@taiga-ui/addon-commerce 2.74.0 → 2.76.0
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/taiga-ui-addon-commerce-components-card.umd.js +60 -15
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +80 -35
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +57 -12
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +51 -6
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +52 -6
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js +52 -7
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js +46 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
- package/components/card/card.component.d.ts +1 -1
- package/enums/payment-system.d.ts +1 -1
- package/esm2015/components/card/card.component.js +15 -15
- package/esm2015/components/input-card/input-card.component.js +12 -12
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +35 -35
- package/esm2015/components/input-cvc/input-cvc.component.js +6 -6
- package/esm2015/components/input-expire/input-expire.component.js +7 -6
- package/esm2015/components/money/money.component.js +7 -7
- package/esm2015/enums/payment-system.js +1 -1
- package/esm2015/types/money-sign.js +1 -1
- package/esm2015/utils/is-card-number-valid.js +1 -1
- package/esm5/components/card/card.component.js +15 -15
- package/esm5/components/input-card/input-card.component.js +12 -12
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +35 -35
- package/esm5/components/input-cvc/input-cvc.component.js +6 -6
- package/esm5/components/input-expire/input-expire.component.js +7 -6
- package/esm5/components/money/money.component.js +7 -7
- package/esm5/enums/payment-system.js +1 -1
- package/esm5/types/money-sign.js +1 -1
- package/esm5/utils/is-card-number-valid.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-card.js +14 -14
- package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +34 -34
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +11 -11
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +5 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +6 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js +6 -6
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-card.js +14 -14
- package/fesm5/taiga-ui-addon-commerce-components-card.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +34 -34
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js +11 -11
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js +5 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +6 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js +6 -6
- package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/package.json +4 -4
- package/types/money-sign.d.ts +2 -2
- package/utils/is-card-number-valid.d.ts +1 -1
|
@@ -12,7 +12,7 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
12
12
|
var _this = _super.call(this, control, changeDetectorRef) || this;
|
|
13
13
|
_this.textfieldLabelOutside = textfieldLabelOutside;
|
|
14
14
|
_this.autocompleteEnabled = false;
|
|
15
|
-
_this.exampleText =
|
|
15
|
+
_this.exampleText = '000';
|
|
16
16
|
_this.textMaskOptions = {
|
|
17
17
|
mask: new Array(3).fill(TUI_DIGIT_REGEXP),
|
|
18
18
|
guide: false,
|
|
@@ -22,7 +22,7 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
22
22
|
TuiInputCVCComponent_1 = TuiInputCVCComponent;
|
|
23
23
|
Object.defineProperty(TuiInputCVCComponent.prototype, "length", {
|
|
24
24
|
set: function (length) {
|
|
25
|
-
this.exampleText =
|
|
25
|
+
this.exampleText = '0'.repeat(length);
|
|
26
26
|
this.textMaskOptions = {
|
|
27
27
|
mask: new Array(length).fill(TUI_DIGIT_REGEXP),
|
|
28
28
|
guide: false,
|
|
@@ -56,7 +56,7 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(TuiInputCVCComponent.prototype, "computedExampleText", {
|
|
58
58
|
get: function () {
|
|
59
|
-
return this.textfieldLabelOutside.labelOutside ?
|
|
59
|
+
return this.textfieldLabelOutside.labelOutside ? '' : this.exampleText;
|
|
60
60
|
},
|
|
61
61
|
enumerable: true,
|
|
62
62
|
configurable: true
|
|
@@ -72,7 +72,7 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
72
72
|
this.updateValue(value);
|
|
73
73
|
};
|
|
74
74
|
TuiInputCVCComponent.prototype.getFallbackValue = function () {
|
|
75
|
-
return
|
|
75
|
+
return '';
|
|
76
76
|
};
|
|
77
77
|
var TuiInputCVCComponent_1;
|
|
78
78
|
TuiInputCVCComponent.ctorParameters = function () { return [
|
|
@@ -93,7 +93,7 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
93
93
|
], TuiInputCVCComponent.prototype, "length", null);
|
|
94
94
|
TuiInputCVCComponent = TuiInputCVCComponent_1 = __decorate([
|
|
95
95
|
Component({
|
|
96
|
-
selector:
|
|
96
|
+
selector: 'tui-input-cvc',
|
|
97
97
|
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldExampleText]=\"computedExampleText\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
98
98
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
99
99
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector:
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: 'tui-input-cvc',\n templateUrl: './input-cvc.template.html',\n styleUrls: ['./input-cvc.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCVCComponent),\n },\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = '0'.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = '000';\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n get computedExampleText(): string {\n return this.textfieldLabelOutside.labelOutside ? '' : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA2CY,wCAA0B;IA2BlC,8BAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD;QAP7E,YASI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAHoB,2BAAqB,GAArB,qBAAqB,CAAmC;QA1B7E,yBAAmB,GAAG,KAAK,CAAC;QAY5B,iBAAW,GAAG,KAAK,CAAC;QAEpB,qBAAe,GAAmB;YAC9B,IAAI,EAAE,I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
19
|
+
'/',
|
|
20
20
|
TUI_DIGIT_REGEXP,
|
|
21
21
|
TUI_DIGIT_REGEXP,
|
|
22
22
|
],
|
|
@@ -50,15 +50,16 @@ var TuiInputExpireComponent = /** @class */ (function (_super) {
|
|
|
50
50
|
configurable: true
|
|
51
51
|
});
|
|
52
52
|
TuiInputExpireComponent.prototype.onValueChange = function (value) {
|
|
53
|
+
var _a;
|
|
53
54
|
// @bad TODO: Workaround until mask pipe can replace chars and keep caret position
|
|
54
55
|
// @bad TODO: Think about a solution without mask at all
|
|
55
|
-
if (!this.input ||
|
|
56
|
+
if (!((_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement)) {
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
if (parseInt(value.slice(0, 2), 10) > 12) {
|
|
59
60
|
value = "12" + value.slice(2);
|
|
60
61
|
}
|
|
61
|
-
if (value.slice(0, 2) ===
|
|
62
|
+
if (value.slice(0, 2) === '00') {
|
|
62
63
|
value = "01" + value.slice(2);
|
|
63
64
|
}
|
|
64
65
|
this.input.nativeFocusableElement.value = value;
|
|
@@ -73,7 +74,7 @@ var TuiInputExpireComponent = /** @class */ (function (_super) {
|
|
|
73
74
|
this.updateHovered(hovered);
|
|
74
75
|
};
|
|
75
76
|
TuiInputExpireComponent.prototype.getFallbackValue = function () {
|
|
76
|
-
return
|
|
77
|
+
return '';
|
|
77
78
|
};
|
|
78
79
|
var TuiInputExpireComponent_1;
|
|
79
80
|
TuiInputExpireComponent.ctorParameters = function () { return [
|
|
@@ -89,7 +90,7 @@ var TuiInputExpireComponent = /** @class */ (function (_super) {
|
|
|
89
90
|
], TuiInputExpireComponent.prototype, "autocompleteEnabled", void 0);
|
|
90
91
|
TuiInputExpireComponent = TuiInputExpireComponent_1 = __decorate([
|
|
91
92
|
Component({
|
|
92
|
-
selector:
|
|
93
|
+
selector: 'tui-input-expire',
|
|
93
94
|
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldType]=\"$any('')\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
94
95
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
95
96
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector:
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: 'tui-input-expire',\n templateUrl: './input-expire.template.html',\n styleUrls: ['./input-expire.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputExpireComponent),\n },\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n '/',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n onValueChange(value: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input?.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.slice(0, 2), 10) > 12) {\n value = `12${value.slice(2)}`;\n }\n\n if (value.slice(0, 2) === '00') {\n value = `01${value.slice(2)}`;\n }\n\n this.input.nativeFocusableElement.value = value;\n\n if (this.value !== value) {\n this.updateValue(value);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputExpireComponent} from './input-expire.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputExpireComponent],\n exports: [TuiInputExpireComponent],\n})\nexport class TuiInputExpireModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAwCY,2CAA0B;IAsBlC,iCAII,OAAyB,EACE,iBAAoC;QALnE,YAOI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAtBD,yBAAmB,GAAG,KAAK,CAAC;QAEnB,qBAAe,GAAmB;YACvC,IAA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2CAAS,GAAT,UAAU,OAAgB;QACtB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;KAC/B;IAES,kDAAgB,GAA1B;QACI,OAAO,EAAE,CAAC;KACb;;;gBApDY,SAAS,uBAHjB,QAAQ,YACR,IAAI,YACJ,MAAM,SAAC,SAAS;gBAE6B,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;;IAvB7B;QADC,SAAS,CAAC,8BAA8B,CAAC;0DACc;IAIxD;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;wEACW;IATnB,uBAAuB;QAZnC,SAAS,CAAC;YACP,QAAQ,EAAE,kBAAkB;YAC5B,kuBAA2C;YAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAA2B;oBACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,yBAAuB,GAAA,CAAC;iBACzD;aACJ;;SACJ,CAAC;QAyBO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OA5BrB,uBAAuB,CAgFnC;IAAD,8BAAC;CAAA,CA/EW,kBAAkB;;;ICvB9B;KAAoC;IAAvB,oBAAoB;QAVhC,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,cAAc;gBACd,2BAA2B;gBAC3B,4BAA4B;gBAC5B,sBAAsB;aACzB;YACD,YAAY,EAAE,CAAC,uBAAuB,CAAC;YACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACrC,CAAC;OACW,oBAAoB,CAAG;IAAD,2BAAC;CAApC;;ACjBA;;;;;;"}
|
|
@@ -53,7 +53,7 @@ var TuiMoneyComponent = /** @class */ (function () {
|
|
|
53
53
|
get: function () {
|
|
54
54
|
return (this.colored &&
|
|
55
55
|
(this.signSymbol === CHAR_MINUS ||
|
|
56
|
-
(this.value < 0 && this.sign !==
|
|
56
|
+
(this.value < 0 && this.sign !== 'force-positive')));
|
|
57
57
|
},
|
|
58
58
|
enumerable: true,
|
|
59
59
|
configurable: true
|
|
@@ -62,7 +62,7 @@ var TuiMoneyComponent = /** @class */ (function () {
|
|
|
62
62
|
get: function () {
|
|
63
63
|
return (this.colored &&
|
|
64
64
|
(this.signSymbol === CHAR_PLUS ||
|
|
65
|
-
(this.value > 0 && this.sign !==
|
|
65
|
+
(this.value > 0 && this.sign !== 'force-negative')));
|
|
66
66
|
},
|
|
67
67
|
enumerable: true,
|
|
68
68
|
configurable: true
|
|
@@ -106,17 +106,17 @@ var TuiMoneyComponent = /** @class */ (function () {
|
|
|
106
106
|
tuiDefaultProp()
|
|
107
107
|
], TuiMoneyComponent.prototype, "singleColor", void 0);
|
|
108
108
|
__decorate([
|
|
109
|
-
HostBinding(
|
|
109
|
+
HostBinding('class._red')
|
|
110
110
|
], TuiMoneyComponent.prototype, "red", null);
|
|
111
111
|
__decorate([
|
|
112
|
-
HostBinding(
|
|
112
|
+
HostBinding('class._green')
|
|
113
113
|
], TuiMoneyComponent.prototype, "green", null);
|
|
114
114
|
__decorate([
|
|
115
|
-
HostBinding(
|
|
115
|
+
HostBinding('class._inherit-color')
|
|
116
116
|
], TuiMoneyComponent.prototype, "inheritColor", null);
|
|
117
117
|
TuiMoneyComponent = __decorate([
|
|
118
118
|
Component({
|
|
119
|
-
selector:
|
|
119
|
+
selector: 'tui-money',
|
|
120
120
|
template: "<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n",
|
|
121
121
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
122
122
|
styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}.t-currency:not(:empty){padding-left:.2rem}"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money-options.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-sign-symbol.ts","ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-fraction-part.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/fraction-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/integer-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimalT;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySignT;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: `not-zero`,\n currency: TuiCurrency.Ruble,\n sign: `negative-only`,\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n `Default parameters for money component`,\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySignT,\n): TuiMoneySignSymbol {\n if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {\n return ``;\n }\n\n if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {\n return CHAR_MINUS;\n }\n\n return CHAR_PLUS;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySignSymbol,\n TuiMoneySignT,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: `tui-money`,\n templateUrl: `./money.template.html`,\n styleUrls: [`./money.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding(`class._red`)\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_MINUS ||\n (this.value < 0 && this.sign !== `force-positive`))\n );\n }\n\n @HostBinding(`class._green`)\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== `force-negative`))\n );\n }\n\n @HostBinding(`class._inherit-color`)\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","import {TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimalT;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split(`.`)[1];\n const shouldShow =\n decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: `tuiFractionPart`})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimalT, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: `tuiIntegerPart`})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: `tuiSignSymbol`})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySignT): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAca,iCAAiC,GAAoB;IAC9D,OAAO,EAAE,UAAU;IACnB,QAAQ;IACR,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,KAAK;EACpB;IAEW,iBAAiB,GAAG,IAAI,cAAc,CAC/C,wCAAwC,EACxC;IACI,OAAO,EAAE,cAAM,OAAA,iCAAiC,GAAA;CACnD,EACH;IAEW,uBAAuB,GAEf,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A;KAIC;IAHG,qCAAS,GAAT,UAAU,KAAa,EAAE,IAAmB;QACxC,OAAO,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC3C;IAHQ,iBAAiB;QAD7B,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;OACjB,iBAAiB,CAI7B;IAAD,wBAAC;CAJD;;;ICaA;KAA8B;IAAjB,cAAc;QAV1B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;YAC9C,YAAY,EAAE;gBACV,iBAAiB;gBACjB,mBAAmB;gBACnB,kBAAkB;gBAClB,iBAAiB;aACpB;YACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC/B,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B;;ACnBA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money-options.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-sign-symbol.ts","ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-fraction-part.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/fraction-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/integer-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimalT;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySignT;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: `not-zero`,\n currency: TuiCurrency.Ruble,\n sign: `negative-only`,\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n `Default parameters for money component`,\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySignT,\n): TuiMoneySignSymbol {\n if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {\n return ``;\n }\n\n if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {\n return CHAR_MINUS;\n }\n\n return CHAR_PLUS;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySignSymbol,\n TuiMoneySignT,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: 'tui-money',\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_MINUS ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","import {TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimalT;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split(`.`)[1];\n const shouldShow =\n decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: `tuiFractionPart`})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimalT, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: `tuiIntegerPart`})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: `tuiSignSymbol`})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySignT): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[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EACtD,IAAI,EACJ,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAClC,IAAI,CAAC,YAAY,CAAC,iBAAiB,CACtC,CAAC;KACL;;gDAVI,MAAM,SAAC,iBAAiB;;IAFpB,kBAAkB;QAD9B,IAAI,CAAC,EAAC,IAAI,EAAE,gBAAgB,EAAC,CAAC;QAGtB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OAFrB,kBAAkB,CAa9B;IAAD,yBAAC;CAbD;;;ICEA;KAIC;IAHG,qCAAS,GAAT,UAAU,KAAa,EAAE,IAAmB;QACxC,OAAO,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC3C;IAHQ,iBAAiB;QAD7B,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;OACjB,iBAAiB,CAI7B;IAAD,wBAAC;CAJD;;;ICaA;KAA8B;IAAjB,cAAc;QAV1B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;YAC9C,YAAY,EAAE;gBACV,iBAAiB;gBACjB,mBAAmB;gBACnB,kBAAkB;gBAClB,iBAAiB;aACpB;YACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC/B,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B;;ACnBA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-enums.js","sources":["ng://@taiga-ui/addon-commerce/enums/currency.ts","ng://@taiga-ui/addon-commerce/enums/currency-code.ts","ng://@taiga-ui/addon-commerce/enums/money-sign.ts","ng://@taiga-ui/addon-commerce/enums/payment-system.ts","ng://@taiga-ui/addon-commerce/enums/taiga-ui-addon-commerce-enums.ts"],"sourcesContent":["/**\n * **Active ISO 4217 alphabetic currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Alphabetic code is also called \"alfa-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrency {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n * @description Currency symbol: ₽\n */\n Ruble = `RUB`,\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n * @description Currency symbol: €\n */\n Euro = `EUR`,\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n * @description Currency symbol: $\n */\n Dollar = `USD`,\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n * @description Currency symbol: £\n */\n Pound = `GBP`,\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n * @description Currency symbol: ฿\n */\n Baht = `THB`,\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n * @description Currency symbol: ₺\n */\n TurkishLira = `TRY`,\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n * @description Currency symbol: CN¥\n */\n YuanRenminbi = `CNY`,\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n * @description Currency symbol: ₸\n */\n Tenge = `KZT`,\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n * @description Currency symbol: ₪\n */\n IsraeliShekel = `ILS`,\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n * @description Currency symbol: ₹\n */\n IndianRupee = `INR`,\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n * @description Currency symbol: ¥\n */\n Yen = `JPY`,\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n * @description Currency symbol: ₩\n */\n Won = `KRW`,\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n * @description Currency symbol: ₣\n */\n SwissFranc = `CHF`,\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n * @description Currency symbol: S$\n */\n SingaporeDollar = `SGD`,\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n * @description Currency symbol: A$\n */\n AustralianDollar = `AUD`,\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n * @description Currency symbol: HK$\n */\n HongKongDollar = `HKD`,\n\n /**\n * @deprecated:\n * TODO: 3.0 replace with {@link HongKongDollar}\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HongKong_dollar = `HKD`,\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n * @description Currency symbol: C$\n */\n CanadianDollar = `CAD`,\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n * @description Currency symbol: ֏\n */\n ArmenianDram = `AMD`,\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n * @description Currency symbol: ₴\n */\n Hryvnia = `UAH`,\n\n /**\n * Mexican peso\n *\n * @description Numeric code: 484\n * @description Alphabetic code: MXN\n * @description Countries and territories: Mexico\n * @description Currency symbol: $\n */\n MexicanPeso = `MXN`,\n\n /**\n * Uzbek sum\n *\n * @description Numeric code: 860\n * @description Alphabetic code: UZS\n * @description Countries and territories: Uzbekistan\n * @description Currency symbol: So'm\n */\n UzbekSum = `UZS`,\n\n /**\n * Kyrgyzstani som\n *\n * @description Numeric code: 417\n * @description Alphabetic code: KGS\n * @description Countries and territories: Kyrgyzstan\n * @description Currency symbol: c\n */\n KyrgyzstanSom = `KGS`,\n\n /**\n * United Arab Emirates dirham\n *\n * @description Numeric code: 784\n * @description Alphabetic code: AED\n * @description Countries and territories: United Arab Emirates\n * @description Currency symbol: Dh\n */\n Dirham = `AED`,\n}\n","/**\n * **Active ISO 4217 numeric currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Numeric code is also called \"number-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrencyCode {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n * @description Currency symbol: ₽\n */\n Ruble = `643`,\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n * @description Currency symbol: €\n */\n Euro = `978`,\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n * @description Currency symbol: $\n */\n Dollar = `840`,\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n * @description Currency symbol: £\n */\n Pound = `826`,\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n * @description Currency symbol: ฿\n */\n Baht = `764`,\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n * @description Currency symbol: ₺\n */\n TurkishLira = `949`,\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n * @description Currency symbol: CN¥\n */\n YuanRenminbi = `156`,\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n * @description Currency symbol: ₸\n */\n Tenge = `398`,\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n * @description Currency symbol: ₪\n */\n IsraeliShekel = `376`,\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n * @description Currency symbol: ₹\n */\n IndianRupee = `356`,\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n * @description Currency symbol: ¥\n */\n Yen = `392`,\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n * @description Currency symbol: ₩\n */\n Won = `410`,\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n * @description Currency symbol: ₣\n */\n SwissFranc = `756`,\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n * @description Currency symbol: S$\n */\n SingaporeDollar = `702`,\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n * @description Currency symbol: A$\n */\n AustralianDollar = `036`,\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n * @description Currency symbol: HK$\n */\n HongKongDollar = `344`,\n\n /**\n * @deprecated\n * TODO: 3.0 replace with {@link HongKongDollar}\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HongKong_dollar = `344`,\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n * @description Currency symbol: C$\n */\n CanadianDollar = `124`,\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n * @description Currency symbol: ֏\n */\n ArmenianDram = `051`,\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n * @description Currency symbol: ₴\n */\n Hryvnia = `980`,\n\n /**\n * Mexican peso\n *\n * @description Numeric code: 484\n * @description Alphabetic code: MXN\n * @description Countries and territories: Mexico\n * @description Currency symbol: $\n */\n MexicanPeso = `484`,\n\n /**\n * Uzbek sum\n *\n * @description Numeric code: 860\n * @description Alphabetic code: UZS\n * @description Countries and territories: Uzbekistan\n * @description Currency symbol: So'm\n */\n UzbekSum = `860`,\n\n /**\n * Kyrgyzstani som\n *\n * @description Numeric code: 417\n * @description Alphabetic code: KGS\n * @description Countries and territories: Kyrgyzstan\n * @description Currency symbol: c\n */\n KyrgyzstanSom = `417`,\n\n /**\n * United Arab Emirates dirham\n *\n * @description Numeric code: 784\n * @description Alphabetic code: AED\n * @description Countries and territories: United Arab Emirates\n * @description Currency symbol: Dh\n */\n Dirham = `784`,\n}\n","/**\n * negative-only — show sign only for negative numbers\n * always — always show sign, except for zero\n * never — never show sign\n * force-negative — show minus no matter the number, except for zero\n * force-positive — show plus no matter the number, except for zero\n * @deprecated use join type {@link TuiMoneySignT}\n * TODO: delete in v3.0\n */\nexport const enum TuiMoneySign {\n NegativeOnly = `negative-only`,\n Always = `always`,\n Never = `never`,\n ForceNegative = `force-negative`,\n ForcePositive = `force-positive`,\n}\n","export const enum TuiPaymentSystem {\n Visa = `visa`,\n Electron = `electron`,\n Mastercard = `mastercard`,\n Maestro = `maestro`,\n Mir = `mir`,\n}\n\nexport type TuiPaymentSystemT = 'visa' | 'electron' | 'mastercard' | 'maestro' | 'mir';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;;IAQkB;AAAlB,WAAkB,WAAW;;;;;;;;;IASzB,4BAAa,CAAA;;;;;;;;;IAUb,2BAAY,CAAA;;;;;;;;;IAUZ,6BAAc,CAAA;;;;;;;;;IAUd,4BAAa,CAAA;;;;;;;;;IAUb,2BAAY,CAAA;;;;;;;;;IAUZ,kCAAmB,CAAA;;;;;;;;;IAUnB,mCAAoB,CAAA;;;;;;;;;IAUpB,4BAAa,CAAA;;;;;;;;;IAUb,oCAAqB,CAAA;;;;;;;;;IAUrB,kCAAmB,CAAA;;;;;;;;;IAUnB,0BAAW,CAAA;;;;;;;;;IAUX,0BAAW,CAAA;;;;;;;;;IAUX,iCAAkB,CAAA;;;;;;;;;IAUlB,sCAAuB,CAAA;;;;;;;;;IAUvB,uCAAwB,CAAA;;;;;;;;;IAUxB,qCAAsB,CAAA;;;;;;IAOtB,sCAAuB,CAAA;;;;;;;;;IAUvB,qCAAsB,CAAA;;;;;;;;;IAUtB,mCAAoB,CAAA;;;;;;;;;IAUpB,8BAAe,CAAA;;;;;;;;;IAUf,kCAAmB,CAAA;;;;;;;;;IAUnB,+BAAgB,CAAA;;;;;;;;;IAUhB,oCAAqB,CAAA;;;;;;;;;IAUrB,6BAAc,CAA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|
+
{"version":3,"file":"taiga-ui-addon-commerce-enums.js","sources":["ng://@taiga-ui/addon-commerce/enums/currency.ts","ng://@taiga-ui/addon-commerce/enums/currency-code.ts","ng://@taiga-ui/addon-commerce/enums/money-sign.ts","ng://@taiga-ui/addon-commerce/enums/payment-system.ts","ng://@taiga-ui/addon-commerce/enums/taiga-ui-addon-commerce-enums.ts"],"sourcesContent":["/**\n * **Active ISO 4217 alphabetic currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Alphabetic code is also called \"alfa-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrency {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n * @description Currency symbol: ₽\n */\n Ruble = `RUB`,\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n * @description Currency symbol: €\n */\n Euro = `EUR`,\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n * @description Currency symbol: $\n */\n Dollar = `USD`,\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n * @description Currency symbol: £\n */\n Pound = `GBP`,\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n * @description Currency symbol: ฿\n */\n Baht = `THB`,\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n * @description Currency symbol: ₺\n */\n TurkishLira = `TRY`,\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n * @description Currency symbol: CN¥\n */\n YuanRenminbi = `CNY`,\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n * @description Currency symbol: ₸\n */\n Tenge = `KZT`,\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n * @description Currency symbol: ₪\n */\n IsraeliShekel = `ILS`,\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n * @description Currency symbol: ₹\n */\n IndianRupee = `INR`,\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n * @description Currency symbol: ¥\n */\n Yen = `JPY`,\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n * @description Currency symbol: ₩\n */\n Won = `KRW`,\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n * @description Currency symbol: ₣\n */\n SwissFranc = `CHF`,\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n * @description Currency symbol: S$\n */\n SingaporeDollar = `SGD`,\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n * @description Currency symbol: A$\n */\n AustralianDollar = `AUD`,\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n * @description Currency symbol: HK$\n */\n HongKongDollar = `HKD`,\n\n /**\n * @deprecated:\n * TODO: 3.0 replace with {@link HongKongDollar}\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HongKong_dollar = `HKD`,\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n * @description Currency symbol: C$\n */\n CanadianDollar = `CAD`,\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n * @description Currency symbol: ֏\n */\n ArmenianDram = `AMD`,\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n * @description Currency symbol: ₴\n */\n Hryvnia = `UAH`,\n\n /**\n * Mexican peso\n *\n * @description Numeric code: 484\n * @description Alphabetic code: MXN\n * @description Countries and territories: Mexico\n * @description Currency symbol: $\n */\n MexicanPeso = `MXN`,\n\n /**\n * Uzbek sum\n *\n * @description Numeric code: 860\n * @description Alphabetic code: UZS\n * @description Countries and territories: Uzbekistan\n * @description Currency symbol: So'm\n */\n UzbekSum = `UZS`,\n\n /**\n * Kyrgyzstani som\n *\n * @description Numeric code: 417\n * @description Alphabetic code: KGS\n * @description Countries and territories: Kyrgyzstan\n * @description Currency symbol: c\n */\n KyrgyzstanSom = `KGS`,\n\n /**\n * United Arab Emirates dirham\n *\n * @description Numeric code: 784\n * @description Alphabetic code: AED\n * @description Countries and territories: United Arab Emirates\n * @description Currency symbol: Dh\n */\n Dirham = `AED`,\n}\n","/**\n * **Active ISO 4217 numeric currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Numeric code is also called \"number-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrencyCode {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n * @description Currency symbol: ₽\n */\n Ruble = `643`,\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n * @description Currency symbol: €\n */\n Euro = `978`,\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n * @description Currency symbol: $\n */\n Dollar = `840`,\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n * @description Currency symbol: £\n */\n Pound = `826`,\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n * @description Currency symbol: ฿\n */\n Baht = `764`,\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n * @description Currency symbol: ₺\n */\n TurkishLira = `949`,\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n * @description Currency symbol: CN¥\n */\n YuanRenminbi = `156`,\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n * @description Currency symbol: ₸\n */\n Tenge = `398`,\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n * @description Currency symbol: ₪\n */\n IsraeliShekel = `376`,\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n * @description Currency symbol: ₹\n */\n IndianRupee = `356`,\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n * @description Currency symbol: ¥\n */\n Yen = `392`,\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n * @description Currency symbol: ₩\n */\n Won = `410`,\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n * @description Currency symbol: ₣\n */\n SwissFranc = `756`,\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n * @description Currency symbol: S$\n */\n SingaporeDollar = `702`,\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n * @description Currency symbol: A$\n */\n AustralianDollar = `036`,\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n * @description Currency symbol: HK$\n */\n HongKongDollar = `344`,\n\n /**\n * @deprecated\n * TODO: 3.0 replace with {@link HongKongDollar}\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HongKong_dollar = `344`,\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n * @description Currency symbol: C$\n */\n CanadianDollar = `124`,\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n * @description Currency symbol: ֏\n */\n ArmenianDram = `051`,\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n * @description Currency symbol: ₴\n */\n Hryvnia = `980`,\n\n /**\n * Mexican peso\n *\n * @description Numeric code: 484\n * @description Alphabetic code: MXN\n * @description Countries and territories: Mexico\n * @description Currency symbol: $\n */\n MexicanPeso = `484`,\n\n /**\n * Uzbek sum\n *\n * @description Numeric code: 860\n * @description Alphabetic code: UZS\n * @description Countries and territories: Uzbekistan\n * @description Currency symbol: So'm\n */\n UzbekSum = `860`,\n\n /**\n * Kyrgyzstani som\n *\n * @description Numeric code: 417\n * @description Alphabetic code: KGS\n * @description Countries and territories: Kyrgyzstan\n * @description Currency symbol: c\n */\n KyrgyzstanSom = `417`,\n\n /**\n * United Arab Emirates dirham\n *\n * @description Numeric code: 784\n * @description Alphabetic code: AED\n * @description Countries and territories: United Arab Emirates\n * @description Currency symbol: Dh\n */\n Dirham = `784`,\n}\n","/**\n * negative-only — show sign only for negative numbers\n * always — always show sign, except for zero\n * never — never show sign\n * force-negative — show minus no matter the number, except for zero\n * force-positive — show plus no matter the number, except for zero\n * @deprecated use join type {@link TuiMoneySignT}\n * TODO: delete in v3.0\n */\nexport const enum TuiMoneySign {\n NegativeOnly = `negative-only`,\n Always = `always`,\n Never = `never`,\n ForceNegative = `force-negative`,\n ForcePositive = `force-positive`,\n}\n","export const enum TuiPaymentSystem {\n Visa = `visa`,\n Electron = `electron`,\n Mastercard = `mastercard`,\n Maestro = `maestro`,\n Mir = `mir`,\n}\n\nexport type TuiPaymentSystemT = 'electron' | 'maestro' | 'mastercard' | 'mir' | 'visa';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;;IAQkB;AAAlB,WAAkB,WAAW;;;;;;;;;IASzB,4BAAa,CAAA;;;;;;;;;IAUb,2BAAY,CAAA;;;;;;;;;IAUZ,6BAAc,CAAA;;;;;;;;;IAUd,4BAAa,CAAA;;;;;;;;;IAUb,2BAAY,CAAA;;;;;;;;;IAUZ,kCAAmB,CAAA;;;;;;;;;IAUnB,mCAAoB,CAAA;;;;;;;;;IAUpB,4BAAa,CAAA;;;;;;;;;IAUb,oCAAqB,CAAA;;;;;;;;;IAUrB,kCAAmB,CAAA;;;;;;;;;IAUnB,0BAAW,CAAA;;;;;;;;;IAU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ACRjC;;;;;;;;;IASkB;AAAlB,WAAkB,YAAY;IAC1B,8CAA8B,CAAA;IAC9B,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,gDAAgC,CAAA;IAChC,gDAAgC,CAAA;AACpC,CAAC,EANiB,YAAY,KAAZ,YAAY;;ICTZ;AAAlB,WAAkB,gBAAgB;IAC9B,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+BAAW,CAAA;AACf,CAAC,EANiB,gBAAgB,KAAhB,gBAAgB;;ACAlC;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = `${rawValue.slice(0, 2)}/${rawValue.slice(5)}`;\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n\n // TODO: investigate why the month is sometimes more than 2-length in safari\n const month = array[1].slice(2);\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${`0`.repeat(2 - month.length)}${month}/${\n year ? year.slice(2) : ``\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split(``);\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = `/`;\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = `0`;\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(``),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\n/**\n * @deprecated: use {@link tuiGetCurrencySymbol} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return `₽`;\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n case TuiCurrency.MexicanPeso:\n case TuiCurrencyCode.MexicanPeso:\n return `$`;\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return `S$`;\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return `A$`;\n case TuiCurrency.HongKongDollar:\n case TuiCurrencyCode.HongKongDollar:\n return `HK$`;\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return `C$`;\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return `€`;\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return `£`;\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return `฿`;\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return `₺`;\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return `CN¥`;\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return `¥`;\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return `₪`;\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return `₹`;\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return `₣`;\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return `֏`;\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return `₩`;\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return `₸`;\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return `₴`;\n case TuiCurrency.UzbekSum:\n case TuiCurrencyCode.UzbekSum:\n return `So'm`;\n case TuiCurrency.KyrgyzstanSom:\n case TuiCurrencyCode.KyrgyzstanSom:\n return `c`;\n case TuiCurrency.Dirham:\n case TuiCurrencyCode.Dirham:\n return `Dh`;\n default:\n return null;\n }\n}\n\nexport const tuiGetCurrencySymbol = getCurrencySymbol;\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\n/**\n * @deprecated: use {@link tuiFormatCurrency} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nexport const tuiFormatCurrency = formatCurrency;\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === `string`\n ? currency || ``\n : padStart(String(currency), 3, `0`);\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\n/**\n * @deprecated: use {@link tuiGetPaymentSystem} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === ``) {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.slice(0, 2), 10);\n const three = Number.parseInt(cardNumber.slice(0, 3), 10);\n const four = Number.parseInt(cardNumber.slice(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport const tuiGetPaymentSystem = getPaymentSystem;\n\n/**\n * @deprecated: use {@link tuiIsMaestro} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport const tuiIsMaestro = isMaestro;\n\n/**\n * @deprecated: use {@link tuiIsMastercard} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport const tuiIsMastercard = isMastercard;\n\n/**\n * @deprecated: use {@link tuiIsMir} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport const tuiIsMir = isMir;\n\n/**\n * @deprecated: use {@link tuiIsElectron} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport const tuiIsElectron = isElectron;\n\n/**\n * @deprecated: use {@link tuiIsVisa} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n\nexport const tuiIsVisa = isVisa;\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * @deprecated: use {@link tuiIsCardLengthValid} instead\n * Validates card number length using payment system dictionary\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n\nexport const tuiIsCardLengthValid = isCardLengthValid;\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * @deprecated: use {@link tuiIsCardNumberValid} instead\n * Validates card number using Luhn algorithm\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, ``);\n\n const {length} = cardNumber;\n const arr = cardNumber.split(``).map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n\nexport const tuiIsCardNumberValid = isCardNumberValid;\n","/**\n * @deprecated: use {@link tuiIsExpireValid} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n\nexport const tuiIsExpireValid = isExpireValid;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,IAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,UAAC,cAAc,EAAE,EAAU;YAAT,sBAAQ;;QAE7B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,SAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;SACnE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;;YAGnD,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAChC,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,UAAC,EAAQ;oBAAP,kBAAM;gBAAM,OAAA,MAAM,KAAK,CAAC;aAAA,CAAC,CAAC;YAEpD,cAAc,GAAG,KAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC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AAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF,CAAC;IAEY,gBAAgB,GAAG;;ACdhC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = `${rawValue.slice(0, 2)}/${rawValue.slice(5)}`;\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n\n // TODO: investigate why the month is sometimes more than 2-length in safari\n const month = array[1].slice(2);\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${`0`.repeat(2 - month.length)}${month}/${\n year ? year.slice(2) : ``\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split(``);\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = `/`;\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = `0`;\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(``),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\n/**\n * @deprecated: use {@link tuiGetCurrencySymbol} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return `₽`;\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n case TuiCurrency.MexicanPeso:\n case TuiCurrencyCode.MexicanPeso:\n return `$`;\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return `S$`;\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return `A$`;\n case TuiCurrency.HongKongDollar:\n case TuiCurrencyCode.HongKongDollar:\n return `HK$`;\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return `C$`;\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return `€`;\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return `£`;\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return `฿`;\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return `₺`;\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return `CN¥`;\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return `¥`;\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return `₪`;\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return `₹`;\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return `₣`;\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return `֏`;\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return `₩`;\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return `₸`;\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return `₴`;\n case TuiCurrency.UzbekSum:\n case TuiCurrencyCode.UzbekSum:\n return `So'm`;\n case TuiCurrency.KyrgyzstanSom:\n case TuiCurrencyCode.KyrgyzstanSom:\n return `c`;\n case TuiCurrency.Dirham:\n case TuiCurrencyCode.Dirham:\n return `Dh`;\n default:\n return null;\n }\n}\n\nexport const tuiGetCurrencySymbol = getCurrencySymbol;\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\n/**\n * @deprecated: use {@link tuiFormatCurrency} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nexport const tuiFormatCurrency = formatCurrency;\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === `string`\n ? currency || ``\n : padStart(String(currency), 3, `0`);\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\n/**\n * @deprecated: use {@link tuiGetPaymentSystem} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === ``) {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.slice(0, 2), 10);\n const three = Number.parseInt(cardNumber.slice(0, 3), 10);\n const four = Number.parseInt(cardNumber.slice(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport const tuiGetPaymentSystem = getPaymentSystem;\n\n/**\n * @deprecated: use {@link tuiIsMaestro} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport const tuiIsMaestro = isMaestro;\n\n/**\n * @deprecated: use {@link tuiIsMastercard} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport const tuiIsMastercard = isMastercard;\n\n/**\n * @deprecated: use {@link tuiIsMir} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport const tuiIsMir = isMir;\n\n/**\n * @deprecated: use {@link tuiIsElectron} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport const tuiIsElectron = isElectron;\n\n/**\n * @deprecated: use {@link tuiIsVisa} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n\nexport const tuiIsVisa = isVisa;\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * @deprecated: use {@link tuiIsCardLengthValid} instead\n * Validates card number length using payment system dictionary\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n\nexport const tuiIsCardLengthValid = isCardLengthValid;\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * @deprecated: use {@link tuiIsCardNumberValid} instead\n * Validates card number using Luhn algorithm\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardNumberValid(value: number | string): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, ``);\n\n const {length} = cardNumber;\n const arr = cardNumber.split(``).map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n\nexport const tuiIsCardNumberValid = isCardNumberValid;\n","/**\n * @deprecated: use {@link tuiIsExpireValid} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n\nexport const tuiIsExpireValid = isExpireValid;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,IAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,UAAC,cAAc,EAAE,EAAU;YAAT,sBAAQ;;QAE7B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,SAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;SACnE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;;YAGnD,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAChC,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,UAAC,EAAQ;oBAAP,kBAAM;gBAAM,OAAA,MAAM,KAAK,CAAC;aAAA,CAAC,CAAC;YAEpD,cAAc,GAAG,KAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,UACpD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAC3B,CAAC;SACN;QAED,IAAM,mBAAmB,GAAa,EAAE,CAAC;QACzC,IAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,CA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;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-commerce",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.76.0",
|
|
4
4
|
"description": "Extension package for Taiga UI related to commerce, payment systems, currencies etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"@angular/core": ">=9.0.0",
|
|
19
19
|
"@angular/forms": ">=9.0.0",
|
|
20
20
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
21
|
-
"@taiga-ui/cdk": ">=2.
|
|
22
|
-
"@taiga-ui/core": ">=2.
|
|
23
|
-
"@taiga-ui/i18n": ">=2.
|
|
21
|
+
"@taiga-ui/cdk": ">=2.76.0",
|
|
22
|
+
"@taiga-ui/core": ">=2.76.0",
|
|
23
|
+
"@taiga-ui/i18n": ">=2.76.0",
|
|
24
24
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
25
25
|
"angular2-text-mask": ">=9.0.0",
|
|
26
26
|
"rxjs": ">=6.0.0"
|
package/types/money-sign.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CHAR_MINUS, CHAR_PLUS } from '@taiga-ui/cdk';
|
|
2
|
-
export declare type TuiMoneySignT = '
|
|
3
|
-
export declare type TuiMoneySignSymbol =
|
|
2
|
+
export declare type TuiMoneySignT = 'always' | 'force-negative' | 'force-positive' | 'negative-only' | 'never';
|
|
3
|
+
export declare type TuiMoneySignSymbol = typeof CHAR_MINUS | typeof CHAR_PLUS | '';
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* @deprecated: use {@link tuiIsCardNumberValid} instead
|
|
3
3
|
* Validates card number using Luhn algorithm
|
|
4
4
|
*/
|
|
5
|
-
export declare function isCardNumberValid(value:
|
|
5
|
+
export declare function isCardNumberValid(value: number | string): boolean;
|
|
6
6
|
export declare const tuiIsCardNumberValid: typeof isCardNumberValid;
|