@fluxhub/fluxhub-lib 9.0.33 → 9.0.35

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 (36) hide show
  1. package/bundles/fluxhub-fluxhub-lib.umd.js +298 -365
  2. package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
  3. package/bundles/fluxhub-fluxhub-lib.umd.min.js +2 -2
  4. package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
  5. package/esm2015/fluxhub-fluxhub-lib.js +35 -30
  6. package/esm2015/lib/controls/fhautocomplete.js +32 -31
  7. package/esm2015/lib/controls/fhcheckbox.js +26 -36
  8. package/esm2015/lib/controls/fhcombobox.js +27 -24
  9. package/esm2015/lib/controls/fhdatepicker.js +34 -13
  10. package/esm2015/lib/controls/fhtextinput.js +25 -35
  11. package/esm2015/lib/controls/fhtimepicker.js +29 -13
  12. package/esm2015/lib/controls/fhuploadpanel.js +1 -2
  13. package/esm5/fluxhub-fluxhub-lib.js +35 -30
  14. package/esm5/lib/controls/fhautocomplete.js +59 -64
  15. package/esm5/lib/controls/fhcheckbox.js +35 -52
  16. package/esm5/lib/controls/fhcombobox.js +51 -55
  17. package/esm5/lib/controls/fhdatepicker.js +49 -31
  18. package/esm5/lib/controls/fhtextinput.js +35 -52
  19. package/esm5/lib/controls/fhtimepicker.js +45 -32
  20. package/esm5/lib/controls/fhuploadpanel.js +1 -2
  21. package/fesm2015/fluxhub-fluxhub-lib.js +169 -203
  22. package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
  23. package/fesm5/fluxhub-fluxhub-lib.js +265 -337
  24. package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
  25. package/fluxhub-fluxhub-lib.d.ts +35 -30
  26. package/fluxhub-fluxhub-lib.metadata.json +1 -1
  27. package/lib/controls/fhautocomplete.d.ts +8 -9
  28. package/lib/controls/fhcheckbox.d.ts +7 -7
  29. package/lib/controls/fhcombobox.d.ts +7 -5
  30. package/lib/controls/fhdatepicker.d.ts +8 -2
  31. package/lib/controls/fhtextinput.d.ts +7 -8
  32. package/lib/controls/fhtimepicker.d.ts +8 -2
  33. package/package.json +1 -1
  34. package/esm2015/lib/models/FHValueAccessor.js +0 -55
  35. package/esm5/lib/models/FHValueAccessor.js +0 -61
  36. package/lib/models/FHValueAccessor.d.ts +0 -36
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __metadata, __param } from 'tslib';
2
- import { ɵɵdefineInjectable, Injectable, ɵɵinject, ViewChild, ViewContainerRef, Component, Directive, EventEmitter, Input, Output, Inject, ElementRef, forwardRef, HostListener, Pipe, PLATFORM_ID, Optional, NgModule } from '@angular/core';
2
+ import { ɵɵdefineInjectable, Injectable, ɵɵinject, ViewChild, ViewContainerRef, Component, Directive, forwardRef, EventEmitter, Input, Output, Inject, ElementRef, HostListener, Pipe, PLATFORM_ID, Optional, NgModule } from '@angular/core';
3
3
  import { HttpHeaders, HttpClient } from '@angular/common/http';
4
4
  import { ToastrService } from 'ngx-toastr';
5
5
  import { map, catchError, flatMap } from 'rxjs/operators';
@@ -1214,68 +1214,19 @@ QueryService = __decorate([
1214
1214
  ToastrService, AppService, UtilityService])
1215
1215
  ], QueryService);
1216
1216
 
1217
- /**
1218
- * Add support of "[(ngModel)]"
1219
- * HOW TO:
1220
- *
1221
- * 1. ADD: providers: [
1222
- * {provide: NG_VALUE_ACCESSOR, useExisting: FHAutoCompleteComponent, multi: true},
1223
- * ]
1224
- * 2. ADD: extends FHValueAccessor<any>
1225
- * 3. ADD: constructor() { super(); }
1226
- * 4. Add: (if not exists) getValue(){...} AND setValue(value){...}
1227
- * 5. ADD: (!!!) this.emitChanged(); (!!!) call this when you have value changed by user
1228
- *
1229
- * 6 (optional) add: @Output() change: EventEmitter<any> = new EventEmitter();
1230
- * 7 (optional) add: this.change.emit(this.getValue());
1231
- *
1232
- * Read more:
1233
- * https://blog.rangle.io/angular-2-ngmodel-and-custom-form-components/
1234
- * https://material.angular.io/guide/creating-a-custom-form-field-control#implementing-the-methods-and-properties-of-matformfieldcontrol
1235
- */
1236
- class FHValueAccessor {
1237
- constructor() {
1238
- // implement 'ControlValueAccessor
1239
- this.changed = [];
1240
- this.touched = [];
1241
- }
1242
- /**
1243
- * call this when you have value changed by user
1244
- */
1245
- emitChanged() {
1246
- const value = this.getValue();
1247
- this.changed.forEach(f => f(value));
1248
- }
1249
- get value() {
1250
- return this.getValue();
1251
- }
1252
- set value(value) {
1253
- if (this.getValue() !== value) {
1254
- this.setValue(value);
1255
- this.changed.forEach(f => f(value));
1256
- }
1257
- }
1258
- writeValue(value) {
1259
- this.setValue(value);
1260
- }
1261
- touch() {
1262
- this.touched.forEach(f => f());
1263
- }
1264
- registerOnChange(fn) {
1265
- this.changed.push(fn);
1266
- }
1267
- registerOnTouched(fn) {
1268
- this.touched.push(fn);
1269
- }
1270
- } // -
1271
-
1272
- var FHTimePickerComponent_1;
1273
- let FHTimePickerComponent = FHTimePickerComponent_1 = class FHTimePickerComponent extends FHValueAccessor {
1217
+ const noop = () => {
1218
+ };
1219
+ const ɵ0 = noop;
1220
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
1221
+ provide: NG_VALUE_ACCESSOR,
1222
+ useExisting: forwardRef(() => FHTimePickerComponent),
1223
+ multi: true
1224
+ };
1225
+ let FHTimePickerComponent = class FHTimePickerComponent {
1274
1226
  /**
1275
1227
  *
1276
1228
  */
1277
1229
  constructor(_dataService, dialog, m_appService, toastr, uti_s) {
1278
- super();
1279
1230
  this._dataService = _dataService;
1280
1231
  this.dialog = dialog;
1281
1232
  this.m_appService = m_appService;
@@ -1290,6 +1241,10 @@ let FHTimePickerComponent = FHTimePickerComponent_1 = class FHTimePickerComponen
1290
1241
  this.h = 0;
1291
1242
  this.m = 0;
1292
1243
  this.res = "";
1244
+ this.onChange = (_) => {
1245
+ };
1246
+ this.onTouched = () => {
1247
+ };
1293
1248
  }
1294
1249
  uph() {
1295
1250
  if (this.h < this.maxore) {
@@ -1380,8 +1335,7 @@ let FHTimePickerComponent = FHTimePickerComponent_1 = class FHTimePickerComponen
1380
1335
  this.h = parseInt(a[0]);
1381
1336
  this.m = parseInt(a[1]);
1382
1337
  if (desc_val.length != 5) {
1383
- // it will make ngModel assign value with the padding
1384
- this.emitChanged();
1338
+ this.onChange(this.getValue());
1385
1339
  }
1386
1340
  }
1387
1341
  isValidVal() {
@@ -1419,7 +1373,7 @@ let FHTimePickerComponent = FHTimePickerComponent_1 = class FHTimePickerComponen
1419
1373
  .selchange
1420
1374
  .emit();
1421
1375
  this.ngChange.emit(value);
1422
- this.emitChanged();
1376
+ this.onChange(value);
1423
1377
  }
1424
1378
  isCharNumeric(charStr) {
1425
1379
  return !!/\d/.test(charStr);
@@ -1442,6 +1396,15 @@ let FHTimePickerComponent = FHTimePickerComponent_1 = class FHTimePickerComponen
1442
1396
  return false;
1443
1397
  }
1444
1398
  }
1399
+ writeValue(value) {
1400
+ this.setByValue(value);
1401
+ }
1402
+ registerOnChange(fn) {
1403
+ this.onChange = fn;
1404
+ }
1405
+ registerOnTouched(fn) {
1406
+ this.onTouched = fn;
1407
+ }
1445
1408
  }; // -
1446
1409
  FHTimePickerComponent.ctorParameters = () => [
1447
1410
  { type: QueryService },
@@ -1470,9 +1433,10 @@ __decorate([
1470
1433
  Output('change'),
1471
1434
  __metadata("design:type", EventEmitter)
1472
1435
  ], FHTimePickerComponent.prototype, "ngChange", void 0);
1473
- FHTimePickerComponent = FHTimePickerComponent_1 = __decorate([
1436
+ FHTimePickerComponent = __decorate([
1474
1437
  Component({
1475
1438
  selector: 'FHTimePicker',
1439
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
1476
1440
  template: `
1477
1441
  <div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b>&nbsp;&nbsp;
1478
1442
  <div fxLayout="column" fxLayoutAlign="center center">
@@ -1504,9 +1468,6 @@ FHTimePickerComponent = FHTimePickerComponent_1 = __decorate([
1504
1468
  </div>
1505
1469
  </div>
1506
1470
  `,
1507
- providers: [
1508
- { provide: NG_VALUE_ACCESSOR, useExisting: FHTimePickerComponent_1, multi: true },
1509
- ],
1510
1471
  styles: [`
1511
1472
  .hhh {
1512
1473
  height: 63px;
@@ -1966,10 +1927,16 @@ WinWait = __decorate([
1966
1927
  __metadata("design:paramtypes", [MatDialogRef, ToastrService, AppService])
1967
1928
  ], WinWait);
1968
1929
 
1969
- var FHComboboxComponent_1;
1970
- let FHComboboxComponent = FHComboboxComponent_1 = class FHComboboxComponent extends FHValueAccessor {
1930
+ const noop$1 = () => {
1931
+ };
1932
+ const ɵ0$1 = noop$1;
1933
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 = {
1934
+ provide: NG_VALUE_ACCESSOR,
1935
+ useExisting: forwardRef(() => FHComboboxComponent),
1936
+ multi: true
1937
+ };
1938
+ let FHComboboxComponent = class FHComboboxComponent {
1971
1939
  constructor(_dataService, _dataService_odbc) {
1972
- super();
1973
1940
  this._dataService = _dataService;
1974
1941
  this._dataService_odbc = _dataService_odbc;
1975
1942
  this.init_fill = true;
@@ -1991,6 +1958,10 @@ let FHComboboxComponent = FHComboboxComponent_1 = class FHComboboxComponent exte
1991
1958
  this.db_type = "1";
1992
1959
  this.dis_value = '';
1993
1960
  this.descri_val = "";
1961
+ this.onChange = (_) => {
1962
+ };
1963
+ this.onTouched = () => {
1964
+ };
1994
1965
  }
1995
1966
  setValue(desc_val) {
1996
1967
  this.setByValue(desc_val);
@@ -2238,6 +2209,7 @@ let FHComboboxComponent = FHComboboxComponent_1 = class FHComboboxComponent exte
2238
2209
  });
2239
2210
  }
2240
2211
  sc() {
2212
+ this.onChange(this.getValue());
2241
2213
  this
2242
2214
  .selchange
2243
2215
  .emit({ event: this.getObj(), valore: this.getValue(), descrizione_valore: this.getDescri() });
@@ -2246,21 +2218,14 @@ let FHComboboxComponent = FHComboboxComponent_1 = class FHComboboxComponent exte
2246
2218
  const value = this.getData('valore');
2247
2219
  return value;
2248
2220
  }
2249
- emitChanged() {
2250
- const value = this.getModelValue();
2251
- this.changed.forEach(f => f(value));
2252
- }
2253
- get value() {
2254
- return this.getModelValue();
2221
+ writeValue(value) {
2222
+ this.setByValue(value);
2255
2223
  }
2256
- set value(value) {
2257
- if (this.getModelValue() !== value) {
2258
- this.setByValue(value);
2259
- this.changed.forEach(f => f(value));
2260
- }
2224
+ registerOnChange(fn) {
2225
+ this.onChange = fn;
2261
2226
  }
2262
- writeValue(value) {
2263
- this.setValue(value);
2227
+ registerOnTouched(fn) {
2228
+ this.onTouched = fn;
2264
2229
  }
2265
2230
  };
2266
2231
  FHComboboxComponent.ctorParameters = () => [
@@ -2327,9 +2292,11 @@ __decorate([
2327
2292
  Input(),
2328
2293
  __metadata("design:type", String)
2329
2294
  ], FHComboboxComponent.prototype, "db_type", void 0);
2330
- FHComboboxComponent = FHComboboxComponent_1 = __decorate([
2295
+ FHComboboxComponent = __decorate([
2331
2296
  Component({
2332
- selector: 'FHComboBox', template: `
2297
+ selector: 'FHComboBox',
2298
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1],
2299
+ template: `
2333
2300
  <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
2334
2301
  <mat-select #cmb [(ngModel)]="selval" (selectionChange)="sc()" [required]="required">
2335
2302
  <mat-option value="-1">{{sel_label}}</mat-option>
@@ -2341,9 +2308,6 @@ FHComboboxComponent = FHComboboxComponent_1 = __decorate([
2341
2308
  <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="dis_value">
2342
2309
  </mat-form-field>
2343
2310
  `,
2344
- providers: [
2345
- { provide: NG_VALUE_ACCESSOR, useExisting: FHComboboxComponent_1, multi: true },
2346
- ],
2347
2311
  styles: [`
2348
2312
 
2349
2313
  `]
@@ -3261,7 +3225,6 @@ let FHUploadPanelComponent = class FHUploadPanelComponent {
3261
3225
  }, 700);
3262
3226
  this.upc.single = false;
3263
3227
  this.b_mobile = this._appservice.getState().pageFullscreen;
3264
- console.log('this.m_p_tipo ', this.m_p_tipo);
3265
3228
  this
3266
3229
  .upc
3267
3230
  .init(this.App, this.K, 'Descrizione Allegato', this.m_p_tipo, this.m_programma_da_eseguire);
@@ -4309,7 +4272,7 @@ win_riassegna_select_user = __decorate([
4309
4272
  __metadata("design:paramtypes", [MatDialogRef, AppService, ToastrService, QueryService])
4310
4273
  ], win_riassegna_select_user);
4311
4274
 
4312
- const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
4275
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 = {
4313
4276
  provide: NG_VALUE_ACCESSOR,
4314
4277
  useExisting: forwardRef(() => FHUserFieldComponent),
4315
4278
  multi: true
@@ -4554,7 +4517,7 @@ __decorate([
4554
4517
  ], FHUserFieldComponent.prototype, "userName", void 0);
4555
4518
  FHUserFieldComponent = __decorate([
4556
4519
  Component({
4557
- selector: 'FHUserField', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
4520
+ selector: 'FHUserField', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2],
4558
4521
  template: `
4559
4522
  <div fxLayout="row" [hidden]="!enabled || hidden">
4560
4523
  <mat-form-field style="clickable-field" (click)="open_pick()" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
@@ -7045,10 +7008,16 @@ FHGridComponent = __decorate([
7045
7008
  __metadata("design:paramtypes", [GridService, ToastrService, QueryService, AppService, SlimLoadingBarService, MatDialog, UtilityService, OfficeAutomatorService, FileService])
7046
7009
  ], FHGridComponent);
7047
7010
 
7048
- var FHAutoCompleteComponent_1;
7049
- let FHAutoCompleteComponent = FHAutoCompleteComponent_1 = class FHAutoCompleteComponent extends FHValueAccessor {
7011
+ const noop$2 = () => {
7012
+ };
7013
+ const ɵ0$2 = noop$2;
7014
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3 = {
7015
+ provide: NG_VALUE_ACCESSOR,
7016
+ useExisting: forwardRef(() => FHAutoCompleteComponent),
7017
+ multi: true
7018
+ };
7019
+ let FHAutoCompleteComponent = class FHAutoCompleteComponent {
7050
7020
  constructor(_dataService, _dataService_odbc) {
7051
- super();
7052
7021
  this._dataService = _dataService;
7053
7022
  this._dataService_odbc = _dataService_odbc;
7054
7023
  this.init_fill = true; //automatic load data from database default is true
@@ -7074,6 +7043,10 @@ let FHAutoCompleteComponent = FHAutoCompleteComponent_1 = class FHAutoCompleteCo
7074
7043
  this.errorMsg = "";
7075
7044
  this.valDef = "";
7076
7045
  this.table_hidden = true;
7046
+ this.onChange = (_) => {
7047
+ };
7048
+ this.onTouched = () => {
7049
+ };
7077
7050
  }
7078
7051
  fi_search() {
7079
7052
  if (this.sItem == null) {
@@ -7082,11 +7055,15 @@ let FHAutoCompleteComponent = FHAutoCompleteComponent_1 = class FHAutoCompleteCo
7082
7055
  }
7083
7056
  }
7084
7057
  fo_search(o) {
7058
+ setTimeout(() => {
7059
+ this.onChange(this.sItem);
7060
+ this.change.emit(this.sItem);
7061
+ });
7085
7062
  this
7086
7063
  .focusout
7087
7064
  .emit();
7088
7065
  }
7089
- onChange(e) {
7066
+ onChange_up(e) {
7090
7067
  // console.log('onChange()');
7091
7068
  this.searchItemsFiltered = [];
7092
7069
  if (this.sItem != null) {
@@ -7128,7 +7105,7 @@ let FHAutoCompleteComponent = FHAutoCompleteComponent_1 = class FHAutoCompleteCo
7128
7105
  this
7129
7106
  .change
7130
7107
  .emit(value);
7131
- this.emitChanged();
7108
+ this.onChange(value);
7132
7109
  }
7133
7110
  myListFormatter(data) {
7134
7111
  return data['descrizione_valore'];
@@ -7327,27 +7304,16 @@ let FHAutoCompleteComponent = FHAutoCompleteComponent_1 = class FHAutoCompleteCo
7327
7304
  .emit();
7328
7305
  });
7329
7306
  }
7330
- /// override some FHValueAccessor implementation
7331
- /**
7332
- * call this when you have value changed by user
7333
- */
7334
- emitChanged() {
7335
- const value = this.getModelValue();
7336
- this.changed.forEach(f => f(value));
7337
- }
7338
- get value() {
7339
- return this.getModelValue();
7340
- }
7341
- set value(value) {
7342
- if (this.getModelValue() !== value) {
7343
- this.setValue(value);
7344
- this.changed.forEach(f => f(value));
7345
- }
7346
- }
7347
7307
  writeValue(value) {
7348
7308
  this.setValue(value);
7349
7309
  }
7350
- }; //
7310
+ registerOnChange(fn) {
7311
+ this.onChange = fn;
7312
+ }
7313
+ registerOnTouched(fn) {
7314
+ this.onTouched = fn;
7315
+ }
7316
+ };
7351
7317
  FHAutoCompleteComponent.ctorParameters = () => [
7352
7318
  { type: QueryService },
7353
7319
  { type: OdbcService }
@@ -7420,14 +7386,15 @@ __decorate([
7420
7386
  ViewChild('auto'),
7421
7387
  __metadata("design:type", MatAutocomplete)
7422
7388
  ], FHAutoCompleteComponent.prototype, "auto", void 0);
7423
- FHAutoCompleteComponent = FHAutoCompleteComponent_1 = __decorate([
7389
+ FHAutoCompleteComponent = __decorate([
7424
7390
  Component({
7425
7391
  selector: 'FHAutoComplete',
7392
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3],
7426
7393
  template: `
7427
7394
  <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
7428
7395
  <input matInput
7429
7396
  [disabled]="!enabled || hidden" [matAutocomplete]="auto" [required]="required"
7430
- (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search($event)"
7397
+ (keyup)="onChange_up($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search($event)"
7431
7398
  #searchp>
7432
7399
  </mat-form-field>
7433
7400
  <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)" autoActiveFirstOption >
@@ -7448,9 +7415,6 @@ FHAutoCompleteComponent = FHAutoCompleteComponent_1 = __decorate([
7448
7415
  >
7449
7416
  </mat-form-field>
7450
7417
  `,
7451
- providers: [
7452
- { provide: NG_VALUE_ACCESSOR, useExisting: FHAutoCompleteComponent_1, multi: true },
7453
- ],
7454
7418
  styles: [`
7455
7419
 
7456
7420
  `]
@@ -7630,11 +7594,17 @@ class MomentDateAdapter extends DateAdapter {
7630
7594
  }
7631
7595
  }
7632
7596
 
7633
- var FHDatePickerComponent_1;
7634
- const ɵ0 = MOMENT_DATE_FORMATS;
7635
- let FHDatePickerComponent = FHDatePickerComponent_1 = class FHDatePickerComponent extends FHValueAccessor {
7597
+ const noop$3 = () => {
7598
+ };
7599
+ const ɵ0$3 = noop$3;
7600
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$4 = {
7601
+ provide: NG_VALUE_ACCESSOR,
7602
+ useExisting: forwardRef(() => FHDatePickerComponent),
7603
+ multi: true
7604
+ };
7605
+ const ɵ1 = MOMENT_DATE_FORMATS;
7606
+ let FHDatePickerComponent = class FHDatePickerComponent {
7636
7607
  constructor(dateAdapter, uti_s) {
7637
- super();
7638
7608
  this.dateAdapter = dateAdapter;
7639
7609
  this.uti_s = uti_s;
7640
7610
  this.label = '';
@@ -7647,6 +7617,10 @@ let FHDatePickerComponent = FHDatePickerComponent_1 = class FHDatePickerComponen
7647
7617
  this.v_view = this.uti_s.date2String(new Date());
7648
7618
  this.date_sel = null;
7649
7619
  this.v_date_sel = "";
7620
+ this.onChange = (_) => {
7621
+ };
7622
+ this.onTouched = () => {
7623
+ };
7650
7624
  this.dateAdapter.setLocale('it-IT');
7651
7625
  }
7652
7626
  checkInput(ob) {
@@ -7698,8 +7672,8 @@ let FHDatePickerComponent = FHDatePickerComponent_1 = class FHDatePickerComponen
7698
7672
  monthLabels: { 1: 'Gen', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'Mag', 6: 'Giu', 7: 'Lug', 8: 'Ago', 9: 'Set', 10: 'Ott', 11: 'Nov', 12: 'Dic' }
7699
7673
  };*/
7700
7674
  ch(event) {
7675
+ this.onChange(this.getValue());
7701
7676
  this.change.emit(this.getValue());
7702
- this.emitChanged();
7703
7677
  }
7704
7678
  setFocus() {
7705
7679
  this.pickerId.nativeElement.focus();
@@ -7760,10 +7734,23 @@ let FHDatePickerComponent = FHDatePickerComponent_1 = class FHDatePickerComponen
7760
7734
  d = new Date(d.value);
7761
7735
  }
7762
7736
  }
7737
+ if (d.getFullYear() == 1970) {
7738
+ this.date_sel = null;
7739
+ return;
7740
+ }
7763
7741
  let dtp = new MomentDateAdapter();
7764
7742
  this.date_sel = dtp.createDate(d.getFullYear(), d.getMonth(), d.getDate());
7765
7743
  this.v_view = this.uti_s.date2String(this.getValue());
7766
7744
  }
7745
+ writeValue(value) {
7746
+ this.setValue(value);
7747
+ }
7748
+ registerOnChange(fn) {
7749
+ this.onChange = fn;
7750
+ }
7751
+ registerOnTouched(fn) {
7752
+ this.onTouched = fn;
7753
+ }
7767
7754
  };
7768
7755
  FHDatePickerComponent.ctorParameters = () => [
7769
7756
  { type: DateAdapter },
@@ -7801,13 +7788,12 @@ __decorate([
7801
7788
  ViewChild('pickerId'),
7802
7789
  __metadata("design:type", ElementRef)
7803
7790
  ], FHDatePickerComponent.prototype, "pickerId", void 0);
7804
- FHDatePickerComponent = FHDatePickerComponent_1 = __decorate([
7791
+ FHDatePickerComponent = __decorate([
7805
7792
  Component({
7806
7793
  selector: 'FHDatePicker',
7807
- providers: [
7808
- { provide: MAT_DATE_FORMATS, useValue: ɵ0 },
7794
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$4,
7795
+ { provide: MAT_DATE_FORMATS, useValue: ɵ1 },
7809
7796
  { provide: DateAdapter, useClass: MomentDateAdapter },
7810
- { provide: NG_VALUE_ACCESSOR, useExisting: FHDatePickerComponent_1, multi: true },
7811
7797
  { provide: MAT_DATE_LOCALE, useValue: 'it-IT' },
7812
7798
  ],
7813
7799
  template: `
@@ -7850,10 +7836,16 @@ FHDatePickerComponent = FHDatePickerComponent_1 = __decorate([
7850
7836
  __metadata("design:paramtypes", [DateAdapter, UtilityService])
7851
7837
  ], FHDatePickerComponent);
7852
7838
 
7853
- var FHTextInput_1;
7854
- let FHTextInput = FHTextInput_1 = class FHTextInput extends FHValueAccessor {
7839
+ const noop$4 = () => {
7840
+ };
7841
+ const ɵ0$4 = noop$4;
7842
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5 = {
7843
+ provide: NG_VALUE_ACCESSOR,
7844
+ useExisting: forwardRef(() => FHTextInput),
7845
+ multi: true
7846
+ };
7847
+ let FHTextInput = class FHTextInput {
7855
7848
  constructor() {
7856
- super();
7857
7849
  this.hidden = false;
7858
7850
  this.label = "";
7859
7851
  this.enabled = true;
@@ -7862,6 +7854,10 @@ let FHTextInput = FHTextInput_1 = class FHTextInput extends FHValueAccessor {
7862
7854
  this.focusout = new EventEmitter();
7863
7855
  this.focusin = new EventEmitter();
7864
7856
  this.text_v = '';
7857
+ this.onChange = (_) => {
7858
+ };
7859
+ this.onTouched = () => {
7860
+ };
7865
7861
  }
7866
7862
  onFi() {
7867
7863
  setTimeout(() => {
@@ -7875,35 +7871,19 @@ let FHTextInput = FHTextInput_1 = class FHTextInput extends FHValueAccessor {
7875
7871
  }
7876
7872
  modelch() {
7877
7873
  setTimeout(() => {
7874
+ this.onChange(this.text_v);
7878
7875
  this.change.emit(this.text_v);
7879
7876
  });
7880
7877
  }
7881
7878
  ngAfterViewInit() { }
7882
- getValue() {
7883
- return this.text_v;
7884
- }
7885
- setValue(v) {
7886
- this.text_v = v;
7887
- }
7888
- getModelValue() {
7889
- const value = this.text_v;
7890
- return value;
7891
- }
7892
- emitChanged() {
7893
- const value = this.getModelValue();
7894
- this.changed.forEach(f => f(value));
7895
- }
7896
- get value() {
7897
- return this.getModelValue();
7879
+ writeValue(value) {
7880
+ this.text_v = value;
7898
7881
  }
7899
- set value(value) {
7900
- if (this.getModelValue() !== value) {
7901
- this.text_v = value;
7902
- this.changed.forEach(f => f(value));
7903
- }
7882
+ registerOnChange(fn) {
7883
+ this.onChange = fn;
7904
7884
  }
7905
- writeValue(value) {
7906
- this.setValue(value);
7885
+ registerOnTouched(fn) {
7886
+ this.onTouched = fn;
7907
7887
  }
7908
7888
  };
7909
7889
  __decorate([
@@ -7934,19 +7914,15 @@ __decorate([
7934
7914
  Output(),
7935
7915
  __metadata("design:type", EventEmitter)
7936
7916
  ], FHTextInput.prototype, "focusin", void 0);
7937
- FHTextInput = FHTextInput_1 = __decorate([
7917
+ FHTextInput = __decorate([
7938
7918
  Component({
7939
7919
  selector: 'FHTextInput',
7920
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5],
7940
7921
  template: `
7941
7922
  <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
7942
7923
  <input matInput type="text" [(ngModel)]="text_v" [disabled]="!enabled" [required]="required" (focusout)="onFu()" (focusin)="onFi()" (ngModelChange)="modelch()">
7943
7924
  </mat-form-field>
7944
7925
  `,
7945
- providers: [{
7946
- provide: NG_VALUE_ACCESSOR,
7947
- useExisting: FHTextInput_1,
7948
- multi: true
7949
- },],
7950
7926
  styles: [`
7951
7927
 
7952
7928
  `]
@@ -8944,10 +8920,10 @@ FHLogPanelComponent = __decorate([
8944
8920
  __metadata("design:paramtypes", [UtilityService])
8945
8921
  ], FHLogPanelComponent);
8946
8922
 
8947
- const noop = () => {
8923
+ const noop$5 = () => {
8948
8924
  };
8949
- const ɵ0$1 = noop;
8950
- const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 = {
8925
+ const ɵ0$5 = noop$5;
8926
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6 = {
8951
8927
  provide: NG_VALUE_ACCESSOR,
8952
8928
  useExisting: forwardRef(() => FHCurrencyFieldComponent),
8953
8929
  multi: true
@@ -9105,7 +9081,7 @@ __decorate([
9105
9081
  FHCurrencyFieldComponent = __decorate([
9106
9082
  Component({
9107
9083
  selector: 'FHCurrencyField',
9108
- providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1],
9084
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6],
9109
9085
  template: `
9110
9086
  <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
9111
9087
  <input type="text" style="text-align:right" #el matInput
@@ -9127,9 +9103,9 @@ FHCurrencyFieldComponent = __decorate([
9127
9103
  __metadata("design:paramtypes", [])
9128
9104
  ], FHCurrencyFieldComponent);
9129
9105
 
9130
- const noop$1 = () => {
9106
+ const noop$6 = () => {
9131
9107
  };
9132
- const ɵ0$2 = noop$1;
9108
+ const ɵ0$6 = noop$6;
9133
9109
  const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_RT = {
9134
9110
  provide: NG_VALUE_ACCESSOR,
9135
9111
  useExisting: forwardRef(() => FHRichText),
@@ -9315,9 +9291,9 @@ WinOutputComponent = __decorate([
9315
9291
  __metadata("design:paramtypes", [MatDialogRef, ToastrService])
9316
9292
  ], WinOutputComponent);
9317
9293
 
9318
- const noop$2 = () => {
9294
+ const noop$7 = () => {
9319
9295
  };
9320
- const ɵ0$3 = noop$2;
9296
+ const ɵ0$7 = noop$7;
9321
9297
  const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC = {
9322
9298
  provide: NG_VALUE_ACCESSOR,
9323
9299
  useExisting: forwardRef(() => FHNumericFieldComponent),
@@ -14578,7 +14554,7 @@ SafePipe = __decorate([
14578
14554
  __metadata("design:paramtypes", [DomSanitizer])
14579
14555
  ], SafePipe);
14580
14556
 
14581
- const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 = {
14557
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 = {
14582
14558
  provide: NG_VALUE_ACCESSOR,
14583
14559
  useExisting: forwardRef(() => FHFieldPickListComponent),
14584
14560
  multi: true
@@ -14702,7 +14678,7 @@ __decorate([
14702
14678
  ], FHFieldPickListComponent.prototype, "value", void 0);
14703
14679
  FHFieldPickListComponent = __decorate([
14704
14680
  Component({
14705
- providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2],
14681
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7],
14706
14682
  selector: 'FHFieldPickList', template: `
14707
14683
  <div fxLayout="row" style="width: 100%" fxLayoutAlign="start center" [hidden]="hidden"><div style="width: 100%">
14708
14684
  <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
@@ -15883,10 +15859,16 @@ FHHelpButton = __decorate([
15883
15859
  __metadata("design:paramtypes", [QueryService, ToastrService])
15884
15860
  ], FHHelpButton);
15885
15861
 
15886
- var FHCheckBox_1;
15887
- let FHCheckBox = FHCheckBox_1 = class FHCheckBox extends FHValueAccessor {
15862
+ const noop$8 = () => {
15863
+ };
15864
+ const ɵ0$8 = noop$8;
15865
+ const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8 = {
15866
+ provide: NG_VALUE_ACCESSOR,
15867
+ useExisting: forwardRef(() => FHCheckBox),
15868
+ multi: true
15869
+ };
15870
+ let FHCheckBox = class FHCheckBox {
15888
15871
  constructor() {
15889
- super();
15890
15872
  this.hidden = false;
15891
15873
  this.label = "";
15892
15874
  this.enabled = true;
@@ -15894,15 +15876,20 @@ let FHCheckBox = FHCheckBox_1 = class FHCheckBox extends FHValueAccessor {
15894
15876
  this.change = new EventEmitter();
15895
15877
  this.click = new EventEmitter();
15896
15878
  this.value_b = false;
15879
+ this.onChange = (_) => {
15880
+ };
15881
+ this.onTouched = () => {
15882
+ };
15897
15883
  }
15898
15884
  onCl() {
15899
15885
  setTimeout(() => {
15900
- this.click.emit(this.value_b);
15886
+ this.click.emit(this.value_b ? 1 : 0);
15901
15887
  });
15902
15888
  }
15903
15889
  modelch() {
15904
15890
  setTimeout(() => {
15905
- this.change.emit(this.value_b);
15891
+ this.onChange(this.value_b ? 1 : 0);
15892
+ this.change.emit(this.value_b ? 1 : 0);
15906
15893
  });
15907
15894
  }
15908
15895
  ngAfterViewInit() { }
@@ -15912,10 +15899,7 @@ let FHCheckBox = FHCheckBox_1 = class FHCheckBox extends FHValueAccessor {
15912
15899
  else
15913
15900
  return 0;
15914
15901
  }
15915
- getValue() {
15916
- return this.getModelValue();
15917
- }
15918
- setValue(value) {
15902
+ writeValue(value) {
15919
15903
  if (this.getModelValue() !== value) {
15920
15904
  if (value != null)
15921
15905
  if (value == 1)
@@ -15924,25 +15908,11 @@ let FHCheckBox = FHCheckBox_1 = class FHCheckBox extends FHValueAccessor {
15924
15908
  this.value_b = false;
15925
15909
  }
15926
15910
  }
15927
- emitChanged() {
15928
- const value = this.getModelValue();
15929
- this.changed.forEach(f => f(value));
15930
- }
15931
- get value() {
15932
- return this.getModelValue();
15933
- }
15934
- set value(value) {
15935
- if (this.getModelValue() !== value) {
15936
- if (value != null)
15937
- if (value == 1)
15938
- this.value_b = true;
15939
- else
15940
- this.value_b = false;
15941
- this.changed.forEach(f => f(value));
15942
- }
15911
+ registerOnChange(fn) {
15912
+ this.onChange = fn;
15943
15913
  }
15944
- writeValue(value) {
15945
- this.setValue(value);
15914
+ registerOnTouched(fn) {
15915
+ this.onTouched = fn;
15946
15916
  }
15947
15917
  };
15948
15918
  __decorate([
@@ -15969,19 +15939,15 @@ __decorate([
15969
15939
  Output(),
15970
15940
  __metadata("design:type", EventEmitter)
15971
15941
  ], FHCheckBox.prototype, "click", void 0);
15972
- FHCheckBox = FHCheckBox_1 = __decorate([
15942
+ FHCheckBox = __decorate([
15973
15943
  Component({
15974
15944
  selector: 'FHCheckBox',
15945
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8],
15975
15946
  template: `
15976
15947
 
15977
15948
  <mat-checkbox [(ngModel)]="value_b" (click)="onCl()" [disabled]="!enabled" [required]="required" (ngModelChange)="modelch()">{{label}}
15978
15949
  </mat-checkbox>
15979
15950
  `,
15980
- providers: [{
15981
- provide: NG_VALUE_ACCESSOR,
15982
- useExisting: FHCheckBox_1,
15983
- multi: true
15984
- },],
15985
15951
  styles: [`
15986
15952
 
15987
15953
  `]
@@ -16246,5 +16212,5 @@ class FSResult {
16246
16212
  * Generated bundle index. Do not edit.
16247
16213
  */
16248
16214
 
16249
- export { AppMakerService, AppService, ApprovaGridComponent, AuthenticationService, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHComboboxComponent, FHConfirmComponent, FHConfirmValues, FHCurrencyFieldComponent, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHFieldPickListComponent, FHGridComponent, FHGridJSONComponent, FHGuard, FHListComponent, FHListPick, FHLogPanelComponent, FHMdReader, FHNumericFieldComponent, FHPickListComponent, FHRichText, FHRoleManager, FHTableManager, FHTextInput, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUserFieldComponent, FHUserPickerComponent, FHWinComboSelect, FSInput, FSResult, FileService, FluxhubLibModule, FormBuilderComponent, FormExecuterComponent, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, TextAreaEditor, UtilityService, WinAskButtonsComponent, WinAskNumberComponent, WinAskTextBigComponent, WinAskTextComponent, WinOutputComponent, WinWait, WkfService, dati_aggiuntivi, fhimagepreview, win_insert_commento, win_mappa, win_salva_annulla, win_show_image, win_time_slider, win_user_info, wkf_header_bar, wkfapp, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as ɵa, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 as ɵb, win_riassegna_select_user as ɵba, win_sostituisci_utente as ɵbb, win_commento_sel_notif as ɵbc, win_manage_values as ɵbd, win_manage_roles as ɵbe, FHComboboxComponentFilter as ɵbf, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC as ɵc, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_RT as ɵd, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR as ɵe, FHValueAccessor as ɵf, FHHelpButton as ɵg, SafePipe as ɵh, DecimalMask as ɵi, MOMENT_DATE_FORMATS as ɵj, MomentDateAdapter as ɵk, win_grid_help as ɵl, HighlightService as ɵm, FHViewerComponent as ɵn, FHGridToolBarComponent as ɵp, win_assegna as ɵq, win_conferma as ɵr, win_select_canale as ɵs, win_select_level as ɵt, win_uploads as ɵu, win_commenti as ɵv, win_info_doc as ɵw, win_log as ɵx, win_recupera_doc as ɵy, win_riassegna_select_level as ɵz };
16215
+ export { AppMakerService, AppService, ApprovaGridComponent, AuthenticationService, ComboBoxEditor, CurrencyComponent, FHAutoCompleteComponent, FHCheckBox, FHComboboxComponent, FHConfirmComponent, FHConfirmValues, FHCurrencyFieldComponent, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHFieldPickListComponent, FHGridComponent, FHGridJSONComponent, FHGuard, FHListComponent, FHListPick, FHLogPanelComponent, FHMdReader, FHNumericFieldComponent, FHPickListComponent, FHRichText, FHRoleManager, FHTableManager, FHTextInput, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUserFieldComponent, FHUserPickerComponent, FHWinComboSelect, FSInput, FSResult, FileService, FluxhubLibModule, FormBuilderComponent, FormExecuterComponent, GridService, LocalDBService, NumericEditorComponent, OdbcService, OfficeAutomatorService, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, TextAreaEditor, UtilityService, WinAskButtonsComponent, WinAskNumberComponent, WinAskTextBigComponent, WinAskTextComponent, WinOutputComponent, WinWait, WkfService, dati_aggiuntivi, fhimagepreview, win_insert_commento, win_mappa, win_salva_annulla, win_show_image, win_time_slider, win_user_info, wkf_header_bar, wkfapp, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 as ɵa, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3 as ɵb, win_commenti as ɵba, win_info_doc as ɵbb, win_log as ɵbc, win_recupera_doc as ɵbd, win_riassegna_select_level as ɵbe, win_riassegna_select_user as ɵbf, win_sostituisci_utente as ɵbg, win_commento_sel_notif as ɵbh, win_manage_values as ɵbi, win_manage_roles as ɵbj, FHComboboxComponentFilter as ɵbk, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 as ɵc, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6 as ɵd, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$4 as ɵe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC as ɵf, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_RT as ɵg, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR as ɵh, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as ɵi, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5 as ɵj, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8 as ɵk, FHHelpButton as ɵl, SafePipe as ɵm, DecimalMask as ɵn, MOMENT_DATE_FORMATS as ɵo, MomentDateAdapter as ɵp, win_grid_help as ɵq, HighlightService as ɵr, FHViewerComponent as ɵs, FHGridToolBarComponent as ɵu, win_assegna as ɵv, win_conferma as ɵw, win_select_canale as ɵx, win_select_level as ɵy, win_uploads as ɵz };
16250
16216
  //# sourceMappingURL=fluxhub-fluxhub-lib.js.map