@sotoa-ui/dynamic-form 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sotoa-ui/dynamic-form",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.1.0",
|
|
6
|
+
"@angular/core": "^20.1.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/sotoa-ui-dynamic-form.mjs",
|
|
13
|
+
"typings": "types/sotoa-ui-dynamic-form.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/sotoa-ui-dynamic-form.d.ts",
|
|
20
|
+
"default": "./fesm2022/sotoa-ui-dynamic-form.mjs"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnInit, DestroyRef, InputSignal, OutputEmitterRef } from '@angular/core';
|
|
3
|
+
import { ValidatorFn, AsyncValidatorFn, FormGroup, FormControl, FormArray, AbstractControl } from '@angular/forms';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
interface AcCondition {
|
|
7
|
+
type: 'condition';
|
|
8
|
+
logicOperator?: AcLogicOperatorEnum;
|
|
9
|
+
items: (AcCondition | AcExpression)[];
|
|
10
|
+
}
|
|
11
|
+
interface AcExpression {
|
|
12
|
+
type: 'expression';
|
|
13
|
+
fieldId: string;
|
|
14
|
+
operator: AcExpressionOperatorEnum;
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
declare enum AcLogicOperatorEnum {
|
|
18
|
+
OR = "OR",
|
|
19
|
+
AND = "AND"
|
|
20
|
+
}
|
|
21
|
+
declare enum AcExpressionOperatorEnum {
|
|
22
|
+
EQUALS = "EQUALS"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AbstractFieldConfig {
|
|
26
|
+
type: string;
|
|
27
|
+
name: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
hostClassName?: string | string[];
|
|
32
|
+
className?: string | string[];
|
|
33
|
+
labelClassName?: string | string[];
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
displayCondition?: AcCondition;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Liste des valeurs possible pour l'attribut autocomplete
|
|
40
|
+
* (https://accessibilite.numerique.gouv.fr/methode/glossaire/#liste-des-valeurs-possibles-pour-l-attribut-autocomplete)
|
|
41
|
+
*/
|
|
42
|
+
declare enum AutocompleteAttribute {
|
|
43
|
+
Off = "off",
|
|
44
|
+
/** Nom complet */
|
|
45
|
+
Name = "name",
|
|
46
|
+
/** Abréviation, civilité ou titre */
|
|
47
|
+
HonorificPrefix = "honorific-prefix",
|
|
48
|
+
/** Prénom */
|
|
49
|
+
GivenName = "given-name",
|
|
50
|
+
/** Prénoms additionnels */
|
|
51
|
+
AdditionalName = "additional-name",
|
|
52
|
+
/** Nom de famille */
|
|
53
|
+
FamilyName = "family-name",
|
|
54
|
+
/** Suffixe honorifique */
|
|
55
|
+
HonorificSuffix = "honorific-suffix",
|
|
56
|
+
/** Surnom, diminutif */
|
|
57
|
+
Nickname = "nickname",
|
|
58
|
+
/** Fonction, intitulé de poste */
|
|
59
|
+
OrganizationTitle = "organization-title",
|
|
60
|
+
/** Nom d’utilisateur */
|
|
61
|
+
Username = "username",
|
|
62
|
+
/**
|
|
63
|
+
* Nouveau mot de passe (par exemple, lors de la création d’un compte
|
|
64
|
+
* ou d’un changement de mot de passe)
|
|
65
|
+
*/
|
|
66
|
+
NewPassword = "new-password",
|
|
67
|
+
/**
|
|
68
|
+
* Mot de passe actuel pour le compte identifié par le champ username
|
|
69
|
+
* (par exemple, lors d’une connexion)
|
|
70
|
+
*/
|
|
71
|
+
CurrentPassword = "current-password",
|
|
72
|
+
/**
|
|
73
|
+
* Nom de l’organisation correspondant à la personne, à l’adresse
|
|
74
|
+
* ou à l’information de contact dans les autres champs associés avec ce champ
|
|
75
|
+
*/
|
|
76
|
+
Organization = "organization",
|
|
77
|
+
/** Adresse postale (multiligne, nouvelles lignes conservées) */
|
|
78
|
+
StreetAddress = "street-address",
|
|
79
|
+
/** Adresse postale (une ligne par champ, ligne 1) */
|
|
80
|
+
AddressLine1 = "address-line1",
|
|
81
|
+
/** Adresse postale (une ligne par champ, ligne 2) */
|
|
82
|
+
AddressLine2 = "address-line2",
|
|
83
|
+
/** Adresse postale (une ligne par champ, ligne 3) */
|
|
84
|
+
AddressLine3 = "address-line3",
|
|
85
|
+
/** Le niveau administratif le plus détaillé, pour les adresses pourvues de quatre niveaux administratifs */
|
|
86
|
+
AddressLevel4 = "address-level4",
|
|
87
|
+
/** Le troisième niveau administratif, pour les adresses pourvues d’au moins trois niveaux administratifs */
|
|
88
|
+
AddressLevel3 = "address-level3",
|
|
89
|
+
/** Le deuxième niveau administratif, pour les adresses pourvues d’au moins deux niveaux administratifs */
|
|
90
|
+
AddressLevel2 = "address-level2",
|
|
91
|
+
/** Le plus large niveau administratif d’une adresse, c’est-à-dire la province dans laquelle se trouve la localité */
|
|
92
|
+
AddressLevel1 = "address-level1",
|
|
93
|
+
/** Code pays */
|
|
94
|
+
Country = "country",
|
|
95
|
+
/** Nom de pays */
|
|
96
|
+
CountryName = "country-name",
|
|
97
|
+
/**
|
|
98
|
+
* Code postal, code CEDEX (si le CEDEX est présent, ajouter “CEDEX”,
|
|
99
|
+
* et ce qui le suit doit être ajouté dans le champ address-level2)
|
|
100
|
+
*/
|
|
101
|
+
PostalCode = "postal-code",
|
|
102
|
+
/** Nom complet figurant sur le moyen de paiement */
|
|
103
|
+
CcName = "cc-name",
|
|
104
|
+
/** Prénom figurant sur le moyen de paiement */
|
|
105
|
+
CcGivenName = "cc-given-name",
|
|
106
|
+
/** Prénoms additionnels figurant sur le moyen de paiement */
|
|
107
|
+
CcAdditionalName = "cc-additional-name",
|
|
108
|
+
/** Nom de famille figurant sur le moyen de paiement */
|
|
109
|
+
CcFamilyName = "cc-family-name",
|
|
110
|
+
/** Code identifiant le moyen de paiement (e.g., un numéro de carte bancaire) */
|
|
111
|
+
CcNumber = "cc-number",
|
|
112
|
+
/** Date d’expiration du moyen de paiement */
|
|
113
|
+
CcExp = "cc-exp",
|
|
114
|
+
/** Le mois de la date d’expiration du moyen de paiement */
|
|
115
|
+
CcExpMonth = "cc-exp-month",
|
|
116
|
+
/** L’année de la date d’expiration du moyen de paiement */
|
|
117
|
+
CcExpYear = "cc-exp-year",
|
|
118
|
+
/**
|
|
119
|
+
* Code de sécurité du moyen de paiement (also known as the card security code (CSC),
|
|
120
|
+
* card validation code (CVC), card verification value (CVV), signature panel code (SPC),
|
|
121
|
+
* credit card ID (CCID), etc.)
|
|
122
|
+
*/
|
|
123
|
+
CcCsc = "cc-csc",
|
|
124
|
+
/** Type de moyen de paiement (e.g. Visa) */
|
|
125
|
+
CcType = "cc-type",
|
|
126
|
+
/** La devise qui a la préférence de l’utilisateur lors d’une transaction */
|
|
127
|
+
TransactionCurrency = "transaction-currency",
|
|
128
|
+
/** 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é) */
|
|
129
|
+
TransactionAmount = "transaction-amount",
|
|
130
|
+
/** Langue préférée */
|
|
131
|
+
Language = "language",
|
|
132
|
+
/** Date d’anniversaire */
|
|
133
|
+
Bday = "bday",
|
|
134
|
+
/** Le jour de la date d’anniversaire */
|
|
135
|
+
BdayDay = "bday-day",
|
|
136
|
+
/** Le mois de la date d’anniversaire */
|
|
137
|
+
BdayMonth = "bday-month",
|
|
138
|
+
/** L’année de la date d’anniversaire */
|
|
139
|
+
BdayYear = "bday-year",
|
|
140
|
+
/** Identité de genre */
|
|
141
|
+
Sex = "sex",
|
|
142
|
+
/**
|
|
143
|
+
* Page d’accueil ou une autre page Web correspondant à l’organisation, la personne,
|
|
144
|
+
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
145
|
+
*/
|
|
146
|
+
Url = "url",
|
|
147
|
+
/**
|
|
148
|
+
* Photographie, icône ou une autre image correspondant à l’organisation, la personne,
|
|
149
|
+
* l’adresse ou à l’information de contact dans les autres champs associés avec ce champ
|
|
150
|
+
*/
|
|
151
|
+
Photo = "photo",
|
|
152
|
+
/** Numéro de téléphone complet, y compris le code pays */
|
|
153
|
+
Tel = "tel",
|
|
154
|
+
/** Code pays du numéro de téléphone */
|
|
155
|
+
TelCountryCode = "tel-country-code",
|
|
156
|
+
/** Numéro de téléphone sans la partie code pays, avec un préfixe interne au pays, s’il y a lieu */
|
|
157
|
+
TelNational = "tel-national",
|
|
158
|
+
/** Indicatif régional du numéro de téléphone, avec un préfixe interne au pays, s’il y a lieu */
|
|
159
|
+
TelAreaCode = "tel-area-code",
|
|
160
|
+
/** Numéro de téléphone sans la partie code pays ni l’indicatif régional */
|
|
161
|
+
TelLocal = "tel-local",
|
|
162
|
+
/**
|
|
163
|
+
* La première partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
164
|
+
* lorsque ce composant est scindé en deux parties
|
|
165
|
+
*/
|
|
166
|
+
TelLocalPrefix = "tel-local-prefix",
|
|
167
|
+
/**
|
|
168
|
+
* La seconde partie du composant du numéro de téléphone qui suit l’indicatif régional,
|
|
169
|
+
* lorsque ce composant est scindé en deux parties
|
|
170
|
+
*/
|
|
171
|
+
TelLocalSuffix = "tel-local-suffix",
|
|
172
|
+
/** Numéro de téléphone d’un poste interne */
|
|
173
|
+
TelExtension = "tel-extension",
|
|
174
|
+
/** Adresse électronique */
|
|
175
|
+
Email = "email",
|
|
176
|
+
/**
|
|
177
|
+
* URL correspondant d’un protocole de messagerie instantanée
|
|
178
|
+
* (par exemple, "aim:goim?screenname=example" ou "xmpp:fred@example.net")
|
|
179
|
+
*/
|
|
180
|
+
Impp = "impp"
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface AcTextConfig extends AbstractFieldConfig {
|
|
184
|
+
type: 'text';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface AcValidator {
|
|
188
|
+
name: string;
|
|
189
|
+
validator?: ValidatorFn;
|
|
190
|
+
asyncValidator?: AsyncValidatorFn;
|
|
191
|
+
message: string;
|
|
192
|
+
condition?: AcCondition;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface AbstractControlConfig extends AbstractFieldConfig {
|
|
196
|
+
value?: any;
|
|
197
|
+
disabled?: boolean;
|
|
198
|
+
validations?: AcValidator[];
|
|
199
|
+
onValueChanges?: (value: any, datas: DynamicFormData, group: FormGroup, instancePath?: string) => void;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface AcGroupConfig extends AbstractControlConfig {
|
|
203
|
+
type: 'group';
|
|
204
|
+
fields: (AcFieldConfig | AcTextConfig)[];
|
|
205
|
+
accordion?: boolean;
|
|
206
|
+
opened?: boolean;
|
|
207
|
+
description?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
interface AcArrayConfig extends AbstractControlConfig {
|
|
211
|
+
type: "array";
|
|
212
|
+
field: AcGroupConfig;
|
|
213
|
+
itemLabel?: string;
|
|
214
|
+
description?: string;
|
|
215
|
+
accordion?: boolean;
|
|
216
|
+
opened?: boolean;
|
|
217
|
+
elementClassName?: string | string[];
|
|
218
|
+
elementContentClassName?: string | string[];
|
|
219
|
+
minNbRow?: number;
|
|
220
|
+
maxNbRow?: number;
|
|
221
|
+
addButton?: {
|
|
222
|
+
label?: string;
|
|
223
|
+
matIcon?: string;
|
|
224
|
+
title?: string;
|
|
225
|
+
};
|
|
226
|
+
deleteButton?: {
|
|
227
|
+
label?: string;
|
|
228
|
+
matIcon?: string;
|
|
229
|
+
title?: string;
|
|
230
|
+
};
|
|
231
|
+
instances?: {
|
|
232
|
+
number: number;
|
|
233
|
+
group: FormGroup;
|
|
234
|
+
fields: (AcFieldConfig | AcTextConfig)[];
|
|
235
|
+
}[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface AcRowConfig extends AbstractFieldConfig {
|
|
239
|
+
type: 'row';
|
|
240
|
+
fields: (AcFieldConfig | AcTextConfig)[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
interface TabConfig extends AbstractFieldConfig {
|
|
244
|
+
elementClassName?: string | string[];
|
|
245
|
+
disabled?: boolean;
|
|
246
|
+
field: AcGroupConfig;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface AcTabsConfig extends AbstractFieldConfig {
|
|
250
|
+
type: 'tabs';
|
|
251
|
+
elementClassName?: string | string[];
|
|
252
|
+
tabs: TabConfig[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface StepConfig extends AbstractFieldConfig {
|
|
256
|
+
type: "step";
|
|
257
|
+
elementClassName?: string | string[];
|
|
258
|
+
disabled?: boolean;
|
|
259
|
+
fields: (AcFieldConfig | AcTextConfig)[];
|
|
260
|
+
errorMessage?: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
type AcFieldConfig = AcControlConfig | AcGroupConfig | AcArrayConfig | AcRowConfig | AcTabsConfig;
|
|
264
|
+
type DynamicFormData = {
|
|
265
|
+
fields: (AcFieldConfig | AcTextConfig)[] | StepConfig[];
|
|
266
|
+
updateOn: UpdateOnType;
|
|
267
|
+
idPathMap: Map<string, string[]>;
|
|
268
|
+
pathFieldConfigMap: Map<string, AcFieldConfig | AcTextConfig | StepConfig>;
|
|
269
|
+
pathControlMap: Map<string, FormControl | FormGroup | FormArray>;
|
|
270
|
+
};
|
|
271
|
+
type PathArrayInstance = {
|
|
272
|
+
path: string;
|
|
273
|
+
arrayCode: string;
|
|
274
|
+
arrayInstance: number;
|
|
275
|
+
};
|
|
276
|
+
type UpdateOnType = "change" | "blur" | "submit" | undefined;
|
|
277
|
+
|
|
278
|
+
interface AcAffix {
|
|
279
|
+
label?: string;
|
|
280
|
+
action?: (field: AcFieldConfig, group: FormGroup, datas: DynamicFormData) => void;
|
|
281
|
+
actionAriaLabel?: string;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
interface AcFieldInputConfig extends AbstractControlConfig {
|
|
285
|
+
type: 'input';
|
|
286
|
+
inputType?: string;
|
|
287
|
+
autocomplete?: AutocompleteAttribute;
|
|
288
|
+
readonly?: boolean;
|
|
289
|
+
maxlength?: number;
|
|
290
|
+
suffixes?: AcAffix[];
|
|
291
|
+
prefixes?: AcAffix[];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
interface AcFieldCheckboxConfig extends AbstractControlConfig {
|
|
295
|
+
type: 'checkbox';
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface AcFieldSelectConfig extends AbstractControlConfig {
|
|
299
|
+
type: 'select';
|
|
300
|
+
options: any[] | Observable<any[]>;
|
|
301
|
+
groupLabelKey?: string;
|
|
302
|
+
groupOptionsKey?: string;
|
|
303
|
+
labelKey?: string;
|
|
304
|
+
valueKey?: string;
|
|
305
|
+
disabledKey?: string;
|
|
306
|
+
resetOption?: boolean;
|
|
307
|
+
resetOptionLabel?: string;
|
|
308
|
+
suffixes?: AcAffix[];
|
|
309
|
+
prefixes?: AcAffix[];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
interface AcFieldAutocompleteConfig extends AbstractControlConfig {
|
|
313
|
+
type: 'autocomplete';
|
|
314
|
+
options?: any[];
|
|
315
|
+
asyncOptions?: Observable<any[]>;
|
|
316
|
+
labelKey?: string;
|
|
317
|
+
valueKey?: string;
|
|
318
|
+
matchOption?: boolean;
|
|
319
|
+
externalFilteredOptions?: (value: any, field: AcFieldAutocompleteConfig, group: FormGroup) => Observable<any[]>;
|
|
320
|
+
displayWith?: (value?: any) => string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface AcFieldRadioButtonConfig extends AbstractControlConfig {
|
|
324
|
+
type: 'radio';
|
|
325
|
+
options: any[];
|
|
326
|
+
description?: string;
|
|
327
|
+
verticalAlign?: boolean;
|
|
328
|
+
labelKey?: string;
|
|
329
|
+
valueKey?: string;
|
|
330
|
+
descriptionKey?: string;
|
|
331
|
+
disabledKey?: string;
|
|
332
|
+
radioButtonClassName?: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface AcFieldTextareaConfig extends AbstractControlConfig {
|
|
336
|
+
type: 'textarea';
|
|
337
|
+
readonly?: boolean;
|
|
338
|
+
maxlength?: number;
|
|
339
|
+
rows?: number;
|
|
340
|
+
suffixes?: AcAffix[];
|
|
341
|
+
prefixes?: AcAffix[];
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface AcFieldDateConfig extends AbstractControlConfig {
|
|
345
|
+
type: 'date';
|
|
346
|
+
readonly?: boolean;
|
|
347
|
+
onlyPopup?: boolean;
|
|
348
|
+
format?: string;
|
|
349
|
+
minDate?: any;
|
|
350
|
+
maxDate?: any;
|
|
351
|
+
filter?: (d: any | null, field?: AcFieldDateConfig, group?: FormGroup) => boolean;
|
|
352
|
+
touchUi?: boolean;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface AcFieldFileConfig extends AbstractControlConfig {
|
|
356
|
+
type: 'file';
|
|
357
|
+
multiple?: boolean;
|
|
358
|
+
maxNbRow?: number;
|
|
359
|
+
accept?: string;
|
|
360
|
+
onAddFile?: (file: any) => void;
|
|
361
|
+
onDeleteFile?: (file: any) => void;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
interface AcFieldEditorConfig extends AbstractControlConfig {
|
|
365
|
+
type: 'editor';
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface AcFieldToggleConfig extends AbstractControlConfig {
|
|
369
|
+
type: 'toggle';
|
|
370
|
+
labelPosition?: 'before' | 'after';
|
|
371
|
+
checkedLabel: string;
|
|
372
|
+
uncheckedLabel: string;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
interface AcFieldPasswordConfig extends AbstractControlConfig {
|
|
376
|
+
type: 'password';
|
|
377
|
+
minlength: number;
|
|
378
|
+
maxlength?: number;
|
|
379
|
+
autocomplete?: AutocompleteAttribute;
|
|
380
|
+
requiresDigit?: boolean;
|
|
381
|
+
requiresUppercase?: boolean;
|
|
382
|
+
requiresLowercase?: boolean;
|
|
383
|
+
requiresSpecialChars?: boolean;
|
|
384
|
+
specialChars?: string[];
|
|
385
|
+
labels?: {
|
|
386
|
+
showPassword?: string;
|
|
387
|
+
hidePassword?: string;
|
|
388
|
+
minlength?: string;
|
|
389
|
+
maxlength?: string;
|
|
390
|
+
requiresDigit?: string;
|
|
391
|
+
requiresUppercase?: string;
|
|
392
|
+
requiresLowercase?: string;
|
|
393
|
+
requiresSpecialChars?: string;
|
|
394
|
+
iconError?: string;
|
|
395
|
+
iconSuccess?: string;
|
|
396
|
+
};
|
|
397
|
+
suffixes?: AcAffix[];
|
|
398
|
+
prefixes?: AcAffix[];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
type AcControlConfig = AcFieldCheckboxConfig | AcFieldInputConfig | AcFieldDateConfig | AcFieldTextareaConfig | AcFieldSelectConfig | AcFieldAutocompleteConfig | AcFieldRadioButtonConfig | AcFieldFileConfig | AcFieldEditorConfig | AcFieldToggleConfig | AcFieldPasswordConfig;
|
|
402
|
+
|
|
403
|
+
declare class DynamicFormService {
|
|
404
|
+
private readonly fb;
|
|
405
|
+
private readonly conditionsService;
|
|
406
|
+
private readonly destroyRef;
|
|
407
|
+
private readonly separator;
|
|
408
|
+
data?: DynamicFormData;
|
|
409
|
+
form?: FormGroup;
|
|
410
|
+
displayConditions: {
|
|
411
|
+
fieldId: string;
|
|
412
|
+
condition: AcCondition;
|
|
413
|
+
}[];
|
|
414
|
+
validationConditions: {
|
|
415
|
+
fieldId: string;
|
|
416
|
+
validation: AcValidator;
|
|
417
|
+
}[];
|
|
418
|
+
createForm(fields: (AcFieldConfig | AcTextConfig)[], validations: AcValidator[] | undefined, updateOn: UpdateOnType, initialValues: any): void;
|
|
419
|
+
createFormStepper(steps: StepConfig[], validations: AcValidator[] | undefined, updateOn: UpdateOnType, initialValues: any): void;
|
|
420
|
+
setCondition(): void;
|
|
421
|
+
createGroup(fields: (AcFieldConfig | AcTextConfig)[], parentPath: string | null, initialValues: any): FormGroup<{}>;
|
|
422
|
+
treatField(config: AcFieldConfig | AcTextConfig, group: FormGroup, parentPath: string | null, initialValues: any): void;
|
|
423
|
+
createGroupField(groupConfig: AcGroupConfig, parentPath: string | null, initialValues: any): FormGroup<any>;
|
|
424
|
+
createArrayInstance(arrayConfig: AcArrayConfig, arrayPath: string, instanceNumber: number, initialValues: any): FormGroup;
|
|
425
|
+
createArray(arrayConfig: AcArrayConfig, parentPath: string | null, initialValues: any): FormArray;
|
|
426
|
+
setFormFieldMapItem(path: string, config: AcFieldConfig | AcTextConfig | StepConfig, control: FormControl | FormGroup | FormArray | null): void;
|
|
427
|
+
createControl(config: AcControlConfig, initialValues: any): FormControl<any>;
|
|
428
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormService, never>;
|
|
429
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DynamicFormService>;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
declare class AbstractFieldComponent<T extends AbstractFieldConfig> {
|
|
433
|
+
path: string;
|
|
434
|
+
field: T;
|
|
435
|
+
group: FormGroup;
|
|
436
|
+
instancePath?: string;
|
|
437
|
+
protected dynamicFormService: DynamicFormService;
|
|
438
|
+
get control(): AbstractControl<any, any> | null;
|
|
439
|
+
get required(): boolean | undefined;
|
|
440
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFieldComponent<any>, never>;
|
|
441
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare class AbstractControlFieldComponent<T extends AbstractControlConfig> extends AbstractFieldComponent<T> implements OnInit {
|
|
445
|
+
protected destroyRef: DestroyRef;
|
|
446
|
+
uuid: string;
|
|
447
|
+
ngOnInit(): void;
|
|
448
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractControlFieldComponent<any>, never>;
|
|
449
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractControlFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
interface AcDynamicForm {
|
|
453
|
+
fields: (AcFieldConfig | AcTextConfig)[];
|
|
454
|
+
buttons?: AcButton[];
|
|
455
|
+
className?: {
|
|
456
|
+
form?: string;
|
|
457
|
+
formContent?: string;
|
|
458
|
+
formButtons?: string;
|
|
459
|
+
};
|
|
460
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
461
|
+
debounceTime?: number;
|
|
462
|
+
validations?: AcValidator[];
|
|
463
|
+
}
|
|
464
|
+
interface AcButton {
|
|
465
|
+
type: any;
|
|
466
|
+
matButtonType?: any;
|
|
467
|
+
matIcon?: string;
|
|
468
|
+
className?: string;
|
|
469
|
+
label?: string;
|
|
470
|
+
title?: string;
|
|
471
|
+
ariaLabel?: string;
|
|
472
|
+
disabledIfFormNoValid?: boolean;
|
|
473
|
+
action?: (form: FormGroup) => void;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
interface AcField {
|
|
477
|
+
path: string;
|
|
478
|
+
field: AcFieldConfig | AcTextConfig;
|
|
479
|
+
group: FormGroup;
|
|
480
|
+
instancePath?: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare class ConditionsService {
|
|
484
|
+
constructor();
|
|
485
|
+
checkValidationConditions(validationConditions: {
|
|
486
|
+
fieldId: string;
|
|
487
|
+
validation: AcValidator;
|
|
488
|
+
}[], dynamicFormDatas: DynamicFormData): void;
|
|
489
|
+
checkDisplayConditions(displayConditions: {
|
|
490
|
+
fieldId: string;
|
|
491
|
+
condition: AcCondition;
|
|
492
|
+
}[], dynamicFormDatas: DynamicFormData): void;
|
|
493
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConditionsService, never>;
|
|
494
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConditionsService>;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
declare class AcMaterialDynamicFormComponent {
|
|
498
|
+
private readonly dynamicFormService;
|
|
499
|
+
private readonly destroyRef;
|
|
500
|
+
config: InputSignal<AcDynamicForm | null>;
|
|
501
|
+
initialValues: InputSignal<any>;
|
|
502
|
+
formCancel: OutputEmitterRef<void>;
|
|
503
|
+
formSubmit: OutputEmitterRef<FormGroup>;
|
|
504
|
+
formChange: OutputEmitterRef<FormGroup>;
|
|
505
|
+
get form(): FormGroup | undefined;
|
|
506
|
+
get controls(): {
|
|
507
|
+
[key: string]: AbstractControl;
|
|
508
|
+
} | null;
|
|
509
|
+
get changes(): Observable<any> | null;
|
|
510
|
+
get valid(): boolean | null;
|
|
511
|
+
get value(): any;
|
|
512
|
+
constructor();
|
|
513
|
+
createForm(): void;
|
|
514
|
+
setValue(values: {
|
|
515
|
+
[key: string]: any;
|
|
516
|
+
}): void;
|
|
517
|
+
onClickButton(button: any): void;
|
|
518
|
+
reset(): void;
|
|
519
|
+
handleSubmit(event?: Event): void;
|
|
520
|
+
focusFirstInvalidControl(): void;
|
|
521
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AcMaterialDynamicFormComponent, never>;
|
|
522
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AcMaterialDynamicFormComponent, "sot-material-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
declare class AcDsfrDynamicFormComponent {
|
|
526
|
+
private readonly dynamicFormService;
|
|
527
|
+
private readonly destroyRef;
|
|
528
|
+
config: InputSignal<AcDynamicForm | null>;
|
|
529
|
+
initialValues: InputSignal<any>;
|
|
530
|
+
formCancel: OutputEmitterRef<void>;
|
|
531
|
+
formSubmit: OutputEmitterRef<FormGroup>;
|
|
532
|
+
formChange: OutputEmitterRef<FormGroup>;
|
|
533
|
+
get form(): FormGroup | undefined;
|
|
534
|
+
get controls(): {
|
|
535
|
+
[key: string]: AbstractControl;
|
|
536
|
+
} | null;
|
|
537
|
+
get changes(): Observable<any> | null;
|
|
538
|
+
get valid(): boolean | null;
|
|
539
|
+
get value(): any;
|
|
540
|
+
constructor();
|
|
541
|
+
createForm(): void;
|
|
542
|
+
setValue(values: {
|
|
543
|
+
[key: string]: any;
|
|
544
|
+
}): void;
|
|
545
|
+
onClickButton(button: any): void;
|
|
546
|
+
reset(): void;
|
|
547
|
+
handleSubmit(event?: Event): void;
|
|
548
|
+
focusFirstInvalidControl(): void;
|
|
549
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AcDsfrDynamicFormComponent, never>;
|
|
550
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AcDsfrDynamicFormComponent, "sot-dsfr-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare class AcClassicDynamicFormComponent {
|
|
554
|
+
private readonly dynamicFormService;
|
|
555
|
+
private readonly destroyRef;
|
|
556
|
+
config: InputSignal<AcDynamicForm | null>;
|
|
557
|
+
initialValues: InputSignal<any>;
|
|
558
|
+
formCancel: OutputEmitterRef<void>;
|
|
559
|
+
formSubmit: OutputEmitterRef<FormGroup>;
|
|
560
|
+
formChange: OutputEmitterRef<FormGroup>;
|
|
561
|
+
get form(): FormGroup | undefined;
|
|
562
|
+
get controls(): {
|
|
563
|
+
[key: string]: AbstractControl;
|
|
564
|
+
} | null;
|
|
565
|
+
get changes(): Observable<any> | null;
|
|
566
|
+
get valid(): boolean | null;
|
|
567
|
+
get value(): any;
|
|
568
|
+
constructor();
|
|
569
|
+
createForm(): void;
|
|
570
|
+
setValue(values: {
|
|
571
|
+
[key: string]: any;
|
|
572
|
+
}): void;
|
|
573
|
+
onClickButton(button: any): void;
|
|
574
|
+
reset(): void;
|
|
575
|
+
handleSubmit(event?: Event): void;
|
|
576
|
+
focusFirstInvalidControl(): void;
|
|
577
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AcClassicDynamicFormComponent, never>;
|
|
578
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AcClassicDynamicFormComponent, "sot-classic-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export { AbstractControlFieldComponent, AbstractFieldComponent, AcClassicDynamicFormComponent, AcDsfrDynamicFormComponent, AcMaterialDynamicFormComponent, AutocompleteAttribute, ConditionsService, DynamicFormService };
|
|
582
|
+
export type { AbstractControlConfig, AbstractFieldConfig, AcAffix, AcArrayConfig, AcButton, AcControlConfig, AcDynamicForm, AcField, AcFieldCheckboxConfig, AcFieldConfig, AcFieldInputConfig, AcFieldPasswordConfig, AcFieldRadioButtonConfig, AcFieldSelectConfig, AcFieldTextareaConfig, AcFieldToggleConfig, AcGroupConfig, AcRowConfig, AcTextConfig, AcValidator, DynamicFormData, PathArrayInstance, UpdateOnType };
|