@taiga-ui/addon-commerce 2.55.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.
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js +424 -305
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +623 -466
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +461 -331
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +444 -314
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +432 -306
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js +516 -384
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components.umd.js +15 -27
- package/bundles/taiga-ui-addon-commerce-components.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-constants.umd.js +38 -36
- package/bundles/taiga-ui-addon-commerce-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.js +6 -35
- package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.js +2 -2
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js +63 -274
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js +11 -7
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-types.umd.js +2 -2
- package/bundles/taiga-ui-addon-commerce-types.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js +63 -107
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-validators.umd.js +17 -11
- package/bundles/taiga-ui-addon-commerce-validators.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce.umd.js +31 -33
- package/bundles/taiga-ui-addon-commerce.umd.js.map +1 -1
- package/components/card/card.component.d.ts +5 -2
- package/components/card/card.module.d.ts +7 -0
- package/components/card/package.json +2 -5
- package/components/card/taiga-ui-addon-commerce-components-card.d.ts +1 -0
- package/components/input-card/input-card.component.d.ts +4 -2
- package/components/input-card/input-card.module.d.ts +8 -0
- package/components/input-card/package.json +2 -5
- package/components/input-card/taiga-ui-addon-commerce-components-input-card.d.ts +1 -0
- package/components/input-card-grouped/input-card-grouped.component.d.ts +5 -3
- package/components/input-card-grouped/input-card-grouped.module.d.ts +12 -0
- package/components/input-card-grouped/package.json +2 -5
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.d.ts +1 -0
- package/components/input-cvc/input-cvc.component.d.ts +3 -1
- package/components/input-cvc/input-cvc.module.d.ts +8 -0
- package/components/input-cvc/package.json +2 -5
- package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.d.ts +1 -0
- package/components/input-expire/input-expire.component.d.ts +3 -1
- package/components/input-expire/input-expire.module.d.ts +8 -0
- package/components/input-expire/package.json +2 -5
- package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.d.ts +1 -0
- package/components/money/money-options.d.ts +4 -4
- package/components/money/money.component.d.ts +7 -4
- package/components/money/money.module.d.ts +10 -0
- package/components/money/package.json +2 -5
- package/components/money/pipes/fraction-part.pipe.d.ts +5 -2
- package/components/money/pipes/integer-part.pipe.d.ts +3 -0
- package/components/money/pipes/sign-symbol.pipe.d.ts +5 -2
- package/components/money/taiga-ui-addon-commerce-components-money.d.ts +1 -0
- package/components/money/utils/format-fraction-part.d.ts +2 -2
- package/components/money/utils/format-sign-symbol.d.ts +2 -2
- package/components/package.json +2 -5
- package/components/taiga-ui-addon-commerce-components.d.ts +1 -0
- package/constants/package.json +2 -5
- package/constants/taiga-ui-addon-commerce-constants.d.ts +1 -0
- package/enums/currency-code.d.ts +0 -5
- package/enums/index.d.ts +0 -2
- package/enums/package.json +2 -5
- package/enums/taiga-ui-addon-commerce-enums.d.ts +1 -0
- package/esm2015/components/card/card.component.js +44 -30
- package/esm2015/components/card/card.module.js +15 -12
- package/esm2015/components/card/index.js +1 -1
- package/esm2015/components/card/taiga-ui-addon-commerce-components-card.js +1 -1
- package/esm2015/components/index.js +1 -1
- package/esm2015/components/input-card/index.js +1 -1
- package/esm2015/components/input-card/input-card.component.js +72 -56
- package/esm2015/components/input-card/input-card.module.js +24 -13
- package/esm2015/components/input-card/taiga-ui-addon-commerce-components-input-card.js +1 -1
- package/esm2015/components/input-card-grouped/index.js +1 -1
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +148 -121
- package/esm2015/components/input-card-grouped/input-card-grouped.module.js +45 -15
- package/esm2015/components/input-card-grouped/input-card-grouped.providers.js +3 -3
- package/esm2015/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +1 -1
- package/esm2015/components/input-cvc/index.js +1 -1
- package/esm2015/components/input-cvc/input-cvc.component.js +56 -43
- package/esm2015/components/input-cvc/input-cvc.module.js +26 -13
- package/esm2015/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +1 -1
- package/esm2015/components/input-expire/index.js +1 -1
- package/esm2015/components/input-expire/input-expire.component.js +49 -38
- package/esm2015/components/input-expire/input-expire.module.js +24 -13
- package/esm2015/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +1 -1
- package/esm2015/components/money/index.js +1 -1
- package/esm2015/components/money/money-options.js +4 -4
- package/esm2015/components/money/money.component.js +48 -35
- package/esm2015/components/money/money.module.js +23 -17
- package/esm2015/components/money/pipes/fraction-part.pipe.js +13 -12
- package/esm2015/components/money/pipes/integer-part.pipe.js +13 -12
- package/esm2015/components/money/pipes/sign-symbol.pipe.js +10 -8
- package/esm2015/components/money/taiga-ui-addon-commerce-components-money.js +1 -1
- package/esm2015/components/money/utils/format-fraction-part.js +4 -4
- package/esm2015/components/money/utils/format-sign-symbol.js +4 -4
- package/esm2015/components/taiga-ui-addon-commerce-components.js +1 -1
- package/esm2015/constants/card-holder-mask.js +27 -27
- package/esm2015/constants/card-mask.js +5 -5
- package/esm2015/constants/default-card-validator.js +3 -3
- package/esm2015/constants/index.js +1 -1
- package/esm2015/constants/taiga-ui-addon-commerce-constants.js +1 -1
- package/esm2015/enums/currency-code.js +1 -7
- package/esm2015/enums/currency.js +1 -1
- package/esm2015/enums/index.js +1 -3
- package/esm2015/enums/taiga-ui-addon-commerce-enums.js +1 -1
- package/esm2015/index.js +3 -1
- package/esm2015/interfaces/card.js +2 -1
- package/esm2015/interfaces/index.js +2 -1
- package/esm2015/interfaces/taiga-ui-addon-commerce-interfaces.js +2 -1
- package/esm2015/pipes/currency/currency.module.js +14 -11
- package/esm2015/pipes/currency/currency.pipe.js +12 -10
- package/esm2015/pipes/format-card/format-card.module.js +14 -11
- package/esm2015/pipes/format-card/format-card.pipe.js +14 -12
- package/esm2015/pipes/index.js +1 -1
- package/esm2015/pipes/taiga-ui-addon-commerce-pipes.js +1 -1
- package/esm2015/taiga-ui-addon-commerce.js +1 -1
- package/esm2015/tokens/i18n.js +6 -6
- package/esm2015/tokens/index.js +1 -1
- package/esm2015/tokens/taiga-ui-addon-commerce-tokens.js +1 -1
- package/esm2015/types/code-length.js +2 -1
- package/esm2015/types/currency-variants.js +2 -1
- package/esm2015/types/index.js +5 -1
- package/esm2015/types/money-sign.js +2 -1
- package/esm2015/types/payment-system.js +2 -0
- package/esm2015/types/taiga-ui-addon-commerce-types.js +2 -1
- package/esm2015/utils/create-auto-corrected-expire-pipe.js +6 -6
- package/esm2015/utils/format-currency.js +7 -7
- package/esm2015/utils/get-currency-symbol.js +21 -26
- package/esm2015/utils/get-payment-system.js +18 -48
- package/esm2015/utils/index.js +1 -1
- package/esm2015/utils/is-card-length-valid.js +9 -11
- package/esm2015/utils/is-card-number-valid.js +4 -6
- package/esm2015/utils/is-expire-valid.js +1 -1
- package/esm2015/utils/taiga-ui-addon-commerce-utils.js +1 -1
- package/esm2015/validators/card-expire.validator.js +2 -2
- package/esm2015/validators/card-number.validator.js +4 -4
- package/esm2015/validators/index.js +1 -1
- package/esm2015/validators/luhn.validator.js +5 -3
- package/esm2015/validators/taiga-ui-addon-commerce-validators.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-card.js +58 -39
- package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +196 -136
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +96 -67
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +81 -53
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +72 -48
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js +133 -108
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-constants.js +32 -32
- package/fesm2015/taiga-ui-addon-commerce-constants.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js +1 -34
- package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-interfaces.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-pipes.js +47 -33
- package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-tokens.js +5 -5
- package/fesm2015/taiga-ui-addon-commerce-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-types.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js +58 -97
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-validators.js +7 -5
- package/fesm2015/taiga-ui-addon-commerce-validators.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce.js +2 -0
- package/fesm2015/taiga-ui-addon-commerce.js.map +1 -1
- package/interfaces/package.json +2 -5
- package/interfaces/taiga-ui-addon-commerce-interfaces.d.ts +1 -0
- package/package.json +12 -15
- package/pipes/currency/currency.module.d.ts +5 -0
- package/pipes/currency/currency.pipe.d.ts +3 -0
- package/pipes/format-card/format-card.module.d.ts +5 -0
- package/pipes/format-card/format-card.pipe.d.ts +3 -0
- package/pipes/package.json +2 -5
- package/pipes/taiga-ui-addon-commerce-pipes.d.ts +1 -0
- package/taiga-ui-addon-commerce.d.ts +1 -0
- package/tokens/package.json +2 -5
- package/tokens/taiga-ui-addon-commerce-tokens.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/money-sign.d.ts +1 -1
- package/types/package.json +2 -5
- package/types/payment-system.d.ts +1 -0
- package/types/taiga-ui-addon-commerce-types.d.ts +1 -0
- package/utils/get-currency-symbol.d.ts +1 -5
- package/utils/get-payment-system.d.ts +7 -31
- package/utils/is-card-length-valid.d.ts +1 -3
- package/utils/is-card-number-valid.d.ts +1 -3
- package/utils/package.json +2 -5
- package/utils/taiga-ui-addon-commerce-utils.d.ts +1 -0
- package/validators/package.json +2 -5
- package/validators/taiga-ui-addon-commerce-validators.d.ts +1 -0
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-components.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-components.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-constants.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-constants.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-interfaces.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-types.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-types.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce-validators.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce-validators.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-commerce.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-commerce.umd.min.js.map +0 -1
- package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +0 -1
- package/components/input-card/taiga-ui-addon-commerce-components-input-card.metadata.json +0 -1
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +0 -1
- package/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.metadata.json +0 -1
- package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.metadata.json +0 -1
- package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +0 -1
- package/components/taiga-ui-addon-commerce-components.metadata.json +0 -1
- package/constants/taiga-ui-addon-commerce-constants.metadata.json +0 -1
- package/enums/money-sign.d.ts +0 -16
- package/enums/payment-system.d.ts +0 -8
- package/enums/taiga-ui-addon-commerce-enums.metadata.json +0 -1
- package/esm2015/enums/money-sign.js +0 -18
- package/esm2015/enums/payment-system.js +0 -9
- package/esm5/components/card/card.component.js +0 -73
- package/esm5/components/card/card.module.js +0 -19
- package/esm5/components/card/index.js +0 -3
- package/esm5/components/card/taiga-ui-addon-commerce-components-card.js +0 -5
- package/esm5/components/index.js +0 -7
- package/esm5/components/input-card/index.js +0 -3
- package/esm5/components/input-card/input-card.component.js +0 -167
- package/esm5/components/input-card/input-card.module.js +0 -25
- package/esm5/components/input-card/taiga-ui-addon-commerce-components-input-card.js +0 -5
- package/esm5/components/input-card-grouped/index.js +0 -4
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +0 -511
- package/esm5/components/input-card-grouped/input-card-grouped.module.js +0 -40
- package/esm5/components/input-card-grouped/input-card-grouped.providers.js +0 -34
- package/esm5/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -5
- package/esm5/components/input-cvc/index.js +0 -3
- package/esm5/components/input-cvc/input-cvc.component.js +0 -113
- package/esm5/components/input-cvc/input-cvc.module.js +0 -26
- package/esm5/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.js +0 -5
- package/esm5/components/input-expire/index.js +0 -3
- package/esm5/components/input-expire/input-expire.component.js +0 -108
- package/esm5/components/input-expire/input-expire.module.js +0 -25
- package/esm5/components/input-expire/taiga-ui-addon-commerce-components-input-expire.js +0 -5
- package/esm5/components/money/index.js +0 -9
- package/esm5/components/money/money-options.js +0 -18
- package/esm5/components/money/money.component.js +0 -101
- package/esm5/components/money/money.module.js +0 -27
- package/esm5/components/money/pipes/fraction-part.pipe.js +0 -27
- package/esm5/components/money/pipes/integer-part.pipe.js +0 -21
- package/esm5/components/money/pipes/sign-symbol.pipe.js +0 -16
- package/esm5/components/money/taiga-ui-addon-commerce-components-money.js +0 -5
- package/esm5/components/money/utils/format-fraction-part.js +0 -7
- package/esm5/components/money/utils/format-sign-symbol.js +0 -11
- package/esm5/components/taiga-ui-addon-commerce-components.js +0 -5
- package/esm5/constants/card-holder-mask.js +0 -37
- package/esm5/constants/card-mask.js +0 -30
- package/esm5/constants/default-card-validator.js +0 -5
- package/esm5/constants/index.js +0 -4
- package/esm5/constants/taiga-ui-addon-commerce-constants.js +0 -5
- package/esm5/enums/currency-code.js +0 -171
- package/esm5/enums/currency.js +0 -171
- package/esm5/enums/index.js +0 -5
- package/esm5/enums/money-sign.js +0 -18
- package/esm5/enums/payment-system.js +0 -9
- package/esm5/enums/taiga-ui-addon-commerce-enums.js +0 -5
- package/esm5/index.js +0 -8
- package/esm5/interfaces/card.js +0 -1
- package/esm5/interfaces/index.js +0 -1
- package/esm5/interfaces/taiga-ui-addon-commerce-interfaces.js +0 -4
- package/esm5/pipes/currency/currency.module.js +0 -16
- package/esm5/pipes/currency/currency.pipe.js +0 -18
- package/esm5/pipes/format-card/format-card.module.js +0 -16
- package/esm5/pipes/format-card/format-card.pipe.js +0 -22
- package/esm5/pipes/index.js +0 -5
- package/esm5/pipes/taiga-ui-addon-commerce-pipes.js +0 -5
- package/esm5/taiga-ui-addon-commerce.js +0 -5
- package/esm5/tokens/i18n.js +0 -13
- package/esm5/tokens/index.js +0 -2
- package/esm5/tokens/taiga-ui-addon-commerce-tokens.js +0 -5
- package/esm5/types/code-length.js +0 -1
- package/esm5/types/currency-variants.js +0 -1
- package/esm5/types/index.js +0 -1
- package/esm5/types/money-sign.js +0 -1
- package/esm5/types/taiga-ui-addon-commerce-types.js +0 -4
- package/esm5/utils/create-auto-corrected-expire-pipe.js +0 -43
- package/esm5/utils/format-currency.js +0 -17
- package/esm5/utils/get-currency-symbol.js +0 -71
- package/esm5/utils/get-payment-system.js +0 -103
- package/esm5/utils/index.js +0 -8
- package/esm5/utils/is-card-length-valid.js +0 -25
- package/esm5/utils/is-card-number-valid.js +0 -21
- package/esm5/utils/is-expire-valid.js +0 -14
- package/esm5/utils/taiga-ui-addon-commerce-utils.js +0 -5
- package/esm5/validators/card-expire.validator.js +0 -10
- package/esm5/validators/card-number.validator.js +0 -9
- package/esm5/validators/index.js +0 -4
- package/esm5/validators/luhn.validator.js +0 -9
- package/esm5/validators/taiga-ui-addon-commerce-validators.js +0 -5
- package/fesm5/taiga-ui-addon-commerce-components-card.js +0 -94
- package/fesm5/taiga-ui-addon-commerce-components-card.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +0 -579
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js +0 -193
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js +0 -140
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +0 -134
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js +0 -210
- package/fesm5/taiga-ui-addon-commerce-components-money.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-components.js +0 -11
- package/fesm5/taiga-ui-addon-commerce-components.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-constants.js +0 -78
- package/fesm5/taiga-ui-addon-commerce-constants.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-enums.js +0 -375
- package/fesm5/taiga-ui-addon-commerce-enums.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-interfaces.js +0 -4
- package/fesm5/taiga-ui-addon-commerce-interfaces.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-pipes.js +0 -67
- package/fesm5/taiga-ui-addon-commerce-pipes.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-tokens.js +0 -20
- package/fesm5/taiga-ui-addon-commerce-tokens.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-types.js +0 -4
- package/fesm5/taiga-ui-addon-commerce-types.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js +0 -298
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce-validators.js +0 -31
- package/fesm5/taiga-ui-addon-commerce-validators.js.map +0 -1
- package/fesm5/taiga-ui-addon-commerce.js +0 -12
- package/fesm5/taiga-ui-addon-commerce.js.map +0 -1
- package/interfaces/taiga-ui-addon-commerce-interfaces.metadata.json +0 -1
- package/pipes/taiga-ui-addon-commerce-pipes.metadata.json +0 -1
- package/taiga-ui-addon-commerce.metadata.json +0 -1
- package/tokens/taiga-ui-addon-commerce-tokens.metadata.json +0 -1
- package/types/taiga-ui-addon-commerce-types.metadata.json +0 -1
- package/utils/taiga-ui-addon-commerce-utils.metadata.json +0 -1
- package/validators/taiga-ui-addon-commerce-validators.metadata.json +0 -1
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { TUI_NON_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP } from '@taiga-ui/core';
|
|
2
|
-
import { padStart } from '@taiga-ui/cdk';
|
|
3
|
-
|
|
4
|
-
var TUI_EXP_YEAR_MONTH = /^\d{2}[/|.]\d{4}$/;
|
|
5
|
-
var TUI_EXP_SAFARI = /^\d{1,4}.\d{1,2}.\d{1,4}$/;
|
|
6
|
-
/**
|
|
7
|
-
* Correct expiration date text allowing only valid months
|
|
8
|
-
* @internal
|
|
9
|
-
*
|
|
10
|
-
* @returns MM/YY
|
|
11
|
-
*/
|
|
12
|
-
function tuiCreateAutoCorrectedExpirePipe() {
|
|
13
|
-
return function (conformedValue, _a) {
|
|
14
|
-
var rawValue = _a.rawValue;
|
|
15
|
-
// Autofilled with MM/YYYY format
|
|
16
|
-
if (TUI_EXP_YEAR_MONTH.test(rawValue)) {
|
|
17
|
-
conformedValue = rawValue.slice(0, 2) + "/" + rawValue.slice(5);
|
|
18
|
-
}
|
|
19
|
-
// Autofilled with Safari crazy format
|
|
20
|
-
if (rawValue.length > 7 &&
|
|
21
|
-
rawValue.length < 11 &&
|
|
22
|
-
TUI_EXP_SAFARI.test(rawValue)) {
|
|
23
|
-
var array = rawValue.split(TUI_NON_DIGIT_REGEXP);
|
|
24
|
-
var month = array[1];
|
|
25
|
-
var year = array.find(function (_a) {
|
|
26
|
-
var length = _a.length;
|
|
27
|
-
return length === 4;
|
|
28
|
-
});
|
|
29
|
-
conformedValue = "" + '0'.repeat(2 - month.length) + month + "/" + (year ? year.slice(2) : '');
|
|
30
|
-
}
|
|
31
|
-
var indexesOfPipedChars = [];
|
|
32
|
-
var conformedValueArr = conformedValue.split('');
|
|
33
|
-
if (parseInt(conformedValueArr[0], 10) > 1) {
|
|
34
|
-
conformedValueArr[2] = '/';
|
|
35
|
-
conformedValueArr[1] = conformedValueArr[0];
|
|
36
|
-
conformedValueArr[0] = '0';
|
|
37
|
-
indexesOfPipedChars.push(0);
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
value: conformedValueArr.join(''),
|
|
41
|
-
indexesOfPipedChars: indexesOfPipedChars,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated: use {@link tuiGetCurrencySymbol} instead
|
|
48
|
-
*/
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
-
function getCurrencySymbol(currency) {
|
|
51
|
-
switch (currency) {
|
|
52
|
-
case "RUB" /* Ruble */:
|
|
53
|
-
case "643" /* Ruble */:
|
|
54
|
-
return '₽';
|
|
55
|
-
case "USD" /* Dollar */:
|
|
56
|
-
case "840" /* Dollar */:
|
|
57
|
-
case "MXN" /* MexicanPeso */:
|
|
58
|
-
case "484" /* MexicanPeso */:
|
|
59
|
-
return '$';
|
|
60
|
-
case "SGD" /* SingaporeDollar */:
|
|
61
|
-
case "702" /* SingaporeDollar */:
|
|
62
|
-
return 'S$';
|
|
63
|
-
case "AUD" /* AustralianDollar */:
|
|
64
|
-
case "036" /* AustralianDollar */:
|
|
65
|
-
return 'A$';
|
|
66
|
-
case "HKD" /* HongKongDollar */:
|
|
67
|
-
case "344" /* HongKongDollar */:
|
|
68
|
-
return 'HK$';
|
|
69
|
-
case "CAD" /* CanadianDollar */:
|
|
70
|
-
case "124" /* CanadianDollar */:
|
|
71
|
-
return 'C$';
|
|
72
|
-
case "EUR" /* Euro */:
|
|
73
|
-
case "978" /* Euro */:
|
|
74
|
-
return '€';
|
|
75
|
-
case "GBP" /* Pound */:
|
|
76
|
-
case "826" /* Pound */:
|
|
77
|
-
return '£';
|
|
78
|
-
case "THB" /* Baht */:
|
|
79
|
-
case "764" /* Baht */:
|
|
80
|
-
return '฿';
|
|
81
|
-
case "TRY" /* TurkishLira */:
|
|
82
|
-
case "949" /* TurkishLira */:
|
|
83
|
-
return '₺';
|
|
84
|
-
case "CNY" /* YuanRenminbi */:
|
|
85
|
-
case "156" /* YuanRenminbi */:
|
|
86
|
-
return 'CN¥';
|
|
87
|
-
case "JPY" /* Yen */:
|
|
88
|
-
case "392" /* Yen */:
|
|
89
|
-
return '¥';
|
|
90
|
-
case "ILS" /* IsraeliShekel */:
|
|
91
|
-
case "376" /* IsraeliShekel */:
|
|
92
|
-
return '₪';
|
|
93
|
-
case "INR" /* IndianRupee */:
|
|
94
|
-
case "356" /* IndianRupee */:
|
|
95
|
-
return '₹';
|
|
96
|
-
case "CHF" /* SwissFranc */:
|
|
97
|
-
case "756" /* SwissFranc */:
|
|
98
|
-
return '₣';
|
|
99
|
-
case "AMD" /* ArmenianDram */:
|
|
100
|
-
case "051" /* ArmenianDram */:
|
|
101
|
-
return '֏';
|
|
102
|
-
case "KRW" /* Won */:
|
|
103
|
-
case "410" /* Won */:
|
|
104
|
-
return '₩';
|
|
105
|
-
case "KZT" /* Tenge */:
|
|
106
|
-
case "398" /* Tenge */:
|
|
107
|
-
return '₸';
|
|
108
|
-
case "UAH" /* Hryvnia */:
|
|
109
|
-
case "980" /* Hryvnia */:
|
|
110
|
-
return '₴';
|
|
111
|
-
default:
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
var tuiGetCurrencySymbol = getCurrencySymbol;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated: use {@link tuiFormatCurrency} instead
|
|
119
|
-
*/
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
121
|
-
function formatCurrency(currency) {
|
|
122
|
-
var stringifiedCurrency = stringifyCurrency(currency);
|
|
123
|
-
return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;
|
|
124
|
-
}
|
|
125
|
-
var tuiFormatCurrency = formatCurrency;
|
|
126
|
-
function stringifyCurrency(currency) {
|
|
127
|
-
return currency === null || typeof currency === 'string'
|
|
128
|
-
? currency || ''
|
|
129
|
-
: padStart(String(currency), 3, '0');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @deprecated: use {@link tuiGetPaymentSystem} instead
|
|
134
|
-
*/
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
136
|
-
function getPaymentSystem(cardNumber) {
|
|
137
|
-
if (cardNumber === '') {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
var one = Number.parseInt(cardNumber[0], 10);
|
|
141
|
-
var two = Number.parseInt(cardNumber.slice(0, 2), 10);
|
|
142
|
-
var three = Number.parseInt(cardNumber.slice(0, 3), 10);
|
|
143
|
-
var four = Number.parseInt(cardNumber.slice(0, 4), 10);
|
|
144
|
-
if (isMaestro(three, two, one)) {
|
|
145
|
-
return "maestro" /* Maestro */;
|
|
146
|
-
}
|
|
147
|
-
if (isMastercard(four, two, one)) {
|
|
148
|
-
return "mastercard" /* Mastercard */;
|
|
149
|
-
}
|
|
150
|
-
if (isMir(four)) {
|
|
151
|
-
return "mir" /* Mir */;
|
|
152
|
-
}
|
|
153
|
-
if (isElectron(four)) {
|
|
154
|
-
return "electron" /* Electron */;
|
|
155
|
-
}
|
|
156
|
-
if (isVisa(one)) {
|
|
157
|
-
return "visa" /* Visa */;
|
|
158
|
-
}
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
|
-
var tuiGetPaymentSystem = getPaymentSystem;
|
|
162
|
-
/**
|
|
163
|
-
* @deprecated: use {@link tuiIsMaestro} instead
|
|
164
|
-
*/
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
166
|
-
function isMaestro(three, two, one) {
|
|
167
|
-
if (one === 6) {
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
if (two === 50 || (two > 55 && two < 59)) {
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
if (three < 500) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
return three < 510;
|
|
177
|
-
}
|
|
178
|
-
var tuiIsMaestro = isMaestro;
|
|
179
|
-
/**
|
|
180
|
-
* @deprecated: use {@link tuiIsMastercard} instead
|
|
181
|
-
*/
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
183
|
-
function isMastercard(four, two, one) {
|
|
184
|
-
if (one === 5) {
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
if (two < 10) {
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
if (two > 50 && two < 56) {
|
|
191
|
-
return true;
|
|
192
|
-
}
|
|
193
|
-
if (four < 1000) {
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
return four > 2220 && four < 2721;
|
|
197
|
-
}
|
|
198
|
-
var tuiIsMastercard = isMastercard;
|
|
199
|
-
/**
|
|
200
|
-
* @deprecated: use {@link tuiIsMir} instead
|
|
201
|
-
*/
|
|
202
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
203
|
-
function isMir(four) {
|
|
204
|
-
return four > 2199 && four < 2205;
|
|
205
|
-
}
|
|
206
|
-
var tuiIsMir = isMir;
|
|
207
|
-
/**
|
|
208
|
-
* @deprecated: use {@link tuiIsElectron} instead
|
|
209
|
-
*/
|
|
210
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
211
|
-
function isElectron(four) {
|
|
212
|
-
switch (four) {
|
|
213
|
-
case 4026:
|
|
214
|
-
case 4175:
|
|
215
|
-
case 4405:
|
|
216
|
-
case 4508:
|
|
217
|
-
case 4844:
|
|
218
|
-
case 4913:
|
|
219
|
-
case 4917:
|
|
220
|
-
return true;
|
|
221
|
-
default:
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
var tuiIsElectron = isElectron;
|
|
226
|
-
/**
|
|
227
|
-
* @deprecated: use {@link tuiIsVisa} instead
|
|
228
|
-
*/
|
|
229
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
230
|
-
function isVisa(one) {
|
|
231
|
-
return one === 4;
|
|
232
|
-
}
|
|
233
|
-
var tuiIsVisa = isVisa;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* @deprecated: use {@link tuiIsCardLengthValid} instead
|
|
237
|
-
* Validates card number length using payment system dictionary
|
|
238
|
-
*/
|
|
239
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
240
|
-
function isCardLengthValid(cardNumber) {
|
|
241
|
-
var length = cardNumber.length;
|
|
242
|
-
var paymentSystem = getPaymentSystem(cardNumber);
|
|
243
|
-
switch (paymentSystem) {
|
|
244
|
-
case "electron" /* Electron */:
|
|
245
|
-
return length === 16;
|
|
246
|
-
case "maestro" /* Maestro */:
|
|
247
|
-
return length > 11 && length < 20;
|
|
248
|
-
case "mastercard" /* Mastercard */:
|
|
249
|
-
case "mir" /* Mir */:
|
|
250
|
-
return length > 15 && length < 20;
|
|
251
|
-
case "visa" /* Visa */:
|
|
252
|
-
return length > 12 && length < 20;
|
|
253
|
-
default:
|
|
254
|
-
return length > 8 && length < 20;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
var tuiIsCardLengthValid = isCardLengthValid;
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* @deprecated: use {@link tuiIsCardNumberValid} instead
|
|
261
|
-
* Validates card number using Luhn algorithm
|
|
262
|
-
*/
|
|
263
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
264
|
-
function isCardNumberValid(value) {
|
|
265
|
-
var cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');
|
|
266
|
-
var length = cardNumber.length;
|
|
267
|
-
var arr = cardNumber.split('').map(function (char, index) {
|
|
268
|
-
var digit = parseInt(char, 10);
|
|
269
|
-
if ((index + length) % 2 === 0) {
|
|
270
|
-
var digitX2 = digit * 2;
|
|
271
|
-
return digitX2 > 9 ? digitX2 - 9 : digitX2;
|
|
272
|
-
}
|
|
273
|
-
return digit;
|
|
274
|
-
});
|
|
275
|
-
return !(arr.reduce(function (a, b) { return a + b; }, 0) % 10);
|
|
276
|
-
}
|
|
277
|
-
var tuiIsCardNumberValid = isCardNumberValid;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* @deprecated: use {@link tuiIsExpireValid} instead
|
|
281
|
-
*/
|
|
282
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
283
|
-
function isExpireValid(expire) {
|
|
284
|
-
var today = new Date();
|
|
285
|
-
var currentMonth = today.getMonth();
|
|
286
|
-
var currentYear = today.getFullYear() - 2000;
|
|
287
|
-
var month = parseInt(expire.slice(0, 2), 0);
|
|
288
|
-
var year = parseInt(expire.slice(-2), 0);
|
|
289
|
-
return year > currentYear || (year === currentYear && month >= currentMonth);
|
|
290
|
-
}
|
|
291
|
-
var tuiIsExpireValid = isExpireValid;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Generated bundle index. Do not edit.
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
export { formatCurrency, getCurrencySymbol, getPaymentSystem, isCardLengthValid, isCardNumberValid, isElectron, isExpireValid, isMaestro, isMastercard, isMir, isVisa, tuiCreateAutoCorrectedExpirePipe, tuiFormatCurrency, tuiGetCurrencySymbol, tuiGetPaymentSystem, tuiIsCardLengthValid, tuiIsCardNumberValid, tuiIsElectron, tuiIsExpireValid, tuiIsMaestro, tuiIsMastercard, tuiIsMir, tuiIsVisa };
|
|
298
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = `${rawValue.slice(0, 2)}/${rawValue.slice(5)}`;\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.slice(2) : ''\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = '/';\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = '0';\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\n/**\n * @deprecated: use {@link tuiGetCurrencySymbol} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return '₽';\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n case TuiCurrency.MexicanPeso:\n case TuiCurrencyCode.MexicanPeso:\n return '$';\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return 'S$';\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return 'A$';\n case TuiCurrency.HongKongDollar:\n case TuiCurrencyCode.HongKongDollar:\n return 'HK$';\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return 'C$';\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return '€';\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return '£';\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return '฿';\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return '₺';\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return 'CN¥';\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return '¥';\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return '₪';\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return '₹';\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return '₣';\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return '֏';\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return '₩';\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return '₸';\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return '₴';\n default:\n return null;\n }\n}\n\nexport const tuiGetCurrencySymbol = getCurrencySymbol;\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\n/**\n * @deprecated: use {@link tuiFormatCurrency} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nexport const tuiFormatCurrency = formatCurrency;\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === 'string'\n ? currency || ''\n : padStart(String(currency), 3, '0');\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\n/**\n * @deprecated: use {@link tuiGetPaymentSystem} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === '') {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.slice(0, 2), 10);\n const three = Number.parseInt(cardNumber.slice(0, 3), 10);\n const four = Number.parseInt(cardNumber.slice(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport const tuiGetPaymentSystem = getPaymentSystem;\n\n/**\n * @deprecated: use {@link tuiIsMaestro} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport const tuiIsMaestro = isMaestro;\n\n/**\n * @deprecated: use {@link tuiIsMastercard} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport const tuiIsMastercard = isMastercard;\n\n/**\n * @deprecated: use {@link tuiIsMir} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport const tuiIsMir = isMir;\n\n/**\n * @deprecated: use {@link tuiIsElectron} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport const tuiIsElectron = isElectron;\n\n/**\n * @deprecated: use {@link tuiIsVisa} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n\nexport const tuiIsVisa = isVisa;\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * @deprecated: use {@link tuiIsCardLengthValid} instead\n * Validates card number length using payment system dictionary\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n\nexport const tuiIsCardLengthValid = isCardLengthValid;\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * @deprecated: use {@link tuiIsCardNumberValid} instead\n * Validates card number using Luhn algorithm\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');\n\n const {length} = cardNumber;\n const arr = cardNumber.split('').map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n\nexport const tuiIsCardNumberValid = isCardNumberValid;\n","/**\n * @deprecated: use {@link tuiIsExpireValid} instead\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n\nexport const tuiIsExpireValid = isExpireValid;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,IAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,UAAC,cAAc,EAAE,EAAU;YAAT,sBAAQ;;QAE7B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,SAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;SACnE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,UAAC,EAAQ;oBAAP,kBAAM;gBAAM,OAAA,MAAM,KAAK,CAAC;aAAA,CAAC,CAAC;YAEpD,cAAc,GAAG,KAAG,GAAG,CAA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G,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF,CAAC;IAEY,gBAAgB,GAAG;;ACdhC;;;;;;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { isExpireValid, isCardNumberValid } from '@taiga-ui/addon-commerce/utils';
|
|
2
|
-
import { TuiValidationError } from '@taiga-ui/cdk';
|
|
3
|
-
|
|
4
|
-
function tuiCardExpireValidator(_a) {
|
|
5
|
-
var value = _a.value;
|
|
6
|
-
var _b;
|
|
7
|
-
return ((_b = value === null || value === void 0 ? void 0 : value.expire) === null || _b === void 0 ? void 0 : _b.length) === 5 && !isExpireValid(value === null || value === void 0 ? void 0 : value.expire)
|
|
8
|
-
? { expire: new TuiValidationError('Expire date') }
|
|
9
|
-
: null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function tuiCardNumberValidator(_a) {
|
|
13
|
-
var value = _a.value;
|
|
14
|
-
return (value === null || value === void 0 ? void 0 : value.card) && !isCardNumberValid(value.card)
|
|
15
|
-
? { card: new TuiValidationError('Invalid card number') }
|
|
16
|
-
: null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function tuiCreateLuhnValidator(message) {
|
|
20
|
-
return function (_a) {
|
|
21
|
-
var value = _a.value;
|
|
22
|
-
return isCardNumberValid(value) ? null : { luhn: new TuiValidationError(message) };
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Generated bundle index. Do not edit.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
export { tuiCardExpireValidator, tuiCardNumberValidator, tuiCreateLuhnValidator };
|
|
31
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-validators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-validators.js","sources":["ng://@taiga-ui/addon-commerce/validators/card-expire.validator.ts","ng://@taiga-ui/addon-commerce/validators/card-number.validator.ts","ng://@taiga-ui/addon-commerce/validators/luhn.validator.ts","ng://@taiga-ui/addon-commerce/validators/taiga-ui-addon-commerce-validators.ts"],"sourcesContent":["import {AbstractControl, ValidationErrors} from '@angular/forms';\nimport {isExpireValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\n\nexport function tuiCardExpireValidator({\n value,\n}: AbstractControl): ValidationErrors | null {\n return value?.expire?.length === 5 && !isExpireValid(value?.expire)\n ? {expire: new TuiValidationError('Expire date')}\n : null;\n}\n","import {AbstractControl, ValidationErrors} from '@angular/forms';\nimport {isCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\n\nexport function tuiCardNumberValidator({\n value,\n}: AbstractControl): ValidationErrors | null {\n return value?.card && !isCardNumberValid(value.card)\n ? {card: new TuiValidationError('Invalid card number')}\n : null;\n}\n","import {AbstractControl, ValidatorFn} from '@angular/forms';\nimport {isCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport function tuiCreateLuhnValidator(message: PolymorpheusContent): ValidatorFn {\n return ({value}: AbstractControl) => {\n return isCardNumberValid(value) ? null : {luhn: new TuiValidationError(message)};\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;SAIgB,sBAAsB,CAAC,EAErB;QADd,gBAAK;;IAEL,OAAO,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,MAAM,MAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC;UAC7D,EAAC,MAAM,EAAE,IAAI,kBAAkB,CAAC,aAAa,CAAC,EAAC;UAC/C,IAAI,CAAC;AACf;;SCNgB,sBAAsB,CAAC,EAErB;QADd,gBAAK;IAEL,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC;UAC9C,EAAC,IAAI,EAAE,IAAI,kBAAkB,CAAC,qBAAqB,CAAC,EAAC;UACrD,IAAI,CAAC;AACf;;SCLgB,sBAAsB,CAAC,OAA4B;IAC/D,OAAO,UAAC,EAAwB;YAAvB,gBAAK;QACV,OAAO,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAC,IAAI,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAC,CAAC;KACpF,CAAC;AACN;;ACTA;;;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from '@taiga-ui/addon-commerce/components';
|
|
2
|
-
export * from '@taiga-ui/addon-commerce/constants';
|
|
3
|
-
export * from '@taiga-ui/addon-commerce/enums';
|
|
4
|
-
export * from '@taiga-ui/addon-commerce/pipes';
|
|
5
|
-
export * from '@taiga-ui/addon-commerce/tokens';
|
|
6
|
-
export * from '@taiga-ui/addon-commerce/utils';
|
|
7
|
-
export * from '@taiga-ui/addon-commerce/validators';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Generated bundle index. Do not edit.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=taiga-ui-addon-commerce.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce.js","sources":["ng://@taiga-ui/addon-commerce/taiga-ui-addon-commerce.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiCard":{"__symbolic":"interface"}},"origins":{"TuiCard":"./card"},"importAs":"@taiga-ui/addon-commerce/interfaces"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiCurrencyPipeModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"TuiCurrencyPipe"}],"exports":[{"__symbolic":"reference","name":"TuiCurrencyPipe"}]}]}],"members":{}},"TuiCurrencyPipe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":4,"character":1},"arguments":[{"name":"tuiCurrency"}]}],"members":{"transform":[{"__symbolic":"method"}]}},"TuiFormatCardModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"TuiFormatCardPipe"}],"exports":[{"__symbolic":"reference","name":"TuiFormatCardPipe"}]}]}],"members":{}},"TuiFormatCardPipe":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":2,"character":1},"arguments":[{"name":"tuiFormatCard"}]}],"members":{"transform":[{"__symbolic":"method"}]}}},"origins":{"TuiCurrencyPipeModule":"./currency/currency.module","TuiCurrencyPipe":"./currency/currency.pipe","TuiFormatCardModule":"./format-card/format-card.module","TuiFormatCardPipe":"./format-card/format-card.pipe"},"importAs":"@taiga-ui/addon-commerce/pipes"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"exports":[{"from":"@taiga-ui/addon-commerce/components"},{"from":"@taiga-ui/addon-commerce/constants"},{"from":"@taiga-ui/addon-commerce/enums"},{"from":"@taiga-ui/addon-commerce/interfaces"},{"from":"@taiga-ui/addon-commerce/pipes"},{"from":"@taiga-ui/addon-commerce/tokens"},{"from":"@taiga-ui/addon-commerce/types"},{"from":"@taiga-ui/addon-commerce/utils"},{"from":"@taiga-ui/addon-commerce/validators"}],"metadata":{},"origins":{},"importAs":"@taiga-ui/addon-commerce"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TUI_CARD_NUMBER_TEXTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":41},"arguments":["Number and card number i18n",{"factory":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/i18n","name":"extractI18n","line":5,"character":13},"arguments":["cardNumber"]}}]},"TUI_CARD_EXPIRY_TEXTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":8,"character":41},"arguments":["Expiry and card expiry i18n",{"factory":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/i18n","name":"extractI18n","line":9,"character":13},"arguments":["cardExpiry"]}}]},"TUI_CARD_CVC_TEXTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":12,"character":38},"arguments":["Card CVC number text",{"__symbolic":"error","message":"Lambda not supported","line":15,"character":17,"module":"./i18n"}]}},"origins":{"TUI_CARD_NUMBER_TEXTS":"./i18n","TUI_CARD_EXPIRY_TEXTS":"./i18n","TUI_CARD_CVC_TEXTS":"./i18n"},"importAs":"@taiga-ui/addon-commerce/tokens"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiCodeCVCLength":{"__symbolic":"interface"},"TuiCurrencyAutocompletion":{"__symbolic":"interface"},"TuiCurrencyVariants":{"__symbolic":"interface"},"TuiMoneySignT":{"__symbolic":"interface"},"TuiMoneySignSymbol":{"__symbolic":"interface"}},"origins":{"TuiCodeCVCLength":"./code-length","TuiCurrencyAutocompletion":"./currency-variants","TuiCurrencyVariants":"./currency-variants","TuiMoneySignT":"./money-sign","TuiMoneySignSymbol":"./money-sign"},"importAs":"@taiga-ui/addon-commerce/types"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"tuiCreateAutoCorrectedExpirePipe":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":12,"character":11,"module":"./create-auto-corrected-expire-pipe"}},"formatCurrency":{"__symbolic":"function"},"tuiFormatCurrency":{"__symbolic":"reference","name":"formatCurrency"},"getCurrencySymbol":{"__symbolic":"function"},"tuiGetCurrencySymbol":{"__symbolic":"reference","name":"getCurrencySymbol"},"getPaymentSystem":{"__symbolic":"function"},"tuiGetPaymentSystem":{"__symbolic":"reference","name":"getPaymentSystem"},"isMaestro":{"__symbolic":"function"},"tuiIsMaestro":{"__symbolic":"reference","name":"isMaestro"},"isMastercard":{"__symbolic":"function"},"tuiIsMastercard":{"__symbolic":"reference","name":"isMastercard"},"isMir":{"__symbolic":"function","parameters":["four"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":">","left":{"__symbolic":"reference","name":"four"},"right":2199},"right":{"__symbolic":"binop","operator":"<","left":{"__symbolic":"reference","name":"four"},"right":2205}}},"tuiIsMir":{"__symbolic":"reference","name":"isMir"},"isElectron":{"__symbolic":"function"},"tuiIsElectron":{"__symbolic":"reference","name":"isElectron"},"isVisa":{"__symbolic":"function","parameters":["one"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"one"},"right":4}},"tuiIsVisa":{"__symbolic":"reference","name":"isVisa"},"isCardLengthValid":{"__symbolic":"function"},"tuiIsCardLengthValid":{"__symbolic":"reference","name":"isCardLengthValid"},"isCardNumberValid":{"__symbolic":"function"},"tuiIsCardNumberValid":{"__symbolic":"reference","name":"isCardNumberValid"},"isExpireValid":{"__symbolic":"function"},"tuiIsExpireValid":{"__symbolic":"reference","name":"isExpireValid"}},"origins":{"tuiCreateAutoCorrectedExpirePipe":"./create-auto-corrected-expire-pipe","formatCurrency":"./format-currency","tuiFormatCurrency":"./format-currency","getCurrencySymbol":"./get-currency-symbol","tuiGetCurrencySymbol":"./get-currency-symbol","getPaymentSystem":"./get-payment-system","tuiGetPaymentSystem":"./get-payment-system","isMaestro":"./get-payment-system","tuiIsMaestro":"./get-payment-system","isMastercard":"./get-payment-system","tuiIsMastercard":"./get-payment-system","isMir":"./get-payment-system","tuiIsMir":"./get-payment-system","isElectron":"./get-payment-system","tuiIsElectron":"./get-payment-system","isVisa":"./get-payment-system","tuiIsVisa":"./get-payment-system","isCardLengthValid":"./is-card-length-valid","tuiIsCardLengthValid":"./is-card-length-valid","isCardNumberValid":"./is-card-number-valid","tuiIsCardNumberValid":"./is-card-number-valid","isExpireValid":"./is-expire-valid","tuiIsExpireValid":"./is-expire-valid"},"importAs":"@taiga-ui/addon-commerce/utils"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"tuiCardExpireValidator":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"expire"},"member":"length"},"right":5},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/addon-commerce/utils","name":"isExpireValid","line":7,"character":43},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"expire"}]}}},"thenExpression":{"expire":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiValidationError","line":8,"character":23},"arguments":["Expire date"]}},"elseExpression":null}},"tuiCardNumberValidator":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"card"},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/addon-commerce/utils","name":"isCardNumberValid","line":7,"character":27},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"card"}]}}},"thenExpression":{"card":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiValidationError","line":8,"character":21},"arguments":["Invalid card number"]}},"elseExpression":null}},"tuiCreateLuhnValidator":{"__symbolic":"function","parameters":["message"],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./luhn.validator"}}},"origins":{"tuiCardExpireValidator":"./card-expire.validator","tuiCardNumberValidator":"./card-number.validator","tuiCreateLuhnValidator":"./luhn.validator"},"importAs":"@taiga-ui/addon-commerce/validators"}
|