monkey-style-guide 2.0.80 → 2.0.84

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.
@@ -107,8 +107,8 @@ mecx-form-field {
107
107
  font-style: normal;
108
108
  font-weight: normal;
109
109
  font-size: 14px;
110
- line-height: 16px;
111
- color: #4b4a53;
110
+ line-height: 17px;
111
+ color: #9c9ca6;
112
112
  }
113
113
  }
114
114
 
@@ -23,6 +23,7 @@ input {
23
23
  color: #4b4a53;
24
24
  font-weight: 500;
25
25
  border: none;
26
+ font-size: 14px;
26
27
  }
27
28
 
28
29
  ::-webkit-input-placeholder {
@@ -2265,12 +2265,15 @@
2265
2265
  }
2266
2266
  return value;
2267
2267
  };
2268
+ MonkeyInputComponent.prototype.replaceZero = function (value) {
2269
+ return ("" + value).replace(new RegExp(/0/, 'g'), '');
2270
+ };
2268
2271
  MonkeyInputComponent.prototype.formatValue = function (value) {
2269
2272
  var _a, _b;
2270
2273
  var settings = this.settings;
2271
2274
  if (this.currency) {
2272
- if (!value)
2273
- value = 0;
2275
+ if (!value || !this.replaceZero(value))
2276
+ return '';
2274
2277
  return this.currencyPipe.transform(value, ((_a = settings === null || settings === void 0 ? void 0 : settings.currency) === null || _a === void 0 ? void 0 : _a.code) || 'BRL', '', '1.2-2', ((_b = settings === null || settings === void 0 ? void 0 : settings.currency) === null || _b === void 0 ? void 0 : _b.locale) || 'pt-BR');
2275
2278
  }
2276
2279
  else if (this.percent) {
@@ -2342,10 +2345,16 @@
2342
2345
  (_c = (_b = (_a = document === null || document === void 0 ? void 0 : document.getElementById(this._id)) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('input')) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.focus();
2343
2346
  };
2344
2347
  MonkeyInputComponent.prototype.onKeyPress = function (event) {
2348
+ var _a;
2345
2349
  var pattern = null;
2350
+ var cmp = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value;
2346
2351
  var inputChar = String.fromCharCode(event.charCode);
2347
2352
  if (this.currency || this.onlyNumber || this.percent) {
2348
2353
  pattern = /[0-9]/;
2354
+ if (inputChar === '0' && !this.replaceZero(cmp)) {
2355
+ event.preventDefault();
2356
+ return;
2357
+ }
2349
2358
  }
2350
2359
  else if (this.onlyAlphaNumeric) {
2351
2360
  pattern = /[^0-9A-Za-z]/;