monkey-front-components 0.0.176 → 0.0.177

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.
@@ -348,8 +348,16 @@
348
348
 
349
349
  var BaseComponent = /** @class */ (function () {
350
350
  function BaseComponent() {
351
+ this.__isMobile = this.isMobile();
352
+ this.__locales = ['pt-BR', 'es-CL'];
351
353
  this.__unsubscribeAll = new rxjs.Subject();
352
354
  }
355
+ BaseComponent.prototype.isMobile = function () {
356
+ var isMobileWidth = (window.screen.width <= 640) ||
357
+ (window.matchMedia &&
358
+ window.matchMedia('only screen and (max-width: 640px)').matches);
359
+ return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent)) || isMobileWidth;
360
+ };
353
361
  BaseComponent.prototype.handlePagination = function (create) {
354
362
  var _this = this;
355
363
  if (create === void 0) { create = true; }
@@ -378,8 +386,8 @@
378
386
  }, 200);
379
387
  }
380
388
  };
381
- BaseComponent.prototype.handleIntercom = function (intercomControls) {
382
- var service = intercomControls.service, show = intercomControls.show;
389
+ BaseComponent.prototype.handleSupport = function (supportControls) {
390
+ var service = supportControls.service, show = supportControls.show;
383
391
  var method = show ? 'show' : 'hide';
384
392
  service[method.toLowerCase()]();
385
393
  };
@@ -543,8 +551,8 @@
543
551
  this.__paginationOptions = args === null || args === void 0 ? void 0 : args.paginationOptions;
544
552
  this.handlePagination();
545
553
  }
546
- if (args === null || args === void 0 ? void 0 : args.intercomControls) {
547
- this.handleIntercom(args === null || args === void 0 ? void 0 : args.intercomControls);
554
+ if (args === null || args === void 0 ? void 0 : args.supportControls) {
555
+ this.handleSupport(args === null || args === void 0 ? void 0 : args.supportControls);
548
556
  }
549
557
  if (args === null || args === void 0 ? void 0 : args.translateOptions) {
550
558
  this.handleTranslate(args === null || args === void 0 ? void 0 : args.translateOptions);
@@ -590,6 +598,38 @@
590
598
  if (element)
591
599
  element.scrollIntoView();
592
600
  };
601
+ BaseComponent.prototype.getEmbeddedData = function (data, field) {
602
+ var _embedded = data._embedded;
603
+ return _embedded ? _embedded[field] : null;
604
+ };
605
+ BaseComponent.prototype.openWindow = function (url) {
606
+ window.open("" + url, '_blank');
607
+ };
608
+ BaseComponent.prototype.fillI18n = function (data) {
609
+ this.__i18n = data;
610
+ };
611
+ BaseComponent.prototype.getCountryPrefix = function (country) {
612
+ return {
613
+ br: 55,
614
+ cl: 56
615
+ }[country];
616
+ };
617
+ BaseComponent.prototype.getCountryCurrencyChartFormat = function (country) {
618
+ return {
619
+ br: 'R$ #,###,##0.00',
620
+ cl: 'CLP #,###,##0'
621
+ }[country];
622
+ };
623
+ BaseComponent.prototype.getCountryValidators = function (country) {
624
+ return {
625
+ br: {
626
+ governmentId: monkeyFrontCore.ValidateUtils.DocumentValidator
627
+ },
628
+ cl: {
629
+ governmentId: monkeyFrontCore.ValidateUtils.DocumentRutValidator
630
+ }
631
+ }[country];
632
+ };
593
633
  return BaseComponent;
594
634
  }());
595
635
  BaseComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });