@taiga-ui/addon-commerce 2.54.0 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +518 -387
- 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 +50 -37
- 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 +6 -7
- 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 +136 -112
- 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 +3 -3
- 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 -12
- 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 -211
- 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,19 +1,21 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, Pipe, Inject, Component, ChangeDetectionStrategy, Input, HostBinding, NgModule } from '@angular/core';
|
|
4
|
+
import { CHAR_MINUS, CHAR_PLUS, tuiDefaultProp } from '@taiga-ui/cdk';
|
|
5
|
+
import { formatNumber, TUI_NUMBER_FORMAT } from '@taiga-ui/core';
|
|
6
|
+
import * as i4 from '@taiga-ui/addon-commerce/pipes';
|
|
5
7
|
import { TuiCurrencyPipeModule } from '@taiga-ui/addon-commerce/pipes';
|
|
6
|
-
import {
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
7
9
|
|
|
8
10
|
const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS = {
|
|
9
|
-
decimal:
|
|
11
|
+
decimal: `not-zero`,
|
|
10
12
|
currency: "RUB" /* Ruble */,
|
|
11
|
-
sign:
|
|
13
|
+
sign: `negative-only`,
|
|
12
14
|
colored: false,
|
|
13
15
|
precision: 2,
|
|
14
16
|
singleColor: false,
|
|
15
17
|
};
|
|
16
|
-
const TUI_MONEY_OPTIONS = new InjectionToken(
|
|
18
|
+
const TUI_MONEY_OPTIONS = new InjectionToken(`Default parameters for money component`, {
|
|
17
19
|
factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,
|
|
18
20
|
});
|
|
19
21
|
const tuiMoneyOptionsProvider = (options) => ({
|
|
@@ -22,17 +24,76 @@ const tuiMoneyOptionsProvider = (options) => ({
|
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
function tuiFormatSignSymbol(value, sign) {
|
|
25
|
-
if (sign ===
|
|
26
|
-
return
|
|
27
|
+
if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {
|
|
28
|
+
return ``;
|
|
27
29
|
}
|
|
28
|
-
if (sign ===
|
|
29
|
-
|
|
30
|
-
return CHAR_EN_DASH;
|
|
30
|
+
if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {
|
|
31
|
+
return CHAR_MINUS;
|
|
31
32
|
}
|
|
32
33
|
return CHAR_PLUS;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
class TuiSignSymbolPipe {
|
|
37
|
+
transform(value, sign) {
|
|
38
|
+
return tuiFormatSignSymbol(value, sign);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
TuiSignSymbolPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
42
|
+
TuiSignSymbolPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, name: "tuiSignSymbol" });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiSignSymbolPipe, decorators: [{
|
|
44
|
+
type: Pipe,
|
|
45
|
+
args: [{ name: `tuiSignSymbol` }]
|
|
46
|
+
}] });
|
|
47
|
+
|
|
48
|
+
class TuiIntegerPartPipe {
|
|
49
|
+
constructor(numberFormat) {
|
|
50
|
+
this.numberFormat = numberFormat;
|
|
51
|
+
}
|
|
52
|
+
transform(value, precision) {
|
|
53
|
+
return formatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
TuiIntegerPartPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, deps: [{ token: TUI_NUMBER_FORMAT }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
57
|
+
TuiIntegerPartPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, name: "tuiIntegerPart" });
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiIntegerPartPipe, decorators: [{
|
|
59
|
+
type: Pipe,
|
|
60
|
+
args: [{ name: `tuiIntegerPart` }]
|
|
61
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
62
|
+
type: Inject,
|
|
63
|
+
args: [TUI_NUMBER_FORMAT]
|
|
64
|
+
}] }]; } });
|
|
65
|
+
|
|
66
|
+
function tuiFormatFractionPart(options) {
|
|
67
|
+
const { value, decimal, numberFormat, precision } = options;
|
|
68
|
+
const fraction = value.toFixed(precision).split(`.`)[1];
|
|
69
|
+
const shouldShow = decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));
|
|
70
|
+
return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
class TuiFractionPartPipe {
|
|
74
|
+
constructor(numberFormat) {
|
|
75
|
+
this.numberFormat = numberFormat;
|
|
76
|
+
}
|
|
77
|
+
transform(value, decimal, precision) {
|
|
78
|
+
return tuiFormatFractionPart({
|
|
79
|
+
value,
|
|
80
|
+
decimal,
|
|
81
|
+
precision,
|
|
82
|
+
numberFormat: this.numberFormat,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
TuiFractionPartPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, deps: [{ token: TUI_NUMBER_FORMAT }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
87
|
+
TuiFractionPartPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, name: "tuiFractionPart" });
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiFractionPartPipe, decorators: [{
|
|
89
|
+
type: Pipe,
|
|
90
|
+
args: [{ name: `tuiFractionPart` }]
|
|
91
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
92
|
+
type: Inject,
|
|
93
|
+
args: [TUI_NUMBER_FORMAT]
|
|
94
|
+
}] }]; } });
|
|
95
|
+
|
|
96
|
+
class TuiMoneyComponent {
|
|
36
97
|
constructor(options) {
|
|
37
98
|
this.options = options;
|
|
38
99
|
this.value = NaN;
|
|
@@ -48,135 +109,98 @@ let TuiMoneyComponent = class TuiMoneyComponent {
|
|
|
48
109
|
}
|
|
49
110
|
get red() {
|
|
50
111
|
return (this.colored &&
|
|
51
|
-
(this.signSymbol ===
|
|
52
|
-
(this.value < 0 && this.sign !==
|
|
112
|
+
(this.signSymbol === CHAR_MINUS ||
|
|
113
|
+
(this.value < 0 && this.sign !== `force-positive`)));
|
|
53
114
|
}
|
|
54
115
|
get green() {
|
|
55
116
|
return (this.colored &&
|
|
56
117
|
(this.signSymbol === CHAR_PLUS ||
|
|
57
|
-
(this.value > 0 && this.sign !==
|
|
118
|
+
(this.value > 0 && this.sign !== `force-negative`)));
|
|
58
119
|
}
|
|
59
120
|
get inheritColor() {
|
|
60
121
|
return this.singleColor || (this.value === 0 && this.colored);
|
|
61
122
|
}
|
|
62
|
-
}
|
|
63
|
-
TuiMoneyComponent
|
|
64
|
-
|
|
65
|
-
];
|
|
123
|
+
}
|
|
124
|
+
TuiMoneyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyComponent, deps: [{ token: TUI_MONEY_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
TuiMoneyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiMoneyComponent, selector: "tui-money", inputs: { value: "value", decimal: "decimal", currency: "currency", sign: "sign", colored: "colored", precision: "precision", singleColor: "singleColor" }, host: { properties: { "class._red": "this.red", "class._green": "this.green", "class._inherit-color": "this.inheritColor" } }, ngImport: i0, template: "<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n", styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}.t-currency:not(:empty){padding-left:.2rem}\n"], pipes: { "tuiSignSymbol": TuiSignSymbolPipe, "tuiIntegerPart": TuiIntegerPartPipe, "tuiFractionPart": TuiFractionPartPipe, "tuiCurrency": i4.TuiCurrencyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
66
126
|
__decorate([
|
|
67
|
-
Input(),
|
|
68
127
|
tuiDefaultProp()
|
|
69
128
|
], TuiMoneyComponent.prototype, "value", void 0);
|
|
70
129
|
__decorate([
|
|
71
|
-
Input(),
|
|
72
130
|
tuiDefaultProp()
|
|
73
131
|
], TuiMoneyComponent.prototype, "decimal", void 0);
|
|
74
132
|
__decorate([
|
|
75
|
-
Input(),
|
|
76
133
|
tuiDefaultProp()
|
|
77
134
|
], TuiMoneyComponent.prototype, "currency", void 0);
|
|
78
135
|
__decorate([
|
|
79
|
-
Input(),
|
|
80
136
|
tuiDefaultProp()
|
|
81
137
|
], TuiMoneyComponent.prototype, "sign", void 0);
|
|
82
138
|
__decorate([
|
|
83
|
-
Input(),
|
|
84
139
|
tuiDefaultProp()
|
|
85
140
|
], TuiMoneyComponent.prototype, "colored", void 0);
|
|
86
141
|
__decorate([
|
|
87
|
-
Input(),
|
|
88
142
|
tuiDefaultProp()
|
|
89
143
|
], TuiMoneyComponent.prototype, "precision", void 0);
|
|
90
144
|
__decorate([
|
|
91
|
-
Input(),
|
|
92
145
|
tuiDefaultProp()
|
|
93
146
|
], TuiMoneyComponent.prototype, "singleColor", void 0);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{
|
|
150
|
+
selector: `tui-money`,
|
|
151
|
+
templateUrl: `./money.template.html`,
|
|
152
|
+
styleUrls: [`./money.style.less`],
|
|
153
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
154
|
+
}]
|
|
155
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
156
|
+
type: Inject,
|
|
157
|
+
args: [TUI_MONEY_OPTIONS]
|
|
158
|
+
}] }]; }, propDecorators: { value: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], decimal: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}], currency: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], sign: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], colored: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], precision: [{
|
|
169
|
+
type: Input
|
|
170
|
+
}], singleColor: [{
|
|
171
|
+
type: Input
|
|
172
|
+
}], red: [{
|
|
173
|
+
type: HostBinding,
|
|
174
|
+
args: [`class._red`]
|
|
175
|
+
}], green: [{
|
|
176
|
+
type: HostBinding,
|
|
177
|
+
args: [`class._green`]
|
|
178
|
+
}], inheritColor: [{
|
|
179
|
+
type: HostBinding,
|
|
180
|
+
args: [`class._inherit-color`]
|
|
181
|
+
}] } });
|
|
112
182
|
|
|
113
|
-
|
|
114
|
-
const { value, decimal, numberFormat, precision } = options;
|
|
115
|
-
const fraction = value.toFixed(precision).split('.')[1];
|
|
116
|
-
const shouldShow = decimal !== 'never' && (decimal === 'always' || !!parseInt(fraction, 10));
|
|
117
|
-
return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : '';
|
|
183
|
+
class TuiMoneyModule {
|
|
118
184
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
]
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
__param(0, Inject(TUI_NUMBER_FORMAT))
|
|
139
|
-
], TuiFractionPartPipe);
|
|
140
|
-
|
|
141
|
-
let TuiIntegerPartPipe = class TuiIntegerPartPipe {
|
|
142
|
-
constructor(numberFormat) {
|
|
143
|
-
this.numberFormat = numberFormat;
|
|
144
|
-
}
|
|
145
|
-
transform(value, precision) {
|
|
146
|
-
return formatNumber(Math.floor(Math.abs(Number(value.toFixed(precision)))), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
TuiIntegerPartPipe.ctorParameters = () => [
|
|
150
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
|
|
151
|
-
];
|
|
152
|
-
TuiIntegerPartPipe = __decorate([
|
|
153
|
-
Pipe({ name: 'tuiIntegerPart' }),
|
|
154
|
-
__param(0, Inject(TUI_NUMBER_FORMAT))
|
|
155
|
-
], TuiIntegerPartPipe);
|
|
156
|
-
|
|
157
|
-
let TuiSignSymbolPipe = class TuiSignSymbolPipe {
|
|
158
|
-
transform(value, sign) {
|
|
159
|
-
return tuiFormatSignSymbol(value, sign);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
TuiSignSymbolPipe = __decorate([
|
|
163
|
-
Pipe({ name: 'tuiSignSymbol' })
|
|
164
|
-
], TuiSignSymbolPipe);
|
|
165
|
-
|
|
166
|
-
let TuiMoneyModule = class TuiMoneyModule {
|
|
167
|
-
};
|
|
168
|
-
TuiMoneyModule = __decorate([
|
|
169
|
-
NgModule({
|
|
170
|
-
imports: [CommonModule, TuiCurrencyPipeModule],
|
|
171
|
-
declarations: [
|
|
172
|
-
TuiMoneyComponent,
|
|
173
|
-
TuiFractionPartPipe,
|
|
174
|
-
TuiIntegerPartPipe,
|
|
175
|
-
TuiSignSymbolPipe,
|
|
176
|
-
],
|
|
177
|
-
exports: [TuiMoneyComponent],
|
|
178
|
-
})
|
|
179
|
-
], TuiMoneyModule);
|
|
185
|
+
TuiMoneyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
186
|
+
TuiMoneyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, declarations: [TuiMoneyComponent,
|
|
187
|
+
TuiFractionPartPipe,
|
|
188
|
+
TuiIntegerPartPipe,
|
|
189
|
+
TuiSignSymbolPipe], imports: [CommonModule, TuiCurrencyPipeModule], exports: [TuiMoneyComponent] });
|
|
190
|
+
TuiMoneyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, imports: [[CommonModule, TuiCurrencyPipeModule]] });
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiMoneyModule, decorators: [{
|
|
192
|
+
type: NgModule,
|
|
193
|
+
args: [{
|
|
194
|
+
imports: [CommonModule, TuiCurrencyPipeModule],
|
|
195
|
+
declarations: [
|
|
196
|
+
TuiMoneyComponent,
|
|
197
|
+
TuiFractionPartPipe,
|
|
198
|
+
TuiIntegerPartPipe,
|
|
199
|
+
TuiSignSymbolPipe,
|
|
200
|
+
],
|
|
201
|
+
exports: [TuiMoneyComponent],
|
|
202
|
+
}]
|
|
203
|
+
}] });
|
|
180
204
|
|
|
181
205
|
/**
|
|
182
206
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money-options.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-sign-symbol.ts","ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/utils/format-fraction-part.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/fraction-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/integer-part.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimalT;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySignT;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: 'not-zero',\n currency: TuiCurrency.Ruble,\n sign: 'negative-only',\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n 'Default parameters for money component',\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySignT,\n): TuiMoneySignSymbol {\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n /** TODO(nsbarsukov): investigate if it should be replaced by {@link CHAR_HYPHEN} */\n return CHAR_EN_DASH;\n }\n\n return CHAR_PLUS;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySignSymbol,\n TuiMoneySignT,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: 'tui-money',\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","import {TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimalT;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split('.')[1];\n const shouldShow =\n decimal !== 'never' && (decimal === 'always' || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : '';\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimalT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: 'tuiFractionPart'})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimalT, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: 'tuiIntegerPart'})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySignSymbol, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: 'tuiSignSymbol'})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySignT): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,iCAAiC,GAAoB;IAC9D,OAAO,EAAE,UAAU;IACnB,QAAQ;IACR,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,KAAK;EACpB;MAEW,iBAAiB,GAAG,IAAI,cAAc,CAC/C,wCAAwC,EACxC;IACI,OAAO,EAAE,MAAM,iCAAiC;CAC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kB,CAa9B;;ICXY,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,SAAS,CAAC,KAAa,EAAE,IAAmB;QACxC,OAAO,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC3C;EACJ;AAJY,iBAAiB;IAD7B,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;GACjB,iBAAiB,CAI7B;;ICSY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAV1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;QAC9C,YAAY,EAAE;YACV,iBAAiB;YACjB,mBAAmB;YACnB,kBAAkB;YAClB,iBAAiB;SACpB;QACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACnB9B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["../../../projects/addon-commerce/components/money/money-options.ts","../../../projects/addon-commerce/components/money/utils/format-sign-symbol.ts","../../../projects/addon-commerce/components/money/pipes/sign-symbol.pipe.ts","../../../projects/addon-commerce/components/money/pipes/integer-part.pipe.ts","../../../projects/addon-commerce/components/money/utils/format-fraction-part.ts","../../../projects/addon-commerce/components/money/pipes/fraction-part.pipe.ts","../../../projects/addon-commerce/components/money/money.component.ts","../../../projects/addon-commerce/components/money/money.template.html","../../../projects/addon-commerce/components/money/money.module.ts","../../../projects/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySign} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimal} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimal;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySign;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: `not-zero`,\n currency: TuiCurrency.Ruble,\n sign: `negative-only`,\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n `Default parameters for money component`,\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {TuiMoneySign, TuiMoneySignSymbol} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS} from '@taiga-ui/cdk';\n\nexport function tuiFormatSignSymbol(\n value: number,\n sign: TuiMoneySign,\n): TuiMoneySignSymbol {\n if (sign === `never` || !value || (sign === `negative-only` && value > 0)) {\n return ``;\n }\n\n if (sign === `force-negative` || (value < 0 && sign !== `force-positive`)) {\n return CHAR_MINUS;\n }\n\n return CHAR_PLUS;\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiMoneySign, TuiMoneySignSymbol} from '@taiga-ui/addon-commerce/types';\n\nimport {tuiFormatSignSymbol} from '../utils/format-sign-symbol';\n\n@Pipe({name: `tuiSignSymbol`})\nexport class TuiSignSymbolPipe implements PipeTransform {\n transform(value: number, sign: TuiMoneySign): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(value, sign);\n }\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {formatNumber, TUI_NUMBER_FORMAT, TuiNumberFormatSettings} from '@taiga-ui/core';\n\n@Pipe({name: `tuiIntegerPart`})\nexport class TuiIntegerPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, precision: number): string {\n return formatNumber(\n Math.floor(Math.abs(Number(value.toFixed(precision)))),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {TuiDecimal, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nexport function tuiFormatFractionPart(options: {\n value: number;\n decimal: TuiDecimal;\n precision: number;\n numberFormat: TuiNumberFormatSettings;\n}): string {\n const {value, decimal, numberFormat, precision} = options;\n const fraction = value.toFixed(precision).split(`.`)[1];\n const shouldShow =\n decimal !== `never` && (decimal === `always` || !!parseInt(fraction, 10));\n\n return shouldShow ? `${numberFormat.decimalSeparator}${fraction}` : ``;\n}\n","import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {TUI_NUMBER_FORMAT, TuiDecimal, TuiNumberFormatSettings} from '@taiga-ui/core';\n\nimport {tuiFormatFractionPart} from '../utils/format-fraction-part';\n\n@Pipe({name: `tuiFractionPart`})\nexport class TuiFractionPartPipe implements PipeTransform {\n constructor(\n @Inject(TUI_NUMBER_FORMAT) private readonly numberFormat: TuiNumberFormatSettings,\n ) {}\n\n transform(value: number, decimal: TuiDecimal, precision: number): string {\n return tuiFormatFractionPart({\n value,\n decimal,\n precision,\n numberFormat: this.numberFormat,\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n TuiCurrencyVariants,\n TuiMoneySign,\n TuiMoneySignSymbol,\n} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_MINUS, CHAR_PLUS, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDecimal} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\nimport {tuiFormatSignSymbol} from './utils/format-sign-symbol';\n\n@Component({\n selector: `tui-money`,\n templateUrl: `./money.template.html`,\n styleUrls: [`./money.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimal = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySign = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get signSymbol(): TuiMoneySignSymbol {\n return tuiFormatSignSymbol(this.value, this.sign);\n }\n\n @HostBinding(`class._red`)\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_MINUS ||\n (this.value < 0 && this.sign !== `force-positive`))\n );\n }\n\n @HostBinding(`class._green`)\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_PLUS ||\n (this.value > 0 && this.sign !== `force-negative`))\n );\n }\n\n @HostBinding(`class._inherit-color`)\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(@Inject(TUI_MONEY_OPTIONS) private readonly options: TuiMoneyOptions) {}\n}\n","<span\n automation-id=\"tui-money__sign\"\n [textContent]=\"value | tuiSignSymbol: sign\"\n></span>\n<span\n automation-id=\"tui-money__integer-part\"\n [textContent]=\"value | tuiIntegerPart: precision\"\n></span>\n<span class=\"t-lighter\">\n <span\n automation-id=\"tui-money__fraction-part\"\n [textContent]=\"value | tuiFractionPart: decimal:precision\"\n ></span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\nimport {TuiFractionPartPipe} from './pipes/fraction-part.pipe';\nimport {TuiIntegerPartPipe} from './pipes/integer-part.pipe';\nimport {TuiSignSymbolPipe} from './pipes/sign-symbol.pipe';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [\n TuiMoneyComponent,\n TuiFractionPartPipe,\n TuiIntegerPartPipe,\n TuiSignSymbolPipe,\n ],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TuiSignSymbolPipe","i2.TuiIntegerPartPipe","i3.TuiFractionPartPipe"],"mappings":";;;;;;;;;AAca,MAAA,iCAAiC,GAAoB;AAC9D,IAAA,OAAO,EAAE,CAAU,QAAA,CAAA;AACnB,IAAA,QAAQ,EAAmB,KAAA;AAC3B,IAAA,IAAI,EAAE,CAAe,aAAA,CAAA;AACrB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,WAAW,EAAE,KAAK;EACpB;MAEW,iBAAiB,GAAG,IAAI,cAAc,CAC/C,wCAAwC,EACxC;AACI,IAAA,OAAO,EAAE,MAAM,iCAAiC;AACnD,CAAA,EACH;MAEW,uBAAuB,GAEf,CAAC,OAAiC,MAAM;AACzD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,QAAQ,EAAM,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,iCAAiC,CAAK,EAAA,OAAO,CAAC;AAC/D,CAAA;;AChCe,SAAA,mBAAmB,CAC/B,KAAa,EACb,IAAkB,EAAA;AAElB,IAAA,IAAI,IAAI,KAAK,CAAA,KAAA,CAAO,IAAI,CAAC,KAAK,KAAK,IAAI,KAAK,eAAe,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;AACvE,QAAA,OAAO,EAAE,CAAC;AACb,KAAA;AAED,IAAA,IAAI,IAAI,KAAK,CAAgB,cAAA,CAAA,KAAK,KAAK,GAAG,CAAC,IAAI,IAAI,KAAK,CAAA,cAAA,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WAAW;uBAAC,CAAc,YAAA,CAAA,CAAA;gBAUvB,YAAY,EAAA,CAAA;sBADf,WAAW;uBAAC,CAAsB,oBAAA,CAAA,CAAA;;;MExD1B,cAAc,CAAA;;4GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,iBAPnB,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;AAClB,QAAA,iBAAiB,CALX,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,qBAAqB,aAOnC,iBAAiB,CAAA,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":["
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components.js","sources":["../../../projects/addon-commerce/components/taiga-ui-addon-commerce-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { tuiCreateCorrectionMask, TUI_DIGIT_REGEXP } from '@taiga-ui/core';
|
|
2
|
-
import {
|
|
2
|
+
import { tuiIsCardLengthValid, tuiIsCardNumberValid } from '@taiga-ui/addon-commerce/utils';
|
|
3
3
|
|
|
4
4
|
const ALLOWED_REGEXP = /[A-Z]| /;
|
|
5
5
|
const MAP = {
|
|
6
|
-
А:
|
|
7
|
-
В:
|
|
8
|
-
Г:
|
|
9
|
-
Д:
|
|
10
|
-
Е:
|
|
11
|
-
З:
|
|
12
|
-
И:
|
|
13
|
-
Й:
|
|
14
|
-
К:
|
|
15
|
-
Л:
|
|
16
|
-
М:
|
|
17
|
-
Н:
|
|
18
|
-
О:
|
|
19
|
-
П:
|
|
20
|
-
Р:
|
|
21
|
-
С:
|
|
22
|
-
Т:
|
|
23
|
-
У:
|
|
24
|
-
Ф:
|
|
25
|
-
Ц:
|
|
26
|
-
Ч:
|
|
27
|
-
Ш:
|
|
28
|
-
Щ:
|
|
29
|
-
Ы:
|
|
30
|
-
Ь:
|
|
31
|
-
Я:
|
|
6
|
+
А: `F`,
|
|
7
|
+
В: `D`,
|
|
8
|
+
Г: `U`,
|
|
9
|
+
Д: `L`,
|
|
10
|
+
Е: `T`,
|
|
11
|
+
З: `P`,
|
|
12
|
+
И: `B`,
|
|
13
|
+
Й: `Q`,
|
|
14
|
+
К: `R`,
|
|
15
|
+
Л: `K`,
|
|
16
|
+
М: `V`,
|
|
17
|
+
Н: `Y`,
|
|
18
|
+
О: `J`,
|
|
19
|
+
П: `G`,
|
|
20
|
+
Р: `H`,
|
|
21
|
+
С: `C`,
|
|
22
|
+
Т: `N`,
|
|
23
|
+
У: `E`,
|
|
24
|
+
Ф: `A`,
|
|
25
|
+
Ц: `W`,
|
|
26
|
+
Ч: `X`,
|
|
27
|
+
Ш: `I`,
|
|
28
|
+
Щ: `O`,
|
|
29
|
+
Ы: `S`,
|
|
30
|
+
Ь: `M`,
|
|
31
|
+
Я: `Z`,
|
|
32
32
|
};
|
|
33
33
|
function toEnglishUppercase(char) {
|
|
34
34
|
const uppercase = char.toUpperCase();
|
|
@@ -45,28 +45,28 @@ const TUI_CARD_MASK = [
|
|
|
45
45
|
TUI_DIGIT_REGEXP,
|
|
46
46
|
TUI_DIGIT_REGEXP,
|
|
47
47
|
TUI_DIGIT_REGEXP,
|
|
48
|
-
|
|
48
|
+
` `,
|
|
49
49
|
TUI_DIGIT_REGEXP,
|
|
50
50
|
TUI_DIGIT_REGEXP,
|
|
51
51
|
TUI_DIGIT_REGEXP,
|
|
52
52
|
TUI_DIGIT_REGEXP,
|
|
53
|
-
|
|
53
|
+
` `,
|
|
54
54
|
TUI_DIGIT_REGEXP,
|
|
55
55
|
TUI_DIGIT_REGEXP,
|
|
56
56
|
TUI_DIGIT_REGEXP,
|
|
57
57
|
TUI_DIGIT_REGEXP,
|
|
58
|
-
|
|
58
|
+
` `,
|
|
59
59
|
TUI_DIGIT_REGEXP,
|
|
60
60
|
TUI_DIGIT_REGEXP,
|
|
61
61
|
TUI_DIGIT_REGEXP,
|
|
62
62
|
TUI_DIGIT_REGEXP,
|
|
63
|
-
|
|
63
|
+
` `,
|
|
64
64
|
TUI_DIGIT_REGEXP,
|
|
65
65
|
TUI_DIGIT_REGEXP,
|
|
66
66
|
TUI_DIGIT_REGEXP,
|
|
67
67
|
];
|
|
68
68
|
|
|
69
|
-
const tuiDefaultCardValidator = card => card.length > 11 &&
|
|
69
|
+
const tuiDefaultCardValidator = card => card.length > 11 && tuiIsCardLengthValid(card) && tuiIsCardNumberValid(card);
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-constants.js","sources":["
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-constants.js","sources":["../../../projects/addon-commerce/constants/card-holder-mask.ts","../../../projects/addon-commerce/constants/card-mask.ts","../../../projects/addon-commerce/constants/default-card-validator.ts","../../../projects/addon-commerce/constants/taiga-ui-addon-commerce-constants.ts"],"sourcesContent":["import {tuiCreateCorrectionMask, TuiTextMaskListHandler} from '@taiga-ui/core';\n\nconst ALLOWED_REGEXP = /[A-Z]| /;\nconst MAP: Record<string, string> = {\n А: `F`,\n В: `D`,\n Г: `U`,\n Д: `L`,\n Е: `T`,\n З: `P`,\n И: `B`,\n Й: `Q`,\n К: `R`,\n Л: `K`,\n М: `V`,\n Н: `Y`,\n О: `J`,\n П: `G`,\n Р: `H`,\n С: `C`,\n Т: `N`,\n У: `E`,\n Ф: `A`,\n Ц: `W`,\n Ч: `X`,\n Ш: `I`,\n Щ: `O`,\n Ы: `S`,\n Ь: `M`,\n Я: `Z`,\n};\n\nfunction toEnglishUppercase(char: string): string | null {\n const uppercase = char.toUpperCase();\n const result = ALLOWED_REGEXP.test(uppercase) ? uppercase : MAP[uppercase];\n\n return result || null;\n}\n\nexport const cardHolderMask: TuiTextMaskListHandler = tuiCreateCorrectionMask(\n ALLOWED_REGEXP,\n toEnglishUppercase,\n);\n","import {TUI_DIGIT_REGEXP} from '@taiga-ui/core';\n\n/**\n * @internal\n */\nexport const TUI_CARD_MASK = [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ` `,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n];\n","import {tuiIsCardLengthValid, tuiIsCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiBooleanHandler} from '@taiga-ui/cdk';\n\nexport const tuiDefaultCardValidator: TuiBooleanHandler<string> = card =>\n card.length > 11 && tuiIsCardLengthValid(card) && tuiIsCardNumberValid(card);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,GAAG,GAA2B;AAChC,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AACN,IAAA,CAAC,EAAE,CAAG,CAAA,CAAA;AAC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|
TuiCurrencyCode["HongKongDollar"] = "344";
|
|
310
|
-
/**
|
|
311
|
-
* @deprecated
|
|
312
|
-
* TODO: 3.0 replace with {@link HongKongDollar}
|
|
313
|
-
*/
|
|
314
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
315
|
-
TuiCurrencyCode["HongKong_dollar"] = "344";
|
|
316
310
|
/**
|
|
317
311
|
* Canadian dollar
|
|
318
312
|
*
|
|
@@ -340,36 +334,9 @@ var TuiCurrencyCode;
|
|
|
340
334
|
TuiCurrencyCode["MexicanPeso"] = "484";
|
|
341
335
|
})(TuiCurrencyCode || (TuiCurrencyCode = {}));
|
|
342
336
|
|
|
343
|
-
/**
|
|
344
|
-
* negative-only — show sign only for negative numbers
|
|
345
|
-
* always — always show sign, except for zero
|
|
346
|
-
* never — never show sign
|
|
347
|
-
* force-negative — show minus no matter the number, except for zero
|
|
348
|
-
* force-positive — show plus no matter the number, except for zero
|
|
349
|
-
* @deprecated use join type {@link TuiMoneySignT}
|
|
350
|
-
* TODO: delete in v3.0
|
|
351
|
-
*/
|
|
352
|
-
var TuiMoneySign;
|
|
353
|
-
(function (TuiMoneySign) {
|
|
354
|
-
TuiMoneySign["NegativeOnly"] = "negative-only";
|
|
355
|
-
TuiMoneySign["Always"] = "always";
|
|
356
|
-
TuiMoneySign["Never"] = "never";
|
|
357
|
-
TuiMoneySign["ForceNegative"] = "force-negative";
|
|
358
|
-
TuiMoneySign["ForcePositive"] = "force-positive";
|
|
359
|
-
})(TuiMoneySign || (TuiMoneySign = {}));
|
|
360
|
-
|
|
361
|
-
var TuiPaymentSystem;
|
|
362
|
-
(function (TuiPaymentSystem) {
|
|
363
|
-
TuiPaymentSystem["Visa"] = "visa";
|
|
364
|
-
TuiPaymentSystem["Electron"] = "electron";
|
|
365
|
-
TuiPaymentSystem["Mastercard"] = "mastercard";
|
|
366
|
-
TuiPaymentSystem["Maestro"] = "maestro";
|
|
367
|
-
TuiPaymentSystem["Mir"] = "mir";
|
|
368
|
-
})(TuiPaymentSystem || (TuiPaymentSystem = {}));
|
|
369
|
-
|
|
370
337
|
/**
|
|
371
338
|
* Generated bundle index. Do not edit.
|
|
372
339
|
*/
|
|
373
340
|
|
|
374
|
-
export { TuiCurrency, TuiCurrencyCode
|
|
341
|
+
export { TuiCurrency, TuiCurrencyCode };
|
|
375
342
|
//# sourceMappingURL=taiga-ui-addon-commerce-enums.js.map
|