@seniorsistemas/angular-components 14.7.0 → 14.7.1

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.
@@ -3709,7 +3709,7 @@ var TableColumnsComponent = /** @class */ (function () {
3709
3709
  return uninformed;
3710
3710
  }
3711
3711
  else {
3712
- var numberConfigs = __assign(__assign({}, locale.number), { scale: column.scale ? _this.getColumnScale(column.scale) : locale.number.scale });
3712
+ var numberConfigs = __assign(__assign({}, locale.number), { scale: column.scale ? _this.getColumnScale(column.scale) : locale.number.scale, prefix: locale.number.currencySymbol + " " });
3713
3713
  switch (column.type) {
3714
3714
  case EnumColumnFieldType.ENUM:
3715
3715
  if (column.badgeConfigs && column.badgeConfigs.length) {
@@ -3717,7 +3717,7 @@ var TableColumnsComponent = /** @class */ (function () {
3717
3717
  }
3718
3718
  return _this.translate.instant(column.enumPrefix + attributeValue.toString().toLowerCase());
3719
3719
  case EnumColumnFieldType.CURRENCY:
3720
- return _this.applyMask(attributeValue, numberConfigs);
3720
+ return applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
3721
3721
  case EnumColumnFieldType.DATE:
3722
3722
  var dateFormat = column.dateFormat ? column.dateFormat : locale.calendar.dateFormat;
3723
3723
  return moment_(attributeValue).format(dateFormat);
@@ -3728,7 +3728,8 @@ var TableColumnsComponent = /** @class */ (function () {
3728
3728
  case EnumColumnFieldType.STRING:
3729
3729
  return attributeValue;
3730
3730
  case EnumColumnFieldType.NUMBER:
3731
- return _this.applyMask(attributeValue, numberConfigs, false);
3731
+ numberConfigs.prefix = "";
3732
+ return applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
3732
3733
  case EnumColumnFieldType.TOKENS:
3733
3734
  return _this.getTokens(attributeValue);
3734
3735
  }
@@ -3783,21 +3784,8 @@ var TableColumnsComponent = /** @class */ (function () {
3783
3784
  return tooltip;
3784
3785
  }
3785
3786
  };
3786
- TableColumnsComponent.prototype.applyMask = function (value, options, useCurrencySymbol) {
3787
- if (useCurrencySymbol === void 0) { useCurrencySymbol = true; }
3788
- var scale = options.scale, thousandsSeparator = options.thousandsSeparator, decimalSeparator = options.decimalSeparator;
3789
- var currencySymbol = useCurrencySymbol ? options.currencySymbol : "";
3790
- var rawValue = Number(value ? value : 0).toFixed(scale);
3791
- var onlyNumbers = rawValue.replace(/[^0-9]/g, "");
3792
- var integerPart = onlyNumbers
3793
- .slice(0, onlyNumbers.length - scale)
3794
- .replace(/^0*/g, "")
3795
- .replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || "0";
3796
- var decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
3797
- var newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
3798
- var isZero = !Number(onlyNumbers);
3799
- var operator = rawValue.includes("-") && !isZero ? "-" : "";
3800
- return "" + operator + currencySymbol + " " + newValue;
3787
+ TableColumnsComponent.prototype.isNumber = function (value) {
3788
+ return !(new BigNumber(value).isNaN());
3801
3789
  };
3802
3790
  TableColumnsComponent.prototype.getTokens = function (values) {
3803
3791
  if (!this.isArray(values))