@seniorsistemas/angular-components 17.9.3 → 17.9.4
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/bundles/seniorsistemas-angular-components.umd.js +192 -30
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/dynamic-form/components/fields/currency/currency-field.component.d.ts +3 -1
- package/components/dynamic-form/configurations/fields/currency-field.d.ts +1 -0
- package/esm2015/components/dynamic-form/components/fields/currency/currency-field.component.js +7 -4
- package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +2 -1
- package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
- package/esm2015/utils/currency/currency.service.js +162 -2
- package/esm5/components/dynamic-form/components/fields/currency/currency-field.component.js +7 -4
- package/esm5/components/dynamic-form/configurations/fields/currency-field.js +2 -1
- package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
- package/esm5/utils/currency/currency.service.js +162 -2
- package/fesm2015/seniorsistemas-angular-components.js +190 -28
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +192 -30
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
- package/utils/currency/currency.service.d.ts +634 -0
|
@@ -4865,11 +4865,10 @@ var NumberField = /** @class */ (function (_super) {
|
|
|
4865
4865
|
var DecimalField = /** @class */ (function (_super) {
|
|
4866
4866
|
__extends(DecimalField, _super);
|
|
4867
4867
|
function DecimalField(config) {
|
|
4868
|
-
var _a;
|
|
4869
4868
|
var _this = _super.call(this, config) || this;
|
|
4870
4869
|
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4871
4870
|
_this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
|
|
4872
|
-
_this.scale = typeof config.scale === "function" ? config.scale() :
|
|
4871
|
+
_this.scale = typeof config.scale === "function" ? config.scale() : config.scale;
|
|
4873
4872
|
return _this;
|
|
4874
4873
|
}
|
|
4875
4874
|
return DecimalField;
|
|
@@ -4882,6 +4881,7 @@ var CurrencyField = /** @class */ (function (_super) {
|
|
|
4882
4881
|
__extends(CurrencyField, _super);
|
|
4883
4882
|
function CurrencyField(config) {
|
|
4884
4883
|
var _this = _super.call(this, config) || this;
|
|
4884
|
+
_this.currency = config['currency'];
|
|
4885
4885
|
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4886
4886
|
return _this;
|
|
4887
4887
|
}
|
|
@@ -9785,14 +9785,200 @@ var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
|
9785
9785
|
return BignumberFieldComponent;
|
|
9786
9786
|
}(BaseFieldComponent));
|
|
9787
9787
|
|
|
9788
|
+
var CurrencyService = /** @class */ (function () {
|
|
9789
|
+
function CurrencyService(localeService) {
|
|
9790
|
+
this.localeService = localeService;
|
|
9791
|
+
this.currencies = {
|
|
9792
|
+
KHR: { precision: 12, scale: 2 },
|
|
9793
|
+
SSP: { precision: 12, scale: 2 },
|
|
9794
|
+
XCD: { precision: 12, scale: 2 },
|
|
9795
|
+
EGP: { precision: 12, scale: 2 },
|
|
9796
|
+
KWD: { precision: 12, scale: 3 },
|
|
9797
|
+
YER: { precision: 12, scale: 2 },
|
|
9798
|
+
HUF: { precision: 12, scale: 2 },
|
|
9799
|
+
MXN: { precision: 12, scale: 2 },
|
|
9800
|
+
MYR: { precision: 12, scale: 2 },
|
|
9801
|
+
ZWL: { precision: 12, scale: 2 },
|
|
9802
|
+
MUR: { precision: 12, scale: 2 },
|
|
9803
|
+
DKK: { precision: 12, scale: 2 },
|
|
9804
|
+
NOK: { precision: 12, scale: 2 },
|
|
9805
|
+
DJF: { precision: 12, scale: 0 },
|
|
9806
|
+
CRC: { precision: 12, scale: 2 },
|
|
9807
|
+
BND: { precision: 12, scale: 2 },
|
|
9808
|
+
NAD: { precision: 12, scale: 2 },
|
|
9809
|
+
MKD: { precision: 12, scale: 2 },
|
|
9810
|
+
CDF: { precision: 12, scale: 2 },
|
|
9811
|
+
GNF: { precision: 12, scale: 0 },
|
|
9812
|
+
EUR: { precision: 12, scale: 2 },
|
|
9813
|
+
OMR: { precision: 12, scale: 3 },
|
|
9814
|
+
CLP: { precision: 12, scale: 0 },
|
|
9815
|
+
BSD: { precision: 12, scale: 2 },
|
|
9816
|
+
TOP: { precision: 12, scale: 2 },
|
|
9817
|
+
IRR: { precision: 12, scale: 2 },
|
|
9818
|
+
BGN: { precision: 12, scale: 2 },
|
|
9819
|
+
BZD: { precision: 12, scale: 2 },
|
|
9820
|
+
CNY: { precision: 12, scale: 2 },
|
|
9821
|
+
FJD: { precision: 12, scale: 2 },
|
|
9822
|
+
SRD: { precision: 12, scale: 2 },
|
|
9823
|
+
SOS: { precision: 12, scale: 2 },
|
|
9824
|
+
GYD: { precision: 12, scale: 2 },
|
|
9825
|
+
VUV: { precision: 12, scale: 0 },
|
|
9826
|
+
MWK: { precision: 12, scale: 2 },
|
|
9827
|
+
MRU: { precision: 12, scale: 2 },
|
|
9828
|
+
LSL: { precision: 12, scale: 2 },
|
|
9829
|
+
ERN: { precision: 12, scale: 2 },
|
|
9830
|
+
BMD: { precision: 12, scale: 2 },
|
|
9831
|
+
WST: { precision: 12, scale: 2 },
|
|
9832
|
+
LRD: { precision: 12, scale: 2 },
|
|
9833
|
+
GMD: { precision: 12, scale: 2 },
|
|
9834
|
+
ARS: { precision: 12, scale: 2 },
|
|
9835
|
+
ZAR: { precision: 12, scale: 2 },
|
|
9836
|
+
RSD: { precision: 12, scale: 2 },
|
|
9837
|
+
MDL: { precision: 12, scale: 2 },
|
|
9838
|
+
USD: { precision: 12, scale: 2 },
|
|
9839
|
+
QAR: { precision: 12, scale: 2 },
|
|
9840
|
+
HRK: { precision: 12, scale: 2 },
|
|
9841
|
+
GIP: { precision: 12, scale: 2 },
|
|
9842
|
+
NPR: { precision: 12, scale: 2 },
|
|
9843
|
+
"002": { precision: 9, scale: 4 },
|
|
9844
|
+
PLN: { precision: 12, scale: 2 },
|
|
9845
|
+
MAD: { precision: 12, scale: 2 },
|
|
9846
|
+
BAM: { precision: 12, scale: 2 },
|
|
9847
|
+
BTN: { precision: 12, scale: 2 },
|
|
9848
|
+
BBD: { precision: 12, scale: 2 },
|
|
9849
|
+
SHP: { precision: 12, scale: 2 },
|
|
9850
|
+
LKR: { precision: 12, scale: 2 },
|
|
9851
|
+
KPW: { precision: 12, scale: 2 },
|
|
9852
|
+
LAK: { precision: 12, scale: 2 },
|
|
9853
|
+
SZL: { precision: 12, scale: 2 },
|
|
9854
|
+
PHP: { precision: 12, scale: 2 },
|
|
9855
|
+
RWF: { precision: 12, scale: 0 },
|
|
9856
|
+
ISK: { precision: 12, scale: 0 },
|
|
9857
|
+
XOF: { precision: 12, scale: 0 },
|
|
9858
|
+
AUD: { precision: 12, scale: 2 },
|
|
9859
|
+
NGN: { precision: 12, scale: 2 },
|
|
9860
|
+
KGS: { precision: 12, scale: 2 },
|
|
9861
|
+
KYD: { precision: 12, scale: 2 },
|
|
9862
|
+
PGK: { precision: 12, scale: 2 },
|
|
9863
|
+
DZD: { precision: 12, scale: 2 },
|
|
9864
|
+
XAF: { precision: 12, scale: 0 },
|
|
9865
|
+
PEN: { precision: 12, scale: 2 },
|
|
9866
|
+
JPY: { precision: 12, scale: 0 },
|
|
9867
|
+
SBD: { precision: 12, scale: 2 },
|
|
9868
|
+
UGX: { precision: 12, scale: 0 },
|
|
9869
|
+
AMD: { precision: 12, scale: 2 },
|
|
9870
|
+
AED: { precision: 12, scale: 2 },
|
|
9871
|
+
ALL: { precision: 12, scale: 2 },
|
|
9872
|
+
XPF: { precision: 12, scale: 0 },
|
|
9873
|
+
AFN: { precision: 12, scale: 2 },
|
|
9874
|
+
RON: { precision: 12, scale: 2 },
|
|
9875
|
+
TND: { precision: 12, scale: 3 },
|
|
9876
|
+
NZD: { precision: 12, scale: 2 },
|
|
9877
|
+
JOD: { precision: 12, scale: 3 },
|
|
9878
|
+
VND: { precision: 12, scale: 0 },
|
|
9879
|
+
ETB: { precision: 12, scale: 2 },
|
|
9880
|
+
PYG: { precision: 12, scale: 0 },
|
|
9881
|
+
JMD: { precision: 12, scale: 2 },
|
|
9882
|
+
KES: { precision: 12, scale: 2 },
|
|
9883
|
+
IDR: { precision: 12, scale: 2 },
|
|
9884
|
+
HKD: { precision: 12, scale: 2 },
|
|
9885
|
+
BDT: { precision: 12, scale: 2 },
|
|
9886
|
+
GBP: { precision: 12, scale: 2 },
|
|
9887
|
+
AOA: { precision: 12, scale: 2 },
|
|
9888
|
+
PKR: { precision: 12, scale: 2 },
|
|
9889
|
+
TRY: { precision: 12, scale: 2 },
|
|
9890
|
+
SLL: { precision: 12, scale: 2 },
|
|
9891
|
+
CVE: { precision: 12, scale: 2 },
|
|
9892
|
+
LYD: { precision: 12, scale: 3 },
|
|
9893
|
+
ILS: { precision: 12, scale: 2 },
|
|
9894
|
+
UZS: { precision: 12, scale: 2 },
|
|
9895
|
+
CHF: { precision: 12, scale: 2 },
|
|
9896
|
+
SVC: { precision: 12, scale: 2 },
|
|
9897
|
+
BRL: { precision: 12, scale: 2 },
|
|
9898
|
+
GHS: { precision: 12, scale: 2 },
|
|
9899
|
+
CUP: { precision: 12, scale: 2 },
|
|
9900
|
+
FKP: { precision: 12, scale: 2 },
|
|
9901
|
+
NIO: { precision: 12, scale: 2 },
|
|
9902
|
+
GEL: { precision: 12, scale: 2 },
|
|
9903
|
+
TTD: { precision: 12, scale: 2 },
|
|
9904
|
+
AAA: { precision: 1, scale: 1 },
|
|
9905
|
+
COP: { precision: 12, scale: 2 },
|
|
9906
|
+
MGA: { precision: 12, scale: 2 },
|
|
9907
|
+
INR: { precision: 12, scale: 2 },
|
|
9908
|
+
KRW: { precision: 12, scale: 0 },
|
|
9909
|
+
HNL: { precision: 12, scale: 2 },
|
|
9910
|
+
MMK: { precision: 12, scale: 2 },
|
|
9911
|
+
TZS: { precision: 12, scale: 2 },
|
|
9912
|
+
THB: { precision: 12, scale: 2 },
|
|
9913
|
+
TMT: { precision: 12, scale: 2 },
|
|
9914
|
+
SAR: { precision: 12, scale: 2 },
|
|
9915
|
+
UYU: { precision: 12, scale: 2 },
|
|
9916
|
+
BIF: { precision: 12, scale: 0 },
|
|
9917
|
+
MVR: { precision: 12, scale: 2 },
|
|
9918
|
+
RUB: { precision: 12, scale: 2 },
|
|
9919
|
+
GTQ: { precision: 12, scale: 2 },
|
|
9920
|
+
SCR: { precision: 12, scale: 2 },
|
|
9921
|
+
IQD: { precision: 12, scale: 3 },
|
|
9922
|
+
UAH: { precision: 12, scale: 2 },
|
|
9923
|
+
BYN: { precision: 12, scale: 2 },
|
|
9924
|
+
VES: { precision: 12, scale: 2 },
|
|
9925
|
+
BOB: { precision: 12, scale: 2 },
|
|
9926
|
+
SGD: { precision: 12, scale: 2 },
|
|
9927
|
+
ZMW: { precision: 12, scale: 2 },
|
|
9928
|
+
CZK: { precision: 12, scale: 2 },
|
|
9929
|
+
TJS: { precision: 12, scale: 2 },
|
|
9930
|
+
DOP: { precision: 12, scale: 2 },
|
|
9931
|
+
AZN: { precision: 12, scale: 2 },
|
|
9932
|
+
PAB: { precision: 12, scale: 2 },
|
|
9933
|
+
STN: { precision: 12, scale: 2 },
|
|
9934
|
+
SDG: { precision: 12, scale: 2 },
|
|
9935
|
+
BWP: { precision: 12, scale: 2 },
|
|
9936
|
+
BHD: { precision: 12, scale: 3 },
|
|
9937
|
+
CAD: { precision: 12, scale: 2 },
|
|
9938
|
+
MNT: { precision: 12, scale: 2 },
|
|
9939
|
+
MOP: { precision: 12, scale: 2 },
|
|
9940
|
+
HTG: { precision: 12, scale: 2 },
|
|
9941
|
+
KZT: { precision: 12, scale: 2 },
|
|
9942
|
+
LBP: { precision: 12, scale: 2 },
|
|
9943
|
+
SYP: { precision: 12, scale: 2 },
|
|
9944
|
+
TWD: { precision: 12, scale: 2 },
|
|
9945
|
+
MZN: { precision: 12, scale: 2 },
|
|
9946
|
+
ANG: { precision: 12, scale: 2 },
|
|
9947
|
+
SEK: { precision: 12, scale: 2 },
|
|
9948
|
+
KMF: { precision: 12, scale: 0 },
|
|
9949
|
+
AWG: { precision: 12, scale: 2 },
|
|
9950
|
+
};
|
|
9951
|
+
}
|
|
9952
|
+
CurrencyService.prototype.getCurrencySymbol = function (_a) {
|
|
9953
|
+
var currency = _a.currency;
|
|
9954
|
+
var _b, _c;
|
|
9955
|
+
var numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
|
|
9956
|
+
style: "currency",
|
|
9957
|
+
currency: currency !== null && currency !== void 0 ? currency : "BRL",
|
|
9958
|
+
currencyDisplay: "narrowSymbol",
|
|
9959
|
+
maximumFractionDigits: 5,
|
|
9960
|
+
});
|
|
9961
|
+
return (_c = (_b = numberFormat.formatToParts(1).find(function (x) { return x.type === "currency"; })) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : "";
|
|
9962
|
+
};
|
|
9963
|
+
CurrencyService.ctorParameters = function () { return [
|
|
9964
|
+
{ type: LocaleService }
|
|
9965
|
+
]; };
|
|
9966
|
+
CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
|
|
9967
|
+
CurrencyService = __decorate([
|
|
9968
|
+
Injectable({ providedIn: "root" })
|
|
9969
|
+
], CurrencyService);
|
|
9970
|
+
return CurrencyService;
|
|
9971
|
+
}());
|
|
9972
|
+
|
|
9788
9973
|
/**
|
|
9789
9974
|
* @deprecated Should use bignumber instead
|
|
9790
9975
|
*/
|
|
9791
9976
|
var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
9792
9977
|
__extends(CurrencyFieldComponent, _super);
|
|
9793
|
-
function CurrencyFieldComponent(localeService) {
|
|
9978
|
+
function CurrencyFieldComponent(localeService, currencyService) {
|
|
9794
9979
|
var _this = _super.call(this) || this;
|
|
9795
9980
|
_this.localeService = localeService;
|
|
9981
|
+
_this.currencyService = currencyService;
|
|
9796
9982
|
return _this;
|
|
9797
9983
|
}
|
|
9798
9984
|
CurrencyFieldComponent.prototype.ngOnInit = function () {
|
|
@@ -9827,7 +10013,8 @@ var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
|
9827
10013
|
});
|
|
9828
10014
|
};
|
|
9829
10015
|
CurrencyFieldComponent.ctorParameters = function () { return [
|
|
9830
|
-
{ type: LocaleService }
|
|
10016
|
+
{ type: LocaleService },
|
|
10017
|
+
{ type: CurrencyService }
|
|
9831
10018
|
]; };
|
|
9832
10019
|
__decorate([
|
|
9833
10020
|
Input()
|
|
@@ -9837,7 +10024,7 @@ var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
|
9837
10024
|
], CurrencyFieldComponent.prototype, "formControl", void 0);
|
|
9838
10025
|
CurrencyFieldComponent = __decorate([
|
|
9839
10026
|
Component({
|
|
9840
|
-
template: "<div class=\"ui-inputgroup\">\n <span\n *ngIf=\"field.numberLocaleOptions
|
|
10027
|
+
template: "<div class=\"ui-inputgroup\">\n <span\n *ngIf=\"field.currency || field.numberLocaleOptions?.currencySymbol\"\n class=\"ui-inputgroup-addon\"\n >\n {{\n field.currency\n ? currencyService.getCurrencySymbol({\n currency: field.currency()\n })\n : field.numberLocaleOptions.currencySymbol\n }}\n </span>\n\n <input\n *ngIf=\"!field.mask\"\n type=\"text\"\n [id]=\"field.id || field.name\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n sNumberInput\n [precision]=\"\n field.precision\n ? isFunction(field.precision)\n ? trigger(field.precision)\n : field.precision\n : field.currency && field.currency()\n ? currencyService.currencies[field.currency()].precision\n : 15\n \"\n [scale]=\"\n field.scale\n ? isFunction(field.scale)\n ? trigger(field.scale)\n : field.scale\n : field.currency && field.currency()\n ? currencyService.currencies[field.currency()].scale\n : 0\n \"\n [decimalSeparator]=\"field.numberLocaleOptions.decimalSeparator\"\n [thousandsSeparator]=\"field.numberLocaleOptions.thousandsSeparator\"\n [alignTo]=\"field.alignTo\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [placeholder]=\"field.placeholder\"\n [showDelay]=\"500\"\n pInputText\n [autocomplete]=\"field.browserAutocomplete ? 'on' : 'off'\"\n [ngClass]=\"'mousetrap'\"\n (blur)=\"field.onBlur ? field.onBlur($event) : null\"\n (focus)=\"field.onFocus ? field.onFocus($event) : null\"\n />\n\n <p-inputMask\n *ngIf=\"field.mask\"\n type=\"text\"\n [inputId]=\"field.id || field.name\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [mask]=\"field.mask\"\n [placeholder]=\"field.placeholder\"\n slotChar=\"_\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n styleClass=\"mousetrap\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onComplete)=\"field.onComplete ? field.onComplete($event) : null\"\n (onInput)=\"field.onInput ? field.onInput($event) : null\"\n ></p-inputMask>\n</div>\n"
|
|
9841
10028
|
})
|
|
9842
10029
|
], CurrencyFieldComponent);
|
|
9843
10030
|
return CurrencyFieldComponent;
|
|
@@ -17981,31 +18168,6 @@ var WorkspaceSwitchModule = /** @class */ (function () {
|
|
|
17981
18168
|
return WorkspaceSwitchModule;
|
|
17982
18169
|
}());
|
|
17983
18170
|
|
|
17984
|
-
var CurrencyService = /** @class */ (function () {
|
|
17985
|
-
function CurrencyService(localeService) {
|
|
17986
|
-
this.localeService = localeService;
|
|
17987
|
-
}
|
|
17988
|
-
CurrencyService.prototype.getCurrencySymbol = function (_a) {
|
|
17989
|
-
var currency = _a.currency;
|
|
17990
|
-
var _b, _c;
|
|
17991
|
-
var numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
|
|
17992
|
-
style: "currency",
|
|
17993
|
-
currency: currency !== null && currency !== void 0 ? currency : "BRL",
|
|
17994
|
-
currencyDisplay: 'narrowSymbol',
|
|
17995
|
-
maximumFractionDigits: 5,
|
|
17996
|
-
});
|
|
17997
|
-
return (_c = (_b = numberFormat.formatToParts(1).find(function (x) { return x.type === "currency"; })) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : "";
|
|
17998
|
-
};
|
|
17999
|
-
CurrencyService.ctorParameters = function () { return [
|
|
18000
|
-
{ type: LocaleService }
|
|
18001
|
-
]; };
|
|
18002
|
-
CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
|
|
18003
|
-
CurrencyService = __decorate([
|
|
18004
|
-
Injectable({ providedIn: "root" })
|
|
18005
|
-
], CurrencyService);
|
|
18006
|
-
return CurrencyService;
|
|
18007
|
-
}());
|
|
18008
|
-
|
|
18009
18171
|
var fallback = {
|
|
18010
18172
|
"platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
|
|
18011
18173
|
"platform.angular_components.select_a_file": "selecione um arquivo",
|