@esfaenza/forms-and-validations 11.2.148 → 11.2.149-beta2
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/bundles/esfaenza-forms-and-validations.umd.js +220 -70
- package/bundles/esfaenza-forms-and-validations.umd.js.map +1 -1
- package/esfaenza-forms-and-validations.d.ts +7 -6
- package/esfaenza-forms-and-validations.metadata.json +1 -1
- package/esm2015/esfaenza-forms-and-validations.js +8 -7
- package/esm2015/lib/forms/base-form-control.js +91 -37
- package/esm2015/lib/forms/form-input/form-input.component.js +31 -8
- package/esm2015/lib/forms/form-input-new/form-input.component.js +66 -0
- package/esm2015/lib/forms/form-select/form-select.component.js +2 -2
- package/esm2015/lib/forms-and-validations.module.js +8 -3
- package/esm2015/lib/validations/validation-select/validation-select.component.js +3 -3
- package/fesm2015/esfaenza-forms-and-validations.js +184 -46
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/base-form-control.d.ts +43 -21
- package/lib/forms/form-input/form-input.component.d.ts +11 -1
- package/lib/forms/form-input-new/form-input.component.d.ts +21 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlValueAccessor, NgControl, NgForm, NgModel } from "@angular/forms";
|
|
2
|
-
import { EventEmitter, ChangeDetectorRef } from "@angular/core";
|
|
2
|
+
import { EventEmitter, ChangeDetectorRef, ElementRef } from "@angular/core";
|
|
3
3
|
import { AccessControlService, ComponentContext } from "@esfaenza/access-control";
|
|
4
4
|
import { Subject } from "rxjs";
|
|
5
5
|
import { TemplateRef } from "@angular/core";
|
|
@@ -140,20 +140,10 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
140
140
|
* @param {string} input Input nel formato "X Y"
|
|
141
141
|
*/
|
|
142
142
|
set LabelInputRatio(input: string);
|
|
143
|
-
/** val-qualcosa che fa effettivamente da input, o eventualmente il singolo input in casi particolari (es checkbox) */
|
|
144
|
-
protected validationControl: NgModel;
|
|
145
143
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* @param {NgModel} comp Elemento HTML marcato con "#validationControl"
|
|
144
|
+
* Elemento HTML rappresentante l'Input
|
|
149
145
|
*/
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Query sull'elemento 'validationControl' che funziona in ambiente dinamico
|
|
153
|
-
*
|
|
154
|
-
* @param {NgModel} comp Elemento HTML marcato con "#validationControl"
|
|
155
|
-
*/
|
|
156
|
-
set validationControl_static(comp: NgModel);
|
|
146
|
+
htmlInput: ElementRef;
|
|
157
147
|
/** Evento chiamato alla modifica del valore collegato a questo campo */
|
|
158
148
|
inputChange: EventEmitter<ChangeEvent>;
|
|
159
149
|
/** Evento chiamato al focus del campo di testo/combo/quelcheè, riemitta l'evento originale Javascript */
|
|
@@ -200,7 +190,7 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
200
190
|
*/
|
|
201
191
|
ngOnDestroy(): void;
|
|
202
192
|
/** Elabora i validatori iniettati e capisce se il valore è obbligatorio o meno */
|
|
203
|
-
|
|
193
|
+
doCheckRequiredValidator(): void;
|
|
204
194
|
/** @ignore */
|
|
205
195
|
ngAfterViewInit(): void;
|
|
206
196
|
/** Helper che collega la funzione di reset del controllo form al controllo di validazione sottostante */
|
|
@@ -211,19 +201,17 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
211
201
|
registerOnChange(fn: any): void;
|
|
212
202
|
/** @ignore */
|
|
213
203
|
registerOnTouched(fn: any): void;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
*/
|
|
219
|
-
registerValComp(comp: NgModel): void;
|
|
204
|
+
protected validationControl: NgModel;
|
|
205
|
+
set baseInput(comp: NgModel);
|
|
206
|
+
set baseInput_static(comp: NgModel);
|
|
207
|
+
doRegisterBaseInput(baseInput: NgModel): void;
|
|
220
208
|
registerForm(ngForm: NgForm): void;
|
|
221
209
|
/**
|
|
222
210
|
* Aggiorna il valore e la validità dell'input sottostante. Non viene chiamato per input nativi come le checkbox
|
|
223
211
|
*
|
|
224
212
|
* @param {boolean} forcedValue Forza l'aggiornamento anche se non è un input nativo (input nativo = checkbox, ad esempio)
|
|
225
213
|
*/
|
|
226
|
-
|
|
214
|
+
doUpdateValidityForNativeInput(forcedValue?: boolean): void;
|
|
227
215
|
/**
|
|
228
216
|
* @ignore
|
|
229
217
|
* Classico "spara fuori". Mantengo lo stesso nome dell'evento dei <val-*> (inputChange) per retrocompatibilità.
|
|
@@ -253,4 +241,38 @@ export declare abstract class BaseFormControl implements ControlValueAccessor {
|
|
|
253
241
|
log(message: string): void;
|
|
254
242
|
/** @ignore */
|
|
255
243
|
abstract onNotNullValueSet(): void;
|
|
244
|
+
/**
|
|
245
|
+
* Variabile per tenere in memoria lo stato di submit di questo componente
|
|
246
|
+
*/
|
|
247
|
+
protected _submitted: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Variabile per tenere in memoria il fatto che il componente è forzato a invalido o no
|
|
250
|
+
*/
|
|
251
|
+
protected _forceInvalid: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Imposta il componente come "submitted" scatenandone le validazioni ed eventualmente la visualizzazione del tooltip di errore
|
|
254
|
+
*
|
|
255
|
+
* @param {boolean} val **true** se si vuole impostare questo controllo come submitted, **false** altrimenti
|
|
256
|
+
*/
|
|
257
|
+
set submitted(val: boolean);
|
|
258
|
+
/**
|
|
259
|
+
* Imposta il componente come "invalid" a prescindere dai validatori
|
|
260
|
+
*/
|
|
261
|
+
set forceInvalid(val: boolean);
|
|
262
|
+
/**
|
|
263
|
+
* @ignore
|
|
264
|
+
*/
|
|
265
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
266
|
+
/**
|
|
267
|
+
* Subscription alle richieste di focus
|
|
268
|
+
*/
|
|
269
|
+
observable: any;
|
|
270
|
+
/**
|
|
271
|
+
* Registra il Subject per ricevere le richieste di Focus dall'esterno
|
|
272
|
+
*/
|
|
273
|
+
registerFocusRequest(): any;
|
|
274
|
+
/**
|
|
275
|
+
* Deregistra il Subject delle richieste di focus
|
|
276
|
+
*/
|
|
277
|
+
deregisterFocusRequest(): void;
|
|
256
278
|
}
|
|
@@ -4,7 +4,7 @@ import { BaseFormControl } from "../base-form-control";
|
|
|
4
4
|
import { AccessControlService, ComponentContext } from '@esfaenza/access-control';
|
|
5
5
|
import { ChangeDetectorRef } from "@angular/core";
|
|
6
6
|
/** Semplice componente di Input testuale, con eventuale prefisso/suffisso */
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class FormInputComponentOLD extends BaseFormControl implements ControlValueAccessor {
|
|
8
8
|
/** Indica se l'input relativo è di tipo Password */
|
|
9
9
|
Password: boolean;
|
|
10
10
|
/** Delegato per l'esecuzione di un'operazione al click del suffisso */
|
|
@@ -27,4 +27,14 @@ export declare class FormInputComponent extends BaseFormControl implements Contr
|
|
|
27
27
|
ngAfterContentInit(): void;
|
|
28
28
|
/** @ignore */
|
|
29
29
|
onNotNullValueSet(): void;
|
|
30
|
+
ShowPassword: boolean;
|
|
31
|
+
onShowHidePassword(event: any): void;
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
ngOnInit(): void;
|
|
36
|
+
/**
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
ngOnDestroy(): void;
|
|
30
40
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EventEmitter } from "@angular/core";
|
|
2
|
+
import { ControlValueAccessor, NgControl } from "@angular/forms";
|
|
3
|
+
import { BaseFormControl } from "../base-form-control";
|
|
4
|
+
import { AccessControlService, ComponentContext } from '@esfaenza/access-control';
|
|
5
|
+
import { ChangeDetectorRef } from "@angular/core";
|
|
6
|
+
export declare class FormInputComponent extends BaseFormControl implements ControlValueAccessor {
|
|
7
|
+
Password: boolean;
|
|
8
|
+
onSuffixAction: EventEmitter<void>;
|
|
9
|
+
onPrefixAction: EventEmitter<void>;
|
|
10
|
+
suffix: any;
|
|
11
|
+
prefix: any;
|
|
12
|
+
HasSuffix: boolean;
|
|
13
|
+
HasPrefix: boolean;
|
|
14
|
+
constructor(cdr: ChangeDetectorRef, ngControl: NgControl, _validators: Array<any>, ac: AccessControlService, AppContext: ComponentContext, ACO_CUSTOMKEY: string, FAV_DEBUG_MODE: boolean);
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
writeValue(obj: any): void;
|
|
18
|
+
ngAfterContentInit(): void;
|
|
19
|
+
onNotNullValueSet(): void;
|
|
20
|
+
onBlur(): void;
|
|
21
|
+
}
|