@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card-grouped.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.providers.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.module.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.ts"],"sourcesContent":["import {inject, InjectionToken} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n TUI_CARD_CVC_TEXTS,\n TUI_CARD_EXPIRY_TEXTS,\n TUI_CARD_NUMBER_TEXTS,\n} from '@taiga-ui/addon-commerce/tokens';\nimport {typedFromEvent} from '@taiga-ui/cdk';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport {combineLatest, Observable, of} from 'rxjs';\nimport {map, startWith, switchMap} from 'rxjs/operators';\n\nexport interface TuiCardGroupedTexts {\n readonly cardNumberText: string;\n readonly expiryText: string;\n readonly cvcText: string;\n}\n\nexport const TUI_INPUT_CARD_GROUPED_TEXTS = new InjectionToken<\n Observable<TuiCardGroupedTexts>\n>('InputCardGrouped texts', {\n factory: () =>\n inputGroupedTextsFactory(\n inject(WINDOW),\n inject(TUI_CARD_NUMBER_TEXTS),\n inject(TUI_CARD_EXPIRY_TEXTS),\n inject(TUI_CARD_CVC_TEXTS),\n inject(TUI_MEDIA),\n ),\n});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inputGroupedTextsFactory(\n windowRef: Window,\n cardNumberTexts: Observable<[string, string]>,\n expiryTexts: Observable<[string, string]>,\n cvcTexts: Observable<[string, string]>,\n {desktopSmall}: TuiMedia,\n): Observable<TuiCardGroupedTexts> {\n const media = windowRef.matchMedia(\n `screen and (min-width: ${(desktopSmall - 1) / 16}em)`,\n );\n\n return typedFromEvent(media, 'change').pipe(\n startWith(null),\n switchMap(() =>\n combineLatest([\n of(Number(media.matches)),\n cardNumberTexts,\n expiryTexts,\n cvcTexts,\n ]),\n ),\n map(([index, cardNumber, expiry, cvcTexts]) => ({\n cardNumberText: cardNumber[index],\n expiryText: expiry[index],\n cvcText: cvcTexts[index],\n })),\n );\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK, tuiDefaultCardValidator} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCard} from '@taiga-ui/addon-commerce/interfaces';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n getPaymentSystem,\n tuiCreateAutoCorrectedExpirePipe,\n} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiNullableControl,\n isNativeFocused,\n isNativeFocusedIn,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiAssertIsHTMLElement,\n TuiBooleanHandler,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiPure,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n MODE_PROVIDER,\n TUI_DATA_LIST_HOST,\n TUI_DIGIT_REGEXP,\n TUI_MODE,\n TUI_NON_DIGIT_REGEXP,\n TUI_TEXTFIELD_APPEARANCE,\n TuiBrightness,\n TuiDataListComponent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskConfig} from 'angular2-text-mask';\nimport {Observable} from 'rxjs';\n\nimport {\n TUI_INPUT_CARD_GROUPED_TEXTS,\n TuiCardGroupedTexts,\n} from './input-card-grouped.providers';\n\nconst STUB: TuiCard = {\n card: '',\n expire: '',\n cvc: '',\n};\nconst ICONS = {\n [TuiPaymentSystem.Mir]: 'tuiIconMir',\n [TuiPaymentSystem.Visa]: 'tuiIconVisa',\n [TuiPaymentSystem.Electron]: 'tuiIconElectron',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n// @dynamic\n@Component({\n selector: 'tui-input-card-grouped',\n templateUrl: './input-card-grouped.template.html',\n styleUrls: ['./input-card-grouped.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n ],\n host: {\n '($.data-mode.attr)': 'mode$',\n 'data-size': 'l',\n },\n})\nexport class TuiInputCardGroupedComponent\n extends AbstractTuiNullableControl<TuiCard>\n implements TuiFocusableElementAccessor, TuiDataListHost<Partial<TuiCard>>\n{\n @ViewChild('inputCard')\n private readonly inputCard?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputExpire')\n private readonly inputExpire?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputCVC')\n private readonly inputCVC?: ElementRef<HTMLInputElement>;\n\n private expireInert = false;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: PolymorpheusContent | null = null; // TODO: 3.0 will be deleted `null` in v3.0\n\n @Input()\n @tuiDefaultProp()\n exampleText = '0000 0000 0000 0000';\n\n @Input()\n @tuiDefaultProp()\n cardValidator: TuiBooleanHandler<string> = tuiDefaultCardValidator;\n\n @Input()\n @tuiRequiredSetter()\n set codeLength(length: TuiCodeCVCLength) {\n this.exampleTextCVC = '0'.repeat(length);\n this.maskCVC = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n @Output()\n readonly autofilledChange = new EventEmitter<boolean>();\n\n @Output()\n readonly binChange = new EventEmitter<string | null>();\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly dropdown: PolymorpheusContent = '';\n\n @ContentChild(TuiDataListComponent)\n readonly datalist?: TuiDataListComponent<TuiCard>;\n\n exampleTextCVC = '000';\n\n maskCVC: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n readonly maskCard: TextMaskConfig = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n readonly maskExpire: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n '/',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_INPUT_CARD_GROUPED_TEXTS)\n readonly cardGroupedTexts$: Observable<TuiCardGroupedTexts>,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.inputCard ? this.inputCard.nativeElement : null;\n }\n\n get focused(): boolean {\n return this.open || isNativeFocusedIn(this.elementRef.nativeElement);\n }\n\n get card(): string {\n return this.value?.card ?? '';\n }\n\n get expire(): string {\n return this.value?.expire ?? '';\n }\n\n get cvc(): string {\n return this.value?.cvc ?? '';\n }\n\n get hasCleaner(): boolean {\n return !!this.value?.card?.trim() && !this.readOnly && !this.computedDisabled;\n }\n\n get hasDropdown(): boolean {\n return !!this.dropdown;\n }\n\n get defaultIcon(): string | null {\n const {paymentSystem} = this;\n\n return paymentSystem && ICONS[paymentSystem];\n }\n\n get icon(): PolymorpheusContent | null {\n return this.cardSrc ?? this.defaultIcon;\n }\n\n get bin(): string | null {\n return !this.value || this.value.card.length < 6\n ? null\n : this.value.card.slice(0, 6);\n }\n\n get placeholderRaised(): boolean {\n return (this.computedFocused && !this.readOnly) || this.hasCardNumber;\n }\n\n get hasCardNumber(): boolean {\n return !!this.value?.card?.trim();\n }\n\n get idCard(): string {\n return `${this.id}_card`;\n }\n\n get idExpire(): string {\n return `${this.id}_expire`;\n }\n\n get idCVC(): string {\n return `${this.id}_cvc`;\n }\n\n get isCardCollapsed(): boolean {\n return this.isFocusable(this.card) && !this.cardFocused;\n }\n\n get autocompleteCard(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcNumber\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteExpire(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteCVC(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n // Safari expiration date autofill workaround\n get name(): 'ccexpiryyear' | null {\n return this.autocompleteEnabled ? 'ccexpiryyear' : null;\n }\n\n get cardPrefilled(): boolean {\n return !!this.card.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cvcPrefilled(): boolean {\n return !!this.cvc.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cardFocusable(): boolean {\n return this.focusable && !this.cardPrefilled;\n }\n\n get expireFocusable(): boolean {\n return this.isFocusable(this.card) && !this.expireInert;\n }\n\n get cvcFocusable(): boolean {\n return this.isFocusable(this.card);\n }\n\n get masked(): string {\n return this.cardPrefilled ? `*${this.card.slice(-4)}` : '*';\n }\n\n @HostListener('keydown.esc')\n onEsc(): void {\n this.open = false;\n }\n\n @HostListener('keydown.arrowDown.prevent', ['$event.target', '1'])\n @HostListener('keydown.arrowUp.prevent', ['$event.target', '-1'])\n onArrow(element: HTMLElement, step: number): void {\n this.open = this.hasDropdown;\n this.changeDetectorRef.detectChanges();\n this.datalist?.onKeyDownArrow(element, step);\n }\n\n handleOption(option: Partial<TuiCard>): void {\n const {card = '', expire = '', cvc = ''} = option;\n const {bin} = this;\n const element =\n (!expire && this.inputExpire?.nativeElement) || this.inputCVC?.nativeElement;\n\n this.updateValue({card, expire, cvc});\n this.updateBin(bin);\n this.open = false;\n this.expireInert = !!expire;\n\n element?.focus();\n }\n\n onCardChange(card: string): void {\n const {value, bin} = this;\n const parsed = card.split(' ').join('');\n\n if (value && value.card === parsed) {\n return;\n }\n\n this.updateProperty(parsed, 'card');\n this.updateBin(bin);\n\n if (this.cardValidator(this.card) && !this.expire && this.inputExpire) {\n this.focusExpire();\n }\n }\n\n onExpireChange(expire: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.inputExpire) {\n return;\n }\n\n if (parseInt(expire.slice(0, 2), 10) > 12) {\n expire = `12${expire.slice(2)}`;\n }\n\n if (expire.slice(0, 2) === '00') {\n expire = `01${expire.slice(2)}`;\n }\n\n this.inputExpire.nativeElement.value = expire;\n this.updateProperty(expire, 'expire');\n\n if (expire.length === 5) {\n this.focusCVC();\n }\n }\n\n onCVCChange(cvc: string): void {\n this.updateProperty(cvc, 'cvc');\n }\n\n onActiveZoneChange(active: boolean): void {\n this.updateFocused(active);\n this.open = active && this.open;\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onMouseDown(event: MouseEvent): void {\n tuiAssertIsHTMLElement(event.target);\n\n if (event.target.matches('input')) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n onScroll({currentTarget}: Event): void {\n tuiAssertIsHTMLElement(currentTarget);\n\n currentTarget.scrollLeft = 0;\n }\n\n clear(): void {\n this.updateValue(null);\n this.focusCard();\n }\n\n toggle(): void {\n this.open = !this.open;\n }\n\n writeValue(value: TuiCard | null): void {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expireInert = !!this.expire && this.cardPrefilled;\n }\n\n /** Public API for manual focus management */\n focusCard(): void {\n this.inputCard?.nativeElement.focus();\n }\n\n focusExpire(): void {\n this.inputExpire?.nativeElement.focus({preventScroll: true});\n }\n\n focusCVC(): void {\n this.inputCVC?.nativeElement.focus();\n }\n\n private get cardFocused(): boolean {\n return !!this.inputCard && isNativeFocused(this.inputCard.nativeElement);\n }\n\n private get paymentSystem(): TuiPaymentSystem | null {\n return this.value && getPaymentSystem(this.value.card);\n }\n\n @tuiPure\n private isFocusable(card: string): boolean {\n return this.focusable && (this.cardValidator(card) || this.cardPrefilled);\n }\n\n private updateBin(oldBin: string | null): void {\n const {bin} = this;\n\n if (bin !== oldBin && !this.cardPrefilled) {\n this.binChange.emit(bin);\n }\n }\n\n private updateProperty(propValue: string, propName: 'card' | 'expire' | 'cvc'): void {\n const {card, expire, cvc} = this.value || STUB;\n const newValue: TuiCard = {\n card,\n expire,\n cvc,\n };\n\n newValue[propName] = propValue;\n\n if (!newValue.expire && !newValue.cvc && !newValue.card) {\n this.updateValue(null);\n } else {\n this.updateValue(newValue);\n }\n }\n\n private focusInput(): void {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n element?.focus();\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiFormatCardModule} from '@taiga-ui/addon-commerce/pipes';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiLetModule,\n TuiMapperPipeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownModule, TuiSvgModule, TuiWrapperModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCardGroupedComponent} from './input-card-grouped.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiSvgModule,\n TuiWrapperModule,\n TuiHoveredModule,\n TuiActiveZoneModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiDropdownModule,\n TuiPreventDefaultModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiFormatCardModule,\n ],\n declarations: [TuiInputCardGroupedComponent],\n exports: [TuiInputCardGroupedComponent],\n})\nexport class TuiInputCardGroupedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;IAmBa,4BAA4B,GAAG,IAAI,cAAc,CAE5D,wBAAwB,EAAE;IACxB,OAAO,EAAE;QACL,OAAA,wBAAwB,CACpB,MAAM,CAAC,MAAM,CAAC,EACd,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,kBAAkB,CAAC,EAC1B,MAAM,CAAC,SAAS,CAAC,CACpB;KAAA;CACR,EAAE;AAEH;SACgB,wBAAwB,CACpC,SAAiB,EACjB,eAA6C,EAC7C,WAAyC,EACzC,QAAsC,EACtC,EAAwB;QAAvB,8BAAY;IAEb,IAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAC9B,4BAA0B,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,QAAK,CACzD,CAAC;IAEF,OAAO,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,IAAI,CACvC,SAAS,CAAC,IAAI,CAAC,EACf,SAAS,CAAC;QACN,OAAA,aAAa,CAAC;YACV,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzB,eAAe;YACf,WAAW;YACX,QAAQ;SACX,CAAC;KAAA,CACL,EACD,GAAG,CAAC,UAAC,EAAqC;YAArC,kBAAqC,EAApC,aAAK,EAAE,kBAA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ild, Input, Output, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
|
-
import { NgControl } from '@angular/forms';
|
|
4
|
-
import { TUI_CARD_MASK } from '@taiga-ui/addon-commerce/constants';
|
|
5
|
-
import { getPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
6
|
-
import { tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl } from '@taiga-ui/cdk';
|
|
7
|
-
import { TuiTextfieldExampleTextDirective, TuiPrimitiveTextfieldComponent, TUI_TEXTFIELD_EXAMPLE_TEXT, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
8
|
-
import { TuiValueAccessorModule } from '@taiga-ui/kit';
|
|
9
|
-
import { TextMaskModule } from 'angular2-text-mask';
|
|
10
|
-
|
|
11
|
-
var _a;
|
|
12
|
-
var icons = (_a = {},
|
|
13
|
-
_a["mir" /* Mir */] = 'tuiIconMir',
|
|
14
|
-
_a["visa" /* Visa */] = 'tuiIconVisa',
|
|
15
|
-
_a["electron" /* Electron */] = 'tuiIconElectron',
|
|
16
|
-
_a["mastercard" /* Mastercard */] = 'tuiIconMastercard',
|
|
17
|
-
_a["maestro" /* Maestro */] = 'tuiIconMaestro',
|
|
18
|
-
_a);
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
-
function cardTextfieldControllerFactory(directive) {
|
|
21
|
-
directive = directive || new TuiTextfieldExampleTextDirective();
|
|
22
|
-
directive.exampleText = '0000 0000 0000 0000';
|
|
23
|
-
return directive;
|
|
24
|
-
}
|
|
25
|
-
// @dynamic
|
|
26
|
-
var TuiInputCardComponent = /** @class */ (function (_super) {
|
|
27
|
-
__extends(TuiInputCardComponent, _super);
|
|
28
|
-
function TuiInputCardComponent(control, changeDetectorRef) {
|
|
29
|
-
var _this = _super.call(this, control, changeDetectorRef) || this;
|
|
30
|
-
_this.cardSrc = null;
|
|
31
|
-
_this.autocompleteEnabled = false;
|
|
32
|
-
_this.binChange = new EventEmitter();
|
|
33
|
-
_this.textMaskOptions = {
|
|
34
|
-
mask: TUI_CARD_MASK,
|
|
35
|
-
guide: false,
|
|
36
|
-
pipe: function (conformedValue) { return conformedValue.trim(); },
|
|
37
|
-
};
|
|
38
|
-
return _this;
|
|
39
|
-
}
|
|
40
|
-
TuiInputCardComponent_1 = TuiInputCardComponent;
|
|
41
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "nativeFocusableElement", {
|
|
42
|
-
get: function () {
|
|
43
|
-
return this.input ? this.input.nativeFocusableElement : null;
|
|
44
|
-
},
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "focused", {
|
|
49
|
-
get: function () {
|
|
50
|
-
return !!this.input && this.input.focused;
|
|
51
|
-
},
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "icon", {
|
|
56
|
-
get: function () {
|
|
57
|
-
if (this.cardSrc !== null) {
|
|
58
|
-
return this.cardSrc;
|
|
59
|
-
}
|
|
60
|
-
var paymentSystem = this.paymentSystem;
|
|
61
|
-
return paymentSystem ? icons[paymentSystem] : null;
|
|
62
|
-
},
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "autocomplete", {
|
|
67
|
-
get: function () {
|
|
68
|
-
return this.autocompleteEnabled
|
|
69
|
-
? "cc-number" /* CcNumber */
|
|
70
|
-
: "off" /* Off */;
|
|
71
|
-
},
|
|
72
|
-
enumerable: true,
|
|
73
|
-
configurable: true
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "paymentSystem", {
|
|
76
|
-
get: function () {
|
|
77
|
-
return getPaymentSystem(this.value);
|
|
78
|
-
},
|
|
79
|
-
enumerable: true,
|
|
80
|
-
configurable: true
|
|
81
|
-
});
|
|
82
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "bin", {
|
|
83
|
-
get: function () {
|
|
84
|
-
return this.value.length < 6 ? null : this.value.slice(0, 6);
|
|
85
|
-
},
|
|
86
|
-
enumerable: true,
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(TuiInputCardComponent.prototype, "formattedCard", {
|
|
90
|
-
get: function () {
|
|
91
|
-
return this.value
|
|
92
|
-
.split('')
|
|
93
|
-
.map(function (char, index) { return (index && index % 4 === 0 ? " " + char : char); })
|
|
94
|
-
.join('');
|
|
95
|
-
},
|
|
96
|
-
enumerable: true,
|
|
97
|
-
configurable: true
|
|
98
|
-
});
|
|
99
|
-
TuiInputCardComponent.prototype.onValueChange = function (value) {
|
|
100
|
-
var parsed = value.split(' ').join('');
|
|
101
|
-
var currentBin = this.bin;
|
|
102
|
-
this.updateValue(parsed);
|
|
103
|
-
var newBin = this.bin;
|
|
104
|
-
if (currentBin !== newBin) {
|
|
105
|
-
this.binChange.emit(newBin);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
TuiInputCardComponent.prototype.onFocused = function (focused) {
|
|
109
|
-
this.updateFocused(focused);
|
|
110
|
-
};
|
|
111
|
-
TuiInputCardComponent.prototype.onHovered = function (hovered) {
|
|
112
|
-
this.updateHovered(hovered);
|
|
113
|
-
};
|
|
114
|
-
TuiInputCardComponent.prototype.writeValue = function (value) {
|
|
115
|
-
var currentBin = this.bin;
|
|
116
|
-
_super.prototype.writeValue.call(this, value);
|
|
117
|
-
var newBin = this.bin;
|
|
118
|
-
if (currentBin !== newBin) {
|
|
119
|
-
this.binChange.emit(newBin);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
TuiInputCardComponent.prototype.getFallbackValue = function () {
|
|
123
|
-
return '';
|
|
124
|
-
};
|
|
125
|
-
var TuiInputCardComponent_1;
|
|
126
|
-
TuiInputCardComponent.ctorParameters = function () { return [
|
|
127
|
-
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
128
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
|
|
129
|
-
]; };
|
|
130
|
-
__decorate([
|
|
131
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
132
|
-
], TuiInputCardComponent.prototype, "input", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
Input(),
|
|
135
|
-
tuiDefaultProp()
|
|
136
|
-
], TuiInputCardComponent.prototype, "cardSrc", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
Input(),
|
|
139
|
-
tuiDefaultProp()
|
|
140
|
-
], TuiInputCardComponent.prototype, "autocompleteEnabled", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
Output()
|
|
143
|
-
], TuiInputCardComponent.prototype, "binChange", void 0);
|
|
144
|
-
TuiInputCardComponent = TuiInputCardComponent_1 = __decorate([
|
|
145
|
-
Component({
|
|
146
|
-
selector: 'tui-input-card',
|
|
147
|
-
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [tuiTextfieldCustomContent]=\"icon\"\n [readOnly]=\"readOnly\"\n [disabled]=\"disabled\"\n [focusable]=\"focusable\"\n [nativeId]=\"nativeId\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"formattedCard\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
148
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
149
|
-
providers: [
|
|
150
|
-
{
|
|
151
|
-
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
152
|
-
useExisting: forwardRef(function () { return TuiInputCardComponent_1; }),
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
provide: TUI_TEXTFIELD_EXAMPLE_TEXT,
|
|
156
|
-
deps: [[new Optional(), TuiTextfieldExampleTextDirective]],
|
|
157
|
-
useFactory: cardTextfieldControllerFactory,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
styles: [":host{display:block;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}"]
|
|
161
|
-
}),
|
|
162
|
-
__param(0, Optional()),
|
|
163
|
-
__param(0, Self()),
|
|
164
|
-
__param(0, Inject(NgControl)),
|
|
165
|
-
__param(1, Inject(ChangeDetectorRef))
|
|
166
|
-
], TuiInputCardComponent);
|
|
167
|
-
return TuiInputCardComponent;
|
|
168
|
-
}(AbstractTuiControl));
|
|
169
|
-
|
|
170
|
-
var TuiInputCardModule = /** @class */ (function () {
|
|
171
|
-
function TuiInputCardModule() {
|
|
172
|
-
}
|
|
173
|
-
TuiInputCardModule = __decorate([
|
|
174
|
-
NgModule({
|
|
175
|
-
imports: [
|
|
176
|
-
TextMaskModule,
|
|
177
|
-
TuiPrimitiveTextfieldModule,
|
|
178
|
-
TuiTextfieldControllerModule,
|
|
179
|
-
TuiValueAccessorModule,
|
|
180
|
-
],
|
|
181
|
-
declarations: [TuiInputCardComponent],
|
|
182
|
-
exports: [TuiInputCardComponent],
|
|
183
|
-
})
|
|
184
|
-
], TuiInputCardModule);
|
|
185
|
-
return TuiInputCardModule;
|
|
186
|
-
}());
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Generated bundle index. Do not edit.
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
export { TuiInputCardComponent, TuiInputCardModule, cardTextfieldControllerFactory };
|
|
193
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-components-input-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card/input-card.component.ts","ng://@taiga-ui/addon-commerce/components/input-card/input-card.module.ts","ng://@taiga-ui/addon-commerce/components/input-card/taiga-ui-addon-commerce-components-input-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {getPaymentSystem} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_TEXTFIELD_EXAMPLE_TEXT,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldExampleTextDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: 'tuiIconMir',\n [TuiPaymentSystem.Visa]: 'tuiIconVisa',\n [TuiPaymentSystem.Electron]: 'tuiIconElectron',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function cardTextfieldControllerFactory(\n directive: TuiTextfieldExampleTextDirective | null,\n): TuiTextfieldExampleTextDirective {\n directive = directive || new TuiTextfieldExampleTextDirective();\n directive.exampleText = '0000 0000 0000 0000';\n\n return directive;\n}\n\n// @dynamic\n@Component({\n selector: 'tui-input-card',\n templateUrl: './input-card.template.html',\n styleUrls: ['./input-card.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCardComponent),\n },\n {\n provide: TUI_TEXTFIELD_EXAMPLE_TEXT,\n deps: [[new Optional(), TuiTextfieldExampleTextDirective]],\n useFactory: cardTextfieldControllerFactory,\n },\n ],\n})\nexport class TuiInputCardComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: string | null = null;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Output()\n readonly binChange = new EventEmitter<string | null>();\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get icon(): string | null {\n if (this.cardSrc !== null) {\n return this.cardSrc;\n }\n\n const {paymentSystem} = this;\n\n return paymentSystem ? icons[paymentSystem] : null;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcNumber\n : TuiCreditCardAutofillName.Off;\n }\n\n get paymentSystem(): TuiPaymentSystem | null {\n return getPaymentSystem(this.value);\n }\n\n get bin(): string | null {\n return this.value.length < 6 ? null : this.value.slice(0, 6);\n }\n\n get formattedCard(): string {\n return this.value\n .split('')\n .map((char, index) => (index && index % 4 === 0 ? ` ${char}` : char))\n .join('');\n }\n\n onValueChange(value: string): void {\n const parsed = value.split(' ').join('');\n const currentBin = this.bin;\n\n this.updateValue(parsed);\n\n const newBin = this.bin;\n\n if (currentBin !== newBin) {\n this.binChange.emit(newBin);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n writeValue(value: string | null): void {\n const currentBin = this.bin;\n\n super.writeValue(value);\n\n const newBin = this.bin;\n\n if (currentBin !== newBin) {\n this.binChange.emit(newBin);\n }\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCardComponent} from './input-card.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCardComponent],\n exports: [TuiInputCardComponent],\n})\nexport class TuiInputCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA+BA,IAAM,KAAK;IACP,sBAAwB,YAAY;IACpC,wBAAyB,aAAa;IACtC,gCAA6B,iBAAiB;IAC9C,oCAA+B,mBAAmB;IAClD,8BAA4B,gBAAgB;OAC/C,CAAC;AAEF;SACgB,8BAA8B,CAC1C,SAAkD;IAElD,SAAS,GAAG,SAAS,IAAI,IAAI,gCAAgC,EAAE,CAAC;IAChE,SAAS,CAAC,WAAW,GAAG,qBAAqB,CAAC;IAE9C,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;IAmBY,yCAA0B;IAuBlC,+BAII,OAAyB,EACE,iBAAoC;QALnE,YAOI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAvBD,aAAO,GAAkB,IAAI,CAAC;QAI9B,yBAAmB,GAAG,KAAK,CAAC;QAGnB,eAAS,GAAG,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ADC,MAAM,EAAE;4DAC8C;IAhB9C,qBAAqB;QAjBjC,SAAS,CAAC;YACP,QAAQ,EAAE,gBAAgB;YAC1B,uuBAAyC;YAEzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAA2B;oBACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,uBAAqB,GAAA,CAAC;iBACvD;gBACD;oBACI,OAAO,EAAE,0BAA0B;oBACnC,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,gCAAgC,CAAC,CAAC;oBAC1D,UAAU,EAAE,8BAA8B;iBAC7C;aACJ;;SACJ,CAAC;QA0BO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OA7BrB,qBAAqB,CA6GjC;IAAD,4BAAC;CAAA,CA5GW,kBAAkB;;;ICnD9B;KAAkC;IAArB,kBAAkB;QAV9B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,cAAc;gBACd,2BAA2B;gBAC3B,4BAA4B;gBAC5B,sBAAsB;aACzB;YACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;YACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACjBA;;;;;;"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { __extends, __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
|
-
import { NgControl } from '@angular/forms';
|
|
4
|
-
import { tuiDefaultProp, tuiRequiredSetter, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl } from '@taiga-ui/cdk';
|
|
5
|
-
import { TUI_DIGIT_REGEXP, TuiTextfieldLabelOutsideDirective, TUI_TEXTFIELD_LABEL_OUTSIDE, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiHintControllerModule } from '@taiga-ui/core';
|
|
6
|
-
import { TuiValueAccessorModule } from '@taiga-ui/kit';
|
|
7
|
-
import { TextMaskModule } from 'angular2-text-mask';
|
|
8
|
-
|
|
9
|
-
var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
10
|
-
__extends(TuiInputCVCComponent, _super);
|
|
11
|
-
function TuiInputCVCComponent(control, changeDetectorRef, textfieldLabelOutside) {
|
|
12
|
-
var _this = _super.call(this, control, changeDetectorRef) || this;
|
|
13
|
-
_this.textfieldLabelOutside = textfieldLabelOutside;
|
|
14
|
-
_this.autocompleteEnabled = false;
|
|
15
|
-
_this.exampleText = '000';
|
|
16
|
-
_this.textMaskOptions = {
|
|
17
|
-
mask: new Array(3).fill(TUI_DIGIT_REGEXP),
|
|
18
|
-
guide: false,
|
|
19
|
-
};
|
|
20
|
-
return _this;
|
|
21
|
-
}
|
|
22
|
-
TuiInputCVCComponent_1 = TuiInputCVCComponent;
|
|
23
|
-
Object.defineProperty(TuiInputCVCComponent.prototype, "length", {
|
|
24
|
-
set: function (length) {
|
|
25
|
-
this.exampleText = '0'.repeat(length);
|
|
26
|
-
this.textMaskOptions = {
|
|
27
|
-
mask: new Array(length).fill(TUI_DIGIT_REGEXP),
|
|
28
|
-
guide: false,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(TuiInputCVCComponent.prototype, "nativeFocusableElement", {
|
|
35
|
-
get: function () {
|
|
36
|
-
return this.input ? this.input.nativeFocusableElement : null;
|
|
37
|
-
},
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(TuiInputCVCComponent.prototype, "focused", {
|
|
42
|
-
get: function () {
|
|
43
|
-
return !!this.input && this.input.focused;
|
|
44
|
-
},
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(TuiInputCVCComponent.prototype, "autocomplete", {
|
|
49
|
-
get: function () {
|
|
50
|
-
return this.autocompleteEnabled
|
|
51
|
-
? "cc-csc" /* CcCsc */
|
|
52
|
-
: "off" /* Off */;
|
|
53
|
-
},
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(TuiInputCVCComponent.prototype, "computedExampleText", {
|
|
58
|
-
get: function () {
|
|
59
|
-
return this.textfieldLabelOutside.labelOutside ? '' : this.exampleText;
|
|
60
|
-
},
|
|
61
|
-
enumerable: true,
|
|
62
|
-
configurable: true
|
|
63
|
-
});
|
|
64
|
-
TuiInputCVCComponent.prototype.onFocused = function (focused) {
|
|
65
|
-
this.updateFocused(focused);
|
|
66
|
-
};
|
|
67
|
-
TuiInputCVCComponent.prototype.onHovered = function (hovered) {
|
|
68
|
-
this.updateHovered(hovered);
|
|
69
|
-
};
|
|
70
|
-
TuiInputCVCComponent.prototype.onCopy = function () { };
|
|
71
|
-
TuiInputCVCComponent.prototype.onValueChange = function (value) {
|
|
72
|
-
this.updateValue(value);
|
|
73
|
-
};
|
|
74
|
-
TuiInputCVCComponent.prototype.getFallbackValue = function () {
|
|
75
|
-
return '';
|
|
76
|
-
};
|
|
77
|
-
var TuiInputCVCComponent_1;
|
|
78
|
-
TuiInputCVCComponent.ctorParameters = function () { return [
|
|
79
|
-
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
80
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
81
|
-
{ type: TuiTextfieldLabelOutsideDirective, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_LABEL_OUTSIDE,] }] }
|
|
82
|
-
]; };
|
|
83
|
-
__decorate([
|
|
84
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
85
|
-
], TuiInputCVCComponent.prototype, "input", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
Input(),
|
|
88
|
-
tuiDefaultProp()
|
|
89
|
-
], TuiInputCVCComponent.prototype, "autocompleteEnabled", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
Input(),
|
|
92
|
-
tuiRequiredSetter()
|
|
93
|
-
], TuiInputCVCComponent.prototype, "length", null);
|
|
94
|
-
TuiInputCVCComponent = TuiInputCVCComponent_1 = __decorate([
|
|
95
|
-
Component({
|
|
96
|
-
selector: 'tui-input-cvc',
|
|
97
|
-
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldExampleText]=\"computedExampleText\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
98
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
99
|
-
providers: [
|
|
100
|
-
{
|
|
101
|
-
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
102
|
-
useExisting: forwardRef(function () { return TuiInputCVCComponent_1; }),
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}"]
|
|
106
|
-
}),
|
|
107
|
-
__param(0, Optional()),
|
|
108
|
-
__param(0, Self()),
|
|
109
|
-
__param(0, Inject(NgControl)),
|
|
110
|
-
__param(1, Inject(ChangeDetectorRef)),
|
|
111
|
-
__param(2, Inject(TUI_TEXTFIELD_LABEL_OUTSIDE))
|
|
112
|
-
], TuiInputCVCComponent);
|
|
113
|
-
return TuiInputCVCComponent;
|
|
114
|
-
}(AbstractTuiControl));
|
|
115
|
-
|
|
116
|
-
var TuiInputCVCModule = /** @class */ (function () {
|
|
117
|
-
function TuiInputCVCModule() {
|
|
118
|
-
}
|
|
119
|
-
TuiInputCVCModule = __decorate([
|
|
120
|
-
NgModule({
|
|
121
|
-
imports: [
|
|
122
|
-
TextMaskModule,
|
|
123
|
-
TuiPrimitiveTextfieldModule,
|
|
124
|
-
TuiTextfieldControllerModule,
|
|
125
|
-
TuiHintControllerModule,
|
|
126
|
-
TuiValueAccessorModule,
|
|
127
|
-
],
|
|
128
|
-
declarations: [TuiInputCVCComponent],
|
|
129
|
-
exports: [TuiInputCVCComponent],
|
|
130
|
-
})
|
|
131
|
-
], TuiInputCVCModule);
|
|
132
|
-
return TuiInputCVCModule;
|
|
133
|
-
}());
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Generated bundle index. Do not edit.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
export { TuiInputCVCComponent, TuiInputCVCModule };
|
|
140
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-components-input-cvc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: 'tui-input-cvc',\n templateUrl: './input-cvc.template.html',\n styleUrls: ['./input-cvc.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCVCComponent),\n },\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = '0'.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = '000';\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n get computedExampleText(): string {\n return this.textfieldLabelOutside.labelOutside ? '' : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA2CY,wCAA0B;IA2BlC,8BAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD;QAP7E,YASI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAHoB,2BAAqB,GAArB,qBAAqB,CAAmC;QA1B7E,yBAAmB,GAAG,KAAK,CAAC;QAY5B,iBAAW,GAAG,KAAK,CAAC;QAEpB,qBAAe,GAAmB;YAC9B,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACzC,KAAK,EA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;gBAEe,iCAAiC,uBADxE,MAAM,SAAC,2BAA2B;;IA7BvC;QADC,SAAS,CAAC,8BAA8B,CAAC;uDACc;IAIxD;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;qEACW;IAI5B;QAFC,KAAK,EAAE;QACP,iBAAiB,EAAE;sDAOnB;IAnBQ,oBAAoB;QAZhC,SAAS,CAAC;YACP,QAAQ,EAAE,eAAe;YACzB,4tBAAwC;YAExC,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAA2B;oBACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,sBAAoB,GAAA,CAAC;iBACtD;aACJ;;SACJ,CAAC;QA8BO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,2BAA2B,CAAC,CAAA;OAlC/B,oBAAoB,CA2EhC;IAAD,2BAAC;CAAA,CA1EW,kBAAkB;;;ICrB9B;KAAiC;IAApB,iBAAiB;QAX7B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,cAAc;gBACd,2BAA2B;gBAC3B,4BAA4B;gBAC5B,uBAAuB;gBACvB,sBAAsB;aACzB;YACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;YACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;SAClC,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAjC;;ACtBA;;;;;;"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { __extends, __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
|
-
import { NgControl } from '@angular/forms';
|
|
4
|
-
import { tuiCreateAutoCorrectedExpirePipe } from '@taiga-ui/addon-commerce/utils';
|
|
5
|
-
import { tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl } from '@taiga-ui/cdk';
|
|
6
|
-
import { TUI_DIGIT_REGEXP, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
7
|
-
import { TuiValueAccessorModule } from '@taiga-ui/kit';
|
|
8
|
-
import { TextMaskModule } from 'angular2-text-mask';
|
|
9
|
-
|
|
10
|
-
var TuiInputExpireComponent = /** @class */ (function (_super) {
|
|
11
|
-
__extends(TuiInputExpireComponent, _super);
|
|
12
|
-
function TuiInputExpireComponent(control, changeDetectorRef) {
|
|
13
|
-
var _this = _super.call(this, control, changeDetectorRef) || this;
|
|
14
|
-
_this.autocompleteEnabled = false;
|
|
15
|
-
_this.textMaskOptions = {
|
|
16
|
-
mask: [
|
|
17
|
-
TUI_DIGIT_REGEXP,
|
|
18
|
-
TUI_DIGIT_REGEXP,
|
|
19
|
-
'/',
|
|
20
|
-
TUI_DIGIT_REGEXP,
|
|
21
|
-
TUI_DIGIT_REGEXP,
|
|
22
|
-
],
|
|
23
|
-
pipe: tuiCreateAutoCorrectedExpirePipe(),
|
|
24
|
-
guide: false,
|
|
25
|
-
};
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
TuiInputExpireComponent_1 = TuiInputExpireComponent;
|
|
29
|
-
Object.defineProperty(TuiInputExpireComponent.prototype, "nativeFocusableElement", {
|
|
30
|
-
get: function () {
|
|
31
|
-
return this.input ? this.input.nativeFocusableElement : null;
|
|
32
|
-
},
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(TuiInputExpireComponent.prototype, "focused", {
|
|
37
|
-
get: function () {
|
|
38
|
-
return !!this.input && this.input.focused;
|
|
39
|
-
},
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(TuiInputExpireComponent.prototype, "autocomplete", {
|
|
44
|
-
get: function () {
|
|
45
|
-
return this.autocompleteEnabled
|
|
46
|
-
? "cc-exp" /* CcExp */
|
|
47
|
-
: "off" /* Off */;
|
|
48
|
-
},
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true
|
|
51
|
-
});
|
|
52
|
-
TuiInputExpireComponent.prototype.onValueChange = function (value) {
|
|
53
|
-
// @bad TODO: Workaround until mask pipe can replace chars and keep caret position
|
|
54
|
-
// @bad TODO: Think about a solution without mask at all
|
|
55
|
-
if (!this.input || !this.input.nativeFocusableElement) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (parseInt(value.slice(0, 2), 10) > 12) {
|
|
59
|
-
value = "12" + value.slice(2);
|
|
60
|
-
}
|
|
61
|
-
if (value.slice(0, 2) === '00') {
|
|
62
|
-
value = "01" + value.slice(2);
|
|
63
|
-
}
|
|
64
|
-
this.input.nativeFocusableElement.value = value;
|
|
65
|
-
if (this.value !== value) {
|
|
66
|
-
this.updateValue(value);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
TuiInputExpireComponent.prototype.onFocused = function (focused) {
|
|
70
|
-
this.updateFocused(focused);
|
|
71
|
-
};
|
|
72
|
-
TuiInputExpireComponent.prototype.onHovered = function (hovered) {
|
|
73
|
-
this.updateHovered(hovered);
|
|
74
|
-
};
|
|
75
|
-
TuiInputExpireComponent.prototype.getFallbackValue = function () {
|
|
76
|
-
return '';
|
|
77
|
-
};
|
|
78
|
-
var TuiInputExpireComponent_1;
|
|
79
|
-
TuiInputExpireComponent.ctorParameters = function () { return [
|
|
80
|
-
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
81
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
|
|
82
|
-
]; };
|
|
83
|
-
__decorate([
|
|
84
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
85
|
-
], TuiInputExpireComponent.prototype, "input", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
Input(),
|
|
88
|
-
tuiDefaultProp()
|
|
89
|
-
], TuiInputExpireComponent.prototype, "autocompleteEnabled", void 0);
|
|
90
|
-
TuiInputExpireComponent = TuiInputExpireComponent_1 = __decorate([
|
|
91
|
-
Component({
|
|
92
|
-
selector: 'tui-input-expire',
|
|
93
|
-
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
94
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
95
|
-
providers: [
|
|
96
|
-
{
|
|
97
|
-
provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
|
|
98
|
-
useExisting: forwardRef(function () { return TuiInputExpireComponent_1; }),
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}"]
|
|
102
|
-
}),
|
|
103
|
-
__param(0, Optional()),
|
|
104
|
-
__param(0, Self()),
|
|
105
|
-
__param(0, Inject(NgControl)),
|
|
106
|
-
__param(1, Inject(ChangeDetectorRef))
|
|
107
|
-
], TuiInputExpireComponent);
|
|
108
|
-
return TuiInputExpireComponent;
|
|
109
|
-
}(AbstractTuiControl));
|
|
110
|
-
|
|
111
|
-
var TuiInputExpireModule = /** @class */ (function () {
|
|
112
|
-
function TuiInputExpireModule() {
|
|
113
|
-
}
|
|
114
|
-
TuiInputExpireModule = __decorate([
|
|
115
|
-
NgModule({
|
|
116
|
-
imports: [
|
|
117
|
-
TextMaskModule,
|
|
118
|
-
TuiPrimitiveTextfieldModule,
|
|
119
|
-
TuiTextfieldControllerModule,
|
|
120
|
-
TuiValueAccessorModule,
|
|
121
|
-
],
|
|
122
|
-
declarations: [TuiInputExpireComponent],
|
|
123
|
-
exports: [TuiInputExpireComponent],
|
|
124
|
-
})
|
|
125
|
-
], TuiInputExpireModule);
|
|
126
|
-
return TuiInputExpireModule;
|
|
127
|
-
}());
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Generated bundle index. Do not edit.
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
export { TuiInputExpireComponent, TuiInputExpireModule };
|
|
134
|
-
//# sourceMappingURL=taiga-ui-addon-commerce-components-input-expire.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: 'tui-input-expire',\n templateUrl: './input-expire.template.html',\n styleUrls: ['./input-expire.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputExpireComponent),\n },\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n '/',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n onValueChange(value: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input || !this.input.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.slice(0, 2), 10) > 12) {\n value = `12${value.slice(2)}`;\n }\n\n if (value.slice(0, 2) === '00') {\n value = `01${value.slice(2)}`;\n }\n\n this.input.nativeFocusableElement.value = value;\n\n if (this.value !== value) {\n this.updateValue(value);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputExpireComponent} from './input-expire.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputExpireComponent],\n exports: [TuiInputExpireComponent],\n})\nexport class TuiInputExpireModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAwCY,2CAA0B;IAsBlC,iCAII,OAAyB,EACE,iBAAoC;QALnE,YAOI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAtBD,yBAAmB,GAAG,KAAK,CAAC;QAEnB,qBAAe,GAAmB;YACvC,IAAI,EAAE;gBACF,gBAAgB;gBAChB,gBAAgB;gBAChB,GAAG;gBACH,gBAAgB;gBAChB,gBAAgB;aACnB;YACD,IAAI,EAAE,gCAAgC,EAAE;YACxC,KAAK,EAAE,KAAK;SACoC,CAAC;;KAUpD;gCA/BQ,uBAAuB;IAiChC,sBAAI,2DAAsB;aAA1B;YACI,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;SAChE;;;OAAA;IAED,sBAAI,4CAAO;aAAX;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SAC7C;;;OAAA;IAED,sBAAI,iDAAY;aAAhB;YACI,OAAO,IAAI,CAAC,mB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