@taiga-ui/addon-commerce 2.54.0 → 3.0.0-rc.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 (361) hide show
  1. package/bundles/taiga-ui-addon-commerce-components-card.umd.js +424 -305
  2. package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
  3. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +623 -466
  4. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
  5. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +461 -331
  6. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +1 -1
  7. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +444 -314
  8. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +1 -1
  9. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +432 -306
  10. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +1 -1
  11. package/bundles/taiga-ui-addon-commerce-components-money.umd.js +518 -387
  12. package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
  13. package/bundles/taiga-ui-addon-commerce-components.umd.js +15 -27
  14. package/bundles/taiga-ui-addon-commerce-components.umd.js.map +1 -1
  15. package/bundles/taiga-ui-addon-commerce-constants.umd.js +38 -36
  16. package/bundles/taiga-ui-addon-commerce-constants.umd.js.map +1 -1
  17. package/bundles/taiga-ui-addon-commerce-enums.umd.js +6 -35
  18. package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
  19. package/bundles/taiga-ui-addon-commerce-interfaces.umd.js +2 -2
  20. package/bundles/taiga-ui-addon-commerce-interfaces.umd.js.map +1 -1
  21. package/bundles/taiga-ui-addon-commerce-pipes.umd.js +63 -274
  22. package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +1 -1
  23. package/bundles/taiga-ui-addon-commerce-tokens.umd.js +11 -7
  24. package/bundles/taiga-ui-addon-commerce-tokens.umd.js.map +1 -1
  25. package/bundles/taiga-ui-addon-commerce-types.umd.js +2 -2
  26. package/bundles/taiga-ui-addon-commerce-types.umd.js.map +1 -1
  27. package/bundles/taiga-ui-addon-commerce-utils.umd.js +63 -107
  28. package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
  29. package/bundles/taiga-ui-addon-commerce-validators.umd.js +17 -11
  30. package/bundles/taiga-ui-addon-commerce-validators.umd.js.map +1 -1
  31. package/bundles/taiga-ui-addon-commerce.umd.js +31 -33
  32. package/bundles/taiga-ui-addon-commerce.umd.js.map +1 -1
  33. package/components/card/card.component.d.ts +5 -2
  34. package/components/card/card.module.d.ts +7 -0
  35. package/components/card/package.json +2 -5
  36. package/components/card/taiga-ui-addon-commerce-components-card.d.ts +1 -0
  37. package/components/input-card/input-card.component.d.ts +4 -2
  38. package/components/input-card/input-card.module.d.ts +8 -0
  39. package/components/input-card/package.json +2 -5
  40. package/components/input-card/taiga-ui-addon-commerce-components-input-card.d.ts +1 -0
  41. package/components/input-card-grouped/input-card-grouped.component.d.ts +5 -3
  42. package/components/input-card-grouped/input-card-grouped.module.d.ts +12 -0
  43. package/components/input-card-grouped/package.json +2 -5
  44. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.d.ts +1 -0
  45. package/components/input-cvc/input-cvc.component.d.ts +3 -1
  46. package/components/input-cvc/input-cvc.module.d.ts +8 -0
  47. package/components/input-cvc/package.json +2 -5
  48. package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.d.ts +1 -0
  49. package/components/input-expire/input-expire.component.d.ts +3 -1
  50. package/components/input-expire/input-expire.module.d.ts +8 -0
  51. package/components/input-expire/package.json +2 -5
  52. package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.d.ts +1 -0
  53. package/components/money/money-options.d.ts +4 -4
  54. package/components/money/money.component.d.ts +7 -4
  55. package/components/money/money.module.d.ts +10 -0
  56. package/components/money/package.json +2 -5
  57. package/components/money/pipes/fraction-part.pipe.d.ts +5 -2
  58. package/components/money/pipes/integer-part.pipe.d.ts +3 -0
  59. package/components/money/pipes/sign-symbol.pipe.d.ts +5 -2
  60. package/components/money/taiga-ui-addon-commerce-components-money.d.ts +1 -0
  61. package/components/money/utils/format-fraction-part.d.ts +2 -2
  62. package/components/money/utils/format-sign-symbol.d.ts +2 -2
  63. package/components/package.json +2 -5
  64. package/components/taiga-ui-addon-commerce-components.d.ts +1 -0
  65. package/constants/package.json +2 -5
  66. package/constants/taiga-ui-addon-commerce-constants.d.ts +1 -0
  67. package/enums/currency-code.d.ts +0 -5
  68. package/enums/index.d.ts +0 -2
  69. package/enums/package.json +2 -5
  70. package/enums/taiga-ui-addon-commerce-enums.d.ts +1 -0
  71. package/esm2015/components/card/card.component.js +44 -30
  72. package/esm2015/components/card/card.module.js +15 -12
  73. package/esm2015/components/card/index.js +1 -1
  74. package/esm2015/components/card/taiga-ui-addon-commerce-components-card.js +1 -1
  75. package/esm2015/components/index.js +1 -1
  76. package/esm2015/components/input-card/index.js +1 -1
  77. package/esm2015/components/input-card/input-card.component.js +72 -56
  78. package/esm2015/components/input-card/input-card.module.js +24 -13
  79. package/esm2015/components/input-card/taiga-ui-addon-commerce-components-input-card.js +1 -1
  80. package/esm2015/components/input-card-grouped/index.js +1 -1
  81. package/esm2015/components/input-card-grouped/input-card-grouped.component.js +148 -121
  82. package/esm2015/components/input-card-grouped/input-card-grouped.module.js +45 -15
  83. package/esm2015/components/input-card-grouped/input-card-grouped.providers.js +3 -3
  84. package/esm2015/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +1 -1
  85. package/esm2015/components/input-cvc/index.js +1 -1
  86. package/esm2015/components/input-cvc/input-cvc.component.js +56 -43
  87. package/esm2015/components/input-cvc/input-cvc.module.js +26 -13
  88. package/esm2015/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +1 -1
  89. package/esm2015/components/input-expire/index.js +1 -1
  90. package/esm2015/components/input-expire/input-expire.component.js +49 -38
  91. package/esm2015/components/input-expire/input-expire.module.js +24 -13
  92. package/esm2015/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +1 -1
  93. package/esm2015/components/money/index.js +1 -1
  94. package/esm2015/components/money/money-options.js +4 -4
  95. package/esm2015/components/money/money.component.js +50 -37
  96. package/esm2015/components/money/money.module.js +23 -17
  97. package/esm2015/components/money/pipes/fraction-part.pipe.js +13 -12
  98. package/esm2015/components/money/pipes/integer-part.pipe.js +13 -12
  99. package/esm2015/components/money/pipes/sign-symbol.pipe.js +10 -8
  100. package/esm2015/components/money/taiga-ui-addon-commerce-components-money.js +1 -1
  101. package/esm2015/components/money/utils/format-fraction-part.js +4 -4
  102. package/esm2015/components/money/utils/format-sign-symbol.js +6 -7
  103. package/esm2015/components/taiga-ui-addon-commerce-components.js +1 -1
  104. package/esm2015/constants/card-holder-mask.js +27 -27
  105. package/esm2015/constants/card-mask.js +5 -5
  106. package/esm2015/constants/default-card-validator.js +3 -3
  107. package/esm2015/constants/index.js +1 -1
  108. package/esm2015/constants/taiga-ui-addon-commerce-constants.js +1 -1
  109. package/esm2015/enums/currency-code.js +1 -7
  110. package/esm2015/enums/currency.js +1 -1
  111. package/esm2015/enums/index.js +1 -3
  112. package/esm2015/enums/taiga-ui-addon-commerce-enums.js +1 -1
  113. package/esm2015/index.js +3 -1
  114. package/esm2015/interfaces/card.js +2 -1
  115. package/esm2015/interfaces/index.js +2 -1
  116. package/esm2015/interfaces/taiga-ui-addon-commerce-interfaces.js +2 -1
  117. package/esm2015/pipes/currency/currency.module.js +14 -11
  118. package/esm2015/pipes/currency/currency.pipe.js +12 -10
  119. package/esm2015/pipes/format-card/format-card.module.js +14 -11
  120. package/esm2015/pipes/format-card/format-card.pipe.js +14 -12
  121. package/esm2015/pipes/index.js +1 -1
  122. package/esm2015/pipes/taiga-ui-addon-commerce-pipes.js +1 -1
  123. package/esm2015/taiga-ui-addon-commerce.js +1 -1
  124. package/esm2015/tokens/i18n.js +6 -6
  125. package/esm2015/tokens/index.js +1 -1
  126. package/esm2015/tokens/taiga-ui-addon-commerce-tokens.js +1 -1
  127. package/esm2015/types/code-length.js +2 -1
  128. package/esm2015/types/currency-variants.js +2 -1
  129. package/esm2015/types/index.js +5 -1
  130. package/esm2015/types/money-sign.js +2 -1
  131. package/esm2015/types/payment-system.js +2 -0
  132. package/esm2015/types/taiga-ui-addon-commerce-types.js +2 -1
  133. package/esm2015/utils/create-auto-corrected-expire-pipe.js +6 -6
  134. package/esm2015/utils/format-currency.js +7 -7
  135. package/esm2015/utils/get-currency-symbol.js +21 -26
  136. package/esm2015/utils/get-payment-system.js +18 -48
  137. package/esm2015/utils/index.js +1 -1
  138. package/esm2015/utils/is-card-length-valid.js +9 -11
  139. package/esm2015/utils/is-card-number-valid.js +4 -6
  140. package/esm2015/utils/is-expire-valid.js +1 -1
  141. package/esm2015/utils/taiga-ui-addon-commerce-utils.js +1 -1
  142. package/esm2015/validators/card-expire.validator.js +2 -2
  143. package/esm2015/validators/card-number.validator.js +4 -4
  144. package/esm2015/validators/index.js +1 -1
  145. package/esm2015/validators/luhn.validator.js +5 -3
  146. package/esm2015/validators/taiga-ui-addon-commerce-validators.js +1 -1
  147. package/fesm2015/taiga-ui-addon-commerce-components-card.js +58 -39
  148. package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
  149. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +196 -136
  150. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  151. package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +96 -67
  152. package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
  153. package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +81 -53
  154. package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
  155. package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +72 -48
  156. package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
  157. package/fesm2015/taiga-ui-addon-commerce-components-money.js +136 -112
  158. package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
  159. package/fesm2015/taiga-ui-addon-commerce-components.js.map +1 -1
  160. package/fesm2015/taiga-ui-addon-commerce-constants.js +32 -32
  161. package/fesm2015/taiga-ui-addon-commerce-constants.js.map +1 -1
  162. package/fesm2015/taiga-ui-addon-commerce-enums.js +1 -34
  163. package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
  164. package/fesm2015/taiga-ui-addon-commerce-interfaces.js.map +1 -1
  165. package/fesm2015/taiga-ui-addon-commerce-pipes.js +47 -33
  166. package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +1 -1
  167. package/fesm2015/taiga-ui-addon-commerce-tokens.js +5 -5
  168. package/fesm2015/taiga-ui-addon-commerce-tokens.js.map +1 -1
  169. package/fesm2015/taiga-ui-addon-commerce-types.js.map +1 -1
  170. package/fesm2015/taiga-ui-addon-commerce-utils.js +58 -97
  171. package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
  172. package/fesm2015/taiga-ui-addon-commerce-validators.js +7 -5
  173. package/fesm2015/taiga-ui-addon-commerce-validators.js.map +1 -1
  174. package/fesm2015/taiga-ui-addon-commerce.js +2 -0
  175. package/fesm2015/taiga-ui-addon-commerce.js.map +1 -1
  176. package/interfaces/package.json +2 -5
  177. package/interfaces/taiga-ui-addon-commerce-interfaces.d.ts +1 -0
  178. package/package.json +12 -15
  179. package/pipes/currency/currency.module.d.ts +5 -0
  180. package/pipes/currency/currency.pipe.d.ts +3 -0
  181. package/pipes/format-card/format-card.module.d.ts +5 -0
  182. package/pipes/format-card/format-card.pipe.d.ts +3 -0
  183. package/pipes/package.json +2 -5
  184. package/pipes/taiga-ui-addon-commerce-pipes.d.ts +1 -0
  185. package/taiga-ui-addon-commerce.d.ts +1 -0
  186. package/tokens/package.json +2 -5
  187. package/tokens/taiga-ui-addon-commerce-tokens.d.ts +1 -0
  188. package/types/index.d.ts +1 -0
  189. package/types/money-sign.d.ts +3 -3
  190. package/types/package.json +2 -5
  191. package/types/payment-system.d.ts +1 -0
  192. package/types/taiga-ui-addon-commerce-types.d.ts +1 -0
  193. package/utils/get-currency-symbol.d.ts +1 -5
  194. package/utils/get-payment-system.d.ts +7 -31
  195. package/utils/is-card-length-valid.d.ts +1 -3
  196. package/utils/is-card-number-valid.d.ts +1 -3
  197. package/utils/package.json +2 -5
  198. package/utils/taiga-ui-addon-commerce-utils.d.ts +1 -0
  199. package/validators/package.json +2 -5
  200. package/validators/taiga-ui-addon-commerce-validators.d.ts +1 -0
  201. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +0 -2
  202. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +0 -1
  203. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +0 -2
  204. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +0 -1
  205. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js +0 -2
  206. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js.map +0 -1
  207. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js +0 -2
  208. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js.map +0 -1
  209. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js +0 -2
  210. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +0 -1
  211. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +0 -2
  212. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +0 -1
  213. package/bundles/taiga-ui-addon-commerce-components.umd.min.js +0 -2
  214. package/bundles/taiga-ui-addon-commerce-components.umd.min.js.map +0 -1
  215. package/bundles/taiga-ui-addon-commerce-constants.umd.min.js +0 -2
  216. package/bundles/taiga-ui-addon-commerce-constants.umd.min.js.map +0 -1
  217. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +0 -2
  218. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +0 -1
  219. package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js +0 -2
  220. package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js.map +0 -1
  221. package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js +0 -2
  222. package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js.map +0 -1
  223. package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js +0 -2
  224. package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js.map +0 -1
  225. package/bundles/taiga-ui-addon-commerce-types.umd.min.js +0 -2
  226. package/bundles/taiga-ui-addon-commerce-types.umd.min.js.map +0 -1
  227. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +0 -2
  228. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +0 -1
  229. package/bundles/taiga-ui-addon-commerce-validators.umd.min.js +0 -2
  230. package/bundles/taiga-ui-addon-commerce-validators.umd.min.js.map +0 -1
  231. package/bundles/taiga-ui-addon-commerce.umd.min.js +0 -2
  232. package/bundles/taiga-ui-addon-commerce.umd.min.js.map +0 -1
  233. package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +0 -1
  234. package/components/input-card/taiga-ui-addon-commerce-components-input-card.metadata.json +0 -1
  235. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +0 -1
  236. package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.metadata.json +0 -1
  237. package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.metadata.json +0 -1
  238. package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +0 -1
  239. package/components/taiga-ui-addon-commerce-components.metadata.json +0 -1
  240. package/constants/taiga-ui-addon-commerce-constants.metadata.json +0 -1
  241. package/enums/money-sign.d.ts +0 -16
  242. package/enums/payment-system.d.ts +0 -8
  243. package/enums/taiga-ui-addon-commerce-enums.metadata.json +0 -1
  244. package/esm2015/enums/money-sign.js +0 -18
  245. package/esm2015/enums/payment-system.js +0 -9
  246. package/esm5/components/card/card.component.js +0 -73
  247. package/esm5/components/card/card.module.js +0 -19
  248. package/esm5/components/card/index.js +0 -3
  249. package/esm5/components/card/taiga-ui-addon-commerce-components-card.js +0 -5
  250. package/esm5/components/index.js +0 -7
  251. package/esm5/components/input-card/index.js +0 -3
  252. package/esm5/components/input-card/input-card.component.js +0 -167
  253. package/esm5/components/input-card/input-card.module.js +0 -25
  254. package/esm5/components/input-card/taiga-ui-addon-commerce-components-input-card.js +0 -5
  255. package/esm5/components/input-card-grouped/index.js +0 -4
  256. package/esm5/components/input-card-grouped/input-card-grouped.component.js +0 -511
  257. package/esm5/components/input-card-grouped/input-card-grouped.module.js +0 -40
  258. package/esm5/components/input-card-grouped/input-card-grouped.providers.js +0 -34
  259. package/esm5/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -5
  260. package/esm5/components/input-cvc/index.js +0 -3
  261. package/esm5/components/input-cvc/input-cvc.component.js +0 -113
  262. package/esm5/components/input-cvc/input-cvc.module.js +0 -26
  263. package/esm5/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +0 -5
  264. package/esm5/components/input-expire/index.js +0 -3
  265. package/esm5/components/input-expire/input-expire.component.js +0 -108
  266. package/esm5/components/input-expire/input-expire.module.js +0 -25
  267. package/esm5/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +0 -5
  268. package/esm5/components/money/index.js +0 -9
  269. package/esm5/components/money/money-options.js +0 -18
  270. package/esm5/components/money/money.component.js +0 -101
  271. package/esm5/components/money/money.module.js +0 -27
  272. package/esm5/components/money/pipes/fraction-part.pipe.js +0 -27
  273. package/esm5/components/money/pipes/integer-part.pipe.js +0 -21
  274. package/esm5/components/money/pipes/sign-symbol.pipe.js +0 -16
  275. package/esm5/components/money/taiga-ui-addon-commerce-components-money.js +0 -5
  276. package/esm5/components/money/utils/format-fraction-part.js +0 -7
  277. package/esm5/components/money/utils/format-sign-symbol.js +0 -12
  278. package/esm5/components/taiga-ui-addon-commerce-components.js +0 -5
  279. package/esm5/constants/card-holder-mask.js +0 -37
  280. package/esm5/constants/card-mask.js +0 -30
  281. package/esm5/constants/default-card-validator.js +0 -5
  282. package/esm5/constants/index.js +0 -4
  283. package/esm5/constants/taiga-ui-addon-commerce-constants.js +0 -5
  284. package/esm5/enums/currency-code.js +0 -171
  285. package/esm5/enums/currency.js +0 -171
  286. package/esm5/enums/index.js +0 -5
  287. package/esm5/enums/money-sign.js +0 -18
  288. package/esm5/enums/payment-system.js +0 -9
  289. package/esm5/enums/taiga-ui-addon-commerce-enums.js +0 -5
  290. package/esm5/index.js +0 -8
  291. package/esm5/interfaces/card.js +0 -1
  292. package/esm5/interfaces/index.js +0 -1
  293. package/esm5/interfaces/taiga-ui-addon-commerce-interfaces.js +0 -4
  294. package/esm5/pipes/currency/currency.module.js +0 -16
  295. package/esm5/pipes/currency/currency.pipe.js +0 -18
  296. package/esm5/pipes/format-card/format-card.module.js +0 -16
  297. package/esm5/pipes/format-card/format-card.pipe.js +0 -22
  298. package/esm5/pipes/index.js +0 -5
  299. package/esm5/pipes/taiga-ui-addon-commerce-pipes.js +0 -5
  300. package/esm5/taiga-ui-addon-commerce.js +0 -5
  301. package/esm5/tokens/i18n.js +0 -13
  302. package/esm5/tokens/index.js +0 -2
  303. package/esm5/tokens/taiga-ui-addon-commerce-tokens.js +0 -5
  304. package/esm5/types/code-length.js +0 -1
  305. package/esm5/types/currency-variants.js +0 -1
  306. package/esm5/types/index.js +0 -1
  307. package/esm5/types/money-sign.js +0 -1
  308. package/esm5/types/taiga-ui-addon-commerce-types.js +0 -4
  309. package/esm5/utils/create-auto-corrected-expire-pipe.js +0 -43
  310. package/esm5/utils/format-currency.js +0 -17
  311. package/esm5/utils/get-currency-symbol.js +0 -71
  312. package/esm5/utils/get-payment-system.js +0 -103
  313. package/esm5/utils/index.js +0 -8
  314. package/esm5/utils/is-card-length-valid.js +0 -25
  315. package/esm5/utils/is-card-number-valid.js +0 -21
  316. package/esm5/utils/is-expire-valid.js +0 -14
  317. package/esm5/utils/taiga-ui-addon-commerce-utils.js +0 -5
  318. package/esm5/validators/card-expire.validator.js +0 -10
  319. package/esm5/validators/card-number.validator.js +0 -9
  320. package/esm5/validators/index.js +0 -4
  321. package/esm5/validators/luhn.validator.js +0 -9
  322. package/esm5/validators/taiga-ui-addon-commerce-validators.js +0 -5
  323. package/fesm5/taiga-ui-addon-commerce-components-card.js +0 -94
  324. package/fesm5/taiga-ui-addon-commerce-components-card.js.map +0 -1
  325. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -579
  326. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +0 -1
  327. package/fesm5/taiga-ui-addon-commerce-components-input-card.js +0 -193
  328. package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +0 -1
  329. package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js +0 -140
  330. package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js.map +0 -1
  331. package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +0 -134
  332. package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +0 -1
  333. package/fesm5/taiga-ui-addon-commerce-components-money.js +0 -211
  334. package/fesm5/taiga-ui-addon-commerce-components-money.js.map +0 -1
  335. package/fesm5/taiga-ui-addon-commerce-components.js +0 -11
  336. package/fesm5/taiga-ui-addon-commerce-components.js.map +0 -1
  337. package/fesm5/taiga-ui-addon-commerce-constants.js +0 -78
  338. package/fesm5/taiga-ui-addon-commerce-constants.js.map +0 -1
  339. package/fesm5/taiga-ui-addon-commerce-enums.js +0 -375
  340. package/fesm5/taiga-ui-addon-commerce-enums.js.map +0 -1
  341. package/fesm5/taiga-ui-addon-commerce-interfaces.js +0 -4
  342. package/fesm5/taiga-ui-addon-commerce-interfaces.js.map +0 -1
  343. package/fesm5/taiga-ui-addon-commerce-pipes.js +0 -67
  344. package/fesm5/taiga-ui-addon-commerce-pipes.js.map +0 -1
  345. package/fesm5/taiga-ui-addon-commerce-tokens.js +0 -20
  346. package/fesm5/taiga-ui-addon-commerce-tokens.js.map +0 -1
  347. package/fesm5/taiga-ui-addon-commerce-types.js +0 -4
  348. package/fesm5/taiga-ui-addon-commerce-types.js.map +0 -1
  349. package/fesm5/taiga-ui-addon-commerce-utils.js +0 -298
  350. package/fesm5/taiga-ui-addon-commerce-utils.js.map +0 -1
  351. package/fesm5/taiga-ui-addon-commerce-validators.js +0 -31
  352. package/fesm5/taiga-ui-addon-commerce-validators.js.map +0 -1
  353. package/fesm5/taiga-ui-addon-commerce.js +0 -12
  354. package/fesm5/taiga-ui-addon-commerce.js.map +0 -1
  355. package/interfaces/taiga-ui-addon-commerce-interfaces.metadata.json +0 -1
  356. package/pipes/taiga-ui-addon-commerce-pipes.metadata.json +0 -1
  357. package/taiga-ui-addon-commerce.metadata.json +0 -1
  358. package/tokens/taiga-ui-addon-commerce-tokens.metadata.json +0 -1
  359. package/types/taiga-ui-addon-commerce-types.metadata.json +0 -1
  360. package/utils/taiga-ui-addon-commerce-utils.metadata.json +0 -1
  361. package/validators/taiga-ui-addon-commerce-validators.metadata.json +0 -1
@@ -1,19 +1,21 @@
1
- import { __decorate, __param } from 'tslib';
2
- import { InjectionToken, Inject, Input, HostBinding, Component, ChangeDetectionStrategy, Pipe, NgModule } from '@angular/core';
3
- import { CHAR_EN_DASH, CHAR_PLUS, tuiDefaultProp } from '@taiga-ui/cdk';
4
- import { CommonModule } from '@angular/common';
1
+ import { __decorate } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, Pipe, Inject, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
4
+ import { CHAR_MINUS, CHAR_PLUS, tuiDefaultProp } from '@taiga-ui/cdk';
5
+ import { formatNumber, TUI_NUMBER_FORMAT } from '@taiga-ui/core';
6
+ import * as i4 from '@taiga-ui/addon-commerce/pipes';
5
7
  import { TuiCurrencyPipeModule } from '@taiga-ui/addon-commerce/pipes';
6
- import { TUI_NUMBER_FORMAT, formatNumber } from '@taiga-ui/core';
8
+ import { CommonModule } from '@angular/common';
7
9
 
8
10
  const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS = {
9
- decimal: 'not-zero',
11
+ decimal: `not-zero`,
10
12
  currency: "RUB" /* Ruble */,
11
- sign: 'negative-only',
13
+ sign: `negative-only`,
12
14
  colored: false,
13
15
  precision: 2,
14
16
  singleColor: false,
15
17
  };
16
- const TUI_MONEY_OPTIONS = new InjectionToken('Default parameters for money component', {
18
+ const TUI_MONEY_OPTIONS = new InjectionToken(`Default parameters for money component`, {
17
19
  factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,
18
20
  });
19
21
  const tuiMoneyOptionsProvider = (options) => ({
@@ -22,17 +24,76 @@ const tuiMoneyOptionsProvider = (options) => ({
22
24
  });
23
25
 
24
26
  function tuiFormatSignSymbol(value, sign) {
25
- if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {
26
- return '';
27
+ if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {
28
+ return ``;
27
29
  }
28
- if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {
29
- /** TODO(nsbarsukov): investigate if it should be replaced by {@link CHAR_HYPHEN} */
30
- return CHAR_EN_DASH;
30
+ if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {
31
+ return CHAR_MINUS;
31
32
  }
32
33
  return CHAR_PLUS;
33
34
  }
34
35
 
35
- let TuiMoneyComponent = class TuiMoneyComponent {
36
+ class TuiSignSymbolPipe {
37
+ transform(value, sign) {
38
+ return tuiFormatSignSymbol(value, sign);
39
+ }
40
+ }
41
+ TuiSignSymbolPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
42
+ TuiSignSymbolPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, name: "tuiSignSymbol" });
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, decorators: [{
44
+ type: Pipe,
45
+ args: [{ name: `tuiSignSymbol` }]
46
+ }] });
47
+
48
+ class TuiIntegerPartPipe {
49
+ constructor(numberFormat) {
50
+ this.numberFormat = numberFormat;
51
+ }
52
+ transform(value, precision) {
53
+ return formatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
54
+ }
55
+ }
56
+ TuiIntegerPartPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, deps: [{ token: TUI_NUMBER_FORMAT }], target: i0.ɵɵFactoryTarget.Pipe });
57
+ TuiIntegerPartPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, name: "tuiIntegerPart" });
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, decorators: [{
59
+ type: Pipe,
60
+ args: [{ name: `tuiIntegerPart` }]
61
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
62
+ type: Inject,
63
+ args: [TUI_NUMBER_FORMAT]
64
+ }] }]; } });
65
+
66
+ function tuiFormatFractionPart(options) {
67
+ const { value, decimal, numberFormat, precision } = options;
68
+ const fraction = value.toFixed(precision).split(`.`)[1];
69
+ const shouldShow = decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));
70
+ return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;
71
+ }
72
+
73
+ class TuiFractionPartPipe {
74
+ constructor(numberFormat) {
75
+ this.numberFormat = numberFormat;
76
+ }
77
+ transform(value, decimal, precision) {
78
+ return tuiFormatFractionPart({
79
+ value,
80
+ decimal,
81
+ precision,
82
+ numberFormat: this.numberFormat,
83
+ });
84
+ }
85
+ }
86
+ TuiFractionPartPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, deps: [{ token: TUI_NUMBER_FORMAT }], target: i0.ɵɵFactoryTarget.Pipe });
87
+ TuiFractionPartPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, name: "tuiFractionPart" });
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, decorators: [{
89
+ type: Pipe,
90
+ args: [{ name: `tuiFractionPart` }]
91
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
92
+ type: Inject,
93
+ args: [TUI_NUMBER_FORMAT]
94
+ }] }]; } });
95
+
96
+ class TuiMoneyComponent {
36
97
  constructor(options) {
37
98
  this.options = options;
38
99
  this.value = NaN;
@@ -48,135 +109,98 @@ let TuiMoneyComponent = class TuiMoneyComponent {
48
109
  }
49
110
  get red() {
50
111
  return (this.colored &&
51
- (this.signSymbol === CHAR_EN_DASH ||
52
- (this.value < 0 && this.sign !== 'force-positive')));
112
+ (this.signSymbol === CHAR_MINUS ||
113
+ (this.value < 0 && this.sign !== `force-positive`)));
53
114
  }
54
115
  get green() {
55
116
  return (this.colored &&
56
117
  (this.signSymbol === CHAR_PLUS ||
57
- (this.value > 0 && this.sign !== 'force-negative')));
118
+ (this.value > 0 && this.sign !== `force-negative`)));
58
119
  }
59
120
  get inheritColor() {
60
121
  return this.singleColor || (this.value === 0 && this.colored);
61
122
  }
62
- };
63
- TuiMoneyComponent.ctorParameters = () => [
64
- { type: undefined, decorators: [{ type: Inject, args: [TUI_MONEY_OPTIONS,] }] }
65
- ];
123
+ }
124
+ TuiMoneyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyComponent, deps: [{ token: TUI_MONEY_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
125
+ TuiMoneyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiMoneyComponent, selector: "tui-money", inputs: { value: "value", decimal: "decimal", currency: "currency", sign: "sign", colored: "colored", precision: "precision", singleColor: "singleColor" }, host: { properties: { "class._red": "this.red", "class._green": "this.green", "class._inherit-color": "this.inheritColor" } }, ngImport: i0, template: "<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n", styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}.t-currency:not(:empty){padding-left:.2rem}\n"], pipes: { "tuiSignSymbol": TuiSignSymbolPipe, "tuiIntegerPart": TuiIntegerPartPipe, "tuiFractionPart": TuiFractionPartPipe, "tuiCurrency": i4.TuiCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
66
126
  __decorate([
67
- Input(),
68
127
  tuiDefaultProp()
69
128
  ], TuiMoneyComponent.prototype, "value", void 0);
70
129
  __decorate([
71
- Input(),
72
130
  tuiDefaultProp()
73
131
  ], TuiMoneyComponent.prototype, "decimal", void 0);
74
132
  __decorate([
75
- Input(),
76
133
  tuiDefaultProp()
77
134
  ], TuiMoneyComponent.prototype, "currency", void 0);
78
135
  __decorate([
79
- Input(),
80
136
  tuiDefaultProp()
81
137
  ], TuiMoneyComponent.prototype, "sign", void 0);
82
138
  __decorate([
83
- Input(),
84
139
  tuiDefaultProp()
85
140
  ], TuiMoneyComponent.prototype, "colored", void 0);
86
141
  __decorate([
87
- Input(),
88
142
  tuiDefaultProp()
89
143
  ], TuiMoneyComponent.prototype, "precision", void 0);
90
144
  __decorate([
91
- Input(),
92
145
  tuiDefaultProp()
93
146
  ], TuiMoneyComponent.prototype, "singleColor", void 0);
94
- __decorate([
95
- HostBinding('class._red')
96
- ], TuiMoneyComponent.prototype, "red", null);
97
- __decorate([
98
- HostBinding('class._green')
99
- ], TuiMoneyComponent.prototype, "green", null);
100
- __decorate([
101
- HostBinding('class._inherit-color')
102
- ], TuiMoneyComponent.prototype, "inheritColor", null);
103
- TuiMoneyComponent = __decorate([
104
- Component({
105
- selector: 'tui-money',
106
- template: "<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n",
107
- changeDetection: ChangeDetectionStrategy.OnPush,
108
- styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}.t-currency:not(:empty){padding-left:.2rem}"]
109
- }),
110
- __param(0, Inject(TUI_MONEY_OPTIONS))
111
- ], TuiMoneyComponent);
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyComponent, decorators: [{
148
+ type: Component,
149
+ args: [{
150
+ selector: `tui-money`,
151
+ templateUrl: `./money.template.html`,
152
+ styleUrls: [`./money.style.less`],
153
+ changeDetection: ChangeDetectionStrategy.OnPush,
154
+ }]
155
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
156
+ type: Inject,
157
+ args: [TUI_MONEY_OPTIONS]
158
+ }] }]; }, propDecorators: { value: [{
159
+ type: Input
160
+ }], decimal: [{
161
+ type: Input
162
+ }], currency: [{
163
+ type: Input
164
+ }], sign: [{
165
+ type: Input
166
+ }], colored: [{
167
+ type: Input
168
+ }], precision: [{
169
+ type: Input
170
+ }], singleColor: [{
171
+ type: Input
172
+ }], red: [{
173
+ type: HostBinding,
174
+ args: [`class._red`]
175
+ }], green: [{
176
+ type: HostBinding,
177
+ args: [`class._green`]
178
+ }], inheritColor: [{
179
+ type: HostBinding,
180
+ args: [`class._inherit-color`]
181
+ }] } });
112
182
 
113
- function tuiFormatFractionPart(options) {
114
- const { value, decimal, numberFormat, precision } = options;
115
- const fraction = value.toFixed(precision).split('.')[1];
116
- const shouldShow = decimal !== 'never' && (decimal === 'always' || !!parseInt(fraction, 10));
117
- return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : '';
183
+ class TuiMoneyModule {
118
184
  }
119
-
120
- let TuiFractionPartPipe = class TuiFractionPartPipe {
121
- constructor(numberFormat) {
122
- this.numberFormat = numberFormat;
123
- }
124
- transform(value, decimal, precision) {
125
- return tuiFormatFractionPart({
126
- value,
127
- decimal,
128
- precision,
129
- numberFormat: this.numberFormat,
130
- });
131
- }
132
- };
133
- TuiFractionPartPipe.ctorParameters = () => [
134
- { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
135
- ];
136
- TuiFractionPartPipe = __decorate([
137
- Pipe({ name: 'tuiFractionPart' }),
138
- __param(0, Inject(TUI_NUMBER_FORMAT))
139
- ], TuiFractionPartPipe);
140
-
141
- let TuiIntegerPartPipe = class TuiIntegerPartPipe {
142
- constructor(numberFormat) {
143
- this.numberFormat = numberFormat;
144
- }
145
- transform(value, precision) {
146
- return formatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
147
- }
148
- };
149
- TuiIntegerPartPipe.ctorParameters = () => [
150
- { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
151
- ];
152
- TuiIntegerPartPipe = __decorate([
153
- Pipe({ name: 'tuiIntegerPart' }),
154
- __param(0, Inject(TUI_NUMBER_FORMAT))
155
- ], TuiIntegerPartPipe);
156
-
157
- let TuiSignSymbolPipe = class TuiSignSymbolPipe {
158
- transform(value, sign) {
159
- return tuiFormatSignSymbol(value, sign);
160
- }
161
- };
162
- TuiSignSymbolPipe = __decorate([
163
- Pipe({ name: 'tuiSignSymbol' })
164
- ], TuiSignSymbolPipe);
165
-
166
- let TuiMoneyModule = class TuiMoneyModule {
167
- };
168
- TuiMoneyModule = __decorate([
169
- NgModule({
170
- imports: [CommonModule, TuiCurrencyPipeModule],
171
- declarations: [
172
- TuiMoneyComponent,
173
- TuiFractionPartPipe,
174
- TuiIntegerPartPipe,
175
- TuiSignSymbolPipe,
176
- ],
177
- exports: [TuiMoneyComponent],
178
- })
179
- ], TuiMoneyModule);
185
+ TuiMoneyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
186
+ TuiMoneyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, declarations: [TuiMoneyComponent,
187
+ TuiFractionPartPipe,
188
+ TuiIntegerPartPipe,
189
+ TuiSignSymbolPipe], imports: [CommonModule, TuiCurrencyPipeModule], exports: [TuiMoneyComponent] });
190
+ TuiMoneyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, imports: [[CommonModule, TuiCurrencyPipeModule]] });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, decorators: [{
192
+ type: NgModule,
193
+ args: [{
194
+ imports: [CommonModule, TuiCurrencyPipeModule],
195
+ declarations: [
196
+ TuiMoneyComponent,
197
+ TuiFractionPartPipe,
198
+ TuiIntegerPartPipe,
199
+ TuiSignSymbolPipe,
200
+ ],
201
+ exports: [TuiMoneyComponent],
202
+ }]
203
+ }] });
180
204
 
181
205
  /**
182
206
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money-options.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-sign-symbol.ts","ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-fraction-part.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/fraction-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/integer-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimalT;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySignT;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: 'not-zero',\n currency: TuiCurrency.Ruble,\n sign: 'negative-only',\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n 'Default parameters for money component',\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySignT,\n): TuiMoneySignSymbol {\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n /** TODO(nsbarsukov): investigate if it should be replaced by {@link CHAR_HYPHEN} */\n return CHAR_EN_DASH;\n }\n\n return CHAR_PLUS;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySignSymbol,\n TuiMoneySignT,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: 'tui-money',\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_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 === CHAR_PLUS ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","import {TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimalT;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split('.')[1];\n const shouldShow =\n decimal !== 'never' && (decimal === 'always' || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : '';\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: 'tuiFractionPart'})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimalT, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: 'tuiIntegerPart'})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: 'tuiSignSymbol'})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySignT): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,iCAAiC,GAAoB;IAC9D,OAAO,EAAE,UAAU;IACnB,QAAQ;IACR,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,KAAK;EACpB;MAEW,iBAAiB,GAAG,I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C,CAAC;IAGtB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GAFrB,kBAAkB,CAa9B;;ICXY,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,SAAS,CAAC,KAAa,EAAE,IAAmB;QACxC,OAAO,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC3C;EACJ;AAJY,iBAAiB;IAD7B,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;GACjB,iBAAiB,CAI7B;;ICSY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAV1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;QAC9C,YAAY,EAAE;YACV,iBAAiB;YACjB,mBAAmB;YACnB,kBAAkB;YAClB,iBAAiB;SACpB;QACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACnB9B;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["../../../projects/addon-commerce/components/money/money-options.ts","../../../projects/addon-commerce/components/money/utils/format-sign-symbol.ts","../../../projects/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","../../../projects/addon-commerce/components/money/pipes/integer-part.pipe.ts","../../../projects/addon-commerce/components/money/utils/format-fraction-part.ts","../../../projects/addon-commerce/components/money/pipes/fraction-part.pipe.ts","../../../projects/addon-commerce/components/money/money.component.ts","../../../projects/addon-commerce/components/money/money.template.html","../../../projects/addon-commerce/components/money/money.module.ts","../../../projects/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySign} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimal} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimal;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySign;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: `not-zero`,\n currency: TuiCurrency.Ruble,\n sign: `negative-only`,\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n `Default parameters for money component`,\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySign, TuiMoneySignSymbol} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySign,\n): TuiMoneySignSymbol {\n if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {\n return ``;\n }\n\n if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {\n return CHAR_MINUS;\n }\n\n return CHAR_PLUS;\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySign, TuiMoneySignSymbol} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: `tuiSignSymbol`})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySign): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: `tuiIntegerPart`})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {TuiDecimal, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimal;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split(`.`)[1];\n const shouldShow =\n decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimal, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: `tuiFractionPart`})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimal, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySign,\n TuiMoneySignSymbol,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimal} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: `tui-money`,\n templateUrl: `./money.template.html`,\n styleUrls: [`./money.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimal = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySign = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding(`class._red`)\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_MINUS ||\n (this.value < 0 && this.sign !== `force-positive`))\n );\n }\n\n @HostBinding(`class._green`)\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== `force-negative`))\n );\n }\n\n @HostBinding(`class._inherit-color`)\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TuiSignSymbolPipe","i2.TuiIntegerPartPipe","i3.TuiFractionPartPipe"],"mappings":";;;;;;;;;AAca,MAAA,iCAAiC,GAAoB;AAC9D,IAAA,OAAO,EAAE,CAAU,QAAA,CAAA;AACnB,IAAA,QAAQ,EAAmB,KAAA;AAC3B,IAAA,IAAI,EAAE,CAAe,aAAA,CAAA;AACrB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,WAAW,EAAE,KAAK;EACpB;MAEW,iBAAiB,GAAG,IAAI,cAAc,CAC/C,wCAAwC,EACxC;AACI,IAAA,OAAO,EAAE,MAAM,iCAAiC;AACnD,CAAA,EACH;MAEW,uBAAuB,GAEf,CAAC,OAAiC,MAAM;AACzD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,QAAQ,EAAM,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,iCAAiC,CAAK,EAAA,OAAO,CAAC;AAC/D,CAAA;;AChCe,SAAA,mBAAmB,CAC/B,KAAa,EACb,IAAkB,EAAA;AAElB,IAAA,IAAI,IAAI,KAAK,CAAA,KAAA,CAAO,IAAI,CAAC,KAAK,KAAK,IAAI,KAAK,eAAe,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;AACvE,QAAA,OAAO,EAAE,CAAC;AACb,KAAA;AAED,IAAA,IAAI,IAAI,KAAK,CAAgB,cAAA,C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/components/taiga-ui-addon-commerce-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components.js","sources":["../../../projects/addon-commerce/components/taiga-ui-addon-commerce-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG"}
@@ -1,34 +1,34 @@
1
1
  import { tuiCreateCorrectionMask, TUI_DIGIT_REGEXP } from '@taiga-ui/core';
2
- import { isCardLengthValid, isCardNumberValid } from '@taiga-ui/addon-commerce/utils';
2
+ import { tuiIsCardLengthValid, tuiIsCardNumberValid } from '@taiga-ui/addon-commerce/utils';
3
3
 
4
4
  const ALLOWED_REGEXP = /[A-Z]| /;
5
5
  const MAP = {
6
- А: 'F',
7
- В: 'D',
8
- Г: 'U',
9
- Д: 'L',
10
- Е: 'T',
11
- З: 'P',
12
- И: 'B',
13
- Й: 'Q',
14
- К: 'R',
15
- Л: 'K',
16
- М: 'V',
17
- Н: 'Y',
18
- О: 'J',
19
- П: 'G',
20
- Р: 'H',
21
- С: 'C',
22
- Т: 'N',
23
- У: 'E',
24
- Ф: 'A',
25
- Ц: 'W',
26
- Ч: 'X',
27
- Ш: 'I',
28
- Щ: 'O',
29
- Ы: 'S',
30
- Ь: 'M',
31
- Я: 'Z',
6
+ А: `F`,
7
+ В: `D`,
8
+ Г: `U`,
9
+ Д: `L`,
10
+ Е: `T`,
11
+ З: `P`,
12
+ И: `B`,
13
+ Й: `Q`,
14
+ К: `R`,
15
+ Л: `K`,
16
+ М: `V`,
17
+ Н: `Y`,
18
+ О: `J`,
19
+ П: `G`,
20
+ Р: `H`,
21
+ С: `C`,
22
+ Т: `N`,
23
+ У: `E`,
24
+ Ф: `A`,
25
+ Ц: `W`,
26
+ Ч: `X`,
27
+ Ш: `I`,
28
+ Щ: `O`,
29
+ Ы: `S`,
30
+ Ь: `M`,
31
+ Я: `Z`,
32
32
  };
33
33
  function toEnglishUppercase(char) {
34
34
  const uppercase = char.toUpperCase();
@@ -45,28 +45,28 @@ const TUI_CARD_MASK = [
45
45
  TUI_DIGIT_REGEXP,
46
46
  TUI_DIGIT_REGEXP,
47
47
  TUI_DIGIT_REGEXP,
48
- ' ',
48
+ ` `,
49
49
  TUI_DIGIT_REGEXP,
50
50
  TUI_DIGIT_REGEXP,
51
51
  TUI_DIGIT_REGEXP,
52
52
  TUI_DIGIT_REGEXP,
53
- ' ',
53
+ ` `,
54
54
  TUI_DIGIT_REGEXP,
55
55
  TUI_DIGIT_REGEXP,
56
56
  TUI_DIGIT_REGEXP,
57
57
  TUI_DIGIT_REGEXP,
58
- ' ',
58
+ ` `,
59
59
  TUI_DIGIT_REGEXP,
60
60
  TUI_DIGIT_REGEXP,
61
61
  TUI_DIGIT_REGEXP,
62
62
  TUI_DIGIT_REGEXP,
63
- ' ',
63
+ ` `,
64
64
  TUI_DIGIT_REGEXP,
65
65
  TUI_DIGIT_REGEXP,
66
66
  TUI_DIGIT_REGEXP,
67
67
  ];
68
68
 
69
- const tuiDefaultCardValidator = card => card.length > 11 && isCardLengthValid(card) && isCardNumberValid(card);
69
+ const tuiDefaultCardValidator = card => card.length > 11 && tuiIsCardLengthValid(card) && tuiIsCardNumberValid(card);
70
70
 
71
71
  /**
72
72
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-constants.js","sources":["ng://@taiga-ui/addon-commerce/constants/card-holder-mask.ts","ng://@taiga-ui/addon-commerce/constants/card-mask.ts","ng://@taiga-ui/addon-commerce/constants/default-card-validator.ts","ng://@taiga-ui/addon-commerce/constants/taiga-ui-addon-commerce-constants.ts"],"sourcesContent":["import {tuiCreateCorrectionMask, TuiTextMaskListHandler} from '@taiga-ui/core';\n\nconst ALLOWED_REGEXP = /[A-Z]| /;\nconst MAP: Record<string, string> = {\n А: 'F',\n В: 'D',\n Г: 'U',\n Д: 'L',\n Е: 'T',\n З: 'P',\n И: 'B',\n Й: 'Q',\n К: 'R',\n Л: 'K',\n М: 'V',\n Н: 'Y',\n О: 'J',\n П: 'G',\n Р: 'H',\n С: 'C',\n Т: 'N',\n У: 'E',\n Ф: 'A',\n Ц: 'W',\n Ч: 'X',\n Ш: 'I',\n Щ: 'O',\n Ы: 'S',\n Ь: 'M',\n Я: 'Z',\n};\n\nfunction toEnglishUppercase(char: string): string | null {\n const uppercase = char.toUpperCase();\n const result = ALLOWED_REGEXP.test(uppercase) ? uppercase : MAP[uppercase];\n\n return result || null;\n}\n\nexport const cardHolderMask: TuiTextMaskListHandler = tuiCreateCorrectionMask(\n ALLOWED_REGEXP,\n toEnglishUppercase,\n);\n","import {TUI_DIGIT_REGEXP} from '@taiga-ui/core';\n\n/**\n * @internal\n */\nexport const TUI_CARD_MASK = [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ' ',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ' ',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ' ',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ' ',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n];\n","import {isCardLengthValid, isCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiBooleanHandler} from '@taiga-ui/cdk';\n\nexport const tuiDefaultCardValidator: TuiBooleanHandler<string> = card =>\n card.length > 11 && isCardLengthValid(card) && isCardNumberValid(card);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,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BAAgB;IAChB,gBAAgB;IAChB,GAAG;IACH,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;;;MCzBP,uBAAuB,GAA8B,IAAI,IAClE,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,IAAI;;ACJzE;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-constants.js","sources":["../../../projects/addon-commerce/constants/card-holder-mask.ts","../../../projects/addon-commerce/constants/card-mask.ts","../../../projects/addon-commerce/constants/default-card-validator.ts","../../../projects/addon-commerce/constants/taiga-ui-addon-commerce-constants.ts"],"sourcesContent":["import {tuiCreateCorrectionMask, TuiTextMaskListHandler} from '@taiga-ui/core';\n\nconst ALLOWED_REGEXP = /[A-Z]| /;\nconst MAP: Record<string, string> = {\n А: `F`,\n В: `D`,\n Г: `U`,\n Д: `L`,\n Е: `T`,\n З: `P`,\n И: `B`,\n Й: `Q`,\n К: `R`,\n Л: `K`,\n М: `V`,\n Н: `Y`,\n О: `J`,\n П: `G`,\n Р: `H`,\n С: `C`,\n Т: `N`,\n У: `E`,\n Ф: `A`,\n Ц: `W`,\n Ч: `X`,\n Ш: `I`,\n Щ: `O`,\n Ы: `S`,\n Ь: `M`,\n Я: `Z`,\n};\n\nfunction toEnglishUppercase(char: string): string | null {\n const uppercase = char.toUpperCase();\n const result = ALLOWED_REGEXP.test(uppercase) ? uppercase : MAP[uppercase];\n\n return result || null;\n}\n\nexport const cardHolderMask: TuiTextMaskListHandler = tuiCreateCorrectionMask(\n ALLOWED_REGEXP,\n toEnglishUppercase,\n);\n","import {TUI_DIGIT_REGEXP} from '@taiga-ui/core';\n\n/**\n * @internal\n */\nexport const TUI_CARD_MASK = [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n];\n","import {tuiIsCardLengthValid, tuiIsCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiBooleanHandler} from '@taiga-ui/cdk';\n\nexport const tuiDefaultCardValidator: TuiBooleanHandler<string> = card =>\n card.length > 11 && tuiIsCardLengthValid(card) && tuiIsCardNumberValid(card);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,GAAG,GAA2B;AAChC,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,I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MAAM,GAAG,EAAE,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,IAAI;;ACJ/E;;AAEG;;;;"}
@@ -307,12 +307,6 @@ var TuiCurrencyCode;
307
307
  * @description Countries and territories: Hong Kong
308
308
  */
309
309
  TuiCurrencyCode["HongKongDollar"] = "344";
310
- /**
311
- * @deprecated
312
- * TODO: 3.0 replace with {@link HongKongDollar}
313
- */
314
- // eslint-disable-next-line @typescript-eslint/naming-convention
315
- TuiCurrencyCode["HongKong_dollar"] = "344";
316
310
  /**
317
311
  * Canadian dollar
318
312
  *
@@ -340,36 +334,9 @@ var TuiCurrencyCode;
340
334
  TuiCurrencyCode["MexicanPeso"] = "484";
341
335
  })(TuiCurrencyCode || (TuiCurrencyCode = {}));
342
336
 
343
- /**
344
- * negative-only — show sign only for negative numbers
345
- * always — always show sign, except for zero
346
- * never — never show sign
347
- * force-negative — show minus no matter the number, except for zero
348
- * force-positive — show plus no matter the number, except for zero
349
- * @deprecated use join type {@link TuiMoneySignT}
350
- * TODO: delete in v3.0
351
- */
352
- var TuiMoneySign;
353
- (function (TuiMoneySign) {
354
- TuiMoneySign["NegativeOnly"] = "negative-only";
355
- TuiMoneySign["Always"] = "always";
356
- TuiMoneySign["Never"] = "never";
357
- TuiMoneySign["ForceNegative"] = "force-negative";
358
- TuiMoneySign["ForcePositive"] = "force-positive";
359
- })(TuiMoneySign || (TuiMoneySign = {}));
360
-
361
- var TuiPaymentSystem;
362
- (function (TuiPaymentSystem) {
363
- TuiPaymentSystem["Visa"] = "visa";
364
- TuiPaymentSystem["Electron"] = "electron";
365
- TuiPaymentSystem["Mastercard"] = "mastercard";
366
- TuiPaymentSystem["Maestro"] = "maestro";
367
- TuiPaymentSystem["Mir"] = "mir";
368
- })(TuiPaymentSystem || (TuiPaymentSystem = {}));
369
-
370
337
  /**
371
338
  * Generated bundle index. Do not edit.
372
339
  */
373
340
 
374
- export { TuiCurrency, TuiCurrencyCode, TuiMoneySign, TuiPaymentSystem };
341
+ export { TuiCurrency, TuiCurrencyCode };
375
342
  //# sourceMappingURL=taiga-ui-addon-commerce-enums.js.map