@esfaenza/forms-and-validations 11.2.104 → 11.2.105

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.
@@ -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'\">&nbsp;</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)\" />\r\n</ng-template>",
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'\">&nbsp;</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) {
@@ -3955,6 +3969,7 @@
3955
3969
  { 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
3970
  { provide: ACO_CUSTOMKEY, useValue: (config === null || config === void 0 ? void 0 : config.acocustom) || null },
3957
3971
  { provide: datetimePicker.NGX_MAT_DATE_FORMATS, useValue: formats_long },
3972
+ { 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
3973
  { provide: datetimePicker.NgxMatDateAdapter, useClass: NgxExpandedDayJsDateAdapter },
3959
3974
  ]
3960
3975
  };
@@ -4008,14 +4023,15 @@
4008
4023
  exports.ɵc = FAV_LOCALE;
4009
4024
  exports.ɵd = ACO_CUSTOMKEY;
4010
4025
  exports.ɵe = FAV_DEBUG_MODE;
4011
- exports.ɵf = CustomRequiredDirective;
4012
- exports.ɵg = BaseFormControl;
4013
- exports.ɵh = FormSelectComponentLoc;
4014
- exports.ɵi = FormAdaptiveComponentLoc;
4015
- exports.ɵj = FormMultiSelectComponent;
4016
- exports.ɵk = FormMultiSelectComponentLoc;
4017
- exports.ɵl = FormFileComponentLoc;
4018
- exports.ɵm = FormAutocompleteComponentLoc;
4026
+ exports.ɵf = FAV_SLIDER_MODE;
4027
+ exports.ɵg = CustomRequiredDirective;
4028
+ exports.ɵh = BaseFormControl;
4029
+ exports.ɵi = FormSelectComponentLoc;
4030
+ exports.ɵj = FormAdaptiveComponentLoc;
4031
+ exports.ɵk = FormMultiSelectComponent;
4032
+ exports.ɵl = FormMultiSelectComponentLoc;
4033
+ exports.ɵm = FormFileComponentLoc;
4034
+ exports.ɵn = FormAutocompleteComponentLoc;
4019
4035
 
4020
4036
  Object.defineProperty(exports, '__esModule', { value: true });
4021
4037