monkey-style-guide 2.0.198 → 2.0.199

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Inject, Component, ViewEncapsulation, Input, NgModule, NO_ERRORS_SCHEMA, HostListener, EventEmitter, forwardRef, Output, ViewChild, ContentChildren, Directive, Optional, Self } from '@angular/core';
2
+ import { Injectable, Inject, Component, ViewEncapsulation, Input, NgModule, NO_ERRORS_SCHEMA, HostListener, EventEmitter, forwardRef, Output, DEFAULT_CURRENCY_CODE, ViewChild, ContentChildren, Directive, Optional, Self } from '@angular/core';
3
3
  import { BehaviorSubject, throwError, Subject } from 'rxjs';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpClientModule } from '@angular/common/http';
@@ -7638,10 +7638,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7638
7638
  * MIT Licence
7639
7639
  **************************/
7640
7640
  class MonkeyInputComponent {
7641
- constructor(currencyPipe, settingsService, cdr) {
7641
+ constructor(currencyPipe, settingsService, cdr, defaultCurencyCode) {
7642
7642
  this.currencyPipe = currencyPipe;
7643
7643
  this.settingsService = settingsService;
7644
7644
  this.cdr = cdr;
7645
+ this.defaultCurencyCode = defaultCurencyCode;
7645
7646
  this.name = `mecx-input-${MonkeyUtils.getRandomString(10)}`;
7646
7647
  this.helperMessage = '';
7647
7648
  this.placeholder = '';
@@ -7654,6 +7655,7 @@ class MonkeyInputComponent {
7654
7655
  this._disabled = false;
7655
7656
  this._maxDateToday = new Date().toISOString().split('T')[0];
7656
7657
  this._symbol = '';
7658
+ //not to do
7657
7659
  }
7658
7660
  handleValue(value, apply = false) {
7659
7661
  if (this.onlyNumber) {
@@ -7692,12 +7694,20 @@ class MonkeyInputComponent {
7692
7694
  return value;
7693
7695
  }
7694
7696
  handleSymbol() {
7695
- const { settings } = this;
7697
+ const { settings, defaultCurencyCode } = this;
7696
7698
  if (this.currency) {
7697
- this._symbol = {
7698
- BRL: 'R$',
7699
- CLP: 'CLP',
7700
- }[settings?.currency?.code || 'BRL'];
7699
+ if (defaultCurencyCode) {
7700
+ const cur = this.defaultCurencyCode.toString();
7701
+ this._symbol = cur;
7702
+ }
7703
+ else {
7704
+ this._symbol = {
7705
+ BRL: 'R$',
7706
+ CLP: 'CLP',
7707
+ MXN: 'MXN',
7708
+ USD: '$'
7709
+ }[settings?.currency?.code || 'BRL'];
7710
+ }
7701
7711
  }
7702
7712
  else if (this.percent) {
7703
7713
  this._symbol = '%';
@@ -7766,7 +7776,7 @@ class MonkeyInputComponent {
7766
7776
  }
7767
7777
  }
7768
7778
  }
7769
- MonkeyInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MonkeyInputComponent, deps: [{ token: i1$1.CurrencyPipe }, { token: MonkeyStyleGuideSettingsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
7779
+ MonkeyInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MonkeyInputComponent, deps: [{ token: i1$1.CurrencyPipe }, { token: MonkeyStyleGuideSettingsService }, { token: i0.ChangeDetectorRef }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Component });
7770
7780
  MonkeyInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MonkeyInputComponent, selector: "monkey-input", inputs: { name: "name", label: "label", helperMessage: "helperMessage", placeholder: "placeholder", icon: "icon", type: "type", infoMessage: "infoMessage", errorMessage: "errorMessage", mask: "mask", prefix: "prefix", maxLength: "maxLength", onlyNumber: "onlyNumber", onlyAlphaNumeric: "onlyAlphaNumeric", upperCase: "upperCase", lowerCase: "lowerCase", capitalize: "capitalize", currency: "currency", percent: "percent", maxDateToday: "maxDateToday", value: "value" }, outputs: { onChange: "onChange" }, host: { listeners: { "click": "onClick()" } }, providers: [
7771
7781
  {
7772
7782
  provide: NG_VALUE_ACCESSOR,
@@ -7954,7 +7964,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7954
7964
  CurrencyPipe,
7955
7965
  ],
7956
7966
  }]
7957
- }], ctorParameters: function () { return [{ type: i1$1.CurrencyPipe }, { type: MonkeyStyleGuideSettingsService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { name: [{
7967
+ }], ctorParameters: function () { return [{ type: i1$1.CurrencyPipe }, { type: MonkeyStyleGuideSettingsService }, { type: i0.ChangeDetectorRef }, { type: i0.InjectionToken, decorators: [{
7968
+ type: Inject,
7969
+ args: [DEFAULT_CURRENCY_CODE]
7970
+ }] }]; }, propDecorators: { name: [{
7958
7971
  type: Input
7959
7972
  }], label: [{
7960
7973
  type: Input