@fluxhub/fluxhub-lib 9.0.126 → 9.0.128

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.
@@ -806,7 +806,7 @@ var QueryService = /** @class */ (function () {
806
806
  // console.log('QueryService url: '+ this.url);
807
807
  if (queryp.types != null && queryp.sql.indexOf('_MULTI') == -1)
808
808
  for (var i = 0; i < queryp.types.length; i++) {
809
- if (queryp.values[i] == null || queryp.values[i] == 'NaN-0NaN-0NaN' || queryp.values[i] == 'NaN')
809
+ if (queryp.values[i] == null)
810
810
  queryp.values[i] = 'dbnull';
811
811
  else {
812
812
  if (queryp.types[i] == 'boolean')
@@ -828,17 +828,15 @@ var QueryService = /** @class */ (function () {
828
828
  queryp.values[i] = '' + queryp.values[i];
829
829
  if (queryp.types[i] == 'date')
830
830
  queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
831
- if (queryp.types[i] == 'datetime')
831
+ if (queryp.types[i] == 'date') {
832
+ queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
833
+ if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN')
834
+ queryp.values[i] = null;
835
+ }
836
+ if (queryp.types[i] == 'datetime') {
832
837
  queryp.values[i] = this.uti_s.sql_date_time(queryp.values[i]);
833
- if (queryp.types[i] == 'decimal') {
834
- if (queryp.values[i] + '' == '')
835
- queryp.values[i] = 'dbnull';
836
- else {
837
- if (isNaN(queryp.values[i]))
838
- queryp.values[i] = '0';
839
- else
840
- queryp.values[i] = '' + queryp.values[i];
841
- }
838
+ if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN NaN:NaN')
839
+ queryp.values[i] = null;
842
840
  }
843
841
  if (queryp.types[i] == 'string' && queryp.values[i] == null)
844
842
  queryp.values[i] = 'dbnull';
@@ -8719,6 +8717,8 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8719
8717
  this.m_color = '';
8720
8718
  this.label_width = "";
8721
8719
  this.change = new EventEmitter();
8720
+ this.focus = new EventEmitter();
8721
+ this.focus_out = new EventEmitter();
8722
8722
  this.enter_pressed = new EventEmitter();
8723
8723
  this.innerValue = 0;
8724
8724
  this.onChange = function (_) {
@@ -8745,19 +8745,37 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8745
8745
  FHCurrencyFieldComponent.prototype.chg = function () {
8746
8746
  var _this = this;
8747
8747
  setTimeout(function () {
8748
- _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join('.'));
8748
+ if (_this.decimal == 0)
8749
+ _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join(''));
8750
+ else
8751
+ _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join('.'));
8752
+ if (typeof (_this.value) == 'string') {
8753
+ if (_this.decimal == 0)
8754
+ _this.value = parseFloat(_this.value.split('.').join('').split(',').join(''));
8755
+ else
8756
+ _this.value = parseFloat(_this.value.split('.').join('').split(',').join('.'));
8757
+ }
8758
+ console.log('this.value ', _this.value);
8749
8759
  _this.onChange(_this.value);
8750
- }, 50);
8760
+ }, 0);
8751
8761
  };
8752
8762
  FHCurrencyFieldComponent.prototype.writeValue = function (value) {
8753
8763
  if (value == null)
8754
8764
  value = 0;
8755
- // if (value !== this.innerValue) {
8756
- this.innerValue = value;
8757
- this.value = value;
8758
- this.formattedAmount = this.transform(this.value, this.decimal);
8759
- //}
8760
- this.onChange(this.value);
8765
+ if (value !== this.innerValue) {
8766
+ if (typeof (value) == 'string') {
8767
+ if (this.decimal == 0)
8768
+ value = parseFloat(value.split('.').join('').split(',').join(''));
8769
+ else
8770
+ value = parseFloat(value.split('.').join('').split(',').join('.'));
8771
+ }
8772
+ this.innerValue = value;
8773
+ this.value = value;
8774
+ // console.log('writeValue ini ',this.value);
8775
+ this.formattedAmount = this.transform(this.value, this.decimal);
8776
+ // console.log('writeValue fin ',this.value);
8777
+ }
8778
+ // this.onChange(this.value);
8761
8779
  };
8762
8780
  FHCurrencyFieldComponent.prototype.registerOnChange = function (fn) {
8763
8781
  this.onChange = fn;
@@ -8771,10 +8789,13 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8771
8789
  // if (typeof (element.target.value) !== 'number')
8772
8790
  // this.formattedAmount = this.currencyPipe.transform(this.value);
8773
8791
  setTimeout(function () {
8774
- _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join('.'));
8792
+ //if(this.decimal==0)
8793
+ // this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join(''));
8794
+ // else
8795
+ // this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join('.'));
8775
8796
  // this.writeValue(this.value);
8776
8797
  _this.formattedAmount = _this.transform(_this.value, _this.decimal);
8777
- }, 50);
8798
+ }, 0);
8778
8799
  // Remove or comment this line if you dont want
8779
8800
  // to show the formatted amount in the textbox.
8780
8801
  // element.target.value = this.formattedAmount;
@@ -8794,10 +8815,10 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8794
8815
  integer = '0';
8795
8816
  return integer + fraction;
8796
8817
  };
8797
- FHCurrencyFieldComponent.prototype.removeCurrencyPipeFormat = function (element) {
8818
+ FHCurrencyFieldComponent.prototype.focus_e = function () {
8798
8819
  try {
8799
8820
  // this.value=this.value.split('.').join('');
8800
- this.formattedAmount = this.transform(this.value, this.decimal);
8821
+ this.focus.emit(this.value);
8801
8822
  }
8802
8823
  catch (e) {
8803
8824
  console.log(e);
@@ -8853,6 +8874,14 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8853
8874
  Output(),
8854
8875
  __metadata("design:type", EventEmitter)
8855
8876
  ], FHCurrencyFieldComponent.prototype, "change", void 0);
8877
+ __decorate([
8878
+ Output(),
8879
+ __metadata("design:type", EventEmitter)
8880
+ ], FHCurrencyFieldComponent.prototype, "focus", void 0);
8881
+ __decorate([
8882
+ Output(),
8883
+ __metadata("design:type", EventEmitter)
8884
+ ], FHCurrencyFieldComponent.prototype, "focus_out", void 0);
8856
8885
  __decorate([
8857
8886
  Output(),
8858
8887
  __metadata("design:type", EventEmitter)
@@ -8865,7 +8894,7 @@ var FHCurrencyFieldComponent = /** @class */ (function () {
8865
8894
  Component({
8866
8895
  selector: 'FHCurrencyField',
8867
8896
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7],
8868
- template: "\n <mat-form-field [hidden]=\"!enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" style=\"text-align:right\" #el matInput\n [disabled]=\"!enabled\" [(ngModel)]=\"formattedAmount\"\n (blur)=\"transformAmount($event)\" [style.color]=\"getStyle_color()\" (keydown)=\"kd($event)\"\n (focus)=\"removeCurrencyPipeFormat($event)\" (keyup)=\"chg()\"\n pattern=\"[-+]?[0-9]*[.,]?[0-9]+\">\n </mat-form-field>\n <mat-form-field [hidden]=\"enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" style=\"text-align:right\" [style.color]=\"getStyle_color()\" #el1 matInput [disabled]=\"true\"\n [(ngModel)]=\"formattedAmount\"\n >\n </mat-form-field>\n ",
8897
+ template: "\n\n <mat-form-field [hidden]=\"!enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" style=\"text-align:right\" #el matInput\n [disabled]=\"!enabled\" [(ngModel)]=\"formattedAmount\"\n (blur)=\"transformAmount($event);focus_out.emit(value);\" [style.color]=\"getStyle_color()\" (keydown)=\"kd($event)\"\n (focus)=\"focus_e()\" (keyup)=\"chg()\"\n >\n </mat-form-field>\n <mat-form-field [hidden]=\"enabled || hidden\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}}</mat-label>\n <input type=\"text\" style=\"text-align:right\" [style.color]=\"getStyle_color()\" #el1 matInput [disabled]=\"true\"\n [(ngModel)]=\"formattedAmount\"\n >\n </mat-form-field>\n ",
8869
8898
  styles: ["\n\n "]
8870
8899
  }),
8871
8900
  __metadata("design:paramtypes", [])