ng-inail-common 2.0.30-beta.9 → 2.0.31-beta.2

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 (26) hide show
  1. package/bundles/ng-inail-common.umd.js +94 -32
  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 +15 -11
  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 +8 -6
  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 +37 -5
  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 +94 -32
  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 +2 -0
  22. package/lib/components/core/form/input-time/input-time.component.d.ts +3 -0
  23. package/lib/components/core/table/table/table.component.d.ts +3 -0
  24. package/lib/ng-inail-common.config.d.ts +5 -0
  25. package/ng-inail-common.metadata.json +1 -1
  26. 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
  }
@@ -4126,7 +4135,7 @@
4126
4135
  __extends(InputDateComponent, _super);
4127
4136
  function InputDateComponent(cdr, libConfig) {
4128
4137
  var _this = this;
4129
- var _a, _b;
4138
+ var _a, _b, _c, _d, _e, _f;
4130
4139
  _this = _super.call(this, cdr, libConfig) || this;
4131
4140
  _this.cdr = cdr;
4132
4141
  _this.libConfig = libConfig;
@@ -4135,10 +4144,12 @@
4135
4144
  // modelFormat: DateFormat;
4136
4145
  // https://bootstrap-datepicker.readthedocs.io/en/latest/options.html
4137
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');
4138
4149
  _this.isValidInputValue = function () { return isBlankOrNull(_this.visibleData) || isInItalianFormat(_this.visibleData); };
4139
- _this.isThereDataError = function () { return _this.isThereError() || !_this.isValidInputValue(); };
4150
+ _this.isThereDataError = function () { return _this.isThereError() || (!_this.isValidInputValue() && _this.selfValidation); };
4140
4151
  _this.showDataError = function () { return _this.isThereDataError() && isNotBlankOrNull(_this.getDescError()); };
4141
- _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; };
4142
4153
  _this.isEnabledDate = function (date) {
4143
4154
  var dateString = dateToString(date, 'ISO8061');
4144
4155
  return _this.isDataAbilitata(dateString) && !_this.isDataDisabilitata(dateString);
@@ -4156,12 +4167,10 @@
4156
4167
  }
4157
4168
  InputDateComponent.prototype.ngOnChanges = function (changes) {
4158
4169
  _super.prototype.ngOnChanges.call(this, changes);
4159
- if (changes.value && !changes.value.firstChange) {
4160
- this.hasError = false;
4161
- this.error = undefined;
4162
- this.hasErrorChange.emit(this.hasError);
4163
- this.errorChange.emit(this.error);
4164
- }
4170
+ // if (changes.value && !changes.value.firstChange && this.cleanErrorOnChange) {
4171
+ //
4172
+ // this.cleanError();
4173
+ // }
4165
4174
  // Se cambiano le options o gli array delle date abilitate/disabilitate
4166
4175
  // reinizializzo il componente
4167
4176
  if ((changes.options && !changes.options.firstChange)
@@ -4278,7 +4287,9 @@
4278
4287
  _this.setDatepickerDate(_this.visibleData);
4279
4288
  }
4280
4289
  });
4281
- this.cleanError();
4290
+ if (this.cleanErrorOnChange) {
4291
+ this.cleanError();
4292
+ }
4282
4293
  this.cdr.detectChanges();
4283
4294
  if (this.onChange) {
4284
4295
  this.onChange(value);
@@ -4327,6 +4338,8 @@
4327
4338
  formControlElement: [{ type: core.ViewChild, args: ['formControl', { static: true },] }],
4328
4339
  valueChange: [{ type: core.Output }],
4329
4340
  options: [{ type: core.Input }],
4341
+ selfValidation: [{ type: core.Input }],
4342
+ selfValidationError: [{ type: core.Input }],
4330
4343
  enabledDates: [{ type: core.Input }],
4331
4344
  disabledDates: [{ type: core.Input }],
4332
4345
  reinit: [{ type: core.Input }],
@@ -4410,7 +4423,9 @@
4410
4423
  _this.emitDebug("this.valueChange.emit(" + _this.selectedValue + ")");
4411
4424
  _this.valueChange.emit(_this.selectedValue);
4412
4425
  _this.select.emit(_this.options.find(function (opt) { return (opt === null || opt === void 0 ? void 0 : opt.value) === _this.selectedValue; }));
4413
- _this.cleanError();
4426
+ if (_this.cleanErrorOnChange) {
4427
+ _this.cleanError();
4428
+ }
4414
4429
  if (_this.onChange) {
4415
4430
  _this.onChange(_this.selectedValue);
4416
4431
  }
@@ -4532,7 +4547,9 @@
4532
4547
  this.emitDebug("this.checkedChange.emit(" + value + ")");
4533
4548
  this.checkedChange.emit(value);
4534
4549
  this.emitState();
4535
- this.cleanError();
4550
+ if (this.cleanErrorOnChange) {
4551
+ this.cleanError();
4552
+ }
4536
4553
  if (this.onChange) {
4537
4554
  this.onChange(value);
4538
4555
  }
@@ -5247,7 +5264,7 @@
5247
5264
  __extends(TableComponent, _super);
5248
5265
  function TableComponent(cdr, renderer, libConfig) {
5249
5266
  var _this = this;
5250
- 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;
5251
5268
  _this = _super.call(this, cdr, libConfig) || this;
5252
5269
  _this.cdr = cdr;
5253
5270
  _this.renderer = renderer;
@@ -5267,7 +5284,9 @@
5267
5284
  _this.pagination = new core.EventEmitter();
5268
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);
5269
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);
5270
- _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);
5271
5290
  _this.detailsClick = new core.EventEmitter();
5272
5291
  _this.checkedRowsChange = new core.EventEmitter();
5273
5292
  _this.visualizzaBaseFooter = true;
@@ -5280,6 +5299,7 @@
5280
5299
  _this.getPageSize = function () { return _this.externalPaginationSorting ? _this.paginationState.pageSize : _this.tableLength; };
5281
5300
  _this.getListSize = function () { return _this.externalPaginationSorting ? _this.paginationState.fullListSize : _this.dataSource.length; };
5282
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; };
5283
5303
  // Operatori per gestione selezione righe
5284
5304
  _this.isChecked = function (trcbValue) { return _this.righeSelezionate.some(function (value) { return value == trcbValue; }); };
5285
5305
  _this.isAllChecked = function () { return _this.righeSelezionabili.length > 0 && _this.righeSelezionabili.every(_this.isChecked); };
@@ -5760,10 +5780,10 @@
5760
5780
  TableComponent.decorators = [
5761
5781
  { type: core.Component, args: [{
5762
5782
  selector: 'inail-table',
5763
- 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\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\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",
5764
5784
  changeDetection: CHANGE_DETECTION_STRATEGY,
5765
5785
  encapsulation: core.ViewEncapsulation.None,
5766
- 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}"]
5767
5787
  },] }
5768
5788
  ];
5769
5789
  TableComponent.ctorParameters = function () { return [
@@ -5787,6 +5807,8 @@
5787
5807
  tallRows: [{ type: core.Input }],
5788
5808
  caption: [{ type: core.Input }],
5789
5809
  captionHidden: [{ type: core.Input }],
5810
+ showFullListSize: [{ type: core.Input }],
5811
+ fullListSizeText: [{ type: core.Input }],
5790
5812
  bgWhite: [{ type: core.Input }],
5791
5813
  description: [{ type: core.Input }],
5792
5814
  tableClass: [{ type: core.Input }],
@@ -5854,7 +5876,9 @@
5854
5876
  if (!this.addButton) {
5855
5877
  this.fileChange.emit(this.fileModel);
5856
5878
  }
5857
- this.cleanError();
5879
+ if (this.cleanErrorOnChange) {
5880
+ this.cleanError();
5881
+ }
5858
5882
  this.cdr.detectChanges();
5859
5883
  };
5860
5884
  InputFileComponent.prototype.reset = function () {
@@ -5915,10 +5939,10 @@
5915
5939
  if (changes.value) {
5916
5940
  this.previousValue = changes.value.previousValue;
5917
5941
  this.normalizzaValore();
5918
- if (!changes.value.firstChange) {
5919
- this.hasError = false;
5920
- this.error = undefined;
5921
- }
5942
+ // if (!changes.value.firstChange) {
5943
+ //
5944
+ // this.cleanError()
5945
+ // }
5922
5946
  }
5923
5947
  this.cdr.detectChanges();
5924
5948
  };
@@ -5962,7 +5986,9 @@
5962
5986
  this.cdr.detectChanges();
5963
5987
  this.emitDebug("this.valueChange.emit(" + value + ")");
5964
5988
  this.valueChange.emit(value);
5965
- this.cleanError();
5989
+ if (this.cleanErrorOnChange) {
5990
+ this.cleanError();
5991
+ }
5966
5992
  if (this.onChange) {
5967
5993
  this.onChange(value);
5968
5994
  }
@@ -6546,11 +6572,15 @@
6546
6572
  if (!cb.firstChange) {
6547
6573
  if (cb.checked && !this.isChecked(cb.value)) {
6548
6574
  this.pushValue(cb.value);
6549
- this.cleanError();
6575
+ if (this.cleanErrorOnChange) {
6576
+ this.cleanError();
6577
+ }
6550
6578
  }
6551
6579
  else if (!cb.checked && this.isChecked(cb.value)) {
6552
6580
  this.values = this.values.filter(function (value) { return value != cb.value; });
6553
- this.cleanError();
6581
+ if (this.cleanErrorOnChange) {
6582
+ this.cleanError();
6583
+ }
6554
6584
  }
6555
6585
  this.valuesChange.emit(this.values);
6556
6586
  this.inputTextValue = this.getInputTextValue();
@@ -6671,12 +6701,16 @@
6671
6701
  this.setDescError(this.selfValidationError);
6672
6702
  }
6673
6703
  else {
6674
- this.cleanError();
6704
+ if (this.cleanErrorOnChange) {
6705
+ this.cleanError();
6706
+ }
6675
6707
  }
6676
6708
  }
6677
6709
  else {
6678
6710
  this.inputValue = value;
6679
- this.cleanError();
6711
+ if (this.cleanErrorOnChange) {
6712
+ this.cleanError();
6713
+ }
6680
6714
  }
6681
6715
  this.cdr.detectChanges();
6682
6716
  this.emitDebug("this.valueChange.emit(" + this.inputValue + ")");
@@ -6713,6 +6747,34 @@
6713
6747
  ev.preventDefault();
6714
6748
  }
6715
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
+ };
6716
6778
  InputTimeComponent.prototype.ngOnDestroy = function () {
6717
6779
  _super.prototype.ngOnDestroy.call(this);
6718
6780
  };
@@ -6721,7 +6783,7 @@
6721
6783
  InputTimeComponent.decorators = [
6722
6784
  { type: core.Component, args: [{
6723
6785
  selector: 'inail-input-time',
6724
- 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",
6725
6787
  changeDetection: CHANGE_DETECTION_STRATEGY,
6726
6788
  encapsulation: core.ViewEncapsulation.None,
6727
6789
  providers: [