@seniorsistemas/angular-components 16.3.5 → 16.3.7

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.
@@ -1482,13 +1482,13 @@ var LocaleModule = /** @class */ (function () {
1482
1482
  var BignumberField = /** @class */ (function (_super) {
1483
1483
  __extends(BignumberField, _super);
1484
1484
  function BignumberField(config) {
1485
- var _a;
1485
+ var _a, _b;
1486
1486
  var _this = _super.call(this, config) || this;
1487
- _this.allowNegative = config.allowNegative;
1487
+ _this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
1488
1488
  _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
1489
1489
  _this.browserAutocomplete = config.browserAutocomplete;
1490
1490
  _this.precision = config.precision;
1491
- _this.scale = (_a = config.scale) !== null && _a !== void 0 ? _a : 2;
1491
+ _this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
1492
1492
  _this.alignTo = _this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
1493
1493
  _this.mask = config.mask;
1494
1494
  _this.leftAddon = config.leftAddon;
@@ -3784,7 +3784,6 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3784
3784
  _this.precision = 15;
3785
3785
  _this.scale = 0;
3786
3786
  _this.decimalSeparator = ",";
3787
- _this.thousandsSeparator = ".";
3788
3787
  _this.alignTo = AlignmentOptions.LEFT;
3789
3788
  _this.allowNegative = true;
3790
3789
  return _this;
@@ -3808,14 +3807,26 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3808
3807
  this.updateVariables();
3809
3808
  }
3810
3809
  };
3810
+ BignumberInputDirective.prototype.onKeypress = function (event) {
3811
+ var code = event.code;
3812
+ if (code === "Minus" || code === "NumpadSubtract") {
3813
+ if (this.allowNegative) {
3814
+ this.maxLength = this._maxLength + 1;
3815
+ }
3816
+ }
3817
+ else if (code === "Equal" || code === "NumpadAdd") {
3818
+ this.maxLength = this._maxLength;
3819
+ }
3820
+ };
3811
3821
  /**
3812
3822
  * Update the options values according to the directive input values.
3813
3823
  */
3814
3824
  BignumberInputDirective.prototype.updateVariables = function () {
3825
+ var _a;
3815
3826
  this.options = {
3816
3827
  align: this.alignTo,
3817
3828
  decimalSeparator: this.decimalSeparator,
3818
- thousandsSeparator: this.thousandsSeparator,
3829
+ thousandsSeparator: (_a = this.thousandsSeparator) !== null && _a !== void 0 ? _a : ".",
3819
3830
  scale: this.scale || 0,
3820
3831
  prefix: "",
3821
3832
  suffix: "",
@@ -3827,10 +3838,12 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3827
3838
  * Responsible to calculate the field maximum length considering the separators.
3828
3839
  */
3829
3840
  BignumberInputDirective.prototype.calculateMaxLength = function () {
3841
+ var _a, _b;
3830
3842
  var decSepLength = this.decimalSeparator.length;
3831
- var thoSepLength = this.thousandsSeparator.length;
3843
+ var thoSepLength = (_b = (_a = this.thousandsSeparator) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
3832
3844
  var maxLength = this.precision + (this.scale ? decSepLength : 0);
3833
3845
  maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
3846
+ this._maxLength = maxLength;
3834
3847
  this.maxLength = maxLength;
3835
3848
  };
3836
3849
  var BignumberInputDirective_1;
@@ -3859,6 +3872,9 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3859
3872
  __decorate([
3860
3873
  HostBinding("attr.maxLength")
3861
3874
  ], BignumberInputDirective.prototype, "maxLength", void 0);
3875
+ __decorate([
3876
+ HostListener("keypress", ["$event"])
3877
+ ], BignumberInputDirective.prototype, "onKeypress", null);
3862
3878
  BignumberInputDirective = BignumberInputDirective_1 = __decorate([
3863
3879
  Directive({
3864
3880
  selector: "input[sBignumberInput]",