@esfaenza/forms-and-validations 11.2.104 → 11.2.107
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 +36 -18
- package/bundles/esfaenza-forms-and-validations.umd.js.map +1 -1
- package/esfaenza-forms-and-validations.d.ts +8 -9
- package/esfaenza-forms-and-validations.metadata.json +1 -1
- package/esm2015/esfaenza-forms-and-validations.js +9 -10
- package/esm2015/lib/forms/form-checkbox/form-checkbox.component.js +19 -7
- package/esm2015/lib/forms/form-select/form-select.component.js +4 -2
- package/esm2015/lib/forms-and-validations.module.js +3 -2
- package/esm2015/lib/models/FormsAndValidationsModuleConfig.js +1 -1
- package/esm2015/lib/tokens.js +3 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/esfaenza-forms-and-validations.js +25 -8
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/form-checkbox/form-checkbox.component.d.ts +5 -1
- package/lib/models/FormsAndValidationsModuleConfig.d.ts +2 -0
- package/lib/tokens.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -423,7 +423,9 @@
|
|
|
423
423
|
/** Chiave che indica il prefisso dei Contesti Applicativi per permettere l'abilitazione/disabilitazione di input in maniera contestuale */
|
|
424
424
|
var ACO_CUSTOMKEY = new core.InjectionToken('ACO_CUSTOMKEY');
|
|
425
425
|
/** Token che indica la lingua da utilizzare, sono supportate "it-IT" ed "en-US" */
|
|
426
|
-
var FAV_DEBUG_MODE = new core.InjectionToken('FAV_DEBUG_MODE');
|
|
426
|
+
var FAV_DEBUG_MODE = new core.InjectionToken('FAV_DEBUG_MODE');
|
|
427
|
+
/** Token che indica se far apparire l'input delle checkbox come slider o come input nativi */
|
|
428
|
+
var FAV_SLIDER_MODE = new core.InjectionToken('FAV_SLIDER_MODE');
|
|
427
429
|
|
|
428
430
|
// Angular
|
|
429
431
|
/**
|
|
@@ -3058,11 +3060,18 @@
|
|
|
3058
3060
|
var FormCheckboxComponent = /** @class */ (function (_super) {
|
|
3059
3061
|
__extends(FormCheckboxComponent, _super);
|
|
3060
3062
|
/** @ignore Costruttore */
|
|
3061
|
-
function FormCheckboxComponent(lc, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY) {
|
|
3063
|
+
function FormCheckboxComponent(lc, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_SLIDER_MODE) {
|
|
3062
3064
|
var _this = _super.call(this, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, true) || this;
|
|
3063
3065
|
_this.lc = lc;
|
|
3066
|
+
_this.FAV_SLIDER_MODE = FAV_SLIDER_MODE;
|
|
3067
|
+
/** Mostra l'input checkbox con lo stile di uno slider */
|
|
3068
|
+
_this.SliderMode = null;
|
|
3064
3069
|
return _this;
|
|
3065
3070
|
}
|
|
3071
|
+
FormCheckboxComponent.prototype.ngOnInit = function () {
|
|
3072
|
+
if (this.SliderMode == null)
|
|
3073
|
+
this.SliderMode = this.FAV_SLIDER_MODE;
|
|
3074
|
+
};
|
|
3066
3075
|
/** @ignore */
|
|
3067
3076
|
FormCheckboxComponent.prototype.writeValue = function (obj) {
|
|
3068
3077
|
obj = obj ? (obj === true || obj.toLowerCase() == "true") : false;
|
|
@@ -3080,8 +3089,9 @@
|
|
|
3080
3089
|
FormCheckboxComponent.decorators = [
|
|
3081
3090
|
{ type: core.Component, args: [{
|
|
3082
3091
|
selector: "form-checkbox",
|
|
3083
|
-
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\" class=\"app-inline-block\"><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\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>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline'\"> </span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n\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 <input class=\"app-pointer\" [disabled]=\"Readonly ? true : null\" type=\"checkbox\" [(ngModel)]=\"Model\" id=\"{{GeneratedName}}\" name=\"{{GeneratedName}}\" #validationControl=\"ngModel\" (ngModelChange)=\"changed(); finalized()\" (click)=\"focused($event)\"
|
|
3084
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
3092
|
+
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\" class=\"app-inline-block\"><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\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>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline'\"> </span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n\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 <ng-container *ngIf=\"SliderMode\">\r\n <label class=\"toggler-wrapper slider-checkbox\">\r\n <input [disabled]=\"Readonly ? true : null\" type=\"checkbox\" [(ngModel)]=\"Model\" id=\"{{GeneratedName}}\" name=\"{{GeneratedName}}\" #validationControl=\"ngModel\" (ngModelChange)=\"changed(); finalized()\" (click)=\"focused($event)\" >\r\n <div class=\"toggler-slider\">\r\n <div class=\"toggler-knob\"></div>\r\n </div>\r\n </label>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!SliderMode\">\r\n <input class=\"app-pointer\" [disabled]=\"Readonly ? true : null\" type=\"checkbox\" [(ngModel)]=\"Model\" id=\"{{GeneratedName}}\" name=\"{{GeneratedName}}\" #validationControl=\"ngModel\" (ngModelChange)=\"changed(); finalized()\" (click)=\"focused($event)\"/>\r\n </ng-container>\r\n</ng-template>",
|
|
3093
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
3094
|
+
styles: [".toggler-wrapper{display:block;width:45px;height:25px;cursor:pointer;position:relative}.toggler-wrapper input[type=checkbox]{display:none}.toggler-wrapper input[type=checkbox]:checked+.toggler-slider{background-color:#007bff}.toggler-wrapper .toggler-slider{background-color:#ccc;border-radius:100px;top:0;left:0;width:100%;height:100%}.toggler-wrapper .toggler-knob,.toggler-wrapper .toggler-slider{position:absolute;transition:all .3s ease}.slider-checkbox{margin-top:3px}.toggler-wrapper.slider-checkbox input[type=checkbox]:checked+.toggler-slider .toggler-knob{left:calc(100% - 19px - 3px)}.toggler-wrapper.slider-checkbox .toggler-slider:after{position:absolute;top:50%;right:-25px;transform:translateY(-50%);font-size:75%;text-transform:uppercase;font-weight:500;opacity:.7}.toggler-wrapper.slider-checkbox .toggler-knob{width:calc(25px - 6px);height:calc(25px - 6px);border-radius:50%;left:3px;top:3px;background-color:#fff}"]
|
|
3085
3095
|
},] }
|
|
3086
3096
|
];
|
|
3087
3097
|
FormCheckboxComponent.ctorParameters = function () { return [
|
|
@@ -3091,8 +3101,12 @@
|
|
|
3091
3101
|
{ type: Array, decorators: [{ type: core.Optional }, { type: core.Host }, { type: core.Inject, args: [forms.NG_VALIDATORS,] }] },
|
|
3092
3102
|
{ type: accessControl.AccessControlService },
|
|
3093
3103
|
{ type: accessControl.ComponentContext, decorators: [{ type: core.Optional }] },
|
|
3094
|
-
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [ACO_CUSTOMKEY,] }] }
|
|
3095
|
-
|
|
3104
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [ACO_CUSTOMKEY,] }] },
|
|
3105
|
+
{ type: Boolean, decorators: [{ type: core.Optional }, { type: core.Inject, args: [FAV_SLIDER_MODE,] }] }
|
|
3106
|
+
]; };
|
|
3107
|
+
FormCheckboxComponent.propDecorators = {
|
|
3108
|
+
SliderMode: [{ type: core.Input }]
|
|
3109
|
+
};
|
|
3096
3110
|
|
|
3097
3111
|
/** Componente che dà all'utente la possibilità di selezionare una data */
|
|
3098
3112
|
var FormDateComponent = /** @class */ (function (_super) {
|
|
@@ -3295,6 +3309,8 @@
|
|
|
3295
3309
|
/** @ignore */
|
|
3296
3310
|
FormSelectComponent.prototype.detatchPreviousAndRetatchNext = function (doStuff) {
|
|
3297
3311
|
var _this = this;
|
|
3312
|
+
if (this.DisplayMode)
|
|
3313
|
+
return;
|
|
3298
3314
|
if (this.validationControl && this.Form)
|
|
3299
3315
|
this.Form.removeControl(this.validationControl);
|
|
3300
3316
|
setTimeout(function () {
|
|
@@ -3306,7 +3322,7 @@
|
|
|
3306
3322
|
}
|
|
3307
3323
|
else if (!_this.validationControl && _this.Form) {
|
|
3308
3324
|
// Questo messaggio ha senso solo se almeno il form esiste... se non esiste sticazzi insomma...
|
|
3309
|
-
console.error("Impossibile aggiungere il componente di
|
|
3325
|
+
console.error("Impossibile aggiungere il componente di validazione per " + _this.GeneratedName + ", le validazioni potrebbero funzionare in maniera erratica");
|
|
3310
3326
|
}
|
|
3311
3327
|
});
|
|
3312
3328
|
});
|
|
@@ -3955,6 +3971,7 @@
|
|
|
3955
3971
|
{ provide: FAV_DEBUG_MODE, useValue: (config === null || config === void 0 ? void 0 : config.debugMode) != null ? config === null || config === void 0 ? void 0 : config.debugMode : false },
|
|
3956
3972
|
{ provide: ACO_CUSTOMKEY, useValue: (config === null || config === void 0 ? void 0 : config.acocustom) || null },
|
|
3957
3973
|
{ provide: datetimePicker.NGX_MAT_DATE_FORMATS, useValue: formats_long },
|
|
3974
|
+
{ provide: FAV_SLIDER_MODE, useValue: (config === null || config === void 0 ? void 0 : config.sliderMode) != null ? config === null || config === void 0 ? void 0 : config.sliderMode : false },
|
|
3958
3975
|
{ provide: datetimePicker.NgxMatDateAdapter, useClass: NgxExpandedDayJsDateAdapter },
|
|
3959
3976
|
]
|
|
3960
3977
|
};
|
|
@@ -3977,7 +3994,11 @@
|
|
|
3977
3994
|
* Generated bundle index. Do not edit.
|
|
3978
3995
|
*/
|
|
3979
3996
|
|
|
3997
|
+
exports.ACO_CUSTOMKEY = ACO_CUSTOMKEY;
|
|
3980
3998
|
exports.AppFile = AppFile;
|
|
3999
|
+
exports.FAV_DEBUG_MODE = FAV_DEBUG_MODE;
|
|
4000
|
+
exports.FAV_LOCALE = FAV_LOCALE;
|
|
4001
|
+
exports.FAV_SLIDER_MODE = FAV_SLIDER_MODE;
|
|
3981
4002
|
exports.FormAdaptiveComponent = FormAdaptiveComponent;
|
|
3982
4003
|
exports.FormAutocompleteComponent = FormAutocompleteComponent;
|
|
3983
4004
|
exports.FormCheckboxComponent = FormCheckboxComponent;
|
|
@@ -4005,17 +4026,14 @@
|
|
|
4005
4026
|
exports.ValidationTextAreaComponent = ValidationTextAreaComponent;
|
|
4006
4027
|
exports.ɵa = BaseValidation;
|
|
4007
4028
|
exports.ɵb = BaseValidationLoc;
|
|
4008
|
-
exports.ɵc =
|
|
4009
|
-
exports.ɵd =
|
|
4010
|
-
exports.ɵe =
|
|
4011
|
-
exports.ɵf =
|
|
4012
|
-
exports.ɵg =
|
|
4013
|
-
exports.ɵh =
|
|
4014
|
-
exports.ɵi =
|
|
4015
|
-
exports.ɵj =
|
|
4016
|
-
exports.ɵk = FormMultiSelectComponentLoc;
|
|
4017
|
-
exports.ɵl = FormFileComponentLoc;
|
|
4018
|
-
exports.ɵm = FormAutocompleteComponentLoc;
|
|
4029
|
+
exports.ɵc = CustomRequiredDirective;
|
|
4030
|
+
exports.ɵd = BaseFormControl;
|
|
4031
|
+
exports.ɵe = FormSelectComponentLoc;
|
|
4032
|
+
exports.ɵf = FormAdaptiveComponentLoc;
|
|
4033
|
+
exports.ɵg = FormMultiSelectComponent;
|
|
4034
|
+
exports.ɵh = FormMultiSelectComponentLoc;
|
|
4035
|
+
exports.ɵi = FormFileComponentLoc;
|
|
4036
|
+
exports.ɵj = FormAutocompleteComponentLoc;
|
|
4019
4037
|
|
|
4020
4038
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4021
4039
|
|