monkey-style-guide 2.0.32 → 2.0.37

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.
@@ -2238,7 +2238,7 @@
2238
2238
  return ("" + value).toLowerCase();
2239
2239
  else if (this.capitalize)
2240
2240
  return MonkeyUtils.capitalize(("" + value).toUpperCase());
2241
- else if (this.currency) {
2241
+ else if (this.currency || this.percent) {
2242
2242
  return MonkeyUtils.handleOnlyNumbers("" + value) / (apply ? 100 : 1);
2243
2243
  }
2244
2244
  return value;
@@ -2249,6 +2249,9 @@
2249
2249
  if (this.currency) {
2250
2250
  return this.currencyPipe.transform("" + value, ((_a = settings === null || settings === void 0 ? void 0 : settings.currency) === null || _a === void 0 ? void 0 : _a.code) || 'BRL', 'symbol', '', ((_b = settings === null || settings === void 0 ? void 0 : settings.currency) === null || _b === void 0 ? void 0 : _b.locale) || 'pt-BR');
2251
2251
  }
2252
+ else if (this.percent) {
2253
+ return value + " %";
2254
+ }
2252
2255
  return value;
2253
2256
  };
2254
2257
  MonkeyInputComponent.prototype.ngOnInit = function () {
@@ -2273,13 +2276,11 @@
2273
2276
  return this.handledValue;
2274
2277
  },
2275
2278
  set: function (value) {
2276
- if (value) {
2277
- this.handledValue = value;
2278
- this._formatedValue = this.formatValue(value);
2279
- this.cdr.detectChanges();
2280
- this.onModelChange(this.handledValue);
2281
- this.onModelTouched(this.handledValue);
2282
- }
2279
+ this.handledValue = value;
2280
+ this._formatedValue = this.formatValue(value);
2281
+ this.cdr.detectChanges();
2282
+ this.onModelChange(this.handledValue);
2283
+ this.onModelTouched(this.handledValue);
2283
2284
  },
2284
2285
  enumerable: false,
2285
2286
  configurable: true
@@ -2305,7 +2306,7 @@
2305
2306
  MonkeyInputComponent.prototype.onKeyPress = function (event) {
2306
2307
  var pattern = null;
2307
2308
  var inputChar = String.fromCharCode(event.charCode);
2308
- if (this.currency || this.onlyNumber) {
2309
+ if (this.currency || this.onlyNumber || this.percent) {
2309
2310
  pattern = /[0-9]/;
2310
2311
  }
2311
2312
  else if (this.onlyAlphaNumeric) {
@@ -2355,6 +2356,7 @@
2355
2356
  lowerCase: [{ type: core.Input }],
2356
2357
  capitalize: [{ type: core.Input }],
2357
2358
  currency: [{ type: core.Input }],
2359
+ percent: [{ type: core.Input }],
2358
2360
  maxDateToday: [{ type: core.Input }],
2359
2361
  onChange: [{ type: core.Output }],
2360
2362
  monkeyInput: [{ type: core.ViewChild, args: ['monkeyInput', {
@@ -2600,6 +2602,7 @@
2600
2602
  var MonkeySelectComponent = /** @class */ (function () {
2601
2603
  function MonkeySelectComponent(cdRef) {
2602
2604
  this.cdRef = cdRef;
2605
+ this.labelSelect = 'Selecione';
2603
2606
  this.onHandleOptions = new core.EventEmitter();
2604
2607
  this.onChange = new core.EventEmitter();
2605
2608
  this.onModelChange = function (value) { };
@@ -2712,7 +2715,7 @@
2712
2715
  MonkeySelectComponent.decorators = [
2713
2716
  { type: core.Component, args: [{
2714
2717
  selector: 'monkey-select',
2715
- template: "\n <mecx-form-field [id]=\"_id\" [ngClass]=\"{ disabled: _disabled }\">\n <mecx-form-field-header>\n <label>\n {{ label }}\n </label>\n <helper>\n {{ helperMessage }}\n </helper>\n </mecx-form-field-header>\n <mecx-form-field-body (click)=\"open()\">\n <monkey-icon [icon]=\"icon\" [color]=\"'#4B4A53'\"></monkey-icon>\n <mecx-select class=\"trigger\" [ngClass]=\"{ open: _opened }\">\n <mecx-select__trigger>\n <span>\n {{ _selected?.label || 'Selecione' }}\n </span>\n <monkey-icon\n [icon]=\"!_opened ? 'arrow-down-16' : 'arrow-up-16'\"\n [color]=\"'#4B4A53'\"\n ></monkey-icon>\n </mecx-select__trigger>\n </mecx-select>\n </mecx-form-field-body>\n <mecx-select-inside [ngClass]=\"{ open: _opened }\">\n <mecx-select-options #selectOptions>\n <ng-content> </ng-content>\n </mecx-select-options>\n </mecx-select-inside>\n <mecx-form-field-footer>\n <info>\n {{ infoMessage }}\n </info>\n <error>\n {{ errorMessage }}\n </error>\n </mecx-form-field-footer>\n </mecx-form-field>\n ",
2718
+ template: "\n <mecx-form-field [id]=\"_id\" [ngClass]=\"{ disabled: _disabled }\">\n <mecx-form-field-header>\n <label>\n {{ label }}\n </label>\n <helper>\n {{ helperMessage }}\n </helper>\n </mecx-form-field-header>\n <mecx-form-field-body (click)=\"open()\">\n <monkey-icon [icon]=\"icon\" [color]=\"'#4B4A53'\"></monkey-icon>\n <mecx-select class=\"trigger\" [ngClass]=\"{ open: _opened }\">\n <mecx-select__trigger>\n <span>\n {{ _selected?.label || labelSelect }}\n </span>\n <monkey-icon\n [icon]=\"!_opened ? 'arrow-down-16' : 'arrow-up-16'\"\n [color]=\"'#4B4A53'\"\n ></monkey-icon>\n </mecx-select__trigger>\n </mecx-select>\n </mecx-form-field-body>\n <mecx-select-inside [ngClass]=\"{ open: _opened }\">\n <mecx-select-options #selectOptions>\n <ng-content> </ng-content>\n </mecx-select-options>\n </mecx-select-inside>\n <mecx-form-field-footer>\n <info>\n {{ infoMessage }}\n </info>\n <error>\n {{ errorMessage }}\n </error>\n </mecx-form-field-footer>\n </mecx-form-field>\n ",
2716
2719
  encapsulation: core.ViewEncapsulation.None,
2717
2720
  providers: [
2718
2721
  {
@@ -2733,6 +2736,7 @@
2733
2736
  icon: [{ type: core.Input }],
2734
2737
  infoMessage: [{ type: core.Input }],
2735
2738
  errorMessage: [{ type: core.Input }],
2739
+ labelSelect: [{ type: core.Input }],
2736
2740
  onHandleOptions: [{ type: core.Input }],
2737
2741
  onChange: [{ type: core.Output }],
2738
2742
  selectOptions: [{ type: core.ViewChild, args: ['selectOptions', { static: true },] }],