@taiga-ui/addon-commerce 2.59.1 → 3.0.0-rc.1

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 (365) hide show
  1. package/bundles/taiga-ui-addon-commerce-components-card.umd.js +420 -306
  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 +610 -463
  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 +458 -332
  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 +436 -310
  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 +427 -304
  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 +509 -377
  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 +8 -6
  16. package/bundles/taiga-ui-addon-commerce-constants.umd.js.map +1 -1
  17. package/bundles/taiga-ui-addon-commerce-enums.umd.js +100 -41
  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 +60 -271
  22. package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +1 -1
  23. package/bundles/taiga-ui-addon-commerce-tokens.umd.js +9 -5
  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 +46 -95
  28. package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
  29. package/bundles/taiga-ui-addon-commerce-validators.umd.js +15 -9
  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 -4
  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 -4
  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/input-card-grouped.providers.d.ts +0 -2
  44. package/components/input-card-grouped/package.json +2 -5
  45. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.d.ts +1 -0
  46. package/components/input-cvc/input-cvc.component.d.ts +3 -1
  47. package/components/input-cvc/input-cvc.module.d.ts +8 -0
  48. package/components/input-cvc/package.json +2 -5
  49. package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.d.ts +1 -0
  50. package/components/input-expire/input-expire.component.d.ts +3 -1
  51. package/components/input-expire/input-expire.module.d.ts +8 -0
  52. package/components/input-expire/package.json +2 -5
  53. package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.d.ts +1 -0
  54. package/components/money/money-options.d.ts +4 -4
  55. package/components/money/money.component.d.ts +7 -4
  56. package/components/money/money.module.d.ts +10 -0
  57. package/components/money/package.json +2 -5
  58. package/components/money/pipes/fraction-part.pipe.d.ts +5 -2
  59. package/components/money/pipes/integer-part.pipe.d.ts +3 -0
  60. package/components/money/pipes/sign-symbol.pipe.d.ts +5 -2
  61. package/components/money/taiga-ui-addon-commerce-components-money.d.ts +1 -0
  62. package/components/money/utils/format-fraction-part.d.ts +2 -2
  63. package/components/money/utils/format-sign-symbol.d.ts +2 -2
  64. package/components/package.json +2 -5
  65. package/components/taiga-ui-addon-commerce-components.d.ts +1 -0
  66. package/constants/package.json +2 -5
  67. package/constants/taiga-ui-addon-commerce-constants.d.ts +1 -0
  68. package/enums/currency-code.d.ts +48 -6
  69. package/enums/currency.d.ts +48 -6
  70. package/enums/index.d.ts +0 -2
  71. package/enums/package.json +2 -5
  72. package/enums/taiga-ui-addon-commerce-enums.d.ts +1 -0
  73. package/esm2015/components/card/card.component.js +39 -30
  74. package/esm2015/components/card/card.module.js +15 -12
  75. package/esm2015/components/card/index.js +1 -1
  76. package/esm2015/components/card/taiga-ui-addon-commerce-components-card.js +1 -1
  77. package/esm2015/components/index.js +1 -1
  78. package/esm2015/components/input-card/index.js +1 -1
  79. package/esm2015/components/input-card/input-card.component.js +73 -60
  80. package/esm2015/components/input-card/input-card.module.js +24 -13
  81. package/esm2015/components/input-card/taiga-ui-addon-commerce-components-input-card.js +1 -1
  82. package/esm2015/components/input-card-grouped/index.js +1 -1
  83. package/esm2015/components/input-card-grouped/input-card-grouped.component.js +125 -109
  84. package/esm2015/components/input-card-grouped/input-card-grouped.module.js +45 -15
  85. package/esm2015/components/input-card-grouped/input-card-grouped.providers.js +20 -17
  86. package/esm2015/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +1 -1
  87. package/esm2015/components/input-cvc/index.js +1 -1
  88. package/esm2015/components/input-cvc/input-cvc.component.js +50 -41
  89. package/esm2015/components/input-cvc/input-cvc.module.js +26 -13
  90. package/esm2015/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +1 -1
  91. package/esm2015/components/input-expire/index.js +1 -1
  92. package/esm2015/components/input-expire/input-expire.component.js +46 -38
  93. package/esm2015/components/input-expire/input-expire.module.js +24 -13
  94. package/esm2015/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +1 -1
  95. package/esm2015/components/money/index.js +1 -1
  96. package/esm2015/components/money/money-options.js +1 -1
  97. package/esm2015/components/money/money.component.js +46 -33
  98. package/esm2015/components/money/money.module.js +23 -17
  99. package/esm2015/components/money/pipes/fraction-part.pipe.js +13 -12
  100. package/esm2015/components/money/pipes/integer-part.pipe.js +15 -14
  101. package/esm2015/components/money/pipes/sign-symbol.pipe.js +10 -8
  102. package/esm2015/components/money/taiga-ui-addon-commerce-components-money.js +1 -1
  103. package/esm2015/components/money/utils/format-fraction-part.js +1 -1
  104. package/esm2015/components/money/utils/format-sign-symbol.js +1 -1
  105. package/esm2015/components/taiga-ui-addon-commerce-components.js +1 -1
  106. package/esm2015/constants/card-holder-mask.js +1 -1
  107. package/esm2015/constants/card-mask.js +1 -1
  108. package/esm2015/constants/default-card-validator.js +3 -3
  109. package/esm2015/constants/index.js +1 -1
  110. package/esm2015/constants/taiga-ui-addon-commerce-constants.js +1 -1
  111. package/esm2015/enums/currency-code.js +48 -7
  112. package/esm2015/enums/currency.js +48 -7
  113. package/esm2015/enums/index.js +1 -3
  114. package/esm2015/enums/taiga-ui-addon-commerce-enums.js +1 -1
  115. package/esm2015/index.js +3 -1
  116. package/esm2015/interfaces/card.js +2 -1
  117. package/esm2015/interfaces/index.js +2 -1
  118. package/esm2015/interfaces/taiga-ui-addon-commerce-interfaces.js +2 -1
  119. package/esm2015/pipes/currency/currency.module.js +14 -11
  120. package/esm2015/pipes/currency/currency.pipe.js +14 -12
  121. package/esm2015/pipes/format-card/format-card.module.js +14 -11
  122. package/esm2015/pipes/format-card/format-card.pipe.js +10 -8
  123. package/esm2015/pipes/index.js +1 -1
  124. package/esm2015/pipes/taiga-ui-addon-commerce-pipes.js +1 -1
  125. package/esm2015/taiga-ui-addon-commerce.js +1 -1
  126. package/esm2015/tokens/i18n.js +4 -4
  127. package/esm2015/tokens/index.js +1 -1
  128. package/esm2015/tokens/taiga-ui-addon-commerce-tokens.js +1 -1
  129. package/esm2015/types/code-length.js +2 -1
  130. package/esm2015/types/currency-variants.js +2 -1
  131. package/esm2015/types/index.js +5 -1
  132. package/esm2015/types/money-sign.js +2 -1
  133. package/esm2015/types/payment-system.js +2 -0
  134. package/esm2015/types/taiga-ui-addon-commerce-types.js +2 -1
  135. package/esm2015/utils/create-auto-corrected-expire-pipe.js +1 -1
  136. package/esm2015/utils/format-currency.js +7 -12
  137. package/esm2015/utils/get-currency-symbol.js +11 -7
  138. package/esm2015/utils/get-payment-system.js +17 -47
  139. package/esm2015/utils/index.js +1 -1
  140. package/esm2015/utils/is-card-length-valid.js +9 -12
  141. package/esm2015/utils/is-card-number-valid.js +2 -5
  142. package/esm2015/utils/is-expire-valid.js +2 -7
  143. package/esm2015/utils/taiga-ui-addon-commerce-utils.js +1 -1
  144. package/esm2015/validators/card-expire.validator.js +3 -3
  145. package/esm2015/validators/card-number.validator.js +3 -3
  146. package/esm2015/validators/index.js +1 -1
  147. package/esm2015/validators/luhn.validator.js +5 -3
  148. package/esm2015/validators/taiga-ui-addon-commerce-validators.js +1 -1
  149. package/fesm2015/taiga-ui-addon-commerce-components-card.js +54 -40
  150. package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
  151. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +188 -136
  152. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  153. package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +96 -70
  154. package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
  155. package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +73 -49
  156. package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
  157. package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +67 -46
  158. package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
  159. package/fesm2015/taiga-ui-addon-commerce-components-money.js +125 -100
  160. package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
  161. package/fesm2015/taiga-ui-addon-commerce-components.js.map +1 -1
  162. package/fesm2015/taiga-ui-addon-commerce-constants.js +2 -2
  163. package/fesm2015/taiga-ui-addon-commerce-constants.js.map +1 -1
  164. package/fesm2015/taiga-ui-addon-commerce-enums.js +95 -40
  165. package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
  166. package/fesm2015/taiga-ui-addon-commerce-interfaces.js.map +1 -1
  167. package/fesm2015/taiga-ui-addon-commerce-pipes.js +45 -31
  168. package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +1 -1
  169. package/fesm2015/taiga-ui-addon-commerce-tokens.js +3 -3
  170. package/fesm2015/taiga-ui-addon-commerce-tokens.js.map +1 -1
  171. package/fesm2015/taiga-ui-addon-commerce-types.js.map +1 -1
  172. package/fesm2015/taiga-ui-addon-commerce-utils.js +41 -83
  173. package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
  174. package/fesm2015/taiga-ui-addon-commerce-validators.js +6 -4
  175. package/fesm2015/taiga-ui-addon-commerce-validators.js.map +1 -1
  176. package/fesm2015/taiga-ui-addon-commerce.js +2 -0
  177. package/fesm2015/taiga-ui-addon-commerce.js.map +1 -1
  178. package/interfaces/package.json +2 -5
  179. package/interfaces/taiga-ui-addon-commerce-interfaces.d.ts +1 -0
  180. package/package.json +12 -15
  181. package/pipes/currency/currency.module.d.ts +5 -0
  182. package/pipes/currency/currency.pipe.d.ts +3 -0
  183. package/pipes/format-card/format-card.module.d.ts +5 -0
  184. package/pipes/format-card/format-card.pipe.d.ts +3 -0
  185. package/pipes/package.json +2 -5
  186. package/pipes/taiga-ui-addon-commerce-pipes.d.ts +1 -0
  187. package/taiga-ui-addon-commerce.d.ts +1 -0
  188. package/tokens/package.json +2 -5
  189. package/tokens/taiga-ui-addon-commerce-tokens.d.ts +1 -0
  190. package/types/index.d.ts +1 -0
  191. package/types/money-sign.d.ts +1 -1
  192. package/types/package.json +2 -5
  193. package/types/payment-system.d.ts +1 -0
  194. package/types/taiga-ui-addon-commerce-types.d.ts +1 -0
  195. package/utils/format-currency.d.ts +1 -5
  196. package/utils/get-currency-symbol.d.ts +1 -5
  197. package/utils/get-payment-system.d.ts +7 -31
  198. package/utils/is-card-length-valid.d.ts +1 -3
  199. package/utils/is-card-number-valid.d.ts +1 -3
  200. package/utils/is-expire-valid.d.ts +1 -5
  201. package/utils/package.json +2 -5
  202. package/utils/taiga-ui-addon-commerce-utils.d.ts +1 -0
  203. package/validators/package.json +2 -5
  204. package/validators/taiga-ui-addon-commerce-validators.d.ts +1 -0
  205. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +0 -2
  206. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +0 -1
  207. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +0 -2
  208. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +0 -1
  209. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js +0 -2
  210. package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js.map +0 -1
  211. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js +0 -2
  212. package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js.map +0 -1
  213. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js +0 -2
  214. package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +0 -1
  215. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +0 -2
  216. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +0 -1
  217. package/bundles/taiga-ui-addon-commerce-components.umd.min.js +0 -2
  218. package/bundles/taiga-ui-addon-commerce-components.umd.min.js.map +0 -1
  219. package/bundles/taiga-ui-addon-commerce-constants.umd.min.js +0 -2
  220. package/bundles/taiga-ui-addon-commerce-constants.umd.min.js.map +0 -1
  221. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +0 -2
  222. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +0 -1
  223. package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js +0 -2
  224. package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js.map +0 -1
  225. package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js +0 -2
  226. package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js.map +0 -1
  227. package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js +0 -2
  228. package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js.map +0 -1
  229. package/bundles/taiga-ui-addon-commerce-types.umd.min.js +0 -2
  230. package/bundles/taiga-ui-addon-commerce-types.umd.min.js.map +0 -1
  231. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +0 -2
  232. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +0 -1
  233. package/bundles/taiga-ui-addon-commerce-validators.umd.min.js +0 -2
  234. package/bundles/taiga-ui-addon-commerce-validators.umd.min.js.map +0 -1
  235. package/bundles/taiga-ui-addon-commerce.umd.min.js +0 -2
  236. package/bundles/taiga-ui-addon-commerce.umd.min.js.map +0 -1
  237. package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +0 -1
  238. package/components/input-card/taiga-ui-addon-commerce-components-input-card.metadata.json +0 -1
  239. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +0 -1
  240. package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.metadata.json +0 -1
  241. package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.metadata.json +0 -1
  242. package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +0 -1
  243. package/components/taiga-ui-addon-commerce-components.metadata.json +0 -1
  244. package/constants/taiga-ui-addon-commerce-constants.metadata.json +0 -1
  245. package/enums/money-sign.d.ts +0 -16
  246. package/enums/payment-system.d.ts +0 -8
  247. package/enums/taiga-ui-addon-commerce-enums.metadata.json +0 -1
  248. package/esm2015/enums/money-sign.js +0 -18
  249. package/esm2015/enums/payment-system.js +0 -9
  250. package/esm5/components/card/card.component.js +0 -73
  251. package/esm5/components/card/card.module.js +0 -19
  252. package/esm5/components/card/index.js +0 -3
  253. package/esm5/components/card/taiga-ui-addon-commerce-components-card.js +0 -5
  254. package/esm5/components/index.js +0 -7
  255. package/esm5/components/input-card/index.js +0 -3
  256. package/esm5/components/input-card/input-card.component.js +0 -167
  257. package/esm5/components/input-card/input-card.module.js +0 -25
  258. package/esm5/components/input-card/taiga-ui-addon-commerce-components-input-card.js +0 -5
  259. package/esm5/components/input-card-grouped/index.js +0 -4
  260. package/esm5/components/input-card-grouped/input-card-grouped.component.js +0 -511
  261. package/esm5/components/input-card-grouped/input-card-grouped.module.js +0 -40
  262. package/esm5/components/input-card-grouped/input-card-grouped.providers.js +0 -34
  263. package/esm5/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -5
  264. package/esm5/components/input-cvc/index.js +0 -3
  265. package/esm5/components/input-cvc/input-cvc.component.js +0 -113
  266. package/esm5/components/input-cvc/input-cvc.module.js +0 -26
  267. package/esm5/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +0 -5
  268. package/esm5/components/input-expire/index.js +0 -3
  269. package/esm5/components/input-expire/input-expire.component.js +0 -108
  270. package/esm5/components/input-expire/input-expire.module.js +0 -25
  271. package/esm5/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +0 -5
  272. package/esm5/components/money/index.js +0 -9
  273. package/esm5/components/money/money-options.js +0 -18
  274. package/esm5/components/money/money.component.js +0 -101
  275. package/esm5/components/money/money.module.js +0 -27
  276. package/esm5/components/money/pipes/fraction-part.pipe.js +0 -27
  277. package/esm5/components/money/pipes/integer-part.pipe.js +0 -21
  278. package/esm5/components/money/pipes/sign-symbol.pipe.js +0 -16
  279. package/esm5/components/money/taiga-ui-addon-commerce-components-money.js +0 -5
  280. package/esm5/components/money/utils/format-fraction-part.js +0 -7
  281. package/esm5/components/money/utils/format-sign-symbol.js +0 -11
  282. package/esm5/components/taiga-ui-addon-commerce-components.js +0 -5
  283. package/esm5/constants/card-holder-mask.js +0 -37
  284. package/esm5/constants/card-mask.js +0 -30
  285. package/esm5/constants/default-card-validator.js +0 -5
  286. package/esm5/constants/index.js +0 -4
  287. package/esm5/constants/taiga-ui-addon-commerce-constants.js +0 -5
  288. package/esm5/enums/currency-code.js +0 -178
  289. package/esm5/enums/currency.js +0 -178
  290. package/esm5/enums/index.js +0 -5
  291. package/esm5/enums/money-sign.js +0 -18
  292. package/esm5/enums/payment-system.js +0 -9
  293. package/esm5/enums/taiga-ui-addon-commerce-enums.js +0 -5
  294. package/esm5/index.js +0 -8
  295. package/esm5/interfaces/card.js +0 -1
  296. package/esm5/interfaces/index.js +0 -1
  297. package/esm5/interfaces/taiga-ui-addon-commerce-interfaces.js +0 -4
  298. package/esm5/pipes/currency/currency.module.js +0 -16
  299. package/esm5/pipes/currency/currency.pipe.js +0 -18
  300. package/esm5/pipes/format-card/format-card.module.js +0 -16
  301. package/esm5/pipes/format-card/format-card.pipe.js +0 -22
  302. package/esm5/pipes/index.js +0 -5
  303. package/esm5/pipes/taiga-ui-addon-commerce-pipes.js +0 -5
  304. package/esm5/taiga-ui-addon-commerce.js +0 -5
  305. package/esm5/tokens/i18n.js +0 -13
  306. package/esm5/tokens/index.js +0 -2
  307. package/esm5/tokens/taiga-ui-addon-commerce-tokens.js +0 -5
  308. package/esm5/types/code-length.js +0 -1
  309. package/esm5/types/currency-variants.js +0 -1
  310. package/esm5/types/index.js +0 -1
  311. package/esm5/types/money-sign.js +0 -1
  312. package/esm5/types/taiga-ui-addon-commerce-types.js +0 -4
  313. package/esm5/utils/create-auto-corrected-expire-pipe.js +0 -43
  314. package/esm5/utils/format-currency.js +0 -17
  315. package/esm5/utils/get-currency-symbol.js +0 -71
  316. package/esm5/utils/get-payment-system.js +0 -103
  317. package/esm5/utils/index.js +0 -8
  318. package/esm5/utils/is-card-length-valid.js +0 -25
  319. package/esm5/utils/is-card-number-valid.js +0 -21
  320. package/esm5/utils/is-expire-valid.js +0 -14
  321. package/esm5/utils/taiga-ui-addon-commerce-utils.js +0 -5
  322. package/esm5/validators/card-expire.validator.js +0 -10
  323. package/esm5/validators/card-number.validator.js +0 -9
  324. package/esm5/validators/index.js +0 -4
  325. package/esm5/validators/luhn.validator.js +0 -9
  326. package/esm5/validators/taiga-ui-addon-commerce-validators.js +0 -5
  327. package/fesm5/taiga-ui-addon-commerce-components-card.js +0 -94
  328. package/fesm5/taiga-ui-addon-commerce-components-card.js.map +0 -1
  329. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -579
  330. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +0 -1
  331. package/fesm5/taiga-ui-addon-commerce-components-input-card.js +0 -193
  332. package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +0 -1
  333. package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js +0 -140
  334. package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js.map +0 -1
  335. package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +0 -134
  336. package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +0 -1
  337. package/fesm5/taiga-ui-addon-commerce-components-money.js +0 -210
  338. package/fesm5/taiga-ui-addon-commerce-components-money.js.map +0 -1
  339. package/fesm5/taiga-ui-addon-commerce-components.js +0 -11
  340. package/fesm5/taiga-ui-addon-commerce-components.js.map +0 -1
  341. package/fesm5/taiga-ui-addon-commerce-constants.js +0 -78
  342. package/fesm5/taiga-ui-addon-commerce-constants.js.map +0 -1
  343. package/fesm5/taiga-ui-addon-commerce-enums.js +0 -389
  344. package/fesm5/taiga-ui-addon-commerce-enums.js.map +0 -1
  345. package/fesm5/taiga-ui-addon-commerce-interfaces.js +0 -4
  346. package/fesm5/taiga-ui-addon-commerce-interfaces.js.map +0 -1
  347. package/fesm5/taiga-ui-addon-commerce-pipes.js +0 -67
  348. package/fesm5/taiga-ui-addon-commerce-pipes.js.map +0 -1
  349. package/fesm5/taiga-ui-addon-commerce-tokens.js +0 -20
  350. package/fesm5/taiga-ui-addon-commerce-tokens.js.map +0 -1
  351. package/fesm5/taiga-ui-addon-commerce-types.js +0 -4
  352. package/fesm5/taiga-ui-addon-commerce-types.js.map +0 -1
  353. package/fesm5/taiga-ui-addon-commerce-utils.js +0 -298
  354. package/fesm5/taiga-ui-addon-commerce-utils.js.map +0 -1
  355. package/fesm5/taiga-ui-addon-commerce-validators.js +0 -31
  356. package/fesm5/taiga-ui-addon-commerce-validators.js.map +0 -1
  357. package/fesm5/taiga-ui-addon-commerce.js +0 -12
  358. package/fesm5/taiga-ui-addon-commerce.js.map +0 -1
  359. package/interfaces/taiga-ui-addon-commerce-interfaces.metadata.json +0 -1
  360. package/pipes/taiga-ui-addon-commerce-pipes.metadata.json +0 -1
  361. package/taiga-ui-addon-commerce.metadata.json +0 -1
  362. package/tokens/taiga-ui-addon-commerce-tokens.metadata.json +0 -1
  363. package/types/taiga-ui-addon-commerce-types.metadata.json +0 -1
  364. package/utils/taiga-ui-addon-commerce-utils.metadata.json +0 -1
  365. package/validators/taiga-ui-addon-commerce-validators.metadata.json +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-cvc`,\n templateUrl: `./input-cvc.template.html`,\n styleUrls: [`./input-cvc.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCVCComponent),\n },\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = `0`.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = `000`;\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n get computedExampleText(): string {\n return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA0Ca,oBAAoB,4BAAjC,MAAa,oBACT,SAAQ,kBAA0B;IA2BlC,YAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD;QAEzE,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAFjB,0BAAqB,GAArB,qBAAqB,CAAmC;QA1B7E,wBAAmB,GAAG,KAAK,CAAC;QAY5B,gBAAW,GAAG,KAAK,CAAC;QAEpB,oBAAe,GAAmB;YAC9B,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACzC,KAAK,EAAE,KAAK;SACf,CAAC;KAYD;IAzBD,IAAI,MAAM,CAAC,MAAwB;QAC/B,IAAI,CAAC,WAA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AS,CAAC;QACP,QAAQ,EAAE,eAAe;QACzB,4tBAAwC;QAExC,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,sBAAoB,CAAC;aACtD;SACJ;;KACJ,CAAC;IA8BO,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,MAAM,CAAC,2BAA2B,CAAC,CAAA;GAlC/B,oBAAoB,CA2EhC;;IC/FY,iBAAiB,GAA9B,MAAa,iBAAiB;EAAG;AAApB,iBAAiB;IAX7B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,uBAAuB;YACvB,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;QACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAClC,CAAC;GACW,iBAAiB,CAAG;;ACtBjC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["../../../projects/addon-commerce/components/input-cvc/input-cvc.component.ts","../../../projects/addon-commerce/components/input-cvc/input-cvc.template.html","../../../projects/addon-commerce/components/input-cvc/input-cvc.module.ts","../../../projects/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n tuiAsControl,\n tuiAsFocusableItemAccessor,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-cvc`,\n templateUrl: `./input-cvc.template.html`,\n styleUrls: [`./input-cvc.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsFocusableItemAccessor(TuiInputCVCComponent),\n tuiAsControl(TuiInputCVCComponent),\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = `0`.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = `000`;\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n get computedExampleText(): string {\n return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldExampleText]=\"computedExampleText\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwCM,MAAO,oBACT,SAAQ,kBAA0B,CAAA;AA2BlC,IAAA,WAAA,CAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD,EAAA;AAEzE,QAAA,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;Q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BD;;AAEG;;;;"}
@@ -1,14 +1,18 @@
1
- import { __decorate, __param } from 'tslib';
2
- import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
1
+ import { __decorate } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { ChangeDetectorRef, Component, ChangeDetectionStrategy, Optional, Self, Inject, ViewChild, Input, NgModule } from '@angular/core';
4
+ import * as i4 from '@angular/forms';
3
5
  import { NgControl } from '@angular/forms';
4
6
  import { tuiCreateAutoCorrectedExpirePipe } from '@taiga-ui/addon-commerce/utils';
5
- import { AbstractTuiControl, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR } from '@taiga-ui/cdk';
7
+ import { AbstractTuiControl, tuiAsFocusableItemAccessor, tuiAsControl, tuiDefaultProp } from '@taiga-ui/cdk';
8
+ import * as i1 from '@taiga-ui/core';
6
9
  import { TUI_DIGIT_REGEXP, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
10
+ import * as i2 from '@taiga-ui/kit';
7
11
  import { TuiValueAccessorModule } from '@taiga-ui/kit';
12
+ import * as i3 from 'angular2-text-mask';
8
13
  import { TextMaskModule } from 'angular2-text-mask';
9
14
 
10
- var TuiInputExpireComponent_1;
11
- let TuiInputExpireComponent = TuiInputExpireComponent_1 = class TuiInputExpireComponent extends AbstractTuiControl {
15
+ class TuiInputExpireComponent extends AbstractTuiControl {
12
16
  constructor(control, changeDetectorRef) {
13
17
  super(control, changeDetectorRef);
14
18
  this.autocompleteEnabled = false;
@@ -36,9 +40,10 @@ let TuiInputExpireComponent = TuiInputExpireComponent_1 = class TuiInputExpireCo
36
40
  : "off" /* Off */;
37
41
  }
38
42
  onValueChange(value) {
43
+ var _a;
39
44
  // @bad TODO: Workaround until mask pipe can replace chars and keep caret position
40
45
  // @bad TODO: Think about a solution without mask at all
41
- if (!this.input || !this.input.nativeFocusableElement) {
46
+ if (!((_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement)) {
42
47
  return;
43
48
  }
44
49
  if (parseInt(value.slice(0, 2), 10) > 12) {
@@ -55,57 +60,73 @@ let TuiInputExpireComponent = TuiInputExpireComponent_1 = class TuiInputExpireCo
55
60
  onFocused(focused) {
56
61
  this.updateFocused(focused);
57
62
  }
58
- onHovered(hovered) {
59
- this.updateHovered(hovered);
60
- }
61
63
  getFallbackValue() {
62
64
  return ``;
63
65
  }
64
- };
65
- TuiInputExpireComponent.ctorParameters = () => [
66
- { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
67
- { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
68
- ];
69
- __decorate([
70
- ViewChild(TuiPrimitiveTextfieldComponent)
71
- ], TuiInputExpireComponent.prototype, "input", void 0);
66
+ }
67
+ TuiInputExpireComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireComponent, deps: [{ token: NgControl, optional: true, self: true }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
68
+ TuiInputExpireComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiInputExpireComponent, selector: "tui-input-expire", inputs: { autocompleteEnabled: "autocompleteEnabled" }, providers: [
69
+ tuiAsFocusableItemAccessor(TuiInputExpireComponent),
70
+ tuiAsControl(TuiInputExpireComponent),
71
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n", styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}\n"], components: [{ type: i1.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }], directives: [{ type: i1.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2.TuiValueAccessorDirective, selector: "[tuiValueAccessor]" }, { type: i1.TuiTextfieldInputModeDirective, selector: "[tuiTextfieldInputMode]", inputs: ["tuiTextfieldInputMode"] }, { type: i1.TuiTextfieldExampleTextDirective, selector: "[tuiTextfieldExampleText]", inputs: ["tuiTextfieldExampleText"] }, { type: i1.TuiTextfieldAutocompleteDirective, selector: "[tuiTextfieldAutocomplete]", inputs: ["tuiTextfieldAutocomplete"] }, { type: i3.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
72
72
  __decorate([
73
- Input(),
74
73
  tuiDefaultProp()
75
74
  ], TuiInputExpireComponent.prototype, "autocompleteEnabled", void 0);
76
- TuiInputExpireComponent = TuiInputExpireComponent_1 = __decorate([
77
- Component({
78
- selector: `tui-input-expire`,
79
- template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
80
- changeDetection: ChangeDetectionStrategy.OnPush,
81
- providers: [
82
- {
83
- provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
84
- useExisting: forwardRef(() => TuiInputExpireComponent_1),
85
- },
86
- ],
87
- styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}"]
88
- }),
89
- __param(0, Optional()),
90
- __param(0, Self()),
91
- __param(0, Inject(NgControl)),
92
- __param(1, Inject(ChangeDetectorRef))
93
- ], TuiInputExpireComponent);
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireComponent, decorators: [{
76
+ type: Component,
77
+ args: [{
78
+ selector: `tui-input-expire`,
79
+ templateUrl: `./input-expire.template.html`,
80
+ styleUrls: [`./input-expire.style.less`],
81
+ changeDetection: ChangeDetectionStrategy.OnPush,
82
+ providers: [
83
+ tuiAsFocusableItemAccessor(TuiInputExpireComponent),
84
+ tuiAsControl(TuiInputExpireComponent),
85
+ ],
86
+ }]
87
+ }], ctorParameters: function () { return [{ type: i4.NgControl, decorators: [{
88
+ type: Optional
89
+ }, {
90
+ type: Self
91
+ }, {
92
+ type: Inject,
93
+ args: [NgControl]
94
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
95
+ type: Inject,
96
+ args: [ChangeDetectorRef]
97
+ }] }]; }, propDecorators: { input: [{
98
+ type: ViewChild,
99
+ args: [TuiPrimitiveTextfieldComponent]
100
+ }], autocompleteEnabled: [{
101
+ type: Input
102
+ }] } });
94
103
 
95
- let TuiInputExpireModule = class TuiInputExpireModule {
96
- };
97
- TuiInputExpireModule = __decorate([
98
- NgModule({
99
- imports: [
104
+ class TuiInputExpireModule {
105
+ }
106
+ TuiInputExpireModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
107
+ TuiInputExpireModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireModule, declarations: [TuiInputExpireComponent], imports: [TextMaskModule,
108
+ TuiPrimitiveTextfieldModule,
109
+ TuiTextfieldControllerModule,
110
+ TuiValueAccessorModule], exports: [TuiInputExpireComponent] });
111
+ TuiInputExpireModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireModule, imports: [[
100
112
  TextMaskModule,
101
113
  TuiPrimitiveTextfieldModule,
102
114
  TuiTextfieldControllerModule,
103
115
  TuiValueAccessorModule,
104
- ],
105
- declarations: [TuiInputExpireComponent],
106
- exports: [TuiInputExpireComponent],
107
- })
108
- ], TuiInputExpireModule);
116
+ ]] });
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputExpireModule, decorators: [{
118
+ type: NgModule,
119
+ args: [{
120
+ imports: [
121
+ TextMaskModule,
122
+ TuiPrimitiveTextfieldModule,
123
+ TuiTextfieldControllerModule,
124
+ TuiValueAccessorModule,
125
+ ],
126
+ declarations: [TuiInputExpireComponent],
127
+ exports: [TuiInputExpireComponent],
128
+ }]
129
+ }] });
109
130
 
110
131
  /**
111
132
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-expire`,\n templateUrl: `./input-expire.template.html`,\n styleUrls: [`./input-expire.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputExpireComponent),\n },\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n `/`,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n onValueChange(value: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input || !this.input.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.slice(0, 2), 10) > 12) {\n value = `12${value.slice(2)}`;\n }\n\n if (value.slice(0, 2) === `00`) {\n value = `01${value.slice(2)}`;\n }\n\n this.input.nativeFocusableElement.value = value;\n\n if (this.value !== value) {\n this.updateValue(value);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputExpireComponent} from './input-expire.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputExpireComponent],\n exports: [TuiInputExpireComponent],\n})\nexport class TuiInputExpireModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAuCa,uBAAuB,+BAApC,MAAa,uBACT,SAAQ,kBAA0B;IAsBlC,YAII,OAAyB,EACE,iBAAoC;QAE/D,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QArBtC,wBAAmB,GAAG,KAAK,CAAC;QAEnB,oBAAe,GAAmB;YACvC,IAAI,EAAE;gBACF,gBAAgB;gBAChB,g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AgB;QACtB,OAAO,EAAE,CAAC;KACb;EACJ;;YArDgB,SAAS,uBAHjB,QAAQ,YACR,IAAI,YACJ,MAAM,SAAC,SAAS;YAE6B,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;;AAvB7B;IADC,SAAS,CAAC,8BAA8B,CAAC;sDACc;AAIxD;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oEACW;AATnB,uBAAuB;IAZnC,SAAS,CAAC;QACP,QAAQ,EAAE,kBAAkB;QAC5B,6rBAA2C;QAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,yBAAuB,CAAC;aACzD;SACJ;;KACJ,CAAC;IAyBO,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GA5BrB,uBAAuB,CAgFnC;;ICtGY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAVhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACjBpC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["../../../projects/addon-commerce/components/input-expire/input-expire.component.ts","../../../projects/addon-commerce/components/input-expire/input-expire.template.html","../../../projects/addon-commerce/components/input-expire/input-expire.module.ts","../../../projects/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n tuiAsControl,\n tuiAsFocusableItemAccessor,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-expire`,\n templateUrl: `./input-expire.template.html`,\n styleUrls: [`./input-expire.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsFocusableItemAccessor(TuiInputExpireComponent),\n tuiAsControl(TuiInputExpireComponent),\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n `/`,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n onValueChange(value: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input?.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.slice(0, 2), 10) > 12) {\n value = `12${value.slice(2)}`;\n }\n\n if (value.slice(0, 2) === `00`) {\n value = `01${value.slice(2)}`;\n }\n\n this.input.nativeFocusableElement.value = value;\n\n if (this.value !== value) {\n this.updateValue(value);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputExpireComponent} from './input-expire.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputExpireComponent],\n exports: [TuiInputExpireComponent],\n})\nexport class TuiInputExpireModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqCM,MAAO,uB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AAO,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
@@ -1,9 +1,11 @@
1
- import { __decorate, __param } from 'tslib';
2
- import { InjectionToken, Inject, Input, HostBinding, Component, ChangeDetectionStrategy, Pipe, NgModule } from '@angular/core';
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';
3
4
  import { CHAR_MINUS, CHAR_PLUS, tuiDefaultProp } from '@taiga-ui/cdk';
4
- import { CommonModule } from '@angular/common';
5
+ import { tuiFormatNumber, 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
11
  decimal: `not-zero`,
@@ -31,7 +33,67 @@ function tuiFormatSignSymbol(value, sign) {
31
33
  return CHAR_PLUS;
32
34
  }
33
35
 
34
- 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 tuiFormatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), this.numberFormat);
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 {
35
97
  constructor(options) {
36
98
  this.options = options;
37
99
  this.value = NaN;
@@ -58,124 +120,87 @@ let TuiMoneyComponent = class TuiMoneyComponent {
58
120
  get inheritColor() {
59
121
  return this.singleColor || (this.value === 0 && this.colored);
60
122
  }
61
- };
62
- TuiMoneyComponent.ctorParameters = () => [
63
- { type: undefined, decorators: [{ type: Inject, args: [TUI_MONEY_OPTIONS,] }] }
64
- ];
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 });
65
126
  __decorate([
66
- Input(),
67
127
  tuiDefaultProp()
68
128
  ], TuiMoneyComponent.prototype, "value", void 0);
69
129
  __decorate([
70
- Input(),
71
130
  tuiDefaultProp()
72
131
  ], TuiMoneyComponent.prototype, "decimal", void 0);
73
132
  __decorate([
74
- Input(),
75
133
  tuiDefaultProp()
76
134
  ], TuiMoneyComponent.prototype, "currency", void 0);
77
135
  __decorate([
78
- Input(),
79
136
  tuiDefaultProp()
80
137
  ], TuiMoneyComponent.prototype, "sign", void 0);
81
138
  __decorate([
82
- Input(),
83
139
  tuiDefaultProp()
84
140
  ], TuiMoneyComponent.prototype, "colored", void 0);
85
141
  __decorate([
86
- Input(),
87
142
  tuiDefaultProp()
88
143
  ], TuiMoneyComponent.prototype, "precision", void 0);
89
144
  __decorate([
90
- Input(),
91
145
  tuiDefaultProp()
92
146
  ], TuiMoneyComponent.prototype, "singleColor", void 0);
93
- __decorate([
94
- HostBinding(`class._red`)
95
- ], TuiMoneyComponent.prototype, "red", null);
96
- __decorate([
97
- HostBinding(`class._green`)
98
- ], TuiMoneyComponent.prototype, "green", null);
99
- __decorate([
100
- HostBinding(`class._inherit-color`)
101
- ], TuiMoneyComponent.prototype, "inheritColor", null);
102
- TuiMoneyComponent = __decorate([
103
- Component({
104
- selector: `tui-money`,
105
- 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",
106
- changeDetection: ChangeDetectionStrategy.OnPush,
107
- 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}"]
108
- }),
109
- __param(0, Inject(TUI_MONEY_OPTIONS))
110
- ], 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
+ }] } });
111
182
 
112
- function tuiFormatFractionPart(options) {
113
- const { value, decimal, numberFormat, precision } = options;
114
- const fraction = value.toFixed(precision).split(`.`)[1];
115
- const shouldShow = decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));
116
- return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;
183
+ class TuiMoneyModule {
117
184
  }
118
-
119
- let TuiFractionPartPipe = class TuiFractionPartPipe {
120
- constructor(numberFormat) {
121
- this.numberFormat = numberFormat;
122
- }
123
- transform(value, decimal, precision) {
124
- return tuiFormatFractionPart({
125
- value,
126
- decimal,
127
- precision,
128
- numberFormat: this.numberFormat,
129
- });
130
- }
131
- };
132
- TuiFractionPartPipe.ctorParameters = () => [
133
- { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
134
- ];
135
- TuiFractionPartPipe = __decorate([
136
- Pipe({ name: `tuiFractionPart` }),
137
- __param(0, Inject(TUI_NUMBER_FORMAT))
138
- ], TuiFractionPartPipe);
139
-
140
- let TuiIntegerPartPipe = class TuiIntegerPartPipe {
141
- constructor(numberFormat) {
142
- this.numberFormat = numberFormat;
143
- }
144
- transform(value, precision) {
145
- return formatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
146
- }
147
- };
148
- TuiIntegerPartPipe.ctorParameters = () => [
149
- { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
150
- ];
151
- TuiIntegerPartPipe = __decorate([
152
- Pipe({ name: `tuiIntegerPart` }),
153
- __param(0, Inject(TUI_NUMBER_FORMAT))
154
- ], TuiIntegerPartPipe);
155
-
156
- let TuiSignSymbolPipe = class TuiSignSymbolPipe {
157
- transform(value, sign) {
158
- return tuiFormatSignSymbol(value, sign);
159
- }
160
- };
161
- TuiSignSymbolPipe = __decorate([
162
- Pipe({ name: `tuiSignSymbol` })
163
- ], TuiSignSymbolPipe);
164
-
165
- let TuiMoneyModule = class TuiMoneyModule {
166
- };
167
- TuiMoneyModule = __decorate([
168
- NgModule({
169
- imports: [CommonModule, TuiCurrencyPipeModule],
170
- declarations: [
171
- TuiMoneyComponent,
172
- TuiFractionPartPipe,
173
- TuiIntegerPartPipe,
174
- TuiSignSymbolPipe,
175
- ],
176
- exports: [TuiMoneyComponent],
177
- })
178
- ], 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
+ }] });
179
204
 
180
205
  /**
181
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_MINUS, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySignT,\n): TuiMoneySignSymbol {\n if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {\n return ``;\n }\n\n if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {\n return CHAR_MINUS;\n }\n\n return CHAR_PLUS;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySignSymbol,\n TuiMoneySignT,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: `tui-money`,\n templateUrl: `./money.template.html`,\n styleUrls: [`./money.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding(`class._red`)\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_MINUS ||\n (this.value < 0 && this.sign !== `force-positive`))\n );\n }\n\n @HostBinding(`class._green`)\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== `force-negative`))\n );\n }\n\n @HostBinding(`class._inherit-color`)\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","import {TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimalT;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split(`.`)[1];\n const shouldShow =\n decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: `tuiFractionPart`})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimalT, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: `tuiIntegerPart`})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: `tuiSignSymbol`})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySignT): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;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,IAAI,cAAc,CAC/C,wCAAwC,EACxC;IACI,OAAO,EAAE,MAAM,iCAAiC;CACnD,EACH;MAEW,uBAAuB,GAEf,CAAC,OAAiC,MAAM;IACzD,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,kCAAM,iCAAiC,GAAK,OAAO,CAAC;CAC/D;;SChCe,mBAAmB,CAC/B,KAAa,EACb,IAAmB;IAEnB,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,KAAK,eAAe,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;QACvE,OAAO,EAAE,CAAC;KACb;IAED,IAAI,IAAI,KAAK,gBAAgB,KAAK,KAAK,GAAG,CAAC,IAAI,IAAI,KAAK,gBAAgB,CAAC,EAAE;QACvE,OAAO,UAAU,CAAC;K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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 {\n TUI_NUMBER_FORMAT,\n tuiFormatNumber,\n TuiNumberFormatSettings,\n} 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 tuiFormatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n this.numberFormat,\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,K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EAAA,CAAA,CAAA;AAElB,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EATd,OAAA,EAAA,CAAA,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAA,EAAA,CAAA,CAAA;4FASrC,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;AAC9C,oBAAA,YAAY,EAAE;wBACV,iBAAiB;wBACjB,mBAAmB;wBACnB,kBAAkB;wBAClB,iBAAiB;AACpB,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components.js","sources":["ng://@taiga-ui/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;;"}
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,5 +1,5 @@
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 = {
@@ -66,7 +66,7 @@ const TUI_CARD_MASK = [
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.