@fluxhub/fluxhub-lib 9.0.125 → 9.0.127

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.
@@ -960,17 +960,15 @@
960
960
  queryp.values[i] = '' + queryp.values[i];
961
961
  if (queryp.types[i] == 'date')
962
962
  queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
963
- if (queryp.types[i] == 'datetime')
963
+ if (queryp.types[i] == 'date') {
964
+ queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
965
+ if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN')
966
+ queryp.values[i] = 'dbnull';
967
+ }
968
+ if (queryp.types[i] == 'datetime') {
964
969
  queryp.values[i] = this.uti_s.sql_date_time(queryp.values[i]);
965
- if (queryp.types[i] == 'decimal') {
966
- if (queryp.values[i] + '' == '')
970
+ if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN NaN:NaN')
967
971
  queryp.values[i] = 'dbnull';
968
- else {
969
- if (isNaN(queryp.values[i]))
970
- queryp.values[i] = '0';
971
- else
972
- queryp.values[i] = '' + queryp.values[i];
973
- }
974
972
  }
975
973
  if (queryp.types[i] == 'string' && queryp.values[i] == null)
976
974
  queryp.values[i] = 'dbnull';
@@ -8832,28 +8830,34 @@
8832
8830
  return FHLogPanelComponent;
8833
8831
  }());
8834
8832
 
8835
- var noop$6 = function () { };
8833
+ var noop$6 = function () {
8834
+ };
8836
8835
  var ɵ0$6 = noop$6;
8837
8836
  var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7 = {
8838
8837
  provide: forms.NG_VALUE_ACCESSOR,
8839
8838
  useExisting: core.forwardRef(function () { return FHCurrencyFieldComponent; }),
8840
- multi: true,
8839
+ multi: true
8841
8840
  };
8842
8841
  var FHCurrencyFieldComponent = /** @class */ (function () {
8843
8842
  function FHCurrencyFieldComponent() {
8844
8843
  this.decimal = 2;
8845
- this.label = "";
8844
+ this.label = '';
8846
8845
  this.required = false;
8847
8846
  this.enabled = true;
8848
8847
  this.hidden = false;
8849
- this.color = "";
8850
- this.m_color = "";
8848
+ this.color = '';
8849
+ this.m_color = '';
8851
8850
  this.label_width = "";
8852
8851
  this.change = new core.EventEmitter();
8852
+ this.focus = new core.EventEmitter();
8853
+ this.focus_out = new core.EventEmitter();
8853
8854
  this.enter_pressed = new core.EventEmitter();
8854
- this.onChange = function (_) { };
8855
- this.onTouched = function () { };
8856
- this.formattedAmount = "0,00";
8855
+ this.innerValue = 0;
8856
+ this.onChange = function (_) {
8857
+ };
8858
+ this.onTouched = function () {
8859
+ };
8860
+ this.formattedAmount = '0,00';
8857
8861
  this.value = 0;
8858
8862
  }
8859
8863
  FHCurrencyFieldComponent.prototype.kd = function (event) {
@@ -8861,15 +8865,6 @@
8861
8865
  this.enter_pressed.emit();
8862
8866
  }
8863
8867
  };
8864
- FHCurrencyFieldComponent.prototype.click_select_allf = function (element) {
8865
- var _this = this;
8866
- setTimeout(function () {
8867
- _this.el.nativeElement.select();
8868
- }, 200);
8869
- };
8870
- FHCurrencyFieldComponent.prototype.select_allf = function (element) {
8871
- this.el.nativeElement.select();
8872
- };
8873
8868
  FHCurrencyFieldComponent.prototype.getStyle_color = function () {
8874
8869
  return this.m_color;
8875
8870
  };
@@ -8882,27 +8877,36 @@
8882
8877
  FHCurrencyFieldComponent.prototype.chg = function () {
8883
8878
  var _this = this;
8884
8879
  setTimeout(function () {
8885
- _this.value = parseFloat(_this.formattedAmount.split(".").join("").split(",").join("."));
8880
+ if (_this.decimal == 0)
8881
+ _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join(''));
8882
+ else
8883
+ _this.value = parseFloat(_this.formattedAmount.split('.').join('').split(',').join('.'));
8884
+ if (typeof (_this.value) == 'string') {
8885
+ if (_this.decimal == 0)
8886
+ _this.value = parseFloat(_this.value.split('.').join('').split(',').join(''));
8887
+ else
8888
+ _this.value = parseFloat(_this.value.split('.').join('').split(',').join('.'));
8889
+ }
8890
+ console.log('this.value ', _this.value);
8886
8891
  _this.onChange(_this.value);
8887
- }, 50);
8892
+ }, 0);
8888
8893
  };
8889
8894
  FHCurrencyFieldComponent.prototype.writeValue = function (value) {
8890
- // console.log(value,parseFloat(
8891
- // this.formattedAmount.split(".").join("").split(",").join(".")));
8892
- if (this.value == parseFloat(this.formattedAmount.split(".").join("").split(",").join("."))) {
8893
- this.formattedAmount = this.transform(this.value, this.decimal);
8894
- this.value = value;
8895
- return;
8896
- }
8897
8895
  if (value == null)
8898
8896
  value = 0;
8899
- // if (value !== this.innerValue) {
8900
- if (typeof (value) == 'string') {
8901
- value = parseFloat(value.split(".").join("").split(",").join("."));
8897
+ if (value !== this.innerValue) {
8898
+ if (typeof (value) == 'string') {
8899
+ if (this.decimal == 0)
8900
+ value = parseFloat(value.split('.').join('').split(',').join(''));
8901
+ else
8902
+ value = parseFloat(value.split('.').join('').split(',').join('.'));
8903
+ }
8904
+ this.innerValue = value;
8905
+ this.value = value;
8906
+ // console.log('writeValue ini ',this.value);
8907
+ this.formattedAmount = this.transform(this.value, this.decimal);
8908
+ // console.log('writeValue fin ',this.value);
8902
8909
  }
8903
- this.value = value;
8904
- this.formattedAmount = this.transform(this.value, this.decimal);
8905
- //}
8906
8910
  // this.onChange(this.value);
8907
8911
  };
8908
8912
  FHCurrencyFieldComponent.prototype.registerOnChange = function (fn) {
@@ -8917,10 +8921,13 @@
8917
8921
  // if (typeof (element.target.value) !== 'number')
8918
8922
  // this.formattedAmount = this.currencyPipe.transform(this.value);
8919
8923
  setTimeout(function () {
8920
- _this.value = parseFloat(_this.formattedAmount.split(".").join("").split(",").join("."));
8924
+ //if(this.decimal==0)
8925
+ // this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join(''));
8926
+ // else
8927
+ // this.value = parseFloat(this.formattedAmount.split('.').join('').split(',').join('.'));
8921
8928
  // this.writeValue(this.value);
8922
8929
  _this.formattedAmount = _this.transform(_this.value, _this.decimal);
8923
- }, 50);
8930
+ }, 0);
8924
8931
  // Remove or comment this line if you dont want
8925
8932
  // to show the formatted amount in the textbox.
8926
8933
  // element.target.value = this.formattedAmount;
@@ -8931,23 +8938,19 @@
8931
8938
  };
8932
8939
  FHCurrencyFieldComponent.prototype.transform = function (value, fractionSize) {
8933
8940
  if (fractionSize === void 0) { fractionSize = 2; }
8934
- if (typeof (value) == 'string') {
8935
- value = parseFloat(value.split(".").join("").split(",").join("."));
8936
- }
8937
- var _a = __read((value || "").toString().split("."), 2), integer = _a[0], _b = _a[1], fraction = _b === void 0 ? "" : _b;
8938
- fraction =
8939
- fractionSize > 0
8940
- ? "," + (fraction + "000000").substring(0, fractionSize)
8941
- : "";
8942
- integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
8943
- if (integer == "")
8944
- integer = "0";
8941
+ var _a = __read((value || "").toString().split('.'), 2), integer = _a[0], _b = _a[1], fraction = _b === void 0 ? "" : _b;
8942
+ fraction = fractionSize > 0
8943
+ ? ',' + (fraction + '000000').substring(0, fractionSize)
8944
+ : "";
8945
+ integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, '.');
8946
+ if (integer == '')
8947
+ integer = '0';
8945
8948
  return integer + fraction;
8946
8949
  };
8947
- FHCurrencyFieldComponent.prototype.removeCurrencyPipeFormat = function (element) {
8950
+ FHCurrencyFieldComponent.prototype.focus_e = function () {
8948
8951
  try {
8949
8952
  // this.value=this.value.split('.').join('');
8950
- this.formattedAmount = this.transform(this.value, this.decimal);
8953
+ this.focus.emit(this.value);
8951
8954
  }
8952
8955
  catch (e) {
8953
8956
  console.log(e);
@@ -8968,7 +8971,7 @@
8968
8971
  });
8969
8972
  };
8970
8973
  __decorate([
8971
- core.ViewChild("el"),
8974
+ core.ViewChild('el'),
8972
8975
  __metadata("design:type", core.ElementRef)
8973
8976
  ], FHCurrencyFieldComponent.prototype, "el", void 0);
8974
8977
  __decorate([
@@ -9003,6 +9006,14 @@
9003
9006
  core.Output(),
9004
9007
  __metadata("design:type", core.EventEmitter)
9005
9008
  ], FHCurrencyFieldComponent.prototype, "change", void 0);
9009
+ __decorate([
9010
+ core.Output(),
9011
+ __metadata("design:type", core.EventEmitter)
9012
+ ], FHCurrencyFieldComponent.prototype, "focus", void 0);
9013
+ __decorate([
9014
+ core.Output(),
9015
+ __metadata("design:type", core.EventEmitter)
9016
+ ], FHCurrencyFieldComponent.prototype, "focus_out", void 0);
9006
9017
  __decorate([
9007
9018
  core.Output(),
9008
9019
  __metadata("design:type", core.EventEmitter)
@@ -9013,10 +9024,10 @@
9013
9024
  ], FHCurrencyFieldComponent.prototype, "value", void 0);
9014
9025
  FHCurrencyFieldComponent = __decorate([
9015
9026
  core.Component({
9016
- selector: "FHCurrencyField",
9027
+ selector: 'FHCurrencyField',
9017
9028
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$7],
9018
- template: "\n <mat-form-field\n [hidden]=\"!enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n style=\"text-align:right\"\n #el\n matInput\n [disabled]=\"!enabled\"\n [(ngModel)]=\"formattedAmount\"\n (focusout)=\"chg()\"\n [style.color]=\"getStyle_color()\"\n (keydown)=\"kd($event)\"\n (click)=\"click_select_allf($event)\"\n (focus)=\"removeCurrencyPipeFormat($event); select_allf($event)\"\n />\n </mat-form-field>\n <mat-form-field\n [hidden]=\"enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n style=\"text-align:right\"\n [style.color]=\"getStyle_color()\"\n #el1\n matInput\n [disabled]=\"true\"\n [(ngModel)]=\"formattedAmount\"\n />\n </mat-form-field>\n ",
9019
- styles: [""]
9029
+ 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 ",
9030
+ styles: ["\n\n "]
9020
9031
  }),
9021
9032
  __metadata("design:paramtypes", [])
9022
9033
  ], FHCurrencyFieldComponent);