@esfaenza/forms-and-validations 13.1.12 → 13.1.13
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 +11 -3
- package/esm2020/lib/forms/form-adaptive/form-adaptive.component.mjs +3 -3
- package/esm2020/lib/forms/form-autocomplete/form-autocomplete.component.mjs +3 -3
- package/esm2020/lib/forms/form-date/form-date.component.mjs +3 -3
- package/esm2020/lib/forms/form-datetime/form-datetime.component.mjs +3 -3
- package/esm2020/lib/forms/form-input/form-input.component.mjs +3 -3
- package/esm2020/lib/forms/form-select/form-select.component.mjs +3 -3
- package/esm2020/lib/forms/form-textarea/form-textarea.component.mjs +3 -3
- package/esm2020/lib/validations/base-validation.mjs +30 -2
- package/esm2020/lib/validations/validation-autocomplete/validation-autocomplete.component.mjs +8 -7
- package/esm2020/lib/validations/validation-currency/validation-currency.component.mjs +15 -3
- package/esm2020/lib/validations/validation-date/validation-date.component.mjs +10 -3
- package/esm2020/lib/validations/validation-datetime/validation-datetime.component.mjs +10 -3
- package/esm2020/lib/validations/validation-input/validation-input.component.mjs +5 -3
- package/esm2020/lib/validations/validation-select/validation-select.component.mjs +5 -3
- package/esm2020/lib/validations/validation-text-area/validation-text-area.component.mjs +15 -3
- package/fesm2015/esfaenza-forms-and-validations.mjs +114 -35
- package/fesm2015/esfaenza-forms-and-validations.mjs.map +1 -1
- package/fesm2020/esfaenza-forms-and-validations.mjs +114 -35
- package/fesm2020/esfaenza-forms-and-validations.mjs.map +1 -1
- package/lib/forms/base-form-control.d.ts +10 -1
- package/lib/validations/base-validation.d.ts +27 -2
- package/lib/validations/validation-autocomplete/validation-autocomplete.component.d.ts +3 -4
- package/lib/validations/validation-currency/validation-currency.component.d.ts +8 -0
- package/lib/validations/validation-date/validation-date.component.d.ts +4 -0
- package/lib/validations/validation-datetime/validation-datetime.component.d.ts +4 -0
- package/lib/validations/validation-text-area/validation-text-area.component.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlValueAccessor, NgControl, NgForm, NgModel } from "@angular/forms";
|
|
2
2
|
import { EventEmitter, ChangeDetectorRef } from "@angular/core";
|
|
3
3
|
import { AccessControlService, ComponentContext } from "@esfaenza/access-control";
|
|
4
|
+
import { Subject } from "rxjs";
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* Componente base da cui tutti i componenti Form implementano
|
|
@@ -60,6 +61,14 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
60
61
|
* Se non lo sono, il campo risulterà in sola lettura
|
|
61
62
|
*/
|
|
62
63
|
private AppContextOwnership;
|
|
64
|
+
/**
|
|
65
|
+
* Subject a cui l'oggetto interno si collega per effettuare il focus dell'elemento input sottostante
|
|
66
|
+
*/
|
|
67
|
+
FocusSubject: Subject<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Modalità in cui viene mostrato il campo, 1-1 rispetto alle definizioni di Angular Material
|
|
70
|
+
*/
|
|
71
|
+
FieldAppearence: "legacy" | "standard" | "fill" | "outline";
|
|
63
72
|
/**
|
|
64
73
|
* Utilizza o meno il Layout di un form (Label con input di fianco), se false mostra solo l'input
|
|
65
74
|
*/
|
|
@@ -294,5 +303,5 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
294
303
|
*/
|
|
295
304
|
abstract onNotNullValueSet(): void;
|
|
296
305
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormControl, never>;
|
|
297
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormControl, never, never, { "FormLayout": "FormLayout"; "EmitPendingChanges": "EmitPendingChanges"; "Validation": "Validation"; "Placeholder": "Placeholder"; "FormGroupClass": "FormGroupClass"; "FailedValidationMessage": "FailedValidationMessage"; "ForcedError": "ForcedError"; "Label": "Label"; "LabelColWidth": "LabelColWidth"; "InputColWidth": "InputColWidth"; "Last": "Last"; "Form": "Form"; "Source": "Source"; "IdField": "IdField"; "Display": "Display"; "Readonly": "Readonly"; "LabelInputRatio": "LabelInputRatio"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never>;
|
|
306
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormControl, never, never, { "FocusSubject": "FocusSubject"; "FieldAppearence": "FieldAppearence"; "FormLayout": "FormLayout"; "EmitPendingChanges": "EmitPendingChanges"; "Validation": "Validation"; "Placeholder": "Placeholder"; "FormGroupClass": "FormGroupClass"; "FailedValidationMessage": "FailedValidationMessage"; "ForcedError": "ForcedError"; "Label": "Label"; "LabelColWidth": "LabelColWidth"; "InputColWidth": "InputColWidth"; "Last": "Last"; "Form": "Form"; "Source": "Source"; "IdField": "IdField"; "Display": "Display"; "Readonly": "Readonly"; "LabelInputRatio": "LabelInputRatio"; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never>;
|
|
298
307
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from "@angular/core";
|
|
1
|
+
import { EventEmitter, ElementRef } 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
|
+
import { Subject } from "rxjs";
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Classe astratta base che contiene le logiche / proprietà in comune a tutti i validatori
|
|
@@ -35,6 +36,10 @@ export declare abstract class BaseValidation {
|
|
|
35
36
|
* @param {TooltipDirective} comp Elemento HTML a cui è applicata la direttiva del tooltip
|
|
36
37
|
*/
|
|
37
38
|
set tooltip_static(comp: TooltipDirective);
|
|
39
|
+
/**
|
|
40
|
+
* Elemento HTML rappresentante l'Input
|
|
41
|
+
*/
|
|
42
|
+
htmlInput: ElementRef;
|
|
38
43
|
/**
|
|
39
44
|
* Query che raccoglie l'input o direttiva che contiene il valore in maniera statica (solo all'inizio)
|
|
40
45
|
*/
|
|
@@ -45,6 +50,10 @@ export declare abstract class BaseValidation {
|
|
|
45
50
|
* @param {NgModel} comp Elemento HTML associato al ngModel del componente
|
|
46
51
|
*/
|
|
47
52
|
set baseInput_static(comp: NgModel);
|
|
53
|
+
/**
|
|
54
|
+
* Subject a cui l'oggetto interno si collega per effettuare il focus dell'elemento input sottostante
|
|
55
|
+
*/
|
|
56
|
+
FocusSubject: Subject<void>;
|
|
48
57
|
/**
|
|
49
58
|
* Indica se di default deve valutare il messaggio di errore in base al validatore che fallisce.
|
|
50
59
|
*
|
|
@@ -52,6 +61,10 @@ export declare abstract class BaseValidation {
|
|
|
52
61
|
* un eventuale pattern validator scriverà che il formato dell'input è invalido
|
|
53
62
|
*/
|
|
54
63
|
InferErrorMessages: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Modalità in cui viene mostrato il campo, 1-1 rispetto alle definizioni di Angular Material
|
|
66
|
+
*/
|
|
67
|
+
FieldAppearence: "legacy" | "standard" | "fill" | "outline";
|
|
55
68
|
/**
|
|
56
69
|
* Messaggio da mostrare se la validazione fallisce.
|
|
57
70
|
*
|
|
@@ -165,6 +178,18 @@ export declare abstract class BaseValidation {
|
|
|
165
178
|
* Finalizzazione Input
|
|
166
179
|
*/
|
|
167
180
|
onFinalize(): void;
|
|
181
|
+
/**
|
|
182
|
+
* Subscription alle richieste di focus
|
|
183
|
+
*/
|
|
184
|
+
observable: any;
|
|
185
|
+
/**
|
|
186
|
+
* Registra il Subject per ricevere le richieste di Focus dall'esterno
|
|
187
|
+
*/
|
|
188
|
+
registerFocusRequest(): any;
|
|
189
|
+
/**
|
|
190
|
+
* Deregistra il Subject delle richieste di focus
|
|
191
|
+
*/
|
|
192
|
+
deregisterFocusRequest(): void;
|
|
168
193
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseValidation, never>;
|
|
169
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseValidation, never, never, { "InferErrorMessages": "InferErrorMessages"; "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>;
|
|
194
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseValidation, never, never, { "FocusSubject": "FocusSubject"; "InferErrorMessages": "InferErrorMessages"; "FieldAppearence": "FieldAppearence"; "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>;
|
|
170
195
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlValueAccessor } from "@angular/forms";
|
|
2
|
-
import {
|
|
2
|
+
import { 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";
|
|
@@ -11,7 +11,6 @@ export declare class ValidationAutocompleteComponent extends BaseValidation impl
|
|
|
11
11
|
private _asyncValidators;
|
|
12
12
|
private injector;
|
|
13
13
|
protected lc: LocalizationService;
|
|
14
|
-
private cdr;
|
|
15
14
|
/**
|
|
16
15
|
* Sorgente da cui scegliere valori filtrata in base a quello che ha scritto l'utente
|
|
17
16
|
*/
|
|
@@ -42,7 +41,7 @@ export declare class ValidationAutocompleteComponent extends BaseValidation impl
|
|
|
42
41
|
/**
|
|
43
42
|
* @ignore
|
|
44
43
|
*/
|
|
45
|
-
constructor(_validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService
|
|
44
|
+
constructor(_validators: Array<any>, _asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
46
45
|
/**
|
|
47
46
|
* @ignore
|
|
48
47
|
*/
|
|
@@ -82,6 +81,6 @@ export declare class ValidationAutocompleteComponent extends BaseValidation impl
|
|
|
82
81
|
* @ignore
|
|
83
82
|
*/
|
|
84
83
|
registerOnTouched(fn: any): void;
|
|
85
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteComponent, [{ optional: true; }, { optional: true; }, null, null
|
|
84
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationAutocompleteComponent, [{ optional: true; }, { optional: true; }, null, null]>;
|
|
86
85
|
static ɵcmp: i0.ɵɵComponentDeclaration<ValidationAutocompleteComponent, "val-autocomplete", never, { "FilteredSource": "FilteredSource"; "value": "value"; "label": "label"; }, { "optionChange": "optionChange"; }, never, never>;
|
|
87
86
|
}
|
|
@@ -15,6 +15,14 @@ export declare class ValidationCurrencyComponent extends ValidationInputComponen
|
|
|
15
15
|
* @ignore
|
|
16
16
|
*/
|
|
17
17
|
constructor(cdr: ChangeDetectorRef, validators: Array<any>, asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
ngOnDestroy(): void;
|
|
18
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationCurrencyComponent, [null, { optional: true; }, { optional: true; }, null, null]>;
|
|
19
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<ValidationCurrencyComponent, "val-currency", never, { "CurrencyOptions": "CurrencyOptions"; }, {}, never, never>;
|
|
20
28
|
}
|
|
@@ -15,6 +15,14 @@ export declare class ValidationTextAreaComponent extends ValidationInputComponen
|
|
|
15
15
|
* @ignore
|
|
16
16
|
*/
|
|
17
17
|
constructor(cdr: ChangeDetectorRef, validators: Array<any>, asyncValidators: Array<any>, injector: Injector, lc: LocalizationService);
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
ngOnDestroy(): void;
|
|
18
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationTextAreaComponent, [null, { optional: true; }, { optional: true; }, null, null]>;
|
|
19
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<ValidationTextAreaComponent, "val-textarea", never, { "rows": "rows"; }, {}, never, never>;
|
|
20
28
|
}
|