monkey-front-core 0.0.491 → 0.0.492
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/esm2020/lib/core/pipes/monkeyecx-format-currency.mjs +10 -5
- package/fesm2015/monkey-front-core.mjs +9 -4
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +9 -4
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/pipes/monkeyecx-format-currency.d.ts +2 -1
- package/monkey-front-core-0.0.492.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.491.tgz +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { DEFAULT_CURRENCY_CODE, Inject, Pipe } from '@angular/core';
|
|
1
|
+
import { DEFAULT_CURRENCY_CODE, Inject, LOCALE_ID, Pipe } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "@angular/common";
|
|
4
4
|
export class MonkeyEcxFormatCurrencyPipe {
|
|
5
|
-
constructor(currencyPipe, defaultCurencyCode) {
|
|
5
|
+
constructor(currencyPipe, defaultCurencyCode, localeId) {
|
|
6
6
|
this.currencyPipe = currencyPipe;
|
|
7
7
|
this.defaultCurencyCode = defaultCurencyCode;
|
|
8
|
+
this.localeId = localeId;
|
|
8
9
|
// not to do
|
|
9
10
|
}
|
|
10
11
|
transform(value, symbol = 'symbol') {
|
|
11
12
|
const currency = this.defaultCurencyCode.toString();
|
|
12
|
-
|
|
13
|
+
const localeId = this.localeId.toString();
|
|
14
|
+
return this.currencyPipe.transform(value, currency, symbol, '', localeId);
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
|
-
MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i1.CurrencyPipe }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
17
|
+
MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i1.CurrencyPipe }, { token: DEFAULT_CURRENCY_CODE }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
16
18
|
MonkeyEcxFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, name: "monkeyecxFormatCurrency" });
|
|
17
19
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, decorators: [{
|
|
18
20
|
type: Pipe,
|
|
@@ -22,5 +24,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
22
24
|
}], ctorParameters: function () { return [{ type: i1.CurrencyPipe }, { type: i0.InjectionToken, decorators: [{
|
|
23
25
|
type: Inject,
|
|
24
26
|
args: [DEFAULT_CURRENCY_CODE]
|
|
27
|
+
}] }, { type: i0.InjectionToken, decorators: [{
|
|
28
|
+
type: Inject,
|
|
29
|
+
args: [LOCALE_ID]
|
|
25
30
|
}] }]; } });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ua2V5ZWN4LWZvcm1hdC1jdXJyZW5jeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL21vbmtleS1mcm9udC1jb3JlL3NyYy9saWIvY29yZS9waXBlcy9tb25rZXllY3gtZm9ybWF0LWN1cnJlbmN5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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WN0aW9uVG9rZW4sXG4gIExPQ0FMRV9JRCxcbiAgUGlwZSxcbiAgUGlwZVRyYW5zZm9ybVxufSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQFBpcGUoe1xuICBuYW1lOiAnbW9ua2V5ZWN4Rm9ybWF0Q3VycmVuY3knXG59KVxuZXhwb3J0IGNsYXNzIE1vbmtleUVjeEZvcm1hdEN1cnJlbmN5UGlwZSBpbXBsZW1lbnRzIFBpcGVUcmFuc2Zvcm0ge1xuICBjb25zdHJ1Y3RvcihcbiAgICBwcml2YXRlIGN1cnJlbmN5UGlwZTogQ3VycmVuY3lQaXBlLFxuICAgIEBJbmplY3QoREVGQVVMVF9DVVJSRU5DWV9DT0RFKSBwcml2YXRlIGRlZmF1bHRDdXJlbmN5Q29kZTogSW5qZWN0aW9uVG9rZW48c3RyaW5nPixcbiAgICBASW5qZWN0KExPQ0FMRV9JRCkgcHJpdmF0ZSBsb2NhbGVJZDogSW5qZWN0aW9uVG9rZW48c3RyaW5nPlxuICApIHtcbiAgICAvLyBub3QgdG8gZG9cbiAgfVxuXG4gIHRyYW5zZm9ybSh2YWx1ZTogYW55LCBzeW1ib2wgPSAnc3ltYm9sJykge1xuICAgIGNvbnN0IGN1cnJlbmN5ID0gdGhpcy5kZWZhdWx0Q3VyZW5jeUNvZGUudG9TdHJpbmcoKTtcbiAgICBjb25zdCBsb2NhbGVJZCA9IHRoaXMubG9jYWxlSWQudG9TdHJpbmcoKTtcbiAgICByZXR1cm4gdGhpcy5jdXJyZW5jeVBpcGUudHJhbnNmb3JtKHZhbHVlLCBjdXJyZW5jeSwgc3ltYm9sLCAnJywgbG9jYWxlSWQpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, NgModule, Pipe, ViewEncapsulation, Injectable, DEFAULT_CURRENCY_CODE, Inject, InjectionToken, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, Optional, inject, SkipSelf, NgZone, ErrorHandler } from '@angular/core';
|
|
2
|
+
import { Component, Input, NgModule, Pipe, ViewEncapsulation, Injectable, DEFAULT_CURRENCY_CODE, LOCALE_ID, Inject, InjectionToken, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, Optional, inject, SkipSelf, NgZone, ErrorHandler } from '@angular/core';
|
|
3
3
|
import * as i1 from 'monkey-style-guide';
|
|
4
4
|
import { MonkeyButtonModule, MonkeyModalModule, MonkeyIconModule, MonkeyInputModule, MonkeyRadioButtonModule, MonkeyOptionModule, MonkeyUtils, MonkeyStyleGuideModule, MonkeyStyleGuideModalService, MonkeyStyleGuideSettingsService, MonkeyStyleGuideSnackbarService } from 'monkey-style-guide';
|
|
5
5
|
import * as i2 from '@angular/common';
|
|
@@ -733,17 +733,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
733
733
|
}], ctorParameters: function () { return []; } });
|
|
734
734
|
|
|
735
735
|
class MonkeyEcxFormatCurrencyPipe {
|
|
736
|
-
constructor(currencyPipe, defaultCurencyCode) {
|
|
736
|
+
constructor(currencyPipe, defaultCurencyCode, localeId) {
|
|
737
737
|
this.currencyPipe = currencyPipe;
|
|
738
738
|
this.defaultCurencyCode = defaultCurencyCode;
|
|
739
|
+
this.localeId = localeId;
|
|
739
740
|
// not to do
|
|
740
741
|
}
|
|
741
742
|
transform(value, symbol = 'symbol') {
|
|
742
743
|
const currency = this.defaultCurencyCode.toString();
|
|
743
|
-
|
|
744
|
+
const localeId = this.localeId.toString();
|
|
745
|
+
return this.currencyPipe.transform(value, currency, symbol, '', localeId);
|
|
744
746
|
}
|
|
745
747
|
}
|
|
746
|
-
MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i2.CurrencyPipe }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
748
|
+
MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i2.CurrencyPipe }, { token: DEFAULT_CURRENCY_CODE }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
747
749
|
MonkeyEcxFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, name: "monkeyecxFormatCurrency" });
|
|
748
750
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, decorators: [{
|
|
749
751
|
type: Pipe,
|
|
@@ -754,6 +756,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
754
756
|
return [{ type: i2.CurrencyPipe }, { type: i0.InjectionToken, decorators: [{
|
|
755
757
|
type: Inject,
|
|
756
758
|
args: [DEFAULT_CURRENCY_CODE]
|
|
759
|
+
}] }, { type: i0.InjectionToken, decorators: [{
|
|
760
|
+
type: Inject,
|
|
761
|
+
args: [LOCALE_ID]
|
|
757
762
|
}] }];
|
|
758
763
|
} });
|
|
759
764
|
|