@seniorsistemas/angular-components 16.3.5 → 16.3.6

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;
@@ -3808,6 +3808,17 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3808
3808
  this.updateVariables();
3809
3809
  }
3810
3810
  };
3811
+ BignumberInputDirective.prototype.onKeypress = function (event) {
3812
+ var code = event.code;
3813
+ if (code === "Minus" || code === "NumpadSubtract") {
3814
+ if (this.allowNegative) {
3815
+ this.maxLength = this._maxLength + 1;
3816
+ }
3817
+ }
3818
+ else if (code === "Equal" || code === "NumpadAdd") {
3819
+ this.maxLength = this._maxLength;
3820
+ }
3821
+ };
3811
3822
  /**
3812
3823
  * Update the options values according to the directive input values.
3813
3824
  */
@@ -3831,6 +3842,7 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3831
3842
  var thoSepLength = this.thousandsSeparator.length;
3832
3843
  var maxLength = this.precision + (this.scale ? decSepLength : 0);
3833
3844
  maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
3845
+ this._maxLength = maxLength;
3834
3846
  this.maxLength = maxLength;
3835
3847
  };
3836
3848
  var BignumberInputDirective_1;
@@ -3859,6 +3871,9 @@ var BignumberInputDirective = /** @class */ (function (_super) {
3859
3871
  __decorate([
3860
3872
  HostBinding("attr.maxLength")
3861
3873
  ], BignumberInputDirective.prototype, "maxLength", void 0);
3874
+ __decorate([
3875
+ HostListener("keypress", ["$event"])
3876
+ ], BignumberInputDirective.prototype, "onKeypress", null);
3862
3877
  BignumberInputDirective = BignumberInputDirective_1 = __decorate([
3863
3878
  Directive({
3864
3879
  selector: "input[sBignumberInput]",