@fluxhub/fluxhub-lib 9.0.117 → 9.0.119

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 (31) hide show
  1. package/bundles/fluxhub-fluxhub-lib.umd.js +92 -45
  2. package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
  3. package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
  4. package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
  5. package/esm2015/lib/controls/fhcurrencyfield.js +83 -41
  6. package/esm2015/lib/controls/fhdatepicker.js +2 -2
  7. package/esm2015/lib/controls/fhgrid.js +7 -2
  8. package/esm2015/lib/controls/fhupload.js +4 -5
  9. package/esm2015/lib/services/localstorage.service.js +17 -5
  10. package/esm2015/lib/services/utility.service.js +5 -4
  11. package/esm2015/lib/wkf_engine/win_assegna.js +1 -2
  12. package/esm2015/lib/wkf_engine/win_conferma.js +16 -8
  13. package/esm2015/lib/wkf_engine/wkfdatiaggiuntivi.js +6 -5
  14. package/esm5/lib/controls/fhcurrencyfield.js +51 -30
  15. package/esm5/lib/controls/fhdatepicker.js +2 -2
  16. package/esm5/lib/controls/fhgrid.js +7 -2
  17. package/esm5/lib/controls/fhupload.js +2 -2
  18. package/esm5/lib/services/localstorage.service.js +17 -5
  19. package/esm5/lib/services/utility.service.js +5 -4
  20. package/esm5/lib/wkf_engine/win_assegna.js +1 -2
  21. package/esm5/lib/wkf_engine/win_conferma.js +16 -8
  22. package/esm5/lib/wkf_engine/wkfdatiaggiuntivi.js +6 -5
  23. package/fesm2015/fluxhub-fluxhub-lib.js +126 -59
  24. package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
  25. package/fesm5/fluxhub-fluxhub-lib.js +92 -45
  26. package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
  27. package/fluxhub-fluxhub-lib.metadata.json +1 -1
  28. package/lib/controls/fhcurrencyfield.d.ts +5 -3
  29. package/lib/services/utility.service.d.ts +2 -3
  30. package/lib/wkf_engine/win_conferma.d.ts +2 -1
  31. package/package.json +1 -1
@@ -227,7 +227,6 @@ var UtilityService_1;
227
227
  let UtilityService = UtilityService_1 = class UtilityService {
228
228
  constructor(app_s) {
229
229
  this.app_s = app_s;
230
- this.simpleCrypt = new SimpleCrypt();
231
230
  }
232
231
  set_home_title(s) {
233
232
  setTimeout(() => { this.app_s.getState().topnavTitle = s; }, 100);
@@ -738,10 +737,12 @@ let UtilityService = UtilityService_1 = class UtilityService {
738
737
  return enc;
739
738
  }
740
739
  encrypt_v2(s) {
741
- return this.simpleCrypt.encode("prologika_fluxhub_etjda", s);
740
+ let simpleCrypt = new SimpleCrypt();
741
+ return simpleCrypt.encode("prologika_fluxhub_etjda", s);
742
742
  }
743
743
  decrypt_v2(s) {
744
- return this.simpleCrypt.decode("prologika_fluxhub_etjda", s);
744
+ let simpleCrypt = new SimpleCrypt();
745
+ return simpleCrypt.decode("prologika_fluxhub_etjda", s);
745
746
  }
746
747
  string_sqlvalue(s) {
747
748
  if (s == null)
@@ -2133,10 +2134,9 @@ FHUploadComponent = __decorate([
2133
2134
  </button>
2134
2135
  </div>
2135
2136
  </div>
2136
- <div *ngIf="!enabled" fxLayout="row">
2137
- <label>{{label}}:</label>{{descrizione}}
2138
- <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 15px;background-color: #F5F5F5">{{label_b}}</button>
2139
-
2137
+ <div *ngIf="!enabled" fxLayout="row" fxLayoutGap="10px">
2138
+ <label>{{label}}:</label><div *ngIf="label!=descrizione">{{descrizione}}</div>
2139
+ <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 12px;background-color: #F5F5F5">{{label_b}}</button>
2140
2140
  </div>
2141
2141
 
2142
2142
  `,
@@ -6018,7 +6018,12 @@ let FHGridComponent = class FHGridComponent {
6018
6018
  for (let j = 0; j < p_col.length; j++) {
6019
6019
  if (str_fields != '')
6020
6020
  str_fields += ',';
6021
- str_fields += '[' + p_col[j].getColDef().field + '] [' + p_col[j].getColDef().headerName + ']';
6021
+ if (p_col[j].getColDef().headerName == null)
6022
+ str_fields += '[' + p_col[j].getColDef().field + ']';
6023
+ else if (p_col[j].getColDef().headerName == null)
6024
+ str_fields += '[' + p_col[j].getColDef().field + ']';
6025
+ else
6026
+ str_fields += '[' + p_col[j].getColDef().field + '] [' + p_col[j].getColDef().headerName + ']';
6022
6027
  }
6023
6028
  if (this.fields.indexOf('DISTINCT') != -1)
6024
6029
  str_fields = 'DISTINCT ' + str_fields;
@@ -8497,7 +8502,7 @@ FHDatePickerComponent = __decorate([
8497
8502
 
8498
8503
  <mat-form-field (click)="chxx($event)" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
8499
8504
  <input [disabled]="!enabled" #pickerId (dateChange)="ch($event)" (focusout)="dt_chg($event)" (keyup)="checkInput($event)"
8500
- (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" >
8505
+ [min]="min_date" [max]="max_date" (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" >
8501
8506
  <mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>
8502
8507
  <mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>
8503
8508
  </mat-form-field>
@@ -9614,32 +9619,28 @@ FHLogPanelComponent = __decorate([
9614
9619
  __metadata("design:paramtypes", [UtilityService])
9615
9620
  ], FHLogPanelComponent);
9616
9621
 
9617
- const noop$6 = () => {
9618
- };
9622
+ const noop$6 = () => { };
9619
9623
  const ɵ0$6 = noop$6;
9620
9624
  const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 = {
9621
9625
  provide: NG_VALUE_ACCESSOR,
9622
9626
  useExisting: forwardRef(() => FHCurrencyFieldComponent),
9623
- multi: true
9627
+ multi: true,
9624
9628
  };
9625
9629
  let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9626
9630
  constructor() {
9627
9631
  this.decimal = 2;
9628
- this.label = '';
9632
+ this.label = "";
9629
9633
  this.required = false;
9630
9634
  this.enabled = true;
9631
9635
  this.hidden = false;
9632
- this.color = '';
9633
- this.m_color = '';
9636
+ this.color = "";
9637
+ this.m_color = "";
9634
9638
  this.label_width = "";
9635
9639
  this.change = new EventEmitter();
9636
9640
  this.enter_pressed = new EventEmitter();
9637
- this.innerValue = 0;
9638
- this.onChange = (_) => {
9639
- };
9640
- this.onTouched = () => {
9641
- };
9642
- this.formattedAmount = '0,00';
9641
+ this.onChange = (_) => { };
9642
+ this.onTouched = () => { };
9643
+ this.formattedAmount = "0,00";
9643
9644
  this.value = 0;
9644
9645
  }
9645
9646
  kd(event) {
@@ -9647,6 +9648,14 @@ let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9647
9648
  this.enter_pressed.emit();
9648
9649
  }
9649
9650
  }
9651
+ click_select_allf(element) {
9652
+ setTimeout(() => {
9653
+ this.el.nativeElement.select();
9654
+ }, 200);
9655
+ }
9656
+ select_allf(element) {
9657
+ this.el.nativeElement.select();
9658
+ }
9650
9659
  getStyle_color() {
9651
9660
  return this.m_color;
9652
9661
  }
@@ -9658,15 +9667,23 @@ let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9658
9667
  }
9659
9668
  chg() {
9660
9669
  setTimeout(() => {
9661
- this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join('.'));
9670
+ this.value = parseFloat(this.formattedAmount.split(".").join("").split(",").join("."));
9671
+ console.log('onChange ', this.value);
9662
9672
  this.onChange(this.value);
9663
9673
  }, 50);
9664
9674
  }
9665
9675
  writeValue(value) {
9676
+ if (this.value == parseFloat(this.formattedAmount.split(".").join("").split(",").join("."))) {
9677
+ this.formattedAmount = this.transform(this.value, this.decimal);
9678
+ return;
9679
+ }
9666
9680
  if (value == null)
9667
9681
  value = 0;
9668
9682
  // if (value !== this.innerValue) {
9669
- this.innerValue = value;
9683
+ if (typeof (value) == 'string') {
9684
+ value = parseFloat(value.split(".").join("").split(",").join("."));
9685
+ }
9686
+ console.log('value ', value);
9670
9687
  this.value = value;
9671
9688
  this.formattedAmount = this.transform(this.value, this.decimal);
9672
9689
  //}
@@ -9683,7 +9700,7 @@ let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9683
9700
  // if (typeof (element.target.value) !== 'number')
9684
9701
  // this.formattedAmount = this.currencyPipe.transform(this.value);
9685
9702
  setTimeout(() => {
9686
- this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join('.'));
9703
+ this.value = parseFloat(this.formattedAmount.split(".").join("").split(",").join("."));
9687
9704
  // this.writeValue(this.value);
9688
9705
  this.formattedAmount = this.transform(this.value, this.decimal);
9689
9706
  }, 50);
@@ -9696,13 +9713,21 @@ let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9696
9713
  }
9697
9714
  }
9698
9715
  transform(value, fractionSize = 2) {
9699
- let [integer, fraction = ""] = (value || "").toString().split('.');
9700
- fraction = fractionSize > 0
9701
- ? ',' + (fraction + '000000').substring(0, fractionSize)
9702
- : "";
9703
- integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, '.');
9704
- if (integer == '')
9705
- integer = '0';
9716
+ console.log('b', typeof (value));
9717
+ if (typeof (value) == 'string') {
9718
+ value = parseFloat(value.split(".").join("").split(",").join("."));
9719
+ }
9720
+ console.log('a', typeof (value));
9721
+ let [integer, fraction = ""] = (value || "").toString().split(".");
9722
+ console.log('transform ', value);
9723
+ fraction =
9724
+ fractionSize > 0
9725
+ ? "," + (fraction + "000000").substring(0, fractionSize)
9726
+ : "";
9727
+ integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
9728
+ if (integer == "")
9729
+ integer = "0";
9730
+ console.log('transform end ', integer + fraction);
9706
9731
  return integer + fraction;
9707
9732
  }
9708
9733
  removeCurrencyPipeFormat(element) {
@@ -9729,7 +9754,7 @@ let FHCurrencyFieldComponent = class FHCurrencyFieldComponent {
9729
9754
  }
9730
9755
  };
9731
9756
  __decorate([
9732
- ViewChild('el'),
9757
+ ViewChild("el"),
9733
9758
  __metadata("design:type", ElementRef)
9734
9759
  ], FHCurrencyFieldComponent.prototype, "el", void 0);
9735
9760
  __decorate([
@@ -9774,25 +9799,47 @@ __decorate([
9774
9799
  ], FHCurrencyFieldComponent.prototype, "value", void 0);
9775
9800
  FHCurrencyFieldComponent = __decorate([
9776
9801
  Component({
9777
- selector: 'FHCurrencyField',
9802
+ selector: "FHCurrencyField",
9778
9803
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7],
9779
9804
  template: `
9780
- <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
9781
- <input type="text" style="text-align:right" #el matInput
9782
- [disabled]="!enabled" [(ngModel)]="formattedAmount"
9783
- (blur)="transformAmount($event)" [style.color]="getStyle_color()" (keydown)="kd($event)"
9784
- (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"
9785
- pattern="[-+]?[0-9]*[.,]?[0-9]+">
9805
+ <mat-form-field
9806
+ [hidden]="!enabled || hidden"
9807
+ appearance="outline"
9808
+ floatLabel="always"
9809
+ ><mat-label>{{ label }}</mat-label>
9810
+ <input
9811
+ type="text"
9812
+ style="text-align:right"
9813
+ #el
9814
+ matInput
9815
+ [disabled]="!enabled"
9816
+ [(ngModel)]="formattedAmount"
9817
+ (focusout)="chg()"
9818
+ [style.color]="getStyle_color()"
9819
+ (keydown)="kd($event)"
9820
+
9821
+ (click)="click_select_allf($event)"
9822
+ (focus)="removeCurrencyPipeFormat($event); select_allf($event)"
9823
+
9824
+ />
9786
9825
  </mat-form-field>
9787
- <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
9788
- <input type="text" style="text-align:right" [style.color]="getStyle_color()" #el1 matInput [disabled]="true"
9789
- [(ngModel)]="formattedAmount"
9790
- >
9826
+ <mat-form-field
9827
+ [hidden]="enabled || hidden"
9828
+ appearance="outline"
9829
+ floatLabel="always"
9830
+ ><mat-label>{{ label }}</mat-label>
9831
+ <input
9832
+ type="text"
9833
+ style="text-align:right"
9834
+ [style.color]="getStyle_color()"
9835
+ #el1
9836
+ matInput
9837
+ [disabled]="true"
9838
+ [(ngModel)]="formattedAmount"
9839
+ />
9791
9840
  </mat-form-field>
9792
9841
  `,
9793
- styles: [`
9794
-
9795
- `]
9842
+ styles: [``]
9796
9843
  }),
9797
9844
  __metadata("design:paramtypes", [])
9798
9845
  ], FHCurrencyFieldComponent);
@@ -10331,7 +10378,6 @@ let win_assegna = class win_assegna {
10331
10378
  this.nota = data.commento_default;
10332
10379
  if (data.comm_notrequired != null)
10333
10380
  this.comm_notrequired = data.comm_notrequired;
10334
- this.m_appService.temp_var4 = '';
10335
10381
  }
10336
10382
  }
10337
10383
  close() { this.dialogRef.close(null); }
@@ -10403,11 +10449,12 @@ win_assegna = __decorate([
10403
10449
  ], win_assegna);
10404
10450
 
10405
10451
  let win_conferma = class win_conferma {
10406
- constructor(dialogRef, m_appService, toastr, _dataService) {
10452
+ constructor(dialogRef, m_appService, toastr, _dataService, data) {
10407
10453
  this.dialogRef = dialogRef;
10408
10454
  this.m_appService = m_appService;
10409
10455
  this.toastr = toastr;
10410
10456
  this._dataService = _dataService;
10457
+ this.data = data;
10411
10458
  this.utenti = "";
10412
10459
  this.lbl = "";
10413
10460
  this.nota = "";
@@ -10416,13 +10463,18 @@ let win_conferma = class win_conferma {
10416
10463
  this.comm_notrequired = 0;
10417
10464
  this.mobile = false;
10418
10465
  this.comm_notrequired = this.m_appService.getState().wkf_doc_info.comm_notrequired;
10419
- console.log(' this.comm_notrequired ', this.comm_notrequired);
10420
10466
  this.title = this.m_appService.getState().wkf_doc_info.title;
10421
10467
  this.lbl = this.m_appService.getState().wkf_doc_info.lbl;
10422
10468
  this.utenti = this.m_appService.getState().wkf_doc_info.utenti;
10423
10469
  if (this.comm_notrequired == 2)
10424
10470
  this.nota_commento = " (COMMENTO NON OBBLIGATORIO)";
10425
10471
  this.mobile = this.m_appService.getState().pageFullscreen;
10472
+ if (data != null) {
10473
+ if (data.commento_default != null)
10474
+ this.nota = data.commento_default;
10475
+ if (data.comm_notrequired != null)
10476
+ this.comm_notrequired = data.comm_notrequired;
10477
+ }
10426
10478
  }
10427
10479
  ok() {
10428
10480
  if (this.comm_notrequired == 0)
@@ -10445,7 +10497,8 @@ win_conferma.ctorParameters = () => [
10445
10497
  { type: MatDialogRef },
10446
10498
  { type: AppService },
10447
10499
  { type: ToastrService },
10448
- { type: QueryService }
10500
+ { type: QueryService },
10501
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
10449
10502
  ];
10450
10503
  win_conferma = __decorate([
10451
10504
  Component({
@@ -10478,7 +10531,8 @@ win_conferma = __decorate([
10478
10531
 
10479
10532
  `
10480
10533
  }),
10481
- __metadata("design:paramtypes", [MatDialogRef, AppService, ToastrService, QueryService])
10534
+ __param(4, Inject(MAT_DIALOG_DATA)),
10535
+ __metadata("design:paramtypes", [MatDialogRef, AppService, ToastrService, QueryService, Object])
10482
10536
  ], win_conferma);
10483
10537
 
10484
10538
  let win_select_canale = class win_select_canale {
@@ -11629,7 +11683,14 @@ let LocalDBService = class LocalDBService {
11629
11683
  }
11630
11684
  if (crypt) {
11631
11685
  if (json_format) {
11632
- resolve(JSON.parse(this.uti.decrypt_v2(localStorage.getItem(key))));
11686
+ try {
11687
+ resolve(JSON.parse(this.uti.decrypt_v2(localStorage.getItem(key))));
11688
+ }
11689
+ catch (e) {
11690
+ console.log(e, 'Errore JSON ' + ' ' + this.uti.decrypt_v2(localStorage.getItem(key)));
11691
+ resolve({});
11692
+ return;
11693
+ }
11633
11694
  return;
11634
11695
  }
11635
11696
  else {
@@ -11639,7 +11700,14 @@ let LocalDBService = class LocalDBService {
11639
11700
  }
11640
11701
  else {
11641
11702
  if (json_format) {
11642
- resolve(JSON.parse('' + localStorage.getItem(key)));
11703
+ try {
11704
+ resolve(JSON.parse('' + localStorage.getItem(key)));
11705
+ }
11706
+ catch (e) {
11707
+ console.log(e, 'Errore JSON ' + localStorage.getItem(key));
11708
+ resolve({});
11709
+ return;
11710
+ }
11643
11711
  return;
11644
11712
  }
11645
11713
  else {
@@ -11647,8 +11715,6 @@ let LocalDBService = class LocalDBService {
11647
11715
  return;
11648
11716
  }
11649
11717
  }
11650
- resolve(null);
11651
- return;
11652
11718
  });
11653
11719
  }
11654
11720
  write(k, obj, crypt = true, json_format = true) {
@@ -13197,8 +13263,9 @@ class dati_aggiuntivi {
13197
13263
  this.app_s.getState().wkf_doc_info.utenti = sp;
13198
13264
  this.app_s.getState().wkf_doc_info.comm_notrequired = this.nlevel.commenti_opzionali;
13199
13265
  let dialogRef = this.m_dialog.open(win_conferma, {
13200
- disableClose: true
13266
+ disableClose: true, data: { commento_default: this.app_s.temp_var4, comm_notrequired: this.nlevel.commenti_opzionali }
13201
13267
  });
13268
+ this.app_s.temp_var4 = '';
13202
13269
  dialogRef.afterClosed().subscribe(result => {
13203
13270
  if (result == "abort") {
13204
13271
  this.edit_b(true);
@@ -13226,10 +13293,10 @@ class dati_aggiuntivi {
13226
13293
  ;
13227
13294
  if (this.app_s.temp_var4 == null)
13228
13295
  this.app_s.temp_var4 = '';
13229
- console.log('this.app_s.temp_var4 ', this.app_s.temp_var4);
13230
13296
  let dialogRef = this.m_dialog.open(win_assegna, {
13231
13297
  disableClose: true, data: { commento_default: this.app_s.temp_var4, comm_notrequired: this.nlevel.commenti_opzionali }
13232
13298
  });
13299
+ this.app_s.temp_var4 = '';
13233
13300
  dialogRef.afterClosed().subscribe(result => {
13234
13301
  if (result == "" || result == null) {
13235
13302
  this.edit_b(true);
@@ -14072,8 +14139,8 @@ class dati_aggiuntivi {
14072
14139
  console.log('min_liv ', min_liv);
14073
14140
  for (let i = 0; i < this.livs.length; i++)
14074
14141
  if (min_liv == this.livs[i].livello) {
14075
- console.log('this.user_idp.toUpperCase() ', this.user_idp.toUpperCase());
14076
- console.log('this.livs[i].idp.toUpperCase() ', this.livs[i].idp.toUpperCase());
14142
+ //console.log('this.user_idp.toUpperCase() ',this.user_idp.toUpperCase());
14143
+ //console.log('this.livs[i].idp.toUpperCase() ',this.livs[i].idp.toUpperCase() );
14077
14144
  if (this.user_idp.toUpperCase() == this.livs[i].idp.toUpperCase() || this.livs[i].gruppo_parallelo == '*ALLUSERS') {
14078
14145
  if (this.livs[i].abilita_indietro == 1)
14079
14146
  this.respingi_enabled = true;