monkey-front-core 21.2.5 → 21.2.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.
@@ -4129,11 +4129,14 @@ function mapErrorKey(key) {
4129
4129
  phone: 'invalid-phone',
4130
4130
  maxFileSize: 'max-file-size',
4131
4131
  invalidUnlockRegister: 'invalid-unlock-register',
4132
- passwordsNotMatching: 'password-not-matching'
4132
+ passwordsNotMatching: 'password-not-matching',
4133
+ minlength: 'min-length',
4134
+ maxlength: 'max-length'
4133
4135
  };
4134
4136
  return (map[key] ?? key).toUpperCase();
4135
4137
  }
4136
4138
  function mapErrorParams(key, control) {
4139
+ key = key.toLowerCase();
4137
4140
  const map = {
4138
4141
  'invalid-phone': 'phoneAllowed',
4139
4142
  'max-file-size': 'sizeAllowed'
@@ -4142,6 +4145,10 @@ function mapErrorParams(key, control) {
4142
4145
  if (field) {
4143
4146
  return { [field]: control.errors?.[field] };
4144
4147
  }
4148
+ if (key === 'min-length' || key === 'max-length') {
4149
+ const [[, error]] = Object.entries(control?.errors || {});
4150
+ return error;
4151
+ }
4145
4152
  return null;
4146
4153
  }
4147
4154
  class MonkeyEcxErrorMessageDirective {
@@ -5401,14 +5408,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
5401
5408
  * MIT Licence
5402
5409
  ************************* */
5403
5410
  class MonkeyEcxFormatTaxPipe {
5404
- transform(tax, decimalDigits = 7) {
5405
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(tax))
5406
- return '0 %';
5407
- const stringTax = tax.toString();
5408
- const stringTaxLimited = stringTax.slice(0, stringTax.indexOf('.') + decimalDigits + 1);
5409
- return `${Number(stringTaxLimited).toLocaleString('pt-br', {
5410
- maximumFractionDigits: decimalDigits
5411
- })} %`;
5411
+ constructor() {
5412
+ this._country = injectTokenWithWarning(MECX_COUNTRY, 'MECX_COUNTRY');
5413
+ }
5414
+ transform(value) {
5415
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
5416
+ return '';
5417
+ }
5418
+ const identifier = {
5419
+ BR: ',',
5420
+ CL: ',',
5421
+ MX: ','
5422
+ }[this._country || 'BR'];
5423
+ return `${value} %`.replace('.', identifier || '.');
5412
5424
  }
5413
5425
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: MonkeyEcxFormatTaxPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
5414
5426
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: MonkeyEcxFormatTaxPipe, isStandalone: false, name: "monkeyecxFormatTax" }); }