ng-inail-common 2.0.30-beta.8 → 2.0.31-beta.1

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.
Files changed (27) hide show
  1. package/bundles/ng-inail-common.umd.js +126 -239
  2. package/bundles/ng-inail-common.umd.js.map +1 -1
  3. package/bundles/ng-inail-common.umd.min.js +2 -2
  4. package/bundles/ng-inail-common.umd.min.js.map +1 -1
  5. package/esm2015/lib/components/core/form/checkbox/checkbox.component.js +4 -2
  6. package/esm2015/lib/components/core/form/form-element.component.js +6 -3
  7. package/esm2015/lib/components/core/form/input-date/input-date.component.js +30 -215
  8. package/esm2015/lib/components/core/form/input-file/input-file.component.js +4 -2
  9. package/esm2015/lib/components/core/form/input-number/input-number.component.js +23 -7
  10. package/esm2015/lib/components/core/form/input-text/input-text.component.js +4 -2
  11. package/esm2015/lib/components/core/form/input-time/input-time.component.js +38 -6
  12. package/esm2015/lib/components/core/form/multi-select/multi-select.component.js +7 -3
  13. package/esm2015/lib/components/core/form/radio-select/radio-select.component.js +4 -2
  14. package/esm2015/lib/components/core/form/select/select.component.js +4 -2
  15. package/esm2015/lib/components/core/form/textarea/textarea.component.js +4 -2
  16. package/esm2015/lib/components/core/table/table/table.component.js +10 -5
  17. package/esm2015/lib/ng-inail-common.config.js +1 -1
  18. package/fesm2015/ng-inail-common.js +126 -239
  19. package/fesm2015/ng-inail-common.js.map +1 -1
  20. package/lib/components/core/form/form-element.component.d.ts +1 -0
  21. package/lib/components/core/form/input-date/input-date.component.d.ts +7 -0
  22. package/lib/components/core/form/input-number/input-number.component.d.ts +5 -0
  23. package/lib/components/core/form/input-time/input-time.component.d.ts +3 -0
  24. package/lib/components/core/table/table/table.component.d.ts +3 -0
  25. package/lib/ng-inail-common.config.d.ts +5 -0
  26. package/ng-inail-common.metadata.json +1 -1
  27. package/package.json +1 -1
@@ -2962,7 +2962,7 @@
2962
2962
  __extends(FormElementComponent, _super);
2963
2963
  function FormElementComponent(formElementCdr, formElementLibConfig) {
2964
2964
  var _this = this;
2965
- var _a, _b, _c, _d;
2965
+ var _a, _b, _c, _d, _e, _f;
2966
2966
  _this = _super.call(this, formElementCdr, formElementLibConfig) || this;
2967
2967
  _this.formElementCdr = formElementCdr;
2968
2968
  _this.formElementLibConfig = formElementLibConfig;
@@ -2977,6 +2977,7 @@
2977
2977
  _this.errorChange = new core.EventEmitter();
2978
2978
  _this.enterUp = new core.EventEmitter();
2979
2979
  _this.popover = false;
2980
+ _this.cleanErrorOnChange = getConfigValue((_f = (_e = _this.formElementLibConfig) === null || _e === void 0 ? void 0 : _e.formElementComponent) === null || _f === void 0 ? void 0 : _f.cleanErrorOnChange, true);
2980
2981
  _this.getLabel = function () { return "" + ((_this.required && _this.requiredSimbolPosition === 'left') ? _this.requiredSimbol + " " : '') + _this.label + ((_this.required && _this.requiredSimbolPosition === 'right') ? " " + _this.requiredSimbol : ''); };
2981
2982
  _this.isThereError = function () { return _this.hasError || isNotBlankOrNull(_this.error); };
2982
2983
  _this.showError = function () { return _this.isThereError() && isNotBlankOrNull(_this.error); };
@@ -2991,6 +2992,7 @@
2991
2992
  _super.prototype.overrideConfig.call(this, config);
2992
2993
  this.requiredSimbol = getConfigValue(config.requiredSimbol, this.requiredSimbol);
2993
2994
  this.requiredSimbolPosition = getConfigValue(config.requiredSimbolPosition, this.requiredSimbolPosition);
2995
+ this.cleanErrorOnChange = getConfigValue(config.cleanErrorOnChange, this.cleanErrorOnChange);
2994
2996
  }
2995
2997
  };
2996
2998
  FormElementComponent.prototype.ngOnChanges = function (changes) {
@@ -3082,7 +3084,8 @@
3082
3084
  popoverButtonIcon: [{ type: core.Input }],
3083
3085
  popoverButtonTitle: [{ type: core.Input }],
3084
3086
  popoverHeader: [{ type: core.Input }],
3085
- popoverContent: [{ type: core.Input }]
3087
+ popoverContent: [{ type: core.Input }],
3088
+ cleanErrorOnChange: [{ type: core.Input }]
3086
3089
  };
3087
3090
 
3088
3091
  /**
@@ -3237,7 +3240,9 @@
3237
3240
  this.cdr.detectChanges();
3238
3241
  this.emitDebug("this.valueChange.emit(" + value + ")");
3239
3242
  this.valueChange.emit(value);
3240
- this.cleanError();
3243
+ if (this.cleanErrorOnChange) {
3244
+ this.cleanError();
3245
+ }
3241
3246
  if (this.onChange) {
3242
3247
  this.onChange(value);
3243
3248
  }
@@ -3354,7 +3359,9 @@
3354
3359
  _this.emitDebug("this.valueChange.emit(" + _this.selectedValue + ")");
3355
3360
  _this.valueChange.emit(_this.selectedValue);
3356
3361
  _this.select.emit(_this.options.find(function (opt) { return (opt === null || opt === void 0 ? void 0 : opt.value) === _this.selectedValue; }));
3357
- _this.cleanError();
3362
+ if (_this.cleanErrorOnChange) {
3363
+ _this.cleanError();
3364
+ }
3358
3365
  if (_this.onChange) {
3359
3366
  _this.onChange(_this.selectedValue);
3360
3367
  }
@@ -4070,7 +4077,9 @@
4070
4077
  this.cdr.detectChanges();
4071
4078
  this.emitDebug("this.valueChange.emit(" + value + ")");
4072
4079
  this.valueChange.emit(value);
4073
- this.cleanError();
4080
+ if (this.cleanErrorOnChange) {
4081
+ this.cleanError();
4082
+ }
4074
4083
  if (this.onChange) {
4075
4084
  this.onChange(value);
4076
4085
  }
@@ -4121,11 +4130,12 @@
4121
4130
  var ɵ0$3 = isValidInputModel;
4122
4131
  var isLongTime = function (o) { return o && (typeof o === 'number'); };
4123
4132
  var ɵ1$2 = isLongTime;
4133
+ var ACCEPTED_INPUTS = ['/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete', "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"];
4124
4134
  var InputDateComponent = /** @class */ (function (_super) {
4125
4135
  __extends(InputDateComponent, _super);
4126
4136
  function InputDateComponent(cdr, libConfig) {
4127
4137
  var _this = this;
4128
- var _a, _b;
4138
+ var _a, _b, _c, _d, _e, _f;
4129
4139
  _this = _super.call(this, cdr, libConfig) || this;
4130
4140
  _this.cdr = cdr;
4131
4141
  _this.libConfig = libConfig;
@@ -4134,10 +4144,12 @@
4134
4144
  // modelFormat: DateFormat;
4135
4145
  // https://bootstrap-datepicker.readthedocs.io/en/latest/options.html
4136
4146
  _this.options = getConfigValue((_b = (_a = _this.libConfig) === null || _a === void 0 ? void 0 : _a.inputDateComponent) === null || _b === void 0 ? void 0 : _b.options, undefined);
4147
+ _this.selfValidation = getConfigValue((_d = (_c = _this.libConfig) === null || _c === void 0 ? void 0 : _c.inputDateComponent) === null || _d === void 0 ? void 0 : _d.selfValidation, true);
4148
+ _this.selfValidationError = getConfigValue((_f = (_e = _this.libConfig) === null || _e === void 0 ? void 0 : _e.inputDateComponent) === null || _f === void 0 ? void 0 : _f.selfValidationError, 'La data inserita non è valida');
4137
4149
  _this.isValidInputValue = function () { return isBlankOrNull(_this.visibleData) || isInItalianFormat(_this.visibleData); };
4138
- _this.isThereDataError = function () { return _this.isThereError() || !_this.isValidInputValue(); };
4150
+ _this.isThereDataError = function () { return _this.isThereError() || (!_this.isValidInputValue() && _this.selfValidation); };
4139
4151
  _this.showDataError = function () { return _this.isThereDataError() && isNotBlankOrNull(_this.getDescError()); };
4140
- _this.getDescError = function () { return (isBlankOrNull(_this.error) && !_this.isValidInputValue()) ? "La data inserita non è valida" : _this.error; };
4152
+ _this.getDescError = function () { return (_this.selfValidation && isBlankOrNull(_this.error) && !_this.isValidInputValue()) ? _this.selfValidationError : _this.error; };
4141
4153
  _this.isEnabledDate = function (date) {
4142
4154
  var dateString = dateToString(date, 'ISO8061');
4143
4155
  return _this.isDataAbilitata(dateString) && !_this.isDataDisabilitata(dateString);
@@ -4145,6 +4157,9 @@
4145
4157
  _this.isDataAbilitata = function (data) { return _this.enabledDates == undefined || !_this.enabledDates.length || _this.enabledDates.some(function (regex) { return _this.match(data, regex) != undefined; }); };
4146
4158
  _this.isDataDisabilitata = function (data) { return _this.disabledDates != undefined && _this.disabledDates.some(function (regex) { return _this.match(data, regex) != undefined; }); };
4147
4159
  _this.match = function (date, regex) { return date != undefined && date.match(new RegExp('^'.concat(regex).concat('$'), 'i')); };
4160
+ _this.isFirstDigitSlash = function (ev) { return ev.key == '/' && _this.visibleData == undefined; };
4161
+ _this.isDoubleSlash = function (ev) { return ev.key == '/' && ev.key == _this.previousDigit; };
4162
+ _this.isWrongDigit = function (ev) { return _this.isFirstDigitSlash(ev) || _this.isDoubleSlash(ev); };
4148
4163
  _this.logPrefix = "[inail-input-date]";
4149
4164
  _super.prototype.overrideConfig.call(_this, libConfig === null || libConfig === void 0 ? void 0 : libConfig.inputDateComponent);
4150
4165
  _this.detach();
@@ -4152,12 +4167,10 @@
4152
4167
  }
4153
4168
  InputDateComponent.prototype.ngOnChanges = function (changes) {
4154
4169
  _super.prototype.ngOnChanges.call(this, changes);
4155
- if (changes.value && !changes.value.firstChange) {
4156
- this.hasError = false;
4157
- this.error = undefined;
4158
- this.hasErrorChange.emit(this.hasError);
4159
- this.errorChange.emit(this.error);
4160
- }
4170
+ // if (changes.value && !changes.value.firstChange && this.cleanErrorOnChange) {
4171
+ //
4172
+ // this.cleanError();
4173
+ // }
4161
4174
  // Se cambiano le options o gli array delle date abilitate/disabilitate
4162
4175
  // reinizializzo il componente
4163
4176
  if ((changes.options && !changes.options.firstChange)
@@ -4274,7 +4287,9 @@
4274
4287
  _this.setDatepickerDate(_this.visibleData);
4275
4288
  }
4276
4289
  });
4277
- this.cleanError();
4290
+ if (this.cleanErrorOnChange) {
4291
+ this.cleanError();
4292
+ }
4278
4293
  this.cdr.detectChanges();
4279
4294
  if (this.onChange) {
4280
4295
  this.onChange(value);
@@ -4287,12 +4302,22 @@
4287
4302
  InputDateComponent.prototype.setDatepickerDate = function (date) {
4288
4303
  window['$'](this.formControlElement.nativeElement).datepicker('setDate', date);
4289
4304
  };
4305
+ InputDateComponent.prototype.onKeyDown = function (ev) {
4306
+ // console.warn(ev)
4307
+ // console.warn(this.visibleData, `${this.visibleData}`)
4308
+ if ((!ACCEPTED_INPUTS.some(function (v) { return v === ev.key; }) || this.isWrongDigit(ev)) && ev.ctrlKey == false) {
4309
+ ev.preventDefault();
4310
+ }
4311
+ else {
4312
+ this.previousDigit = ev.key;
4313
+ }
4314
+ };
4290
4315
  return InputDateComponent;
4291
4316
  }(FormElementComponent));
4292
4317
  InputDateComponent.decorators = [
4293
4318
  { type: core.Component, args: [{
4294
4319
  selector: 'inail-input-date',
4295
- template: "<div class=\"date datePicker {{getResponsiveClass()}} noPaddingLeft {{class}}\"\n [ngClass]=\"{'has-error': isThereDataError()}\">\n <div class=\"form-group\">\n <div class=\"input-relative\">\n <label *ngIf=\"label\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n class=\"control-label {{labelClass}}\"\n title=\"{{labelTitle}}\"\n for=\"{{id}}\" [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <input id=\"{{id}}\"\n #formControl\n class=\"form-control\"\n [ngClass]=\"inputClass\"\n title=\"GG/MM/AAAA\"\n placeholder=\"GG/MM/AAAA\"\n type=\"text\"\n (change)=\"onChangeHandler($event)\"\n (paste)=\"onChangeHandler($event)\"\n (keyup)=\"onChangeHandler($event)\"\n [disabled]=\"this.disabled\"\n [readonly]=\"this.readonly\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereDataError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (keyup.enter)=\"enterUp.emit()\"\n [(ngModel)]=\"this.visibleData\">\n <em class=\"fa fa-calendar\"\n title=\"Calendario\"\n (click)=\"formControl.focus()\"></em>\n </div>\n <div *ngIf=\"showDataError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+getDescError()\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"description\"></div>\n </div>\n <div *ngIf=\"description && !showDataError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n </div>\n</div>\n",
4320
+ template: "<div class=\"date datePicker {{getResponsiveClass()}} noPaddingLeft {{class}}\"\n [ngClass]=\"{'has-error': isThereDataError()}\">\n <div class=\"form-group\">\n <div class=\"input-relative\">\n <label *ngIf=\"label\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n class=\"control-label {{labelClass}}\"\n title=\"{{labelTitle}}\"\n for=\"{{id}}\" [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <input id=\"{{id}}\"\n #formControl\n class=\"form-control\"\n [ngClass]=\"inputClass\"\n title=\"GG/MM/AAAA\"\n placeholder=\"GG/MM/AAAA\"\n type=\"text\"\n (change)=\"onChangeHandler($event)\"\n (paste)=\"onChangeHandler($event)\"\n (keyup)=\"onChangeHandler($event)\"\n [disabled]=\"this.disabled\"\n [readonly]=\"this.readonly\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereDataError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (keyup.enter)=\"enterUp.emit()\"\n (keydown)=\"onKeyDown($event)\"\n [(ngModel)]=\"this.visibleData\">\n <em class=\"fa fa-calendar\"\n title=\"Calendario\"\n (click)=\"formControl.focus()\"></em>\n </div>\n <div *ngIf=\"showDataError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+getDescError()\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"description\"></div>\n </div>\n <div *ngIf=\"description && !showDataError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n </div>\n</div>\n",
4296
4321
  changeDetection: CHANGE_DETECTION_STRATEGY,
4297
4322
  encapsulation: core.ViewEncapsulation.None,
4298
4323
  providers: [
@@ -4313,214 +4338,13 @@
4313
4338
  formControlElement: [{ type: core.ViewChild, args: ['formControl', { static: true },] }],
4314
4339
  valueChange: [{ type: core.Output }],
4315
4340
  options: [{ type: core.Input }],
4341
+ selfValidation: [{ type: core.Input }],
4342
+ selfValidationError: [{ type: core.Input }],
4316
4343
  enabledDates: [{ type: core.Input }],
4317
4344
  disabledDates: [{ type: core.Input }],
4318
4345
  reinit: [{ type: core.Input }],
4319
4346
  value: [{ type: core.Input }]
4320
4347
  };
4321
- // export class InputDateComponent extends FormElementComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
4322
- //
4323
- // @ViewChild('formControl', {static: true})
4324
- // formControlElement: ElementRef<HTMLElement>;
4325
- //
4326
- // visibleData: string;
4327
- //
4328
- // changed: boolean;
4329
- //
4330
- // @Output()
4331
- // valueChange = new EventEmitter<string>();
4332
- //
4333
- // // @Input()
4334
- // // modelFormat: DateFormat;
4335
- //
4336
- // @Input()
4337
- // datepickerOptions: any;
4338
- //
4339
- // @Input()
4340
- // enabledDates: string[];
4341
- //
4342
- // @Input()
4343
- // disabledDates: string[];
4344
- //
4345
- // constructor(private cdr: ChangeDetectorRef) {
4346
- // super(cdr);
4347
- // this.detach();
4348
- // }
4349
- //
4350
- // ngOnChanges(changes: DatePickerChanges) {
4351
- //
4352
- // super.ngOnChanges(changes);
4353
- // this.emitDebug(`ngOnChanges:`);
4354
- // this.emitDebug(changes);
4355
- //
4356
- // if (changes.value && !changes.value.firstChange) {
4357
- //
4358
- // this.hasError = false;
4359
- // this.error = undefined;
4360
- // }
4361
- //
4362
- // this.cdr.detectChanges();
4363
- // }
4364
- //
4365
- // ngOnInit() {
4366
- //
4367
- // this.logPrefix = `[inail-input-date][${this.label}]`;
4368
- // super.ngOnInit();
4369
- //
4370
- // if (!this.datepickerOptions) {
4371
- //
4372
- // this.datepickerOptions = {
4373
- // autoclose: true,
4374
- // format: 'dd/mm/yyyy',
4375
- // weekStart: 1,
4376
- // todayBtn: 'linked',
4377
- // language: 'it',
4378
- // todayHighlight: true,
4379
- // orientation: 'auto top',
4380
- // enableOnReadonly: false
4381
- // };
4382
- // }
4383
- //
4384
- // if (this.disabledDates != undefined || this.enabledDates != undefined) {
4385
- //
4386
- // this.datepickerOptions.beforeShowDay = this.isEnabledDate
4387
- // }
4388
- //
4389
- // this.cdr.detectChanges();
4390
- // }
4391
- //
4392
- // private isEnabledDate = (date) => {
4393
- //
4394
- // // @ts-ignore
4395
- // var dateString = $.datepicker.formatDate('yy-mm-dd', date);
4396
- // return this.isDataAbilitata(dateString) && !this.isDataDisabilitata(dateString);
4397
- // };
4398
- //
4399
- // private isDataAbilitata = (data: string) => this.enabledDates == undefined || this.enabledDates.some(regex => this.match(data, regex) != undefined);
4400
- // private isDataDisabilitata = (data: string) => this.disabledDates != undefined && this.disabledDates.some(regex => this.match(data, regex) != undefined);
4401
- //
4402
- // match = (date: string, regex: string) => date != undefined && date.match(new RegExp('^'.concat(regex).concat('$'), 'i'));
4403
- //
4404
- // ngAfterViewInit(): void {
4405
- //
4406
- // this.emitDebug('ngAfterViewInit');
4407
- // this.emitDebug('nativeElement');
4408
- // this.emitDebug(this.formControlElement?.nativeElement);
4409
- //
4410
- // // Inizializzazione della libreria datepicker
4411
- // window['$'](this.formControlElement.nativeElement).datepicker(this.datepickerOptions);
4412
- //
4413
- // if (this.visibleData && isDate(this.visibleData)) {
4414
- //
4415
- // this.setDatepickerDate(this.visibleData)
4416
- // }
4417
- //
4418
- // setTimeout(() => {
4419
- //
4420
- // // @ts-ignore
4421
- // $('#' + this.id).on("change", () => {
4422
- //
4423
- // this.emitDebug('onChange');
4424
- // this.emitDebug(`visibleData: ${this.visibleData}`);
4425
- //
4426
- // // @ts-ignore
4427
- // let elem = $('#' + this.id)[0]
4428
- //
4429
- // this.emitDebug(`nativeElement value: ${elem?.value}`);
4430
- //
4431
- // if (elem != undefined && elem.value != this.visibleData) {
4432
- //
4433
- // this.emitDebug(`update value: ${this.value} -> ${elem.value}`);
4434
- // this.value = elem.value;
4435
- // }
4436
- //
4437
- // this.cdr.detectChanges();
4438
- // });
4439
- // });
4440
- //
4441
- // if (this.showPopover()) {
4442
- //
4443
- // // @ts-ignore
4444
- // $(`#${this.id}-popover`).popover();
4445
- // }
4446
- //
4447
- // this.cdr.detectChanges();
4448
- // }
4449
- //
4450
- // ngOnDestroy(): void {
4451
- //
4452
- // super.ngOnDestroy();
4453
- // }
4454
- //
4455
- // @Input()
4456
- // set value(val) {
4457
- //
4458
- // // console.warn('val', val, this.visibleData)
4459
- //
4460
- // let validFormat = isValidInputFormat(val);
4461
- //
4462
- // // console.warn('validFormat', validFormat)
4463
- //
4464
- // if (isNotBlankOrNull(val)) {
4465
- //
4466
- // this.visibleData = validFormat ? toItalianFormat(val) : val;
4467
- // } else {
4468
- //
4469
- // this.visibleData = undefined
4470
- // }
4471
- //
4472
- // // console.warn('visibleData', this.visibleData)
4473
- //
4474
- // setTimeout(() => {
4475
- //
4476
- // let vChange = validFormat ? toISO8601Format(this.visibleData) : this.visibleData
4477
- //
4478
- // // console.warn('vChange', vChange)
4479
- //
4480
- // this.valueChange.emit(validFormat ? toISO8601Format(this.visibleData) : this.visibleData);
4481
- //
4482
- // if (validFormat) {
4483
- //
4484
- // // console.warn(this.visibleData)
4485
- // this.setDatepickerDate(this.visibleData);
4486
- // }
4487
- // });
4488
- // }
4489
- //
4490
- // get isValid(): boolean {
4491
- //
4492
- // return isBlankOrNull(this.visibleData) || isInItalianFormat(this.visibleData);
4493
- // }
4494
- //
4495
- // checkDescError(): boolean {
4496
- //
4497
- // let descError: string = this.getDescError();
4498
- // return this.checkError() && isNotBlankOrNull(descError);
4499
- // }
4500
- //
4501
- // checkError(): boolean {
4502
- //
4503
- // return !this.isValid || this.hasError || isNotBlankOrNull(this.error);
4504
- // }
4505
- //
4506
- // getDescError(): string {
4507
- //
4508
- // return (isNotBlankOrNull(this.error) && !this.isValid)
4509
- // ? 'La data inserita non &egrave; valida'
4510
- // : this.error;
4511
- // }
4512
- //
4513
- // onChangeHandler($event: any) {
4514
- //
4515
- // // console.info('onChange', $event.target.value)
4516
- // this.value = $event.target.value;
4517
- // }
4518
- //
4519
- // private setDatepickerDate(date: string) {
4520
- //
4521
- // window['$'](this.formControlElement.nativeElement).datepicker('setDate', date);
4522
- // }
4523
- // }
4524
4348
 
4525
4349
  var clone$1 = function (obj) { return obj ? JSON.parse(JSON.stringify(obj)) : obj; };
4526
4350
  var ɵ0$4 = clone$1;
@@ -4599,7 +4423,9 @@
4599
4423
  _this.emitDebug("this.valueChange.emit(" + _this.selectedValue + ")");
4600
4424
  _this.valueChange.emit(_this.selectedValue);
4601
4425
  _this.select.emit(_this.options.find(function (opt) { return (opt === null || opt === void 0 ? void 0 : opt.value) === _this.selectedValue; }));
4602
- _this.cleanError();
4426
+ if (_this.cleanErrorOnChange) {
4427
+ _this.cleanError();
4428
+ }
4603
4429
  if (_this.onChange) {
4604
4430
  _this.onChange(_this.selectedValue);
4605
4431
  }
@@ -4721,7 +4547,9 @@
4721
4547
  this.emitDebug("this.checkedChange.emit(" + value + ")");
4722
4548
  this.checkedChange.emit(value);
4723
4549
  this.emitState();
4724
- this.cleanError();
4550
+ if (this.cleanErrorOnChange) {
4551
+ this.cleanError();
4552
+ }
4725
4553
  if (this.onChange) {
4726
4554
  this.onChange(value);
4727
4555
  }
@@ -5436,7 +5264,7 @@
5436
5264
  __extends(TableComponent, _super);
5437
5265
  function TableComponent(cdr, renderer, libConfig) {
5438
5266
  var _this = this;
5439
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
5440
5268
  _this = _super.call(this, cdr, libConfig) || this;
5441
5269
  _this.cdr = cdr;
5442
5270
  _this.renderer = renderer;
@@ -5456,7 +5284,9 @@
5456
5284
  _this.pagination = new core.EventEmitter();
5457
5285
  _this.tallRows = getConfigValue((_h = (_g = _this.libConfig) === null || _g === void 0 ? void 0 : _g.tableComponent) === null || _h === void 0 ? void 0 : _h.tallRows, false);
5458
5286
  _this.captionHidden = getConfigValue((_k = (_j = _this.libConfig) === null || _j === void 0 ? void 0 : _j.tableComponent) === null || _k === void 0 ? void 0 : _k.captionHidden, false);
5459
- _this.bgWhite = getConfigValue((_m = (_l = _this.libConfig) === null || _l === void 0 ? void 0 : _l.tableComponent) === null || _m === void 0 ? void 0 : _m.bgWhite, true);
5287
+ _this.showFullListSize = getConfigValue((_m = (_l = _this.libConfig) === null || _l === void 0 ? void 0 : _l.tableComponent) === null || _m === void 0 ? void 0 : _m.showFullListSize, false);
5288
+ _this.fullListSizeText = getConfigValue((_p = (_o = _this.libConfig) === null || _o === void 0 ? void 0 : _o.tableComponent) === null || _p === void 0 ? void 0 : _p.fullListSizeText, "Elementi totali:");
5289
+ _this.bgWhite = getConfigValue((_r = (_q = _this.libConfig) === null || _q === void 0 ? void 0 : _q.tableComponent) === null || _r === void 0 ? void 0 : _r.bgWhite, true);
5460
5290
  _this.detailsClick = new core.EventEmitter();
5461
5291
  _this.checkedRowsChange = new core.EventEmitter();
5462
5292
  _this.visualizzaBaseFooter = true;
@@ -5469,6 +5299,7 @@
5469
5299
  _this.getPageSize = function () { return _this.externalPaginationSorting ? _this.paginationState.pageSize : _this.tableLength; };
5470
5300
  _this.getListSize = function () { return _this.externalPaginationSorting ? _this.paginationState.fullListSize : _this.dataSource.length; };
5471
5301
  _this.getCurrentPage = function () { return _this.externalPaginationSorting && _this.paginationState ? _this.paginationState.pageNumber : _this.currentPage; };
5302
+ _this.getFullListSize = function () { var _a, _b; return _this.externalPaginationSorting ? (_a = _this.paginationState) === null || _a === void 0 ? void 0 : _a.fullListSize : (_b = _this.dataSource) === null || _b === void 0 ? void 0 : _b.length; };
5472
5303
  // Operatori per gestione selezione righe
5473
5304
  _this.isChecked = function (trcbValue) { return _this.righeSelezionate.some(function (value) { return value == trcbValue; }); };
5474
5305
  _this.isAllChecked = function () { return _this.righeSelezionabili.length > 0 && _this.righeSelezionabili.every(_this.isChecked); };
@@ -5949,10 +5780,10 @@
5949
5780
  TableComponent.decorators = [
5950
5781
  { type: core.Component, args: [{
5951
5782
  selector: 'inail-table',
5952
- template: "<div class=\"tabella table-responsive inail-table {{getResponsiveClass()}} noPaddingLeft {{class}} noPaddingRight\">\n\n <h3 *ngIf=\"title\"\n class=\"col-xs-9 table-title pull-left noPaddingLeft {{titleClass}}\"\n [innerHTML]=\"title\">\n </h3>\n\n <a *ngIf=\"detailsLink\"\n href=\"javascript:void(0)\"\n (click)=\"detailsClick.emit()\"\n class=\"col-xs-3 col-sm-2 linkDettagli pull-right\"\n [innerHTML]=\"detailsLink\">\n </a>\n\n <div *ngIf=\"description\"\n class=\"col-xs-12 caption marginBottom noPaddingLeft\"\n [innerHTML]=\"description\">\n </div>\n\n <inail-table-page-length-selector *ngIf=\"visualizzaPaginazione()\"\n [value]=\"getPageSize()\"\n [tableId]=\"id\"\n [options]=\"elementsPerPageOptions\"\n (valueChange)=\"lengthOnChange($event)\"\n [logOnConsole]=\"logOnConsole\"\n (log)=\"log.emit($event)\">\n </inail-table-page-length-selector>\n\n <ng-container *ngIf=\"true\">\n\n <table id=\"{{id}}\"\n class=\"table display dataTable {{tableClass}}\"\n [ngClass]=\"{'tabella-base': !tallRows, 'bg-white': bgWhite, 'bg-transparent': !bgWhite}\">\n\n <caption *ngIf=\"caption\"\n [ngClass]=\"{'sr-only': captionHidden}\"\n [innerHTML]=\"caption\">\n </caption>\n\n <ng-content select=\"thead\"></ng-content>\n\n <ng-container *ngIf=\"!noDataFound\">\n <ng-content select=\"tbody\"></ng-content>\n </ng-container>\n\n <tbody *ngIf=\"noDataFound\">\n <tr role=\"row\">\n <td class=\"content-text\"\n style=\"padding: 30px; text-align: center\"\n [colSpan]=\"numeroColonne\"\n [innerHTML]=\"noDataFoundText\">\n </td>\n </tr>\n </tbody>\n </table>\n\n <div #baseFooter\n class=\"col-xs-12 baseFooter noPaddingLeft\"\n *ngIf=\"visualizzaBaseFooter\">\n <ng-content select=\"[baseFooter]\"></ng-content>\n </div>\n\n </ng-container>\n\n <inail-table-page-selector *ngIf=\"visualizzaPaginazione() && !this.noDataFound\"\n [listSize]=\"getListSize()\"\n [pageSize]=\"getPageSize()\"\n [currentPage]=\"getCurrentPage()\"\n [tableId]=\"id\"\n (select)=\"pageOnChange($event)\"\n [logOnConsole]=\"logOnConsole\"\n (log)=\"log.emit($event)\">\n </inail-table-page-selector>\n\n</div>\n",
5783
+ template: "<div class=\"tabella table-responsive inail-table {{getResponsiveClass()}} noPaddingLeft {{class}} noPaddingRight\">\n\n <h3 *ngIf=\"title\"\n class=\"col-xs-9 table-title pull-left noPaddingLeft {{titleClass}}\"\n [innerHTML]=\"title\">\n </h3>\n\n <a *ngIf=\"detailsLink\"\n href=\"javascript:void(0)\"\n (click)=\"detailsClick.emit()\"\n class=\"col-xs-3 col-sm-2 linkDettagli pull-right\"\n [innerHTML]=\"detailsLink\">\n </a>\n\n <div *ngIf=\"description\"\n class=\"col-xs-12 caption marginBottom noPaddingLeft\"\n [innerHTML]=\"description\">\n </div>\n\n <div>\n <div *ngIf=\"showFullListSize\"\n class=\"total-elements\">\n <span [innerHTML]=\"fullListSizeText\"></span> {{getFullListSize() || 0}}\n </div>\n\n <inail-table-page-length-selector *ngIf=\"visualizzaPaginazione()\"\n [value]=\"getPageSize()\"\n [tableId]=\"id\"\n [options]=\"elementsPerPageOptions\"\n (valueChange)=\"lengthOnChange($event)\"\n [logOnConsole]=\"logOnConsole\"\n (log)=\"log.emit($event)\">\n </inail-table-page-length-selector>\n </div>\n\n <ng-container *ngIf=\"true\">\n\n <table id=\"{{id}}\"\n class=\"table display dataTable {{tableClass}}\"\n [ngClass]=\"{'tabella-base': !tallRows, 'bg-white': bgWhite, 'bg-transparent': !bgWhite}\">\n\n <caption *ngIf=\"caption\"\n [ngClass]=\"{'sr-only': captionHidden}\"\n [innerHTML]=\"caption\">\n </caption>\n\n <ng-content select=\"thead\"></ng-content>\n\n <ng-container *ngIf=\"!noDataFound\">\n <ng-content select=\"tbody\"></ng-content>\n </ng-container>\n\n <tbody *ngIf=\"noDataFound\">\n <tr role=\"row\">\n <td class=\"content-text\"\n style=\"padding: 30px; text-align: center\"\n [colSpan]=\"numeroColonne\"\n [innerHTML]=\"noDataFoundText\">\n </td>\n </tr>\n </tbody>\n </table>\n\n <div #baseFooter\n class=\"col-xs-12 baseFooter noPaddingLeft\"\n *ngIf=\"visualizzaBaseFooter\">\n <ng-content select=\"[baseFooter]\"></ng-content>\n </div>\n\n </ng-container>\n\n <inail-table-page-selector *ngIf=\"visualizzaPaginazione() && !this.noDataFound\"\n [listSize]=\"getListSize()\"\n [pageSize]=\"getPageSize()\"\n [currentPage]=\"getCurrentPage()\"\n [tableId]=\"id\"\n (select)=\"pageOnChange($event)\"\n [logOnConsole]=\"logOnConsole\"\n (log)=\"log.emit($event)\">\n </inail-table-page-selector>\n\n</div>\n",
5953
5784
  changeDetection: CHANGE_DETECTION_STRATEGY,
5954
5785
  encapsulation: core.ViewEncapsulation.None,
5955
- styles: [".inail-table a.linkDettagli{color:#106cdb;-webkit-text-decoration-line:none;text-decoration-line:none}.inail-table a.linkDettagli:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.inail-table table.table.dataTable.bg-white>tbody>tr:not(:hover){background-color:#fff}.inail-table table.table.dataTable.bg-transparent>tbody>tr:not(:hover){background-color:initial}"]
5786
+ styles: [".inail-table a.linkDettagli{color:#106cdb;-webkit-text-decoration-line:none;text-decoration-line:none}.inail-table a.linkDettagli:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.inail-table table.table.dataTable.bg-white>tbody>tr:not(:hover){background-color:#fff}.inail-table table.table.dataTable.bg-transparent>tbody>tr:not(:hover){background-color:initial}.inail-table .total-elements{float:left;padding-top:12px}"]
5956
5787
  },] }
5957
5788
  ];
5958
5789
  TableComponent.ctorParameters = function () { return [
@@ -5976,6 +5807,8 @@
5976
5807
  tallRows: [{ type: core.Input }],
5977
5808
  caption: [{ type: core.Input }],
5978
5809
  captionHidden: [{ type: core.Input }],
5810
+ showFullListSize: [{ type: core.Input }],
5811
+ fullListSizeText: [{ type: core.Input }],
5979
5812
  bgWhite: [{ type: core.Input }],
5980
5813
  description: [{ type: core.Input }],
5981
5814
  tableClass: [{ type: core.Input }],
@@ -6043,7 +5876,9 @@
6043
5876
  if (!this.addButton) {
6044
5877
  this.fileChange.emit(this.fileModel);
6045
5878
  }
6046
- this.cleanError();
5879
+ if (this.cleanErrorOnChange) {
5880
+ this.cleanError();
5881
+ }
6047
5882
  this.cdr.detectChanges();
6048
5883
  };
6049
5884
  InputFileComponent.prototype.reset = function () {
@@ -6076,6 +5911,7 @@
6076
5911
  inputText: [{ type: core.ViewChild, args: ['inputText', { static: true },] }]
6077
5912
  };
6078
5913
 
5914
+ var ACCEPTED_INPUTS$1 = [',', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete', "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"];
6079
5915
  var InputNumberComponent = /** @class */ (function (_super) {
6080
5916
  __extends(InputNumberComponent, _super);
6081
5917
  function InputNumberComponent(cdr, libConfig) {
@@ -6090,6 +5926,9 @@
6090
5926
  _this.numberOfDecimals = getConfigValue((_h = (_g = _this.libConfig) === null || _g === void 0 ? void 0 : _g.inputNumberComponent) === null || _h === void 0 ? void 0 : _h.numberOfDecimals, undefined);
6091
5927
  _this.hideArrows = getConfigValue((_k = (_j = _this.libConfig) === null || _j === void 0 ? void 0 : _j.inputNumberComponent) === null || _k === void 0 ? void 0 : _k.hideArrows, false);
6092
5928
  _this.valueChange = new core.EventEmitter();
5929
+ _this.isFirstDigitComma = function (ev) { return ev.key == ',' && _this.inputValue == undefined; };
5930
+ _this.isWrongMinus = function (ev) { return ev.key == '-' && ev.key == _this.previousDigit; };
5931
+ _this.isWrongDigit = function (ev) { return _this.isFirstDigitComma(ev) || _this.isWrongMinus(ev); };
6093
5932
  _this.logPrefix = "[inail-input-number]";
6094
5933
  _super.prototype.overrideConfig.call(_this, libConfig === null || libConfig === void 0 ? void 0 : libConfig.inputNumberComponent);
6095
5934
  _this.detach();
@@ -6100,10 +5939,10 @@
6100
5939
  if (changes.value) {
6101
5940
  this.previousValue = changes.value.previousValue;
6102
5941
  this.normalizzaValore();
6103
- if (!changes.value.firstChange) {
6104
- this.hasError = false;
6105
- this.error = undefined;
6106
- }
5942
+ // if (!changes.value.firstChange) {
5943
+ //
5944
+ // this.cleanError()
5945
+ // }
6107
5946
  }
6108
5947
  this.cdr.detectChanges();
6109
5948
  };
@@ -6147,7 +5986,9 @@
6147
5986
  this.cdr.detectChanges();
6148
5987
  this.emitDebug("this.valueChange.emit(" + value + ")");
6149
5988
  this.valueChange.emit(value);
6150
- this.cleanError();
5989
+ if (this.cleanErrorOnChange) {
5990
+ this.cleanError();
5991
+ }
6151
5992
  if (this.onChange) {
6152
5993
  this.onChange(value);
6153
5994
  }
@@ -6191,12 +6032,22 @@
6191
6032
  }
6192
6033
  return true;
6193
6034
  };
6035
+ InputNumberComponent.prototype.onKeyDown = function (ev) {
6036
+ // console.warn(ev)
6037
+ // console.warn(`${this.inputValue}`)
6038
+ if ((!ACCEPTED_INPUTS$1.some(function (v) { return v === ev.key; }) || this.isWrongDigit(ev)) && ev.ctrlKey == false) {
6039
+ ev.preventDefault();
6040
+ }
6041
+ else {
6042
+ this.previousDigit = ev.key;
6043
+ }
6044
+ };
6194
6045
  return InputNumberComponent;
6195
6046
  }(FormElementComponent));
6196
6047
  InputNumberComponent.decorators = [
6197
6048
  { type: core.Component, args: [{
6198
6049
  selector: 'inail-input-number',
6199
- template: "<div class=\"form-group {{getResponsiveClass()}} noPaddingLeft {{class}} inail-input-number\"\n [ngClass]=\"{'has-error': isThereError(), 'no-arrows': hideArrows}\">\n <label *ngIf=\"label\"\n class=\"control-label {{labelClass}}\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n [attr.title]=\"labelTitle\"\n [for]=\"id\"\n [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <input #formControl\n type=\"number\"\n [id]=\"id\"\n class=\"form-control {{inputClass}}\"\n [ngClass]=\"{'disabled': disabled}\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [attr.max]=\"max\"\n [attr.min]=\"min\"\n [attr.step]=\"step\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (keyup)=\"onKeyUp()\"\n (blur)=\"onBlur()\"\n (keyup.enter)=\"enterUp.emit()\"\n [value]=\"inputValue\"\n [(ngModel)]='value'>\n <!--<input type=\"text\"\n *ngIf=\"disabled\"\n [id]=\"id\"\n class=\"form-control disabled {{inputClass}}\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n [ngModel]='value'>-->\n <div *ngIf=\"showError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+this.error\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"this.description\"></div>\n </div>\n <div *ngIf=\"description && !showError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n</div>\n",
6050
+ template: "<div class=\"form-group {{getResponsiveClass()}} noPaddingLeft {{class}} inail-input-number\"\n [ngClass]=\"{'has-error': isThereError(), 'no-arrows': hideArrows}\">\n <label *ngIf=\"label\"\n class=\"control-label {{labelClass}}\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n [attr.title]=\"labelTitle\"\n [for]=\"id\"\n [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <input #formControl\n type=\"number\"\n [id]=\"id\"\n class=\"form-control {{inputClass}}\"\n [ngClass]=\"{'disabled': disabled}\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [attr.max]=\"max\"\n [attr.min]=\"min\"\n [attr.step]=\"step\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (keyup)=\"onKeyUp()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n (keyup.enter)=\"enterUp.emit()\"\n [value]=\"inputValue\"\n [(ngModel)]='value'>\n <!--<input type=\"text\"\n *ngIf=\"disabled\"\n [id]=\"id\"\n class=\"form-control disabled {{inputClass}}\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n [ngModel]='value'>-->\n <div *ngIf=\"showError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+this.error\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"this.description\"></div>\n </div>\n <div *ngIf=\"description && !showError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n</div>\n",
6200
6051
  changeDetection: CHANGE_DETECTION_STRATEGY,
6201
6052
  encapsulation: core.ViewEncapsulation.None,
6202
6053
  providers: [
@@ -6721,11 +6572,15 @@
6721
6572
  if (!cb.firstChange) {
6722
6573
  if (cb.checked && !this.isChecked(cb.value)) {
6723
6574
  this.pushValue(cb.value);
6724
- this.cleanError();
6575
+ if (this.cleanErrorOnChange) {
6576
+ this.cleanError();
6577
+ }
6725
6578
  }
6726
6579
  else if (!cb.checked && this.isChecked(cb.value)) {
6727
6580
  this.values = this.values.filter(function (value) { return value != cb.value; });
6728
- this.cleanError();
6581
+ if (this.cleanErrorOnChange) {
6582
+ this.cleanError();
6583
+ }
6729
6584
  }
6730
6585
  this.valuesChange.emit(this.values);
6731
6586
  this.inputTextValue = this.getInputTextValue();
@@ -6760,7 +6615,7 @@
6760
6615
 
6761
6616
  var HM_PLACEHOLDER = 'HH:MM';
6762
6617
  var HMS_PLACEHOLDER = 'HH:MM:SS';
6763
- var ACCEPTED_INPUTS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete'];
6618
+ var ACCEPTED_INPUTS$2 = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace', 'Delete', "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"];
6764
6619
  var InputTimeComponent = /** @class */ (function (_super) {
6765
6620
  __extends(InputTimeComponent, _super);
6766
6621
  function InputTimeComponent(cdr, libConfig) {
@@ -6846,12 +6701,16 @@
6846
6701
  this.setDescError(this.selfValidationError);
6847
6702
  }
6848
6703
  else {
6849
- this.cleanError();
6704
+ if (this.cleanErrorOnChange) {
6705
+ this.cleanError();
6706
+ }
6850
6707
  }
6851
6708
  }
6852
6709
  else {
6853
6710
  this.inputValue = value;
6854
- this.cleanError();
6711
+ if (this.cleanErrorOnChange) {
6712
+ this.cleanError();
6713
+ }
6855
6714
  }
6856
6715
  this.cdr.detectChanges();
6857
6716
  this.emitDebug("this.valueChange.emit(" + this.inputValue + ")");
@@ -6884,10 +6743,38 @@
6884
6743
  }
6885
6744
  };
6886
6745
  InputTimeComponent.prototype.onKeyDown = function (ev) {
6887
- if (!ACCEPTED_INPUTS.some(function (v) { return v === ev.key; }) && ev.ctrlKey == false) {
6746
+ if (!ACCEPTED_INPUTS$2.some(function (v) { return v === ev.key; }) && ev.ctrlKey == false) {
6888
6747
  ev.preventDefault();
6889
6748
  }
6890
6749
  };
6750
+ InputTimeComponent.prototype.onFocusOut = function () {
6751
+ this.completaValoreInInput();
6752
+ };
6753
+ InputTimeComponent.prototype.completaParteOrario = function (value) {
6754
+ if (isBlankOrNull(value)) {
6755
+ value = '00';
6756
+ }
6757
+ else if (value.length == 1) {
6758
+ value = "0" + value;
6759
+ }
6760
+ return value;
6761
+ };
6762
+ InputTimeComponent.prototype.completaValoreInInput = function () {
6763
+ if (isNotBlankOrNull(this.inputValue) && (this.inputValue.length < 5 || (this.withSeconds && this.inputValue.length < 8))) {
6764
+ var partiOrario = this.inputValue.split(':');
6765
+ var numeroParti = this.withSeconds ? 3 : 2;
6766
+ for (var i = 0; i < numeroParti; i++) {
6767
+ partiOrario[i] = this.completaParteOrario(partiOrario[i]);
6768
+ }
6769
+ var value = partiOrario[0] + ":" + partiOrario[1];
6770
+ if (partiOrario[2]) {
6771
+ value = value + ":" + partiOrario[2];
6772
+ }
6773
+ if (value && this.isValidValue(value)) {
6774
+ this.setValue(value);
6775
+ }
6776
+ }
6777
+ };
6891
6778
  InputTimeComponent.prototype.ngOnDestroy = function () {
6892
6779
  _super.prototype.ngOnDestroy.call(this);
6893
6780
  };
@@ -6896,7 +6783,7 @@
6896
6783
  InputTimeComponent.decorators = [
6897
6784
  { type: core.Component, args: [{
6898
6785
  selector: 'inail-input-time',
6899
- template: "<div class=\"form-group {{getResponsiveClass()}} noPaddingLeft {{class}} inail-input-time\"\n [ngClass]=\"{'has-error': isThereError()}\">\n <label *ngIf=\"label\"\n class=\"control-label {{labelClass}}\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n [attr.title]=\"labelTitle\"\n [for]=\"id\"\n [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <div class=\"form-control-wrapper\"\n [ngClass]=\"{'no-label' : hiddenLabel || !label}\">\n <input #formControl\n [id]=\"id\"\n [attr.type]=\"getType()\"\n [attr.step]=\"getStep()\"\n class=\"form-control {{inputClass}}\"\n [ngClass]=\"{'disabled': disabled}\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [attr.maxlength]=\"getMaxLength()\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.placeholder]=\"placeholderVisualizzato\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n (paste)=\"onPaste($event)\"\n (keyup.enter)=\"enterUp.emit()\"\n [(ngModel)]=\"value\">\n </div>\n <div *ngIf=\"showError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+this.error\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"this.description\"></div>\n </div>\n <div *ngIf=\"description && !showError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n <debug-pre *ngIf=\"showState\">\n <state-propertie [label]=\"'id'\" [propertie]=\"id\"></state-propertie>\n <state-propertie [label]=\"'label'\" [propertie]=\"label\"></state-propertie>\n <state-propertie [label]=\"'inputValue'\" [propertie]=\"inputValue\"></state-propertie>\n <state-propertie [label]=\"'placeholder'\" [propertie]=\"placeholder\"></state-propertie>\n <state-propertie [label]=\"'defaultPlaceholder'\" [propertie]=\"defaultPlaceholder\"></state-propertie>\n <inail-form-element-state-properties [formElement]=\"this\"></inail-form-element-state-properties>\n </debug-pre>\n</div>\n",
6786
+ template: "<div class=\"form-group {{getResponsiveClass()}} noPaddingLeft {{class}} inail-input-time\"\n [ngClass]=\"{'has-error': isThereError()}\">\n <label *ngIf=\"label\"\n class=\"control-label {{labelClass}}\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n [attr.title]=\"labelTitle\"\n [for]=\"id\"\n [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <div class=\"form-control-wrapper\"\n [ngClass]=\"{'no-label' : hiddenLabel || !label}\">\n <input #formControl\n [id]=\"id\"\n [attr.type]=\"getType()\"\n [attr.step]=\"getStep()\"\n class=\"form-control {{inputClass}}\"\n [ngClass]=\"{'disabled': disabled}\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [attr.maxlength]=\"getMaxLength()\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.placeholder]=\"placeholderVisualizzato\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (blur)=\"onBlur()\"\n (focusout)=\"onFocusOut()\"\n (keydown)=\"onKeyDown($event)\"\n (paste)=\"onPaste($event)\"\n (keyup.enter)=\"enterUp.emit()\"\n [(ngModel)]=\"value\">\n </div>\n <div *ngIf=\"showError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+this.error\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"this.description\"></div>\n </div>\n <div *ngIf=\"description && !showError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n <debug-pre *ngIf=\"showState\">\n <state-propertie [label]=\"'id'\" [propertie]=\"id\"></state-propertie>\n <state-propertie [label]=\"'label'\" [propertie]=\"label\"></state-propertie>\n <state-propertie [label]=\"'inputValue'\" [propertie]=\"inputValue\"></state-propertie>\n <state-propertie [label]=\"'placeholder'\" [propertie]=\"placeholder\"></state-propertie>\n <state-propertie [label]=\"'defaultPlaceholder'\" [propertie]=\"defaultPlaceholder\"></state-propertie>\n <inail-form-element-state-properties [formElement]=\"this\"></inail-form-element-state-properties>\n </debug-pre>\n</div>\n",
6900
6787
  changeDetection: CHANGE_DETECTION_STRATEGY,
6901
6788
  encapsulation: core.ViewEncapsulation.None,
6902
6789
  providers: [