@esfaenza/forms-and-validations 14.2.0 → 14.3.0
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/esm2020/lib/forms/base-form-control.mjs +42 -17
- package/esm2020/lib/forms/form-adaptive/form-adaptive.component.loc.mjs +4 -4
- package/esm2020/lib/forms/form-adaptive/form-adaptive.component.mjs +37 -9
- package/esm2020/lib/forms/form-autocomplete/form-autocomplete.component.loc.mjs +4 -4
- package/esm2020/lib/forms/form-autocomplete/form-autocomplete.component.mjs +12 -11
- package/esm2020/lib/forms/form-checkbox/form-checkbox.component.mjs +5 -4
- package/esm2020/lib/forms/form-date/form-date.component.mjs +7 -7
- package/esm2020/lib/forms/form-datetime/form-datetime.component.mjs +7 -7
- package/esm2020/lib/forms/form-empty/form-empty.component.mjs +4 -4
- package/esm2020/lib/forms/form-error/form-error.component.mjs +4 -4
- package/esm2020/lib/forms/form-file/form-file.component.loc.mjs +4 -4
- package/esm2020/lib/forms/form-file/form-file.component.mjs +23 -9
- package/esm2020/lib/forms/form-info/form-info.component.mjs +4 -4
- package/esm2020/lib/forms/form-input/form-input.component.mjs +5 -5
- package/esm2020/lib/forms/form-multiselect/form-multiselect.component.loc.mjs +4 -4
- package/esm2020/lib/forms/form-multiselect/form-multiselect.component.mjs +4 -4
- package/esm2020/lib/forms/form-select/form-select.component.loc.mjs +4 -4
- package/esm2020/lib/forms/form-select/form-select.component.mjs +12 -9
- package/esm2020/lib/forms/form-template/form-template.component.mjs +5 -5
- package/esm2020/lib/forms/form-textarea/form-textarea.component.mjs +5 -5
- package/esm2020/lib/forms/form-time/form-time.component.mjs +4 -4
- package/esm2020/lib/forms-and-validations.module.mjs +5 -5
- package/esm2020/lib/models/dayjs-adapter/dayjs-date-adapter.mjs +4 -4
- package/esm2020/lib/validations/base-validation.loc.mjs +4 -4
- package/esm2020/lib/validations/base-validation.mjs +40 -10
- package/esm2020/lib/validations/customValidators/CustomRequiredDirective.mjs +4 -4
- package/esm2020/lib/validations/validation-autocomplete/validation-autocomplete.component.mjs +13 -12
- package/esm2020/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.mjs +13 -12
- package/esm2020/lib/validations/validation-currency/validation-currency.component.mjs +8 -6
- package/esm2020/lib/validations/validation-date/validation-date.component.mjs +12 -12
- package/esm2020/lib/validations/validation-datetime/validation-datetime.component.mjs +12 -12
- package/esm2020/lib/validations/validation-input/validation-input.component.mjs +11 -11
- package/esm2020/lib/validations/validation-select/validation-select.component.mjs +13 -13
- package/esm2020/lib/validations/validation-text-area/validation-text-area.component.mjs +8 -6
- package/esm2020/public-api.mjs +1 -2
- package/fesm2015/esfaenza-forms-and-validations.mjs +321 -207
- package/fesm2015/esfaenza-forms-and-validations.mjs.map +1 -1
- package/fesm2020/esfaenza-forms-and-validations.mjs +319 -207
- package/fesm2020/esfaenza-forms-and-validations.mjs.map +1 -1
- package/lib/forms/base-form-control.d.ts +20 -6
- package/lib/forms/form-adaptive/form-adaptive.component.d.ts +15 -2
- package/lib/forms/form-autocomplete/form-autocomplete.component.d.ts +5 -4
- package/lib/forms/form-date/form-date.component.d.ts +1 -2
- package/lib/forms/form-datetime/form-datetime.component.d.ts +1 -2
- package/lib/forms/form-file/form-file.component.d.ts +7 -4
- package/lib/forms/form-select/form-select.component.d.ts +5 -3
- package/lib/validations/base-validation.d.ts +24 -4
- package/lib/validations/validation-autocomplete/validation-autocomplete.component.d.ts +4 -4
- package/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.d.ts +4 -4
- package/lib/validations/validation-date/validation-date.component.d.ts +1 -2
- package/lib/validations/validation-datetime/validation-datetime.component.d.ts +1 -2
- package/lib/validations/validation-input/validation-input.component.d.ts +1 -2
- package/lib/validations/validation-select/validation-select.component.d.ts +1 -2
- package/package.json +14 -14
- package/public-api.d.ts +0 -1
|
@@ -23,9 +23,9 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
23
23
|
*/
|
|
24
24
|
private firstBind;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Indica di utilizzare i validatori che l'utente piazza sul componente.
|
|
27
|
+
* Da non usare nel caso di form-adaptive dato che i validatori vengono valutati in base al tipo ecc
|
|
28
|
+
*/
|
|
29
29
|
protected UseUserValidators: boolean;
|
|
30
30
|
/** Indica se il campo è obbligatorio i opzionale */
|
|
31
31
|
Required: boolean;
|
|
@@ -36,7 +36,13 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
36
36
|
/** Nome generato per il controllo interno. Di default è il nome del controllo esterno con l'aggiunta di "_internal". Serve per evitare cross-bind */
|
|
37
37
|
GeneratedName: string;
|
|
38
38
|
/** Indica se il Form che contiene questo campo è già stato registrato */
|
|
39
|
-
protected
|
|
39
|
+
protected formHasBennBound: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Indica se questo campo è staccato dal Form, ad esempio nel caso sia in un ng-template proiettato nel form.
|
|
42
|
+
*
|
|
43
|
+
* In quel caso la variabile **Form** del componente dev'essere valorizzata
|
|
44
|
+
*/
|
|
45
|
+
protected detatchedFromform: boolean;
|
|
40
46
|
/** @ignore */
|
|
41
47
|
protected propagateChange: (_: any) => void;
|
|
42
48
|
/** @ignore */
|
|
@@ -51,6 +57,13 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
51
57
|
private AppContextOwnership;
|
|
52
58
|
/** Subject a cui l'oggetto interno si collega per effettuare il focus dell'elemento input sottostante */
|
|
53
59
|
FocusSubject: Subject<void>;
|
|
60
|
+
/**
|
|
61
|
+
* @EXPERIMENTAL
|
|
62
|
+
*/
|
|
63
|
+
SetValidationSubject: Subject<{
|
|
64
|
+
fieldName: string;
|
|
65
|
+
error: string;
|
|
66
|
+
}>;
|
|
54
67
|
/** Modalità in cui viene mostrato il campo, 1-1 rispetto alle definizioni di Angular Material */
|
|
55
68
|
FieldAppearence: "legacy" | "standard" | "fill" | "outline";
|
|
56
69
|
/** Utilizza o meno il Layout di un form (Label con input di fianco), se false mostra solo l'input */
|
|
@@ -153,7 +166,7 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
153
166
|
/** Evento chiamato al focus del campo di testo/combo/quelcheè, riemitta l'evento originale Javascript */
|
|
154
167
|
inputFocus: EventEmitter<any>;
|
|
155
168
|
/** Evento chiamato al finalize del campo di testo/combo/quelcheè */
|
|
156
|
-
inputFinalized: EventEmitter<
|
|
169
|
+
inputFinalized: EventEmitter<string>;
|
|
157
170
|
/** Cache delle condizioni scritte tipo :prop?(Roba con {prop}) */
|
|
158
171
|
private BindCheckingGroups;
|
|
159
172
|
/** Cache delle proprietà scritte tipo --> {prop} */
|
|
@@ -187,6 +200,7 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
187
200
|
handleNullNgControl(): boolean;
|
|
188
201
|
/** @ignore */
|
|
189
202
|
ngOnInit(): void;
|
|
203
|
+
destroyed$: Subject<void>;
|
|
190
204
|
/**
|
|
191
205
|
* Se sono in modalità detatched devo rimuovere manualmente questo controllo quando entro nella dispose, altrimenti se poi ne andassi a riaggiungere
|
|
192
206
|
* un altro con lo stesso "name" ma magari resettato, Angular lo re-idraterebbe con i valori precedenti nonostante il modello fosse vuoto
|
|
@@ -247,5 +261,5 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
247
261
|
/** @ignore */
|
|
248
262
|
abstract onNotNullValueSet(): void;
|
|
249
263
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormControl, never>;
|
|
250
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormControl, never, never, { "FocusSubject": "FocusSubject"; "FieldAppearence": "FieldAppearence"; "FormLayout": "FormLayout"; "EmitPendingChanges": "EmitPendingChanges"; "Validation": "Validation"; "Frozen": "Frozen"; "Placeholder": "Placeholder"; "FormGroupClass": "FormGroupClass"; "FailedValidationMessage": "FailedValidationMessage"; "ForcedError": "ForcedError"; "Label": "Label"; "LabelColWidth": "LabelColWidth"; "InputColWidth": "InputColWidth"; "Last": "Last"; "Form": "Form"; "Source": "Source"; "IdField": "IdField"; "FloatingLabel": "FloatingLabel"; "DisplayMode": "DisplayMode"; "DisplayCondition": "DisplayCondition"; "DisplayModeTemplate": "DisplayModeTemplate"; "DisplayLayout": "DisplayLayout"; "InlineSeparator": "InlineSeparator"; "Display": "Display"; "Readonly": "Readonly"; "LabelInputRatio": "LabelInputRatio"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never, never, false>;
|
|
264
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormControl, never, never, { "FocusSubject": "FocusSubject"; "SetValidationSubject": "SetValidationSubject"; "FieldAppearence": "FieldAppearence"; "FormLayout": "FormLayout"; "EmitPendingChanges": "EmitPendingChanges"; "Validation": "Validation"; "Frozen": "Frozen"; "Placeholder": "Placeholder"; "FormGroupClass": "FormGroupClass"; "FailedValidationMessage": "FailedValidationMessage"; "ForcedError": "ForcedError"; "Label": "Label"; "LabelColWidth": "LabelColWidth"; "InputColWidth": "InputColWidth"; "Last": "Last"; "Form": "Form"; "Source": "Source"; "IdField": "IdField"; "FloatingLabel": "FloatingLabel"; "DisplayMode": "DisplayMode"; "DisplayCondition": "DisplayCondition"; "DisplayModeTemplate": "DisplayModeTemplate"; "DisplayLayout": "DisplayLayout"; "InlineSeparator": "InlineSeparator"; "Display": "Display"; "Readonly": "Readonly"; "LabelInputRatio": "LabelInputRatio"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never, never, false>;
|
|
251
265
|
}
|
|
@@ -9,6 +9,8 @@ import { AppFile } from "../../models/AppFile";
|
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { ChangeEvent } from "../../models/ChangeEvent";
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
|
+
/** Opzioni generiche disponibili */
|
|
13
|
+
export declare type AvailableOptions = 'JsDates' | 'CaseSensitive' | 'MinChars' | 'SearchFunction' | 'Alignment' | 'Precision' | 'AllowDownload' | 'AdjustNumber' | 'Pattern';
|
|
12
14
|
/** Componente in grado di assumere la forma di un qualsiasi altro componente form in base al tipo specificato. Utile per la creazione di form dinamici */
|
|
13
15
|
export declare class FormAdaptiveComponent extends BaseFormControl implements ControlValueAccessor {
|
|
14
16
|
private utiExts;
|
|
@@ -42,6 +44,10 @@ export declare class FormAdaptiveComponent extends BaseFormControl implements Co
|
|
|
42
44
|
MinChars: number;
|
|
43
45
|
/** Indica se i controlli devono essere effettuati tenendo conto del Case o meno. Vale solo qualora la **Source** fosse fornita */
|
|
44
46
|
CaseSensitive: boolean;
|
|
47
|
+
/** Opzioni specifiche per il componente che si va a visualizzare. Es. per i tipi date: { JsDates: true } */
|
|
48
|
+
Options: {
|
|
49
|
+
[id in AvailableOptions]?: any;
|
|
50
|
+
};
|
|
45
51
|
/** Variabile interna che gestisce se effettuare il riallineamento dei dati o meno */
|
|
46
52
|
private alignValues;
|
|
47
53
|
/**
|
|
@@ -60,6 +66,13 @@ export declare class FormAdaptiveComponent extends BaseFormControl implements Co
|
|
|
60
66
|
constructor(cdr: ChangeDetectorRef, utiExts: UtilityService, datesExts: DateService, dateAdapter: NgxMatDateAdapter<any>, lc: LocalizationService, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, FAV_DEBUG_MODE: boolean);
|
|
61
67
|
IntPattern: string;
|
|
62
68
|
FloatPattern: string;
|
|
69
|
+
/**
|
|
70
|
+
* Nvl con un minimo di senso
|
|
71
|
+
* @param value Valore base
|
|
72
|
+
* @param ifnod Valore da usare se **value** è nullo o undefined
|
|
73
|
+
* @returns Il valore preso fra i due disponibili
|
|
74
|
+
*/
|
|
75
|
+
private nvl;
|
|
63
76
|
ngOnInit(): void;
|
|
64
77
|
/** @ignore */
|
|
65
78
|
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
@@ -76,7 +89,7 @@ export declare class FormAdaptiveComponent extends BaseFormControl implements Co
|
|
|
76
89
|
*
|
|
77
90
|
* @param {string} event Input utente
|
|
78
91
|
*/
|
|
79
|
-
filterSource(event
|
|
92
|
+
filterSource(event?: ChangeEvent): void;
|
|
80
93
|
/** @ignore */
|
|
81
94
|
private removeFilteredSourceOnDescriptionSelection;
|
|
82
95
|
/** Metodo richiamato quando viene modificato il modello del campo di input */
|
|
@@ -102,5 +115,5 @@ export declare class FormAdaptiveComponent extends BaseFormControl implements Co
|
|
|
102
115
|
/** @ignore */
|
|
103
116
|
private throttla;
|
|
104
117
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormAdaptiveComponent, [null, null, null, null, null, { optional: true; self: true; }, { optional: true; }, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
105
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormAdaptiveComponent, "form-adaptive", never, { "Type": "Type"; "TypeMissingMessage": "TypeMissingMessage"; "Pattern": "Pattern"; "AdjustNumber": "AdjustNumber"; "AllowDownload": "AllowDownload"; "Precision": "Precision"; "Alignment": "Alignment"; "SearchFunction": "SearchFunction"; "MinChars": "MinChars"; "CaseSensitive": "CaseSensitive"; }, {}, never, never, false>;
|
|
118
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormAdaptiveComponent, "form-adaptive", never, { "Type": "Type"; "TypeMissingMessage": "TypeMissingMessage"; "Pattern": "Pattern"; "AdjustNumber": "AdjustNumber"; "AllowDownload": "AllowDownload"; "Precision": "Precision"; "Alignment": "Alignment"; "SearchFunction": "SearchFunction"; "MinChars": "MinChars"; "CaseSensitive": "CaseSensitive"; "Options": "Options"; }, {}, never, never, false>;
|
|
106
119
|
}
|
|
@@ -4,15 +4,16 @@ import { BaseFormControl } from "../base-form-control";
|
|
|
4
4
|
import { AccessControlService, ComponentContext } from '@esfaenza/access-control';
|
|
5
5
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
6
6
|
import { Observable } from "rxjs";
|
|
7
|
-
import { ChangeEvent } from "../../models/ChangeEvent";
|
|
8
7
|
import * as i0 from "@angular/core";
|
|
9
8
|
/** Componente di input che si auto-completa in base al valore attuale */
|
|
10
9
|
export declare class FormAutocompleteComponent extends BaseFormControl implements ControlValueAccessor {
|
|
11
10
|
lc: LocalizationService;
|
|
12
11
|
/** Permette di specificare il testo della Label flottante material-style */
|
|
13
12
|
SelectLabel: string;
|
|
13
|
+
/** Contesto per la funzione di ricerca */
|
|
14
|
+
SearchFunctionContext: any;
|
|
14
15
|
/** Funzione di ricerca che verrà chiamata dal componente */
|
|
15
|
-
SearchFunction: (search: string, byid: boolean) => Observable<{
|
|
16
|
+
SearchFunction: (search: string, byid: boolean, context?: any) => Observable<{
|
|
16
17
|
id: string;
|
|
17
18
|
description: string;
|
|
18
19
|
}[]>;
|
|
@@ -58,7 +59,7 @@ export declare class FormAutocompleteComponent extends BaseFormControl implement
|
|
|
58
59
|
*
|
|
59
60
|
* @param {string} event Input utente
|
|
60
61
|
*/
|
|
61
|
-
filterSource(
|
|
62
|
+
filterSource(event: string): void;
|
|
62
63
|
/** @ignore */
|
|
63
64
|
private removeFilteredSourceOnDescriptionSelection;
|
|
64
65
|
/** @ignore */
|
|
@@ -72,5 +73,5 @@ export declare class FormAutocompleteComponent extends BaseFormControl implement
|
|
|
72
73
|
/** @ignore */
|
|
73
74
|
private throttla;
|
|
74
75
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormAutocompleteComponent, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
75
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormAutocompleteComponent, "form-autocomplete", never, { "SelectLabel": "SelectLabel"; "SearchFunction": "SearchFunction"; "MinChars": "MinChars"; "HideChoicesOnSelection": "HideChoicesOnSelection"; "RequiredPlaceholder": "RequiredPlaceholder"; "CaseSensitive": "CaseSensitive"; "Multi": "Multi"; "MultiElementsThreshold": "MultiElementsThreshold"; }, {}, never, never, false>;
|
|
76
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormAutocompleteComponent, "form-autocomplete", never, { "SelectLabel": "SelectLabel"; "SearchFunctionContext": "SearchFunctionContext"; "SearchFunction": "SearchFunction"; "MinChars": "MinChars"; "HideChoicesOnSelection": "HideChoicesOnSelection"; "RequiredPlaceholder": "RequiredPlaceholder"; "CaseSensitive": "CaseSensitive"; "Multi": "Multi"; "MultiElementsThreshold": "MultiElementsThreshold"; }, {}, never, never, false>;
|
|
76
77
|
}
|
|
@@ -3,7 +3,6 @@ import { AccessControlService, ComponentContext } from '@esfaenza/access-control
|
|
|
3
3
|
import { DateService } from "@esfaenza/extensions";
|
|
4
4
|
import { BaseFormControl } from "../base-form-control";
|
|
5
5
|
import { ChangeDetectorRef } from "@angular/core";
|
|
6
|
-
import { ChangeEvent } from "../../models/ChangeEvent";
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/** Componente che dà all'utente la possibilità di selezionare una data */
|
|
9
8
|
export declare class FormDateComponent extends BaseFormControl implements ControlValueAccessor {
|
|
@@ -14,7 +13,7 @@ export declare class FormDateComponent extends BaseFormControl implements Contro
|
|
|
14
13
|
constructor(datesExts: DateService, cdr: ChangeDetectorRef, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, FAV_DEBUG_MODE: boolean);
|
|
15
14
|
/** @ignore */
|
|
16
15
|
writeValue(obj: any): void;
|
|
17
|
-
changed(
|
|
16
|
+
changed(): void;
|
|
18
17
|
/** @ignore */
|
|
19
18
|
onNotNullValueSet(): void;
|
|
20
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormDateComponent, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
@@ -3,7 +3,6 @@ import { AccessControlService, ComponentContext } from '@esfaenza/access-control
|
|
|
3
3
|
import { DateService } from "@esfaenza/extensions";
|
|
4
4
|
import { BaseFormControl } from "../base-form-control";
|
|
5
5
|
import { ChangeDetectorRef } from "@angular/core";
|
|
6
|
-
import { ChangeEvent } from "../../models/ChangeEvent";
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Componente che dà all'utente la possibilità di selezionare una data insieme ad un orario
|
|
@@ -16,7 +15,7 @@ export declare class FormDateTimeComponent extends BaseFormControl implements Co
|
|
|
16
15
|
constructor(datesExts: DateService, cdr: ChangeDetectorRef, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, FAV_DEBUG_MODE: boolean);
|
|
17
16
|
/** @ignore */
|
|
18
17
|
writeValue(obj: any): void;
|
|
19
|
-
changed(
|
|
18
|
+
changed(): void;
|
|
20
19
|
/** @ignore */
|
|
21
20
|
onNotNullValueSet(): void;
|
|
22
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormDateTimeComponent, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
@@ -2,22 +2,25 @@ import { ChangeDetectorRef, ElementRef } from "@angular/core";
|
|
|
2
2
|
import { ControlValueAccessor, NgControl, Validator, AbstractControl, ValidationErrors } from "@angular/forms";
|
|
3
3
|
import { AccessControlService, ComponentContext } from '@esfaenza/access-control';
|
|
4
4
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
5
|
-
import { UtilityService } from "@esfaenza/extensions";
|
|
5
|
+
import { MessageService, UtilityService } from "@esfaenza/extensions";
|
|
6
6
|
import { BaseFormControl } from "../base-form-control";
|
|
7
7
|
import { AppFile } from "../../models/AppFile";
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/** Componente che permette all'utente di caricare/scaricare un file all'interno di un campo Input */
|
|
10
10
|
export declare class FormFileComponent extends BaseFormControl implements ControlValueAccessor, Validator {
|
|
11
|
+
private msgs;
|
|
11
12
|
private utiExts;
|
|
12
13
|
lc: LocalizationService;
|
|
13
14
|
/** Permette di caricare file multipli */
|
|
14
15
|
Multiple: boolean;
|
|
15
16
|
/** Permette di scaricare l'eventuale file selezionato */
|
|
16
17
|
AllowDownload: boolean;
|
|
18
|
+
/** Controllo sulla dimensione di ogni singolo file in Byte. 0 -> nessun limite */
|
|
19
|
+
MaxSize: number;
|
|
17
20
|
/** Riferimento all'elemento input di tipo file */
|
|
18
21
|
inputEl: ElementRef;
|
|
19
22
|
/** @ignore Costruttore */
|
|
20
|
-
constructor(cdr: ChangeDetectorRef, utiExts: UtilityService, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, lc: LocalizationService, FAV_DEBUG_MODE: boolean);
|
|
23
|
+
constructor(msgs: MessageService, cdr: ChangeDetectorRef, utiExts: UtilityService, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, lc: LocalizationService, FAV_DEBUG_MODE: boolean);
|
|
21
24
|
ngOnInit(): void;
|
|
22
25
|
validate(control: AbstractControl): ValidationErrors;
|
|
23
26
|
/** @ignore */
|
|
@@ -32,6 +35,6 @@ export declare class FormFileComponent extends BaseFormControl implements Contro
|
|
|
32
35
|
downloadAttachment(): void;
|
|
33
36
|
/** @ignore */
|
|
34
37
|
onNotNullValueSet(): void;
|
|
35
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormFileComponent, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, null, { optional: true; }]>;
|
|
36
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormFileComponent, "form-file", never, { "Multiple": "Multiple"; "AllowDownload": "AllowDownload"; }, {}, never, never, false>;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormFileComponent, [null, null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, null, { optional: true; }]>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormFileComponent, "form-file", never, { "Multiple": "Multiple"; "AllowDownload": "AllowDownload"; "MaxSize": "MaxSize"; }, {}, never, never, false>;
|
|
37
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SimpleChanges, ChangeDetectorRef } from "@angular/core";
|
|
1
|
+
import { SimpleChanges, ChangeDetectorRef, TemplateRef } from "@angular/core";
|
|
2
2
|
import { ControlValueAccessor, NgControl } from "@angular/forms";
|
|
3
3
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
4
4
|
import { AccessControlService, ComponentContext } from '@esfaenza/access-control';
|
|
@@ -25,6 +25,8 @@ export declare class FormSelectComponent extends BaseFormControl implements Cont
|
|
|
25
25
|
EmptyFieldValue: string;
|
|
26
26
|
/** Se **true** rimuove il simbolino di validazione (croce rossa o tick verde) */
|
|
27
27
|
ShowValidationSymbol: boolean;
|
|
28
|
+
/** Template per la visualizzazione delle opzioni */
|
|
29
|
+
OptionTemplate: TemplateRef<any>;
|
|
28
30
|
/** @ignore Costruttore */
|
|
29
31
|
constructor(cdr: ChangeDetectorRef, lc: LocalizationService, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, FAV_DEBUG_MODE: boolean);
|
|
30
32
|
/** @ignore */
|
|
@@ -33,9 +35,9 @@ export declare class FormSelectComponent extends BaseFormControl implements Cont
|
|
|
33
35
|
private detatchPreviousAndRetatchNext;
|
|
34
36
|
/** @ignore */
|
|
35
37
|
writeValue(obj: any): void;
|
|
36
|
-
changed(
|
|
38
|
+
changed(): void;
|
|
37
39
|
/** @ignore */
|
|
38
40
|
onNotNullValueSet(): void;
|
|
39
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormSelectComponent, [null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormSelectComponent, "form-select", never, { "SelectLabel": "SelectLabel"; "PlaceholderValue": "PlaceholderValue"; "RequiredPlaceholder": "RequiredPlaceholder"; "EmptyFieldValue": "EmptyFieldValue"; "ShowValidationSymbol": "ShowValidationSymbol"; }, {}, never, never, false>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormSelectComponent, "form-select", never, { "SelectLabel": "SelectLabel"; "PlaceholderValue": "PlaceholderValue"; "RequiredPlaceholder": "RequiredPlaceholder"; "EmptyFieldValue": "EmptyFieldValue"; "ShowValidationSymbol": "ShowValidationSymbol"; "OptionTemplate": "OptionTemplate"; }, {}, never, never, false>;
|
|
41
43
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { EventEmitter, ElementRef } from "@angular/core";
|
|
1
|
+
import { EventEmitter, ElementRef, ChangeDetectorRef } from "@angular/core";
|
|
2
2
|
import { NgModel } from "@angular/forms";
|
|
3
3
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
4
4
|
import { TooltipDirective } from "ngx-bootstrap/tooltip";
|
|
5
5
|
import { Subject } from "rxjs";
|
|
6
|
-
import { ChangeEvent } from "../models/ChangeEvent";
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Classe astratta base che contiene le logiche / proprietà in comune a tutti i validatori
|
|
@@ -11,6 +10,17 @@ import * as i0 from "@angular/core";
|
|
|
11
10
|
* Nota bene: I tooltip rallentano tantissimo la pagina perché il tizio che ha fatto ngx bootstrap non è capace
|
|
12
11
|
*/
|
|
13
12
|
export declare abstract class BaseValidation {
|
|
13
|
+
protected cdr: ChangeDetectorRef;
|
|
14
|
+
/** @ignore Constructor */
|
|
15
|
+
constructor(cdr: ChangeDetectorRef);
|
|
16
|
+
/**
|
|
17
|
+
* Per non sovrascrivere l'originale con errori che spuntano da BE
|
|
18
|
+
*/
|
|
19
|
+
validationFailedBind: string;
|
|
20
|
+
/**
|
|
21
|
+
* Per gestire il cambio di messaggi di errore
|
|
22
|
+
*/
|
|
23
|
+
private valueOnLastValidation;
|
|
14
24
|
/**
|
|
15
25
|
* Servizio di localizzazione del Componente
|
|
16
26
|
*/
|
|
@@ -55,6 +65,13 @@ export declare abstract class BaseValidation {
|
|
|
55
65
|
* Subject a cui l'oggetto interno si collega per effettuare il focus dell'elemento input sottostante
|
|
56
66
|
*/
|
|
57
67
|
FocusSubject: Subject<void>;
|
|
68
|
+
/**
|
|
69
|
+
* @EXPERIMENTAL
|
|
70
|
+
*/
|
|
71
|
+
SetValidationSubject: Subject<{
|
|
72
|
+
fieldName: string;
|
|
73
|
+
error: string;
|
|
74
|
+
}>;
|
|
58
75
|
/**
|
|
59
76
|
* Indica se di default deve valutare il messaggio di errore in base al validatore che fallisce.
|
|
60
77
|
*
|
|
@@ -121,7 +138,7 @@ export declare abstract class BaseValidation {
|
|
|
121
138
|
/**
|
|
122
139
|
* Evento che sostituisce l'ngModelChange facendolo funzionare in maniera un po' più consistente
|
|
123
140
|
*/
|
|
124
|
-
inputChange: EventEmitter<
|
|
141
|
+
inputChange: EventEmitter<string>;
|
|
125
142
|
/**
|
|
126
143
|
* Evento che indica il focus avvenuto su un controllo
|
|
127
144
|
*/
|
|
@@ -140,6 +157,9 @@ export declare abstract class BaseValidation {
|
|
|
140
157
|
* Imposta il componente come "invalid" a prescindere dai validatori
|
|
141
158
|
*/
|
|
142
159
|
set forceInvalid(val: boolean);
|
|
160
|
+
ngOnInit(): void;
|
|
161
|
+
destroyed$: Subject<void>;
|
|
162
|
+
ngOnDestroy(): void;
|
|
143
163
|
/**
|
|
144
164
|
* Helper che controlla se il tooltip deve essere mostrato o meno,
|
|
145
165
|
* richiamato direttamente dall'HTML dei componenti
|
|
@@ -198,5 +218,5 @@ export declare abstract class BaseValidation {
|
|
|
198
218
|
*/
|
|
199
219
|
deregisterFocusRequest(): void;
|
|
200
220
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseValidation, never>;
|
|
201
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseValidation, never, never, { "FocusSubject": "FocusSubject"; "InferErrorMessages": "InferErrorMessages"; "FieldAppearence": "FieldAppearence"; "FloatingLabel": "FloatingLabel"; "validationFailed": "validationFailed"; "readonly": "readonly"; "widthPx": "widthPx"; "disabled": "disabled"; "placeholder": "placeholder"; "class": "class"; "style": "style"; "pattern": "pattern"; "noValidate": "noValidate"; "autocomplete": "autocomplete"; "id": "id"; "submitted": "submitted"; "forceInvalid": "forceInvalid"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never, never, false>;
|
|
221
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseValidation, never, never, { "FocusSubject": "FocusSubject"; "SetValidationSubject": "SetValidationSubject"; "InferErrorMessages": "InferErrorMessages"; "FieldAppearence": "FieldAppearence"; "FloatingLabel": "FloatingLabel"; "validationFailed": "validationFailed"; "readonly": "readonly"; "widthPx": "widthPx"; "disabled": "disabled"; "placeholder": "placeholder"; "class": "class"; "style": "style"; "pattern": "pattern"; "noValidate": "noValidate"; "autocomplete": "autocomplete"; "id": "id"; "submitted": "submitted"; "forceInvalid": "forceInvalid"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never, never, false>;
|
|
202
222
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlValueAccessor } from "@angular/forms";
|
|
2
|
-
import { EventEmitter, Injector } from "@angular/core";
|
|
2
|
+
import { ChangeDetectorRef, EventEmitter, Injector } from "@angular/core";
|
|
3
3
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
4
4
|
import { BaseValidation } from "../base-validation";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
@@ -27,7 +27,7 @@ export declare class ValidationAutocompleteComponent extends BaseValidation impl
|
|
|
27
27
|
/** Controllo esposto ottenuto tramite injector */
|
|
28
28
|
private parentControl;
|
|
29
29
|
/** @ignore */
|
|
30
|
-
constructor(_validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
30
|
+
constructor(cdr: ChangeDetectorRef, _validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
31
31
|
/** @ignore */
|
|
32
32
|
ngOnInit(): void;
|
|
33
33
|
/** @ignore */
|
|
@@ -48,11 +48,11 @@ export declare class ValidationAutocompleteComponent extends BaseValidation impl
|
|
|
48
48
|
*
|
|
49
49
|
* @param {any} toEmit valore da propagare all'esterno
|
|
50
50
|
*/
|
|
51
|
-
onModelChange(toEmit: any
|
|
51
|
+
onModelChange(toEmit: any): void;
|
|
52
52
|
/** @ignore */
|
|
53
53
|
registerOnChange(fn: any): void;
|
|
54
54
|
/** @ignore */
|
|
55
55
|
registerOnTouched(fn: any): void;
|
|
56
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteComponent, [{ optional: true; }, { optional: true; }, null, null]>;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteComponent, [null, { optional: true; }, { optional: true; }, null, null]>;
|
|
57
57
|
static ɵcmp: i0.ɵɵComponentDeclaration<ValidationAutocompleteComponent, "val-autocomplete", never, { "FilteredSource": "FilteredSource"; "value": "value"; "label": "label"; }, { "optionChange": "optionChange"; }, never, never, false>;
|
|
58
58
|
}
|
package/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlValueAccessor } from "@angular/forms";
|
|
2
|
-
import { EventEmitter, Injector, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { ChangeDetectorRef, EventEmitter, Injector, SimpleChanges } from "@angular/core";
|
|
3
3
|
import { MatAutocompleteTrigger } from "@angular/material/autocomplete";
|
|
4
4
|
import { LocalizationService } from "@esfaenza/localizations";
|
|
5
5
|
import { BaseValidation } from "../base-validation";
|
|
@@ -40,7 +40,7 @@ export declare class ValidationAutocompleteMultiComponent extends BaseValidation
|
|
|
40
40
|
description: string;
|
|
41
41
|
}[];
|
|
42
42
|
/** @ignore */
|
|
43
|
-
constructor(_validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
43
|
+
constructor(cdr: ChangeDetectorRef, _validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
44
44
|
/** @ignore */
|
|
45
45
|
ngOnInit(): void;
|
|
46
46
|
/** @ignore */
|
|
@@ -63,7 +63,7 @@ export declare class ValidationAutocompleteMultiComponent extends BaseValidation
|
|
|
63
63
|
*
|
|
64
64
|
* @param {any} toEmit valore da propagare all'esterno
|
|
65
65
|
*/
|
|
66
|
-
onModelChange(toEmit: any, finalValue?: boolean
|
|
66
|
+
onModelChange(toEmit: any, finalValue?: boolean): void;
|
|
67
67
|
/** @ignore */
|
|
68
68
|
registerOnChange(fn: any): void;
|
|
69
69
|
/** @ignore */
|
|
@@ -78,6 +78,6 @@ export declare class ValidationAutocompleteMultiComponent extends BaseValidation
|
|
|
78
78
|
id: string;
|
|
79
79
|
description: string;
|
|
80
80
|
}): void;
|
|
81
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteMultiComponent, [{ optional: true; }, { optional: true; }, null, null]>;
|
|
81
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteMultiComponent, [null, { optional: true; }, { optional: true; }, null, null]>;
|
|
82
82
|
static ɵcmp: i0.ɵɵComponentDeclaration<ValidationAutocompleteMultiComponent, "val-autocomplete-multi", never, { "ChipThreshold": "ChipThreshold"; "FilteredSource": "FilteredSource"; "value": "value"; "label": "label"; "HideChoicesOnSelection": "HideChoicesOnSelection"; }, { "optionChange": "optionChange"; }, never, never, false>;
|
|
83
83
|
}
|
|
@@ -8,7 +8,6 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Componente di validaizone per gli input di tipo data
|
|
9
9
|
*/
|
|
10
10
|
export declare class ValidationDateComponent extends BaseValidation implements ControlValueAccessor {
|
|
11
|
-
private cdr;
|
|
12
11
|
private _validators;
|
|
13
12
|
private _asyncValidators;
|
|
14
13
|
private injector;
|
|
@@ -66,7 +65,7 @@ export declare class ValidationDateComponent extends BaseValidation implements C
|
|
|
66
65
|
*
|
|
67
66
|
* @param {any} toEmit valore da propagare all'esterno
|
|
68
67
|
*/
|
|
69
|
-
outputValue(toEmit: any
|
|
68
|
+
outputValue(toEmit: any): void;
|
|
70
69
|
/**
|
|
71
70
|
* @ignore
|
|
72
71
|
*/
|
|
@@ -8,7 +8,6 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Componente di validaizone per gli input di tipo data-ora
|
|
9
9
|
*/
|
|
10
10
|
export declare class ValidationDateTimeComponent extends BaseValidation implements ControlValueAccessor {
|
|
11
|
-
private cdr;
|
|
12
11
|
private _validators;
|
|
13
12
|
private _asyncValidators;
|
|
14
13
|
private injector;
|
|
@@ -96,7 +95,7 @@ export declare class ValidationDateTimeComponent extends BaseValidation implemen
|
|
|
96
95
|
*
|
|
97
96
|
* @param {any} toEmit valore da propagare all'esterno
|
|
98
97
|
*/
|
|
99
|
-
outputValue(toEmit: any
|
|
98
|
+
outputValue(toEmit: any): void;
|
|
100
99
|
/**
|
|
101
100
|
* @ignore
|
|
102
101
|
*/
|
|
@@ -7,7 +7,6 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* Componente di validaizone per gli input a semplice casella di testo
|
|
8
8
|
*/
|
|
9
9
|
export declare class ValidationInputComponent extends BaseValidation implements ControlValueAccessor {
|
|
10
|
-
private cdr;
|
|
11
10
|
private _validators;
|
|
12
11
|
private _asyncValidators;
|
|
13
12
|
private injector;
|
|
@@ -113,7 +112,7 @@ export declare class ValidationInputComponent extends BaseValidation implements
|
|
|
113
112
|
*
|
|
114
113
|
* @param {any} toEmit valore da propagare all'esterno
|
|
115
114
|
*/
|
|
116
|
-
onModelChange(toEmit: any
|
|
115
|
+
onModelChange(toEmit: any): void;
|
|
117
116
|
/**
|
|
118
117
|
* @ignore
|
|
119
118
|
*/
|
|
@@ -10,7 +10,6 @@ export declare class ValidationSelectComponent extends BaseValidation implements
|
|
|
10
10
|
private _validators;
|
|
11
11
|
private _asyncValidators;
|
|
12
12
|
private injector;
|
|
13
|
-
private cdr;
|
|
14
13
|
protected lc: LocalizationService;
|
|
15
14
|
/**
|
|
16
15
|
* valore del campo vuoto della select
|
|
@@ -82,7 +81,7 @@ export declare class ValidationSelectComponent extends BaseValidation implements
|
|
|
82
81
|
*
|
|
83
82
|
* @param {any} toEmit valore da propagare all'esterno
|
|
84
83
|
*/
|
|
85
|
-
onModelChange(toEmit: any
|
|
84
|
+
onModelChange(toEmit: any): void;
|
|
86
85
|
/**
|
|
87
86
|
* @ignore
|
|
88
87
|
*/
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esfaenza/forms-and-validations",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.0.0"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@angular/common": "
|
|
10
|
-
"@angular/core": "
|
|
11
|
-
"@angular/forms": "
|
|
12
|
-
"@angular/material": "
|
|
13
|
-
"@esfaenza/localizations": "^13.
|
|
14
|
-
"@esfaenza/access-control": "^13.
|
|
15
|
-
"@esfaenza/extensions": "^13.
|
|
16
|
-
"@esfaenza/material-dayjs-adapter": "^13.
|
|
17
|
-
"@esfaenza/ngx-currency-mask": "^13.
|
|
9
|
+
"@angular/common": "^14.3.0",
|
|
10
|
+
"@angular/core": "^14.3.0",
|
|
11
|
+
"@angular/forms": "^14.3.0",
|
|
12
|
+
"@angular/material": "14.2.7",
|
|
13
|
+
"@esfaenza/localizations": "^13.4.1",
|
|
14
|
+
"@esfaenza/access-control": "^13.4.1",
|
|
15
|
+
"@esfaenza/extensions": "^13.4.1",
|
|
16
|
+
"@esfaenza/material-dayjs-adapter": "^13.4.1",
|
|
17
|
+
"@esfaenza/ngx-currency-mask": "^13.4.1",
|
|
18
18
|
"angular2-multiselect-dropdown": "5.0.4",
|
|
19
19
|
"@angular-material-components/datetime-picker": "7.0.1",
|
|
20
|
-
"ngx-toastr": "
|
|
21
|
-
"ngx-bootstrap": "
|
|
22
|
-
"dayjs": "1.11.
|
|
20
|
+
"ngx-toastr": "15.2.2",
|
|
21
|
+
"ngx-bootstrap": "9.0.0",
|
|
22
|
+
"dayjs": "1.11.8",
|
|
23
23
|
"cerialize": "0.1.18",
|
|
24
|
-
"sweetalert2": "11.
|
|
24
|
+
"sweetalert2": "11.7.12"
|
|
25
25
|
},
|
|
26
26
|
"module": "fesm2015/esfaenza-forms-and-validations.mjs",
|
|
27
27
|
"es2020": "fesm2020/esfaenza-forms-and-validations.mjs",
|
package/public-api.d.ts
CHANGED