@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.
@@ -1653,13 +1653,13 @@
1653
1653
  var BignumberField = /** @class */ (function (_super) {
1654
1654
  __extends(BignumberField, _super);
1655
1655
  function BignumberField(config) {
1656
- var _a;
1656
+ var _a, _b;
1657
1657
  var _this = _super.call(this, config) || this;
1658
- _this.allowNegative = config.allowNegative;
1658
+ _this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
1659
1659
  _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
1660
1660
  _this.browserAutocomplete = config.browserAutocomplete;
1661
1661
  _this.precision = config.precision;
1662
- _this.scale = (_a = config.scale) !== null && _a !== void 0 ? _a : 2;
1662
+ _this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
1663
1663
  _this.alignTo = _this.scale ? ng2CurrencyMask.AlignmentOptions.RIGHT : ng2CurrencyMask.AlignmentOptions.LEFT;
1664
1664
  _this.mask = config.mask;
1665
1665
  _this.leftAddon = config.leftAddon;
@@ -3979,6 +3979,17 @@
3979
3979
  this.updateVariables();
3980
3980
  }
3981
3981
  };
3982
+ BignumberInputDirective.prototype.onKeypress = function (event) {
3983
+ var code = event.code;
3984
+ if (code === "Minus" || code === "NumpadSubtract") {
3985
+ if (this.allowNegative) {
3986
+ this.maxLength = this._maxLength + 1;
3987
+ }
3988
+ }
3989
+ else if (code === "Equal" || code === "NumpadAdd") {
3990
+ this.maxLength = this._maxLength;
3991
+ }
3992
+ };
3982
3993
  /**
3983
3994
  * Update the options values according to the directive input values.
3984
3995
  */
@@ -4002,6 +4013,7 @@
4002
4013
  var thoSepLength = this.thousandsSeparator.length;
4003
4014
  var maxLength = this.precision + (this.scale ? decSepLength : 0);
4004
4015
  maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
4016
+ this._maxLength = maxLength;
4005
4017
  this.maxLength = maxLength;
4006
4018
  };
4007
4019
  var BignumberInputDirective_1;
@@ -4030,6 +4042,9 @@
4030
4042
  __decorate([
4031
4043
  core.HostBinding("attr.maxLength")
4032
4044
  ], BignumberInputDirective.prototype, "maxLength", void 0);
4045
+ __decorate([
4046
+ core.HostListener("keypress", ["$event"])
4047
+ ], BignumberInputDirective.prototype, "onKeypress", null);
4033
4048
  BignumberInputDirective = BignumberInputDirective_1 = __decorate([
4034
4049
  core.Directive({
4035
4050
  selector: "input[sBignumberInput]",