@taiga-ui/addon-commerce 2.28.0 → 2.32.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/README.md +4 -5
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +7 -4
- 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 +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-money.umd.js +2 -2
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +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 +284 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
- package/components/input-card-grouped/input-card-grouped.component.d.ts +2 -1
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
- package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +1 -1
- package/enums/currency-code.d.ts +141 -0
- package/enums/currency.d.ts +142 -1
- package/enums/taiga-ui-addon-commerce-enums.metadata.json +1 -1
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +9 -6
- package/esm2015/components/money/money.component.js +3 -3
- package/esm2015/enums/currency-code.js +142 -1
- package/esm2015/enums/currency.js +143 -2
- package/esm2015/utils/create-auto-corrected-expire-pipe.js +2 -2
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +9 -6
- package/esm5/components/money/money.component.js +3 -3
- package/esm5/enums/currency-code.js +142 -1
- package/esm5/enums/currency.js +143 -2
- package/esm5/utils/create-auto-corrected-expire-pipe.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +8 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js +283 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +8 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js +2 -2
- package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-enums.js +283 -1
- package/fesm5/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money.component.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 {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = TuiCurrency.Ruble;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = 'negative-only';\n\n @Input()\n @tuiDefaultProp()\n colored = false;\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n singleColor = false;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\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_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\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 === '+' ||\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(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\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';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAuBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAqF1B,YAEqB,YAAkC;QAAlC,iBAAY,GAAZ,YAAY,CAAsB;QApFvD,UAAK,GAAG,GAAG,CAAC;QAIZ,YAAO,GAAgB,UAAU,CAAC;QAIlC,aAAQ,qBAA0C;QAIlD,SAAI,GAAkB,eAAe,CAAC;QAItC,YAAO,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,CAAC,CAAC;QAId,gBAAW,GAAG,KAAK,CAAC;KA6DhB;IA3DJ,IAAI,WAAW;QACX,OAAO,YAAY,CACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAChC,IAAI,EACJ,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAClC,IAAI,CAAC,YAAY,CAAC,iBAAiB,CACtC,CAAC;KACL;IAED,IAAI,YAAY;QACZ,MAAM,EAAC,OAAO,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC;QAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7D,OAAO,OAAO,KAAK,OAAO;aACrB,QAAQ,CAAC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AAItC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;kDACD;AAIhB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oDACH;AAId;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACG;AAoCpB;IADC,WAAW,CAAC,YAAY,CAAC;4CAOzB;AAGD;IADC,WAAW,CAAC,cAAc,CAAC;8CAO3B;AAGD;IADC,WAAW,CAAC,sBAAsB,CAAC;qDAGnC;AAnFQ,iBAAiB;IAN7B,SAAS,CAAC;QACP,QAAQ,EAAE,WAAW;QACrB,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money.component.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 {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = TuiCurrency.Ruble;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = 'negative-only';\n\n @Input()\n @tuiDefaultProp()\n colored = false;\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n singleColor = false;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\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_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\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 === '+' ||\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(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\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';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAuBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAqF1B,YAEqB,YAAkC;QAAlC,iBAAY,GAAZ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AjB,cAAc;IAL1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;QAC9C,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACX9B;;;;;;"}
|
|
@@ -1,46 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Active ISO 4217 alphabetic currency codes**
|
|
3
|
+
*
|
|
4
|
+
* @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.
|
|
5
|
+
* @description Alphabetic code is also called "alfa-3".
|
|
6
|
+
*
|
|
7
|
+
* @link https://en.wikipedia.org/wiki/ISO_4217
|
|
8
|
+
*/
|
|
1
9
|
var TuiCurrency;
|
|
2
10
|
(function (TuiCurrency) {
|
|
11
|
+
/**
|
|
12
|
+
* Russian ruble
|
|
13
|
+
*
|
|
14
|
+
* @description Numeric code: 643
|
|
15
|
+
* @description Alphabetic code: RUB
|
|
16
|
+
* @description Countries and territories: Russia
|
|
17
|
+
*/
|
|
3
18
|
TuiCurrency["Ruble"] = "RUB";
|
|
19
|
+
/**
|
|
20
|
+
* Euro
|
|
21
|
+
*
|
|
22
|
+
* @description Numeric code: 978
|
|
23
|
+
* @description Alphabetic code: EUR
|
|
24
|
+
* @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)
|
|
25
|
+
*/
|
|
4
26
|
TuiCurrency["Euro"] = "EUR";
|
|
27
|
+
/**
|
|
28
|
+
* United States dollar
|
|
29
|
+
*
|
|
30
|
+
* @description Numeric code: 840
|
|
31
|
+
* @description Alphabetic code: USD
|
|
32
|
+
* @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)
|
|
33
|
+
*/
|
|
5
34
|
TuiCurrency["Dollar"] = "USD";
|
|
35
|
+
/**
|
|
36
|
+
* Pound sterling
|
|
37
|
+
*
|
|
38
|
+
* @description Numeric code: 826
|
|
39
|
+
* @description Alphabetic code: GBP
|
|
40
|
+
* @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)
|
|
41
|
+
*/
|
|
6
42
|
TuiCurrency["Pound"] = "GBP";
|
|
43
|
+
/**
|
|
44
|
+
* Thai baht
|
|
45
|
+
*
|
|
46
|
+
* @description Numeric code: 764
|
|
47
|
+
* @description Alphabetic code: THB
|
|
48
|
+
* @description Countries and territories: Thailand
|
|
49
|
+
*/
|
|
7
50
|
TuiCurrency["Baht"] = "THB";
|
|
51
|
+
/**
|
|
52
|
+
* Turkish lira
|
|
53
|
+
*
|
|
54
|
+
* @description Numeric code: 949
|
|
55
|
+
* @description Alphabetic code: TRY
|
|
56
|
+
* @description Countries and territories: Turkey
|
|
57
|
+
*/
|
|
8
58
|
TuiCurrency["TurkishLira"] = "TRY";
|
|
59
|
+
/**
|
|
60
|
+
* Chinese yuan
|
|
61
|
+
*
|
|
62
|
+
* @description Numeric code: 156
|
|
63
|
+
* @description Alphabetic code: CNY
|
|
64
|
+
* @description Countries and territories: China
|
|
65
|
+
*/
|
|
9
66
|
TuiCurrency["YuanRenminbi"] = "CNY";
|
|
67
|
+
/**
|
|
68
|
+
* Kazakhstani tenge
|
|
69
|
+
*
|
|
70
|
+
* @description Numeric code: 398
|
|
71
|
+
* @description Alphabetic code: KZT
|
|
72
|
+
* @description Countries and territories: Kazakhstan
|
|
73
|
+
*/
|
|
10
74
|
TuiCurrency["Tenge"] = "KZT";
|
|
75
|
+
/**
|
|
76
|
+
* Israeli new shekel
|
|
77
|
+
*
|
|
78
|
+
* @description Numeric code: 376
|
|
79
|
+
* @description Alphabetic code: ILS
|
|
80
|
+
* @description Countries and territories: Israel
|
|
81
|
+
*/
|
|
11
82
|
TuiCurrency["IsraeliShekel"] = "ILS";
|
|
83
|
+
/**
|
|
84
|
+
* Indian rupee
|
|
85
|
+
*
|
|
86
|
+
* @description Numeric code: 356
|
|
87
|
+
* @description Alphabetic code: INR
|
|
88
|
+
* @description Countries and territories: India, Bhutan
|
|
89
|
+
*/
|
|
12
90
|
TuiCurrency["IndianRupee"] = "INR";
|
|
91
|
+
/**
|
|
92
|
+
* Japanese yen
|
|
93
|
+
*
|
|
94
|
+
* @description Numeric code: 392
|
|
95
|
+
* @description Alphabetic code: JPY
|
|
96
|
+
* @description Countries and territories: Japan
|
|
97
|
+
*/
|
|
13
98
|
TuiCurrency["Yen"] = "JPY";
|
|
99
|
+
/**
|
|
100
|
+
* South Korean won
|
|
101
|
+
*
|
|
102
|
+
* @description Numeric code: 410
|
|
103
|
+
* @description Alphabetic code: KRW
|
|
104
|
+
* @description Countries and territories: South Korea
|
|
105
|
+
*/
|
|
106
|
+
TuiCurrency["Won"] = "KRW";
|
|
107
|
+
/**
|
|
108
|
+
* Swiss franc
|
|
109
|
+
*
|
|
110
|
+
* @description Numeric code: 756
|
|
111
|
+
* @description Alphabetic code: CHF
|
|
112
|
+
* @description Countries and territories: Switzerland, Liechtenstein (LI)
|
|
113
|
+
*/
|
|
14
114
|
TuiCurrency["SwissFranc"] = "CHF";
|
|
115
|
+
/**
|
|
116
|
+
* Singapore dollar
|
|
117
|
+
*
|
|
118
|
+
* @description Numeric code: 702
|
|
119
|
+
* @description Alphabetic code: SGD
|
|
120
|
+
* @description Countries and territories: Singapore
|
|
121
|
+
*/
|
|
15
122
|
TuiCurrency["SingaporeDollar"] = "SGD";
|
|
123
|
+
/**
|
|
124
|
+
* Australian dollar
|
|
125
|
+
*
|
|
126
|
+
* @description Numeric code: 036
|
|
127
|
+
* @description Alphabetic code: AUD
|
|
128
|
+
* @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)
|
|
129
|
+
*/
|
|
16
130
|
TuiCurrency["AustralianDollar"] = "AUD";
|
|
131
|
+
/**
|
|
132
|
+
* Hong Kong dollar
|
|
133
|
+
*
|
|
134
|
+
* @description Numeric code: 344
|
|
135
|
+
* @description Alphabetic code: HKD
|
|
136
|
+
* @description Countries and territories: Hong Kong
|
|
137
|
+
*/
|
|
17
138
|
TuiCurrency["HongKong_dollar"] = "HKD";
|
|
139
|
+
/**
|
|
140
|
+
* Canadian dollar
|
|
141
|
+
*
|
|
142
|
+
* @description Numeric code: 124
|
|
143
|
+
* @description Alphabetic code: CAD
|
|
144
|
+
* @description Countries and territories: Canada
|
|
145
|
+
*/
|
|
18
146
|
TuiCurrency["CanadianDollar"] = "CAD";
|
|
147
|
+
/**
|
|
148
|
+
* Armenian dram
|
|
149
|
+
*
|
|
150
|
+
* @description Numeric code: 051
|
|
151
|
+
* @description Alphabetic code: AMD
|
|
152
|
+
* @description Countries and territories: Armenia
|
|
153
|
+
*/
|
|
19
154
|
TuiCurrency["ArmenianDram"] = "AMD";
|
|
20
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Ukrainian hryvnia
|
|
157
|
+
*
|
|
158
|
+
* @description Numeric code: 980
|
|
159
|
+
* @description Alphabetic code: UAH
|
|
160
|
+
* @description Countries and territories: Ukraine
|
|
161
|
+
*/
|
|
21
162
|
TuiCurrency["Hryvnia"] = "UAH";
|
|
22
163
|
})(TuiCurrency || (TuiCurrency = {}));
|
|
23
164
|
|
|
165
|
+
/**
|
|
166
|
+
* **Active ISO 4217 numeric currency codes**
|
|
167
|
+
*
|
|
168
|
+
* @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.
|
|
169
|
+
* @description Numeric code is also called "number-3".
|
|
170
|
+
*
|
|
171
|
+
* @link https://en.wikipedia.org/wiki/ISO_4217
|
|
172
|
+
*/
|
|
24
173
|
var TuiCurrencyCode;
|
|
25
174
|
(function (TuiCurrencyCode) {
|
|
175
|
+
/**
|
|
176
|
+
* Russian ruble
|
|
177
|
+
*
|
|
178
|
+
* @description Numeric code: 643
|
|
179
|
+
* @description Alphabetic code: RUB
|
|
180
|
+
* @description Countries and territories: Russia
|
|
181
|
+
*/
|
|
26
182
|
TuiCurrencyCode["Ruble"] = "643";
|
|
183
|
+
/**
|
|
184
|
+
* Euro
|
|
185
|
+
*
|
|
186
|
+
* @description Numeric code: 978
|
|
187
|
+
* @description Alphabetic code: EUR
|
|
188
|
+
* @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)
|
|
189
|
+
*/
|
|
27
190
|
TuiCurrencyCode["Euro"] = "978";
|
|
191
|
+
/**
|
|
192
|
+
* United States dollar
|
|
193
|
+
*
|
|
194
|
+
* @description Numeric code: 840
|
|
195
|
+
* @description Alphabetic code: USD
|
|
196
|
+
* @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)
|
|
197
|
+
*/
|
|
28
198
|
TuiCurrencyCode["Dollar"] = "840";
|
|
199
|
+
/**
|
|
200
|
+
* Pound sterling
|
|
201
|
+
*
|
|
202
|
+
* @description Numeric code: 826
|
|
203
|
+
* @description Alphabetic code: GBP
|
|
204
|
+
* @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)
|
|
205
|
+
*/
|
|
29
206
|
TuiCurrencyCode["Pound"] = "826";
|
|
207
|
+
/**
|
|
208
|
+
* Thai baht
|
|
209
|
+
*
|
|
210
|
+
* @description Numeric code: 764
|
|
211
|
+
* @description Alphabetic code: THB
|
|
212
|
+
* @description Countries and territories: Thailand
|
|
213
|
+
*/
|
|
30
214
|
TuiCurrencyCode["Baht"] = "764";
|
|
215
|
+
/**
|
|
216
|
+
* Turkish lira
|
|
217
|
+
*
|
|
218
|
+
* @description Numeric code: 949
|
|
219
|
+
* @description Alphabetic code: TRY
|
|
220
|
+
* @description Countries and territories: Turkey
|
|
221
|
+
*/
|
|
31
222
|
TuiCurrencyCode["TurkishLira"] = "949";
|
|
223
|
+
/**
|
|
224
|
+
* Chinese yuan
|
|
225
|
+
*
|
|
226
|
+
* @description Numeric code: 156
|
|
227
|
+
* @description Alphabetic code: CNY
|
|
228
|
+
* @description Countries and territories: China
|
|
229
|
+
*/
|
|
32
230
|
TuiCurrencyCode["YuanRenminbi"] = "156";
|
|
231
|
+
/**
|
|
232
|
+
* Kazakhstani tenge
|
|
233
|
+
*
|
|
234
|
+
* @description Numeric code: 398
|
|
235
|
+
* @description Alphabetic code: KZT
|
|
236
|
+
* @description Countries and territories: Kazakhstan
|
|
237
|
+
*/
|
|
33
238
|
TuiCurrencyCode["Tenge"] = "398";
|
|
239
|
+
/**
|
|
240
|
+
* Israeli new shekel
|
|
241
|
+
*
|
|
242
|
+
* @description Numeric code: 376
|
|
243
|
+
* @description Alphabetic code: ILS
|
|
244
|
+
* @description Countries and territories: Israel
|
|
245
|
+
*/
|
|
34
246
|
TuiCurrencyCode["IsraeliShekel"] = "376";
|
|
247
|
+
/**
|
|
248
|
+
* Indian rupee
|
|
249
|
+
*
|
|
250
|
+
* @description Numeric code: 356
|
|
251
|
+
* @description Alphabetic code: INR
|
|
252
|
+
* @description Countries and territories: India, Bhutan
|
|
253
|
+
*/
|
|
35
254
|
TuiCurrencyCode["IndianRupee"] = "356";
|
|
255
|
+
/**
|
|
256
|
+
* Japanese yen
|
|
257
|
+
*
|
|
258
|
+
* @description Numeric code: 392
|
|
259
|
+
* @description Alphabetic code: JPY
|
|
260
|
+
* @description Countries and territories: Japan
|
|
261
|
+
*/
|
|
36
262
|
TuiCurrencyCode["Yen"] = "392";
|
|
263
|
+
/**
|
|
264
|
+
* South Korean won
|
|
265
|
+
*
|
|
266
|
+
* @description Numeric code: 410
|
|
267
|
+
* @description Alphabetic code: KRW
|
|
268
|
+
* @description Countries and territories: South Korea
|
|
269
|
+
*/
|
|
37
270
|
TuiCurrencyCode["Won"] = "410";
|
|
271
|
+
/**
|
|
272
|
+
* Swiss franc
|
|
273
|
+
*
|
|
274
|
+
* @description Numeric code: 756
|
|
275
|
+
* @description Alphabetic code: CHF
|
|
276
|
+
* @description Countries and territories: Switzerland, Liechtenstein (LI)
|
|
277
|
+
*/
|
|
38
278
|
TuiCurrencyCode["SwissFranc"] = "756";
|
|
279
|
+
/**
|
|
280
|
+
* Singapore dollar
|
|
281
|
+
*
|
|
282
|
+
* @description Numeric code: 702
|
|
283
|
+
* @description Alphabetic code: SGD
|
|
284
|
+
* @description Countries and territories: Singapore
|
|
285
|
+
*/
|
|
39
286
|
TuiCurrencyCode["SingaporeDollar"] = "702";
|
|
287
|
+
/**
|
|
288
|
+
* Australian dollar
|
|
289
|
+
*
|
|
290
|
+
* @description Numeric code: 036
|
|
291
|
+
* @description Alphabetic code: AUD
|
|
292
|
+
* @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)
|
|
293
|
+
*/
|
|
40
294
|
TuiCurrencyCode["AustralianDollar"] = "036";
|
|
295
|
+
/**
|
|
296
|
+
* Hong Kong dollar
|
|
297
|
+
*
|
|
298
|
+
* @description Numeric code: 344
|
|
299
|
+
* @description Alphabetic code: HKD
|
|
300
|
+
* @description Countries and territories: Hong Kong
|
|
301
|
+
*/
|
|
41
302
|
TuiCurrencyCode["HongKong_dollar"] = "344";
|
|
303
|
+
/**
|
|
304
|
+
* Canadian dollar
|
|
305
|
+
*
|
|
306
|
+
* @description Numeric code: 124
|
|
307
|
+
* @description Alphabetic code: CAD
|
|
308
|
+
* @description Countries and territories: Canada
|
|
309
|
+
*/
|
|
42
310
|
TuiCurrencyCode["CanadianDollar"] = "124";
|
|
311
|
+
/**
|
|
312
|
+
* Armenian dram
|
|
313
|
+
*
|
|
314
|
+
* @description Numeric code: 051
|
|
315
|
+
* @description Alphabetic code: AMD
|
|
316
|
+
* @description Countries and territories: Armenia
|
|
317
|
+
*/
|
|
43
318
|
TuiCurrencyCode["ArmenianDram"] = "051";
|
|
319
|
+
/**
|
|
320
|
+
* Ukrainian hryvnia
|
|
321
|
+
*
|
|
322
|
+
* @description Numeric code: 980
|
|
323
|
+
* @description Alphabetic code: UAH
|
|
324
|
+
* @description Countries and territories: Ukraine
|
|
325
|
+
*/
|
|
44
326
|
TuiCurrencyCode["Hryvnia"] = "980";
|
|
45
327
|
})(TuiCurrencyCode || (TuiCurrencyCode = {}));
|
|
46
328
|
|
|
@@ -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":["export const enum TuiCurrency {\n Ruble = 'RUB',\n Euro = 'EUR',\n Dollar = 'USD',\n Pound = 'GBP',\n Baht = 'THB',\n TurkishLira = 'TRY',\n YuanRenminbi = 'CNY',\n Tenge = 'KZT',\n IsraeliShekel = 'ILS',\n IndianRupee = 'INR',\n Yen = 'JPY',\n SwissFranc = 'CHF',\n SingaporeDollar = 'SGD',\n AustralianDollar = 'AUD',\n HongKong_dollar = 'HKD',\n CanadianDollar = 'CAD',\n ArmenianDram = 'AMD',\n Won = 'KRW',\n Hryvnia = 'UAH',\n}\n","export const enum TuiCurrencyCode {\n Ruble = '643',\n Euro = '978',\n Dollar = '840',\n Pound = '826',\n Baht = '764',\n TurkishLira = '949',\n YuanRenminbi = '156',\n Tenge = '398',\n IsraeliShekel = '376',\n IndianRupee = '356',\n Yen = '392',\n Won = '410',\n SwissFranc = '756',\n SingaporeDollar = '702',\n AustralianDollar = '036',\n HongKong_dollar = '344',\n CanadianDollar = '124',\n ArmenianDram = '051',\n Hryvnia = '980',\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 */\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"IAAkB;AAAlB,WAAkB,WAAW;IACzB,4BAAa,CAAA;IACb,2BAAY,CAAA;IACZ,6BAAc,CAAA;IACd,4BAAa,CAAA;IACb,2BAAY,CAAA;IACZ,kCAAmB,CAAA;IACnB,mCAAoB,CAAA;IACpB,4BAAa,CAAA;IACb,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,iCAAkB,CAAA;IAClB,sCAAuB,CAAA;IACvB,uCAAwB,CAAA;IACxB,sCAAuB,CAAA;IACvB,qCAAsB,CAAA;IACtB,mCAAoB,CAAA;IACpB,0BAAW,CAAA;IACX,8BAAe,CAAA;AACnB,CAAC,EApBiB,WAAW,KAAX,WAAW;;ICAX;AAAlB,WAAkB,eAAe;IAC7B,gCAAa,CAAA;IACb,+BAAY,CAAA;IACZ,iCAAc,CAAA;IACd,gCAAa,CAAA;IACb,+BAAY,CAAA;IACZ,sCAAmB,CAAA;IACnB,uCAAoB,CAAA;IACpB,gCAAa,CAAA;IACb,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,qCAAkB,CAAA;IAClB,0CAAuB,CAAA;IACvB,2CAAwB,CAAA;IACxB,0CAAuB,CAAA;IACvB,yCAAsB,CAAA;IACtB,uCAAoB,CAAA;IACpB,kCAAe,CAAA;AACnB,CAAC,EApBiB,eAAe,KAAf,eAAe;;ACAjC;;;;;;;;IAQkB;AAAlB,WAAkB,YAAY;IAC1B,8CAA8B,CAAA;IAC9B,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,gDAAgC,CAAA;IAChC,gDAAgC,CAAA;AACpC,CAAC,EANiB,YAAY,KAAZ,YAAY;;ICRZ;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
|
+
{"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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\n Hryvnia = 'UAH',\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\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 */\n Hryvnia = '980',\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 */\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;;IAQkB;AAAlB,WAAkB,WAAW;;;;;;;;IAQzB,4BAAa,CAAA;;;;;;;;IASb,2BAAY,CAAA;;;;;;;;IASZ,6BAAc,CAAA;;;;;;;;IASd,4BAAa,CAAA;;;;;;;;IASb,2BAAY,CAAA;;;;;;;;IASZ,kCAAmB,CAAA;;;;;;;;IASnB,mCAAoB,CAAA;;;;;;;;IASpB,4BAAa,CAAA;;;;;;;;IASb,oCAAqB,CAAA;;;;;;;;IASrB,kCAAmB,CAAA;;;;;;;;IASnB,0BAAW,CAAA;;;;;;;;IASX,0BAAW,CAAA;;;;;;;;IASX,iCAAkB,CAAA;;;;;;;;IASlB,sCAAuB,CAAA;;;;;;;;IASvB,uCAAwB,CAAA;;;;;;;;IASxB,sCAAuB,CAAA;;;;;;;;IASvB,qCAAsB,CAAA;;;;;;;;IAStB,mCAAoB,CAAA;;;;;;;;IASpB,8BAAe,CAAA;AACnB,CAAC,EA3KiB,WAAW,KAAX,WAAW;;ACR7B;;;;;;;;IAQkB;AAAlB,WAAkB,eAAe;;;;;;;;IAQ7B,gCAAa,CAAA;;;;;;;;IASb,+BAAY,CAAA;;;;;;;;IASZ,iCAAc,CAAA;;;;;;;;IASd,gCAAa,CAAA;;;;;;;;IASb,+BAAY,CAAA;;;;;;;;IASZ,sCAAmB,CAAA;;;;;;;;IASnB,uCAAoB,CAAA;;;;;;;;IASpB,gCAAa,CAAA;;;;;;;;IASb,wCAAqB,CAAA;;;;;;;;IASrB,sCAAmB,CAAA;;;;;;;;IASnB,8BAAW,CAAA;;;;;;;;IASX,8BAAW,CAAA;;;;;;;;IASX,qCAAkB,CAAA;;;;;;;;IASlB,0CAAuB,CAAA;;;;;;;;IASvB,2CAAwB,CAAA;;;;;;;;IASxB,0CAAuB,CAAA;;;;;;;;IASvB,yCAAsB,CAAA;;;;;;;;IAStB,uCAAoB,CAAA;;;;;;;;IASpB,kCAAe,CAAA;AACnB,CAAC,EA3KiB,eAAe,KAAf,eAAe;;ACRjC;;;;;;;;IAQkB;AAAlB,WAAkB,YAAY;IAC1B,8CAA8B,CAAA;IAC9B,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,gDAAgC,CAAA;IAChC,gDAAgC,CAAA;AACpC,CAAC,EANiB,YAAY,KAAZ,YAAY;;ICRZ;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,7 +1,7 @@
|
|
|
1
1
|
import { TUI_NON_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP } from '@taiga-ui/core';
|
|
2
2
|
import { padStart } from '@taiga-ui/cdk';
|
|
3
3
|
|
|
4
|
-
const TUI_EXP_YEAR_MONTH = /^\d{2}[
|
|
4
|
+
const TUI_EXP_YEAR_MONTH = /^\d{2}[/|.]\d{4}$/;
|
|
5
5
|
const TUI_EXP_SAFARI = /^\d{1,4}.\d{1,2}.\d{1,4}$/;
|
|
6
6
|
/**
|
|
7
7
|
* Correct expiration date text allowing only valid months
|
|
@@ -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.substr(0, 2) + '/' + rawValue.substr(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 const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(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\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 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.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\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 default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\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\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.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(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 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 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 function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\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 function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\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","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\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","export 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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAC;;QAE9B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAG,QAAQ,CAAC,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MAAM,CAAC,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;;ACRA;;;;;;"}
|
|
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.substr(0, 2) + '/' + rawValue.substr(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 const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(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\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 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.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\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 default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\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\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.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(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 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 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 function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\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 function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\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","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\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","export 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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],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M,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,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;;ACRA;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import { NgControl, FormsModule } from '@angular/forms';
|
|
|
4
4
|
import { tuiDefaultCardValidator, TUI_CARD_MASK } from '@taiga-ui/addon-commerce/constants';
|
|
5
5
|
import { tuiCreateAutoCorrectedExpirePipe, getPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
6
6
|
import { typedFromEvent, isNativeFocusedIn, setNativeFocused, isNativeFocused, tuiDefaultProp, tuiRequiredSetter, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiNullableControl, TuiFocusableModule, TuiHoveredModule, TuiActiveZoneModule, TuiInputModeModule, TuiMapperPipeModule, TuiPreventDefaultModule } from '@taiga-ui/cdk';
|
|
7
|
-
import { TUI_DIGIT_REGEXP, TUI_NON_DIGIT_REGEXP, TUI_MODE, TuiDataListDirective, TuiDataListComponent, MODE_PROVIDER, TUI_DATA_LIST_HOST, TuiSvgModule, TuiWrapperModule, TuiDropdownModule } from '@taiga-ui/core';
|
|
7
|
+
import { TUI_DIGIT_REGEXP, TUI_NON_DIGIT_REGEXP, TUI_MODE, TUI_TEXTFIELD_APPEARANCE, TuiDataListDirective, TuiDataListComponent, MODE_PROVIDER, TUI_DATA_LIST_HOST, TuiSvgModule, TuiWrapperModule, TuiDropdownModule } from '@taiga-ui/core';
|
|
8
8
|
import { combineLatest, of, Observable } from 'rxjs';
|
|
9
9
|
import { WINDOW } from '@ng-web-apis/common';
|
|
10
10
|
import { TUI_CARD_NUMBER_TEXTS, TUI_CARD_EXPIRY_TEXTS, TUI_CARD_CVC_TEXTS } from '@taiga-ui/addon-commerce/tokens';
|
|
@@ -55,11 +55,12 @@ var ICONS = (_a = {},
|
|
|
55
55
|
// @dynamic
|
|
56
56
|
var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
57
57
|
__extends(TuiInputCardGroupedComponent, _super);
|
|
58
|
-
function TuiInputCardGroupedComponent(control, changeDetectorRef, elementRef, mode$, cardGroupedTexts
|
|
58
|
+
function TuiInputCardGroupedComponent(control, changeDetectorRef, elementRef, mode$, cardGroupedTexts$, appearance) {
|
|
59
59
|
var _this = _super.call(this, control, changeDetectorRef) || this;
|
|
60
60
|
_this.elementRef = elementRef;
|
|
61
61
|
_this.mode$ = mode$;
|
|
62
62
|
_this.cardGroupedTexts$ = cardGroupedTexts$;
|
|
63
|
+
_this.appearance = appearance;
|
|
63
64
|
_this.expireInert = false;
|
|
64
65
|
_this.autocompleteEnabled = false;
|
|
65
66
|
_this.cardSrc = null; // TODO(splincode): will be deleted `null` in v3.0
|
|
@@ -444,7 +445,8 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
444
445
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
445
446
|
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
446
447
|
{ type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] },
|
|
447
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_CARD_GROUPED_TEXTS,] }] }
|
|
448
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_CARD_GROUPED_TEXTS,] }] },
|
|
449
|
+
{ type: String, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_APPEARANCE,] }] }
|
|
448
450
|
]; };
|
|
449
451
|
__decorate([
|
|
450
452
|
ViewChild('inputCard')
|
|
@@ -500,7 +502,7 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
500
502
|
TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = __decorate([
|
|
501
503
|
Component({
|
|
502
504
|
selector: 'tui-input-card-grouped',
|
|
503
|
-
template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n
|
|
505
|
+
template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n class=\"t-common-wrapper\"\n [appearance]=\"appearance\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n [tuiDropdown]=\"open\"\n [tuiDropdownContent]=\"dropdown || ''\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (tuiActiveZoneChange)=\"onActiveZoneChange($event)\"\n (scroll)=\"onScroll($event.currentTarget)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label tuiPreventDefault=\"click\">\n <input\n #inputCard\n type=\"text\"\n automation-id=\"tui-input-card-grouped__card\"\n tuiInputMode=\"numeric\"\n class=\"t-input t-input_card\"\n [class.t-input_inert]=\"cardPrefilled\"\n [class.t-input_hidden]=\"isCardCollapsed\"\n [attr.id]=\"idCard\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [placeholder]=\"cardPrefilled ? '' : exampleText\"\n [autocomplete]=\"autocompleteCard\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [textMask]=\"maskCard\"\n [tuiFocusable]=\"cardFocusable\"\n [ngModel]=\"formattedCard\"\n (ngModelChange)=\"onCardChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n aria-hidden=\"true\"\n class=\"t-collapsed\"\n [class.t-collapsed_inactive]=\"!isCardCollapsed\"\n [attr.data-before]=\"masked\"\n >\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [class.t-value_collapsed]=\"isCardCollapsed\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cardNumberText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputExpire\n type=\"text\"\n placeholder=\"00/00\"\n automation-id=\"tui-input-card-grouped__expire\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_inert]=\"!expireFocusable\"\n [attr.id]=\"idExpire\"\n [attr.name]=\"name\"\n [autocomplete]=\"autocompleteExpire\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiFocusable]=\"expireFocusable\"\n [textMask]=\"maskExpire\"\n [ngModel]=\"expire\"\n (ngModelChange)=\"onExpireChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.expiryText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputCVC\n type=\"text\"\n automation-id=\"tui-input-card-grouped__cvc\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [attr.id]=\"idCVC\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly || cvcPrefilled\"\n [autocomplete]=\"autocompleteCVC\"\n [textMask]=\"maskCVC\"\n [tuiFocusable]=\"cvcFocusable\"\n [ngModel]=\"cvc\"\n (ngModelChange)=\"onCVCChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cvcText }}\n </span>\n </label>\n </div>\n <div class=\"t-icons\">\n <div\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-icon-outlet\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n automation-id=\"tui-input-card-grouped__icon\"\n class=\"t-card\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </div>\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"t-icon\"\n (click)=\"clear()\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"hasDropdown\"\n src=\"tuiIconChevronDownLarge\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"open\"\n (click)=\"toggle()\"\n ></tui-svg>\n </div>\n</tui-wrapper>\n",
|
|
504
506
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
505
507
|
providers: [
|
|
506
508
|
MODE_PROVIDER,
|
|
@@ -525,7 +527,8 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
525
527
|
__param(1, Inject(ChangeDetectorRef)),
|
|
526
528
|
__param(2, Inject(ElementRef)),
|
|
527
529
|
__param(3, Inject(TUI_MODE)),
|
|
528
|
-
__param(4, Inject(TUI_INPUT_CARD_GROUPED_TEXTS))
|
|
530
|
+
__param(4, Inject(TUI_INPUT_CARD_GROUPED_TEXTS)),
|
|
531
|
+
__param(5, Inject(TUI_TEXTFIELD_APPEARANCE))
|
|
529
532
|
], TuiInputCardGroupedComponent);
|
|
530
533
|
return TuiInputCardGroupedComponent;
|
|
531
534
|
}(AbstractTuiNullableControl));
|