@taiga-ui/addon-commerce 2.30.0 → 2.34.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.
Files changed (64) hide show
  1. package/bundles/taiga-ui-addon-commerce-components-card.umd.js +2 -2
  2. package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
  3. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +1 -1
  4. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +18 -7
  6. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
  7. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +2 -2
  8. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-addon-commerce-components-money.umd.js +2 -2
  10. package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
  11. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +1 -1
  12. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-addon-commerce-enums.umd.js +286 -1
  14. package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
  15. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +1 -1
  16. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +1 -1
  17. package/bundles/taiga-ui-addon-commerce-utils.umd.js +2 -0
  18. package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
  19. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +1 -1
  20. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
  21. package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +1 -1
  22. package/components/input-card-grouped/input-card-grouped.component.d.ts +3 -1
  23. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
  24. package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +1 -1
  25. package/enums/currency-code.d.ts +143 -1
  26. package/enums/currency.d.ts +144 -2
  27. package/enums/taiga-ui-addon-commerce-enums.metadata.json +1 -1
  28. package/esm2015/components/card/card.component.js +3 -3
  29. package/esm2015/components/input-card-grouped/input-card-grouped.component.js +16 -9
  30. package/esm2015/components/money/money.component.js +3 -3
  31. package/esm2015/enums/currency-code.js +143 -1
  32. package/esm2015/enums/currency.js +144 -2
  33. package/esm2015/types/currency-variants.js +1 -1
  34. package/esm2015/utils/get-currency-symbol.js +3 -1
  35. package/esm5/components/card/card.component.js +3 -3
  36. package/esm5/components/input-card-grouped/input-card-grouped.component.js +20 -9
  37. package/esm5/components/money/money.component.js +3 -3
  38. package/esm5/enums/currency-code.js +143 -1
  39. package/esm5/enums/currency.js +144 -2
  40. package/esm5/types/currency-variants.js +1 -1
  41. package/esm5/utils/get-currency-symbol.js +3 -1
  42. package/fesm2015/taiga-ui-addon-commerce-components-card.js +2 -2
  43. package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
  44. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +15 -8
  45. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  46. package/fesm2015/taiga-ui-addon-commerce-components-money.js +2 -2
  47. package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
  48. package/fesm2015/taiga-ui-addon-commerce-enums.js +285 -1
  49. package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
  50. package/fesm2015/taiga-ui-addon-commerce-utils.js +2 -0
  51. package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
  52. package/fesm5/taiga-ui-addon-commerce-components-card.js +2 -2
  53. package/fesm5/taiga-ui-addon-commerce-components-card.js.map +1 -1
  54. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +19 -8
  55. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  56. package/fesm5/taiga-ui-addon-commerce-components-money.js +2 -2
  57. package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
  58. package/fesm5/taiga-ui-addon-commerce-enums.js +285 -1
  59. package/fesm5/taiga-ui-addon-commerce-enums.js.map +1 -1
  60. package/fesm5/taiga-ui-addon-commerce-utils.js +2 -0
  61. package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
  62. package/package.json +7 -7
  63. package/types/currency-variants.d.ts +2 -1
  64. package/types/taiga-ui-addon-commerce-types.metadata.json +1 -1
@@ -1,47 +1,331 @@
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
- TuiCurrency["Won"] = "KRW";
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";
163
+ TuiCurrency["MexicanPeso"] = "MXN";
22
164
  })(TuiCurrency || (TuiCurrency = {}));
23
165
 
166
+ /**
167
+ * **Active ISO 4217 numeric currency codes**
168
+ *
169
+ * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.
170
+ * @description Numeric code is also called "number-3".
171
+ *
172
+ * @link https://en.wikipedia.org/wiki/ISO_4217
173
+ */
24
174
  var TuiCurrencyCode;
25
175
  (function (TuiCurrencyCode) {
176
+ /**
177
+ * Russian ruble
178
+ *
179
+ * @description Numeric code: 643
180
+ * @description Alphabetic code: RUB
181
+ * @description Countries and territories: Russia
182
+ */
26
183
  TuiCurrencyCode["Ruble"] = "643";
184
+ /**
185
+ * Euro
186
+ *
187
+ * @description Numeric code: 978
188
+ * @description Alphabetic code: EUR
189
+ * @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)
190
+ */
27
191
  TuiCurrencyCode["Euro"] = "978";
192
+ /**
193
+ * United States dollar
194
+ *
195
+ * @description Numeric code: 840
196
+ * @description Alphabetic code: USD
197
+ * @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)
198
+ */
28
199
  TuiCurrencyCode["Dollar"] = "840";
200
+ /**
201
+ * Pound sterling
202
+ *
203
+ * @description Numeric code: 826
204
+ * @description Alphabetic code: GBP
205
+ * @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)
206
+ */
29
207
  TuiCurrencyCode["Pound"] = "826";
208
+ /**
209
+ * Thai baht
210
+ *
211
+ * @description Numeric code: 764
212
+ * @description Alphabetic code: THB
213
+ * @description Countries and territories: Thailand
214
+ */
30
215
  TuiCurrencyCode["Baht"] = "764";
216
+ /**
217
+ * Turkish lira
218
+ *
219
+ * @description Numeric code: 949
220
+ * @description Alphabetic code: TRY
221
+ * @description Countries and territories: Turkey
222
+ */
31
223
  TuiCurrencyCode["TurkishLira"] = "949";
224
+ /**
225
+ * Chinese yuan
226
+ *
227
+ * @description Numeric code: 156
228
+ * @description Alphabetic code: CNY
229
+ * @description Countries and territories: China
230
+ */
32
231
  TuiCurrencyCode["YuanRenminbi"] = "156";
232
+ /**
233
+ * Kazakhstani tenge
234
+ *
235
+ * @description Numeric code: 398
236
+ * @description Alphabetic code: KZT
237
+ * @description Countries and territories: Kazakhstan
238
+ */
33
239
  TuiCurrencyCode["Tenge"] = "398";
240
+ /**
241
+ * Israeli new shekel
242
+ *
243
+ * @description Numeric code: 376
244
+ * @description Alphabetic code: ILS
245
+ * @description Countries and territories: Israel
246
+ */
34
247
  TuiCurrencyCode["IsraeliShekel"] = "376";
248
+ /**
249
+ * Indian rupee
250
+ *
251
+ * @description Numeric code: 356
252
+ * @description Alphabetic code: INR
253
+ * @description Countries and territories: India, Bhutan
254
+ */
35
255
  TuiCurrencyCode["IndianRupee"] = "356";
256
+ /**
257
+ * Japanese yen
258
+ *
259
+ * @description Numeric code: 392
260
+ * @description Alphabetic code: JPY
261
+ * @description Countries and territories: Japan
262
+ */
36
263
  TuiCurrencyCode["Yen"] = "392";
264
+ /**
265
+ * South Korean won
266
+ *
267
+ * @description Numeric code: 410
268
+ * @description Alphabetic code: KRW
269
+ * @description Countries and territories: South Korea
270
+ */
37
271
  TuiCurrencyCode["Won"] = "410";
272
+ /**
273
+ * Swiss franc
274
+ *
275
+ * @description Numeric code: 756
276
+ * @description Alphabetic code: CHF
277
+ * @description Countries and territories: Switzerland, Liechtenstein (LI)
278
+ */
38
279
  TuiCurrencyCode["SwissFranc"] = "756";
280
+ /**
281
+ * Singapore dollar
282
+ *
283
+ * @description Numeric code: 702
284
+ * @description Alphabetic code: SGD
285
+ * @description Countries and territories: Singapore
286
+ */
39
287
  TuiCurrencyCode["SingaporeDollar"] = "702";
288
+ /**
289
+ * Australian dollar
290
+ *
291
+ * @description Numeric code: 036
292
+ * @description Alphabetic code: AUD
293
+ * @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)
294
+ */
40
295
  TuiCurrencyCode["AustralianDollar"] = "036";
296
+ /**
297
+ * Hong Kong dollar
298
+ *
299
+ * @description Numeric code: 344
300
+ * @description Alphabetic code: HKD
301
+ * @description Countries and territories: Hong Kong
302
+ */
41
303
  TuiCurrencyCode["HongKong_dollar"] = "344";
304
+ /**
305
+ * Canadian dollar
306
+ *
307
+ * @description Numeric code: 124
308
+ * @description Alphabetic code: CAD
309
+ * @description Countries and territories: Canada
310
+ */
42
311
  TuiCurrencyCode["CanadianDollar"] = "124";
312
+ /**
313
+ * Armenian dram
314
+ *
315
+ * @description Numeric code: 051
316
+ * @description Alphabetic code: AMD
317
+ * @description Countries and territories: Armenia
318
+ */
43
319
  TuiCurrencyCode["ArmenianDram"] = "051";
320
+ /**
321
+ * Ukrainian hryvnia
322
+ *
323
+ * @description Numeric code: 980
324
+ * @description Alphabetic code: UAH
325
+ * @description Countries and territories: Ukraine
326
+ */
44
327
  TuiCurrencyCode["Hryvnia"] = "980";
328
+ TuiCurrencyCode["MexicanPeso"] = "484";
45
329
  })(TuiCurrencyCode || (TuiCurrencyCode = {}));
46
330
 
47
331
  /**
@@ -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 MexicanPeso = 'MXN',\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 MexicanPeso = '484',\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,qC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53
+ case "MXN" /* MexicanPeso */:
54
+ case "484" /* MexicanPeso */:
53
55
  return '$';
54
56
  case "SGD" /* SingaporeDollar */:
55
57
  case "702" /* SingaporeDollar */:
@@ -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,IAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C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AAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,IAAM,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;;;;;;"}
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 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.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,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,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACrE;;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;YACnD,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,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,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAC5B,CAAC;SACN;QAED,IAAM,mBAAmB,GAAa,EAAE,CAAC;QACzC,IAAM,iBAAiB,GAAG,cAA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,CAAC;KAChB,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,GAAA,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD;;SCtBgB,aAAa,CAAC,MAAc;IACxC,IAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,IAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,IAAM,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;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/addon-commerce",
3
- "version": "2.30.0",
3
+ "version": "2.34.0",
4
4
  "description": "Extension package for Taiga UI related to commerce, payment systems, currencies etc.",
5
5
  "keywords": [
6
6
  "angular",
@@ -17,12 +17,12 @@
17
17
  "@angular/common": ">=9.0.0",
18
18
  "@angular/core": ">=9.0.0",
19
19
  "@angular/forms": ">=9.0.0",
20
- "@ng-web-apis/common": "1.12.1",
21
- "@tinkoff/ng-polymorpheus": "3.1.12",
22
- "@taiga-ui/cdk": "2.30.0",
23
- "@taiga-ui/core": "2.30.0",
24
- "@taiga-ui/i18n": "2.30.0",
25
- "angular2-text-mask": "9.0.0",
20
+ "@ng-web-apis/common": ">=1.12.1 < 2",
21
+ "@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
22
+ "@taiga-ui/cdk": ">=2.34.0",
23
+ "@taiga-ui/core": ">=2.34.0",
24
+ "@taiga-ui/i18n": ">=2.34.0",
25
+ "angular2-text-mask": ">=9.0.0",
26
26
  "rxjs": ">=6.0.0"
27
27
  },
28
28
  "main": "bundles/taiga-ui-addon-commerce.umd.js",
@@ -1,2 +1,3 @@
1
1
  import { TuiCurrency, TuiCurrencyCode } from '@taiga-ui/addon-commerce/enums';
2
- export declare type TuiCurrencyVariants = TuiCurrency | TuiCurrencyCode | number | string | null;
2
+ export declare type TuiCurrencyAutocompletion = keyof Record<TuiCurrency, string> | keyof Record<TuiCurrencyCode, string>;
3
+ export declare type TuiCurrencyVariants = TuiCurrencyAutocompletion | (TuiCurrency | TuiCurrencyCode | number | string | null);
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"TuiCodeCVCLength":{"__symbolic":"interface"},"TuiCurrencyVariants":{"__symbolic":"interface"},"TuiMoneySignT":{"__symbolic":"interface"}},"origins":{"TuiCodeCVCLength":"./code-length","TuiCurrencyVariants":"./currency-variants","TuiMoneySignT":"./money-sign"},"importAs":"@taiga-ui/addon-commerce/types"}
1
+ {"__symbolic":"module","version":4,"metadata":{"TuiCodeCVCLength":{"__symbolic":"interface"},"TuiCurrencyAutocompletion":{"__symbolic":"interface"},"TuiCurrencyVariants":{"__symbolic":"interface"},"TuiMoneySignT":{"__symbolic":"interface"}},"origins":{"TuiCodeCVCLength":"./code-length","TuiCurrencyAutocompletion":"./currency-variants","TuiCurrencyVariants":"./currency-variants","TuiMoneySignT":"./money-sign"},"importAs":"@taiga-ui/addon-commerce/types"}