monkey-style-guide 2.0.86 → 2.0.91
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.
- package/assets/scss/partials/components/_date-range-picker.scss +4 -5
- package/assets/scss/partials/components/_index.scss +1 -0
- package/assets/scss/partials/components/_input-phone.scss +17 -0
- package/bundles/monkey-style-guide.umd.js +248 -27
- package/bundles/monkey-style-guide.umd.js.map +1 -1
- package/esm2015/lib/components/date-range-picker/date-range-picker.component.js +31 -26
- package/esm2015/lib/components/date-range-picker/date-range-picker.component.ngfactory.js +20 -21
- package/esm2015/lib/components/date-range-picker/date-range-picker.component.ngsummary.json +1 -1
- package/esm2015/lib/components/date-range-picker/date-range-picker.module.ngfactory.js +1 -1
- package/esm2015/lib/components/date-range-picker/index.ngsummary.json +1 -1
- package/esm2015/lib/components/index.js +2 -1
- package/esm2015/lib/components/index.ngsummary.json +1 -1
- package/esm2015/lib/components/input-phone/index.js +3 -0
- package/esm2015/lib/components/input-phone/index.ngsummary.json +1 -0
- package/esm2015/lib/components/input-phone/input-phone.component.js +205 -0
- package/esm2015/lib/components/input-phone/input-phone.component.ngfactory.js +27 -0
- package/esm2015/lib/components/input-phone/input-phone.component.ngsummary.json +1 -0
- package/esm2015/lib/components/input-phone/input-phone.module.js +25 -0
- package/esm2015/lib/components/input-phone/input-phone.module.ngfactory.js +18 -0
- package/esm2015/lib/components/input-phone/input-phone.module.ngsummary.json +1 -0
- package/esm2015/monkey-style-guide.ngsummary.json +1 -1
- package/esm2015/public-api.ngsummary.json +1 -1
- package/fesm2015/monkey-style-guide.js +247 -25
- package/fesm2015/monkey-style-guide.js.map +1 -1
- package/lib/components/date-range-picker/date-range-picker.component.d.ts +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/input-phone/index.d.ts +2 -0
- package/lib/components/input-phone/input-phone.component.d.ts +61 -0
- package/lib/components/input-phone/input-phone.component.ngfactory.d.ts +1 -0
- package/lib/components/input-phone/input-phone.module.d.ts +2 -0
- package/lib/components/input-phone/input-phone.module.ngfactory.d.ts +3 -0
- package/monkey-style-guide-2.0.91.tgz +0 -0
- package/monkey-style-guide.metadata.json +1 -1
- package/package.json +3 -2
- package/monkey-style-guide-2.0.86.tgz +0 -0
|
@@ -22,11 +22,6 @@ monkey-date-range-picker {
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
width: 100%;
|
|
24
24
|
|
|
25
|
-
&.error {
|
|
26
|
-
border: 1px solid #fa3838;
|
|
27
|
-
padding: 4px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
mecx-date-range-picker-group-body {
|
|
31
26
|
display: flex;
|
|
32
27
|
width: 100%;
|
|
@@ -81,6 +76,10 @@ monkey-date-range-picker {
|
|
|
81
76
|
padding-top: 16px;
|
|
82
77
|
align-items: flex-end;
|
|
83
78
|
|
|
79
|
+
&.error {
|
|
80
|
+
border-top: 1px solid #fa3838;
|
|
81
|
+
}
|
|
82
|
+
|
|
84
83
|
.action-days > * {
|
|
85
84
|
margin-right: 24px;
|
|
86
85
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**************************
|
|
2
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
3
|
+
* This style guide was developed by Monkey Exchange Team
|
|
4
|
+
* MIT Licence
|
|
5
|
+
**************************/
|
|
6
|
+
@import '../variables';
|
|
7
|
+
@import '../breakpoints.scss';
|
|
8
|
+
|
|
9
|
+
monkey-input-phone {
|
|
10
|
+
mecx-form-field mecx-form-field-header {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
mecx-form-field mecx-form-field-footer {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('@angular/common'), require('@angular/forms'), require('rxjs/operators'), require('moment'), require('ngx-mask'), require('@angular/platform-browser')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('monkey-style-guide', ['exports', '@angular/core', '@angular/common/http', 'rxjs', '@angular/common', '@angular/forms', 'rxjs/operators', 'moment', 'ngx-mask', '@angular/platform-browser'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['monkey-style-guide'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.ng.common, global.ng.forms, global.rxjs.operators, global.moment, global['ngx-mask'], global.ng.platformBrowser));
|
|
5
|
-
}(this, (function (exports, core, http, rxjs, common, forms, operators, moment_, ngxMask, platformBrowser) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('@angular/common'), require('@angular/forms'), require('rxjs/operators'), require('moment'), require('ngx-mask'), require('google-libphonenumber'), require('@angular/platform-browser')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('monkey-style-guide', ['exports', '@angular/core', '@angular/common/http', 'rxjs', '@angular/common', '@angular/forms', 'rxjs/operators', 'moment', 'ngx-mask', 'google-libphonenumber', '@angular/platform-browser'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['monkey-style-guide'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.ng.common, global.ng.forms, global.rxjs.operators, global.moment, global['ngx-mask'], global['google-libphonenumber'], global.ng.platformBrowser));
|
|
5
|
+
}(this, (function (exports, core, http, rxjs, common, forms, operators, moment_, ngxMask, googleLibphonenumber, platformBrowser) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -2247,12 +2247,6 @@
|
|
|
2247
2247
|
];
|
|
2248
2248
|
|
|
2249
2249
|
var moment = moment___namespace;
|
|
2250
|
-
var ɵ0 = function () {
|
|
2251
|
-
var isMobileWidth = window.screen.width <= 640 ||
|
|
2252
|
-
(window.matchMedia && window.matchMedia('only screen and (max-width: 640px)').matches);
|
|
2253
|
-
return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent) || isMobileWidth);
|
|
2254
|
-
};
|
|
2255
|
-
var isMobile = (ɵ0)();
|
|
2256
2250
|
var MonkeyDateRangePickerComponent = /** @class */ (function () {
|
|
2257
2251
|
function MonkeyDateRangePickerComponent(fb, cdr) {
|
|
2258
2252
|
this.fb = fb;
|
|
@@ -2310,9 +2304,11 @@
|
|
|
2310
2304
|
};
|
|
2311
2305
|
MonkeyDateRangePickerComponent.prototype.build = function () {
|
|
2312
2306
|
this._daysArrFirst = this.createCalendar(this._dateFirst);
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2307
|
+
this._daysArrSecond = this.createCalendar(this._dateSecond);
|
|
2308
|
+
};
|
|
2309
|
+
MonkeyDateRangePickerComponent.prototype.clearDates = function () {
|
|
2310
|
+
this._dateForm.setValue({ startDate: null, endDate: null });
|
|
2311
|
+
this.writeValue(this._dateForm.value);
|
|
2316
2312
|
};
|
|
2317
2313
|
MonkeyDateRangePickerComponent.prototype.navigateToToday = function () {
|
|
2318
2314
|
this._dateFirst = moment();
|
|
@@ -2333,10 +2329,13 @@
|
|
|
2333
2329
|
return this._dateForm.value;
|
|
2334
2330
|
},
|
|
2335
2331
|
set: function (value) {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2332
|
+
if (Object.prototype.hasOwnProperty.call(value, 'startDate') &&
|
|
2333
|
+
Object.prototype.hasOwnProperty.call(value, 'endDate')) {
|
|
2334
|
+
this._dateForm.setValue(value);
|
|
2335
|
+
this.cdr.detectChanges();
|
|
2336
|
+
this.onModelChange(this._dateForm.value);
|
|
2337
|
+
this.onModelTouched(this._dateForm.value);
|
|
2338
|
+
}
|
|
2340
2339
|
},
|
|
2341
2340
|
enumerable: false,
|
|
2342
2341
|
configurable: true
|
|
@@ -2390,17 +2389,24 @@
|
|
|
2390
2389
|
var _dateForm = this._dateForm;
|
|
2391
2390
|
var dayFormatted = day.format('YYYY-MM-DD');
|
|
2392
2391
|
if (_dateForm.valid) {
|
|
2393
|
-
|
|
2394
|
-
this.writeValue(null);
|
|
2395
|
-
return;
|
|
2392
|
+
this.clearDates();
|
|
2396
2393
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2394
|
+
var _a = _dateForm.value, startDate = _a.startDate, endDate = _a.endDate;
|
|
2395
|
+
if (startDate) {
|
|
2396
|
+
if (moment(startDate).isAfter(moment(dayFormatted))) {
|
|
2397
|
+
endDate = startDate;
|
|
2398
|
+
startDate = dayFormatted;
|
|
2399
|
+
}
|
|
2399
2400
|
}
|
|
2400
|
-
else
|
|
2401
|
-
|
|
2402
|
-
|
|
2401
|
+
else
|
|
2402
|
+
startDate = dayFormatted;
|
|
2403
|
+
if (startDate) {
|
|
2404
|
+
_dateForm.get('startDate').patchValue(startDate);
|
|
2405
|
+
}
|
|
2406
|
+
if (endDate) {
|
|
2407
|
+
_dateForm.get('endDate').patchValue(endDate);
|
|
2403
2408
|
}
|
|
2409
|
+
this.writeValue(_dateForm.value);
|
|
2404
2410
|
};
|
|
2405
2411
|
MonkeyDateRangePickerComponent.prototype.selectRangeOfDays = function (days) {
|
|
2406
2412
|
var _a = this, _dateForm = _a._dateForm, today = _a.today;
|
|
@@ -2416,7 +2422,7 @@
|
|
|
2416
2422
|
MonkeyDateRangePickerComponent.decorators = [
|
|
2417
2423
|
{ type: core.Component, args: [{
|
|
2418
2424
|
selector: 'monkey-date-range-picker',
|
|
2419
|
-
template: "\n <mecx-date-range-picker-group
|
|
2425
|
+
template: "\n <mecx-date-range-picker-group>\n <mecx-date-range-picker-group-body>\n <mecx-date-range-picker class=\"first-date-range\">\n <mecx-date-range-picker-header>\n <div class=\"calendar-title\">\n <monkey-button\n class=\"calendar-previous\"\n color=\"theme\"\n icon=\"arrow-left-16\"\n type=\"tertiary\"\n (click)=\"previousMonth()\"\n size=\"sm\"\n >\n </monkey-button>\n <div class=\"month-year-title\">\n {{ i18n?.months?.[_dateFirst.format('M')] }}\n {{ _dateFirst.format('YYYY') }}\n </div>\n <monkey-button\n class=\"calendar-next\"\n color=\"theme\"\n icon=\"arrow-right-16\"\n type=\"tertiary\"\n (click)=\"nextMonth()\"\n size=\"sm\"\n >\n </monkey-button>\n </div>\n <div class=\"week\">\n <span class=\"week-day\" *ngFor=\"let day of [1, 2, 3, 4, 5, 6, 7]\">\n {{ i18n?.days?.[day]}}\n </span>\n </div>\n </mecx-date-range-picker-header>\n <mecx-date-range-picker-body>\n <div class=\"month-week\" *ngFor=\"let week of _daysArrFirst\">\n <div\n class=\"month-day\"\n (click)=\"selectedDate(day)\"\n [ngClass]=\"{\n inactive: !day,\n selected: isSelected(day),\n today: todayCheck(day),\n 'first-selected': isFirstSelected(day),\n 'last-selected': isLastSelected(day)\n }\"\n *ngFor=\"let day of week\"\n #divOne\n >\n {{ day?.date() }}\n </div>\n </div>\n </mecx-date-range-picker-body>\n </mecx-date-range-picker>\n\n <mecx-date-range-picker class=\"second-date-range\">\n <mecx-date-range-picker-header>\n <div class=\"calendar-title\">\n <div class=\"month-year-title\">\n {{ i18n?.months?.[_dateSecond.format('M')] }}\n {{ _dateSecond.format('YYYY') }}\n </div>\n <monkey-button\n class=\"calendar-previous\"\n color=\"theme\"\n icon=\"arrow-right-16\"\n type=\"tertiary\"\n (click)=\"nextMonth()\"\n size=\"sm\"\n >\n </monkey-button>\n </div>\n <div class=\"week\">\n <span class=\"week-day\" *ngFor=\"let day of [1, 2, 3, 4, 5, 6, 7]\">\n {{ i18n?.days?.[day]}}\n </span>\n </div>\n </mecx-date-range-picker-header>\n <mecx-date-range-picker-body>\n <div class=\"month-week\" *ngFor=\"let week of _daysArrSecond\">\n <div\n class=\"month-day\"\n (click)=\"selectedDate(day)\"\n [ngClass]=\"{\n inactive: !day,\n selected: isSelected(day),\n today: todayCheck(day),\n 'first-selected': isFirstSelected(day),\n 'last-selected': isLastSelected(day)\n }\"\n *ngFor=\"let day of week\"\n >\n {{ day?.date() }}\n </div>\n </div>\n </mecx-date-range-picker-body>\n </mecx-date-range-picker>\n </mecx-date-range-picker-group-body>\n <mecx-date-range-picker-group-info>\n <info>\n {{ infoMessage }}\n </info>\n <error>\n {{ errorMessage }}\n </error>\n </mecx-date-range-picker-group-info>\n <mecx-date-range-picker-group-action [class.error]=\"errorMessage?.trim()\">\n <div class=\"action-days\">\n <monkey-button color=\"theme\" type=\"secondary\" (click)=\"selectRangeOfDays(30)\">\n {{ i18n?.actions?.['30'] }}\n </monkey-button>\n <monkey-button color=\"theme\" type=\"secondary\" (click)=\"selectRangeOfDays(60)\">\n {{ i18n?.actions?.['60'] }}\n </monkey-button>\n <monkey-button color=\"theme\" type=\"secondary\" (click)=\"selectRangeOfDays(90)\">\n {{ i18n?.actions?.['90'] }}\n </monkey-button>\n </div>\n <monkey-button color=\"theme\" type=\"primary\" (click)=\"navigateToToday()\">\n {{ i18n?.today }}\n </monkey-button>\n </mecx-date-range-picker-group-action>\n </mecx-date-range-picker-group>\n ",
|
|
2420
2426
|
encapsulation: core.ViewEncapsulation.None,
|
|
2421
2427
|
providers: [
|
|
2422
2428
|
{
|
|
@@ -2797,6 +2803,199 @@
|
|
|
2797
2803
|
},] }
|
|
2798
2804
|
];
|
|
2799
2805
|
|
|
2806
|
+
/**************************
|
|
2807
|
+
* Copyright Monkey Exchange. All Rights Reserved
|
|
2808
|
+
* This style guide was developed by Monkey Exchange Team
|
|
2809
|
+
* MIT Licence
|
|
2810
|
+
**************************/
|
|
2811
|
+
var phoneUtil = googleLibphonenumber.PhoneNumberUtil.getInstance();
|
|
2812
|
+
var formatter = new googleLibphonenumber.AsYouTypeFormatter('US');
|
|
2813
|
+
var MonkeyInputPhoneComponent = /** @class */ (function () {
|
|
2814
|
+
function MonkeyInputPhoneComponent(currencyPipe, settingsService, cdr) {
|
|
2815
|
+
this.currencyPipe = currencyPipe;
|
|
2816
|
+
this.settingsService = settingsService;
|
|
2817
|
+
this.cdr = cdr;
|
|
2818
|
+
this.name = "mecx-input-phone-" + MonkeyUtils.getRandomString(10);
|
|
2819
|
+
this.helperMessage = '';
|
|
2820
|
+
this.placeholder = '';
|
|
2821
|
+
this.maxLength = 255;
|
|
2822
|
+
this.maxDateToday = false;
|
|
2823
|
+
this.onChange = new core.EventEmitter();
|
|
2824
|
+
this.onModelChange = function (value) { };
|
|
2825
|
+
this.onModelTouched = function (value) { };
|
|
2826
|
+
this._id = "mecx-input-phone-" + MonkeyUtils.getRandomString(10);
|
|
2827
|
+
this._disabled = false;
|
|
2828
|
+
this._maxDateToday = new Date().toISOString().split('T')[0];
|
|
2829
|
+
this._symbol = '';
|
|
2830
|
+
this._countryCodes = [];
|
|
2831
|
+
}
|
|
2832
|
+
MonkeyInputPhoneComponent.prototype.handleValue = function (value, apply) {
|
|
2833
|
+
if (apply === void 0) { apply = false; }
|
|
2834
|
+
if (this.onlyNumber) {
|
|
2835
|
+
return MonkeyUtils.handleOnlyNumbers("" + value);
|
|
2836
|
+
}
|
|
2837
|
+
else if (this.onlyAlphaNumeric)
|
|
2838
|
+
return MonkeyUtils.handleOnlyAlphaNumeric("" + value);
|
|
2839
|
+
else if (this.upperCase)
|
|
2840
|
+
return ("" + value).toUpperCase();
|
|
2841
|
+
else if (this.lowerCase)
|
|
2842
|
+
return ("" + value).toLowerCase();
|
|
2843
|
+
else if (this.capitalize)
|
|
2844
|
+
return MonkeyUtils.capitalize(("" + value).toUpperCase());
|
|
2845
|
+
else if (this.currency || this.percent) {
|
|
2846
|
+
return MonkeyUtils.handleOnlyNumbers("" + value) / (apply ? 100 : 1);
|
|
2847
|
+
}
|
|
2848
|
+
return value;
|
|
2849
|
+
};
|
|
2850
|
+
MonkeyInputPhoneComponent.prototype.replaceZero = function (value) {
|
|
2851
|
+
return ("" + value).replace(new RegExp(/0/, 'g'), '');
|
|
2852
|
+
};
|
|
2853
|
+
MonkeyInputPhoneComponent.prototype.formatValue = function (value) {
|
|
2854
|
+
//console.log(this.phoneUtil);
|
|
2855
|
+
//console.log(this.phoneUtil.formatInOriginalFormat(value, 'US'));
|
|
2856
|
+
//this.phoneUtil.inputDigit('2');
|
|
2857
|
+
console.log(formatter.inputDigit(value));
|
|
2858
|
+
var number = phoneUtil.parse(value, 'BR');
|
|
2859
|
+
console.log(phoneUtil.isPossibleNumber(number));
|
|
2860
|
+
console.log(phoneUtil.format(number, googleLibphonenumber.PhoneNumberFormat.INTERNATIONAL));
|
|
2861
|
+
return phoneUtil.format(number, googleLibphonenumber.PhoneNumberFormat.INTERNATIONAL);
|
|
2862
|
+
};
|
|
2863
|
+
MonkeyInputPhoneComponent.prototype.handleSymbol = function () {
|
|
2864
|
+
var _a;
|
|
2865
|
+
var settings = this.settings;
|
|
2866
|
+
if (this.currency) {
|
|
2867
|
+
this._symbol = {
|
|
2868
|
+
BRL: 'R$',
|
|
2869
|
+
CLP: 'CLP',
|
|
2870
|
+
}[((_a = settings === null || settings === void 0 ? void 0 : settings.currency) === null || _a === void 0 ? void 0 : _a.code) || 'BRL'];
|
|
2871
|
+
}
|
|
2872
|
+
else if (this.percent) {
|
|
2873
|
+
this._symbol = '%';
|
|
2874
|
+
}
|
|
2875
|
+
};
|
|
2876
|
+
MonkeyInputPhoneComponent.prototype.ngOnInit = function () {
|
|
2877
|
+
var _this = this;
|
|
2878
|
+
var settingsService = this.settingsService;
|
|
2879
|
+
this._oldType = this.type;
|
|
2880
|
+
settingsService.settings().subscribe(function (val) {
|
|
2881
|
+
_this.settings = val;
|
|
2882
|
+
_this.handleSymbol();
|
|
2883
|
+
});
|
|
2884
|
+
this._countryCodes = phoneUtil
|
|
2885
|
+
.getSupportedRegions()
|
|
2886
|
+
.map(function (code) {
|
|
2887
|
+
return phoneUtil.getCountryCodeForRegion(code);
|
|
2888
|
+
})
|
|
2889
|
+
.filter(function (v, i, a) { return a.indexOf(v) === i; })
|
|
2890
|
+
.sort(function (a, b) { return (a < b ? -1 : 1); });
|
|
2891
|
+
};
|
|
2892
|
+
MonkeyInputPhoneComponent.prototype.registerOnChange = function (fn) {
|
|
2893
|
+
this.onModelChange = fn;
|
|
2894
|
+
};
|
|
2895
|
+
MonkeyInputPhoneComponent.prototype.registerOnTouched = function (fn) {
|
|
2896
|
+
this.onModelTouched = fn;
|
|
2897
|
+
};
|
|
2898
|
+
MonkeyInputPhoneComponent.prototype.setDisabledState = function (isDisabled) {
|
|
2899
|
+
this._disabled = isDisabled;
|
|
2900
|
+
};
|
|
2901
|
+
Object.defineProperty(MonkeyInputPhoneComponent.prototype, "value", {
|
|
2902
|
+
get: function () {
|
|
2903
|
+
return this.handledValue;
|
|
2904
|
+
},
|
|
2905
|
+
set: function (value) {
|
|
2906
|
+
this.handledValue = value;
|
|
2907
|
+
this._formatedValue = this.formatValue(value);
|
|
2908
|
+
this.cdr.detectChanges();
|
|
2909
|
+
this.onModelChange(this.handledValue);
|
|
2910
|
+
this.onModelTouched(this.handledValue);
|
|
2911
|
+
},
|
|
2912
|
+
enumerable: false,
|
|
2913
|
+
configurable: true
|
|
2914
|
+
});
|
|
2915
|
+
MonkeyInputPhoneComponent.prototype.writeValue = function (value) {
|
|
2916
|
+
this.value = value;
|
|
2917
|
+
};
|
|
2918
|
+
MonkeyInputPhoneComponent.prototype.onChangeValue = function (event) {
|
|
2919
|
+
var value = this._formatedValue;
|
|
2920
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
2921
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
2922
|
+
var handled = this.handleValue(value, true);
|
|
2923
|
+
this.writeValue(handled);
|
|
2924
|
+
this.onChange.next(handled);
|
|
2925
|
+
};
|
|
2926
|
+
MonkeyInputPhoneComponent.prototype.onShowAndHidePassword = function () {
|
|
2927
|
+
this.type = this.type === 'password' ? 'text' : 'password';
|
|
2928
|
+
};
|
|
2929
|
+
MonkeyInputPhoneComponent.prototype.onClick = function () {
|
|
2930
|
+
var _a, _b, _c;
|
|
2931
|
+
(_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();
|
|
2932
|
+
};
|
|
2933
|
+
MonkeyInputPhoneComponent.prototype.onKeyPress = function (event) {
|
|
2934
|
+
var _a;
|
|
2935
|
+
var pattern = null;
|
|
2936
|
+
var cmp = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
2937
|
+
var inputChar = String.fromCharCode(event.charCode);
|
|
2938
|
+
if (this.currency || this.onlyNumber || this.percent) {
|
|
2939
|
+
pattern = /[0-9]/;
|
|
2940
|
+
if (inputChar === '0' && !this.replaceZero(cmp)) {
|
|
2941
|
+
event.preventDefault();
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
else if (this.onlyAlphaNumeric) {
|
|
2946
|
+
pattern = /[^0-9A-Za-z]/;
|
|
2947
|
+
}
|
|
2948
|
+
if (pattern && !pattern.test(inputChar)) {
|
|
2949
|
+
event.preventDefault();
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
return MonkeyInputPhoneComponent;
|
|
2953
|
+
}());
|
|
2954
|
+
MonkeyInputPhoneComponent.decorators = [
|
|
2955
|
+
{ type: core.Component, args: [{
|
|
2956
|
+
selector: 'monkey-input-phone',
|
|
2957
|
+
template: "\n <monkey-select\n [label]=\"'teste'\"\n errorMessage=\"\"\n errorMessage=\"\"\n [placeholder]=\"'Selecione um banco'\"\n >\n <monkey-option label=\"op\" value=\"op\"> </monkey-option>\n <monkey-option label=\"op\" value=\"op\"> </monkey-option>\n <monkey-option label=\"op\" value=\"op\"> </monkey-option>\n </monkey-select>\n ",
|
|
2958
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
2959
|
+
providers: [
|
|
2960
|
+
{
|
|
2961
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
2962
|
+
useExisting: core.forwardRef(function () { return MonkeyInputPhoneComponent; }),
|
|
2963
|
+
multi: true,
|
|
2964
|
+
},
|
|
2965
|
+
common.CurrencyPipe,
|
|
2966
|
+
]
|
|
2967
|
+
},] }
|
|
2968
|
+
];
|
|
2969
|
+
MonkeyInputPhoneComponent.ctorParameters = function () { return [
|
|
2970
|
+
{ type: common.CurrencyPipe },
|
|
2971
|
+
{ type: MonkeyStyleGuideSettingsService },
|
|
2972
|
+
{ type: core.ChangeDetectorRef }
|
|
2973
|
+
]; };
|
|
2974
|
+
MonkeyInputPhoneComponent.propDecorators = {
|
|
2975
|
+
name: [{ type: core.Input }],
|
|
2976
|
+
label: [{ type: core.Input }],
|
|
2977
|
+
helperMessage: [{ type: core.Input }],
|
|
2978
|
+
placeholder: [{ type: core.Input }],
|
|
2979
|
+
icon: [{ type: core.Input }],
|
|
2980
|
+
type: [{ type: core.Input }],
|
|
2981
|
+
infoMessage: [{ type: core.Input }],
|
|
2982
|
+
errorMessage: [{ type: core.Input }],
|
|
2983
|
+
mask: [{ type: core.Input }],
|
|
2984
|
+
prefix: [{ type: core.Input }],
|
|
2985
|
+
maxLength: [{ type: core.Input }],
|
|
2986
|
+
onlyNumber: [{ type: core.Input }],
|
|
2987
|
+
onlyAlphaNumeric: [{ type: core.Input }],
|
|
2988
|
+
upperCase: [{ type: core.Input }],
|
|
2989
|
+
lowerCase: [{ type: core.Input }],
|
|
2990
|
+
capitalize: [{ type: core.Input }],
|
|
2991
|
+
currency: [{ type: core.Input }],
|
|
2992
|
+
percent: [{ type: core.Input }],
|
|
2993
|
+
maxDateToday: [{ type: core.Input }],
|
|
2994
|
+
onChange: [{ type: core.Output }],
|
|
2995
|
+
value: [{ type: core.Input }],
|
|
2996
|
+
onClick: [{ type: core.HostListener, args: ['click',] }]
|
|
2997
|
+
};
|
|
2998
|
+
|
|
2800
2999
|
/**************************
|
|
2801
3000
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
2802
3001
|
* This style guide was developed by Monkey Exchange Team
|
|
@@ -3604,6 +3803,27 @@
|
|
|
3604
3803
|
},] }
|
|
3605
3804
|
];
|
|
3606
3805
|
|
|
3806
|
+
var MonkeyInputPhoneModule = /** @class */ (function () {
|
|
3807
|
+
function MonkeyInputPhoneModule() {
|
|
3808
|
+
}
|
|
3809
|
+
return MonkeyInputPhoneModule;
|
|
3810
|
+
}());
|
|
3811
|
+
MonkeyInputPhoneModule.decorators = [
|
|
3812
|
+
{ type: core.NgModule, args: [{
|
|
3813
|
+
declarations: [MonkeyInputPhoneComponent],
|
|
3814
|
+
imports: [
|
|
3815
|
+
common.CommonModule,
|
|
3816
|
+
forms.FormsModule,
|
|
3817
|
+
forms.ReactiveFormsModule,
|
|
3818
|
+
ngxMask.NgxMaskModule.forRoot(),
|
|
3819
|
+
MonkeyIconModule,
|
|
3820
|
+
MonkeySelectModule,
|
|
3821
|
+
],
|
|
3822
|
+
exports: [MonkeyInputPhoneComponent],
|
|
3823
|
+
schemas: [core.NO_ERRORS_SCHEMA],
|
|
3824
|
+
},] }
|
|
3825
|
+
];
|
|
3826
|
+
|
|
3607
3827
|
/**************************
|
|
3608
3828
|
* Copyright Monkey Exchange. All Rights Reserved
|
|
3609
3829
|
* This style guide was developed by Monkey Exchange Team
|
|
@@ -4978,6 +5198,8 @@
|
|
|
4978
5198
|
exports.MonkeyInputComponent = MonkeyInputComponent;
|
|
4979
5199
|
exports.MonkeyInputFilterComponent = MonkeyInputFilterComponent;
|
|
4980
5200
|
exports.MonkeyInputModule = MonkeyInputModule;
|
|
5201
|
+
exports.MonkeyInputPhoneComponent = MonkeyInputPhoneComponent;
|
|
5202
|
+
exports.MonkeyInputPhoneModule = MonkeyInputPhoneModule;
|
|
4981
5203
|
exports.MonkeyModalComponent = MonkeyModalComponent;
|
|
4982
5204
|
exports.MonkeyModalModule = MonkeyModalModule;
|
|
4983
5205
|
exports.MonkeyOptionComponent = MonkeyOptionComponent;
|
|
@@ -5006,7 +5228,6 @@
|
|
|
5006
5228
|
exports.MonkeyUtils = MonkeyUtils;
|
|
5007
5229
|
exports.MonkeyWizardComponent = MonkeyWizardComponent;
|
|
5008
5230
|
exports.MonkeyWizardModule = MonkeyWizardModule;
|
|
5009
|
-
exports.ɵ0 = ɵ0;
|
|
5010
5231
|
exports.ɵa = MonkeyStyleGuideService;
|
|
5011
5232
|
exports.ɵb = MonkeyStyleGuideSettingsService;
|
|
5012
5233
|
exports.ɵc = MonkeyStyleGuideThemeSettingsService;
|