monkey-front-components 0.0.799 → 0.0.800

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.
@@ -24,10 +24,9 @@ class BaseComponent {
24
24
  this.__unsubscribeAll = new Subject();
25
25
  }
26
26
  isMobile() {
27
- const isMobileWidth = (window.screen.width <= 640) ||
28
- (window.matchMedia &&
29
- window.matchMedia('only screen and (max-width: 640px)').matches);
30
- return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent)) || isMobileWidth;
27
+ const isMobileWidth = window.screen.width <= 640 ||
28
+ (window.matchMedia && window.matchMedia('only screen and (max-width: 640px)').matches);
29
+ return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent) || isMobileWidth);
31
30
  }
32
31
  handlePagination(create = true) {
33
32
  const { __paginationOptions } = this;
@@ -58,9 +57,7 @@ class BaseComponent {
58
57
  }
59
58
  handleTranslate(translateOptions) {
60
59
  const { service } = translateOptions;
61
- service.__oni18nDataChanged$
62
- .pipe(takeUntil(this.__unsubscribeAll))
63
- .subscribe(() => {
60
+ service.__oni18nDataChanged$.pipe(takeUntil(this.__unsubscribeAll)).subscribe(() => {
64
61
  const data = service.__i18n;
65
62
  if (data) {
66
63
  this.__i18n = data;
@@ -314,12 +311,12 @@ class BaseComponent {
314
311
  this.__i18n = data;
315
312
  }
316
313
  getCountryPrefix(country) {
317
- return {
314
+ return ({
318
315
  br: 55,
319
316
  cl: 56,
320
317
  mx: 52,
321
318
  us: 1
322
- }[country] || '';
319
+ }[country] || '');
323
320
  }
324
321
  getCountryCurrencyChartFormat(country) {
325
322
  return {
@@ -334,7 +331,7 @@ class BaseComponent {
334
331
  return MonkeyEcxUtils.getDocumentPlaceholder(type, country);
335
332
  }
336
333
  getCountryValidators(country) {
337
- return {
334
+ return ({
338
335
  br: {
339
336
  governmentId: ValidateUtils.DocumentValidator,
340
337
  zipCode: Validators.zipCodeByCountry(country)
@@ -347,10 +344,14 @@ class BaseComponent {
347
344
  governmentId: ValidateUtils.DocumentRFCValidator,
348
345
  zipCode: Validators.zipCodeByCountry(country)
349
346
  },
347
+ us: {
348
+ governmentId: ValidateUtils.DocumentEINValidator,
349
+ zipCode: Validators.zipCodeByCountry(country)
350
+ }
350
351
  }[country] || {
351
352
  governmentId: ValidateUtils.DocumentValidator,
352
353
  zipCode: Validators.zipCodeByCountry('br')
353
- };
354
+ });
354
355
  }
355
356
  isAbleToHandlePagination() {
356
357
  const { __paginationOptions } = this;
@@ -385,9 +386,11 @@ const validators = {
385
386
  governmentId: Validators.documentBR,
386
387
  governmentIdRut: Validators.documentCL,
387
388
  governmentIdRfc: Validators.documentMX,
389
+ governmentIdEin: Validators.documentUS,
388
390
  documentBR: Validators.documentBR,
389
391
  documentCL: Validators.documentCL,
390
392
  documentMX: Validators.documentMX,
393
+ documentUS: Validators.documentUS,
391
394
  date: Validators.date,
392
395
  minYears: (param) => {
393
396
  return Validators.minYears(param);