@sotoa-ui/dynamic-form 0.0.13 → 0.0.14
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.
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Component, inject, DestroyRef, Injectable, input, forwardRef, ChangeDetectorRef, ViewContainerRef, EnvironmentInjector, EventEmitter, Output, Optional, Host, SkipSelf, Directive, computed, output, ViewChild, model, signal, effect } from '@angular/core';
|
|
3
3
|
import { distinctUntilChanged, isObservable, take, BehaviorSubject, map } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
|
-
import {
|
|
6
|
-
import * as _ from 'lodash-es';
|
|
7
|
-
import { isArray } from 'lodash-es';
|
|
5
|
+
import { Validators, FormBuilder, ReactiveFormsModule, NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
8
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
7
|
import { debounceTime } from 'rxjs/operators';
|
|
10
8
|
import { NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common';
|
|
@@ -28,6 +26,8 @@ import * as i3$2 from '@angular/material/select';
|
|
|
28
26
|
import { MatSelectModule } from '@angular/material/select';
|
|
29
27
|
import * as i2$3 from '@angular/material/slide-toggle';
|
|
30
28
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
29
|
+
import * as _ from 'lodash-es';
|
|
30
|
+
import { isArray } from 'lodash-es';
|
|
31
31
|
import * as i1$2 from '@angular/material/dialog';
|
|
32
32
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
|
33
33
|
import { MatBadge } from '@angular/material/badge';
|
|
@@ -45,12 +45,211 @@ import { DateAdapter } from '@angular/material/core';
|
|
|
45
45
|
import { provideLuxonDateAdapter } from '@angular/material-luxon-adapter';
|
|
46
46
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
47
47
|
import { MatListModule } from '@angular/material/list';
|
|
48
|
-
import { MatTab, MatTabLabel } from '@angular/material/tabs';
|
|
49
48
|
import * as i4$1 from '@angular/material/stepper';
|
|
50
49
|
import { MatStepperModule, MatStepperPrevious, MatStepperNext } from '@angular/material/stepper';
|
|
51
50
|
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
|
|
52
51
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
53
52
|
|
|
53
|
+
class AbstractFieldComponent {
|
|
54
|
+
field;
|
|
55
|
+
group;
|
|
56
|
+
path;
|
|
57
|
+
instancePath;
|
|
58
|
+
data;
|
|
59
|
+
get control() {
|
|
60
|
+
return this.group() && this.field()?.name ? this.group().get(this.field().name) : null;
|
|
61
|
+
}
|
|
62
|
+
get required() {
|
|
63
|
+
return this.group().get(this.field().name)?.hasValidator(Validators.required);
|
|
64
|
+
}
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AbstractFieldComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractFieldComponent, decorators: [{
|
|
69
|
+
type: Component,
|
|
70
|
+
args: [{ standalone: true, template: '' }]
|
|
71
|
+
}] });
|
|
72
|
+
|
|
73
|
+
class AbstractControlFieldComponent extends AbstractFieldComponent {
|
|
74
|
+
destroyRef = inject(DestroyRef);
|
|
75
|
+
uuid;
|
|
76
|
+
ngOnInit() {
|
|
77
|
+
this.uuid = 'sot-field-' + this.field().name + '-' + (Math.random() + 1).toString(36).substring(7);
|
|
78
|
+
if (this.field().onValueChanges) {
|
|
79
|
+
const control = this.group().get(this.field().name);
|
|
80
|
+
if (control) {
|
|
81
|
+
this.field().onValueChanges(control.value, this.group(), this.data, this.instancePath);
|
|
82
|
+
control.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
83
|
+
this.field().onValueChanges(value, this.group(), this.data, this.instancePath);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractControlFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AbstractControlFieldComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractControlFieldComponent, decorators: [{
|
|
92
|
+
type: Component,
|
|
93
|
+
args: [{ standalone: true, template: '' }]
|
|
94
|
+
}] });
|
|
95
|
+
|
|
96
|
+
class AcCustomComponentField {
|
|
97
|
+
field;
|
|
98
|
+
group;
|
|
99
|
+
registerOnChange(fn) {
|
|
100
|
+
}
|
|
101
|
+
registerOnTouched(fn) {
|
|
102
|
+
}
|
|
103
|
+
writeValue(obj) {
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Liste des valeurs possible pour l'attribut autocomplete
|
|
109
|
+
* (https://accessibilite.numerique.gouv.fr/methode/glossaire/#liste-des-valeurs-possibles-pour-l-attribut-autocomplete)
|
|
110
|
+
*/
|
|
111
|
+
var AutocompleteAttribute;
|
|
112
|
+
(function (AutocompleteAttribute) {
|
|
113
|
+
AutocompleteAttribute["Off"] = "off";
|
|
114
|
+
/** Nom complet */
|
|
115
|
+
AutocompleteAttribute["Name"] = "name";
|
|
116
|
+
/** Abréviation, civilité ou titre */
|
|
117
|
+
AutocompleteAttribute["HonorificPrefix"] = "honorific-prefix";
|
|
118
|
+
/** Prénom */
|
|
119
|
+
AutocompleteAttribute["GivenName"] = "given-name";
|
|
120
|
+
/** Prénoms additionnels */
|
|
121
|
+
AutocompleteAttribute["AdditionalName"] = "additional-name";
|
|
122
|
+
/** Nom de famille */
|
|
123
|
+
AutocompleteAttribute["FamilyName"] = "family-name";
|
|
124
|
+
/** Suffixe honorifique */
|
|
125
|
+
AutocompleteAttribute["HonorificSuffix"] = "honorific-suffix";
|
|
126
|
+
/** Surnom, diminutif */
|
|
127
|
+
AutocompleteAttribute["Nickname"] = "nickname";
|
|
128
|
+
/** Fonction, intitulé de poste */
|
|
129
|
+
AutocompleteAttribute["OrganizationTitle"] = "organization-title";
|
|
130
|
+
/** Nom d’utilisateur */
|
|
131
|
+
AutocompleteAttribute["Username"] = "username";
|
|
132
|
+
/**
|
|
133
|
+
* Nouveau mot de passe (par exemple, lors de la création d’un compte
|
|
134
|
+
* ou d’un changement de mot de passe)
|
|
135
|
+
*/
|
|
136
|
+
AutocompleteAttribute["NewPassword"] = "new-password";
|
|
137
|
+
/**
|
|
138
|
+
* Mot de passe actuel pour le compte identifié par le champ username
|
|
139
|
+
* (par exemple, lors d’une connexion)
|
|
140
|
+
*/
|
|
141
|
+
AutocompleteAttribute["CurrentPassword"] = "current-password";
|
|
142
|
+
/**
|
|
143
|
+
* Nom de l’organisation correspondant à la personne, à l’adresse
|
|
144
|
+
* ou à l’information de contact dans les autres champs associés avec ce champ
|
|
145
|
+
*/
|
|
146
|
+
AutocompleteAttribute["Organization"] = "organization";
|
|
147
|
+
/** Adresse postale (multiligne, nouvelles lignes conservées) */
|
|
148
|
+
AutocompleteAttribute["StreetAddress"] = "street-address";
|
|
149
|
+
/** Adresse postale (une ligne par champ, ligne 1) */
|
|
150
|
+
AutocompleteAttribute["AddressLine1"] = "address-line1";
|
|
151
|
+
/** Adresse postale (une ligne par champ, ligne 2) */
|
|
152
|
+
AutocompleteAttribute["AddressLine2"] = "address-line2";
|
|
153
|
+
/** Adresse postale (une ligne par champ, ligne 3) */
|
|
154
|
+
AutocompleteAttribute["AddressLine3"] = "address-line3";
|
|
155
|
+
/** Le niveau administratif le plus détaillé, pour les adresses pourvues de quatre niveaux administratifs */
|
|
156
|
+
AutocompleteAttribute["AddressLevel4"] = "address-level4";
|
|
157
|
+
/** Le troisième niveau administratif, pour les adresses pourvues d’au moins trois niveaux administratifs */
|
|
158
|
+
AutocompleteAttribute["AddressLevel3"] = "address-level3";
|
|
159
|
+
/** Le deuxième niveau administratif, pour les adresses pourvues d’au moins deux niveaux administratifs */
|
|
160
|
+
AutocompleteAttribute["AddressLevel2"] = "address-level2";
|
|
161
|
+
/** Le plus large niveau administratif d’une adresse, c’est-à-dire la province dans laquelle se trouve la localité */
|
|
162
|
+
AutocompleteAttribute["AddressLevel1"] = "address-level1";
|
|
163
|
+
/** Code pays */
|
|
164
|
+
AutocompleteAttribute["Country"] = "country";
|
|
165
|
+
/** Nom de pays */
|
|
166
|
+
AutocompleteAttribute["CountryName"] = "country-name";
|
|
167
|
+
/**
|
|
168
|
+
* Code postal, code CEDEX (si le CEDEX est présent, ajouter “CEDEX”,
|
|
169
|
+
* et ce qui le suit doit être ajouté dans le champ address-level2)
|
|
170
|
+
*/
|
|
171
|
+
AutocompleteAttribute["PostalCode"] = "postal-code";
|
|
172
|
+
/** Nom complet figurant sur le moyen de paiement */
|
|
173
|
+
AutocompleteAttribute["CcName"] = "cc-name";
|
|
174
|
+
/** Prénom figurant sur le moyen de paiement */
|
|
175
|
+
AutocompleteAttribute["CcGivenName"] = "cc-given-name";
|
|
176
|
+
/** Prénoms additionnels figurant sur le moyen de paiement */
|
|
177
|
+
AutocompleteAttribute["CcAdditionalName"] = "cc-additional-name";
|
|
178
|
+
/** Nom de famille figurant sur le moyen de paiement */
|
|
179
|
+
AutocompleteAttribute["CcFamilyName"] = "cc-family-name";
|
|
180
|
+
/** Code identifiant le moyen de paiement (e.g., un numéro de carte bancaire) */
|
|
181
|
+
AutocompleteAttribute["CcNumber"] = "cc-number";
|
|
182
|
+
/** Date d’expiration du moyen de paiement */
|
|
183
|
+
AutocompleteAttribute["CcExp"] = "cc-exp";
|
|
184
|
+
/** Le mois de la date d’expiration du moyen de paiement */
|
|
185
|
+
AutocompleteAttribute["CcExpMonth"] = "cc-exp-month";
|
|
186
|
+
/** L’année de la date d’expiration du moyen de paiement */
|
|
187
|
+
AutocompleteAttribute["CcExpYear"] = "cc-exp-year";
|
|
188
|
+
/**
|
|
189
|
+
* Code de sécurité du moyen de paiement (also known as the card security code (CSC),
|
|
190
|
+
* card validation code (CVC), card verification value (CVV), signature panel code (SPC),
|
|
191
|
+
* credit card ID (CCID), etc.)
|
|
192
|
+
*/
|
|
193
|
+
AutocompleteAttribute["CcCsc"] = "cc-csc";
|
|
194
|
+
/** Type de moyen de paiement (e.g. Visa) */
|
|
195
|
+
AutocompleteAttribute["CcType"] = "cc-type";
|
|
196
|
+
/** La devise qui a la préférence de l’utilisateur lors d’une transaction */
|
|
197
|
+
AutocompleteAttribute["TransactionCurrency"] = "transaction-currency";
|
|
198
|
+
/** Le montant qui a la préférence de l’utilisateur lors d’une transaction (e.g., en réponse à une enchère ou à un prix soldé) */
|
|
199
|
+
AutocompleteAttribute["TransactionAmount"] = "transaction-amount";
|
|
200
|
+
/** Langue préférée */
|
|
201
|
+
AutocompleteAttribute["Language"] = "language";
|
|
202
|
+
/** Date d’anniversaire */
|
|
203
|
+
AutocompleteAttribute["Bday"] = "bday";
|
|
204
|
+
/** Le jour de la date d’anniversaire */
|
|
205
|
+
AutocompleteAttribute["BdayDay"] = "bday-day";
|
|
206
|
+
/** Le mois de la date d’anniversaire */
|
|
207
|
+
AutocompleteAttribute["BdayMonth"] = "bday-month";
|
|
208
|
+
/** L’année de la date d’anniversaire */
|
|
209
|
+
AutocompleteAttribute["BdayYear"] = "bday-year";
|
|
210
|
+
/** Identité de genre */
|
|
211
|
+
AutocompleteAttribute["Sex"] = "sex";
|
|
212
|
+
/**
|
|
213
|
+
* Page d’accueil ou une autre page Web correspondant à l’organisation, la personne,
|
|
214
|
+
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
215
|
+
*/
|
|
216
|
+
AutocompleteAttribute["Url"] = "url";
|
|
217
|
+
/**
|
|
218
|
+
* Photographie, icône ou une autre image correspondant à l’organisation, la personne,
|
|
219
|
+
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
220
|
+
*/
|
|
221
|
+
AutocompleteAttribute["Photo"] = "photo";
|
|
222
|
+
/** Numéro de téléphone complet, y compris le code pays */
|
|
223
|
+
AutocompleteAttribute["Tel"] = "tel";
|
|
224
|
+
/** Code pays du numéro de téléphone */
|
|
225
|
+
AutocompleteAttribute["TelCountryCode"] = "tel-country-code";
|
|
226
|
+
/** Numéro de téléphone sans la partie code pays, avec un préfixe interne au pays, s’il y a lieu */
|
|
227
|
+
AutocompleteAttribute["TelNational"] = "tel-national";
|
|
228
|
+
/** Indicatif régional du numéro de téléphone, avec un préfixe interne au pays, s’il y a lieu */
|
|
229
|
+
AutocompleteAttribute["TelAreaCode"] = "tel-area-code";
|
|
230
|
+
/** Numéro de téléphone sans la partie code pays ni l’indicatif régional */
|
|
231
|
+
AutocompleteAttribute["TelLocal"] = "tel-local";
|
|
232
|
+
/**
|
|
233
|
+
* La première partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
234
|
+
* lorsque ce composant est scindé en deux parties
|
|
235
|
+
*/
|
|
236
|
+
AutocompleteAttribute["TelLocalPrefix"] = "tel-local-prefix";
|
|
237
|
+
/**
|
|
238
|
+
* La seconde partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
239
|
+
* lorsque ce composant est scindé en deux parties
|
|
240
|
+
*/
|
|
241
|
+
AutocompleteAttribute["TelLocalSuffix"] = "tel-local-suffix";
|
|
242
|
+
/** Numéro de téléphone d’un poste interne */
|
|
243
|
+
AutocompleteAttribute["TelExtension"] = "tel-extension";
|
|
244
|
+
/** Adresse électronique */
|
|
245
|
+
AutocompleteAttribute["Email"] = "email";
|
|
246
|
+
/**
|
|
247
|
+
* URL correspondant d’un protocole de messagerie instantanée
|
|
248
|
+
* (par exemple, "aim:goim?screenname=example" ou "xmpp:fred@example.net")
|
|
249
|
+
*/
|
|
250
|
+
AutocompleteAttribute["Impp"] = "impp";
|
|
251
|
+
})(AutocompleteAttribute || (AutocompleteAttribute = {}));
|
|
252
|
+
|
|
54
253
|
var AcLogicOperatorEnum;
|
|
55
254
|
(function (AcLogicOperatorEnum) {
|
|
56
255
|
AcLogicOperatorEnum["OR"] = "OR";
|
|
@@ -355,11 +554,9 @@ class DynamicFormService {
|
|
|
355
554
|
return g;
|
|
356
555
|
}
|
|
357
556
|
createArrayInstance(arrayConfig, arrayPath, instanceNumber, initialValues) {
|
|
358
|
-
const fields =
|
|
557
|
+
const fields = structuredClone(arrayConfig.field.fields);
|
|
359
558
|
const grp = this.createGroup(fields, `${arrayPath}[${instanceNumber}]`, `${arrayPath}[${instanceNumber}]`, initialValues);
|
|
360
|
-
|
|
361
|
-
arrayConfig.instances = [];
|
|
362
|
-
}
|
|
559
|
+
arrayConfig.instances ??= [];
|
|
363
560
|
arrayConfig.instances.push({
|
|
364
561
|
number: instanceNumber,
|
|
365
562
|
group: grp,
|
|
@@ -372,7 +569,7 @@ class DynamicFormService {
|
|
|
372
569
|
arrayConfig.instances = [];
|
|
373
570
|
const list = [];
|
|
374
571
|
let value = arrayConfig.value;
|
|
375
|
-
if (initialValues && Object.keys(initialValues).
|
|
572
|
+
if (initialValues && Object.keys(initialValues).includes(arrayConfig.name)) {
|
|
376
573
|
value = initialValues[arrayConfig.name];
|
|
377
574
|
}
|
|
378
575
|
let i = 0;
|
|
@@ -413,7 +610,7 @@ class DynamicFormService {
|
|
|
413
610
|
}
|
|
414
611
|
createControl(config, initialValues) {
|
|
415
612
|
let { disabled, validations, value } = config;
|
|
416
|
-
if (initialValues && Object.keys(initialValues).
|
|
613
|
+
if (initialValues && Object.keys(initialValues).includes(config.name)) {
|
|
417
614
|
value = initialValues[config.name];
|
|
418
615
|
}
|
|
419
616
|
if (value === undefined) {
|
|
@@ -444,235 +641,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
444
641
|
}]
|
|
445
642
|
}] });
|
|
446
643
|
|
|
447
|
-
class AbstractFieldComponent {
|
|
448
|
-
path;
|
|
449
|
-
field;
|
|
450
|
-
group;
|
|
451
|
-
instancePath;
|
|
452
|
-
dynamicFormService = inject(DynamicFormService);
|
|
453
|
-
get control() {
|
|
454
|
-
return this.group && this.field && this.field.name ? this.group.get(this.field.name) : null;
|
|
455
|
-
}
|
|
456
|
-
get required() {
|
|
457
|
-
return this.group.get(this.field.name)?.hasValidator(Validators.required);
|
|
458
|
-
}
|
|
459
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
460
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AbstractFieldComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
461
|
-
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractFieldComponent, decorators: [{
|
|
463
|
-
type: Component,
|
|
464
|
-
args: [{ standalone: true, template: '' }]
|
|
465
|
-
}] });
|
|
466
|
-
|
|
467
|
-
class AbstractControlFieldComponent extends AbstractFieldComponent {
|
|
468
|
-
destroyRef = inject(DestroyRef);
|
|
469
|
-
uuid;
|
|
470
|
-
ngOnInit() {
|
|
471
|
-
this.uuid = 'sot-field-' + this.field.name + '-' + (Math.random() + 1).toString(36).substring(7);
|
|
472
|
-
if (this.field.onValueChanges) {
|
|
473
|
-
const control = this.group.get(this.field.name);
|
|
474
|
-
if (control) {
|
|
475
|
-
this.field.onValueChanges(control.value, this.dynamicFormService.data, this.group, this.instancePath);
|
|
476
|
-
control.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
477
|
-
this.field.onValueChanges(value, this.dynamicFormService.data, this.group, this.instancePath);
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractControlFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
483
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AbstractControlFieldComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
484
|
-
}
|
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AbstractControlFieldComponent, decorators: [{
|
|
486
|
-
type: Component,
|
|
487
|
-
args: [{ standalone: true, template: '' }]
|
|
488
|
-
}] });
|
|
489
|
-
|
|
490
|
-
class AcCustomComponentField {
|
|
491
|
-
field;
|
|
492
|
-
group;
|
|
493
|
-
registerOnChange(fn) {
|
|
494
|
-
}
|
|
495
|
-
registerOnTouched(fn) {
|
|
496
|
-
}
|
|
497
|
-
writeValue(obj) {
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Liste des valeurs possible pour l'attribut autocomplete
|
|
503
|
-
* (https://accessibilite.numerique.gouv.fr/methode/glossaire/#liste-des-valeurs-possibles-pour-l-attribut-autocomplete)
|
|
504
|
-
*/
|
|
505
|
-
var AutocompleteAttribute;
|
|
506
|
-
(function (AutocompleteAttribute) {
|
|
507
|
-
AutocompleteAttribute["Off"] = "off";
|
|
508
|
-
/** Nom complet */
|
|
509
|
-
AutocompleteAttribute["Name"] = "name";
|
|
510
|
-
/** Abréviation, civilité ou titre */
|
|
511
|
-
AutocompleteAttribute["HonorificPrefix"] = "honorific-prefix";
|
|
512
|
-
/** Prénom */
|
|
513
|
-
AutocompleteAttribute["GivenName"] = "given-name";
|
|
514
|
-
/** Prénoms additionnels */
|
|
515
|
-
AutocompleteAttribute["AdditionalName"] = "additional-name";
|
|
516
|
-
/** Nom de famille */
|
|
517
|
-
AutocompleteAttribute["FamilyName"] = "family-name";
|
|
518
|
-
/** Suffixe honorifique */
|
|
519
|
-
AutocompleteAttribute["HonorificSuffix"] = "honorific-suffix";
|
|
520
|
-
/** Surnom, diminutif */
|
|
521
|
-
AutocompleteAttribute["Nickname"] = "nickname";
|
|
522
|
-
/** Fonction, intitulé de poste */
|
|
523
|
-
AutocompleteAttribute["OrganizationTitle"] = "organization-title";
|
|
524
|
-
/** Nom d’utilisateur */
|
|
525
|
-
AutocompleteAttribute["Username"] = "username";
|
|
526
|
-
/**
|
|
527
|
-
* Nouveau mot de passe (par exemple, lors de la création d’un compte
|
|
528
|
-
* ou d’un changement de mot de passe)
|
|
529
|
-
*/
|
|
530
|
-
AutocompleteAttribute["NewPassword"] = "new-password";
|
|
531
|
-
/**
|
|
532
|
-
* Mot de passe actuel pour le compte identifié par le champ username
|
|
533
|
-
* (par exemple, lors d’une connexion)
|
|
534
|
-
*/
|
|
535
|
-
AutocompleteAttribute["CurrentPassword"] = "current-password";
|
|
536
|
-
/**
|
|
537
|
-
* Nom de l’organisation correspondant à la personne, à l’adresse
|
|
538
|
-
* ou à l’information de contact dans les autres champs associés avec ce champ
|
|
539
|
-
*/
|
|
540
|
-
AutocompleteAttribute["Organization"] = "organization";
|
|
541
|
-
/** Adresse postale (multiligne, nouvelles lignes conservées) */
|
|
542
|
-
AutocompleteAttribute["StreetAddress"] = "street-address";
|
|
543
|
-
/** Adresse postale (une ligne par champ, ligne 1) */
|
|
544
|
-
AutocompleteAttribute["AddressLine1"] = "address-line1";
|
|
545
|
-
/** Adresse postale (une ligne par champ, ligne 2) */
|
|
546
|
-
AutocompleteAttribute["AddressLine2"] = "address-line2";
|
|
547
|
-
/** Adresse postale (une ligne par champ, ligne 3) */
|
|
548
|
-
AutocompleteAttribute["AddressLine3"] = "address-line3";
|
|
549
|
-
/** Le niveau administratif le plus détaillé, pour les adresses pourvues de quatre niveaux administratifs */
|
|
550
|
-
AutocompleteAttribute["AddressLevel4"] = "address-level4";
|
|
551
|
-
/** Le troisième niveau administratif, pour les adresses pourvues d’au moins trois niveaux administratifs */
|
|
552
|
-
AutocompleteAttribute["AddressLevel3"] = "address-level3";
|
|
553
|
-
/** Le deuxième niveau administratif, pour les adresses pourvues d’au moins deux niveaux administratifs */
|
|
554
|
-
AutocompleteAttribute["AddressLevel2"] = "address-level2";
|
|
555
|
-
/** Le plus large niveau administratif d’une adresse, c’est-à-dire la province dans laquelle se trouve la localité */
|
|
556
|
-
AutocompleteAttribute["AddressLevel1"] = "address-level1";
|
|
557
|
-
/** Code pays */
|
|
558
|
-
AutocompleteAttribute["Country"] = "country";
|
|
559
|
-
/** Nom de pays */
|
|
560
|
-
AutocompleteAttribute["CountryName"] = "country-name";
|
|
561
|
-
/**
|
|
562
|
-
* Code postal, code CEDEX (si le CEDEX est présent, ajouter “CEDEX”,
|
|
563
|
-
* et ce qui le suit doit être ajouté dans le champ address-level2)
|
|
564
|
-
*/
|
|
565
|
-
AutocompleteAttribute["PostalCode"] = "postal-code";
|
|
566
|
-
/** Nom complet figurant sur le moyen de paiement */
|
|
567
|
-
AutocompleteAttribute["CcName"] = "cc-name";
|
|
568
|
-
/** Prénom figurant sur le moyen de paiement */
|
|
569
|
-
AutocompleteAttribute["CcGivenName"] = "cc-given-name";
|
|
570
|
-
/** Prénoms additionnels figurant sur le moyen de paiement */
|
|
571
|
-
AutocompleteAttribute["CcAdditionalName"] = "cc-additional-name";
|
|
572
|
-
/** Nom de famille figurant sur le moyen de paiement */
|
|
573
|
-
AutocompleteAttribute["CcFamilyName"] = "cc-family-name";
|
|
574
|
-
/** Code identifiant le moyen de paiement (e.g., un numéro de carte bancaire) */
|
|
575
|
-
AutocompleteAttribute["CcNumber"] = "cc-number";
|
|
576
|
-
/** Date d’expiration du moyen de paiement */
|
|
577
|
-
AutocompleteAttribute["CcExp"] = "cc-exp";
|
|
578
|
-
/** Le mois de la date d’expiration du moyen de paiement */
|
|
579
|
-
AutocompleteAttribute["CcExpMonth"] = "cc-exp-month";
|
|
580
|
-
/** L’année de la date d’expiration du moyen de paiement */
|
|
581
|
-
AutocompleteAttribute["CcExpYear"] = "cc-exp-year";
|
|
582
|
-
/**
|
|
583
|
-
* Code de sécurité du moyen de paiement (also known as the card security code (CSC),
|
|
584
|
-
* card validation code (CVC), card verification value (CVV), signature panel code (SPC),
|
|
585
|
-
* credit card ID (CCID), etc.)
|
|
586
|
-
*/
|
|
587
|
-
AutocompleteAttribute["CcCsc"] = "cc-csc";
|
|
588
|
-
/** Type de moyen de paiement (e.g. Visa) */
|
|
589
|
-
AutocompleteAttribute["CcType"] = "cc-type";
|
|
590
|
-
/** La devise qui a la préférence de l’utilisateur lors d’une transaction */
|
|
591
|
-
AutocompleteAttribute["TransactionCurrency"] = "transaction-currency";
|
|
592
|
-
/** Le montant qui a la préférence de l’utilisateur lors d’une transaction (e.g., en réponse à une enchère ou à un prix soldé) */
|
|
593
|
-
AutocompleteAttribute["TransactionAmount"] = "transaction-amount";
|
|
594
|
-
/** Langue préférée */
|
|
595
|
-
AutocompleteAttribute["Language"] = "language";
|
|
596
|
-
/** Date d’anniversaire */
|
|
597
|
-
AutocompleteAttribute["Bday"] = "bday";
|
|
598
|
-
/** Le jour de la date d’anniversaire */
|
|
599
|
-
AutocompleteAttribute["BdayDay"] = "bday-day";
|
|
600
|
-
/** Le mois de la date d’anniversaire */
|
|
601
|
-
AutocompleteAttribute["BdayMonth"] = "bday-month";
|
|
602
|
-
/** L’année de la date d’anniversaire */
|
|
603
|
-
AutocompleteAttribute["BdayYear"] = "bday-year";
|
|
604
|
-
/** Identité de genre */
|
|
605
|
-
AutocompleteAttribute["Sex"] = "sex";
|
|
606
|
-
/**
|
|
607
|
-
* Page d’accueil ou une autre page Web correspondant à l’organisation, la personne,
|
|
608
|
-
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
609
|
-
*/
|
|
610
|
-
AutocompleteAttribute["Url"] = "url";
|
|
611
|
-
/**
|
|
612
|
-
* Photographie, icône ou une autre image correspondant à l’organisation, la personne,
|
|
613
|
-
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
614
|
-
*/
|
|
615
|
-
AutocompleteAttribute["Photo"] = "photo";
|
|
616
|
-
/** Numéro de téléphone complet, y compris le code pays */
|
|
617
|
-
AutocompleteAttribute["Tel"] = "tel";
|
|
618
|
-
/** Code pays du numéro de téléphone */
|
|
619
|
-
AutocompleteAttribute["TelCountryCode"] = "tel-country-code";
|
|
620
|
-
/** Numéro de téléphone sans la partie code pays, avec un préfixe interne au pays, s’il y a lieu */
|
|
621
|
-
AutocompleteAttribute["TelNational"] = "tel-national";
|
|
622
|
-
/** Indicatif régional du numéro de téléphone, avec un préfixe interne au pays, s’il y a lieu */
|
|
623
|
-
AutocompleteAttribute["TelAreaCode"] = "tel-area-code";
|
|
624
|
-
/** Numéro de téléphone sans la partie code pays ni l’indicatif régional */
|
|
625
|
-
AutocompleteAttribute["TelLocal"] = "tel-local";
|
|
626
|
-
/**
|
|
627
|
-
* La première partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
628
|
-
* lorsque ce composant est scindé en deux parties
|
|
629
|
-
*/
|
|
630
|
-
AutocompleteAttribute["TelLocalPrefix"] = "tel-local-prefix";
|
|
631
|
-
/**
|
|
632
|
-
* La seconde partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
633
|
-
* lorsque ce composant est scindé en deux parties
|
|
634
|
-
*/
|
|
635
|
-
AutocompleteAttribute["TelLocalSuffix"] = "tel-local-suffix";
|
|
636
|
-
/** Numéro de téléphone d’un poste interne */
|
|
637
|
-
AutocompleteAttribute["TelExtension"] = "tel-extension";
|
|
638
|
-
/** Adresse électronique */
|
|
639
|
-
AutocompleteAttribute["Email"] = "email";
|
|
640
|
-
/**
|
|
641
|
-
* URL correspondant d’un protocole de messagerie instantanée
|
|
642
|
-
* (par exemple, "aim:goim?screenname=example" ou "xmpp:fred@example.net")
|
|
643
|
-
*/
|
|
644
|
-
AutocompleteAttribute["Impp"] = "impp";
|
|
645
|
-
})(AutocompleteAttribute || (AutocompleteAttribute = {}));
|
|
646
|
-
|
|
647
644
|
class MatDivTextComponent extends AbstractFieldComponent {
|
|
648
645
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatDivTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
649
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatDivTextComponent, isStandalone: true, selector: "sot-mat-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
646
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatDivTextComponent, isStandalone: true, selector: "sot-mat-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
650
647
|
}
|
|
651
648
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatDivTextComponent, decorators: [{
|
|
652
649
|
type: Component,
|
|
653
|
-
args: [{ selector: 'sot-mat-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n" }]
|
|
650
|
+
args: [{ selector: 'sot-mat-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n" }]
|
|
654
651
|
}] });
|
|
655
652
|
|
|
656
653
|
class AcFieldCheckboxComponent extends AbstractControlFieldComponent {
|
|
657
654
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcFieldCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
658
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AcFieldCheckboxComponent, isStandalone: true, selector: "sot-mat-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div [formGroup]=\"group\">\r\n <mat-checkbox [formControlName]=\"field.name\"\r\n [id]=\"uuid\"\r\n [aria-describedby]=\"'error-' + uuid\"\r\n >\r\n <div [ngClass]=\"field.labelClassName\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </div>\r\n </mat-checkbox>\r\n\r\n <div [attr.id]=\"'error-' + uuid\" class=\"error-wrapper\" matError>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }] });
|
|
655
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AcFieldCheckboxComponent, isStandalone: true, selector: "sot-mat-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div [formGroup]=\"group()\">\r\n <mat-checkbox [formControlName]=\"field().name\"\r\n [id]=\"uuid\"\r\n [aria-describedby]=\"'error-' + uuid\"\r\n >\r\n <div [ngClass]=\"field().labelClassName\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </div>\r\n </mat-checkbox>\r\n\r\n <div [attr.id]=\"'error-' + uuid\" class=\"error-wrapper\" matError>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }] });
|
|
659
656
|
}
|
|
660
657
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcFieldCheckboxComponent, decorators: [{
|
|
661
658
|
type: Component,
|
|
662
|
-
args: [{ selector: 'sot-mat-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatError], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div [formGroup]=\"group\">\r\n <mat-checkbox [formControlName]=\"field.name\"\r\n [id]=\"uuid\"\r\n [aria-describedby]=\"'error-' + uuid\"\r\n >\r\n <div [ngClass]=\"field.labelClassName\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </div>\r\n </mat-checkbox>\r\n\r\n <div [attr.id]=\"'error-' + uuid\" class=\"error-wrapper\" matError>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"] }]
|
|
659
|
+
args: [{ selector: 'sot-mat-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatError], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div [formGroup]=\"group()\">\r\n <mat-checkbox [formControlName]=\"field().name\"\r\n [id]=\"uuid\"\r\n [aria-describedby]=\"'error-' + uuid\"\r\n >\r\n <div [ngClass]=\"field().labelClassName\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </div>\r\n </mat-checkbox>\r\n\r\n <div [attr.id]=\"'error-' + uuid\" class=\"error-wrapper\" matError>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"] }]
|
|
663
660
|
}] });
|
|
664
661
|
|
|
665
662
|
class MatFieldInputComponent extends AbstractControlFieldComponent {
|
|
663
|
+
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
664
|
+
group = input.required(...(ngDevMode ? [{ debugName: "group" }] : []));
|
|
666
665
|
inputType = 'text';
|
|
667
666
|
buttonAction(b) {
|
|
668
|
-
if (b.action
|
|
669
|
-
b.action(this.field, this.group, this.
|
|
667
|
+
if (b.action) {
|
|
668
|
+
b.action(this.field(), this.group(), this.data);
|
|
670
669
|
}
|
|
671
670
|
}
|
|
672
671
|
ngOnInit() {
|
|
673
672
|
super.ngOnInit();
|
|
674
|
-
this.inputType = this.field.inputType ?? 'text';
|
|
675
|
-
const control = this.group.get(this.field.name);
|
|
673
|
+
this.inputType = this.field().inputType ?? 'text';
|
|
674
|
+
const control = this.group().get(this.field().name);
|
|
676
675
|
if (control) {
|
|
677
676
|
control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
678
677
|
if (value?.length == 0) {
|
|
@@ -682,19 +681,19 @@ class MatFieldInputComponent extends AbstractControlFieldComponent {
|
|
|
682
681
|
}
|
|
683
682
|
}
|
|
684
683
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
685
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldInputComponent, isStandalone: true, selector: "sot-mat-field-input", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 100000000\"\r\n >\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldInputComponent, isStandalone: true, selector: "sot-mat-field-input", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 100000000\"\r\n >\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
686
685
|
}
|
|
687
686
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldInputComponent, decorators: [{
|
|
688
687
|
type: Component,
|
|
689
|
-
args: [{ selector: 'sot-mat-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 100000000\"\r\n >\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
690
|
-
}] });
|
|
688
|
+
args: [{ selector: 'sot-mat-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 100000000\"\r\n >\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
689
|
+
}], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }] } });
|
|
691
690
|
|
|
692
691
|
class MatGroupComponent extends AbstractControlFieldComponent {
|
|
693
692
|
get subGroup() {
|
|
694
|
-
return this.group.controls[this.field.name];
|
|
693
|
+
return this.group().controls[this.field().name];
|
|
695
694
|
}
|
|
696
695
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
697
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatGroupComponent, isStandalone: true, selector: "sot-mat-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset class=\"sot-formfield\">\n @if (field.accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field.opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-group-label\">{{ field.label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => AcDynamicFieldDirective), selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => MatAccordion), selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i0.forwardRef(() => MatExpansionPanel), selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i0.forwardRef(() => MatExpansionPanelHeader), selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i0.forwardRef(() => MatExpansionPanelTitle), selector: "mat-panel-title" }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
696
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatGroupComponent, isStandalone: true, selector: "sot-mat-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset class=\"sot-formfield\">\n @if (field().accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field().opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-group-label\">{{ field().label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n [data]=\"data\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => AcDynamicFieldDirective), selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => MatAccordion), selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i0.forwardRef(() => MatExpansionPanel), selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i0.forwardRef(() => MatExpansionPanelHeader), selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i0.forwardRef(() => MatExpansionPanelTitle), selector: "mat-panel-title" }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
698
697
|
}
|
|
699
698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatGroupComponent, decorators: [{
|
|
700
699
|
type: Component,
|
|
@@ -706,26 +705,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
706
705
|
MatExpansionPanelHeader,
|
|
707
706
|
MatExpansionPanelTitle,
|
|
708
707
|
NgTemplateOutlet
|
|
709
|
-
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset class=\"sot-formfield\">\n @if (field.accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field.opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-group-label\">{{ field.label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
708
|
+
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset class=\"sot-formfield\">\n @if (field().accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field().opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-group-label\">{{ field().label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n [data]=\"data\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
710
709
|
}] });
|
|
711
710
|
|
|
712
711
|
class MatArrayComponent extends AbstractControlFieldComponent {
|
|
713
712
|
dynamicService = inject(DynamicFormService);
|
|
714
713
|
ref = inject(ChangeDetectorRef);
|
|
715
714
|
get array() {
|
|
716
|
-
return this.group.controls[this.field.name];
|
|
715
|
+
return this.group().controls[this.field().name];
|
|
717
716
|
}
|
|
718
717
|
constructor() {
|
|
719
718
|
super();
|
|
720
719
|
}
|
|
721
720
|
addItem() {
|
|
722
|
-
if (!this.field.instances) {
|
|
723
|
-
this.field.instances = [];
|
|
721
|
+
if (!this.field().instances) {
|
|
722
|
+
this.field().instances = [];
|
|
724
723
|
}
|
|
725
|
-
const i = this.field.instances.length > 0 ? this.field.instances[this.field.instances.length - 1].number + 1 : 0;
|
|
726
|
-
const fields =
|
|
724
|
+
const i = this.field().instances.length > 0 ? this.field().instances[this.field().instances.length - 1].number + 1 : 0;
|
|
725
|
+
const fields = structuredClone(this.field().field.fields);
|
|
727
726
|
const grp = this.dynamicService.createGroup(fields, `${this.path}[${i}]`, null, null);
|
|
728
|
-
this.field.instances.push({
|
|
727
|
+
this.field().instances.push({
|
|
729
728
|
number: i,
|
|
730
729
|
group: grp,
|
|
731
730
|
fields
|
|
@@ -734,10 +733,10 @@ class MatArrayComponent extends AbstractControlFieldComponent {
|
|
|
734
733
|
this.ref.detectChanges();
|
|
735
734
|
}
|
|
736
735
|
deleteItem(index, inst) {
|
|
737
|
-
this.field.instances.splice(index, 1);
|
|
736
|
+
this.field().instances.splice(index, 1);
|
|
738
737
|
for (const key of this.dynamicService.data.pathFieldMap.keys()) {
|
|
739
738
|
if (key.startsWith(`${this.path}[${inst.number}]`)) {
|
|
740
|
-
this.
|
|
739
|
+
this.data?.pathFieldMap.delete(key);
|
|
741
740
|
}
|
|
742
741
|
}
|
|
743
742
|
;
|
|
@@ -745,7 +744,7 @@ class MatArrayComponent extends AbstractControlFieldComponent {
|
|
|
745
744
|
this.ref.detectChanges();
|
|
746
745
|
}
|
|
747
746
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatArrayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
748
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatArrayComponent, isStandalone: true, selector: "sot-mat-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset class=\"sot-formfield-wrapper sot-fieldset\">\n @if (field.accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field.opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-array-label\">{{ field.label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n } @else {\n <legend class=\"sot-formfield-array-label\">{{ field.label }}</legend>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div class=\"sot-formfield-array-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\" mat-raised-button (click)=\"deleteItem(i, inst)\">\n @if (field.deleteButton && field.deleteButton
|
|
747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatArrayComponent, isStandalone: true, selector: "sot-mat-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset class=\"sot-formfield-wrapper sot-fieldset\">\n @if (field().accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field().opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-array-label\">{{ field().label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n } @else {\n <legend class=\"sot-formfield-array-label\">{{ field().label }}</legend>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div class=\"sot-formfield-array-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n [data]=\"data\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\" mat-raised-button (click)=\"deleteItem(i, inst)\">\n @if (field().deleteButton && field().deleteButton!.matIcon) {\n <mat-icon [title]=\"field().deleteButton!.title ? field().deleteButton!.title : ''\">\n {{ field().deleteButton!.matIcon }}\n </mat-icon>\n }\n {{ field().deleteButton ? field().deleteButton!.label : 'Supprimer' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button mat-raised-button\n type=\"button\"\n (click)=\"addItem()\"\n >\n @if (field().addButton && field().addButton!.matIcon) {\n <mat-icon [title]=\"field().addButton!.title ? field().addButton!.title : ''\">\n {{ field().addButton!.matIcon }}\n </mat-icon>\n }\n {{ field().addButton ? field().addButton!.label : 'Ajouter' }}\n </button>\n </div>\n }\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (array && !array.untouched && array.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => AcDynamicFieldDirective), selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatExpansionModule) }, { kind: "directive", type: i0.forwardRef(() => i1$1.MatAccordion), selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i0.forwardRef(() => i1$1.MatExpansionPanel), selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i0.forwardRef(() => i1$1.MatExpansionPanelHeader), selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i0.forwardRef(() => i1$1.MatExpansionPanelTitle), selector: "mat-panel-title" }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i0.forwardRef(() => MatIcon), selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i0.forwardRef(() => MatButton), selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatCardModule) }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormArrayName), selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i0.forwardRef(() => MatError), selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
749
748
|
}
|
|
750
749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatArrayComponent, decorators: [{
|
|
751
750
|
type: Component,
|
|
@@ -759,12 +758,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
759
758
|
ReactiveFormsModule,
|
|
760
759
|
MatError,
|
|
761
760
|
NgTemplateOutlet
|
|
762
|
-
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset class=\"sot-formfield-wrapper sot-fieldset\">\n @if (field.accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field.opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-array-label\">{{ field.label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n } @else {\n <legend class=\"sot-formfield-array-label\">{{ field.label }}</legend>\n @if (field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n <div class=\"sot-formfield-array-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\" mat-raised-button (click)=\"deleteItem(i, inst)\">\n @if (field.deleteButton && field.deleteButton
|
|
761
|
+
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset class=\"sot-formfield-wrapper sot-fieldset\">\n @if (field().accordion) {\n <mat-accordion class=\"sot-formfield-array-accordion\" multi>\n <mat-expansion-panel [expanded]=\"field().opened\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend class=\"sot-formfield-array-label\">{{ field().label }}</legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </mat-expansion-panel>\n </mat-accordion>\n } @else {\n <legend class=\"sot-formfield-array-label\">{{ field().label }}</legend>\n @if (field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n <div class=\"sot-formfield-array-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container matDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n [data]=\"data\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\" mat-raised-button (click)=\"deleteItem(i, inst)\">\n @if (field().deleteButton && field().deleteButton!.matIcon) {\n <mat-icon [title]=\"field().deleteButton!.title ? field().deleteButton!.title : ''\">\n {{ field().deleteButton!.matIcon }}\n </mat-icon>\n }\n {{ field().deleteButton ? field().deleteButton!.label : 'Supprimer' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button mat-raised-button\n type=\"button\"\n (click)=\"addItem()\"\n >\n @if (field().addButton && field().addButton!.matIcon) {\n <mat-icon [title]=\"field().addButton!.title ? field().addButton!.title : ''\">\n {{ field().addButton!.matIcon }}\n </mat-icon>\n }\n {{ field().addButton ? field().addButton!.label : 'Ajouter' }}\n </button>\n </div>\n }\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (array && !array.untouched && array.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"] }]
|
|
763
762
|
}], ctorParameters: () => [] });
|
|
764
763
|
|
|
765
764
|
class MatRowComponent extends AbstractFieldComponent {
|
|
766
765
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
767
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatRowComponent, isStandalone: true, selector: "sot-mat-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n matDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => AcDynamicFieldDirective), selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }] });
|
|
766
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatRowComponent, isStandalone: true, selector: "sot-mat-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n matDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => AcDynamicFieldDirective), selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }] });
|
|
768
767
|
}
|
|
769
768
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatRowComponent, decorators: [{
|
|
770
769
|
type: Component,
|
|
@@ -773,7 +772,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
773
772
|
NgClass,
|
|
774
773
|
forwardRef(() => AcDynamicFieldDirective),
|
|
775
774
|
AcDynamicFieldDirective
|
|
776
|
-
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n matDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
775
|
+
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n matDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
777
776
|
}] });
|
|
778
777
|
|
|
779
778
|
let PasswordValidators$2 = class PasswordValidators {
|
|
@@ -795,16 +794,16 @@ class MatFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
795
794
|
iconErrorLabel;
|
|
796
795
|
iconSuccessLabel;
|
|
797
796
|
buttonAction(b) {
|
|
798
|
-
if (b.action
|
|
799
|
-
b.action(this.field, this.group, this.
|
|
797
|
+
if (b.action) {
|
|
798
|
+
b.action(this.field(), this.group(), this.data);
|
|
800
799
|
}
|
|
801
800
|
}
|
|
802
801
|
ngOnInit() {
|
|
803
802
|
super.ngOnInit();
|
|
804
|
-
this.showPasswordLabel = this.field.labels?.showPassword ?? "Show password";
|
|
805
|
-
this.hidePasswordLabel = this.field.labels?.hidePassword ?? "Hide password";
|
|
806
|
-
this.iconSuccessLabel = this.field.labels?.iconSuccess ?? "Success";
|
|
807
|
-
this.iconErrorLabel = this.field.labels?.iconError ?? "Error";
|
|
803
|
+
this.showPasswordLabel = this.field().labels?.showPassword ?? "Show password";
|
|
804
|
+
this.hidePasswordLabel = this.field().labels?.hidePassword ?? "Hide password";
|
|
805
|
+
this.iconSuccessLabel = this.field().labels?.iconSuccess ?? "Success";
|
|
806
|
+
this.iconErrorLabel = this.field().labels?.iconError ?? "Error";
|
|
808
807
|
if (this.control) {
|
|
809
808
|
this.control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
810
809
|
if (value?.length == 0) {
|
|
@@ -836,29 +835,29 @@ class MatFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
836
835
|
return this.control.value && !this.control.hasError("requiresSpecialChars");
|
|
837
836
|
}
|
|
838
837
|
setPasswordValidators() {
|
|
839
|
-
if (this.field.minlength) {
|
|
840
|
-
this.control?.addValidators(Validators.minLength(this.field.minlength));
|
|
838
|
+
if (this.field().minlength) {
|
|
839
|
+
this.control?.addValidators(Validators.minLength(this.field().minlength));
|
|
841
840
|
}
|
|
842
|
-
if (this.field.maxlength) {
|
|
843
|
-
this.control?.addValidators(Validators.maxLength(this.field.maxlength));
|
|
841
|
+
if (this.field().maxlength) {
|
|
842
|
+
this.control?.addValidators(Validators.maxLength(this.field().maxlength));
|
|
844
843
|
}
|
|
845
|
-
if (this.field.requiresDigit) {
|
|
844
|
+
if (this.field().requiresDigit) {
|
|
846
845
|
this.control?.addValidators(PasswordValidators$2.patternValidator(/(?=.*[0-9])/, {
|
|
847
846
|
requiresDigit: true
|
|
848
847
|
}));
|
|
849
848
|
}
|
|
850
|
-
if (this.field.requiresUppercase) {
|
|
849
|
+
if (this.field().requiresUppercase) {
|
|
851
850
|
this.control?.addValidators(PasswordValidators$2.patternValidator(/(?=.*[A-Z])/, {
|
|
852
851
|
requiresUppercase: true
|
|
853
852
|
}));
|
|
854
853
|
}
|
|
855
|
-
if (this.field.requiresLowercase) {
|
|
854
|
+
if (this.field().requiresLowercase) {
|
|
856
855
|
this.control?.addValidators(PasswordValidators$2.patternValidator(/(?=.*[a-z])/, {
|
|
857
856
|
requiresLowercase: true
|
|
858
857
|
}));
|
|
859
858
|
}
|
|
860
|
-
if (this.field.requiresSpecialChars) {
|
|
861
|
-
const chars = this.field.specialChars?.join("") ?? "$@^!%*?&";
|
|
859
|
+
if (this.field().requiresSpecialChars) {
|
|
860
|
+
const chars = this.field().specialChars?.join("") ?? "$@^!%*?&";
|
|
862
861
|
const regex = "(?=.*[" + chars + "])";
|
|
863
862
|
this.control?.addValidators(PasswordValidators$2.patternValidator(new RegExp(regex), {
|
|
864
863
|
requiresSpecialChars: true
|
|
@@ -866,69 +865,70 @@ class MatFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
866
865
|
}
|
|
867
866
|
}
|
|
868
867
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldPasswordComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
869
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldPasswordComponent, isStandalone: true, selector: "sot-mat-field-password", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-password\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [aria-describedby]=\"uuid + '-description'\"\r\n >\r\n <button type=\"button\" matIconButton matSuffix (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n <mat-icon>{{ inputType === 'password' ? 'visibility_off' : 'visibility' }}</mat-icon>\r\n </button>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-password mat-form-field{width:100%}.sot-formfield-password mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
868
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldPasswordComponent, isStandalone: true, selector: "sot-mat-field-password", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-password\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [aria-describedby]=\"uuid + '-description'\"\r\n >\r\n <button type=\"button\" matIconButton matSuffix (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n <mat-icon>{{ inputType === 'password' ? 'visibility_off' : 'visibility' }}</mat-icon>\r\n </button>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-password mat-form-field{width:100%}.sot-formfield-password mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
870
869
|
}
|
|
871
870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldPasswordComponent, decorators: [{
|
|
872
871
|
type: Component,
|
|
873
|
-
args: [{ selector: 'sot-mat-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule, MatIconButton], template: "<div\r\n class=\"sot-formfield sot-formfield-password\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [aria-describedby]=\"uuid + '-description'\"\r\n >\r\n <button type=\"button\" matIconButton matSuffix (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n <mat-icon>{{ inputType === 'password' ? 'visibility_off' : 'visibility' }}</mat-icon>\r\n </button>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-password mat-form-field{width:100%}.sot-formfield-password mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"] }]
|
|
872
|
+
args: [{ selector: 'sot-mat-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule, MatIconButton], template: "<div\r\n class=\"sot-formfield sot-formfield-password\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <input matInput\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [aria-describedby]=\"uuid + '-description'\"\r\n >\r\n <button type=\"button\" matIconButton matSuffix (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n <mat-icon>{{ inputType === 'password' ? 'visibility_off' : 'visibility' }}</mat-icon>\r\n </button>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{prefix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{suffix.label}}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-password mat-form-field{width:100%}.sot-formfield-password mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"] }]
|
|
874
873
|
}] });
|
|
875
874
|
|
|
876
875
|
class MatFieldRadioButtonComponent extends AbstractControlFieldComponent {
|
|
877
876
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldRadioButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
878
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldRadioButtonComponent, isStandalone: true, selector: "sot-mat-field-radio-button", usesInheritance: true, ngImport: i0, template: "<fieldset\r\n class=\"sot-formfield sot-formfield-radiobutton\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <legend [attr.id]=\"'radiobutton-'+uuid\" class=\"sot-formfield-radiobutton-label\">\r\n {{ field.label }} {{ !!required ? '*' : '' }}\r\n @if (field.description) {\r\n <span class=\"radiobutton-description\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n <mat-radio-group class=\"sot-formfield-radiobutton-content\"\r\n [id]=\"uuid\"\r\n [attr.aria-labelledby]=\"'radiobutton-'+uuid\"\r\n [formControlName]=\"field.name\"\r\n [ngClass]=\"{'verticalAlign': field.verticalAlign, 'horizontalAlign': !field.verticalAlign}\"\r\n >\r\n @if (field.options) {\r\n @for (item of field.options; track item) {\r\n <mat-radio-button\r\n class=\"sot-formfield-radiobutton-item\"\r\n [ngClass]=\"field.radioButtonClassName\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n <span class=\"item-label\">{{ field.labelKey ? item[field.labelKey!] : item }}</span>\r\n @if (field.descriptionKey) {\r\n <span class=\"item-description\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </mat-radio-button>\r\n }\r\n }\r\n </mat-radio-group>\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n</fieldset>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i2$2.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i2$2.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatIconModule }] });
|
|
877
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldRadioButtonComponent, isStandalone: true, selector: "sot-mat-field-radio-button", usesInheritance: true, ngImport: i0, template: "<fieldset\r\n class=\"sot-formfield sot-formfield-radiobutton\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <legend [attr.id]=\"'radiobutton-'+uuid\" class=\"sot-formfield-radiobutton-label\">\r\n {{ field().label }} {{ !!required ? '*' : '' }}\r\n @if (field().description) {\r\n <span class=\"radiobutton-description\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n <mat-radio-group class=\"sot-formfield-radiobutton-content\"\r\n [id]=\"uuid\"\r\n [attr.aria-labelledby]=\"'radiobutton-'+uuid\"\r\n [formControlName]=\"field().name\"\r\n [ngClass]=\"{'verticalAlign': field().verticalAlign, 'horizontalAlign': !field().verticalAlign}\"\r\n >\r\n @if (field().options) {\r\n @for (item of field().options; track item) {\r\n <mat-radio-button\r\n class=\"sot-formfield-radiobutton-item\"\r\n [ngClass]=\"field().radioButtonClassName\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n <span class=\"item-label\">{{ field().labelKey ? item[field().labelKey!] : item }}</span>\r\n @if (field().descriptionKey) {\r\n <span class=\"item-description\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </mat-radio-button>\r\n }\r\n }\r\n </mat-radio-group>\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n</fieldset>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i2$2.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i2$2.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatIconModule }] });
|
|
879
878
|
}
|
|
880
879
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldRadioButtonComponent, decorators: [{
|
|
881
880
|
type: Component,
|
|
882
|
-
args: [{ selector: 'sot-mat-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass, MatRadioModule, MatError, MatTooltipModule, MatIconModule], template: "<fieldset\r\n class=\"sot-formfield sot-formfield-radiobutton\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <legend [attr.id]=\"'radiobutton-'+uuid\" class=\"sot-formfield-radiobutton-label\">\r\n {{ field.label }} {{ !!required ? '*' : '' }}\r\n @if (field.description) {\r\n <span class=\"radiobutton-description\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n <mat-radio-group class=\"sot-formfield-radiobutton-content\"\r\n [id]=\"uuid\"\r\n [attr.aria-labelledby]=\"'radiobutton-'+uuid\"\r\n [formControlName]=\"field.name\"\r\n [ngClass]=\"{'verticalAlign': field.verticalAlign, 'horizontalAlign': !field.verticalAlign}\"\r\n >\r\n @if (field.options) {\r\n @for (item of field.options; track item) {\r\n <mat-radio-button\r\n class=\"sot-formfield-radiobutton-item\"\r\n [ngClass]=\"field.radioButtonClassName\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n <span class=\"item-label\">{{ field.labelKey ? item[field.labelKey!] : item }}</span>\r\n @if (field.descriptionKey) {\r\n <span class=\"item-description\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </mat-radio-button>\r\n }\r\n }\r\n </mat-radio-group>\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n</fieldset>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
881
|
+
args: [{ selector: 'sot-mat-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass, MatRadioModule, MatError, MatTooltipModule, MatIconModule], template: "<fieldset\r\n class=\"sot-formfield sot-formfield-radiobutton\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <legend [attr.id]=\"'radiobutton-'+uuid\" class=\"sot-formfield-radiobutton-label\">\r\n {{ field().label }} {{ !!required ? '*' : '' }}\r\n @if (field().description) {\r\n <span class=\"radiobutton-description\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n <mat-radio-group class=\"sot-formfield-radiobutton-content\"\r\n [id]=\"uuid\"\r\n [attr.aria-labelledby]=\"'radiobutton-'+uuid\"\r\n [formControlName]=\"field().name\"\r\n [ngClass]=\"{'verticalAlign': field().verticalAlign, 'horizontalAlign': !field().verticalAlign}\"\r\n >\r\n @if (field().options) {\r\n @for (item of field().options; track item) {\r\n <mat-radio-button\r\n class=\"sot-formfield-radiobutton-item\"\r\n [ngClass]=\"field().radioButtonClassName\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n <span class=\"item-label\">{{ field().labelKey ? item[field().labelKey!] : item }}</span>\r\n @if (field().descriptionKey) {\r\n <span class=\"item-description\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </mat-radio-button>\r\n }\r\n }\r\n </mat-radio-group>\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n</fieldset>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
883
882
|
}] });
|
|
884
883
|
|
|
885
884
|
class MatFieldSelectComponent extends AbstractControlFieldComponent {
|
|
886
885
|
options = [];
|
|
887
886
|
ngOnInit() {
|
|
888
887
|
super.ngOnInit();
|
|
889
|
-
|
|
890
|
-
|
|
888
|
+
const options = this.field().options;
|
|
889
|
+
if (isObservable(options)) {
|
|
890
|
+
options.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((options) => {
|
|
891
891
|
this.options = options;
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
894
|
else {
|
|
895
|
-
this.options =
|
|
895
|
+
this.options = options;
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
buttonAction(b) {
|
|
899
|
-
if (b.action
|
|
900
|
-
b.action(this.field, this.group, this.
|
|
899
|
+
if (b.action) {
|
|
900
|
+
b.action(this.field(), this.group(), this.data);
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
904
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldSelectComponent, isStandalone: true, selector: "sot-mat-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\">\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <mat-select\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [multiple]=\"field.multiple\"\r\n panelClass=\"sot-formfield-select-panel\">\r\n @if (field.resetOption) {\r\n <mat-option [value]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </mat-option>\r\n }\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <mat-optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <mat-option [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n </mat-optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <mat-option [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n }\r\n </mat-select>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n <mat-error>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </mat-error>\r\n </mat-form-field>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3$2.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }] });
|
|
904
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldSelectComponent, isStandalone: true, selector: "sot-mat-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\">\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <mat-select\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [multiple]=\"field().multiple\"\r\n panelClass=\"sot-formfield-select-panel\">\r\n @if (field().resetOption) {\r\n <mat-option [value]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </mat-option>\r\n }\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <mat-optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <mat-option [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n </mat-optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <mat-option [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n }\r\n </mat-select>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n <mat-error>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </mat-error>\r\n </mat-form-field>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3$2.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }] });
|
|
905
905
|
}
|
|
906
906
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldSelectComponent, decorators: [{
|
|
907
907
|
type: Component,
|
|
908
|
-
args: [{ selector: 'sot-mat-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatSelectModule], template: "<div class=\"sot-formfield sot-formfield-select\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\">\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n <mat-select\r\n [id]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [multiple]=\"field.multiple\"\r\n panelClass=\"sot-formfield-select-panel\">\r\n @if (field.resetOption) {\r\n <mat-option [value]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </mat-option>\r\n }\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <mat-optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <mat-option [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n </mat-optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <mat-option [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n }\r\n </mat-select>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n <mat-error>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </mat-error>\r\n </mat-form-field>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"] }]
|
|
908
|
+
args: [{ selector: 'sot-mat-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatSelectModule], template: "<div class=\"sot-formfield sot-formfield-select\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\">\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n <mat-select\r\n [id]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [multiple]=\"field().multiple\"\r\n panelClass=\"sot-formfield-select-panel\">\r\n @if (field().resetOption) {\r\n <mat-option [value]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </mat-option>\r\n }\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <mat-optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <mat-option [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n </mat-optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <mat-option [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </mat-option>\r\n }\r\n }\r\n }\r\n </mat-select>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n <mat-error>\r\n @if (control && !control.untouched && control.invalid) {\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n }\r\n </mat-error>\r\n </mat-form-field>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"] }]
|
|
909
909
|
}] });
|
|
910
910
|
|
|
911
911
|
class MatFieldTextareaComponent extends AbstractControlFieldComponent {
|
|
912
912
|
buttonAction(b) {
|
|
913
|
-
if (b.action
|
|
914
|
-
b.action(this.field, this.group, this.
|
|
913
|
+
if (b.action) {
|
|
914
|
+
b.action(this.field(), this.group(), this.data);
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
918
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldTextareaComponent, isStandalone: true, selector: "sot-mat-field-textarea", usesInheritance: true, ngImport: i0, template: "<div\n class=\"sot-formfield sot-formfield-textarea\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\"\n>\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\n <textarea matInput\n [id]=\"uuid\"\n [formControlName]=\"field.name\"\n [readonly]=\"field.readonly\"\n [required]=\"!!required\"\n [rows]=\"field.rows\"\n ></textarea>\n\n @for (b of field.prefixes; track b) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @for (b of field.suffixes; track b) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @if (field.description) {\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\n }\n\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field.validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
918
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldTextareaComponent, isStandalone: true, selector: "sot-mat-field-textarea", usesInheritance: true, ngImport: i0, template: "<div\n class=\"sot-formfield sot-formfield-textarea\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\"\n>\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\n <textarea matInput\n [id]=\"uuid\"\n [formControlName]=\"field().name\"\n [readonly]=\"field().readonly\"\n [required]=\"!!required\"\n [rows]=\"field().rows\"\n ></textarea>\n\n @for (b of field().prefixes; track b) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @for (b of field().suffixes; track b) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @if (field().description) {\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\n }\n\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
919
919
|
}
|
|
920
920
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldTextareaComponent, decorators: [{
|
|
921
921
|
type: Component,
|
|
922
|
-
args: [{ selector: 'sot-mat-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatInputModule, MatButtonModule], template: "<div\n class=\"sot-formfield sot-formfield-textarea\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\"\n>\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\n <textarea matInput\n [id]=\"uuid\"\n [formControlName]=\"field.name\"\n [readonly]=\"field.readonly\"\n [required]=\"!!required\"\n [rows]=\"field.rows\"\n ></textarea>\n\n @for (b of field.prefixes; track b) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @for (b of field.suffixes; track b) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @if (field.description) {\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\n }\n\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field.validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"] }]
|
|
922
|
+
args: [{ selector: 'sot-mat-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatInputModule, MatButtonModule], template: "<div\n class=\"sot-formfield sot-formfield-textarea\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\"\n>\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\n <textarea matInput\n [id]=\"uuid\"\n [formControlName]=\"field().name\"\n [readonly]=\"field().readonly\"\n [required]=\"!!required\"\n [rows]=\"field().rows\"\n ></textarea>\n\n @for (b of field().prefixes; track b) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @for (b of field().suffixes; track b) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (b.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"b.actionAriaLabel\"\n (click)=\"buttonAction(b)\"\n >{{b.label}}</button>\n } @else {\n <span [innerHTML]=\"b.label\"></span>\n }\n </span>\n }\n @if (field().description) {\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\n }\n\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"] }]
|
|
923
923
|
}] });
|
|
924
924
|
|
|
925
925
|
class MatFieldToggleComponent extends AbstractControlFieldComponent {
|
|
926
926
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldToggleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
927
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldToggleComponent, isStandalone: true, selector: "sot-mat-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toggle\" [ngClass]=\"field.className\">\r\n <div [formGroup]=\"group\">\r\n <mat-slide-toggle\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'toggle-' + field.name\"\r\n [labelPosition]=\"field.labelPosition ?? 'after'\"\r\n >\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </mat-slide-toggle>\r\n\r\n <div class=\"messages-group\" [attr.id]=\"'toggle-' + field.name + '-error'\" aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p>{{ validation.message }}</p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }] });
|
|
927
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldToggleComponent, isStandalone: true, selector: "sot-mat-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toggle\" [ngClass]=\"field().className\">\r\n <div [formGroup]=\"group()\">\r\n <mat-slide-toggle\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'toggle-' + field().name\"\r\n [labelPosition]=\"field().labelPosition ?? 'after'\"\r\n >\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </mat-slide-toggle>\r\n\r\n <div class=\"messages-group\" [attr.id]=\"'toggle-' + field().name + '-error'\" aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p>{{ validation.message }}</p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }] });
|
|
928
928
|
}
|
|
929
929
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldToggleComponent, decorators: [{
|
|
930
930
|
type: Component,
|
|
931
|
-
args: [{ selector: 'sot-mat-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatSlideToggleModule], template: "<div class=\"sot-formfield sot-formfield-toggle\" [ngClass]=\"field.className\">\r\n <div [formGroup]=\"group\">\r\n <mat-slide-toggle\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'toggle-' + field.name\"\r\n [labelPosition]=\"field.labelPosition ?? 'after'\"\r\n >\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </mat-slide-toggle>\r\n\r\n <div class=\"messages-group\" [attr.id]=\"'toggle-' + field.name + '-error'\" aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p>{{ validation.message }}</p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
931
|
+
args: [{ selector: 'sot-mat-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatSlideToggleModule], template: "<div class=\"sot-formfield sot-formfield-toggle\" [ngClass]=\"field().className\">\r\n <div [formGroup]=\"group()\">\r\n <mat-slide-toggle\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'toggle-' + field().name\"\r\n [labelPosition]=\"field().labelPosition ?? 'after'\"\r\n >\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </mat-slide-toggle>\r\n\r\n <div class=\"messages-group\" [attr.id]=\"'toggle-' + field().name + '-error'\" aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p>{{ validation.message }}</p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
932
932
|
}] });
|
|
933
933
|
|
|
934
934
|
class AcFieldCustomDirective extends NgControl {
|
|
@@ -1016,11 +1016,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1016
1016
|
|
|
1017
1017
|
class MatFieldCustomComponent extends AbstractControlFieldComponent {
|
|
1018
1018
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldCustomComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1019
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: MatFieldCustomComponent, isStandalone: true, selector: "ac-mat-field-custom", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-form-field ac-form-field-custom\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\" >\n <ng-container fieldCustom [field]=\"field\" [group]=\"group\" > </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: AcFieldCustomDirective, selector: "[fieldCustom]", inputs: ["field", "group"], outputs: ["ngModelChange"] }] });
|
|
1019
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: MatFieldCustomComponent, isStandalone: true, selector: "ac-mat-field-custom", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-form-field ac-form-field-custom\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\" >\n <ng-container fieldCustom [field]=\"field()\" [group]=\"group()\" > </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: AcFieldCustomDirective, selector: "[fieldCustom]", inputs: ["field", "group"], outputs: ["ngModelChange"] }] });
|
|
1020
1020
|
}
|
|
1021
1021
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldCustomComponent, decorators: [{
|
|
1022
1022
|
type: Component,
|
|
1023
|
-
args: [{ selector: "ac-mat-field-custom", standalone: true, imports: [ReactiveFormsModule, NgClass, AcFieldCustomDirective], template: "<div class=\"ac-form-field ac-form-field-custom\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\" >\n <ng-container fieldCustom [field]=\"field\" [group]=\"group\" > </ng-container>\n</div>\n" }]
|
|
1023
|
+
args: [{ selector: "ac-mat-field-custom", standalone: true, imports: [ReactiveFormsModule, NgClass, AcFieldCustomDirective], template: "<div class=\"ac-form-field ac-form-field-custom\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\" >\n <ng-container fieldCustom [field]=\"field()\" [group]=\"group()\" > </ng-container>\n</div>\n" }]
|
|
1024
1024
|
}] });
|
|
1025
1025
|
|
|
1026
1026
|
class ConfirmDialogComponent {
|
|
@@ -1212,7 +1212,7 @@ class MatInputFileComponent {
|
|
|
1212
1212
|
multi: true,
|
|
1213
1213
|
useExisting: forwardRef(() => MatInputFileComponent),
|
|
1214
1214
|
},
|
|
1215
|
-
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"sot-file-wrapper\">\n <label [ngClass]=\"field()
|
|
1215
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"sot-file-wrapper\">\n <label [ngClass]=\"field().labelClassName\"\n [for]=\"'file-upload-' + field().id\">{{ field().label }}</label>\n <div class=\"sot-file-list\">\n @if (field().multiple) {\n <ul>\n @for (item of fileList; track item) {\n <li class=\"file-list-item\">\n <div>\n <div>\n @if (item.srcUrl) {\n <img [src]=\"item.srcUrl\" [alt]=\"item!.file.name\"/>\n } @else {\n {{ item.file.name }}\n }\n </div>\n </div>\n <div>\n @if (!field().disabled) {\n <button matIconButton\n type=\"button\"\n (click)=\"deleteFile(item)\"\n title=\"Supprimer\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n </li>\n }\n </ul>\n } @else {\n @if (fichier) {\n <div class=\"file-list-item\">\n <div>\n @if (fichier.srcUrl) {\n <img [src]=\"fichier.srcUrl\" [alt]=\"fichier.file.name\"/>\n } @else {\n {{ fichier.file.name }}\n }\n </div>\n @if (!field().disabled) {\n <sot-mat-button\n type=\"button\"\n [className]=\"field().deleteButton?.className\"\n [matType]=\"field().deleteButton?.matButtonType\"\n [matIcon]=\"field().deleteButton?.matIcon\"\n [label]=\"field().deleteButton?.label ?? 'Delete'\"\n [title]=\"field().deleteButton?.title\"\n [ariaLabel]=\"field().deleteButton?.ariaLabel\"\n (buttonClick)=\"confirmDeleteFile(fichier!)\"\n ></sot-mat-button>\n }\n </div>\n }\n }\n </div>\n <div class=\"sot-file-button\">\n <sot-mat-button\n type=\"button\"\n [className]=\"field().addButton?.className\"\n [matType]=\"field().addButton?.matButtonType\"\n [matIcon]=\"field().addButton?.matIcon\"\n [label]=\"field().addButton?.label ?? 'Select a file'\"\n [title]=\"field().addButton?.title\"\n [ariaLabel]=\"field().addButton?.ariaLabel\"\n [disabled]=\"field().disabled\"\n (buttonClick)=\"fileInput.click()\"\n ></sot-mat-button>\n <input\n #fileInput\n hidden\n type=\"file\"\n [attr.id]=\"'file-upload-' + field().id\"\n name=\"file-upload\"\n (change)=\"onSelectFile($event)\"\n [accept]=\"field().accept ? field().accept : '*/*'\"\n [multiple]=\"field().multiple\"\n />\n </div>\n</div>\n", styles: [".file-list-item{display:flex;flex-direction:row;gap:1rem;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MaterialButton, selector: "sot-mat-button", inputs: ["type", "matType", "disabled", "disableRipple", "label", "className", "title", "matIcon", "badge", "badgeOptions", "ariaLabel"], outputs: ["buttonClick"] }] });
|
|
1216
1216
|
}
|
|
1217
1217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatInputFileComponent, decorators: [{
|
|
1218
1218
|
type: Component,
|
|
@@ -1222,7 +1222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1222
1222
|
multi: true,
|
|
1223
1223
|
useExisting: forwardRef(() => MatInputFileComponent),
|
|
1224
1224
|
},
|
|
1225
|
-
], template: "<div class=\"sot-file-wrapper\">\n <label [ngClass]=\"field()
|
|
1225
|
+
], template: "<div class=\"sot-file-wrapper\">\n <label [ngClass]=\"field().labelClassName\"\n [for]=\"'file-upload-' + field().id\">{{ field().label }}</label>\n <div class=\"sot-file-list\">\n @if (field().multiple) {\n <ul>\n @for (item of fileList; track item) {\n <li class=\"file-list-item\">\n <div>\n <div>\n @if (item.srcUrl) {\n <img [src]=\"item.srcUrl\" [alt]=\"item!.file.name\"/>\n } @else {\n {{ item.file.name }}\n }\n </div>\n </div>\n <div>\n @if (!field().disabled) {\n <button matIconButton\n type=\"button\"\n (click)=\"deleteFile(item)\"\n title=\"Supprimer\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n </li>\n }\n </ul>\n } @else {\n @if (fichier) {\n <div class=\"file-list-item\">\n <div>\n @if (fichier.srcUrl) {\n <img [src]=\"fichier.srcUrl\" [alt]=\"fichier.file.name\"/>\n } @else {\n {{ fichier.file.name }}\n }\n </div>\n @if (!field().disabled) {\n <sot-mat-button\n type=\"button\"\n [className]=\"field().deleteButton?.className\"\n [matType]=\"field().deleteButton?.matButtonType\"\n [matIcon]=\"field().deleteButton?.matIcon\"\n [label]=\"field().deleteButton?.label ?? 'Delete'\"\n [title]=\"field().deleteButton?.title\"\n [ariaLabel]=\"field().deleteButton?.ariaLabel\"\n (buttonClick)=\"confirmDeleteFile(fichier!)\"\n ></sot-mat-button>\n }\n </div>\n }\n }\n </div>\n <div class=\"sot-file-button\">\n <sot-mat-button\n type=\"button\"\n [className]=\"field().addButton?.className\"\n [matType]=\"field().addButton?.matButtonType\"\n [matIcon]=\"field().addButton?.matIcon\"\n [label]=\"field().addButton?.label ?? 'Select a file'\"\n [title]=\"field().addButton?.title\"\n [ariaLabel]=\"field().addButton?.ariaLabel\"\n [disabled]=\"field().disabled\"\n (buttonClick)=\"fileInput.click()\"\n ></sot-mat-button>\n <input\n #fileInput\n hidden\n type=\"file\"\n [attr.id]=\"'file-upload-' + field().id\"\n name=\"file-upload\"\n (change)=\"onSelectFile($event)\"\n [accept]=\"field().accept ? field().accept : '*/*'\"\n [multiple]=\"field().multiple\"\n />\n </div>\n</div>\n", styles: [".file-list-item{display:flex;flex-direction:row;gap:1rem;align-items:center}\n"] }]
|
|
1226
1226
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], fileInput: [{
|
|
1227
1227
|
type: ViewChild,
|
|
1228
1228
|
args: ['fileInput']
|
|
@@ -1230,11 +1230,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1230
1230
|
|
|
1231
1231
|
class MatFieldFileComponent extends AbstractControlFieldComponent {
|
|
1232
1232
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldFileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1233
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldFileComponent, isStandalone: true, selector: "sot-mat-field-file", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-file\" [ngClass]=\"field.className\" [formGroup]=\"group\">\n <sot-mat-input-file [formControlName]=\"field.name\" [field]=\"field\"\n [group]=\"group\"></sot-mat-input-file>\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <mat-error>{{ validation.message }}</mat-error>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatInputFileComponent, selector: "sot-mat-input-file", inputs: ["field", "group"] }] });
|
|
1233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldFileComponent, isStandalone: true, selector: "sot-mat-field-file", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-file\" [ngClass]=\"field().className\" [formGroup]=\"group()\">\n <sot-mat-input-file [formControlName]=\"field().name\" [field]=\"field()\"\n [group]=\"group()\"></sot-mat-input-file>\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <mat-error>{{ validation.message }}</mat-error>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatInputFileComponent, selector: "sot-mat-input-file", inputs: ["field", "group"] }] });
|
|
1234
1234
|
}
|
|
1235
1235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldFileComponent, decorators: [{
|
|
1236
1236
|
type: Component,
|
|
1237
|
-
args: [{ selector: 'sot-mat-field-file', standalone: true, imports: [ReactiveFormsModule, NgClass, MatError, MatInputFileComponent], template: "<div class=\"sot-formfield sot-formfield-file\" [ngClass]=\"field.className\" [formGroup]=\"group\">\n <sot-mat-input-file [formControlName]=\"field.name\" [field]=\"field\"\n [group]=\"group\"></sot-mat-input-file>\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <mat-error>{{ validation.message }}</mat-error>\n }\n }\n</div>\n" }]
|
|
1237
|
+
args: [{ selector: 'sot-mat-field-file', standalone: true, imports: [ReactiveFormsModule, NgClass, MatError, MatInputFileComponent], template: "<div class=\"sot-formfield sot-formfield-file\" [ngClass]=\"field().className\" [formGroup]=\"group()\">\n <sot-mat-input-file [formControlName]=\"field().name\" [field]=\"field()\"\n [group]=\"group()\"></sot-mat-input-file>\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <mat-error>{{ validation.message }}</mat-error>\n }\n }\n</div>\n" }]
|
|
1238
1238
|
}] });
|
|
1239
1239
|
|
|
1240
1240
|
class MatFieldChipsComponent extends AbstractControlFieldComponent {
|
|
@@ -1254,23 +1254,23 @@ class MatFieldChipsComponent extends AbstractControlFieldComponent {
|
|
|
1254
1254
|
constructor() {
|
|
1255
1255
|
super();
|
|
1256
1256
|
effect(() => {
|
|
1257
|
-
this.group.get(this.field.name)?.setValue(this.values());
|
|
1257
|
+
this.group().get(this.field().name)?.setValue(this.values());
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
buttonAction(b) {
|
|
1261
|
-
if (b.action
|
|
1262
|
-
b.action(this.field, this.group, this.
|
|
1261
|
+
if (b.action) {
|
|
1262
|
+
b.action(this.field(), this.group(), this.data);
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
1265
|
ngOnInit() {
|
|
1266
1266
|
super.ngOnInit();
|
|
1267
|
-
if (this.field.options) {
|
|
1268
|
-
this.options = this.field.options;
|
|
1267
|
+
if (this.field().options) {
|
|
1268
|
+
this.options = this.field().options;
|
|
1269
1269
|
}
|
|
1270
|
-
if (this.field.value) {
|
|
1271
|
-
this.values.set(this.field.value);
|
|
1270
|
+
if (this.field().value) {
|
|
1271
|
+
this.values.set(this.field().value);
|
|
1272
1272
|
}
|
|
1273
|
-
const control = this.group.get(this.field.name);
|
|
1273
|
+
const control = this.group().get(this.field().name);
|
|
1274
1274
|
if (control) {
|
|
1275
1275
|
control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
1276
1276
|
if (JSON.stringify(value) !== JSON.stringify(this.values())) {
|
|
@@ -1308,11 +1308,11 @@ class MatFieldChipsComponent extends AbstractControlFieldComponent {
|
|
|
1308
1308
|
event.option.deselect();
|
|
1309
1309
|
}
|
|
1310
1310
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1311
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldChipsComponent, isStandalone: true, selector: "sot-mat-field-chips", inputs: { currentOption: { classPropertyName: "currentOption", publicName: "currentOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentOption: "currentOptionChange" }, usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n\r\n <mat-chip-grid #chipGrid aria-label=\"option selection\">\r\n @for (option of values(); track $index) {\r\n <mat-chip-row (removed)=\"remove(option)\">\r\n {{ option }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + option\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n <input\r\n #chipsInput\r\n [id]=\"uuid\"\r\n name=\"option\"\r\n [(ngModel)]=\"currentOption\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field.readonly\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputSeparatorKeyCodes]=\"field.separatorKeysCodes ?? separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"add($event); chipsInput.value = ''\"\r\n >\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event); chipsInput.value = ''\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1311
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldChipsComponent, isStandalone: true, selector: "sot-mat-field-chips", inputs: { currentOption: { classPropertyName: "currentOption", publicName: "currentOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentOption: "currentOptionChange" }, usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n\r\n <mat-chip-grid #chipGrid aria-label=\"option selection\">\r\n @for (option of values(); track $index) {\r\n <mat-chip-row (removed)=\"remove(option)\">\r\n {{ option }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + option\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n <input\r\n #chipsInput\r\n [id]=\"uuid\"\r\n name=\"option\"\r\n [(ngModel)]=\"currentOption\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field().readonly\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputSeparatorKeyCodes]=\"field().separatorKeysCodes ?? separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"add($event); chipsInput.value = ''\"\r\n >\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event); chipsInput.value = ''\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1312
1312
|
}
|
|
1313
1313
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldChipsComponent, decorators: [{
|
|
1314
1314
|
type: Component,
|
|
1315
|
-
args: [{ selector: 'sot-mat-field-chips', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatButtonModule, MatChipsModule, MatAutocompleteModule, FormsModule], template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field.className\"\r\n [formGroup]=\"group\"\r\n>\r\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field.label\"></span></mat-label>\r\n\r\n <mat-chip-grid #chipGrid aria-label=\"option selection\">\r\n @for (option of values(); track $index) {\r\n <mat-chip-row (removed)=\"remove(option)\">\r\n {{ option }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + option\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n <input\r\n #chipsInput\r\n [id]=\"uuid\"\r\n name=\"option\"\r\n [(ngModel)]=\"currentOption\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field.readonly\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputSeparatorKeyCodes]=\"field.separatorKeysCodes ?? separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"add($event); chipsInput.value = ''\"\r\n >\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event); chipsInput.value = ''\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field.description) {\r\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
1315
|
+
args: [{ selector: 'sot-mat-field-chips', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatButtonModule, MatChipsModule, MatAutocompleteModule, FormsModule], template: "<div\r\n class=\"sot-formfield sot-formfield-input\"\r\n [ngClass]=\"field().className\"\r\n [formGroup]=\"group()\"\r\n>\r\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\r\n <mat-label><span [innerHTML]=\"field().label\"></span></mat-label>\r\n\r\n <mat-chip-grid #chipGrid aria-label=\"option selection\">\r\n @for (option of values(); track $index) {\r\n <mat-chip-row (removed)=\"remove(option)\">\r\n {{ option }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + option\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n </mat-chip-grid>\r\n\r\n <input\r\n #chipsInput\r\n [id]=\"uuid\"\r\n name=\"option\"\r\n [(ngModel)]=\"currentOption\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [type]=\"inputType\"\r\n [readonly]=\"field().readonly\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matAutocomplete]=\"auto\"\r\n [matChipInputSeparatorKeyCodes]=\"field().separatorKeysCodes ?? separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"add($event); chipsInput.value = ''\"\r\n >\r\n <mat-autocomplete #auto=\"matAutocomplete\"\r\n (optionSelected)=\"selected($event); chipsInput.value = ''\">\r\n @for (option of filteredOptions(); track option) {\r\n <mat-option [value]=\"option\">{{ option }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\" matSuffix>\r\n @if (suffix.action) {\r\n <button type=\"button\" matButton\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n @if (field().description) {\r\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\r\n }\r\n\r\n @if (control && !control.untouched && control.invalid) {\r\n <mat-error>\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
1316
1316
|
}], ctorParameters: () => [], propDecorators: { currentOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentOption", required: false }] }, { type: i0.Output, args: ["currentOptionChange"] }] } });
|
|
1317
1317
|
|
|
1318
1318
|
class MatFieldDateComponent extends AbstractControlFieldComponent {
|
|
@@ -1322,41 +1322,41 @@ class MatFieldDateComponent extends AbstractControlFieldComponent {
|
|
|
1322
1322
|
locale;
|
|
1323
1323
|
ngOnInit() {
|
|
1324
1324
|
super.ngOnInit();
|
|
1325
|
-
this.locale = this.field.locale ?? 'en';
|
|
1325
|
+
this.locale = this.field().locale ?? 'en';
|
|
1326
1326
|
this._adapter.setLocale(this.locale);
|
|
1327
|
-
this.dateFormatString = this.field.format ?? 'YYYY/MM/DD';
|
|
1327
|
+
this.dateFormatString = this.field().format ?? 'YYYY/MM/DD';
|
|
1328
1328
|
this.updateCloseButtonLabel();
|
|
1329
|
-
const control = this.group.get(this.field.name);
|
|
1329
|
+
const control = this.group().get(this.field().name);
|
|
1330
1330
|
if (control) {
|
|
1331
1331
|
if (typeof control.value === 'string') {
|
|
1332
|
-
//TODO control.setValue(moment(control.value, this.field.format));
|
|
1332
|
+
//TODO control.setValue(moment(control.value, this.field().format));
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
1336
|
buttonAction(b) {
|
|
1337
|
-
if (b.action
|
|
1338
|
-
b.action(this.field, this.group, this.
|
|
1337
|
+
if (b.action) {
|
|
1338
|
+
b.action(this.field(), this.group(), this.data);
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
1341
|
filterDate = (d) => {
|
|
1342
|
-
return this.field.filter ? this.field.filter(d, this.field, this.group) : true;
|
|
1342
|
+
return this.field().filter ? this.field().filter(d, this.field(), this.group()) : true;
|
|
1343
1343
|
};
|
|
1344
1344
|
updateCloseButtonLabel() {
|
|
1345
|
-
if (this.field.closeCalendarLabel) {
|
|
1346
|
-
this._intl.closeCalendarLabel = this.field.closeCalendarLabel;
|
|
1345
|
+
if (this.field().closeCalendarLabel) {
|
|
1346
|
+
this._intl.closeCalendarLabel = this.field().closeCalendarLabel;
|
|
1347
1347
|
}
|
|
1348
1348
|
this._intl.changes.next();
|
|
1349
1349
|
}
|
|
1350
1350
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1351
1351
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MatFieldDateComponent, isStandalone: true, selector: "sot-field-date", providers: [
|
|
1352
1352
|
provideLuxonDateAdapter(),
|
|
1353
|
-
], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ac-form-field ac-form-field-date\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\"\n>\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\n <mat-label>\n {{ field.label }}\n </mat-label>\n <input matInput\n type=\"text\"\n [id]=\"uuid\"\n [matDatepicker]=\"picker\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [min]=\"field.minDate ? field.minDate : null\"\n [max]=\"field.maxDate ? field.maxDate : null\"\n [matDatepickerFilter]=\"filterDate\"\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker [touchUi]=\"!!field.touchUi\"></mat-datepicker>\n\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{prefix.label}}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (suffix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{suffix.label}}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n\n @if (field.description) {\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\n }\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field.validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".ac-form-field-date mat-form-field{width:100%}.ac-form-field-date mat-form-field[hidden]{display:none}.ac-form-field-date-prefix,.ac-form-field-date-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
1353
|
+
], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ac-form-field ac-form-field-date\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\"\n>\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\n <mat-label>\n {{ field().label }}\n </mat-label>\n <input matInput\n type=\"text\"\n [id]=\"uuid\"\n [matDatepicker]=\"picker\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [min]=\"field().minDate ? field().minDate : null\"\n [max]=\"field().maxDate ? field().maxDate : null\"\n [matDatepickerFilter]=\"filterDate\"\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker [touchUi]=\"!!field().touchUi\"></mat-datepicker>\n\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{prefix.label}}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (suffix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{suffix.label}}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n\n @if (field().description) {\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\n }\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".ac-form-field-date mat-form-field{width:100%}.ac-form-field-date mat-form-field[hidden]{display:none}.ac-form-field-date-prefix,.ac-form-field-date-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i3$3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
1354
1354
|
}
|
|
1355
1355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MatFieldDateComponent, decorators: [{
|
|
1356
1356
|
type: Component,
|
|
1357
1357
|
args: [{ selector: 'sot-field-date', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatDatepickerModule, MatInputModule, MatButtonModule], providers: [
|
|
1358
1358
|
provideLuxonDateAdapter(),
|
|
1359
|
-
], template: "<div\n class=\"ac-form-field ac-form-field-date\"\n [ngClass]=\"field.className\"\n [formGroup]=\"group\"\n>\n <mat-form-field [appearance]=\"field.appearance ?? 'fill'\">\n <mat-label>\n {{ field.label }}\n </mat-label>\n <input matInput\n type=\"text\"\n [id]=\"uuid\"\n [matDatepicker]=\"picker\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [min]=\"field.minDate ? field.minDate : null\"\n [max]=\"field.maxDate ? field.maxDate : null\"\n [matDatepickerFilter]=\"filterDate\"\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker [touchUi]=\"!!field.touchUi\"></mat-datepicker>\n\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{prefix.label}}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (suffix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{suffix.label}}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n\n @if (field.description) {\n <mat-hint align=\"start\"> {{ field.description }}</mat-hint>\n }\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field.validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".ac-form-field-date mat-form-field{width:100%}.ac-form-field-date mat-form-field[hidden]{display:none}.ac-form-field-date-prefix,.ac-form-field-date-suffix{padding:0 .5rem}\n"] }]
|
|
1359
|
+
], template: "<div\n class=\"ac-form-field ac-form-field-date\"\n [ngClass]=\"field().className\"\n [formGroup]=\"group()\"\n>\n <mat-form-field [appearance]=\"field().appearance ?? 'fill'\">\n <mat-label>\n {{ field().label }}\n </mat-label>\n <input matInput\n type=\"text\"\n [id]=\"uuid\"\n [matDatepicker]=\"picker\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [min]=\"field().minDate ? field().minDate : null\"\n [max]=\"field().maxDate ? field().maxDate : null\"\n [matDatepickerFilter]=\"filterDate\"\n />\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker [touchUi]=\"!!field().touchUi\"></mat-datepicker>\n\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{prefix.label}}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\" matSuffix>\n @if (suffix.action) {\n <button type=\"button\" matButton\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{suffix.label}}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n\n @if (field().description) {\n <mat-hint align=\"start\"> {{ field().description }}</mat-hint>\n }\n @if (control && !control.untouched && control.invalid) {\n <mat-error>\n @for (validation of field().validations; track validation) {\n @if (control.hasError(validation.name)) {\n {{ validation.message }}\n }\n }\n </mat-error>\n }\n </mat-form-field>\n</div>\n", styles: [".ac-form-field-date mat-form-field{width:100%}.ac-form-field-date mat-form-field[hidden]{display:none}.ac-form-field-date-prefix,.ac-form-field-date-suffix{padding:0 .5rem}\n"] }]
|
|
1360
1360
|
}] });
|
|
1361
1361
|
|
|
1362
1362
|
const components$2 = {
|
|
@@ -1389,6 +1389,7 @@ class AcDynamicFieldDirective {
|
|
|
1389
1389
|
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : []));
|
|
1390
1390
|
group = input.required(...(ngDevMode ? [{ debugName: "group" }] : []));
|
|
1391
1391
|
instancePath = input(...(ngDevMode ? [undefined, { debugName: "instancePath" }] : []));
|
|
1392
|
+
data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
|
|
1392
1393
|
component;
|
|
1393
1394
|
ngOnChanges(changes) {
|
|
1394
1395
|
if (!components$2[this.field().type]) {
|
|
@@ -1403,14 +1404,15 @@ class AcDynamicFieldDirective {
|
|
|
1403
1404
|
environmentInjector: this.injector
|
|
1404
1405
|
});
|
|
1405
1406
|
}
|
|
1406
|
-
this.component.instance.field = this.field
|
|
1407
|
-
this.component.instance.group = this.group
|
|
1407
|
+
this.component.instance.field = this.field;
|
|
1408
|
+
this.component.instance.group = this.group;
|
|
1408
1409
|
this.component.instance.instancePath = this.instancePath();
|
|
1409
1410
|
this.component.instance.path = this.path();
|
|
1411
|
+
this.component.instance.data = this.data();
|
|
1410
1412
|
}
|
|
1411
1413
|
}
|
|
1412
1414
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcDynamicFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1413
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: AcDynamicFieldDirective, isStandalone: true, selector: "[matDynamicField]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: true, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, instancePath: { classPropertyName: "instancePath", publicName: "instancePath", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 });
|
|
1415
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: AcDynamicFieldDirective, isStandalone: true, selector: "[matDynamicField]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: true, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, instancePath: { classPropertyName: "instancePath", publicName: "instancePath", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 });
|
|
1414
1416
|
}
|
|
1415
1417
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcDynamicFieldDirective, decorators: [{
|
|
1416
1418
|
type: Directive,
|
|
@@ -1418,7 +1420,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1418
1420
|
selector: "[matDynamicField]",
|
|
1419
1421
|
standalone: true
|
|
1420
1422
|
}]
|
|
1421
|
-
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: true }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], instancePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "instancePath", required: false }] }] } });
|
|
1423
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: true }] }], field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }], instancePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "instancePath", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
1422
1424
|
|
|
1423
1425
|
class MaterialDynamicFormComponent {
|
|
1424
1426
|
dynamicFormService = inject(DynamicFormService);
|
|
@@ -1432,6 +1434,9 @@ class MaterialDynamicFormComponent {
|
|
|
1432
1434
|
get form() {
|
|
1433
1435
|
return this.dynamicFormService.form;
|
|
1434
1436
|
}
|
|
1437
|
+
get data() {
|
|
1438
|
+
return this.dynamicFormService.data;
|
|
1439
|
+
}
|
|
1435
1440
|
get controls() {
|
|
1436
1441
|
return this.form ? this.form.controls : null;
|
|
1437
1442
|
}
|
|
@@ -1498,11 +1503,11 @@ class MaterialDynamicFormComponent {
|
|
|
1498
1503
|
// TODO
|
|
1499
1504
|
}
|
|
1500
1505
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1501
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MaterialDynamicFormComponent, isStandalone: true, selector: "sot-material-dynamic-form", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formCancel: "formCancel", formSubmit: "formSubmit", formChange: "formChange", formInit: "formInit" }, providers: [DynamicFormService], exportAs: ["dynamicForm"], ngImport: i0, template: "@if (form && config()) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n (submit)=\"handleSubmit($event)\"\r\n [ngClass]=\"config()!.className?.form\">\r\n @if (this.config()!.fields) {\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"config()!.className?.formContent\">\r\n @for (field of config()!.fields; track field.type + field.name) {\r\n <div [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- TODO Revoir l'affichage des erreurs -->\r\n @if (config()!.validations && form && !form.untouched && form.invalid) {\r\n <mat-error class=\"dynamic-form-error\">\r\n @for (validation of config()!.validations!; track validation) {\r\n @if (form.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-buttons\" [ngClass]=\"config()!.className?.formButtons\">\r\n @for (button of config()!.buttons; track $index) {\r\n <sot-mat-button\r\n [type]=\"button.type\"\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form
|
|
1506
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MaterialDynamicFormComponent, isStandalone: true, selector: "sot-material-dynamic-form", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formCancel: "formCancel", formSubmit: "formSubmit", formChange: "formChange", formInit: "formInit" }, providers: [DynamicFormService], exportAs: ["dynamicForm"], ngImport: i0, template: "@if (form && config()) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n (submit)=\"handleSubmit($event)\"\r\n [ngClass]=\"config()!.className?.form\">\r\n @if (this.config()!.fields) {\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"config()!.className?.formContent\">\r\n @for (field of config()!.fields; track field.type + field.name) {\r\n <div [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n [data]=\"data\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- TODO Revoir l'affichage des erreurs -->\r\n @if (config()!.validations && form && !form.untouched && form.invalid) {\r\n <mat-error class=\"dynamic-form-error\">\r\n @for (validation of config()!.validations!; track validation) {\r\n @if (form.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-buttons\" [ngClass]=\"config()!.className?.formButtons\">\r\n @for (button of config()!.buttons; track $index) {\r\n <sot-mat-button\r\n [type]=\"button.type\"\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n }\r\n </form>\r\n}\r\n", styles: [".dynamic-form-horizontal{display:flex;flex-direction:row;flex-wrap:wrap}.dynamic-form-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}.dynamic-form-error{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: AcDynamicFieldDirective, selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: MaterialButton, selector: "sot-mat-button", inputs: ["type", "matType", "disabled", "disableRipple", "label", "className", "title", "matIcon", "badge", "badgeOptions", "ariaLabel"], outputs: ["buttonClick"] }] });
|
|
1502
1507
|
}
|
|
1503
1508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormComponent, decorators: [{
|
|
1504
1509
|
type: Component,
|
|
1505
|
-
args: [{ exportAs: 'dynamicForm', selector: 'sot-material-dynamic-form', standalone: true, imports: [AcDynamicFieldDirective, NgClass, ReactiveFormsModule, MatError, MatIconModule, MatButtonModule, MaterialButton], providers: [DynamicFormService], template: "@if (form && config()) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n (submit)=\"handleSubmit($event)\"\r\n [ngClass]=\"config()!.className?.form\">\r\n @if (this.config()!.fields) {\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"config()!.className?.formContent\">\r\n @for (field of config()!.fields; track field.type + field.name) {\r\n <div [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- TODO Revoir l'affichage des erreurs -->\r\n @if (config()!.validations && form && !form.untouched && form.invalid) {\r\n <mat-error class=\"dynamic-form-error\">\r\n @for (validation of config()!.validations!; track validation) {\r\n @if (form.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-buttons\" [ngClass]=\"config()!.className?.formButtons\">\r\n @for (button of config()!.buttons; track $index) {\r\n <sot-mat-button\r\n [type]=\"button.type\"\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form
|
|
1510
|
+
args: [{ exportAs: 'dynamicForm', selector: 'sot-material-dynamic-form', standalone: true, imports: [AcDynamicFieldDirective, NgClass, ReactiveFormsModule, MatError, MatIconModule, MatButtonModule, MaterialButton], providers: [DynamicFormService], template: "@if (form && config()) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n (submit)=\"handleSubmit($event)\"\r\n [ngClass]=\"config()!.className?.form\">\r\n @if (this.config()!.fields) {\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"config()!.className?.formContent\">\r\n @for (field of config()!.fields; track field.type + field.name) {\r\n <div [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n [data]=\"data\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- TODO Revoir l'affichage des erreurs -->\r\n @if (config()!.validations && form && !form.untouched && form.invalid) {\r\n <mat-error class=\"dynamic-form-error\">\r\n @for (validation of config()!.validations!; track validation) {\r\n @if (form.hasError(validation.name)) {\r\n {{ validation.message }}\r\n }\r\n }\r\n </mat-error>\r\n }\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-buttons\" [ngClass]=\"config()!.className?.formButtons\">\r\n @for (button of config()!.buttons; track $index) {\r\n <sot-mat-button\r\n [type]=\"button.type\"\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n }\r\n </form>\r\n}\r\n", styles: [".dynamic-form-horizontal{display:flex;flex-direction:row;flex-wrap:wrap}.dynamic-form-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}.dynamic-form-error{margin-bottom:2rem}\n"] }]
|
|
1506
1511
|
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], initialValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValues", required: false }] }], formCancel: [{ type: i0.Output, args: ["formCancel"] }], formSubmit: [{ type: i0.Output, args: ["formSubmit"] }], formChange: [{ type: i0.Output, args: ["formChange"] }], formInit: [{ type: i0.Output, args: ["formInit"] }] } });
|
|
1507
1512
|
|
|
1508
1513
|
class MaterialDynamicFormModalComponent {
|
|
@@ -1514,6 +1519,9 @@ class MaterialDynamicFormModalComponent {
|
|
|
1514
1519
|
get form() {
|
|
1515
1520
|
return this.dynamicFormService.form;
|
|
1516
1521
|
}
|
|
1522
|
+
get formData() {
|
|
1523
|
+
return this.dynamicFormService.data;
|
|
1524
|
+
}
|
|
1517
1525
|
constructor() {
|
|
1518
1526
|
this.dynamicFormService.createForm(this.data.fields, this.data.validations, this.data.updateOn ?? "change", this.data.initialObject);
|
|
1519
1527
|
}
|
|
@@ -1536,14 +1544,14 @@ class MaterialDynamicFormModalComponent {
|
|
|
1536
1544
|
}
|
|
1537
1545
|
}
|
|
1538
1546
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1539
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MaterialDynamicFormModalComponent, isStandalone: true, selector: "ac-dynamic-form-modal", providers: [DynamicFormService], ngImport: i0, template: "<h2 class=\"modal-title\" matDialogTitle> {{ data.title }}</h2>\r\n\r\n<div matDialogContent>\r\n @if (data.description) {\r\n <p [innerHTML]=\"data.description\"></p>\r\n }\r\n @if (form) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n [ngClass]=\"data.className?.form\">\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"data.className?.formContent\">\r\n @for (field of data.fields; track field) {\r\n <div\r\n [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n </form>\r\n }\r\n @if (message) {\r\n <div [innerHTML]=\"message\"\r\n [ngClass]=\"{'message-success': status === 'OK', 'message-error': status === 'ERROR'}\"\r\n ></div>\r\n }\r\n</div>\r\n\r\n<div matDialogActions>\r\n <div class=\"modal-action-buttons\" [ngClass]=\"data.className?.formButtons\">\r\n @for (button of data.buttons; track $index) {\r\n <sot-mat-button\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form?.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: AcDynamicFieldDirective, selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "component", type: MaterialButton, selector: "sot-mat-button", inputs: ["type", "matType", "disabled", "disableRipple", "label", "className", "title", "matIcon", "badge", "badgeOptions", "ariaLabel"], outputs: ["buttonClick"] }] });
|
|
1547
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MaterialDynamicFormModalComponent, isStandalone: true, selector: "ac-dynamic-form-modal", providers: [DynamicFormService], ngImport: i0, template: "<h2 class=\"modal-title\" matDialogTitle> {{ data.title }}</h2>\r\n\r\n<div matDialogContent>\r\n @if (data.description) {\r\n <p [innerHTML]=\"data.description\"></p>\r\n }\r\n @if (form) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n [ngClass]=\"data.className?.form\">\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"data.className?.formContent\">\r\n @for (field of data.fields; track field) {\r\n <div\r\n [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n [data]=\"formData\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n </form>\r\n }\r\n @if (message) {\r\n <div [innerHTML]=\"message\"\r\n [ngClass]=\"{'message-success': status === 'OK', 'message-error': status === 'ERROR'}\"\r\n ></div>\r\n }\r\n</div>\r\n\r\n<div matDialogActions>\r\n <div class=\"modal-action-buttons\" [ngClass]=\"data.className?.formButtons\">\r\n @for (button of data.buttons; track $index) {\r\n <sot-mat-button\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form?.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: AcDynamicFieldDirective, selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }, { kind: "component", type: MaterialButton, selector: "sot-mat-button", inputs: ["type", "matType", "disabled", "disableRipple", "label", "className", "title", "matIcon", "badge", "badgeOptions", "ariaLabel"], outputs: ["buttonClick"] }] });
|
|
1540
1548
|
}
|
|
1541
1549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormModalComponent, decorators: [{
|
|
1542
1550
|
type: Component,
|
|
1543
|
-
args: [{ selector: "ac-dynamic-form-modal", standalone: true, imports: [NgClass, ReactiveFormsModule, MatIconModule, MatButtonModule, MatDialogModule, AcDynamicFieldDirective, MaterialButton], providers: [DynamicFormService], template: "<h2 class=\"modal-title\" matDialogTitle> {{ data.title }}</h2>\r\n\r\n<div matDialogContent>\r\n @if (data.description) {\r\n <p [innerHTML]=\"data.description\"></p>\r\n }\r\n @if (form) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n [ngClass]=\"data.className?.form\">\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"data.className?.formContent\">\r\n @for (field of data.fields; track field) {\r\n <div\r\n [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n </form>\r\n }\r\n @if (message) {\r\n <div [innerHTML]=\"message\"\r\n [ngClass]=\"{'message-success': status === 'OK', 'message-error': status === 'ERROR'}\"\r\n ></div>\r\n }\r\n</div>\r\n\r\n<div matDialogActions>\r\n <div class=\"modal-action-buttons\" [ngClass]=\"data.className?.formButtons\">\r\n @for (button of data.buttons; track $index) {\r\n <sot-mat-button\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form?.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
1551
|
+
args: [{ selector: "ac-dynamic-form-modal", standalone: true, imports: [NgClass, ReactiveFormsModule, MatIconModule, MatButtonModule, MatDialogModule, AcDynamicFieldDirective, MaterialButton], providers: [DynamicFormService], template: "<h2 class=\"modal-title\" matDialogTitle> {{ data.title }}</h2>\r\n\r\n<div matDialogContent>\r\n @if (data.description) {\r\n <p [innerHTML]=\"data.description\"></p>\r\n }\r\n @if (form) {\r\n <form class=\"dynamic-form\"\r\n [formGroup]=\"form\"\r\n [ngClass]=\"data.className?.form\">\r\n <div class=\"dynamic-form-content\"\r\n [ngClass]=\"data.className?.formContent\">\r\n @for (field of data.fields; track field) {\r\n <div\r\n [hidden]=\"!!field.hidden\"\r\n [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"form\"\r\n [data]=\"formData\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n </form>\r\n }\r\n @if (message) {\r\n <div [innerHTML]=\"message\"\r\n [ngClass]=\"{'message-success': status === 'OK', 'message-error': status === 'ERROR'}\"\r\n ></div>\r\n }\r\n</div>\r\n\r\n<div matDialogActions>\r\n <div class=\"modal-action-buttons\" [ngClass]=\"data.className?.formButtons\">\r\n @for (button of data.buttons; track $index) {\r\n <sot-mat-button\r\n [className]=\"button.className\"\r\n [matType]=\"button.matButtonType\"\r\n [disabled]=\"button.disabledIfFormNoValid && form?.invalid\"\r\n [matIcon]=\"button.matIcon\"\r\n [label]=\"button.label\"\r\n [title]=\"button.title\"\r\n [ariaLabel]=\"button.ariaLabel\"\r\n (buttonClick)=\"onClickButton(button)\"\r\n ></sot-mat-button>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
1544
1552
|
}], ctorParameters: () => [] });
|
|
1545
1553
|
|
|
1546
|
-
class
|
|
1554
|
+
class MaterialDynamicFormStepperComponent {
|
|
1547
1555
|
dynamicFormService = inject(DynamicFormService);
|
|
1548
1556
|
destroyRef = inject(DestroyRef);
|
|
1549
1557
|
cdr = inject(ChangeDetectorRef);
|
|
@@ -1558,6 +1566,9 @@ class AcDynamicFormStepperComponent {
|
|
|
1558
1566
|
get form() {
|
|
1559
1567
|
return this.dynamicFormService.form;
|
|
1560
1568
|
}
|
|
1569
|
+
get data() {
|
|
1570
|
+
return this.dynamicFormService.data;
|
|
1571
|
+
}
|
|
1561
1572
|
get controls() {
|
|
1562
1573
|
return this.form ? this.form.controls : null;
|
|
1563
1574
|
}
|
|
@@ -1624,24 +1635,24 @@ class AcDynamicFormStepperComponent {
|
|
|
1624
1635
|
this.stepper.reset();
|
|
1625
1636
|
this.formCancel.emit();
|
|
1626
1637
|
}
|
|
1627
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
1628
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type:
|
|
1638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1639
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: MaterialDynamicFormStepperComponent, isStandalone: true, selector: "sot-material-dynamic-form-stepper", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formCancel: "formCancel", formSubmit: "formSubmit", formChange: "formChange" }, providers: [
|
|
1629
1640
|
DynamicFormService, {
|
|
1630
1641
|
provide: STEPPER_GLOBAL_OPTIONS,
|
|
1631
1642
|
useValue: { showError: true, displayDefaultIndicatorType: false },
|
|
1632
1643
|
}
|
|
1633
|
-
], viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], exportAs: ["dynamicFormStepper"], usesOnChanges: true, ngImport: i0, template: "@if (form) {\r\n <form [formGroup]=\"form\"\r\n class=\"dynamic-form-stepper\"\r\n [ngClass]=\"config().className\"\r\n >\r\n <mat-stepper #stepper\r\n [linear]=\"config().linear\"\r\n [orientation]=\"(stepperOrientation | async)!\">\r\n @for (step of config().steps; track step.name; let stepFirst = $first; let stepLast = $last) {\r\n <mat-step [stepControl]=\"form.controls[step.name]\"\r\n [formGroup]=\"getSubGroup(step.name)\"\r\n [errorMessage]=\"step.errorMessage ?? ''\">\r\n <ng-template matStepLabel>{{ step.label }}</ng-template>\r\n <ng-template matStepContent>\r\n <div class=\"dynamic-form-stepper-content\"\r\n [ngClass]=\"config().className?.formContent\">\r\n @for (field of step.fields; track field.name) {\r\n <div [hidden]=\"!!field.hidden\" [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"getSubGroup(step.name)\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-stepper-buttons\" [ngClass]=\"config().className?.formButtons\">\r\n @for (button of config().buttons; track $index) {\r\n\r\n @if (button.type === 'previous' && !stepFirst) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperPrevious\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'next' && !stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperNext\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if ((button.type === 'submit' || button.type === 'reset') && stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'button') {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n </mat-step>\r\n }\r\n </mat-stepper>\r\n </form>\r\n}\r\n", styles: [":host{display:flex;flex-direction:column;flex:1}.dynamic-form-stepper-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: AcDynamicFieldDirective, selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "ngmodule", type: MatListModule }, { kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i4$1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i4$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i4$1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "directive", type: i4$1.MatStepperNext, selector: "button[matStepperNext]" }, { kind: "directive", type: i4$1.MatStepperPrevious, selector: "button[matStepperPrevious]" }, { kind: "directive", type: i4$1.MatStepContent, selector: "ng-template[matStepContent]" }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
1644
|
+
], viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], exportAs: ["dynamicFormStepper"], usesOnChanges: true, ngImport: i0, template: "@if (form) {\r\n <form [formGroup]=\"form\"\r\n class=\"dynamic-form-stepper\"\r\n [ngClass]=\"config().className\"\r\n >\r\n <mat-stepper #stepper\r\n [linear]=\"config().linear\"\r\n [orientation]=\"(stepperOrientation | async)!\">\r\n @for (step of config().steps; track step.name; let stepFirst = $first; let stepLast = $last) {\r\n <mat-step [stepControl]=\"form.controls[step.name]\"\r\n [formGroup]=\"getSubGroup(step.name)\"\r\n [errorMessage]=\"step.errorMessage ?? ''\">\r\n <ng-template matStepLabel>{{ step.label }}</ng-template>\r\n <ng-template matStepContent>\r\n <div class=\"dynamic-form-stepper-content\"\r\n [ngClass]=\"config().className?.formContent\">\r\n @for (field of step.fields; track field.name) {\r\n <div [hidden]=\"!!field.hidden\" [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"getSubGroup(step.name)\"\r\n [data]=\"data\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-stepper-buttons\" [ngClass]=\"config().className?.formButtons\">\r\n @for (button of config().buttons; track $index) {\r\n\r\n @if (button.type === 'previous' && !stepFirst) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperPrevious\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'next' && !stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperNext\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if ((button.type === 'submit' || button.type === 'reset') && stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'button') {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n </mat-step>\r\n }\r\n </mat-stepper>\r\n </form>\r\n}\r\n", styles: [":host{display:flex;flex-direction:column;flex:1}.dynamic-form-stepper-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: AcDynamicFieldDirective, selector: "[matDynamicField]", inputs: ["type", "path", "field", "group", "instancePath", "data"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "ngmodule", type: MatListModule }, { kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i4$1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i4$1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i4$1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "directive", type: i4$1.MatStepperNext, selector: "button[matStepperNext]" }, { kind: "directive", type: i4$1.MatStepperPrevious, selector: "button[matStepperPrevious]" }, { kind: "directive", type: i4$1.MatStepContent, selector: "ng-template[matStepContent]" }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
1634
1645
|
}
|
|
1635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
1646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: MaterialDynamicFormStepperComponent, decorators: [{
|
|
1636
1647
|
type: Component,
|
|
1637
|
-
args: [{ exportAs: "dynamicFormStepper", selector: "sot-material-dynamic-form-stepper", standalone: true, imports: [AcDynamicFieldDirective, NgClass, ReactiveFormsModule,
|
|
1638
|
-
MatIconModule, MatButtonModule, MatSidenavModule, MatListModule,
|
|
1648
|
+
args: [{ exportAs: "dynamicFormStepper", selector: "sot-material-dynamic-form-stepper", standalone: true, imports: [AcDynamicFieldDirective, NgClass, ReactiveFormsModule,
|
|
1649
|
+
MatIconModule, MatButtonModule, MatSidenavModule, MatListModule,
|
|
1639
1650
|
MatStepperModule, AsyncPipe, MatStepperPrevious, MatStepperNext, MatIcon], providers: [
|
|
1640
1651
|
DynamicFormService, {
|
|
1641
1652
|
provide: STEPPER_GLOBAL_OPTIONS,
|
|
1642
1653
|
useValue: { showError: true, displayDefaultIndicatorType: false },
|
|
1643
1654
|
}
|
|
1644
|
-
], template: "@if (form) {\r\n <form [formGroup]=\"form\"\r\n class=\"dynamic-form-stepper\"\r\n [ngClass]=\"config().className\"\r\n >\r\n <mat-stepper #stepper\r\n [linear]=\"config().linear\"\r\n [orientation]=\"(stepperOrientation | async)!\">\r\n @for (step of config().steps; track step.name; let stepFirst = $first; let stepLast = $last) {\r\n <mat-step [stepControl]=\"form.controls[step.name]\"\r\n [formGroup]=\"getSubGroup(step.name)\"\r\n [errorMessage]=\"step.errorMessage ?? ''\">\r\n <ng-template matStepLabel>{{ step.label }}</ng-template>\r\n <ng-template matStepContent>\r\n <div class=\"dynamic-form-stepper-content\"\r\n [ngClass]=\"config().className?.formContent\">\r\n @for (field of step.fields; track field.name) {\r\n <div [hidden]=\"!!field.hidden\" [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"getSubGroup(step.name)\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-stepper-buttons\" [ngClass]=\"config().className?.formButtons\">\r\n @for (button of config().buttons; track $index) {\r\n\r\n @if (button.type === 'previous' && !stepFirst) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperPrevious\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'next' && !stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperNext\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if ((button.type === 'submit' || button.type === 'reset') && stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'button') {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n </mat-step>\r\n }\r\n </mat-stepper>\r\n </form>\r\n}\r\n", styles: [":host{display:flex;flex-direction:column;flex:1}.dynamic-form-stepper-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}\n"] }]
|
|
1655
|
+
], template: "@if (form) {\r\n <form [formGroup]=\"form\"\r\n class=\"dynamic-form-stepper\"\r\n [ngClass]=\"config().className\"\r\n >\r\n <mat-stepper #stepper\r\n [linear]=\"config().linear\"\r\n [orientation]=\"(stepperOrientation | async)!\">\r\n @for (step of config().steps; track step.name; let stepFirst = $first; let stepLast = $last) {\r\n <mat-step [stepControl]=\"form.controls[step.name]\"\r\n [formGroup]=\"getSubGroup(step.name)\"\r\n [errorMessage]=\"step.errorMessage ?? ''\">\r\n <ng-template matStepLabel>{{ step.label }}</ng-template>\r\n <ng-template matStepContent>\r\n <div class=\"dynamic-form-stepper-content\"\r\n [ngClass]=\"config().className?.formContent\">\r\n @for (field of step.fields; track field.name) {\r\n <div [hidden]=\"!!field.hidden\" [ngClass]=\"field.hostClassName\">\r\n <ng-container\r\n matDynamicField\r\n [path]=\"field.name\"\r\n [type]=\"field.type\"\r\n [field]=\"field\"\r\n [group]=\"getSubGroup(step.name)\"\r\n [data]=\"data\"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (config()!.buttons) {\r\n <div class=\"dynamic-form-stepper-buttons\" [ngClass]=\"config().className?.formButtons\">\r\n @for (button of config().buttons; track $index) {\r\n\r\n @if (button.type === 'previous' && !stepFirst) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperPrevious\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'next' && !stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n matStepperNext\r\n type=\"button\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if ((button.type === 'submit' || button.type === 'reset') && stepLast) {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n [disabled]=\"button.disabledIfFormNoValid && getSubGroup(step.name).invalid\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n } @else if (button.type === 'button') {\r\n <button [matButton]=\"button.matButtonAppearance ?? 'text'\"\r\n [type]=\"button.type\"\r\n [ngClass]=\"button.className\"\r\n (click)=\"onClickButton(button)\"\r\n [title]=\"button.title ? button.title : ''\"\r\n [attr.aria-label]=\"button.ariaLabel\"\r\n >\r\n @if (button.matIcon) {\r\n <mat-icon>\r\n {{ button.matIcon }}\r\n </mat-icon>\r\n }\r\n {{ button.label }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n </mat-step>\r\n }\r\n </mat-stepper>\r\n </form>\r\n}\r\n", styles: [":host{display:flex;flex-direction:column;flex:1}.dynamic-form-stepper-buttons{display:flex;flex-direction:row;gap:2rem;margin-bottom:2rem}\n"] }]
|
|
1645
1656
|
}], propDecorators: { stepper: [{
|
|
1646
1657
|
type: ViewChild,
|
|
1647
1658
|
args: ['stepper']
|
|
@@ -1649,33 +1660,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1649
1660
|
|
|
1650
1661
|
class DsfrDivTextComponent extends AbstractFieldComponent {
|
|
1651
1662
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrDivTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1652
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrDivTextComponent, isStandalone: true, selector: "sot-dsfr-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1663
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrDivTextComponent, isStandalone: true, selector: "sot-dsfr-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1653
1664
|
}
|
|
1654
1665
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrDivTextComponent, decorators: [{
|
|
1655
1666
|
type: Component,
|
|
1656
|
-
args: [{ selector: 'sot-dsfr-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n" }]
|
|
1667
|
+
args: [{ selector: 'sot-dsfr-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n" }]
|
|
1657
1668
|
}] });
|
|
1658
1669
|
|
|
1659
1670
|
class DsfrFieldCheckboxComponent extends AbstractControlFieldComponent {
|
|
1660
1671
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1661
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldCheckboxComponent, isStandalone: true, selector: "sot-dsfr-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-checkbox-group\"\r\n [ngClass]=\"{\r\n 'fr-checkbox-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox-group--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox-group--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'fr-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }] });
|
|
1672
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldCheckboxComponent, isStandalone: true, selector: "sot-dsfr-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-checkbox-group\"\r\n [ngClass]=\"{\r\n 'fr-checkbox-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox-group--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox-group--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'fr-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }] });
|
|
1662
1673
|
}
|
|
1663
1674
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldCheckboxComponent, decorators: [{
|
|
1664
1675
|
type: Component,
|
|
1665
|
-
args: [{ selector: 'sot-dsfr-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-checkbox-group\"\r\n [ngClass]=\"{\r\n 'fr-checkbox-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox-group--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox-group--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'fr-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"] }]
|
|
1676
|
+
args: [{ selector: 'sot-dsfr-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-checkbox-group\"\r\n [ngClass]=\"{\r\n 'fr-checkbox-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox-group--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox-group--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'fr-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-checkbox--valid': control && !control.untouched && control.valid,\r\n 'fr-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error-wrapper{padding:0 16px;font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));color:var(--mat-form-field-error-text-color, var(--mat-sys-error));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-app-body-small-line-height))}\n"] }]
|
|
1666
1677
|
}] });
|
|
1667
1678
|
|
|
1668
1679
|
class DsfrFieldInputComponent extends AbstractControlFieldComponent {
|
|
1669
1680
|
inputType = 'text';
|
|
1670
1681
|
buttonAction(b) {
|
|
1671
|
-
if (b.action
|
|
1672
|
-
b.action(this.field, this.group, this.
|
|
1682
|
+
if (b.action) {
|
|
1683
|
+
b.action(this.field(), this.group(), this.data);
|
|
1673
1684
|
}
|
|
1674
1685
|
}
|
|
1675
1686
|
ngOnInit() {
|
|
1676
1687
|
super.ngOnInit();
|
|
1677
|
-
this.inputType = this.field.inputType ?? 'text';
|
|
1678
|
-
const control = this.group.get(this.field.name);
|
|
1688
|
+
this.inputType = this.field().inputType ?? 'text';
|
|
1689
|
+
const control = this.group().get(this.field().name);
|
|
1679
1690
|
if (control) {
|
|
1680
1691
|
control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
1681
1692
|
if (value?.length == 0) {
|
|
@@ -1685,47 +1696,43 @@ class DsfrFieldInputComponent extends AbstractControlFieldComponent {
|
|
|
1685
1696
|
}
|
|
1686
1697
|
}
|
|
1687
1698
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1688
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldInputComponent, isStandalone: true, selector: "sot-dsfr-field-input", usesInheritance: true, ngImport: i0, template: "<div class=\"form-field-input\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled) || field.readonly,\r\n }\"\r\n [type]=\"field.inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1699
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldInputComponent, isStandalone: true, selector: "sot-dsfr-field-input", usesInheritance: true, ngImport: i0, template: "<div class=\"form-field-input\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled) || field().readonly,\r\n }\"\r\n [type]=\"field().inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1689
1700
|
}
|
|
1690
1701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldInputComponent, decorators: [{
|
|
1691
1702
|
type: Component,
|
|
1692
|
-
args: [{ selector: 'sot-dsfr-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div class=\"form-field-input\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled) || field.readonly,\r\n }\"\r\n [type]=\"field.inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
1703
|
+
args: [{ selector: 'sot-dsfr-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div class=\"form-field-input\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled) || field().readonly,\r\n }\"\r\n [type]=\"field().inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
1693
1704
|
}] });
|
|
1694
1705
|
|
|
1695
1706
|
class DsfrGroupComponent extends AbstractControlFieldComponent {
|
|
1696
1707
|
get subGroup() {
|
|
1697
|
-
return this.group.controls[this.field.name];
|
|
1708
|
+
return this.group().controls[this.field().name];
|
|
1698
1709
|
}
|
|
1699
1710
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1700
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrGroupComponent, isStandalone: true, selector: "sot-dsfr-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'fr-accordion': field.accordion,\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'group-content-' + field.name\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'group-content-' + field.name\">\n @if (field.description) {\n <p class=\"fr-hint-text\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n } @else {\n <legend [ngClass]=\"field.labelClassName\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </legend>\n <div *ngTemplateOutlet=\"groupFields\"></div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"\">\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1711
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrGroupComponent, isStandalone: true, selector: "sot-dsfr-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'fr-accordion': field().accordion,\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'group-content-' + field().name\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'group-content-' + field().name\">\n @if (field().description) {\n <p class=\"fr-hint-text\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n } @else {\n <legend [ngClass]=\"field().labelClassName\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </legend>\n <div *ngTemplateOutlet=\"groupFields\"></div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"\">\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1701
1712
|
}
|
|
1702
1713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrGroupComponent, decorators: [{
|
|
1703
1714
|
type: Component,
|
|
1704
1715
|
args: [{ selector: 'sot-dsfr-group', standalone: true, imports: [
|
|
1705
1716
|
forwardRef(() => DsfrDynamicFieldDirective),
|
|
1706
1717
|
NgClass,
|
|
1707
|
-
MatAccordion,
|
|
1708
|
-
MatExpansionPanel,
|
|
1709
|
-
MatExpansionPanelHeader,
|
|
1710
|
-
MatExpansionPanelTitle,
|
|
1711
1718
|
NgTemplateOutlet
|
|
1712
|
-
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'fr-accordion': field.accordion,\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'group-content-' + field.name\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'group-content-' + field.name\">\n @if (field.description) {\n <p class=\"fr-hint-text\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n } @else {\n <legend [ngClass]=\"field.labelClassName\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </legend>\n <div *ngTemplateOutlet=\"groupFields\"></div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"\">\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
1719
|
+
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'fr-accordion': field().accordion,\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'group-content-' + field().name\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'group-content-' + field().name\">\n @if (field().description) {\n <p class=\"fr-hint-text\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n } @else {\n <legend [ngClass]=\"field().labelClassName\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </legend>\n <div *ngTemplateOutlet=\"groupFields\"></div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"\">\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
1713
1720
|
}] });
|
|
1714
1721
|
|
|
1715
1722
|
class DsfrArrayComponent extends AbstractControlFieldComponent {
|
|
1716
1723
|
dynamicService = inject(DynamicFormService);
|
|
1717
1724
|
ref = inject(ChangeDetectorRef);
|
|
1718
1725
|
get array() {
|
|
1719
|
-
return this.group.controls[this.field.name];
|
|
1726
|
+
return this.group().controls[this.field().name];
|
|
1720
1727
|
}
|
|
1721
1728
|
constructor() {
|
|
1722
1729
|
super();
|
|
1723
1730
|
}
|
|
1724
1731
|
addItem() {
|
|
1725
|
-
const i = this.field.instances.length > 0 ? this.field.instances[this.field.instances.length - 1].number + 1 : 0;
|
|
1726
|
-
const fields =
|
|
1732
|
+
const i = this.field().instances.length > 0 ? this.field().instances[this.field().instances.length - 1].number + 1 : 0;
|
|
1733
|
+
const fields = structuredClone(this.field().field.fields);
|
|
1727
1734
|
const grp = this.dynamicService.createGroup(fields, `${this.path}[${i}]`, null, null);
|
|
1728
|
-
this.field.instances.push({
|
|
1735
|
+
this.field().instances.push({
|
|
1729
1736
|
number: i,
|
|
1730
1737
|
group: grp,
|
|
1731
1738
|
fields
|
|
@@ -1736,7 +1743,7 @@ class DsfrArrayComponent extends AbstractControlFieldComponent {
|
|
|
1736
1743
|
deleteItem(index, inst) {
|
|
1737
1744
|
/*
|
|
1738
1745
|
TODO
|
|
1739
|
-
this.field.instances!.splice(index, 1);
|
|
1746
|
+
this.field().instances!.splice(index, 1);
|
|
1740
1747
|
for (const key of this.dynamicService.pathFieldMap.keys()) {
|
|
1741
1748
|
if (key.startsWith(`${this.path}[${inst.number}]`)) {
|
|
1742
1749
|
this.dynamicFormService.pathFieldMap.delete(key);
|
|
@@ -1748,7 +1755,7 @@ class DsfrArrayComponent extends AbstractControlFieldComponent {
|
|
|
1748
1755
|
this.ref.detectChanges();
|
|
1749
1756
|
}
|
|
1750
1757
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrArrayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1751
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrArrayComponent, isStandalone: true, selector: "sot-dsfr-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{'fr-accordion': field.accordion}\"\n >\n @if (field.accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field.label }}\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend [ngClass]=\"field.labelClassName\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </legend>\n <div [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field.deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field.disabled && (!field.maxNbRow || field.maxNbRow > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"addItem()\"\n >\n {{ field.addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'fr-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-message fr-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatExpansionModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatCardModule) }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormArrayName), selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1758
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrArrayComponent, isStandalone: true, selector: "sot-dsfr-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{'fr-accordion': field().accordion}\"\n >\n @if (field().accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field().label }}\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend [ngClass]=\"field().labelClassName\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </legend>\n <div [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field().deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"addItem()\"\n >\n {{ field().addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'fr-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-message fr-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatExpansionModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i0.forwardRef(() => MatCardModule) }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormArrayName), selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1752
1759
|
}
|
|
1753
1760
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrArrayComponent, decorators: [{
|
|
1754
1761
|
type: Component,
|
|
@@ -1759,12 +1766,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1759
1766
|
MatCardModule,
|
|
1760
1767
|
ReactiveFormsModule,
|
|
1761
1768
|
NgTemplateOutlet
|
|
1762
|
-
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{'fr-accordion': field.accordion}\"\n >\n @if (field.accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field.label }}\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend [ngClass]=\"field.labelClassName\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </legend>\n <div [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field.deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field.disabled && (!field.maxNbRow || field.maxNbRow > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"addItem()\"\n >\n {{ field.addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'fr-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-message fr-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"] }]
|
|
1769
|
+
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{'fr-accordion': field().accordion}\"\n >\n @if (field().accordion) {\n <legend\n class=\"fr-accordion__title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"fr-accordion__btn\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field().label }}\n </button>\n </legend>\n <div\n class=\"fr-collapse\"\n [ngClass]=\"{ 'fr-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend [ngClass]=\"field().labelClassName\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </legend>\n <div [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container dsfrDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field().deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"fr-btn\"\n (click)=\"addItem()\"\n >\n {{ field().addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'fr-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-message fr-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"] }]
|
|
1763
1770
|
}], ctorParameters: () => [] });
|
|
1764
1771
|
|
|
1765
1772
|
class DsfrRowComponent extends AbstractFieldComponent {
|
|
1766
1773
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1767
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrRowComponent, isStandalone: true, selector: "sot-dsfr-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n dsfrDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }] });
|
|
1774
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrRowComponent, isStandalone: true, selector: "sot-dsfr-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n dsfrDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => DsfrDynamicFieldDirective), selector: "[dsfrDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }] });
|
|
1768
1775
|
}
|
|
1769
1776
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrRowComponent, decorators: [{
|
|
1770
1777
|
type: Component,
|
|
@@ -1773,7 +1780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1773
1780
|
NgClass,
|
|
1774
1781
|
forwardRef(() => DsfrDynamicFieldDirective),
|
|
1775
1782
|
DsfrDynamicFieldDirective
|
|
1776
|
-
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n dsfrDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
1783
|
+
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n dsfrDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
1777
1784
|
}] });
|
|
1778
1785
|
|
|
1779
1786
|
let PasswordValidators$1 = class PasswordValidators {
|
|
@@ -1795,16 +1802,16 @@ class DsfrFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
1795
1802
|
iconErrorLabel;
|
|
1796
1803
|
iconSuccessLabel;
|
|
1797
1804
|
buttonAction(b) {
|
|
1798
|
-
if (b.action
|
|
1799
|
-
b.action(this.field, this.group, this.
|
|
1805
|
+
if (b.action) {
|
|
1806
|
+
b.action(this.field(), this.group(), this.data);
|
|
1800
1807
|
}
|
|
1801
1808
|
}
|
|
1802
1809
|
ngOnInit() {
|
|
1803
1810
|
super.ngOnInit();
|
|
1804
|
-
this.showPasswordLabel = this.field.labels?.showPassword ?? "Show password";
|
|
1805
|
-
this.hidePasswordLabel = this.field.labels?.hidePassword ?? "Hide password";
|
|
1806
|
-
this.iconSuccessLabel = this.field.labels?.iconSuccess ?? "Success";
|
|
1807
|
-
this.iconErrorLabel = this.field.labels?.iconError ?? "Error";
|
|
1811
|
+
this.showPasswordLabel = this.field().labels?.showPassword ?? "Show password";
|
|
1812
|
+
this.hidePasswordLabel = this.field().labels?.hidePassword ?? "Hide password";
|
|
1813
|
+
this.iconSuccessLabel = this.field().labels?.iconSuccess ?? "Success";
|
|
1814
|
+
this.iconErrorLabel = this.field().labels?.iconError ?? "Error";
|
|
1808
1815
|
if (this.control) {
|
|
1809
1816
|
this.control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
1810
1817
|
if (value?.length == 0) {
|
|
@@ -1836,29 +1843,29 @@ class DsfrFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
1836
1843
|
return this.control.value && !this.control.hasError("requiresSpecialChars");
|
|
1837
1844
|
}
|
|
1838
1845
|
setPasswordValidators() {
|
|
1839
|
-
if (this.field.minlength) {
|
|
1840
|
-
this.control?.addValidators(Validators.minLength(this.field.minlength));
|
|
1846
|
+
if (this.field().minlength) {
|
|
1847
|
+
this.control?.addValidators(Validators.minLength(this.field().minlength));
|
|
1841
1848
|
}
|
|
1842
|
-
if (this.field.maxlength) {
|
|
1843
|
-
this.control?.addValidators(Validators.maxLength(this.field.maxlength));
|
|
1849
|
+
if (this.field().maxlength) {
|
|
1850
|
+
this.control?.addValidators(Validators.maxLength(this.field().maxlength));
|
|
1844
1851
|
}
|
|
1845
|
-
if (this.field.requiresDigit) {
|
|
1852
|
+
if (this.field().requiresDigit) {
|
|
1846
1853
|
this.control?.addValidators(PasswordValidators$1.patternValidator(/(?=.*[0-9])/, {
|
|
1847
1854
|
requiresDigit: true
|
|
1848
1855
|
}));
|
|
1849
1856
|
}
|
|
1850
|
-
if (this.field.requiresUppercase) {
|
|
1857
|
+
if (this.field().requiresUppercase) {
|
|
1851
1858
|
this.control?.addValidators(PasswordValidators$1.patternValidator(/(?=.*[A-Z])/, {
|
|
1852
1859
|
requiresUppercase: true
|
|
1853
1860
|
}));
|
|
1854
1861
|
}
|
|
1855
|
-
if (this.field.requiresLowercase) {
|
|
1862
|
+
if (this.field().requiresLowercase) {
|
|
1856
1863
|
this.control?.addValidators(PasswordValidators$1.patternValidator(/(?=.*[a-z])/, {
|
|
1857
1864
|
requiresLowercase: true
|
|
1858
1865
|
}));
|
|
1859
1866
|
}
|
|
1860
|
-
if (this.field.requiresSpecialChars) {
|
|
1861
|
-
const chars = this.field.specialChars?.join("") ?? "$@^!%*?&";
|
|
1867
|
+
if (this.field().requiresSpecialChars) {
|
|
1868
|
+
const chars = this.field().specialChars?.join("") ?? "$@^!%*?&";
|
|
1862
1869
|
const regex = "(?=.*[" + chars + "])";
|
|
1863
1870
|
this.control?.addValidators(PasswordValidators$1.patternValidator(new RegExp(regex), {
|
|
1864
1871
|
requiresSpecialChars: true
|
|
@@ -1866,69 +1873,70 @@ class DsfrFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
1866
1873
|
}
|
|
1867
1874
|
}
|
|
1868
1875
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldPasswordComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1869
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldPasswordComponent, isStandalone: true, selector: "sot-dsfr-field-password", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"fr-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1876
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldPasswordComponent, isStandalone: true, selector: "sot-dsfr-field-password", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"fr-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1870
1877
|
}
|
|
1871
1878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldPasswordComponent, decorators: [{
|
|
1872
1879
|
type: Component,
|
|
1873
|
-
args: [{ selector: 'sot-dsfr-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"fr-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"] }]
|
|
1880
|
+
args: [{ selector: 'sot-dsfr-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatIconModule, MatInputModule, MatButtonModule], template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid,\r\n 'fr-input-group--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"fr-input\"\r\n [ngClass]=\"{\r\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input--valid': control && !control.untouched && control.valid,\r\n 'fr-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"fr-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"fr-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"minLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"maxLengthValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresDigitValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresUppercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresLowercaseValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <mat-icon [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"\r\n [fontIcon]=\"requiresSpecialCharsValid ? 'check' : 'error'\"></mat-icon>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input mat-form-field{width:100%}.sot-formfield-input mat-form-field[hidden]{display:none}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}.password-description li mat-icon{margin-right:.5rem}.password-description li.text-error{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}\n"] }]
|
|
1874
1881
|
}] });
|
|
1875
1882
|
|
|
1876
1883
|
class DsfrFieldRadioButtonComponent extends AbstractControlFieldComponent {
|
|
1877
1884
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldRadioButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1878
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldRadioButtonComponent, isStandalone: true, selector: "sot-dsfr-field-radio-button", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"form-field-radio\"\r\n [hidden]=\"field.hidden\"\r\n [ngClass]=\"field.className\">\r\n <fieldset\r\n class=\"fr-fieldset\"\r\n [ngClass]=\"{\r\n 'fr-fieldset--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-fieldset--valid': control && !control.untouched && control.valid,\r\n 'fr-fieldset--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group\">\r\n <legend\r\n class=\"fr-fieldset__legend--regular fr-fieldset__legend\"\r\n [ngClass]=\"field.labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n @if(field.options) {\r\n @for (item of field.options; track item; let i = $index) {\r\n <div\r\n class=\"fr-fieldset__element\"\r\n [ngClass]=\"{ 'fr-fieldset__element--inline': !field.verticalAlign }\">\r\n <div class=\"fr-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [attr.disabled]=\"field.disabledKey && !!item[field.disabledKey] ? true : undefined\"/>\r\n <label\r\n class=\"fr-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n @if (field.descriptionKey) {\r\n <span class=\"fr-hint-text\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (control && !control.untouched && control.invalid) {\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'text-radio-' + uuid + '-error'\"\r\n aria-live=\"polite\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n <p class=\"fr-error-text\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n }\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatIconModule }] });
|
|
1885
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldRadioButtonComponent, isStandalone: true, selector: "sot-dsfr-field-radio-button", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"form-field-radio\"\r\n [hidden]=\"field().hidden\"\r\n [ngClass]=\"field().className\">\r\n <fieldset\r\n class=\"fr-fieldset\"\r\n [ngClass]=\"{\r\n 'fr-fieldset--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-fieldset--valid': control && !control.untouched && control.valid,\r\n 'fr-fieldset--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group()\">\r\n <legend\r\n class=\"fr-fieldset__legend--regular fr-fieldset__legend\"\r\n [ngClass]=\"field().labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n @if(field().options) {\r\n @for (item of field().options; track item; let i = $index) {\r\n <div\r\n class=\"fr-fieldset__element\"\r\n [ngClass]=\"{ 'fr-fieldset__element--inline': !field().verticalAlign }\">\r\n <div class=\"fr-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [attr.disabled]=\"field().disabledKey && !!item[field().disabledKey!] ? true : undefined\"/>\r\n <label\r\n class=\"fr-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n @if (field().descriptionKey) {\r\n <span class=\"fr-hint-text\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (control && !control.untouched && control.invalid) {\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'text-radio-' + uuid + '-error'\"\r\n aria-live=\"polite\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n <p class=\"fr-error-text\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n }\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatIconModule }] });
|
|
1879
1886
|
}
|
|
1880
1887
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldRadioButtonComponent, decorators: [{
|
|
1881
1888
|
type: Component,
|
|
1882
|
-
args: [{ selector: 'sot-dsfr-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass, MatRadioModule, MatTooltipModule, MatIconModule], template: "<div\r\n class=\"form-field-radio\"\r\n [hidden]=\"field.hidden\"\r\n [ngClass]=\"field.className\">\r\n <fieldset\r\n class=\"fr-fieldset\"\r\n [ngClass]=\"{\r\n 'fr-fieldset--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-fieldset--valid': control && !control.untouched && control.valid,\r\n 'fr-fieldset--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group\">\r\n <legend\r\n class=\"fr-fieldset__legend--regular fr-fieldset__legend\"\r\n [ngClass]=\"field.labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n @if(field.options) {\r\n @for (item of field.options; track item; let i = $index) {\r\n <div\r\n class=\"fr-fieldset__element\"\r\n [ngClass]=\"{ 'fr-fieldset__element--inline': !field.verticalAlign }\">\r\n <div class=\"fr-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [attr.disabled]=\"field.disabledKey && !!item[field.disabledKey] ? true : undefined\"/>\r\n <label\r\n class=\"fr-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n @if (field.descriptionKey) {\r\n <span class=\"fr-hint-text\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (control && !control.untouched && control.invalid) {\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'text-radio-' + uuid + '-error'\"\r\n aria-live=\"polite\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n <p class=\"fr-error-text\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n }\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
1889
|
+
args: [{ selector: 'sot-dsfr-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass, MatRadioModule, MatTooltipModule, MatIconModule], template: "<div\r\n class=\"form-field-radio\"\r\n [hidden]=\"field().hidden\"\r\n [ngClass]=\"field().className\">\r\n <fieldset\r\n class=\"fr-fieldset\"\r\n [ngClass]=\"{\r\n 'fr-fieldset--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-fieldset--valid': control && !control.untouched && control.valid,\r\n 'fr-fieldset--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group()\">\r\n <legend\r\n class=\"fr-fieldset__legend--regular fr-fieldset__legend\"\r\n [ngClass]=\"field().labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n @if(field().options) {\r\n @for (item of field().options; track item; let i = $index) {\r\n <div\r\n class=\"fr-fieldset__element\"\r\n [ngClass]=\"{ 'fr-fieldset__element--inline': !field().verticalAlign }\">\r\n <div class=\"fr-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [attr.disabled]=\"field().disabledKey && !!item[field().disabledKey!] ? true : undefined\"/>\r\n <label\r\n class=\"fr-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n @if (field().descriptionKey) {\r\n <span class=\"fr-hint-text\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if (control && !control.untouched && control.invalid) {\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'text-radio-' + uuid + '-error'\"\r\n aria-live=\"polite\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control.hasError(validation.name)) {\r\n <p class=\"fr-error-text\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n }\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
1883
1890
|
}] });
|
|
1884
1891
|
|
|
1885
1892
|
class AcFieldSelectComponent extends AbstractControlFieldComponent {
|
|
1886
1893
|
options = [];
|
|
1887
1894
|
ngOnInit() {
|
|
1888
1895
|
super.ngOnInit();
|
|
1889
|
-
|
|
1890
|
-
|
|
1896
|
+
const options = this.field().options;
|
|
1897
|
+
if (isObservable(options)) {
|
|
1898
|
+
options.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((options) => {
|
|
1891
1899
|
this.options = options;
|
|
1892
1900
|
});
|
|
1893
1901
|
}
|
|
1894
1902
|
else {
|
|
1895
|
-
this.options =
|
|
1903
|
+
this.options = options;
|
|
1896
1904
|
}
|
|
1897
1905
|
}
|
|
1898
1906
|
buttonAction(b) {
|
|
1899
|
-
if (b.action
|
|
1900
|
-
b.action(this.field, this.group, this.
|
|
1907
|
+
if (b.action) {
|
|
1908
|
+
b.action(this.field(), this.group(), this.data);
|
|
1901
1909
|
}
|
|
1902
1910
|
}
|
|
1903
1911
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcFieldSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1904
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AcFieldSelectComponent, isStandalone: true, selector: "sot-dsfr-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-select-group\"\r\n [ngClass]=\"{\r\n 'fr-select-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select-group--valid': control && !control.untouched && control.valid,\r\n 'fr-select-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"fr-select\"\r\n [multiple]=\"field.multiple\"\r\n [ngClass]=\"{\r\n 'fr-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select--valid': control && !control.untouched && control.valid,\r\n 'fr-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field.name\">\r\n @if (field.resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatSelectModule }] });
|
|
1912
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AcFieldSelectComponent, isStandalone: true, selector: "sot-dsfr-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-select-group\"\r\n [ngClass]=\"{\r\n 'fr-select-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select-group--valid': control && !control.untouched && control.valid,\r\n 'fr-select-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"fr-select\"\r\n [multiple]=\"field().multiple\"\r\n [ngClass]=\"{\r\n 'fr-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select--valid': control && !control.untouched && control.valid,\r\n 'fr-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field().name\">\r\n @if (field().resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatSelectModule }] });
|
|
1905
1913
|
}
|
|
1906
1914
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AcFieldSelectComponent, decorators: [{
|
|
1907
1915
|
type: Component,
|
|
1908
|
-
args: [{ selector: 'sot-dsfr-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatSelectModule], template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-select-group\"\r\n [ngClass]=\"{\r\n 'fr-select-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select-group--valid': control && !control.untouched && control.valid,\r\n 'fr-select-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n {{ field.label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"fr-hint-text\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"fr-select\"\r\n [multiple]=\"field.multiple\"\r\n [ngClass]=\"{\r\n 'fr-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select--valid': control && !control.untouched && control.valid,\r\n 'fr-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field.name\">\r\n @if (field.resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"] }]
|
|
1916
|
+
args: [{ selector: 'sot-dsfr-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatSelectModule], template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-select-group\"\r\n [ngClass]=\"{\r\n 'fr-select-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select-group--valid': control && !control.untouched && control.valid,\r\n 'fr-select-group--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"fr-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n {{ field().label }}\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"fr-hint-text\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"fr-select\"\r\n [multiple]=\"field().multiple\"\r\n [ngClass]=\"{\r\n 'fr-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-select--valid': control && !control.untouched && control.valid,\r\n 'fr-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field().name\">\r\n @if (field().resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-prefix\" matPrefix>\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"fr-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select mat-form-field{width:100%}.sot-formfield-select mat-form-field[hidden]{display:none}::ng-deep .sot-formfield-select-panel .mdc-list-item__primary-text{width:100%}.sot-formfield-select-prefix,.sot-formfield-select-suffix{padding:0 .5rem}\n"] }]
|
|
1909
1917
|
}] });
|
|
1910
1918
|
|
|
1911
1919
|
class DsfrFieldTextareaComponent extends AbstractControlFieldComponent {
|
|
1912
1920
|
buttonAction(b) {
|
|
1913
|
-
if (b.action
|
|
1914
|
-
b.action(this.field, this.group, this.
|
|
1921
|
+
if (b.action) {
|
|
1922
|
+
b.action(this.field(), this.group(), this.data);
|
|
1915
1923
|
}
|
|
1916
1924
|
}
|
|
1917
1925
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1918
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldTextareaComponent, isStandalone: true, selector: "sot-dsfr-field-textarea", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field.className\">\n <div\n [formGroup]=\"group\"\n class=\"fr-input-group\"\n [ngClass]=\"{\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\n 'fr-input-group--disabled': control && control.disabled,\n }\">\n <label\n class=\"fr-label\"\n [ngClass]=\"field.labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </label>\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"fr-input\"\n [ngClass]=\"{\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input--valid': control && !control.untouched && control.valid ,\n 'fr-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [rows]=\"field.rows\"\n [maxlength]=\"field.maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-error-text\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1926
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldTextareaComponent, isStandalone: true, selector: "sot-dsfr-field-textarea", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field().className\">\n <div\n [formGroup]=\"group()\"\n class=\"fr-input-group\"\n [ngClass]=\"{\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\n 'fr-input-group--disabled': control && control.disabled,\n }\">\n <label\n class=\"fr-label\"\n [ngClass]=\"field().labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </label>\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"fr-input\"\n [ngClass]=\"{\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input--valid': control && !control.untouched && control.valid ,\n 'fr-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [rows]=\"field().rows\"\n [maxlength]=\"field().maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-error-text\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
1919
1927
|
}
|
|
1920
1928
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldTextareaComponent, decorators: [{
|
|
1921
1929
|
type: Component,
|
|
1922
|
-
args: [{ selector: 'sot-dsfr-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatInputModule, MatButtonModule], template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field.className\">\n <div\n [formGroup]=\"group\"\n class=\"fr-input-group\"\n [ngClass]=\"{\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\n 'fr-input-group--disabled': control && control.disabled,\n }\">\n <label\n class=\"fr-label\"\n [ngClass]=\"field.labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"fr-hint-text\">{{ field.description }}</span>\n }\n </label>\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"fr-input\"\n [ngClass]=\"{\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input--valid': control && !control.untouched && control.valid ,\n 'fr-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [rows]=\"field.rows\"\n [maxlength]=\"field.maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-error-text\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"] }]
|
|
1930
|
+
args: [{ selector: 'sot-dsfr-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass, MatFormFieldModule, MatInputModule, MatButtonModule], template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field().className\">\n <div\n [formGroup]=\"group()\"\n class=\"fr-input-group\"\n [ngClass]=\"{\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\n 'fr-input-group--disabled': control && control.disabled,\n }\">\n <label\n class=\"fr-label\"\n [ngClass]=\"field().labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"fr-hint-text\">{{ field().description }}</span>\n }\n </label>\n <div class=\"fr-input-wrap fr-input-wrap--addon\">\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\" matPrefix>\n @if (prefix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"fr-input\"\n [ngClass]=\"{\n 'fr-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'fr-input--valid': control && !control.untouched && control.valid ,\n 'fr-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [rows]=\"field().rows\"\n [maxlength]=\"field().maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"fr-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"fr-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"fr-error-text\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea mat-form-field{width:100%}.sot-formfield-textarea mat-form-field[hidden]{display:none}.sot-formfield-textarea .sot-formfield-textarea-prefix,.sot-formfield-textarea .sot-formfield-textarea-suffix{padding:0 .5rem}\n"] }]
|
|
1923
1931
|
}] });
|
|
1924
1932
|
|
|
1925
1933
|
class DsfrFieldToggleComponent extends AbstractControlFieldComponent {
|
|
1926
1934
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldToggleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1927
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldToggleComponent, isStandalone: true, selector: "sot-dsfr-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"fr-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"fr-toggle__input\"\r\n [attr.id]=\"'toggle-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field.disabled\"/>\r\n <label\r\n class=\"fr-toggle__label\"\r\n [attr.for]=\"'toggle-' + uuid\"\r\n [attr.data-fr-checked-label]=\"field.checkedLabel\"\r\n [attr.data-fr-unchecked-label]=\"field.uncheckedLabel\"\r\n >{{ field.label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </label>\r\n <p\r\n class=\"fr-hint-text\">\r\n {{ field.description }}\r\n </p>\r\n </div>\r\n\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatSlideToggleModule }] });
|
|
1935
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DsfrFieldToggleComponent, isStandalone: true, selector: "sot-dsfr-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"fr-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"fr-toggle__input\"\r\n [attr.id]=\"'toggle-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field().disabled\"/>\r\n <label\r\n class=\"fr-toggle__label\"\r\n [attr.for]=\"'toggle-' + uuid\"\r\n [attr.data-fr-checked-label]=\"field().checkedLabel\"\r\n [attr.data-fr-unchecked-label]=\"field().uncheckedLabel\"\r\n >{{ field().label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </label>\r\n <p\r\n class=\"fr-hint-text\">\r\n {{ field().description }}\r\n </p>\r\n </div>\r\n\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatSlideToggleModule }] });
|
|
1928
1936
|
}
|
|
1929
1937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DsfrFieldToggleComponent, decorators: [{
|
|
1930
1938
|
type: Component,
|
|
1931
|
-
args: [{ selector: 'sot-dsfr-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatSlideToggleModule], template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"fr-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"fr-toggle__input\"\r\n [attr.id]=\"'toggle-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field.disabled\"/>\r\n <label\r\n class=\"fr-toggle__label\"\r\n [attr.for]=\"'toggle-' + uuid\"\r\n [attr.data-fr-checked-label]=\"field.checkedLabel\"\r\n [attr.data-fr-unchecked-label]=\"field.uncheckedLabel\"\r\n >{{ field.label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </label>\r\n <p\r\n class=\"fr-hint-text\">\r\n {{ field.description }}\r\n </p>\r\n </div>\r\n\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
1939
|
+
args: [{ selector: 'sot-dsfr-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass, MatCheckboxModule, MatSlideToggleModule], template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"fr-input-group\"\r\n [ngClass]=\"{\r\n 'fr-input-group--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'fr-input-group--valid': control && !control.untouched && control.valid ,\r\n 'fr-input-group--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"fr-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"fr-toggle__input\"\r\n [attr.id]=\"'toggle-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field().disabled\"/>\r\n <label\r\n class=\"fr-toggle__label\"\r\n [attr.for]=\"'toggle-' + uuid\"\r\n [attr.data-fr-checked-label]=\"field().checkedLabel\"\r\n [attr.data-fr-unchecked-label]=\"field().uncheckedLabel\"\r\n >{{ field().label }}\r\n @if (required) {\r\n <span class=\"red\">*</span>\r\n }\r\n </label>\r\n <p\r\n class=\"fr-hint-text\">\r\n {{ field().description }}\r\n </p>\r\n </div>\r\n\r\n <div\r\n class=\"fr-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"fr-message fr-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
1932
1940
|
}] });
|
|
1933
1941
|
|
|
1934
1942
|
const components$1 = {
|
|
@@ -1973,8 +1981,8 @@ class DsfrDynamicFieldDirective {
|
|
|
1973
1981
|
environmentInjector: this.injector
|
|
1974
1982
|
});
|
|
1975
1983
|
}
|
|
1976
|
-
this.component.instance.field = this.field
|
|
1977
|
-
this.component.instance.group = this.group
|
|
1984
|
+
this.component.instance.field = this.field;
|
|
1985
|
+
this.component.instance.group = this.group;
|
|
1978
1986
|
this.component.instance.instancePath = this.instancePath();
|
|
1979
1987
|
this.component.instance.path = this.path();
|
|
1980
1988
|
}
|
|
@@ -2018,7 +2026,7 @@ class DsfrDynamicFormComponent {
|
|
|
2018
2026
|
if (!this.form && this.config() != null) {
|
|
2019
2027
|
this.createForm();
|
|
2020
2028
|
}
|
|
2021
|
-
if (this.initialValues() && this.form
|
|
2029
|
+
if (this.initialValues() && this.form?.pristine) {
|
|
2022
2030
|
this.setValue(this.initialValues());
|
|
2023
2031
|
}
|
|
2024
2032
|
});
|
|
@@ -2076,33 +2084,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2076
2084
|
|
|
2077
2085
|
class ClassicDivTextComponent extends AbstractFieldComponent {
|
|
2078
2086
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicDivTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2079
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicDivTextComponent, isStandalone: true, selector: "sot-classic-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2087
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicDivTextComponent, isStandalone: true, selector: "sot-classic-div-text", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2080
2088
|
}
|
|
2081
2089
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicDivTextComponent, decorators: [{
|
|
2082
2090
|
type: Component,
|
|
2083
|
-
args: [{ selector: 'sot-classic-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field.className\">\n <div [innerHTML]=\"field.label\"></div>\n @if(field.description) {\n <p [innerHTML]=\"field.description\"></p>\n }\n</div>\n" }]
|
|
2091
|
+
args: [{ selector: 'sot-classic-div-text', standalone: true, imports: [NgClass], template: "<div class=\"sot-formfield sot-formfield-text\" [ngClass]=\"field().className\">\n <div [innerHTML]=\"field().label\"></div>\n @if(field().description) {\n <p [innerHTML]=\"field().description\"></p>\n }\n</div>\n" }]
|
|
2084
2092
|
}] });
|
|
2085
2093
|
|
|
2086
2094
|
class ClassicFieldCheckboxComponent extends AbstractControlFieldComponent {
|
|
2087
2095
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2088
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldCheckboxComponent, isStandalone: true, selector: "sot-classic-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'sot-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-checkbox--valid': control && !control.untouched && control.valid,\r\n 'sot-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2096
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldCheckboxComponent, isStandalone: true, selector: "sot-classic-field-checkbox", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'sot-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-checkbox--valid': control && !control.untouched && control.valid,\r\n 'sot-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2089
2097
|
}
|
|
2090
2098
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldCheckboxComponent, decorators: [{
|
|
2091
2099
|
type: Component,
|
|
2092
|
-
args: [{ selector: 'sot-classic-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field.name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'sot-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-checkbox--valid': control && !control.untouched && control.valid,\r\n 'sot-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2100
|
+
args: [{ selector: 'sot-classic-field-checkbox', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-checkbox\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <input\r\n type=\"checkbox\"\r\n [formControlName]=\"field().name\"\r\n [attr.id]=\"'sot-checkbox-' + uuid\"\r\n [ngClass]=\"{\r\n 'sot-checkbox--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-checkbox--valid': control && !control.untouched && control.valid,\r\n 'sot-checkbox--disabled': control && control.disabled,\r\n }\" />\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-checkbox-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-checkbox-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2093
2101
|
}] });
|
|
2094
2102
|
|
|
2095
2103
|
class ClassicFieldInputComponent extends AbstractControlFieldComponent {
|
|
2096
2104
|
inputType = 'text';
|
|
2097
2105
|
buttonAction(b) {
|
|
2098
|
-
if (b.action
|
|
2099
|
-
b.action(this.field, this.group, this.
|
|
2106
|
+
if (b.action) {
|
|
2107
|
+
b.action(this.field(), this.group(), this.data);
|
|
2100
2108
|
}
|
|
2101
2109
|
}
|
|
2102
2110
|
ngOnInit() {
|
|
2103
2111
|
super.ngOnInit();
|
|
2104
|
-
this.inputType = this.field.inputType ?? 'text';
|
|
2105
|
-
const control = this.group.get(this.field.name);
|
|
2112
|
+
this.inputType = this.field().inputType ?? 'text';
|
|
2113
|
+
const control = this.group().get(this.field().name);
|
|
2106
2114
|
if (control) {
|
|
2107
2115
|
control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
2108
2116
|
if (value?.length == 0) {
|
|
@@ -2112,19 +2120,19 @@ class ClassicFieldInputComponent extends AbstractControlFieldComponent {
|
|
|
2112
2120
|
}
|
|
2113
2121
|
}
|
|
2114
2122
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2115
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldInputComponent, isStandalone: true, selector: "sot-classic-field-input", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-input\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"field.inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2123
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldInputComponent, isStandalone: true, selector: "sot-classic-field-input", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-input\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"field().inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2116
2124
|
}
|
|
2117
2125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldInputComponent, decorators: [{
|
|
2118
2126
|
type: Component,
|
|
2119
|
-
args: [{ selector: 'sot-classic-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-input\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"field.inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [readonly]=\"field.readonly\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2127
|
+
args: [{ selector: 'sot-classic-field-input', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-input\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"field().inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [readonly]=\"field().readonly\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2120
2128
|
}] });
|
|
2121
2129
|
|
|
2122
2130
|
class ClassicGroupComponent extends AbstractControlFieldComponent {
|
|
2123
2131
|
get subGroup() {
|
|
2124
|
-
return this.group.controls[this.field.name];
|
|
2132
|
+
return this.group().controls[this.field().name];
|
|
2125
2133
|
}
|
|
2126
2134
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2127
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicGroupComponent, isStandalone: true, selector: "sot-classic-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'sot-accordion': field.accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'group-content-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'group-content-' + uuid\">\n @if (field.description) {\n <p class=\"sot-label-description\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2135
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicGroupComponent, isStandalone: true, selector: "sot-classic-group", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'sot-accordion': field().accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'group-content-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'group-content-' + uuid\">\n @if (field().description) {\n <p class=\"sot-label-description\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2128
2136
|
}
|
|
2129
2137
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicGroupComponent, decorators: [{
|
|
2130
2138
|
type: Component,
|
|
@@ -2132,23 +2140,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2132
2140
|
forwardRef(() => ClassiDynamicFieldDirective),
|
|
2133
2141
|
NgClass,
|
|
2134
2142
|
NgTemplateOutlet
|
|
2135
|
-
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'sot-accordion': field.accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'group-content-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'group-content-' + uuid\">\n @if (field.description) {\n <p class=\"sot-label-description\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field.fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
2143
|
+
], template: "<div class=\"sot-formfield sot-formfield-group\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield\"\n [ngClass]=\"{\n 'sot-accordion': field().accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'group-content-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'group-content-' + uuid\">\n @if (field().description) {\n <p class=\"sot-label-description\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n\n\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n @for (f of field().fields; track f.type + f.name) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"subGroup\"\n [instancePath]=\"instancePath\"\n ></ng-container>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-group-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n</ng-template>\n", styles: ["fieldset{border:none;padding:0;margin:0}\n"] }]
|
|
2136
2144
|
}] });
|
|
2137
2145
|
|
|
2138
2146
|
class ClassicArrayComponent extends AbstractControlFieldComponent {
|
|
2139
2147
|
dynamicService = inject(DynamicFormService);
|
|
2140
2148
|
ref = inject(ChangeDetectorRef);
|
|
2141
2149
|
get array() {
|
|
2142
|
-
return this.group.controls[this.field.name];
|
|
2150
|
+
return this.group().controls[this.field().name];
|
|
2143
2151
|
}
|
|
2144
2152
|
constructor() {
|
|
2145
2153
|
super();
|
|
2146
2154
|
}
|
|
2147
2155
|
addItem() {
|
|
2148
|
-
const i = this.field.instances.length > 0 ? this.field.instances[this.field.instances.length - 1].number + 1 : 0;
|
|
2149
|
-
const fields =
|
|
2156
|
+
const i = this.field().instances.length > 0 ? this.field().instances[this.field().instances.length - 1].number + 1 : 0;
|
|
2157
|
+
const fields = structuredClone(this.field().field.fields);
|
|
2150
2158
|
const grp = this.dynamicService.createGroup(fields, `${this.path}[${i}]`, null, null);
|
|
2151
|
-
this.field.instances.push({
|
|
2159
|
+
this.field().instances.push({
|
|
2152
2160
|
number: i,
|
|
2153
2161
|
group: grp,
|
|
2154
2162
|
fields
|
|
@@ -2159,7 +2167,7 @@ class ClassicArrayComponent extends AbstractControlFieldComponent {
|
|
|
2159
2167
|
deleteItem(index, inst) {
|
|
2160
2168
|
/*
|
|
2161
2169
|
TODO
|
|
2162
|
-
this.field.instances!.splice(index, 1);
|
|
2170
|
+
this.field().instances!.splice(index, 1);
|
|
2163
2171
|
for (const key of this.dynamicService.pathFieldMap.keys()) {
|
|
2164
2172
|
if (key.startsWith(`${this.path}[${inst.number}]`)) {
|
|
2165
2173
|
this.dynamicFormService.pathFieldMap.delete(key);
|
|
@@ -2171,7 +2179,7 @@ class ClassicArrayComponent extends AbstractControlFieldComponent {
|
|
|
2171
2179
|
this.ref.detectChanges();
|
|
2172
2180
|
}
|
|
2173
2181
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicArrayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2174
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicArrayComponent, isStandalone: true, selector: "sot-classic-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{\n 'sot-accordion': field.accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field.description) {\n <p class=\"sot-label-description\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\"\n [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field.deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field.disabled && (!field.maxNbRow || field.maxNbRow > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"addItem()\"\n >\n {{ field.addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormArrayName), selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicArrayComponent, isStandalone: true, selector: "sot-classic-array", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{\n 'sot-accordion': field().accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field().description) {\n <p class=\"sot-label-description\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\"\n [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field().deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"addItem()\"\n >\n {{ field().addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormArrayName), selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2175
2183
|
}
|
|
2176
2184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicArrayComponent, decorators: [{
|
|
2177
2185
|
type: Component,
|
|
@@ -2180,12 +2188,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2180
2188
|
NgClass,
|
|
2181
2189
|
ReactiveFormsModule,
|
|
2182
2190
|
NgTemplateOutlet
|
|
2183
|
-
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field.className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{\n 'sot-accordion': field.accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field.accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field.labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field.opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field.label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field.opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field.description) {\n <p class=\"sot-label-description\">{{ field.description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field.labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\"\n [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group\">\n <div [formArrayName]=\"field.name\">\n @for (inst of field.instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field.elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field.itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field.elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field.disabled && (!field.minNbRow || field.minNbRow < array.controls.length)) {\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field.deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field.disabled && (!field.maxNbRow || field.maxNbRow > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"addItem()\"\n >\n {{ field.addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"] }]
|
|
2191
|
+
], template: "<div class=\"sot-formfield sot-formfield-array\" [ngClass]=\"field().className\">\n <fieldset\n class=\"sot-formfield-wrapper sot-fieldset\"\n [ngClass]=\"{\n 'sot-accordion': field().accordion,\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid,\n 'sot-formfield--disabled': (control && control.disabled),\n }\"\n >\n @if (field().accordion) {\n <legend\n class=\"sot-accordion-title\"\n [ngClass]=\"field().labelClassName\">\n <button\n type=\"button\"\n class=\"sot-accordion-button\"\n [attr.aria-expanded]=\"!!field().opened\"\n [attr.aria-controls]=\"'array-content-' + uuid\">\n {{ field().label }}\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n </button>\n </legend>\n <div\n class=\"sot-collapse sot-accordion-content sot-fieldset-content\"\n [ngClass]=\"{ 'sot-collapse--expanded': !!field().opened }\"\n [attr.id]=\"'array-content-' + uuid\">\n @if (field().description) {\n <p class=\"sot-label-description\">{{ field().description }}</p>\n }\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n } @else {\n <legend\n class=\"sot-fieldset-legend\"\n [ngClass]=\"field().labelClassName\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </legend>\n <div class=\"sot-fieldset-content\"\n [attr.id]=\"'array-content-' + uuid\">\n <div *ngTemplateOutlet=\"groupFields\"></div>\n </div>\n }\n </fieldset>\n</div>\n\n<ng-template #groupFields>\n <div class=\"sot-formfield-array\" [formGroup]=\"group()\">\n <div [formArrayName]=\"field().name\">\n @for (inst of field().instances; track inst; let i = $index) {\n <fieldset class=\"sot-formfield-array-element\"\n [ngClass]=\"field().elementClassName\">\n <legend class=\"sot-formfield-array-element-label\">\n {{ field().itemLabel ?? 'Item' }} {{ inst.number + 1 }}\n </legend>\n <div class=\"sot-formfield-array-element-content\"\n [ngClass]=\"field().elementContentClassName\">\n @for (f of inst.fields; track f.name + f.type) {\n <div [hidden]=\"f.hidden\" [ngClass]=\"f.hostClassName\">\n <ng-container classicDynamicField\n [type]=\"f.type\"\n [path]=\"path + '.' + f.name\"\n [field]=\"f\"\n [group]=\"inst.group\"\n [instancePath]=\"path + '[' + inst.number + ']'\"\n ></ng-container>\n </div>\n }\n </div>\n <div class=\"sot-formfield-array-element-action\">\n @if (!field().disabled && (!field().minNbRow || field().minNbRow! < array.controls.length)) {\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"deleteItem(i, inst)\"\n >\n {{ field().deleteButton?.label ?? 'Delete' }}\n </button>\n }\n </div>\n </fieldset>\n }\n @if (!field().disabled && (!field().maxNbRow || field().maxNbRow! > array.controls.length)) {\n <div class=\"sot-formfield-array-add-button\">\n <button type=\"button\"\n class=\"sot-button\"\n (click)=\"addItem()\"\n >\n {{ field().addButton?.label ?? 'Add' }}\n </button>\n </div>\n }\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-array-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n </div>\n</ng-template>\n", styles: ["fieldset.dynamic-field-array{border:none;padding:0;margin:0}.dynamic-field-array-add-button{padding:2rem 0}.dynamic-field-array{margin-bottom:2rem}\n"] }]
|
|
2184
2192
|
}], ctorParameters: () => [] });
|
|
2185
2193
|
|
|
2186
2194
|
class ClassicRowComponent extends AbstractFieldComponent {
|
|
2187
2195
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2188
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicRowComponent, isStandalone: true, selector: "sot-classic-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n classicDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }] });
|
|
2196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicRowComponent, isStandalone: true, selector: "sot-classic-row", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n classicDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => ClassiDynamicFieldDirective), selector: "[classicDynamicField]", inputs: ["type", "path", "field", "group", "instancePath"] }] });
|
|
2189
2197
|
}
|
|
2190
2198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicRowComponent, decorators: [{
|
|
2191
2199
|
type: Component,
|
|
@@ -2193,7 +2201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2193
2201
|
ReactiveFormsModule,
|
|
2194
2202
|
NgClass,
|
|
2195
2203
|
forwardRef(() => ClassiDynamicFieldDirective)
|
|
2196
|
-
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field.className\">\n @for (f of field.fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n classicDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
2204
|
+
], template: "<div class=\"sot-formfield sot-formfield-row\" [ngClass]=\"field().className\">\n @for (f of field().fields; track f.type + f.name) {\n <div\n [hidden]=\"f.hidden\"\n [ngClass]=\"f.hostClassName\">\n <ng-container\n classicDynamicField\n [path]=\"path + '.' + f.name\"\n [type]=\"f.type\"\n [field]=\"f\"\n [group]=\"group()\"\n [instancePath]=\"instancePath\"\n >\n </ng-container>\n </div>\n }\n</div>\n" }]
|
|
2197
2205
|
}] });
|
|
2198
2206
|
|
|
2199
2207
|
class PasswordValidators {
|
|
@@ -2215,16 +2223,16 @@ class ClassicFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
2215
2223
|
iconErrorLabel;
|
|
2216
2224
|
iconSuccessLabel;
|
|
2217
2225
|
buttonAction(b) {
|
|
2218
|
-
if (b.action
|
|
2219
|
-
b.action(this.field, this.group, this.
|
|
2226
|
+
if (b.action) {
|
|
2227
|
+
b.action(this.field(), this.group(), this.data);
|
|
2220
2228
|
}
|
|
2221
2229
|
}
|
|
2222
2230
|
ngOnInit() {
|
|
2223
2231
|
super.ngOnInit();
|
|
2224
|
-
this.showPasswordLabel = this.field.labels?.showPassword ?? "Show password";
|
|
2225
|
-
this.hidePasswordLabel = this.field.labels?.hidePassword ?? "Hide password";
|
|
2226
|
-
this.iconSuccessLabel = this.field.labels?.iconSuccess ?? "Success";
|
|
2227
|
-
this.iconErrorLabel = this.field.labels?.iconError ?? "Error";
|
|
2232
|
+
this.showPasswordLabel = this.field().labels?.showPassword ?? "Show password";
|
|
2233
|
+
this.hidePasswordLabel = this.field().labels?.hidePassword ?? "Hide password";
|
|
2234
|
+
this.iconSuccessLabel = this.field().labels?.iconSuccess ?? "Success";
|
|
2235
|
+
this.iconErrorLabel = this.field().labels?.iconError ?? "Error";
|
|
2228
2236
|
if (this.control) {
|
|
2229
2237
|
this.control.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
2230
2238
|
if (value?.length == 0) {
|
|
@@ -2256,29 +2264,29 @@ class ClassicFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
2256
2264
|
return this.control.value && !this.control.hasError("requiresSpecialChars");
|
|
2257
2265
|
}
|
|
2258
2266
|
setPasswordValidators() {
|
|
2259
|
-
if (this.field.minlength) {
|
|
2260
|
-
this.control?.addValidators(Validators.minLength(this.field.minlength));
|
|
2267
|
+
if (this.field().minlength) {
|
|
2268
|
+
this.control?.addValidators(Validators.minLength(this.field().minlength));
|
|
2261
2269
|
}
|
|
2262
|
-
if (this.field.maxlength) {
|
|
2263
|
-
this.control?.addValidators(Validators.maxLength(this.field.maxlength));
|
|
2270
|
+
if (this.field().maxlength) {
|
|
2271
|
+
this.control?.addValidators(Validators.maxLength(this.field().maxlength));
|
|
2264
2272
|
}
|
|
2265
|
-
if (this.field.requiresDigit) {
|
|
2273
|
+
if (this.field().requiresDigit) {
|
|
2266
2274
|
this.control?.addValidators(PasswordValidators.patternValidator(/(?=.*[0-9])/, {
|
|
2267
2275
|
requiresDigit: true
|
|
2268
2276
|
}));
|
|
2269
2277
|
}
|
|
2270
|
-
if (this.field.requiresUppercase) {
|
|
2278
|
+
if (this.field().requiresUppercase) {
|
|
2271
2279
|
this.control?.addValidators(PasswordValidators.patternValidator(/(?=.*[A-Z])/, {
|
|
2272
2280
|
requiresUppercase: true
|
|
2273
2281
|
}));
|
|
2274
2282
|
}
|
|
2275
|
-
if (this.field.requiresLowercase) {
|
|
2283
|
+
if (this.field().requiresLowercase) {
|
|
2276
2284
|
this.control?.addValidators(PasswordValidators.patternValidator(/(?=.*[a-z])/, {
|
|
2277
2285
|
requiresLowercase: true
|
|
2278
2286
|
}));
|
|
2279
2287
|
}
|
|
2280
|
-
if (this.field.requiresSpecialChars) {
|
|
2281
|
-
const chars = this.field.specialChars?.join("") ?? "$@^!%*?&";
|
|
2288
|
+
if (this.field().requiresSpecialChars) {
|
|
2289
|
+
const chars = this.field().specialChars?.join("") ?? "$@^!%*?&";
|
|
2282
2290
|
const regex = "(?=.*[" + chars + "])";
|
|
2283
2291
|
this.control?.addValidators(PasswordValidators.patternValidator(new RegExp(regex), {
|
|
2284
2292
|
requiresSpecialChars: true
|
|
@@ -2286,69 +2294,70 @@ class ClassicFieldPasswordComponent extends AbstractControlFieldComponent {
|
|
|
2286
2294
|
}
|
|
2287
2295
|
}
|
|
2288
2296
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldPasswordComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2289
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldPasswordComponent, isStandalone: true, selector: "sot-classic-field-password", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"sot-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <span [ngClass]=\"minLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <span [ngClass]=\"maxLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"maxLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <span [ngClass]=\"requiresDigitValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresDigitValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <span [ngClass]=\"requiresUppercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresUppercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <span [ngClass]=\"requiresLowercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresLowercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <span [ngClass]=\"requiresSpecialCharsValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresSpecialCharsValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2297
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldPasswordComponent, isStandalone: true, selector: "sot-classic-field-password", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"sot-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <span [ngClass]=\"minLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <span [ngClass]=\"maxLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"maxLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <span [ngClass]=\"requiresDigitValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresDigitValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <span [ngClass]=\"requiresUppercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresUppercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <span [ngClass]=\"requiresLowercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresLowercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <span [ngClass]=\"requiresSpecialCharsValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresSpecialCharsValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2290
2298
|
}
|
|
2291
2299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldPasswordComponent, decorators: [{
|
|
2292
2300
|
type: Component,
|
|
2293
|
-
args: [{ selector: 'sot-classic-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field.autocomplete ?? 'off'\"\r\n [maxlength]=\"field.maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"sot-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field.minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <span [ngClass]=\"minLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <span [ngClass]=\"maxLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"maxLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field.requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <span [ngClass]=\"requiresDigitValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresDigitValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field.requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <span [ngClass]=\"requiresUppercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresUppercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <span [ngClass]=\"requiresLowercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresLowercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field.requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <span [ngClass]=\"requiresSpecialCharsValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresSpecialCharsValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field.labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}\n"] }]
|
|
2301
|
+
args: [{ selector: 'sot-classic-field-password', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-password\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': (control && control.disabled),\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-input-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n\r\n <input\r\n class=\"sot-input\"\r\n [ngClass]=\"{\r\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-input--valid': control && !control.untouched && control.valid,\r\n 'sot-input--disabled': (control && control.disabled),\r\n }\"\r\n [type]=\"inputType\"\r\n [attr.id]=\"'sot-input-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [autocomplete]=\"field().autocomplete ?? 'off'\"\r\n [maxlength]=\"field().maxlength ?? 10000000\"/>\r\n\r\n <button type=\"button\" class=\"sot-button\"\r\n (click)=\"tooglePassword()\"\r\n [attr.aria-label]=\"inputType === 'password' ? showPasswordLabel : hidePasswordLabel\"\r\n [attr.aria-pressed]=\"inputType === 'password'\">\r\n @if(inputType === 'password') {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-off-fill\"></span>\r\n } @else {\r\n <span aria-hidden=\"true\" class=\"sot-icon-eye-fill\"></span>\r\n }\r\n </button>\r\n\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <ul class=\"password-description\" [id]=\"uuid + '-description'\">\r\n @if (field().minlength) {\r\n <li [ngClass]=\"{ 'text-success': minLengthValid, 'text-error': !minLengthValid }\">\r\n <span [ngClass]=\"minLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"minLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.minlength ?? \"Must be at least 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().maxlength) {\r\n <li [ngClass]=\"{ 'text-success': maxLengthValid, 'text-error': !maxLengthValid }\">\r\n <span [ngClass]=\"maxLengthValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"maxLengthValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.maxlength ?? \"Must be at most 8 characters long\" }}\r\n </li>\r\n }\r\n @if (field().requiresDigit) {\r\n <li [ngClass]=\"{ 'text-success': requiresDigitValid, 'text-error': !requiresDigitValid }\">\r\n <span [ngClass]=\"requiresDigitValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresDigitValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresDigit ?? \"Must contain at least 1 digit\" }}\r\n </li>\r\n }\r\n @if (field().requiresUppercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresUppercaseValid, 'text-error': !requiresUppercaseValid }\">\r\n <span [ngClass]=\"requiresUppercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresUppercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresUppercase ?? \"Must contain at least 1 uppercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresLowercase) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresLowercaseValid, 'text-error': !requiresLowercaseValid }\">\r\n <span [ngClass]=\"requiresLowercaseValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresLowercaseValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresLowercase ?? \"Must contain at least 1 lowercase character\" }}\r\n </li>\r\n }\r\n @if (field().requiresSpecialChars) {\r\n <li\r\n [ngClass]=\"{ 'text-success': requiresSpecialCharsValid, 'text-error': !requiresSpecialCharsValid }\">\r\n <span [ngClass]=\"requiresSpecialCharsValid ? 'check' : 'error'\"\r\n [attr.aria-label]=\"requiresSpecialCharsValid ? iconSuccessLabel : iconErrorLabel\"></span>\r\n {{ field().labels?.requiresSpecialChars ?? \"Must contain at least 1 special character\" }}\r\n </li>\r\n }\r\n </ul>\r\n</div>\r\n\r\n", styles: [".sot-formfield-input{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}.password-description{list-style-type:none;margin-block-start:0}.password-description li{display:flex;flex-direction:row;align-items:center}\n"] }]
|
|
2294
2302
|
}] });
|
|
2295
2303
|
|
|
2296
2304
|
class ClassicFieldRadioButtonComponent extends AbstractControlFieldComponent {
|
|
2297
2305
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldRadioButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2298
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldRadioButtonComponent, isStandalone: true, selector: "sot-classic-field-radio-button", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-radio\" [ngClass]=\"field.className\">\r\n <fieldset\r\n class=\"sot-formfield-wrapper sot-fieldset\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group\">\r\n <legend\r\n class=\"sot-fieldset-legend\"\r\n [ngClass]=\"field.labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n <span class=\"sot-legend-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n @if (field.options) {\r\n @for (item of field.options; track item; let i = $index) {\r\n <div\r\n class=\"sot-fieldset-element\"\r\n [ngClass]=\"{ 'sot-fieldset--inline': !field.verticalAlign }\">\r\n <div class=\"sot-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [attr.disabled]=\"field.disabledKey && !!item[field.disabledKey] ? true : undefined\"\r\n [ngClass]=\"{\r\n 'sot-radio--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-radio--valid': control && !control.untouched && control.valid,\r\n 'sot-radio--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n <span class=\"sot-label-text\"\r\n [innerHTML]=\"field.labelKey ? item[field.labelKey!] : item\"></span>\r\n @if (field.descriptionKey) {\r\n <span class=\"sot-label-description\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-radio-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2306
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldRadioButtonComponent, isStandalone: true, selector: "sot-classic-field-radio-button", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-radio\" [ngClass]=\"field().className\">\r\n <fieldset\r\n class=\"sot-formfield-wrapper sot-fieldset\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group()\">\r\n <legend\r\n class=\"sot-fieldset-legend\"\r\n [ngClass]=\"field().labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n <span class=\"sot-legend-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n @if (field().options) {\r\n @for (item of field().options; track item; let i = $index) {\r\n <div\r\n class=\"sot-fieldset-element\"\r\n [ngClass]=\"{ 'sot-fieldset--inline': !field().verticalAlign }\">\r\n <div class=\"sot-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [attr.disabled]=\"field().disabledKey && !!item[field().disabledKey!] ? true : undefined\"\r\n [ngClass]=\"{\r\n 'sot-radio--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-radio--valid': control && !control.untouched && control.valid,\r\n 'sot-radio--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n <span class=\"sot-label-text\"\r\n [innerHTML]=\"field().labelKey ? item[field().labelKey!] : item\"></span>\r\n @if (field().descriptionKey) {\r\n <span class=\"sot-label-description\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-radio-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2299
2307
|
}
|
|
2300
2308
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldRadioButtonComponent, decorators: [{
|
|
2301
2309
|
type: Component,
|
|
2302
|
-
args: [{ selector: 'sot-classic-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-radio\" [ngClass]=\"field.className\">\r\n <fieldset\r\n class=\"sot-formfield-wrapper sot-fieldset\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group\">\r\n <legend\r\n class=\"sot-fieldset-legend\"\r\n [ngClass]=\"field.labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n <span class=\"sot-legend-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </legend>\r\n @if (field.options) {\r\n @for (item of field.options; track item; let i = $index) {\r\n <div\r\n class=\"sot-fieldset-element\"\r\n [ngClass]=\"{ 'sot-fieldset--inline': !field.verticalAlign }\">\r\n <div class=\"sot-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field.name\"\r\n [attr.disabled]=\"field.disabledKey && !!item[field.disabledKey] ? true : undefined\"\r\n [ngClass]=\"{\r\n 'sot-radio--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-radio--valid': control && !control.untouched && control.valid,\r\n 'sot-radio--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n <span class=\"sot-label-text\"\r\n [innerHTML]=\"field.labelKey ? item[field.labelKey!] : item\"></span>\r\n @if (field.descriptionKey) {\r\n <span class=\"sot-label-description\">{{ item[field.descriptionKey] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-radio-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
2310
|
+
args: [{ selector: 'sot-classic-field-radio-button', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-radio\" [ngClass]=\"field().className\">\r\n <fieldset\r\n class=\"sot-formfield-wrapper sot-fieldset\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\"\r\n [id]=\"'radio-' + uuid\"\r\n [attr.aria-labelledby]=\"'radio-legend-' + uuid\"\r\n [formGroup]=\"group()\">\r\n <legend\r\n class=\"sot-fieldset-legend\"\r\n [ngClass]=\"field().labelClassName\"\r\n [id]=\"'radio-legend-' + uuid\">\r\n <span class=\"sot-legend-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </legend>\r\n @if (field().options) {\r\n @for (item of field().options; track item; let i = $index) {\r\n <div\r\n class=\"sot-fieldset-element\"\r\n [ngClass]=\"{ 'sot-fieldset--inline': !field().verticalAlign }\">\r\n <div class=\"sot-radio-group\">\r\n <input\r\n type=\"radio\"\r\n [id]=\"'radio-' + uuid + '-' + i\"\r\n [value]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [attr.name]=\"uuid\"\r\n [formControlName]=\"field().name\"\r\n [attr.disabled]=\"field().disabledKey && !!item[field().disabledKey!] ? true : undefined\"\r\n [ngClass]=\"{\r\n 'sot-radio--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-radio--valid': control && !control.untouched && control.valid,\r\n 'sot-radio--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-label\"\r\n [for]=\"'radio-' + uuid + '-' + i\">\r\n <span class=\"sot-label-text\"\r\n [innerHTML]=\"field().labelKey ? item[field().labelKey!] : item\"></span>\r\n @if (field().descriptionKey) {\r\n <span class=\"sot-label-description\">{{ item[field().descriptionKey!] }}</span>\r\n }\r\n </label>\r\n </div>\r\n </div>\r\n }\r\n }\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-radio-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </fieldset>\r\n</div>\r\n", styles: [".verticalAlign{display:flex;flex-direction:column}.horizontalAlign{display:flex;flex-direction:row;gap:2rem}.sot-formfield-radiobutton-label{display:flex;flex-direction:column}.sot-formfield-radiobutton-item ::ng-deep label{display:flex;flex-direction:column}\n"] }]
|
|
2303
2311
|
}] });
|
|
2304
2312
|
|
|
2305
2313
|
class ClassicFieldSelectComponent extends AbstractControlFieldComponent {
|
|
2306
2314
|
options = [];
|
|
2307
2315
|
ngOnInit() {
|
|
2308
2316
|
super.ngOnInit();
|
|
2309
|
-
|
|
2310
|
-
|
|
2317
|
+
const options = this.field().options;
|
|
2318
|
+
if (isObservable(options)) {
|
|
2319
|
+
options.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((options) => {
|
|
2311
2320
|
this.options = options;
|
|
2312
2321
|
});
|
|
2313
2322
|
}
|
|
2314
2323
|
else {
|
|
2315
|
-
this.options =
|
|
2324
|
+
this.options = options;
|
|
2316
2325
|
}
|
|
2317
2326
|
}
|
|
2318
2327
|
buttonAction(b) {
|
|
2319
|
-
if (b.action
|
|
2320
|
-
b.action(this.field, this.group, this.
|
|
2328
|
+
if (b.action) {
|
|
2329
|
+
b.action(this.field(), this.group(), this.data);
|
|
2321
2330
|
}
|
|
2322
2331
|
}
|
|
2323
2332
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2324
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldSelectComponent, isStandalone: true, selector: "sot-classic-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"sot-select\"\r\n [multiple]=\"field.multiple\"\r\n [ngClass]=\"{\r\n 'sot-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-select--valid': control && !control.untouched && control.valid,\r\n 'sot-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field.name\">\r\n @if (field.resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2333
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldSelectComponent, isStandalone: true, selector: "sot-classic-field-select", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"sot-select\"\r\n [multiple]=\"field().multiple\"\r\n [ngClass]=\"{\r\n 'sot-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-select--valid': control && !control.untouched && control.valid,\r\n 'sot-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field().name\">\r\n @if (field().resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2325
2334
|
}
|
|
2326
2335
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldSelectComponent, decorators: [{
|
|
2327
2336
|
type: Component,
|
|
2328
|
-
args: [{ selector: 'sot-classic-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field.labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field.prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"sot-select\"\r\n [multiple]=\"field.multiple\"\r\n [ngClass]=\"{\r\n 'sot-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-select--valid': control && !control.untouched && control.valid,\r\n 'sot-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field.name\">\r\n @if (field.resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field.resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field.options) {\r\n @if (field.groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field.groupLabelKey ? group[field.groupLabelKey] : ''\">\r\n @if (field.groupOptionsKey && group[field.groupOptionsKey]) {\r\n @for (item of group[field.groupOptionsKey]; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field.valueKey ? item[field.valueKey] : item\"\r\n [disabled]=\"field.disabledKey ? item[field.disabledKey] : false\">\r\n {{ field.labelKey ? item[field.labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field.suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2337
|
+
args: [{ selector: 'sot-classic-field-select', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-select\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <label\r\n class=\"sot-label\"\r\n [ngClass]=\"field().labelClassName\"\r\n [attr.for]=\"'sot-select-' + uuid\">\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n <div class=\"sot-input-wrapper\">\r\n @for (prefix of field().prefixes; track prefix) {\r\n <span class=\"sot-formfield-prefix\">\r\n @if (prefix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"prefix.actionAriaLabel\"\r\n (click)=\"buttonAction(prefix)\"\r\n >{{ prefix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"prefix.label\"></span>\r\n }\r\n </span>\r\n }\r\n <select\r\n class=\"sot-select\"\r\n [multiple]=\"field().multiple\"\r\n [ngClass]=\"{\r\n 'sot-select--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-select--valid': control && !control.untouched && control.valid,\r\n 'sot-select--disabled': control && control.disabled,\r\n }\"\r\n [attr.id]=\"'sot-select-' + uuid\"\r\n [formControlName]=\"field().name\">\r\n @if (field().resetOption) {\r\n <option [ngValue]=\"undefined\">\r\n {{ field().resetOptionLabel }}\r\n </option>\r\n }\r\n\r\n @if (field().options) {\r\n @if (field().groupLabelKey) {\r\n @for (group of options; track group) {\r\n <optgroup [label]=\"field().groupLabelKey ? group[field().groupLabelKey!] : ''\">\r\n @if (field().groupOptionsKey && group[field().groupOptionsKey!]) {\r\n @for (item of group[field().groupOptionsKey!]; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n </optgroup>\r\n }\r\n } @else {\r\n @for (item of options; track item) {\r\n <option\r\n [ngValue]=\"field().valueKey ? item[field().valueKey!] : item\"\r\n [disabled]=\"field().disabledKey ? item[field().disabledKey!] : false\">\r\n {{ field().labelKey ? item[field().labelKey!] : item }}\r\n </option>\r\n }\r\n }\r\n\r\n }\r\n </select>\r\n @for (suffix of field().suffixes; track suffix) {\r\n <span class=\"sot-formfield-suffix\">\r\n @if (suffix.action) {\r\n <button type=\"button\"\r\n class=\"sot-button\"\r\n [attr.aria-label]=\"suffix.actionAriaLabel\"\r\n (click)=\"buttonAction(suffix)\"\r\n >{{ suffix.label }}</button>\r\n } @else {\r\n <span [innerHTML]=\"suffix.label\"></span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-select-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sot-formfield-select{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2329
2338
|
}] });
|
|
2330
2339
|
|
|
2331
2340
|
class ClassicFieldToggleComponent extends AbstractControlFieldComponent {
|
|
2332
2341
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldToggleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2333
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldToggleComponent, isStandalone: true, selector: "sot-classic-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"sot-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"sot-toggle-input\"\r\n [attr.id]=\"'sot-toggle-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field.disabled\"\r\n [ngClass]=\"{\r\n 'sot-toggle--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-toggle--valid': control && !control.untouched && control.valid,\r\n 'sot-toggle--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-toggle-label\"\r\n [attr.for]=\"'sot-toggle-' + uuid\"\r\n [attr.data-sot-checked-label]=\"field.checkedLabel\"\r\n [attr.data-sot-unchecked-label]=\"field.uncheckedLabel\"\r\n >\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2342
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldToggleComponent, isStandalone: true, selector: "sot-classic-field-toggle", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"sot-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"sot-toggle-input\"\r\n [attr.id]=\"'sot-toggle-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field().disabled\"\r\n [ngClass]=\"{\r\n 'sot-toggle--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-toggle--valid': control && !control.untouched && control.valid,\r\n 'sot-toggle--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-toggle-label\"\r\n [attr.for]=\"'sot-toggle-' + uuid\"\r\n [attr.data-sot-checked-label]=\"field().checkedLabel\"\r\n [attr.data-sot-unchecked-label]=\"field().uncheckedLabel\"\r\n >\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2334
2343
|
}
|
|
2335
2344
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldToggleComponent, decorators: [{
|
|
2336
2345
|
type: Component,
|
|
2337
|
-
args: [{ selector: 'sot-classic-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field.className\">\r\n <div\r\n [formGroup]=\"group\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"sot-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"sot-toggle-input\"\r\n [attr.id]=\"'sot-toggle-' + uuid\"\r\n [formControlName]=\"field.name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field.disabled\"\r\n [ngClass]=\"{\r\n 'sot-toggle--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-toggle--valid': control && !control.untouched && control.valid,\r\n 'sot-toggle--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-toggle-label\"\r\n [attr.for]=\"'sot-toggle-' + uuid\"\r\n [attr.data-sot-checked-label]=\"field.checkedLabel\"\r\n [attr.data-sot-unchecked-label]=\"field.uncheckedLabel\"\r\n >\r\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field.description) {\r\n <span class=\"sot-label-description\">{{ field.description }}</span>\r\n }\r\n </label>\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field.validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2346
|
+
args: [{ selector: 'sot-classic-field-toggle', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-toogle\" [ngClass]=\"field().className\">\r\n <div\r\n [formGroup]=\"group()\"\r\n class=\"sot-formfield-wrapper\"\r\n [ngClass]=\"{\r\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\r\n 'sot-formfield--disabled': control && control.disabled,\r\n }\">\r\n <div class=\"sot-toggle\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"sot-toggle-input\"\r\n [attr.id]=\"'sot-toggle-' + uuid\"\r\n [formControlName]=\"field().name\"\r\n [required]=\"!!required\"\r\n [attr.disabled]=\"field().disabled\"\r\n [ngClass]=\"{\r\n 'sot-toggle--error': control && !control.untouched && !control.valid && !control.disabled,\r\n 'sot-toggle--valid': control && !control.untouched && control.valid,\r\n 'sot-toggle--disabled': control && control.disabled,\r\n }\"/>\r\n <label\r\n class=\"sot-toggle-label\"\r\n [attr.for]=\"'sot-toggle-' + uuid\"\r\n [attr.data-sot-checked-label]=\"field().checkedLabel\"\r\n [attr.data-sot-unchecked-label]=\"field().uncheckedLabel\"\r\n >\r\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\r\n @if (required) {\r\n <span class=\"sot-label-required\">*</span>\r\n }\r\n @if (field().description) {\r\n <span class=\"sot-label-description\">{{ field().description }}</span>\r\n }\r\n </label>\r\n </div>\r\n <div\r\n class=\"sot-messages-group\"\r\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\r\n aria-live=\"assertive\">\r\n @for (validation of field().validations; track validation) {\r\n @if (control && !control.untouched && control.hasError(validation.name)) {\r\n <p class=\"sot-message sot-message--error\">\r\n {{ validation.message }}\r\n </p>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
2338
2347
|
}] });
|
|
2339
2348
|
|
|
2340
2349
|
class ClassicFieldTextareaComponent extends AbstractControlFieldComponent {
|
|
2341
2350
|
buttonAction(b) {
|
|
2342
|
-
if (b.action && this.field && this.group) {
|
|
2343
|
-
b.action(this.field, this.group, this.
|
|
2351
|
+
if (b.action && this.field() && this.group()) {
|
|
2352
|
+
b.action(this.field(), this.group(), this.data);
|
|
2344
2353
|
}
|
|
2345
2354
|
}
|
|
2346
2355
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2347
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldTextareaComponent, isStandalone: true, selector: "sot-classic-field-textarea", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field.className\">\n <div\n [formGroup]=\"group\"\n class=\"sot-formfield-wrapper\"\n [ngClass]=\"{\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\n 'sot-formfield--disabled': control && control.disabled,\n }\">\n <label\n class=\"sot-label\"\n [ngClass]=\"field.labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </label>\n <div class=\"sot-input-wrapper\">\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\">\n @if (prefix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"sot-textarea\"\n [ngClass]=\"{\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-input--valid': control && !control.untouched && control.valid ,\n 'sot-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [rows]=\"field.rows\"\n [maxlength]=\"field.maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2356
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ClassicFieldTextareaComponent, isStandalone: true, selector: "sot-classic-field-textarea", usesInheritance: true, ngImport: i0, template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field().className\">\n <div\n [formGroup]=\"group()\"\n class=\"sot-formfield-wrapper\"\n [ngClass]=\"{\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\n 'sot-formfield--disabled': control && control.disabled,\n }\">\n <label\n class=\"sot-label\"\n [ngClass]=\"field().labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </label>\n <div class=\"sot-input-wrapper\">\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\">\n @if (prefix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"sot-textarea\"\n [ngClass]=\"{\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-input--valid': control && !control.untouched && control.valid ,\n 'sot-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [rows]=\"field().rows\"\n [maxlength]=\"field().maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2348
2357
|
}
|
|
2349
2358
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ClassicFieldTextareaComponent, decorators: [{
|
|
2350
2359
|
type: Component,
|
|
2351
|
-
args: [{ selector: 'sot-classic-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field.className\">\n <div\n [formGroup]=\"group\"\n class=\"sot-formfield-wrapper\"\n [ngClass]=\"{\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\n 'sot-formfield--disabled': control && control.disabled,\n }\">\n <label\n class=\"sot-label\"\n [ngClass]=\"field.labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n <span class=\"sot-label-text\" [innerHTML]=\"field.label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field.description) {\n <span class=\"sot-label-description\">{{ field.description }}</span>\n }\n </label>\n <div class=\"sot-input-wrapper\">\n @for (prefix of field.prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\">\n @if (prefix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"sot-textarea\"\n [ngClass]=\"{\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-input--valid': control && !control.untouched && control.valid ,\n 'sot-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field.name\"\n [required]=\"!!required\"\n [readonly]=\"field.readonly\"\n [rows]=\"field.rows\"\n [maxlength]=\"field.maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field.suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field.validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2360
|
+
args: [{ selector: 'sot-classic-field-textarea', standalone: true, imports: [ReactiveFormsModule, NgClass], template: "<div class=\"sot-formfield sot-formfield-textarea\" [ngClass]=\" field().className\">\n <div\n [formGroup]=\"group()\"\n class=\"sot-formfield-wrapper\"\n [ngClass]=\"{\n 'sot-formfield--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-formfield--valid': control && !control.untouched && control.valid ,\n 'sot-formfield--disabled': control && control.disabled,\n }\">\n <label\n class=\"sot-label\"\n [ngClass]=\"field().labelClassName\"\n [attr.for]=\"'sot-textarea-' + uuid\">\n <span class=\"sot-label-text\" [innerHTML]=\"field().label\"></span>\n @if (required) {\n <span class=\"sot-label-required\">*</span>\n }\n @if (field().description) {\n <span class=\"sot-label-description\">{{ field().description }}</span>\n }\n </label>\n <div class=\"sot-input-wrapper\">\n @for (prefix of field().prefixes; track prefix) {\n <span class=\"sot-formfield-prefix\">\n @if (prefix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"prefix.actionAriaLabel\"\n (click)=\"buttonAction(prefix)\"\n >{{ prefix.label }}</button>\n } @else {\n <span [innerHTML]=\"prefix.label\"></span>\n }\n </span>\n }\n\n <textarea\n class=\"sot-textarea\"\n [ngClass]=\"{\n 'sot-input--error': control && !control.untouched && !control.valid && !control.disabled,\n 'sot-input--valid': control && !control.untouched && control.valid ,\n 'sot-input--disabled': control && control.disabled,\n }\"\n [attr.id]=\"'sot-textarea-' + uuid\"\n [formControlName]=\"field().name\"\n [required]=\"!!required\"\n [readonly]=\"field().readonly\"\n [rows]=\"field().rows\"\n [maxlength]=\"field().maxlength ?? 10000000\">\n </textarea>\n\n @for (suffix of field().suffixes; track suffix) {\n <span class=\"sot-formfield-suffix\">\n @if (suffix.action) {\n <button type=\"button\"\n class=\"sot-button\"\n [attr.aria-label]=\"suffix.actionAriaLabel\"\n (click)=\"buttonAction(suffix)\"\n >{{ suffix.label }}</button>\n } @else {\n <span [innerHTML]=\"suffix.label\"></span>\n }\n </span>\n }\n </div>\n <div\n class=\"sot-messages-group\"\n [attr.id]=\"'sot-input-' + uuid + '-error'\"\n aria-live=\"assertive\">\n @for (validation of field().validations; track validation) {\n @if (control && !control.untouched && control.hasError(validation.name)) {\n <p class=\"sot-message sot-message--error\">\n {{ validation.message }}\n </p>\n }\n }\n </div>\n </div>\n</div>\n", styles: [".sot-formfield-textarea{width:100%}.sot-formfield-prefix,.sot-formfield-suffix{padding:0 .5rem}\n"] }]
|
|
2352
2361
|
}] });
|
|
2353
2362
|
|
|
2354
2363
|
const components = {
|
|
@@ -2394,8 +2403,8 @@ class ClassiDynamicFieldDirective {
|
|
|
2394
2403
|
environmentInjector: this.injector
|
|
2395
2404
|
});
|
|
2396
2405
|
}
|
|
2397
|
-
this.component.instance.field = this.field
|
|
2398
|
-
this.component.instance.group = this.group
|
|
2406
|
+
this.component.instance.field = this.field;
|
|
2407
|
+
this.component.instance.group = this.group;
|
|
2399
2408
|
this.component.instance.instancePath = this.instancePath();
|
|
2400
2409
|
this.component.instance.path = this.path();
|
|
2401
2410
|
}
|
|
@@ -2499,5 +2508,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2499
2508
|
* Generated bundle index. Do not edit.
|
|
2500
2509
|
*/
|
|
2501
2510
|
|
|
2502
|
-
export { AbstractControlFieldComponent, AbstractFieldComponent, AcCustomComponentField,
|
|
2511
|
+
export { AbstractControlFieldComponent, AbstractFieldComponent, AcCustomComponentField, AcFieldCheckboxComponent, AutocompleteAttribute, ClassicDynamicFormComponent, ConditionsService, DsfrDynamicFormComponent, DynamicFormService, MatFieldChipsComponent, MatFieldCustomComponent, MatFieldDateComponent, MatFieldFileComponent, MatFieldInputComponent, MatFieldPasswordComponent, MatFieldRadioButtonComponent, MatFieldSelectComponent, MatFieldTextareaComponent, MatFieldToggleComponent, MaterialDynamicFormComponent, MaterialDynamicFormModalComponent, MaterialDynamicFormStepperComponent };
|
|
2503
2512
|
//# sourceMappingURL=sotoa-ui-dynamic-form.mjs.map
|