@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,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/core'), require('@esfaenza/material-dayjs-adapter'), require('@angular/common'), require('@angular/forms'), require('@angular/material/datepicker'), require('@angular/material/autocomplete'), require('@angular/material/input'), require('@angular/material/chips'), require('@angular/material/icon'), require('@angular/material/checkbox'), require('@esfaenza/localizations'), require('@esfaenza/ngx-currency-mask'), require('angular2-multiselect-dropdown'), require('@angular-material-components/datetime-picker'), require('ngx-bootstrap/tooltip'), require('rxjs'), require('rxjs/operators'), require('@esfaenza/extensions'), require('@esfaenza/access-control')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/forms-and-validations', ['exports', '@angular/core', '@angular/material/core', '@esfaenza/material-dayjs-adapter', '@angular/common', '@angular/forms', '@angular/material/datepicker', '@angular/material/autocomplete', '@angular/material/input', '@angular/material/chips', '@angular/material/icon', '@angular/material/checkbox', '@esfaenza/localizations', '@esfaenza/ngx-currency-mask', 'angular2-multiselect-dropdown', '@angular-material-components/datetime-picker', 'ngx-bootstrap/tooltip', 'rxjs', 'rxjs/operators', '@esfaenza/extensions', '@esfaenza/access-control'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza['forms-and-validations'] = {}), global.ng.core, global.ng.material.core, global.materialDayjsAdapter, global.ng.common, global.ng.forms, global.ng.material.datepicker, global.ng.material.autocomplete, global.ng.material.input, global.ng.material.chips, global.ng.material.icon, global.ng.material.checkbox, global.localizations, global.ngxCurrencyMask, global.angular2MultiselectDropdown, global.datetimePicker, global.tooltip, global.rxjs, global.rxjs.operators, global.extensions, global.accessControl));
|
|
5
|
-
}(this, (function (exports, core, core$1, materialDayjsAdapter, common, forms, datepicker, autocomplete, input, chips, icon, checkbox, localizations, ngxCurrencyMask, angular2MultiselectDropdown, datetimePicker, tooltip, rxjs, operators, extensions, accessControl) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/core'), require('@esfaenza/material-dayjs-adapter'), require('@angular/common'), require('@angular/forms'), require('@angular/material/datepicker'), require('@angular/material/autocomplete'), require('@angular/material/input'), require('@angular/material/chips'), require('@angular/material/icon'), require('@angular/material/checkbox'), require('primeng/inputtext'), require('@esfaenza/localizations'), require('@esfaenza/ngx-currency-mask'), require('angular2-multiselect-dropdown'), require('@angular-material-components/datetime-picker'), require('ngx-bootstrap/tooltip'), require('rxjs'), require('rxjs/operators'), require('@esfaenza/extensions'), require('@esfaenza/access-control')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/forms-and-validations', ['exports', '@angular/core', '@angular/material/core', '@esfaenza/material-dayjs-adapter', '@angular/common', '@angular/forms', '@angular/material/datepicker', '@angular/material/autocomplete', '@angular/material/input', '@angular/material/chips', '@angular/material/icon', '@angular/material/checkbox', 'primeng/inputtext', '@esfaenza/localizations', '@esfaenza/ngx-currency-mask', 'angular2-multiselect-dropdown', '@angular-material-components/datetime-picker', 'ngx-bootstrap/tooltip', 'rxjs', 'rxjs/operators', '@esfaenza/extensions', '@esfaenza/access-control'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza['forms-and-validations'] = {}), global.ng.core, global.ng.material.core, global.materialDayjsAdapter, global.ng.common, global.ng.forms, global.ng.material.datepicker, global.ng.material.autocomplete, global.ng.material.input, global.ng.material.chips, global.ng.material.icon, global.ng.material.checkbox, global.inputtext, global.localizations, global.ngxCurrencyMask, global.angular2MultiselectDropdown, global.datetimePicker, global.tooltip, global.rxjs, global.rxjs.operators, global.extensions, global.accessControl));
|
|
5
|
+
}(this, (function (exports, core, core$1, materialDayjsAdapter, common, forms, datepicker, autocomplete, input, chips, icon, checkbox, inputtext, localizations, ngxCurrencyMask, angular2MultiselectDropdown, datetimePicker, tooltip, rxjs, operators, extensions, accessControl) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ChangeEvent = /** @class */ (function () {
|
|
8
8
|
function ChangeEvent(internal, value) {
|
|
@@ -827,11 +827,11 @@
|
|
|
827
827
|
/**
|
|
828
828
|
* valore del campo vuoto della select
|
|
829
829
|
*/
|
|
830
|
-
_this.emptyFieldValue = "-
|
|
830
|
+
_this.emptyFieldValue = "-2000";
|
|
831
831
|
/**
|
|
832
832
|
* Valore del placeholder
|
|
833
833
|
*/
|
|
834
|
-
_this.placeHolderValue = "-
|
|
834
|
+
_this.placeHolderValue = "-1000";
|
|
835
835
|
/**
|
|
836
836
|
* Per i componenti non obbligatori indica se fornire un "valore vuoto"
|
|
837
837
|
*/
|
|
@@ -2083,6 +2083,10 @@
|
|
|
2083
2083
|
/** Cache delle proprietà scritte tipo --> {prop} */
|
|
2084
2084
|
this.BindProperties = [];
|
|
2085
2085
|
this.destroyed$ = new rxjs.Subject();
|
|
2086
|
+
/**
|
|
2087
|
+
* Variabile per tenere in memoria il fatto che il componente è forzato a invalido o no
|
|
2088
|
+
*/
|
|
2089
|
+
this._forceInvalid = false;
|
|
2086
2090
|
if (ngControl == null) {
|
|
2087
2091
|
if (!this.handleNullNgControl())
|
|
2088
2092
|
console.error("ngControl nullo per qualche motivo! Il 90% delle funzionalità di questo input saranno disabilitate");
|
|
@@ -2149,27 +2153,6 @@
|
|
|
2149
2153
|
enumerable: false,
|
|
2150
2154
|
configurable: true
|
|
2151
2155
|
});
|
|
2152
|
-
Object.defineProperty(BaseFormControl.prototype, "_validationControl", {
|
|
2153
|
-
/**
|
|
2154
|
-
* Query sull'elemento 'validationControl' che funziona in ambiente statico
|
|
2155
|
-
*
|
|
2156
|
-
* @param {NgModel} comp Elemento HTML marcato con "#validationControl"
|
|
2157
|
-
*/
|
|
2158
|
-
set: function (comp) { this.registerValComp(comp); },
|
|
2159
|
-
enumerable: false,
|
|
2160
|
-
configurable: true
|
|
2161
|
-
});
|
|
2162
|
-
Object.defineProperty(BaseFormControl.prototype, "validationControl_static", {
|
|
2163
|
-
/**
|
|
2164
|
-
* Query sull'elemento 'validationControl' che funziona in ambiente dinamico
|
|
2165
|
-
*
|
|
2166
|
-
* @param {NgModel} comp Elemento HTML marcato con "#validationControl"
|
|
2167
|
-
*/
|
|
2168
|
-
set: function (comp) { this.registerValComp(comp); },
|
|
2169
|
-
enumerable: false,
|
|
2170
|
-
configurable: true
|
|
2171
|
-
});
|
|
2172
|
-
;
|
|
2173
2156
|
/**
|
|
2174
2157
|
* Effettua il Bind/Parse delle varie **Source** unendo le informazioni specificate in **Display**
|
|
2175
2158
|
*
|
|
@@ -2258,7 +2241,7 @@
|
|
|
2258
2241
|
var _this = this;
|
|
2259
2242
|
// A volte nell'ngOnInit non ci passa quindi lo metto sia qui sia nell'afterviewinit, penso che valga per i componenti di terze parti
|
|
2260
2243
|
// che si collegano per i cazzi loro al form ecc, quindi la parte sopra non serve... BOH
|
|
2261
|
-
this.
|
|
2244
|
+
this.doCheckRequiredValidator();
|
|
2262
2245
|
//Il nome non c'è se metto standalone : true (CHE NON é DA METTERE)
|
|
2263
2246
|
//Dato che anche il controllo esterno viene considerato come componente del form, non posso basarmi solo sul nome ma devo aggiungere un tag. In questo caso "_internal"
|
|
2264
2247
|
// ATTENZIONE: QUALSIASI SIA IL MOTIVO, SE STO COSO VIENE SPOSTATO DALL ngOnInit NON FUNZIONA PIU NULLA
|
|
@@ -2276,6 +2259,7 @@
|
|
|
2276
2259
|
var origFunc_1 = this.Form.onSubmit;
|
|
2277
2260
|
var formOutsideRef = this.Form;
|
|
2278
2261
|
this.Form.onSubmit = function (ev) {
|
|
2262
|
+
_this.submitted = true;
|
|
2279
2263
|
_this.cdr.markForCheck();
|
|
2280
2264
|
return origFunc_1.apply(formOutsideRef);
|
|
2281
2265
|
};
|
|
@@ -2283,11 +2267,14 @@
|
|
|
2283
2267
|
if (this.SetValidationSubject) {
|
|
2284
2268
|
this.SetValidationSubject.pipe(operators.takeUntil(this.destroyed$)).subscribe(function (v) {
|
|
2285
2269
|
if (v.fieldName + "_internal" == _this.GeneratedName) {
|
|
2270
|
+
// Bisogna farlo su entrambi i Control per portare il ".valid" nel punto giusto
|
|
2271
|
+
// e per avere gli stili sull'input
|
|
2286
2272
|
var control = _this.Form.getControl(_this.validationControl);
|
|
2287
2273
|
control.setErrors({ forcedtoinvalid: true });
|
|
2288
2274
|
control.markAsTouched();
|
|
2289
2275
|
_this.ngControl.control.setErrors({ forcedtoinvalid: true });
|
|
2290
2276
|
_this.ngControl.control.markAsTouched();
|
|
2277
|
+
_this.cdr.markForCheck();
|
|
2291
2278
|
}
|
|
2292
2279
|
});
|
|
2293
2280
|
}
|
|
@@ -2303,17 +2290,17 @@
|
|
|
2303
2290
|
this.destroyed$.complete();
|
|
2304
2291
|
};
|
|
2305
2292
|
/** Elabora i validatori iniettati e capisce se il valore è obbligatorio o meno */
|
|
2306
|
-
BaseFormControl.prototype.
|
|
2307
|
-
//
|
|
2293
|
+
BaseFormControl.prototype.doCheckRequiredValidator = function () {
|
|
2294
|
+
// Controllo se è settato un required per decidere in maniera condizionale se utilizzare il validatore required nel componente interno
|
|
2308
2295
|
// Lo faccio qui e non in un eventuale ngOnInit o costruttore perché ngOnInit non sempre viene chiamato e da costruttore il validatore non ha ancora il valore giusto
|
|
2309
|
-
if (this._validators && this._validators.some(function (elem) { return elem instanceof forms.RequiredValidator && elem.required; }))
|
|
2296
|
+
if (this._validators && this.Validation && this._validators.some(function (elem) { return elem instanceof forms.RequiredValidator && elem.required; }))
|
|
2310
2297
|
this.Required = true;
|
|
2311
2298
|
};
|
|
2312
2299
|
/** @ignore */
|
|
2313
2300
|
BaseFormControl.prototype.ngAfterViewInit = function () {
|
|
2314
2301
|
if (!this.ngControl)
|
|
2315
2302
|
return;
|
|
2316
|
-
this.
|
|
2303
|
+
this.doCheckRequiredValidator();
|
|
2317
2304
|
};
|
|
2318
2305
|
/** Helper che collega la funzione di reset del controllo form al controllo di validazione sottostante */
|
|
2319
2306
|
BaseFormControl.prototype.bindResetFunction = function () {
|
|
@@ -2341,7 +2328,7 @@
|
|
|
2341
2328
|
if (this.Model)
|
|
2342
2329
|
this.onNotNullValueSet();
|
|
2343
2330
|
// markForCheck non va bene in quanto arrivano possibilmente 2 update su un solo ciclo di stack
|
|
2344
|
-
//
|
|
2331
|
+
// setTimeout che wrappa tutto non va bene sennò spamma delle change detection a suon di interval che rallentano tantissimo l'app
|
|
2345
2332
|
this.cdr.detectChanges();
|
|
2346
2333
|
};
|
|
2347
2334
|
/** @ignore */
|
|
@@ -2352,17 +2339,23 @@
|
|
|
2352
2339
|
BaseFormControl.prototype.registerOnTouched = function (fn) {
|
|
2353
2340
|
this.onTouched = fn;
|
|
2354
2341
|
};
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
BaseFormControl.prototype
|
|
2361
|
-
|
|
2342
|
+
Object.defineProperty(BaseFormControl.prototype, "baseInput", {
|
|
2343
|
+
set: function (comp) { this.doRegisterBaseInput(comp); },
|
|
2344
|
+
enumerable: false,
|
|
2345
|
+
configurable: true
|
|
2346
|
+
});
|
|
2347
|
+
Object.defineProperty(BaseFormControl.prototype, "baseInput_static", {
|
|
2348
|
+
set: function (comp) { this.doRegisterBaseInput(comp); },
|
|
2349
|
+
enumerable: false,
|
|
2350
|
+
configurable: true
|
|
2351
|
+
});
|
|
2352
|
+
;
|
|
2353
|
+
BaseFormControl.prototype.doRegisterBaseInput = function (baseInput) {
|
|
2354
|
+
if (baseInput) {
|
|
2362
2355
|
// È arrivato un nuovo validationContorl (succede solo nel form-select quando cambia la source da 0 elementi / null ad N elementi, quindi al massimo una volta)
|
|
2363
2356
|
if (this.validationControl && this.Form)
|
|
2364
2357
|
this.Form.removeControl(this.validationControl);
|
|
2365
|
-
this.validationControl =
|
|
2358
|
+
this.validationControl = baseInput;
|
|
2366
2359
|
//Questa serve per passare avanti i validatori
|
|
2367
2360
|
if (this.UseUserValidators)
|
|
2368
2361
|
this.validationControl.control.setValidators(this._validators);
|
|
@@ -2373,10 +2366,11 @@
|
|
|
2373
2366
|
}
|
|
2374
2367
|
if (this.ngControl)
|
|
2375
2368
|
this.bindResetFunction();
|
|
2376
|
-
//I val-roba questo lo fanno automaticamente dentro... gli altri no (es. semplice input checkbox)
|
|
2377
|
-
this.
|
|
2369
|
+
// I val-roba questo lo fanno automaticamente dentro... gli altri no (es. semplice input checkbox)
|
|
2370
|
+
this.doUpdateValidityForNativeInput();
|
|
2378
2371
|
}
|
|
2379
2372
|
};
|
|
2373
|
+
//#endregion
|
|
2380
2374
|
BaseFormControl.prototype.registerForm = function (ngForm) {
|
|
2381
2375
|
this.Form = ngForm;
|
|
2382
2376
|
this.Form.addControl(this.validationControl);
|
|
@@ -2387,10 +2381,9 @@
|
|
|
2387
2381
|
*
|
|
2388
2382
|
* @param {boolean} forcedValue Forza l'aggiornamento anche se non è un input nativo (input nativo = checkbox, ad esempio)
|
|
2389
2383
|
*/
|
|
2390
|
-
BaseFormControl.prototype.
|
|
2384
|
+
BaseFormControl.prototype.doUpdateValidityForNativeInput = function (forcedValue) {
|
|
2391
2385
|
if (forcedValue === void 0) { forcedValue = false; }
|
|
2392
|
-
|
|
2393
|
-
this.validationControl.control.updateValueAndValidity();
|
|
2386
|
+
this.validationControl.control.updateValueAndValidity();
|
|
2394
2387
|
};
|
|
2395
2388
|
/**
|
|
2396
2389
|
* @ignore
|
|
@@ -2442,6 +2435,74 @@
|
|
|
2442
2435
|
if (this.FAV_DEBUG_MODE)
|
|
2443
2436
|
console.log("@forms-and-validations: " + message);
|
|
2444
2437
|
};
|
|
2438
|
+
Object.defineProperty(BaseFormControl.prototype, "submitted", {
|
|
2439
|
+
/**
|
|
2440
|
+
* Imposta il componente come "submitted" scatenandone le validazioni ed eventualmente la visualizzazione del tooltip di errore
|
|
2441
|
+
*
|
|
2442
|
+
* @param {boolean} val **true** se si vuole impostare questo controllo come submitted, **false** altrimenti
|
|
2443
|
+
*/
|
|
2444
|
+
set: function (val) {
|
|
2445
|
+
this._submitted = val;
|
|
2446
|
+
if (!this.validationControl)
|
|
2447
|
+
return;
|
|
2448
|
+
if (val) {
|
|
2449
|
+
this.validationControl.control.markAsTouched();
|
|
2450
|
+
this.validationControl.control.markAsDirty();
|
|
2451
|
+
}
|
|
2452
|
+
if (this.validationControl.control.status === "INVALID" && val) { /*this.showTooltipWithMessage();*/ }
|
|
2453
|
+
else { /*this.tooltip.hide();*/ }
|
|
2454
|
+
},
|
|
2455
|
+
enumerable: false,
|
|
2456
|
+
configurable: true
|
|
2457
|
+
});
|
|
2458
|
+
Object.defineProperty(BaseFormControl.prototype, "forceInvalid", {
|
|
2459
|
+
/**
|
|
2460
|
+
* Imposta il componente come "invalid" a prescindere dai validatori
|
|
2461
|
+
*/
|
|
2462
|
+
set: function (val) {
|
|
2463
|
+
var _this = this;
|
|
2464
|
+
this._forceInvalid = val;
|
|
2465
|
+
if (val)
|
|
2466
|
+
setTimeout(function () {
|
|
2467
|
+
_this.validationControl.control.setErrors({ forcedtoinvalid: true });
|
|
2468
|
+
_this.validationControl.control.markAsTouched();
|
|
2469
|
+
_this.validationControl.control.markAsDirty();
|
|
2470
|
+
_this.cdr.detectChanges();
|
|
2471
|
+
});
|
|
2472
|
+
else
|
|
2473
|
+
setTimeout(function () {
|
|
2474
|
+
_this.validationControl.control.setErrors({ forcedtoinvalid: null });
|
|
2475
|
+
_this.validationControl.control.updateValueAndValidity();
|
|
2476
|
+
});
|
|
2477
|
+
},
|
|
2478
|
+
enumerable: false,
|
|
2479
|
+
configurable: true
|
|
2480
|
+
});
|
|
2481
|
+
/**
|
|
2482
|
+
* @ignore
|
|
2483
|
+
*/
|
|
2484
|
+
BaseFormControl.prototype.setDisabledState = function (isDisabled) {
|
|
2485
|
+
isDisabled ? this.validationControl.control.disable() : this.validationControl.control.enable();
|
|
2486
|
+
this.Readonly = isDisabled;
|
|
2487
|
+
};
|
|
2488
|
+
/**
|
|
2489
|
+
* Registra il Subject per ricevere le richieste di Focus dall'esterno
|
|
2490
|
+
*/
|
|
2491
|
+
BaseFormControl.prototype.registerFocusRequest = function () {
|
|
2492
|
+
var _this = this;
|
|
2493
|
+
if (!this.FocusSubject)
|
|
2494
|
+
return;
|
|
2495
|
+
this.observable = this.FocusSubject.subscribe(function (t) {
|
|
2496
|
+
_this.htmlInput.nativeElement.focus();
|
|
2497
|
+
});
|
|
2498
|
+
};
|
|
2499
|
+
/**
|
|
2500
|
+
* Deregistra il Subject delle richieste di focus
|
|
2501
|
+
*/
|
|
2502
|
+
BaseFormControl.prototype.deregisterFocusRequest = function () {
|
|
2503
|
+
if (this.observable)
|
|
2504
|
+
this.observable.unsubscribe();
|
|
2505
|
+
};
|
|
2445
2506
|
return BaseFormControl;
|
|
2446
2507
|
}());
|
|
2447
2508
|
BaseFormControl.decorators = [
|
|
@@ -2485,11 +2546,14 @@
|
|
|
2485
2546
|
Display: [{ type: core.Input }],
|
|
2486
2547
|
Readonly: [{ type: core.Input }],
|
|
2487
2548
|
LabelInputRatio: [{ type: core.Input }],
|
|
2488
|
-
|
|
2489
|
-
validationControl_static: [{ type: core.ViewChild, args: ["validationControl", { static: true },] }],
|
|
2549
|
+
htmlInput: [{ type: core.ViewChild, args: ['htmlInput', { static: false },] }],
|
|
2490
2550
|
inputChange: [{ type: core.Output }],
|
|
2491
2551
|
inputFocus: [{ type: core.Output }],
|
|
2492
|
-
inputFinalized: [{ type: core.Output }]
|
|
2552
|
+
inputFinalized: [{ type: core.Output }],
|
|
2553
|
+
baseInput: [{ type: core.ViewChild, args: ["baseInput", { static: false },] }],
|
|
2554
|
+
baseInput_static: [{ type: core.ViewChild, args: ["baseInput", { static: true },] }],
|
|
2555
|
+
submitted: [{ type: core.Input, args: ["submitted",] }],
|
|
2556
|
+
forceInvalid: [{ type: core.Input }]
|
|
2493
2557
|
};
|
|
2494
2558
|
|
|
2495
2559
|
/**
|
|
@@ -3344,10 +3408,10 @@
|
|
|
3344
3408
|
};
|
|
3345
3409
|
|
|
3346
3410
|
/** Semplice componente di Input testuale, con eventuale prefisso/suffisso */
|
|
3347
|
-
var
|
|
3348
|
-
__extends(
|
|
3411
|
+
var FormInputComponentOLD = /** @class */ (function (_super) {
|
|
3412
|
+
__extends(FormInputComponentOLD, _super);
|
|
3349
3413
|
/** @ignore Costruttore */
|
|
3350
|
-
function
|
|
3414
|
+
function FormInputComponentOLD(cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_DEBUG_MODE) {
|
|
3351
3415
|
var _this = _super.call(this, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_DEBUG_MODE) || this;
|
|
3352
3416
|
/** Indica se l'input relativo è di tipo Password */
|
|
3353
3417
|
_this.Password = false;
|
|
@@ -3359,30 +3423,53 @@
|
|
|
3359
3423
|
_this.HasSuffix = false;
|
|
3360
3424
|
/** Indica la presenza o meno di un prefisso, si basa sulla "truthiness" della proiezione **prefix** */
|
|
3361
3425
|
_this.HasPrefix = false;
|
|
3426
|
+
_this.ShowPassword = false;
|
|
3362
3427
|
return _this;
|
|
3363
3428
|
}
|
|
3364
3429
|
/** @ignore */
|
|
3365
|
-
|
|
3430
|
+
FormInputComponentOLD.prototype.writeValue = function (obj) {
|
|
3366
3431
|
this.EvaluatedModel = (obj === null || obj === void 0 ? void 0 : obj.toString()) || "";
|
|
3367
3432
|
_super.prototype.writeValue.call(this, obj);
|
|
3368
3433
|
};
|
|
3369
3434
|
/** @ignore */
|
|
3370
|
-
|
|
3435
|
+
FormInputComponentOLD.prototype.ngAfterContentInit = function () {
|
|
3371
3436
|
this.HasSuffix = !!this.suffix;
|
|
3372
3437
|
this.HasPrefix = !!this.prefix;
|
|
3373
3438
|
};
|
|
3374
3439
|
/** @ignore */
|
|
3375
|
-
|
|
3376
|
-
|
|
3440
|
+
FormInputComponentOLD.prototype.onNotNullValueSet = function () { };
|
|
3441
|
+
FormInputComponentOLD.prototype.onShowHidePassword = function (event) {
|
|
3442
|
+
this.Password = !this.Password;
|
|
3443
|
+
this.ShowPassword = !this.ShowPassword;
|
|
3444
|
+
event.preventDefault();
|
|
3445
|
+
};
|
|
3446
|
+
/**
|
|
3447
|
+
* @ignore
|
|
3448
|
+
*/
|
|
3449
|
+
FormInputComponentOLD.prototype.ngOnInit = function () {
|
|
3450
|
+
_super.prototype.ngOnInit.call(this);
|
|
3451
|
+
this.registerFocusRequest();
|
|
3452
|
+
// Controllo se è settato un required per decidere in maniera condizionale se utilizzare il validatore required nel componente interno
|
|
3453
|
+
if (this._validators && this.Validation && this._validators.some(function (elem) { return elem instanceof forms.RequiredValidator; }))
|
|
3454
|
+
this.Required = true;
|
|
3455
|
+
};
|
|
3456
|
+
/**
|
|
3457
|
+
* @ignore
|
|
3458
|
+
*/
|
|
3459
|
+
FormInputComponentOLD.prototype.ngOnDestroy = function () {
|
|
3460
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
3461
|
+
this.deregisterFocusRequest();
|
|
3462
|
+
};
|
|
3463
|
+
return FormInputComponentOLD;
|
|
3377
3464
|
}(BaseFormControl));
|
|
3378
|
-
|
|
3465
|
+
FormInputComponentOLD.decorators = [
|
|
3379
3466
|
{ type: core.Component, args: [{
|
|
3380
|
-
selector: "form-input",
|
|
3381
|
-
template: "
|
|
3467
|
+
selector: "form-input-old",
|
|
3468
|
+
template: "Uguale in tutti i componenti -------------------------------------------------------------------------\r\n<ng-container *ngIf=\"!FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">\r\n <ng-container *ngIf=\"DisplayLayout == 'form'\">{{ EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"DisplayLayout == 'inline'\" class=\"app-inline\">{{ EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\" class=\"{{FormGroupClass + (Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (DisplayLayout == 'inline' && DisplayMode ? (' app-inline-block ' + (!Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(DisplayMode && DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : LabelColWidth) + (DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{Label}}{{Required && !DisplayMode ? '*' : ''}}{{Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline' && InlineSeparator != ''\">{{InlineSeparator}}</span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">{{ EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>\r\n<!----------------------------------------------------------------------------------------------------------->\r\n\r\n<ng-template #controlTemplate>\r\n <mat-form-field floatLabel=\"never\" appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\">\r\n <mat-label [class.app-margin-left-25]=\"HasPrefix\" *ngIf=\"Placeholder && FloatingLabel\">{{Placeholder}}</mat-label>\r\n <!--Prefisso-->\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <button type=\"button\"\r\n class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-prefix\"\r\n matPrefix (click)=\"onPrefixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"prefix\"></ng-container>\r\n </button>\r\n </ng-container>\r\n <!--Input-->\r\n <input matInput\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n [type]=\"Password ? 'password' : 'text'\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"off\"\r\n name=\"base-input\"\r\n class=\"form-control\"\r\n id=\"{{GeneratedName}}\"\r\n [class.app-margin-left-25]=\"HasPrefix\"\r\n [class.mat-input-with-suffix]=\"HasSuffix || Password\"\r\n [(ngModel)]=\"Model\"\r\n [class.checking-field]=\"!Validation\"\r\n [readonly]=\"Frozen\"\r\n [disabled]=\"Readonly\"\r\n [placeholder]=\"FloatingLabel ? undefined : Placeholder\"\r\n (focus)=\"focused($event);\"\r\n (ngModelChange)=\"changed()\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && finalized();\"\r\n (blur)=\"finalized();\"\r\n >\r\n <ng-container *ngIf=\"HasSuffix || Password\">\r\n <ng-container *ngIf=\"!Password\">\r\n <button type=\"button\"\r\n class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-suffix\"\r\n matSuffix (click)=\"onSuffixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"suffix\"></ng-container>\r\n </button>\r\n </ng-container>\r\n <!--Password-->\r\n <span class=\"form-input-suffix\" *ngIf=\"Password\">\r\n <ng-container *ngIf=\"Password\" matSuffix>\r\n <a *ngIf=\"ShowPassword\" class=\"fa fa-eye-slash app-fs-16 app-pointer\" (click)=\"onShowHidePassword($event)\"></a>\r\n <a *ngIf=\"!ShowPassword\" class=\"fa fa-eye app-fs-16 app-pointer\" (click)=\"onShowHidePassword($event)\"></a>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n </mat-form-field>\r\n</ng-template>",
|
|
3382
3469
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
3383
3470
|
},] }
|
|
3384
3471
|
];
|
|
3385
|
-
|
|
3472
|
+
FormInputComponentOLD.ctorParameters = function () { return [
|
|
3386
3473
|
{ type: core.ChangeDetectorRef },
|
|
3387
3474
|
{ type: forms.NgControl, decorators: [{ type: core.Optional }, { type: core.Self }] },
|
|
3388
3475
|
{ type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_VALIDATORS,] }] },
|
|
@@ -3391,7 +3478,7 @@
|
|
|
3391
3478
|
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [ACO_CUSTOMKEY,] }] },
|
|
3392
3479
|
{ type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [FAV_DEBUG_MODE,] }] }
|
|
3393
3480
|
]; };
|
|
3394
|
-
|
|
3481
|
+
FormInputComponentOLD.propDecorators = {
|
|
3395
3482
|
Password: [{ type: core.Input }],
|
|
3396
3483
|
onSuffixAction: [{ type: core.Output }],
|
|
3397
3484
|
onPrefixAction: [{ type: core.Output }],
|
|
@@ -3441,7 +3528,7 @@
|
|
|
3441
3528
|
*
|
|
3442
3529
|
* Si consiglia di mantenere il default
|
|
3443
3530
|
*/
|
|
3444
|
-
_this.EmptyFieldValue = '-
|
|
3531
|
+
_this.EmptyFieldValue = '-2000';
|
|
3445
3532
|
/** Se **true** rimuove il simbolino di validazione (croce rossa o tick verde) */
|
|
3446
3533
|
_this.ShowValidationSymbol = true;
|
|
3447
3534
|
/** Template per la visualizzazione delle opzioni */
|
|
@@ -4101,6 +4188,66 @@
|
|
|
4101
4188
|
InOutFormat: [{ type: core.Input }]
|
|
4102
4189
|
};
|
|
4103
4190
|
|
|
4191
|
+
var FormInputComponent = /** @class */ (function (_super) {
|
|
4192
|
+
__extends(FormInputComponent, _super);
|
|
4193
|
+
function FormInputComponent(cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_DEBUG_MODE) {
|
|
4194
|
+
var _this = _super.call(this, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_DEBUG_MODE) || this;
|
|
4195
|
+
_this.Password = false;
|
|
4196
|
+
_this.onSuffixAction = new core.EventEmitter();
|
|
4197
|
+
_this.onPrefixAction = new core.EventEmitter();
|
|
4198
|
+
_this.HasSuffix = false;
|
|
4199
|
+
_this.HasPrefix = false;
|
|
4200
|
+
return _this;
|
|
4201
|
+
}
|
|
4202
|
+
FormInputComponent.prototype.ngOnInit = function () {
|
|
4203
|
+
_super.prototype.ngOnInit.call(this);
|
|
4204
|
+
this.registerFocusRequest();
|
|
4205
|
+
};
|
|
4206
|
+
FormInputComponent.prototype.ngOnDestroy = function () {
|
|
4207
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
4208
|
+
this.deregisterFocusRequest();
|
|
4209
|
+
};
|
|
4210
|
+
FormInputComponent.prototype.writeValue = function (obj) {
|
|
4211
|
+
this.EvaluatedModel = (obj === null || obj === void 0 ? void 0 : obj.toString()) || "";
|
|
4212
|
+
_super.prototype.writeValue.call(this, obj);
|
|
4213
|
+
};
|
|
4214
|
+
FormInputComponent.prototype.ngAfterContentInit = function () {
|
|
4215
|
+
this.HasSuffix = !!this.suffix && !this.Password;
|
|
4216
|
+
this.HasPrefix = !!this.prefix;
|
|
4217
|
+
};
|
|
4218
|
+
FormInputComponent.prototype.onNotNullValueSet = function () { };
|
|
4219
|
+
FormInputComponent.prototype.onBlur = function () {
|
|
4220
|
+
var _a, _b;
|
|
4221
|
+
this.validationControl.control.markAsDirty();
|
|
4222
|
+
this.inputFinalized.emit((_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toString());
|
|
4223
|
+
};
|
|
4224
|
+
return FormInputComponent;
|
|
4225
|
+
}(BaseFormControl));
|
|
4226
|
+
FormInputComponent.decorators = [
|
|
4227
|
+
{ type: core.Component, args: [{
|
|
4228
|
+
selector: "form-input",
|
|
4229
|
+
template: "<!-- Uguale in tutti i componenti --------------------------------------------------------------------------->\r\n<ng-container *ngIf=\"!FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">\r\n <ng-container *ngIf=\"DisplayLayout == 'form'\">{{ EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"DisplayLayout == 'inline'\" class=\"app-inline\">{{ EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\" class=\"{{FormGroupClass + (Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (DisplayLayout == 'inline' && DisplayMode ? (' app-inline-block ' + (!Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(DisplayMode && DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : LabelColWidth) + (DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{Label}}{{Required && !DisplayMode ? '*' : ''}}{{Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline' && InlineSeparator != ''\">{{InlineSeparator}}</span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">{{ EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>\r\n<!----------------------------------------------------------------------------------------------------------->\r\n\r\n<ng-template #controlTemplate>\r\n <span [class.p-float-label]=\"FloatingLabel && (!HasPrefix && !HasSuffix)\" \r\n [class.p-input-icon-right]=\"Password || HasSuffix\"\r\n [class.p-input-icon-left]=\"HasPrefix\">\r\n <!--Prefisso-->\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <i (click)=\"onPrefixAction.emit(); $event.stopPropagation(); $event.preventDefault();\" style=\"cursor: pointer;\">\r\n <ng-container *ngTemplateOutlet=\"prefix\"></ng-container>\r\n </i>\r\n </ng-container>\r\n <!--Input-->\r\n <input pInputText #baseInput=\"ngModel\" #htmlInput\r\n name=\"{{GeneratedName}}\" id=\"{{GeneratedName}}\"\r\n [type]=\"Password ? 'password' : 'text'\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"off\"\r\n [class.app-margin-left-25]=\"HasPrefix\"\r\n [(ngModel)]=\"Model\"\r\n style=\"box-shadow: unset\"\r\n [readonly]=\"Frozen\"\r\n [disabled]=\"Readonly\"\r\n [placeholder]=\"FloatingLabel ? '' : Placeholder\"\r\n (focus)=\"focused($event);\"\r\n (ngModelChange)=\"changed()\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onBlur();\"\r\n (blur)=\"onBlur();\"\r\n >\r\n <label *ngIf=\"Placeholder && FloatingLabel\" htmlFor=\"{{GeneratedName}}\">\r\n {{Placeholder}}\r\n </label>\r\n <!--Password-->\r\n <i *ngIf=\"Password && htmlInput.type == 'password'\" class=\"fa fas fa-eye\" style=\"cursor: pointer;\" (click)=\"htmlInput.type = 'text'\"></i>\r\n <i *ngIf=\"Password && htmlInput.type == 'text'\" class=\"fa fas fa-eye-slash\" style=\"cursor: pointer;\" (click)=\"htmlInput.type = 'password'\"></i>\r\n <!--Suffisso-->\r\n <ng-container *ngIf=\"HasSuffix\">\r\n <i (click)=\"onSuffixAction.emit(); $event.stopPropagation(); $event.preventDefault();\" style=\"cursor: pointer;\">\r\n <ng-container *ngTemplateOutlet=\"suffix\"></ng-container>\r\n </i>\r\n </ng-container>\r\n </span>\r\n</ng-template>",
|
|
4230
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
4231
|
+
styles: [".p-inputtext{width:100%}.p-input-icon-left,.p-input-icon-right{display:block!important}"]
|
|
4232
|
+
},] }
|
|
4233
|
+
];
|
|
4234
|
+
FormInputComponent.ctorParameters = function () { return [
|
|
4235
|
+
{ type: core.ChangeDetectorRef },
|
|
4236
|
+
{ type: forms.NgControl, decorators: [{ type: core.Optional }, { type: core.Self }] },
|
|
4237
|
+
{ type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_VALIDATORS,] }] },
|
|
4238
|
+
{ type: accessControl.AccessControlService, decorators: [{ type: core.Optional }] },
|
|
4239
|
+
{ type: accessControl.ComponentContext, decorators: [{ type: core.Optional }] },
|
|
4240
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [ACO_CUSTOMKEY,] }] },
|
|
4241
|
+
{ type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [FAV_DEBUG_MODE,] }] }
|
|
4242
|
+
]; };
|
|
4243
|
+
FormInputComponent.propDecorators = {
|
|
4244
|
+
Password: [{ type: core.Input }],
|
|
4245
|
+
onSuffixAction: [{ type: core.Output }],
|
|
4246
|
+
onPrefixAction: [{ type: core.Output }],
|
|
4247
|
+
suffix: [{ type: core.ContentChild, args: ["suffix", { static: false },] }],
|
|
4248
|
+
prefix: [{ type: core.ContentChild, args: ["prefix", { static: false },] }]
|
|
4249
|
+
};
|
|
4250
|
+
|
|
4104
4251
|
/**
|
|
4105
4252
|
* Formato in display (modalità lunga, con ore, minuti e secondi) delle date per tutti i componenti che utilizzino input data.
|
|
4106
4253
|
*
|
|
@@ -4128,6 +4275,7 @@
|
|
|
4128
4275
|
FormCheckboxComponent,
|
|
4129
4276
|
FormDateComponent,
|
|
4130
4277
|
FormEmptyComponent,
|
|
4278
|
+
FormInputComponentOLD,
|
|
4131
4279
|
FormInputComponent,
|
|
4132
4280
|
FormSelectComponent,
|
|
4133
4281
|
FormTextareaComponent,
|
|
@@ -4161,7 +4309,8 @@
|
|
|
4161
4309
|
ngxCurrencyMask.CurrencyMaskModule,
|
|
4162
4310
|
autocomplete.MatAutocompleteModule,
|
|
4163
4311
|
datetimePicker.NgxMatDatetimePickerModule,
|
|
4164
|
-
datetimePicker.NgxMatTimepickerModule
|
|
4312
|
+
datetimePicker.NgxMatTimepickerModule,
|
|
4313
|
+
inputtext.InputTextModule
|
|
4165
4314
|
];
|
|
4166
4315
|
/**
|
|
4167
4316
|
* Moduli utilizzati dalla libreria e che devono essere esposti all'esterno
|
|
@@ -4219,7 +4368,7 @@
|
|
|
4219
4368
|
exports.FormErrorComponent = FormErrorComponent;
|
|
4220
4369
|
exports.FormFileComponent = FormFileComponent;
|
|
4221
4370
|
exports.FormInfoComponent = FormInfoComponent;
|
|
4222
|
-
exports.
|
|
4371
|
+
exports.FormInputComponentOLD = FormInputComponentOLD;
|
|
4223
4372
|
exports.FormSelectComponent = FormSelectComponent;
|
|
4224
4373
|
exports.FormTemplateComponent = FormTemplateComponent;
|
|
4225
4374
|
exports.FormTextareaComponent = FormTextareaComponent;
|
|
@@ -4238,12 +4387,13 @@
|
|
|
4238
4387
|
exports.ɵa = BaseValidation;
|
|
4239
4388
|
exports.ɵb = BaseValidationLoc;
|
|
4240
4389
|
exports.ɵc = CustomRequiredDirective;
|
|
4241
|
-
exports.ɵd =
|
|
4242
|
-
exports.ɵe =
|
|
4243
|
-
exports.ɵf =
|
|
4244
|
-
exports.ɵg =
|
|
4245
|
-
exports.ɵh =
|
|
4246
|
-
exports.ɵi =
|
|
4390
|
+
exports.ɵd = FormInputComponent;
|
|
4391
|
+
exports.ɵe = FormSelectComponentLoc;
|
|
4392
|
+
exports.ɵf = FormAdaptiveComponentLoc;
|
|
4393
|
+
exports.ɵg = FormMultiSelectComponent;
|
|
4394
|
+
exports.ɵh = FormMultiSelectComponentLoc;
|
|
4395
|
+
exports.ɵi = FormFileComponentLoc;
|
|
4396
|
+
exports.ɵj = FormAutocompleteComponentLoc;
|
|
4247
4397
|
|
|
4248
4398
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4249
4399
|
|