@fluxhub/fluxhub-lib 19.0.28 → 19.0.30

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.
@@ -2464,7 +2464,7 @@ const noop$8 = () => { };
2464
2464
  const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$b = {
2465
2465
  provide: NG_VALUE_ACCESSOR,
2466
2466
  useExisting: forwardRef(() => FHAutoCompleteComponent),
2467
- multi: true
2467
+ multi: true,
2468
2468
  };
2469
2469
  class FHAutoCompleteComponent {
2470
2470
  _dataService;
@@ -2543,57 +2543,46 @@ class FHAutoCompleteComponent {
2543
2543
  setTimeout(() => {
2544
2544
  if (!this.only_from_list) {
2545
2545
  this.onChange(this.sItem);
2546
- this
2547
- .change
2548
- .emit(this.sItem);
2546
+ this.change.emit(this.sItem);
2549
2547
  }
2550
2548
  else {
2551
2549
  this.onChange(this.getValue());
2552
- this
2553
- .change
2554
- .emit(this.getValue());
2550
+ this.change.emit(this.getValue());
2555
2551
  setTimeout(() => {
2556
2552
  this.sItem = this.getDescri();
2557
2553
  }, 500);
2558
2554
  }
2559
2555
  });
2560
- this
2561
- .focusout
2562
- .emit();
2556
+ this.focusout.emit();
2563
2557
  }
2564
2558
  onChange_up(e) {
2565
2559
  // console.log('onChange()');
2566
2560
  this.searchItemsFiltered = [];
2567
2561
  if (this.sItem != null) {
2568
2562
  if (this.sItem != '') {
2569
- let ps = this
2570
- .sItem
2571
- .toLowerCase();
2563
+ let ps = this.sItem.toLowerCase();
2572
2564
  if (ps.length < this.min_length_search)
2573
2565
  return;
2574
2566
  if (this.myData != null)
2575
2567
  for (let i = 0; i < this.myData.length; i++) {
2576
2568
  if (this.myData[i].descrizione_valore != null) {
2577
- if (this.myData[i].descrizione_valore.toLowerCase().indexOf(ps) != -1) {
2578
- this
2579
- .searchItemsFiltered
2580
- .push(this.myData[i]);
2569
+ if (this.myData[i].descrizione_valore.toLowerCase().indexOf(ps) !=
2570
+ -1) {
2571
+ this.searchItemsFiltered.push(this.myData[i]);
2581
2572
  }
2582
2573
  }
2583
- if (ps.length < 4 && this.searchItemsFiltered.length == this.max_item_show) {
2574
+ if (ps.length < 4 &&
2575
+ this.searchItemsFiltered.length == this.max_item_show) {
2584
2576
  break;
2585
2577
  }
2586
2578
  }
2587
2579
  }
2588
2580
  else {
2589
- // console.log('onChange()1');
2590
2581
  if (this.min_length_search > 0)
2591
2582
  return;
2592
2583
  if (this.myData != null)
2593
2584
  for (let i = 0; i < this.myData.length; i++) {
2594
- this
2595
- .searchItemsFiltered
2596
- .push(this.myData[i]);
2585
+ this.searchItemsFiltered.push(this.myData[i]);
2597
2586
  if (i == this.max_item_show) {
2598
2587
  break;
2599
2588
  }
@@ -2602,11 +2591,8 @@ class FHAutoCompleteComponent {
2602
2591
  }
2603
2592
  }
2604
2593
  translateValue(val) {
2605
- // console.log("🚀 ~ file: fh-autocomplete.ts:196 ~ translateValue ~
2606
- // translateValue:", val)
2607
- if (!val)
2608
- return '';
2609
- if (val == '')
2594
+ console.log('🚀 ~ file: fh-autocomplete.ts:196 ~ translateValue ~ translateValue:', val);
2595
+ if ((val || '') == '')
2610
2596
  return '';
2611
2597
  if (!this.disableTranslation && this.only_from_list)
2612
2598
  return this._tsr.instant(val);
@@ -2615,18 +2601,14 @@ class FHAutoCompleteComponent {
2615
2601
  }
2616
2602
  add_option(o) {
2617
2603
  let b_found = false;
2618
- this
2619
- .myData
2620
- .map((v) => {
2604
+ this.myData.map((v) => {
2621
2605
  o.descrizione_valore = this.translateValue(o.descrizione_valore);
2622
2606
  if (v.descrizione_valore == o.descrizione_valore || v.valore == o.valore)
2623
2607
  b_found = true;
2624
2608
  });
2625
2609
  if (!b_found) {
2626
2610
  // console.log('Inserisco ',o);
2627
- this
2628
- .myData
2629
- .push(o);
2611
+ this.myData.push(o);
2630
2612
  } //else console.log('Esiste già ',o);
2631
2613
  }
2632
2614
  selectedSearchItem(event) {
@@ -2636,27 +2618,23 @@ class FHAutoCompleteComponent {
2636
2618
  }
2637
2619
  ch($event) {
2638
2620
  const value = this.getValue();
2639
- this
2640
- .selchange
2641
- .emit({
2621
+ this.selchange.emit({
2642
2622
  event: $event,
2643
2623
  valore: this.getValue(),
2644
- descrizione_valore: this.sItem
2624
+ descrizione_valore: this.sItem,
2645
2625
  });
2646
2626
  if (!this.only_from_list) {
2647
2627
  this.onChange(this.sItem);
2648
- this
2649
- .change
2650
- .emit(this.sItem);
2628
+ this.change.emit(this.sItem);
2651
2629
  }
2652
2630
  else {
2653
2631
  this.onChange(this.getValue());
2654
- this
2655
- .change
2656
- .emit(this.getValue());
2632
+ this.change.emit(this.getValue());
2657
2633
  }
2658
2634
  }
2659
- myListFormatter(data) { return data['descrizione_valore']; }
2635
+ myListFormatter(data) {
2636
+ return data['descrizione_valore'];
2637
+ }
2660
2638
  resetValue(b_res_valdef = true) {
2661
2639
  //console.log(">>>resetValue<<<");
2662
2640
  this.selval = '';
@@ -2703,26 +2681,18 @@ class FHAutoCompleteComponent {
2703
2681
  p.types = this.types;
2704
2682
  p.values = this.values;
2705
2683
  if (this.db_type == '1') {
2706
- this
2707
- ._dataService
2708
- .doQuery(p)
2709
- .subscribe((data) => {
2684
+ this._dataService.doQuery(p).subscribe((data) => {
2710
2685
  if (data != null) {
2711
2686
  if (data.result_msg == 'OK') {
2712
2687
  this.resetD(data.result_data);
2713
2688
  this.is_loaded = true;
2714
- this
2715
- .fillend
2716
- .emit();
2689
+ this.fillend.emit();
2717
2690
  }
2718
2691
  }
2719
2692
  });
2720
2693
  }
2721
2694
  if (this.db_type == '2') {
2722
- this
2723
- ._dataService_odbc
2724
- .doQuery(p)
2725
- .subscribe((data) => {
2695
+ this._dataService_odbc.doQuery(p).subscribe((data) => {
2726
2696
  let ok_op = false;
2727
2697
  if (data != null) {
2728
2698
  if (data.result_msg == 'OK') {
@@ -2736,9 +2706,7 @@ class FHAutoCompleteComponent {
2736
2706
  }
2737
2707
  this.resetD(data.result_data);
2738
2708
  this.is_loaded = true;
2739
- this
2740
- .fillend
2741
- .emit();
2709
+ this.fillend.emit();
2742
2710
  ok_op = true;
2743
2711
  }
2744
2712
  }
@@ -2762,7 +2730,8 @@ class FHAutoCompleteComponent {
2762
2730
  return;
2763
2731
  }
2764
2732
  this.setByValue(this.valDef);
2765
- if ((this.getValue() == null || this.getValue() == '') && this.valDef != '') {
2733
+ if ((this.getValue() == null || this.getValue() == '') &&
2734
+ this.valDef != '') {
2766
2735
  this.setByDescri(this.valDef);
2767
2736
  }
2768
2737
  }
@@ -2854,7 +2823,8 @@ class FHAutoCompleteComponent {
2854
2823
  }
2855
2824
  getObj() {
2856
2825
  for (let x in this.myData) {
2857
- if (this.myData[x]['descrizione_valore'] == this.selval || this.myData[x]['valore'] == this.selval) {
2826
+ if (this.myData[x]['descrizione_valore'] == this.selval ||
2827
+ this.myData[x]['valore'] == this.selval) {
2858
2828
  return this.myData[x];
2859
2829
  }
2860
2830
  }
@@ -2880,9 +2850,7 @@ class FHAutoCompleteComponent {
2880
2850
  var av = a[i].split('|');
2881
2851
  o.valore = av[1];
2882
2852
  o.descrizione_valore = this.translateValue(av[0]);
2883
- this
2884
- .myData
2885
- .push(o);
2853
+ this.myData.push(o);
2886
2854
  }
2887
2855
  this.table_hidden = false;
2888
2856
  this.is_loaded = true;
@@ -2905,10 +2873,9 @@ class FHAutoCompleteComponent {
2905
2873
  this.fillCombo();
2906
2874
  }, this.load_delay);
2907
2875
  }
2908
- else { }
2909
- this
2910
- .initend
2911
- .emit();
2876
+ else {
2877
+ }
2878
+ this.initend.emit();
2912
2879
  setTimeout(() => {
2913
2880
  this.is_loaded = true;
2914
2881
  }, 1000);
@@ -2998,7 +2965,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2998
2965
  MatFormFieldModule,
2999
2966
  MatAutocompleteModule,
3000
2967
  FormsModule,
3001
- MatInputModule
2968
+ MatInputModule,
3002
2969
  ], providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$b], template: `
3003
2970
  <div
3004
2971
  style="min-height:45px"