@taiga-ui/addon-commerce 4.65.0 → 5.0.0-canary.8b64ec1
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/README.md +2 -2
- package/components/index.d.ts +0 -2
- package/components/input-card/index.d.ts +3 -1
- package/components/input-card/input-card.component.d.ts +7 -13
- package/components/input-card/input-card.d.ts +7 -0
- package/components/input-card/input-cvc.directive.d.ts +10 -0
- package/components/input-card/input-expire.directive.d.ts +8 -0
- package/components/input-card-group/input-card-group.component.d.ts +33 -47
- package/components/input-card-group/input-card-group.directive.d.ts +3 -6
- package/components/input-card-group/input-card-group.options.d.ts +4 -7
- package/components/input-card-group/input-card-group.providers.d.ts +4 -5
- package/components/thumbnail-card/thumbnail-card.component.d.ts +5 -8
- package/components/thumbnail-card/thumbnail-card.options.d.ts +0 -2
- package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs +112 -203
- package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs +95 -66
- package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs +11 -26
- package/fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-components.mjs +0 -2
- package/fesm2022/taiga-ui-addon-commerce-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-constants.mjs +4 -26
- package/fesm2022/taiga-ui-addon-commerce-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-pipes-amount.mjs +27 -25
- package/fesm2022/taiga-ui-addon-commerce-pipes-amount.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-pipes-currency.mjs +6 -9
- package/fesm2022/taiga-ui-addon-commerce-pipes-currency.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-pipes-decimal.mjs +18 -10
- package/fesm2022/taiga-ui-addon-commerce-pipes-decimal.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-pipes-format-card.mjs +4 -7
- package/fesm2022/taiga-ui-addon-commerce-pipes-format-card.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-tokens.mjs +13 -14
- package/fesm2022/taiga-ui-addon-commerce-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-types.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-utils.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-validators.mjs.map +1 -1
- package/package.json +17 -56
- package/pipes/amount/amount.options.d.ts +1 -3
- package/pipes/amount/amount.pipe.d.ts +5 -2
- package/pipes/currency/currency.pipe.d.ts +2 -2
- package/pipes/decimal/decimal.pipe.d.ts +4 -2
- package/tokens/i18n.d.ts +4 -5
- package/components/input-card/input-card.options.d.ts +0 -12
- package/components/input-cvc/index.d.ts +0 -1
- package/components/input-cvc/input-cvc.directive.d.ts +0 -14
- package/components/input-expire/index.d.ts +0 -1
- package/components/input-expire/input-expire.directive.d.ts +0 -10
- package/esm2022/components/index.mjs +0 -6
- package/esm2022/components/input-card/index.mjs +0 -3
- package/esm2022/components/input-card/input-card.component.mjs +0 -86
- package/esm2022/components/input-card/input-card.options.mjs +0 -15
- package/esm2022/components/input-card/taiga-ui-addon-commerce-components-input-card.mjs +0 -5
- package/esm2022/components/input-card-group/index.mjs +0 -5
- package/esm2022/components/input-card-group/input-card-group.component.mjs +0 -335
- package/esm2022/components/input-card-group/input-card-group.directive.mjs +0 -30
- package/esm2022/components/input-card-group/input-card-group.options.mjs +0 -19
- package/esm2022/components/input-card-group/input-card-group.providers.mjs +0 -20
- package/esm2022/components/input-card-group/taiga-ui-addon-commerce-components-input-card-group.mjs +0 -5
- package/esm2022/components/input-cvc/index.mjs +0 -2
- package/esm2022/components/input-cvc/input-cvc.directive.mjs +0 -47
- package/esm2022/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.mjs +0 -5
- package/esm2022/components/input-expire/index.mjs +0 -2
- package/esm2022/components/input-expire/input-expire.directive.mjs +0 -38
- package/esm2022/components/input-expire/taiga-ui-addon-commerce-components-input-expire.mjs +0 -5
- package/esm2022/components/taiga-ui-addon-commerce-components.mjs +0 -5
- package/esm2022/components/thumbnail-card/index.mjs +0 -3
- package/esm2022/components/thumbnail-card/taiga-ui-addon-commerce-components-thumbnail-card.mjs +0 -5
- package/esm2022/components/thumbnail-card/thumbnail-card.component.mjs +0 -35
- package/esm2022/components/thumbnail-card/thumbnail-card.options.mjs +0 -10
- package/esm2022/constants/default-card-validator.mjs +0 -3
- package/esm2022/constants/index.mjs +0 -6
- package/esm2022/constants/mask-card-holder.mjs +0 -51
- package/esm2022/constants/mask-card.mjs +0 -29
- package/esm2022/constants/mask-cvc.mjs +0 -5
- package/esm2022/constants/mask-expire.mjs +0 -6
- package/esm2022/constants/taiga-ui-addon-commerce-constants.mjs +0 -5
- package/esm2022/index.mjs +0 -8
- package/esm2022/pipes/amount/amount.options.mjs +0 -14
- package/esm2022/pipes/amount/amount.pipe.mjs +0 -45
- package/esm2022/pipes/amount/amount.types.mjs +0 -2
- package/esm2022/pipes/amount/amount.utils.mjs +0 -11
- package/esm2022/pipes/amount/index.mjs +0 -4
- package/esm2022/pipes/amount/taiga-ui-addon-commerce-pipes-amount.mjs +0 -5
- package/esm2022/pipes/currency/currency.pipe.mjs +0 -19
- package/esm2022/pipes/currency/index.mjs +0 -2
- package/esm2022/pipes/currency/taiga-ui-addon-commerce-pipes-currency.mjs +0 -5
- package/esm2022/pipes/decimal/decimal.pipe.mjs +0 -28
- package/esm2022/pipes/decimal/index.mjs +0 -2
- package/esm2022/pipes/decimal/taiga-ui-addon-commerce-pipes-decimal.mjs +0 -5
- package/esm2022/pipes/format-card/format-card.pipe.mjs +0 -24
- package/esm2022/pipes/format-card/index.mjs +0 -2
- package/esm2022/pipes/format-card/taiga-ui-addon-commerce-pipes-format-card.mjs +0 -5
- package/esm2022/pipes/index.mjs +0 -5
- package/esm2022/pipes/taiga-ui-addon-commerce-pipes.mjs +0 -5
- package/esm2022/taiga-ui-addon-commerce.mjs +0 -5
- package/esm2022/tokens/i18n.mjs +0 -22
- package/esm2022/tokens/index.mjs +0 -3
- package/esm2022/tokens/payment-system-icons.mjs +0 -20
- package/esm2022/tokens/taiga-ui-addon-commerce-tokens.mjs +0 -5
- package/esm2022/types/currency-code.mjs +0 -410
- package/esm2022/types/currency-variants.mjs +0 -2
- package/esm2022/types/currency.mjs +0 -419
- package/esm2022/types/index.mjs +0 -3
- package/esm2022/types/payment-system.mjs +0 -2
- package/esm2022/types/taiga-ui-addon-commerce-types.mjs +0 -5
- package/esm2022/utils/format-currency.mjs +0 -12
- package/esm2022/utils/get-code-by-currency.mjs +0 -52
- package/esm2022/utils/get-currency-by-code.mjs +0 -52
- package/esm2022/utils/get-currency-symbol.mjs +0 -139
- package/esm2022/utils/get-payment-system.mjs +0 -105
- package/esm2022/utils/index.mjs +0 -9
- package/esm2022/utils/is-card-length-valid.mjs +0 -22
- package/esm2022/utils/is-card-number-valid.mjs +0 -18
- package/esm2022/utils/is-expire-valid.mjs +0 -10
- package/esm2022/utils/taiga-ui-addon-commerce-utils.mjs +0 -5
- package/esm2022/validators/card-expire.validator.mjs +0 -8
- package/esm2022/validators/card-number.validator.mjs +0 -8
- package/esm2022/validators/index.mjs +0 -4
- package/esm2022/validators/luhn.validator.mjs +0 -6
- package/esm2022/validators/taiga-ui-addon-commerce-validators.mjs +0 -5
- package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs +0 -53
- package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs.map +0 -1
- package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs +0 -44
- package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs.map +0 -1
|
@@ -1,261 +1,211 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DOCUMENT, isPlatformServer, NgIf } from '@angular/common';
|
|
1
|
+
import { DOCUMENT, isPlatformServer } from '@angular/common';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject,
|
|
5
|
-
import {
|
|
3
|
+
import { inject, input, Directive, InjectionToken, computed, viewChild, PLATFORM_ID, signal, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
5
|
import * as i4 from '@angular/forms';
|
|
7
6
|
import { FormsModule } from '@angular/forms';
|
|
8
7
|
import { MaskitoDirective } from '@maskito/angular';
|
|
8
|
+
import { WA_IS_MOBILE, WA_IS_WEBKIT } from '@ng-web-apis/platform';
|
|
9
9
|
import { WaResizeObserver } from '@ng-web-apis/resize-observer';
|
|
10
10
|
import { tuiDefaultCardValidator, TUI_MASK_CVC, TUI_MASK_CARD, TUI_MASK_EXPIRE } from '@taiga-ui/addon-commerce/constants';
|
|
11
|
-
import { TuiFormatCardPipe } from '@taiga-ui/addon-commerce/pipes';
|
|
11
|
+
import { TuiFormatCardPipe } from '@taiga-ui/addon-commerce/pipes/format-card';
|
|
12
12
|
import { TUI_CARD_NUMBER_TEXTS, TUI_CARD_EXPIRY_TEXTS, TUI_CARD_CVC_TEXTS, TUI_PAYMENT_SYSTEM_ICONS } from '@taiga-ui/addon-commerce/tokens';
|
|
13
|
+
import { tuiGetPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
13
14
|
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
14
15
|
import { TUI_NON_DIGIT_REGEXP, CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
|
|
15
16
|
import { tuiHovered, TuiHoveredService } from '@taiga-ui/cdk/directives/hovered';
|
|
16
|
-
import {
|
|
17
|
+
import { TuiTransitioned } from '@taiga-ui/cdk/directives/transitioned';
|
|
17
18
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
18
|
-
import { tuiInjectId } from '@taiga-ui/cdk/services';
|
|
19
|
-
import { TUI_IS_MOBILE, TUI_IS_WEBKIT } from '@taiga-ui/cdk/tokens';
|
|
20
19
|
import { tuiInjectElement, tuiIsElement, tuiIsInput } from '@taiga-ui/cdk/utils/dom';
|
|
21
|
-
import { tuiFocusedIn,
|
|
22
|
-
import {
|
|
20
|
+
import { tuiFocusedIn, tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
|
|
21
|
+
import { tuiGenerateId } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
23
22
|
import { tuiAsDataListHost } from '@taiga-ui/core/components/data-list';
|
|
24
23
|
import { TuiIcon, TuiIconPipe } from '@taiga-ui/core/components/icon';
|
|
25
24
|
import { TUI_TEXTFIELD_OPTIONS } from '@taiga-ui/core/components/textfield';
|
|
26
25
|
import * as i1 from '@taiga-ui/core/directives/appearance';
|
|
27
26
|
import { tuiAppearanceMode, tuiAppearance, tuiAppearanceState, tuiAppearanceFocus, TuiAppearance } from '@taiga-ui/core/directives/appearance';
|
|
28
|
-
import * as i2 from '@taiga-ui/core/
|
|
29
|
-
import { TuiDropdownDirective,
|
|
30
|
-
import { TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
27
|
+
import * as i2 from '@taiga-ui/core/portals/dropdown';
|
|
28
|
+
import { TuiDropdownDirective, TuiDropdownOpen, tuiDropdownOptionsProvider, TuiWithDropdownOpen } from '@taiga-ui/core/portals/dropdown';
|
|
29
|
+
import { TUI_BREAKPOINT, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
31
30
|
import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
|
|
32
31
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { TUI_INPUT_CARD_DEFAULT_OPTIONS } from '@taiga-ui/addon-commerce/components/input-card';
|
|
32
|
+
import { Subject, EMPTY, switchMap, timer } from 'rxjs';
|
|
33
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
36
34
|
|
|
37
35
|
class TuiInputCardGroupDirective {
|
|
38
36
|
constructor() {
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.compact$ = combineLatest([this.c$, this.m$]).pipe(map((c) => c.some(Boolean)));
|
|
42
|
-
this.compact = toSignal(this.compact$, { initialValue: false });
|
|
37
|
+
this.breakpoint = inject(TUI_BREAKPOINT);
|
|
38
|
+
this.compact = input(false);
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputCardGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
48
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputCardGroupDirective, isStandalone: true, inputs: { compactSetter: ["compact", "compactSetter"] }, host: { properties: { "class._compact": "compact()" } }, ngImport: i0 }); }
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
41
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiInputCardGroupDirective, isStandalone: true, inputs: { compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class._compact": "compact() || breakpoint() === 'mobile'" } }, ngImport: i0 }); }
|
|
49
42
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroupDirective, decorators: [{
|
|
51
44
|
type: Directive,
|
|
52
45
|
args: [{
|
|
53
|
-
|
|
54
|
-
host: { '[class._compact]': 'compact()' },
|
|
46
|
+
host: { '[class._compact]': "compact() || breakpoint() === 'mobile'" },
|
|
55
47
|
}]
|
|
56
|
-
}]
|
|
57
|
-
type: Input,
|
|
58
|
-
args: ['compact']
|
|
59
|
-
}] } });
|
|
48
|
+
}] });
|
|
60
49
|
|
|
61
50
|
const TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS = {
|
|
62
|
-
...TUI_INPUT_CARD_DEFAULT_OPTIONS,
|
|
63
51
|
cardValidator: tuiDefaultCardValidator,
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
placeholder: '0000 0000 0000 0000',
|
|
53
|
+
cvcPlaceholder: '000',
|
|
66
54
|
cvcHidden: true,
|
|
67
55
|
inputs: { cvc: true, expire: true },
|
|
68
56
|
};
|
|
69
|
-
const TUI_INPUT_CARD_GROUP_OPTIONS =
|
|
70
|
-
factory: () => TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS,
|
|
71
|
-
});
|
|
72
|
-
function tuiInputCardGroupOptionsProvider(options) {
|
|
73
|
-
return tuiProvideOptions(TUI_INPUT_CARD_GROUP_OPTIONS, options, TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS);
|
|
74
|
-
}
|
|
57
|
+
const [TUI_INPUT_CARD_GROUP_OPTIONS, tuiInputCardGroupOptionsProvider] = tuiCreateOptions(TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS);
|
|
75
58
|
|
|
76
59
|
const TUI_INPUT_CARD_GROUP_TEXTS = new InjectionToken(ngDevMode ? 'TUI_INPUT_CARD_GROUP_TEXTS' : '');
|
|
77
60
|
const TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER = {
|
|
78
61
|
provide: TUI_INPUT_CARD_GROUP_TEXTS,
|
|
79
|
-
useFactory: () =>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
useFactory: () => {
|
|
63
|
+
const cardGroupTexts = inject(TUI_INPUT_CARD_GROUP_TEXTS, {
|
|
64
|
+
skipSelf: true,
|
|
65
|
+
optional: true,
|
|
66
|
+
});
|
|
67
|
+
const breakpoint = inject(TUI_BREAKPOINT);
|
|
68
|
+
const directive = inject(TuiInputCardGroupDirective);
|
|
69
|
+
const compact = computed(() => directive.compact() || breakpoint() === 'mobile');
|
|
70
|
+
const cardNumber = inject(TUI_CARD_NUMBER_TEXTS);
|
|
71
|
+
const expiry = inject(TUI_CARD_EXPIRY_TEXTS);
|
|
72
|
+
const cvcTexts = inject(TUI_CARD_CVC_TEXTS);
|
|
73
|
+
return computed(() => cardGroupTexts?.() ?? {
|
|
74
|
+
cardNumberText: cardNumber()[Number(!compact())] ?? '',
|
|
75
|
+
expiryText: expiry()[Number(!compact())] ?? '',
|
|
76
|
+
cvcText: cvcTexts()[Number(!compact())] ?? '',
|
|
77
|
+
});
|
|
78
|
+
},
|
|
90
79
|
};
|
|
91
80
|
|
|
92
81
|
class TuiInputCardGroup extends TuiControl {
|
|
93
82
|
constructor() {
|
|
94
83
|
super(...arguments);
|
|
84
|
+
this.inputCard = viewChild('inputCard');
|
|
85
|
+
this.inputExpire = viewChild('inputExpire');
|
|
86
|
+
this.inputCVC = viewChild('inputCVC');
|
|
95
87
|
this.doc = inject(DOCUMENT);
|
|
96
88
|
this.isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
97
89
|
this.focus$ = new Subject();
|
|
98
|
-
this.expirePrefilled = false;
|
|
90
|
+
this.expirePrefilled = signal(false);
|
|
99
91
|
this.paymentSystems = inject(TUI_PAYMENT_SYSTEM_ICONS);
|
|
100
92
|
this.options = inject(TUI_INPUT_CARD_GROUP_OPTIONS);
|
|
101
93
|
this.el = tuiInjectElement();
|
|
102
94
|
this.hover = tuiHovered();
|
|
103
95
|
this.focusedIn = tuiFocusedIn(this.el);
|
|
104
|
-
this.
|
|
96
|
+
this.cvcMask = computed(() => TUI_MASK_CVC(this.codeLength() ?? 3));
|
|
105
97
|
this.cvcHidden = this.options.cvcHidden;
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
98
|
+
this.cvcPlaceholder = computed((length = this.codeLength()) => length ? '0'.repeat(length) : this.options.cvcPlaceholder);
|
|
99
|
+
this.cvcPrefilled = computed(() => !this.inputs().cvc || !!this.cvc().match(TUI_NON_DIGIT_REGEXP));
|
|
100
|
+
this.cardPrefilled = computed(() => !!this.card().match(TUI_NON_DIGIT_REGEXP));
|
|
101
|
+
this.focusable = computed(() => this.cardValidator()(this.card()) || this.cardPrefilled());
|
|
102
|
+
this.expireFocusable = computed(() => this.focusable() && !this.expirePrefilled());
|
|
103
|
+
this.isMobile = inject(WA_IS_MOBILE);
|
|
104
|
+
this.isWebkit = inject(WA_IS_WEBKIT);
|
|
109
105
|
this.dropdown = inject(TuiDropdownDirective);
|
|
110
106
|
this.maskCard = TUI_MASK_CARD;
|
|
111
107
|
this.maskExpire = TUI_MASK_EXPIRE;
|
|
112
108
|
this.icons = inject(TUI_COMMON_ICONS);
|
|
113
109
|
this.textfield = inject(TUI_TEXTFIELD_OPTIONS);
|
|
114
|
-
this.texts =
|
|
115
|
-
this.open =
|
|
110
|
+
this.texts = inject(TUI_INPUT_CARD_GROUP_TEXTS);
|
|
111
|
+
this.open = inject(TuiDropdownOpen).open;
|
|
116
112
|
this.$ = this.isWebkit
|
|
117
113
|
? this.focus$
|
|
118
114
|
.pipe(switchMap(() => timer(100)), takeUntilDestroyed())
|
|
119
|
-
.subscribe(() => (this.expire ? this.focusCVC() : this.focusExpire()))
|
|
115
|
+
.subscribe(() => (this.expire() ? this.focusCVC() : this.focusExpire()))
|
|
120
116
|
: EMPTY;
|
|
117
|
+
this.card = computed(() => this.value()?.card || '');
|
|
118
|
+
this.expire = computed(() => this.value()?.expire || '');
|
|
119
|
+
this.cvc = computed(() => this.value()?.cvc || '');
|
|
121
120
|
this.m = tuiAppearanceMode(this.mode);
|
|
122
121
|
this.appearance = tuiAppearance(inject(TUI_TEXTFIELD_OPTIONS).appearance);
|
|
123
122
|
this.state = tuiAppearanceState(
|
|
124
123
|
// eslint-disable-next-line no-nested-ternary
|
|
125
124
|
computed(() => (this.disabled() ? 'disabled' : this.hover() ? 'hover' : null)));
|
|
126
125
|
this.focus = tuiAppearanceFocus(computed(() => this.open() || this.focusedIn()));
|
|
127
|
-
this.labelRaised = computed(() => (this.focus() && !this.readOnly()) || !!this.
|
|
128
|
-
this.hasCleaner = computed(() =>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
this.
|
|
138
|
-
/** @deprecated apparently "off" doesn't disable autocomplete */
|
|
139
|
-
this.autocomplete = this.options.autocomplete;
|
|
140
|
-
this.binChange = new EventEmitter();
|
|
141
|
-
}
|
|
142
|
-
set codeLength(length) {
|
|
143
|
-
this.exampleTextCVC = '0'.repeat(length);
|
|
144
|
-
this.maskCVC = TUI_MASK_CVC(length);
|
|
145
|
-
}
|
|
146
|
-
get bin() {
|
|
147
|
-
return this.card.length < 6 ? null : this.card.slice(0, 6);
|
|
148
|
-
}
|
|
149
|
-
ngAfterViewInit() {
|
|
150
|
-
// Enabling transitions
|
|
151
|
-
setTimeout(() => this.el.style.removeProperty('--tui-duration'), 500);
|
|
126
|
+
this.labelRaised = computed(() => (this.focus() && !this.readOnly()) || !!this.card());
|
|
127
|
+
this.hasCleaner = computed(() => this.textfield.cleaner() && this.card() && this.interactive());
|
|
128
|
+
this.bin = computed(() => this.card().length < 6 ? null : this.card().slice(0, 6));
|
|
129
|
+
this.content = computed((system = tuiGetPaymentSystem(this.card())) => this.icon() || (system && this.paymentSystems[system]));
|
|
130
|
+
this.placeholder = input(this.options.placeholder);
|
|
131
|
+
this.inputs = input(this.options.inputs);
|
|
132
|
+
this.cardValidator = input(this.options.cardValidator);
|
|
133
|
+
this.icon = input('');
|
|
134
|
+
this.id = input(tuiGenerateId());
|
|
135
|
+
this.codeLength = input();
|
|
136
|
+
this.binChange = output();
|
|
152
137
|
}
|
|
153
138
|
writeValue(value) {
|
|
154
|
-
const
|
|
139
|
+
const bin = this.bin();
|
|
155
140
|
const { activeElement } = this.doc;
|
|
156
141
|
super.writeValue(value);
|
|
157
142
|
this.updateBin(bin);
|
|
158
|
-
this.expirePrefilled
|
|
143
|
+
this.expirePrefilled.set(!!this.expire() && this.cardPrefilled());
|
|
159
144
|
// Programmatic setting of expire input value breaks autofill in Chrome
|
|
160
|
-
|
|
145
|
+
const inputExpire = this.inputExpire();
|
|
146
|
+
if (!inputExpire ||
|
|
161
147
|
this.isMobile ||
|
|
162
148
|
this.isWebkit ||
|
|
163
149
|
this.isServer ||
|
|
164
|
-
|
|
150
|
+
inputExpire.nativeElement.value === this.expire()) {
|
|
165
151
|
return;
|
|
166
152
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.doc.execCommand('insertText', false, this.expire);
|
|
170
|
-
|
|
153
|
+
inputExpire.nativeElement.focus({ preventScroll: true });
|
|
154
|
+
inputExpire.nativeElement.select();
|
|
155
|
+
this.doc.execCommand('insertText', false, this.expire());
|
|
156
|
+
inputExpire.nativeElement.blur();
|
|
171
157
|
activeElement?.focus({ preventScroll: true });
|
|
172
158
|
}
|
|
173
|
-
/** Public API for manual focus management */
|
|
174
159
|
focusCard() {
|
|
175
|
-
this.inputCard?.nativeElement.focus({ preventScroll: true });
|
|
160
|
+
this.inputCard()?.nativeElement.focus({ preventScroll: true });
|
|
176
161
|
}
|
|
177
162
|
focusExpire() {
|
|
178
|
-
if (this.inputs.expire) {
|
|
179
|
-
this.inputExpire?.nativeElement.focus({ preventScroll: true });
|
|
163
|
+
if (this.inputs().expire) {
|
|
164
|
+
this.inputExpire()?.nativeElement.focus({ preventScroll: true });
|
|
180
165
|
}
|
|
181
166
|
else {
|
|
182
|
-
this.inputCVC?.nativeElement.focus({ preventScroll: true });
|
|
167
|
+
this.inputCVC()?.nativeElement.focus({ preventScroll: true });
|
|
183
168
|
}
|
|
184
169
|
}
|
|
185
170
|
focusCVC() {
|
|
186
|
-
this.inputCVC?.nativeElement.focus({ preventScroll: true });
|
|
171
|
+
this.inputCVC()?.nativeElement.focus({ preventScroll: true });
|
|
187
172
|
}
|
|
188
173
|
handleOption(option) {
|
|
189
174
|
const { card = '', expire = '', cvc = '' } = option || {};
|
|
190
|
-
const
|
|
191
|
-
const element = (!card && this.inputCard?.nativeElement) ||
|
|
192
|
-
(!expire && this.inputExpire?.nativeElement) ||
|
|
193
|
-
this.inputCVC?.nativeElement;
|
|
175
|
+
const bin = this.bin();
|
|
176
|
+
const element = (!card && this.inputCard()?.nativeElement) ||
|
|
177
|
+
(!expire && this.inputExpire()?.nativeElement) ||
|
|
178
|
+
this.inputCVC()?.nativeElement;
|
|
194
179
|
this.onChange({ card, expire, cvc });
|
|
195
180
|
this.updateBin(bin);
|
|
196
181
|
this.open.set(false);
|
|
197
|
-
this.expirePrefilled
|
|
182
|
+
this.expirePrefilled.set(!!expire);
|
|
198
183
|
element?.focus();
|
|
199
184
|
}
|
|
200
185
|
clear() {
|
|
201
|
-
this.expirePrefilled
|
|
202
|
-
[this.inputCVC, this.inputExpire, this.inputCard].forEach((e) => {
|
|
186
|
+
this.expirePrefilled.set(false);
|
|
187
|
+
[this.inputCVC(), this.inputExpire(), this.inputCard()].forEach((e) => {
|
|
203
188
|
e?.nativeElement.focus();
|
|
204
189
|
e?.nativeElement.select();
|
|
205
190
|
e?.nativeElement.ownerDocument.execCommand('delete');
|
|
206
191
|
});
|
|
207
192
|
this.onChange(null);
|
|
208
193
|
}
|
|
209
|
-
onResize() {
|
|
210
|
-
this.cdr.detectChanges();
|
|
211
|
-
}
|
|
212
|
-
get content() {
|
|
213
|
-
const system = this.getPaymentSystem(this.card);
|
|
214
|
-
return this.icon || (system && this.paymentSystems[system]);
|
|
215
|
-
}
|
|
216
|
-
get card() {
|
|
217
|
-
return this.value()?.card || '';
|
|
218
|
-
}
|
|
219
|
-
get expire() {
|
|
220
|
-
return this.value()?.expire || '';
|
|
221
|
-
}
|
|
222
|
-
get cvc() {
|
|
223
|
-
return this.value()?.cvc || '';
|
|
224
|
-
}
|
|
225
194
|
get cardCollapsed() {
|
|
226
|
-
return
|
|
227
|
-
!tuiIsNativeFocused(this.inputCard?.nativeElement));
|
|
228
|
-
}
|
|
229
|
-
get tailLength() {
|
|
230
|
-
return this.card.length % 4 > 0 ? 5 : 4;
|
|
231
|
-
}
|
|
232
|
-
get cardPrefilled() {
|
|
233
|
-
return !!this.card.match(TUI_NON_DIGIT_REGEXP);
|
|
234
|
-
}
|
|
235
|
-
get cvcPrefilled() {
|
|
236
|
-
return !this.inputs.cvc || !!this.cvc.match(TUI_NON_DIGIT_REGEXP);
|
|
237
|
-
}
|
|
238
|
-
get cardFocusable() {
|
|
239
|
-
return !this.cardPrefilled;
|
|
195
|
+
return this.focusable() && !tuiIsFocused(this.inputCard()?.nativeElement);
|
|
240
196
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
get cvcFocusable() {
|
|
245
|
-
return this.isFocusable(this.card);
|
|
246
|
-
}
|
|
247
|
-
get masked() {
|
|
248
|
-
return this.cardPrefilled ? `${this.card.slice(-4)}` : '';
|
|
197
|
+
onResize() {
|
|
198
|
+
this.cdr.detectChanges();
|
|
249
199
|
}
|
|
250
200
|
onCardChange(card) {
|
|
251
|
-
const
|
|
201
|
+
const bin = this.bin();
|
|
252
202
|
const parsed = card.split(CHAR_NO_BREAK_SPACE).join('');
|
|
253
|
-
if (
|
|
203
|
+
if (this.card() === parsed) {
|
|
254
204
|
return;
|
|
255
205
|
}
|
|
256
206
|
this.updateProperty(parsed, 'card');
|
|
257
207
|
this.updateBin(bin);
|
|
258
|
-
if (this.cardValidator(this.card) && !
|
|
208
|
+
if (this.cardValidator()(this.card()) && !this.expire() && this.inputExpire()) {
|
|
259
209
|
this.focusExpire();
|
|
260
210
|
// Safari autofill focus jerk workaround
|
|
261
211
|
this.focus$.next();
|
|
@@ -264,7 +214,7 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
264
214
|
onExpireChange(expire) {
|
|
265
215
|
this.updateProperty(expire, 'expire');
|
|
266
216
|
// MM/YY
|
|
267
|
-
if (Number(this.inputExpire?.nativeElement.selectionStart) === 5) {
|
|
217
|
+
if (Number(this.inputExpire()?.nativeElement.selectionStart) === 5) {
|
|
268
218
|
this.focusCVC();
|
|
269
219
|
}
|
|
270
220
|
}
|
|
@@ -286,16 +236,9 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
286
236
|
toggle() {
|
|
287
237
|
this.open.update((open) => !open);
|
|
288
238
|
}
|
|
289
|
-
isFocusable(card) {
|
|
290
|
-
return this.cardValidator(card) || this.cardPrefilled;
|
|
291
|
-
}
|
|
292
|
-
getPaymentSystem(value) {
|
|
293
|
-
return this.options.paymentSystemHandler(value);
|
|
294
|
-
}
|
|
295
239
|
updateBin(oldBin) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
this.binChange.emit(bin);
|
|
240
|
+
if (this.bin() !== oldBin && !this.cardPrefilled()) {
|
|
241
|
+
this.binChange.emit(this.bin());
|
|
299
242
|
}
|
|
300
243
|
}
|
|
301
244
|
updateProperty(value, propName) {
|
|
@@ -305,40 +248,33 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
305
248
|
this.onChange(newValue.expire || newValue.cvc || newValue.card ? newValue : null);
|
|
306
249
|
}
|
|
307
250
|
focusInput() {
|
|
308
|
-
const element = (this.
|
|
309
|
-
(this.expireFocusable && this.inputExpire?.nativeElement) ||
|
|
310
|
-
this.inputCVC?.nativeElement;
|
|
251
|
+
const element = (!this.cardPrefilled() && this.inputCard()?.nativeElement) ||
|
|
252
|
+
(this.expireFocusable() && this.inputExpire()?.nativeElement) ||
|
|
253
|
+
this.inputCVC()?.nativeElement;
|
|
311
254
|
element?.focus();
|
|
312
255
|
}
|
|
313
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
314
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
257
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiInputCardGroup, isStandalone: true, selector: "tui-input-card-group", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputs: { classPropertyName: "inputs", publicName: "inputs", isSignal: true, isRequired: false, transformFunction: null }, cardValidator: { classPropertyName: "cardValidator", publicName: "cardValidator", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, codeLength: { classPropertyName: "codeLength", publicName: "codeLength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { binChange: "binChange" }, host: { listeners: { "pointerdown": "onPointerDown($event)", "scroll.zoneless": "$event.target.scrollLeft = 0", "tuiActiveZoneChange": "onTouched()" }, properties: { "attr.data-size": "textfield.size()" } }, providers: [
|
|
315
258
|
tuiAsDataListHost(TuiInputCardGroup),
|
|
316
259
|
tuiAsControl(TuiInputCardGroup),
|
|
317
260
|
tuiDropdownOptionsProvider({ limitWidth: 'fixed' }),
|
|
318
261
|
TuiHoveredService,
|
|
319
262
|
TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER,
|
|
320
|
-
], viewQueries: [{ propertyName: "inputCard", first: true, predicate: ["inputCard"], descendants: true, static: true }, { propertyName: "inputExpire", first: true, predicate: ["inputExpire"], descendants: true, static: true }, { propertyName: "inputCVC", first: true, predicate: ["inputCVC"], descendants: true, static: true }], usesInheritance: true, hostDirectives: [{ directive: i1.TuiAppearance }, { directive: i2.TuiDropdownDirective }, { directive: i2.TuiWithDropdownOpen }, { directive: TuiInputCardGroupDirective, inputs: ["compact", "compact"] }], ngImport: i0, template: "<div class=\"t-wrapper\">\n <label\n *tuiLet=\"value()?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n (click.zoneless.prevent)=\"(0)\"\n >\n <input\n #inputCard\n autocomplete=\"cc-number\"\n automation-id=\"tui-input-card-group__card\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input t-input_card\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [attr.id]=\"id + '_card'\"\n [class.t-input_filled]=\"card.length\"\n [class.t-input_inert]=\"cardPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cardPrefilled ? '' : placeholder || exampleText\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"cardFocusable ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCardChange($event)\"\n />\n <span\n aria-hidden=\"true\"\n translate=\"no\"\n class=\"t-collapsed\"\n [attr.data-before]=\"masked\"\n [class.t-collapsed_enable-mask]=\"cardCollapsed\"\n (waResizeObserver)=\"onResize()\"\n >\n <span\n #ghost\n class=\"t-ghost\"\n [textContent]=\"formattedCard.slice(-tailLength)\"\n ></span>\n\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [style]=\"getStyle(ghost)\"\n [textContent]=\"formattedCard\"\n ></span>\n </span>\n </span>\n <div\n class=\"t-label\"\n [attr.data-label]=\"texts()?.cardNumberText\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n <ng-content />\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputExpire\n autocomplete=\"cc-exp\"\n automation-id=\"tui-input-card-group__expire\"\n inputmode=\"numeric\"\n maxlength=\"5\"\n name=\"ccexpiryyear\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"id + '_expire'\"\n [class.t-input_inert]=\"!expireFocusable\"\n [class.t-input_prefilled]=\"!inputs.expire\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"inputs.expire ? '00/00' : '\u2022\u2022/\u2022\u2022'\"\n [readOnly]=\"readOnly() || !inputs.expire\"\n [tabIndex]=\"expireFocusable || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onExpireChange($event)\"\n />\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.expiryText }}\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCVC\n autocomplete=\"cc-csc\"\n automation-id=\"tui-input-card-group__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"id + '_cvc'\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCVC\"\n [ngModel]=\"cvc\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [readOnly]=\"readOnly() || cvcPrefilled\"\n [tabIndex]=\"cvcFocusable || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCVCChange($event)\"\n />\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.cvcText }}\n </div>\n </label>\n</div>\n<div class=\"t-icons\">\n <div\n *ngIf=\"content\"\n class=\"t-icon-outlet\"\n >\n <img\n *polymorpheusOutlet=\"content as src\"\n alt=\"\"\n automation-id=\"tui-input-card-group__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n <tui-icon\n *ngIf=\"hasCleaner()\"\n automation-id=\"tui-input-card-group__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n [style.border-width.rem]=\"0.25\"\n (click)=\"clear()\"\n />\n <tui-icon\n *ngIf=\"dropdown._content()\"\n automation-id=\"tui-input-card-group__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n class=\"t-icon\"\n (click)=\"toggle()\"\n />\n</div>\n", styles: ["@keyframes outside{0%{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}to{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}}@keyframes inside{0%{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}to{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}}:host{--t-height: var(--tui-height-l);--t-padding: var(--tui-padding-l);--t-label: -.7rem;--t-label-size: .83em;--t-translate: 6.5625rem;--t-collapsed-offset: 1.4375rem;position:relative;display:block;block-size:var(--t-height);inline-size:29.5rem;border-radius:var(--tui-radius-l);overflow:hidden;font:var(--tui-font-text-ui-m);isolation:isolate}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);--t-collapsed-offset: 1.125rem;border-radius:var(--tui-radius-m);font:var(--tui-font-text-ui-s)}:host[data-size=m] .t-card{inline-size:1.5rem;block-size:1.5rem}:host[data-size=m] [tuiChevron]{margin-inline-end:-.875rem;margin-inline-start:.125rem}:host._compact{inline-size:18rem;--t-translate: 4.125rem}:host[tuiAppearance][data-appearance]:has(:-webkit-autofill){background:var(--tui-service-autofill-background)!important}:host [tuiChevron]{block-size:auto;align-self:stretch;border-inline-end:var(--t-padding) solid transparent;margin-inline-end:-.75rem;box-sizing:content-box;font-size:1rem;cursor:pointer}.t-wrapper{position:absolute;z-index:1;inline-size:100%;block-size:100%;transition:opacity 0s var(--tui-duration)}.t-wrapper_cvc,.t-wrapper_expire{opacity:0;pointer-events:none;animation:outside var(--tui-duration) ease-in-out}.t-wrapper_cvc{margin-inline-start:7.1875rem}:host._compact .t-wrapper_cvc{margin-inline-start:4.0625rem}.t-wrapper_active{transition:none;pointer-events:auto;opacity:1;animation:inside var(--tui-duration) ease-in-out forwards}.t-card{inline-size:2rem;block-size:2rem}.t-collapsed{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;padding:calc(var(--t-height) / 3) var(--t-padding) 0;box-sizing:border-box;line-height:calc(2 * var(--t-height) / 3);color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed:after{content:\"*\";float:left;opacity:0}:host-context([dir=\"rtl\"]) .t-collapsed:after{float:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask:after{opacity:1}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask:after{transition:opacity 0s var(--tui-duration)}.t-collapsed_enable-mask .t-collapsed-wrapper{left:var(--t-collapsed-offset)}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask .t-collapsed-wrapper{left:unset}.t-collapsed-wrapper{position:absolute;top:0;display:block;inline-size:100%;block-size:100%;overflow:hidden}.t-value{transition-property:transform,clip-path;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{right:unset;left:100%;transform:translate3d(calc(100% * var(--tui-inline)),0,0)!important}.t-input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;z-index:1;border:0;margin:0;padding:calc(var(--t-height) / 3) var(--t-padding) 0;outline:none;background:transparent;box-sizing:border-box;font:inherit;color:var(--tui-text-primary);direction:ltr}:host-context([dir=\"rtl\"]) .t-input{text-align:end}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input_prefilled::placeholder{color:var(--tui-text-primary)}.t-input[chrome-autofilled],.t-input:-webkit-autofill{-webkit-text-fill-color:var(--tui-text-primary)!important;caret-color:var(--tui-text-primary)!important;-webkit-transition:background-color 600000s 0s;transition:background-color 600000s 0s}.t-input.t-input.t-input_card:not(:-webkit-autofill):not(:focus:placeholder-shown),.t-input.t-input.t-input_card.t-input_filled{caret-color:var(--tui-text-primary);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input.t-input.t-input_card::-webkit-credit-card-auto-fill-button{content:none!important;position:absolute;left:-60rem;top:-60rem;z-index:-999;display:none!important;background:transparent!important;pointer-events:none!important}.t-input_inert{pointer-events:none}.t-input_cvc_hidden{-webkit-text-security:disc}.t-icons{position:absolute;right:1rem;z-index:1;display:flex;align-items:center;block-size:100%;gap:.25rem;pointer-events:none}@supports (inset-inline-end: 0){.t-icons{right:unset;inset-inline-end:1rem}}.t-icon-outlet{display:flex;margin-inline-end:.25rem}.t-icon{cursor:pointer;pointer-events:auto}.t-label{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;margin:0 var(--t-padding);line-height:var(--t-height);color:var(--tui-text-secondary)}.t-label:empty:before{content:attr(data-label)}input:-webkit-autofill~.t-label,.t-label_raised{font-size:var(--t-label-size);transform:translateY(var(--t-label))}:host([data-mode~=\"invalid\"]) input:-webkit-autofill~.t-label,:host([data-mode~=\"invalid\"]) .t-label_raised{color:var(--tui-text-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAppearance, selector: "[tuiAppearance]", inputs: ["tuiAppearance", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceMode"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "pipe", type: TuiFormatCardPipe, name: "tuiFormatCard" }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "pipe", type: TuiIconPipe, name: "tuiIcon" }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "directive", type: WaResizeObserver, selector: "[waResizeObserver]", inputs: ["box"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
263
|
+
], viewQueries: [{ propertyName: "inputCard", first: true, predicate: ["inputCard"], descendants: true, isSignal: true }, { propertyName: "inputExpire", first: true, predicate: ["inputExpire"], descendants: true, isSignal: true }, { propertyName: "inputCVC", first: true, predicate: ["inputCVC"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.TuiAppearance }, { directive: i2.TuiDropdownDirective }, { directive: i2.TuiWithDropdownOpen }, { directive: TuiInputCardGroupDirective, inputs: ["compact", "compact"] }], ngImport: i0, template: "@let formattedCard = card() | tuiFormatCard: cardPrefilled();\n\n<div class=\"t-wrapper\">\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCard\n autocomplete=\"cc-number\"\n automation-id=\"tui-input-card-group__card\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input t-input_card\"\n [attr.aria-invalid]=\"!cardPrefilled() && !(this.card() | tuiMapper: cardValidator())\"\n [attr.id]=\"`${id()}_card`\"\n [class.t-input_filled]=\"card().length\"\n [class.t-input_inert]=\"cardPrefilled()\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cardPrefilled() ? '' : placeholder()\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"cardPrefilled() ? -1 : 0\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCardChange($event)\"\n />\n <span\n aria-hidden=\"true\"\n translate=\"no\"\n class=\"t-collapsed\"\n [attr.data-before]=\"cardPrefilled() ? card().slice(-4) : ''\"\n [class.t-collapsed_enable-mask]=\"cardCollapsed\"\n (waResizeObserver)=\"onResize()\"\n >\n <span\n #ghost\n class=\"t-ghost\"\n [textContent]=\"formattedCard.slice(card().length % 4 > 0 ? -5 : -4)\"\n ></span>\n\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [style]=\"getStyle(ghost)\"\n [textContent]=\"formattedCard\"\n ></span>\n </span>\n </span>\n <div\n tuiTransitioned\n class=\"t-label\"\n [attr.data-label]=\"texts().cardNumberText\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n <ng-content />\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputExpire\n autocomplete=\"cc-exp\"\n automation-id=\"tui-input-card-group__expire\"\n inputmode=\"numeric\"\n maxlength=\"5\"\n name=\"ccexpiryyear\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"`${id()}_expire`\"\n [class.t-input_inert]=\"!expireFocusable()\"\n [class.t-input_prefilled]=\"!inputs().expire\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire()\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"inputs().expire ? '00/00' : '\u2022\u2022/\u2022\u2022'\"\n [readOnly]=\"readOnly() || !inputs().expire\"\n [tabIndex]=\"expireFocusable() || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onExpireChange($event)\"\n />\n <div\n tuiTransitioned\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts().expiryText }}\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCVC\n autocomplete=\"cc-csc\"\n automation-id=\"tui-input-card-group__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"`${id()}_cvc`\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled()\"\n [disabled]=\"disabled()\"\n [maskito]=\"cvcMask()\"\n [ngModel]=\"cvc()\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cvcPrefilled() ? '\u2022\u2022\u2022' : cvcPlaceholder()\"\n [readOnly]=\"readOnly() || cvcPrefilled()\"\n [tabIndex]=\"focusable() || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCVCChange($event)\"\n />\n <div\n tuiTransitioned\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts().cvcText }}\n </div>\n </label>\n</div>\n<div class=\"t-icons\">\n @if (content()) {\n <div class=\"t-icon-outlet\">\n <img\n *polymorpheusOutlet=\"content() as src\"\n alt=\"\"\n automation-id=\"tui-input-card-group__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n }\n @if (hasCleaner()) {\n <tui-icon\n automation-id=\"tui-input-card-group__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n (click)=\"clear()\"\n />\n }\n @if (dropdown.content()) {\n <tui-icon\n automation-id=\"tui-input-card-group__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n class=\"t-icon\"\n (click)=\"toggle()\"\n />\n }\n</div>\n", styles: ["@keyframes outside{0%{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}to{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}}@keyframes inside{0%{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}to{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}}:host{--t-height: var(--tui-height-l);--t-padding: var(--tui-padding-l);--t-label: -.7rem;--t-label-size: .83em;--t-translate: 6.5rem;--t-collapsed-offset: 1.4375rem;position:relative;display:block;block-size:var(--t-height);min-inline-size:24rem;border-radius:var(--tui-radius-l);overflow:hidden;font:var(--tui-font-ui-m);isolation:isolate}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);--t-collapsed-offset: 1.125rem;border-radius:var(--tui-radius-m);font:var(--tui-font-ui-s)}:host[data-size=m] .t-card{inline-size:1.5rem;block-size:1.5rem}:host[data-size=m] [tuiChevron]{margin-inline-end:-.875rem;margin-inline-start:.125rem}:host._compact{min-inline-size:19rem;--t-translate: 4rem}:host[tuiAppearance][data-appearance]:has(:-webkit-autofill,[chrome-autofilled]){background:var(--tui-service-autofill-background)!important}:host [tuiChevron]{block-size:auto;align-self:stretch;border-inline-end:var(--t-padding) solid transparent;margin-inline-end:-.75rem;box-sizing:content-box;font-size:1rem;cursor:pointer}.t-wrapper{position:absolute;z-index:1;inline-size:100%;block-size:var(--t-height);transition:opacity 0s var(--tui-duration)}.t-wrapper_cvc,.t-wrapper_expire{opacity:0;pointer-events:none;animation:outside var(--tui-duration) ease-in-out}.t-wrapper_cvc{margin-inline-start:7rem}:host._compact .t-wrapper_cvc{margin-inline-start:4rem}.t-wrapper_active{transition:none;pointer-events:auto;opacity:1;animation:inside var(--tui-duration) ease-in-out forwards}.t-card{inline-size:2rem;block-size:2rem}.t-collapsed{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;padding:calc(var(--t-height) / 3) var(--t-padding) 0;box-sizing:border-box;line-height:calc(2 * var(--t-height) / 3);color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed:after{content:\"*\";float:left;opacity:0}:host-context([dir=\"rtl\"]) .t-collapsed:after{float:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask:after{opacity:1}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask:after{transition:opacity 0s var(--tui-duration)}.t-collapsed_enable-mask .t-collapsed-wrapper{inset-inline-start:var(--t-collapsed-offset)}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask .t-collapsed-wrapper{inset-inline-start:unset}.t-collapsed-wrapper{position:absolute;display:block;inset-block-start:0;inline-size:100%;block-size:100%;overflow:hidden}.t-value{transition-property:transform,clip-path;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;display:block;inset-block:auto 0;inset-inline:auto 100%;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{transform:translate3d(calc(100% * var(--tui-inline)),0,0)!important}.t-input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;z-index:1;border:0;margin:0;padding:calc(var(--t-height) / 3) var(--t-padding) 0;outline:none;background:transparent;box-sizing:border-box;font:inherit;color:var(--tui-text-primary);direction:ltr}:host-context([dir=\"rtl\"]) .t-input{text-align:end}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input_prefilled::placeholder{color:var(--tui-text-primary)}.t-input[chrome-autofilled],.t-input:-webkit-autofill{-webkit-text-fill-color:var(--tui-text-primary)!important;caret-color:var(--tui-text-primary)!important;transition:background-color 600000s 0s}.t-input.t-input.t-input_card:not(:-webkit-autofill,[chrome-autofilled]):not(:focus:placeholder-shown),.t-input.t-input.t-input_card.t-input_filled{caret-color:var(--tui-text-primary);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input.t-input.t-input_card::-webkit-credit-card-auto-fill-button{content:none!important;position:absolute;z-index:-999;display:none!important;inset:-60rem 0 0 -60rem;background:transparent!important;pointer-events:none!important}.t-input_inert{pointer-events:none}.t-input_cvc_hidden{-webkit-text-security:disc}.t-icons{position:absolute;z-index:1;display:flex;inset-inline-end:1rem;align-items:center;block-size:var(--t-height);gap:.25rem;pointer-events:none}.t-icon-outlet{display:flex;margin-inline-end:.25rem}.t-icon{cursor:pointer;pointer-events:auto}.t-icon:before{font-size:1rem}.t-label{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;margin:0 var(--t-padding);line-height:var(--t-height);color:var(--tui-text-secondary)}.t-label:empty:before{content:attr(data-label)}input[chrome-autofilled]~.t-label,input:-webkit-autofill~.t-label,.t-label_raised{font-size:var(--t-label-size);transform:translateY(var(--t-label))}:host([data-mode~=\"invalid\"]) input[chrome-autofilled]~.t-label,:host([data-mode~=\"invalid\"]) input:-webkit-autofill~.t-label,:host([data-mode~=\"invalid\"]) .t-label_raised{color:var(--tui-text-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAppearance, selector: "[tuiAppearance]", inputs: ["tuiAppearance", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceMode"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "pipe", type: TuiFormatCardPipe, name: "tuiFormatCard" }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "pipe", type: TuiIconPipe, name: "tuiIcon" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "directive", type: TuiTransitioned, selector: "[tuiTransitioned]" }, { kind: "directive", type: WaResizeObserver, selector: "[waResizeObserver]", inputs: ["waResizeBox"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
321
264
|
}
|
|
322
|
-
|
|
323
|
-
tuiPure
|
|
324
|
-
], TuiInputCardGroup.prototype, "isFocusable", null);
|
|
325
|
-
__decorate([
|
|
326
|
-
tuiPure
|
|
327
|
-
], TuiInputCardGroup.prototype, "getPaymentSystem", null);
|
|
328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputCardGroup, decorators: [{
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroup, decorators: [{
|
|
329
266
|
type: Component,
|
|
330
|
-
args: [{
|
|
267
|
+
args: [{ selector: 'tui-input-card-group', imports: [
|
|
331
268
|
FormsModule,
|
|
332
269
|
MaskitoDirective,
|
|
333
|
-
NgIf,
|
|
334
270
|
PolymorpheusOutlet,
|
|
335
271
|
TuiAppearance,
|
|
336
272
|
TuiChevron,
|
|
337
273
|
TuiFormatCardPipe,
|
|
338
274
|
TuiIcon,
|
|
339
275
|
TuiIconPipe,
|
|
340
|
-
TuiLet,
|
|
341
276
|
TuiMapperPipe,
|
|
277
|
+
TuiTransitioned,
|
|
342
278
|
WaResizeObserver,
|
|
343
279
|
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
344
280
|
tuiAsDataListHost(TuiInputCardGroup),
|
|
@@ -353,38 +289,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
353
289
|
{ directive: TuiInputCardGroupDirective, inputs: ['compact'] },
|
|
354
290
|
], host: {
|
|
355
291
|
'[attr.data-size]': 'textfield.size()',
|
|
356
|
-
'[style.--tui-duration.s]': '0',
|
|
357
292
|
'(pointerdown)': 'onPointerDown($event)',
|
|
358
293
|
'(scroll.zoneless)': '$event.target.scrollLeft = 0',
|
|
359
|
-
}, template: "<div class=\"t-wrapper\">\n <label\n *tuiLet=\"value()?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n (click.zoneless.prevent)=\"(0)\"\n >\n <input\n #inputCard\n autocomplete=\"cc-number\"\n automation-id=\"tui-input-card-group__card\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input t-input_card\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [attr.id]=\"id + '_card'\"\n [class.t-input_filled]=\"card.length\"\n [class.t-input_inert]=\"cardPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cardPrefilled ? '' : placeholder || exampleText\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"cardFocusable ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCardChange($event)\"\n />\n <span\n aria-hidden=\"true\"\n translate=\"no\"\n class=\"t-collapsed\"\n [attr.data-before]=\"masked\"\n [class.t-collapsed_enable-mask]=\"cardCollapsed\"\n (waResizeObserver)=\"onResize()\"\n >\n <span\n #ghost\n class=\"t-ghost\"\n [textContent]=\"formattedCard.slice(-tailLength)\"\n ></span>\n\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [style]=\"getStyle(ghost)\"\n [textContent]=\"formattedCard\"\n ></span>\n </span>\n </span>\n <div\n class=\"t-label\"\n [attr.data-label]=\"texts()?.cardNumberText\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n <ng-content />\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputExpire\n autocomplete=\"cc-exp\"\n automation-id=\"tui-input-card-group__expire\"\n inputmode=\"numeric\"\n maxlength=\"5\"\n name=\"ccexpiryyear\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"id + '_expire'\"\n [class.t-input_inert]=\"!expireFocusable\"\n [class.t-input_prefilled]=\"!inputs.expire\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"inputs.expire ? '00/00' : '\u2022\u2022/\u2022\u2022'\"\n [readOnly]=\"readOnly() || !inputs.expire\"\n [tabIndex]=\"expireFocusable || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onExpireChange($event)\"\n />\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.expiryText }}\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCVC\n autocomplete=\"cc-csc\"\n automation-id=\"tui-input-card-group__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"id + '_cvc'\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCVC\"\n [ngModel]=\"cvc\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [readOnly]=\"readOnly() || cvcPrefilled\"\n [tabIndex]=\"cvcFocusable || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCVCChange($event)\"\n />\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.cvcText }}\n </div>\n </label>\n</div>\n<div class=\"t-icons\">\n <div\n *ngIf=\"content\"\n class=\"t-icon-outlet\"\n >\n <img\n *polymorpheusOutlet=\"content as src\"\n alt=\"\"\n automation-id=\"tui-input-card-group__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n <tui-icon\n *ngIf=\"hasCleaner()\"\n automation-id=\"tui-input-card-group__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n [style.border-width.rem]=\"0.25\"\n (click)=\"clear()\"\n />\n <tui-icon\n *ngIf=\"dropdown._content()\"\n automation-id=\"tui-input-card-group__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n class=\"t-icon\"\n (click)=\"toggle()\"\n />\n</div>\n", styles: ["@keyframes outside{0%{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}to{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}}@keyframes inside{0%{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}to{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}}:host{--t-height: var(--tui-height-l);--t-padding: var(--tui-padding-l);--t-label: -.7rem;--t-label-size: .83em;--t-translate: 6.5625rem;--t-collapsed-offset: 1.4375rem;position:relative;display:block;block-size:var(--t-height);inline-size:29.5rem;border-radius:var(--tui-radius-l);overflow:hidden;font:var(--tui-font-text-ui-m);isolation:isolate}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);--t-collapsed-offset: 1.125rem;border-radius:var(--tui-radius-m);font:var(--tui-font-text-ui-s)}:host[data-size=m] .t-card{inline-size:1.5rem;block-size:1.5rem}:host[data-size=m] [tuiChevron]{margin-inline-end:-.875rem;margin-inline-start:.125rem}:host._compact{inline-size:18rem;--t-translate: 4.125rem}:host[tuiAppearance][data-appearance]:has(:-webkit-autofill){background:var(--tui-service-autofill-background)!important}:host [tuiChevron]{block-size:auto;align-self:stretch;border-inline-end:var(--t-padding) solid transparent;margin-inline-end:-.75rem;box-sizing:content-box;font-size:1rem;cursor:pointer}.t-wrapper{position:absolute;z-index:1;inline-size:100%;block-size:100%;transition:opacity 0s var(--tui-duration)}.t-wrapper_cvc,.t-wrapper_expire{opacity:0;pointer-events:none;animation:outside var(--tui-duration) ease-in-out}.t-wrapper_cvc{margin-inline-start:7.1875rem}:host._compact .t-wrapper_cvc{margin-inline-start:4.0625rem}.t-wrapper_active{transition:none;pointer-events:auto;opacity:1;animation:inside var(--tui-duration) ease-in-out forwards}.t-card{inline-size:2rem;block-size:2rem}.t-collapsed{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;padding:calc(var(--t-height) / 3) var(--t-padding) 0;box-sizing:border-box;line-height:calc(2 * var(--t-height) / 3);color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed:after{content:\"*\";float:left;opacity:0}:host-context([dir=\"rtl\"]) .t-collapsed:after{float:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask:after{opacity:1}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask:after{transition:opacity 0s var(--tui-duration)}.t-collapsed_enable-mask .t-collapsed-wrapper{left:var(--t-collapsed-offset)}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask .t-collapsed-wrapper{left:unset}.t-collapsed-wrapper{position:absolute;top:0;display:block;inline-size:100%;block-size:100%;overflow:hidden}.t-value{transition-property:transform,clip-path;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{right:unset;left:100%;transform:translate3d(calc(100% * var(--tui-inline)),0,0)!important}.t-input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;z-index:1;border:0;margin:0;padding:calc(var(--t-height) / 3) var(--t-padding) 0;outline:none;background:transparent;box-sizing:border-box;font:inherit;color:var(--tui-text-primary);direction:ltr}:host-context([dir=\"rtl\"]) .t-input{text-align:end}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input_prefilled::placeholder{color:var(--tui-text-primary)}.t-input[chrome-autofilled],.t-input:-webkit-autofill{-webkit-text-fill-color:var(--tui-text-primary)!important;caret-color:var(--tui-text-primary)!important;-webkit-transition:background-color 600000s 0s;transition:background-color 600000s 0s}.t-input.t-input.t-input_card:not(:-webkit-autofill):not(:focus:placeholder-shown),.t-input.t-input.t-input_card.t-input_filled{caret-color:var(--tui-text-primary);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input.t-input.t-input_card::-webkit-credit-card-auto-fill-button{content:none!important;position:absolute;left:-60rem;top:-60rem;z-index:-999;display:none!important;background:transparent!important;pointer-events:none!important}.t-input_inert{pointer-events:none}.t-input_cvc_hidden{-webkit-text-security:disc}.t-icons{position:absolute;right:1rem;z-index:1;display:flex;align-items:center;block-size:100%;gap:.25rem;pointer-events:none}@supports (inset-inline-end: 0){.t-icons{right:unset;inset-inline-end:1rem}}.t-icon-outlet{display:flex;margin-inline-end:.25rem}.t-icon{cursor:pointer;pointer-events:auto}.t-label{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;margin:0 var(--t-padding);line-height:var(--t-height);color:var(--tui-text-secondary)}.t-label:empty:before{content:attr(data-label)}input:-webkit-autofill~.t-label,.t-label_raised{font-size:var(--t-label-size);transform:translateY(var(--t-label))}:host([data-mode~=\"invalid\"]) input:-webkit-autofill~.t-label,:host([data-mode~=\"invalid\"]) .t-label_raised{color:var(--tui-text-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"] }]
|
|
360
|
-
}], propDecorators: { inputCard: [{
|
|
361
|
-
|
|
362
|
-
args: ['inputCard', { static: true }]
|
|
363
|
-
}], inputExpire: [{
|
|
364
|
-
type: ViewChild,
|
|
365
|
-
args: ['inputExpire', { static: true }]
|
|
366
|
-
}], inputCVC: [{
|
|
367
|
-
type: ViewChild,
|
|
368
|
-
args: ['inputCVC', { static: true }]
|
|
369
|
-
}], exampleText: [{
|
|
370
|
-
type: Input
|
|
371
|
-
}], placeholder: [{
|
|
372
|
-
type: Input
|
|
373
|
-
}], inputs: [{
|
|
374
|
-
type: Input
|
|
375
|
-
}], cardValidator: [{
|
|
376
|
-
type: Input
|
|
377
|
-
}], icon: [{
|
|
378
|
-
type: Input
|
|
379
|
-
}], id: [{
|
|
380
|
-
type: Input
|
|
381
|
-
}], autocomplete: [{
|
|
382
|
-
type: Input
|
|
383
|
-
}], binChange: [{
|
|
384
|
-
type: Output
|
|
385
|
-
}], codeLength: [{
|
|
386
|
-
type: Input
|
|
387
|
-
}], isFocusable: [], getPaymentSystem: [] } });
|
|
294
|
+
'(tuiActiveZoneChange)': 'onTouched()',
|
|
295
|
+
}, template: "@let formattedCard = card() | tuiFormatCard: cardPrefilled();\n\n<div class=\"t-wrapper\">\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCard\n autocomplete=\"cc-number\"\n automation-id=\"tui-input-card-group__card\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input t-input_card\"\n [attr.aria-invalid]=\"!cardPrefilled() && !(this.card() | tuiMapper: cardValidator())\"\n [attr.id]=\"`${id()}_card`\"\n [class.t-input_filled]=\"card().length\"\n [class.t-input_inert]=\"cardPrefilled()\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cardPrefilled() ? '' : placeholder()\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"cardPrefilled() ? -1 : 0\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCardChange($event)\"\n />\n <span\n aria-hidden=\"true\"\n translate=\"no\"\n class=\"t-collapsed\"\n [attr.data-before]=\"cardPrefilled() ? card().slice(-4) : ''\"\n [class.t-collapsed_enable-mask]=\"cardCollapsed\"\n (waResizeObserver)=\"onResize()\"\n >\n <span\n #ghost\n class=\"t-ghost\"\n [textContent]=\"formattedCard.slice(card().length % 4 > 0 ? -5 : -4)\"\n ></span>\n\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [style]=\"getStyle(ghost)\"\n [textContent]=\"formattedCard\"\n ></span>\n </span>\n </span>\n <div\n tuiTransitioned\n class=\"t-label\"\n [attr.data-label]=\"texts().cardNumberText\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n <ng-content />\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputExpire\n autocomplete=\"cc-exp\"\n automation-id=\"tui-input-card-group__expire\"\n inputmode=\"numeric\"\n maxlength=\"5\"\n name=\"ccexpiryyear\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"`${id()}_expire`\"\n [class.t-input_inert]=\"!expireFocusable()\"\n [class.t-input_prefilled]=\"!inputs().expire\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire()\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"inputs().expire ? '00/00' : '\u2022\u2022/\u2022\u2022'\"\n [readOnly]=\"readOnly() || !inputs().expire\"\n [tabIndex]=\"expireFocusable() || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onExpireChange($event)\"\n />\n <div\n tuiTransitioned\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts().expiryText }}\n </div>\n </label>\n</div>\n<div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"cardCollapsed\"\n>\n <label (click.zoneless.prevent)=\"(0)\">\n <input\n #inputCVC\n autocomplete=\"cc-csc\"\n automation-id=\"tui-input-card-group__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"`${id()}_cvc`\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled()\"\n [disabled]=\"disabled()\"\n [maskito]=\"cvcMask()\"\n [ngModel]=\"cvc()\"\n [ngModelOptions]=\"{standalone: true}\"\n [placeholder]=\"cvcPrefilled() ? '\u2022\u2022\u2022' : cvcPlaceholder()\"\n [readOnly]=\"readOnly() || cvcPrefilled()\"\n [tabIndex]=\"focusable() || (isMobile && isWebkit) ? 0 : -1\"\n (focus)=\"(0)\"\n (ngModelChange)=\"onCVCChange($event)\"\n />\n <div\n tuiTransitioned\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts().cvcText }}\n </div>\n </label>\n</div>\n<div class=\"t-icons\">\n @if (content()) {\n <div class=\"t-icon-outlet\">\n <img\n *polymorpheusOutlet=\"content() as src\"\n alt=\"\"\n automation-id=\"tui-input-card-group__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n }\n @if (hasCleaner()) {\n <tui-icon\n automation-id=\"tui-input-card-group__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n (click)=\"clear()\"\n />\n }\n @if (dropdown.content()) {\n <tui-icon\n automation-id=\"tui-input-card-group__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n class=\"t-icon\"\n (click)=\"toggle()\"\n />\n }\n</div>\n", styles: ["@keyframes outside{0%{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}to{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}}@keyframes inside{0%{transform:translate3d(calc(100% * var(--tui-inline)),0,0)}to{transform:translate3d(calc(var(--t-translate) * var(--tui-inline)),0,0)}}:host{--t-height: var(--tui-height-l);--t-padding: var(--tui-padding-l);--t-label: -.7rem;--t-label-size: .83em;--t-translate: 6.5rem;--t-collapsed-offset: 1.4375rem;position:relative;display:block;block-size:var(--t-height);min-inline-size:24rem;border-radius:var(--tui-radius-l);overflow:hidden;font:var(--tui-font-ui-m);isolation:isolate}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);--t-collapsed-offset: 1.125rem;border-radius:var(--tui-radius-m);font:var(--tui-font-ui-s)}:host[data-size=m] .t-card{inline-size:1.5rem;block-size:1.5rem}:host[data-size=m] [tuiChevron]{margin-inline-end:-.875rem;margin-inline-start:.125rem}:host._compact{min-inline-size:19rem;--t-translate: 4rem}:host[tuiAppearance][data-appearance]:has(:-webkit-autofill,[chrome-autofilled]){background:var(--tui-service-autofill-background)!important}:host [tuiChevron]{block-size:auto;align-self:stretch;border-inline-end:var(--t-padding) solid transparent;margin-inline-end:-.75rem;box-sizing:content-box;font-size:1rem;cursor:pointer}.t-wrapper{position:absolute;z-index:1;inline-size:100%;block-size:var(--t-height);transition:opacity 0s var(--tui-duration)}.t-wrapper_cvc,.t-wrapper_expire{opacity:0;pointer-events:none;animation:outside var(--tui-duration) ease-in-out}.t-wrapper_cvc{margin-inline-start:7rem}:host._compact .t-wrapper_cvc{margin-inline-start:4rem}.t-wrapper_active{transition:none;pointer-events:auto;opacity:1;animation:inside var(--tui-duration) ease-in-out forwards}.t-card{inline-size:2rem;block-size:2rem}.t-collapsed{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;padding:calc(var(--t-height) / 3) var(--t-padding) 0;box-sizing:border-box;line-height:calc(2 * var(--t-height) / 3);color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed:after{content:\"*\";float:left;opacity:0}:host-context([dir=\"rtl\"]) .t-collapsed:after{float:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask:after{opacity:1}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask:after{transition:opacity 0s var(--tui-duration)}.t-collapsed_enable-mask .t-collapsed-wrapper{inset-inline-start:var(--t-collapsed-offset)}:host-context([dir=\"rtl\"]) .t-collapsed_enable-mask .t-collapsed-wrapper{inset-inline-start:unset}.t-collapsed-wrapper{position:absolute;display:block;inset-block-start:0;inline-size:100%;block-size:100%;overflow:hidden}.t-value{transition-property:transform,clip-path;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;display:block;inset-block:auto 0;inset-inline:auto 100%;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{transform:translate3d(calc(100% * var(--tui-inline)),0,0)!important}.t-input{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;z-index:1;border:0;margin:0;padding:calc(var(--t-height) / 3) var(--t-padding) 0;outline:none;background:transparent;box-sizing:border-box;font:inherit;color:var(--tui-text-primary);direction:ltr}:host-context([dir=\"rtl\"]) .t-input{text-align:end}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input_prefilled::placeholder{color:var(--tui-text-primary)}.t-input[chrome-autofilled],.t-input:-webkit-autofill{-webkit-text-fill-color:var(--tui-text-primary)!important;caret-color:var(--tui-text-primary)!important;transition:background-color 600000s 0s}.t-input.t-input.t-input_card:not(:-webkit-autofill,[chrome-autofilled]):not(:focus:placeholder-shown),.t-input.t-input.t-input_card.t-input_filled{caret-color:var(--tui-text-primary);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input.t-input.t-input_card::-webkit-credit-card-auto-fill-button{content:none!important;position:absolute;z-index:-999;display:none!important;inset:-60rem 0 0 -60rem;background:transparent!important;pointer-events:none!important}.t-input_inert{pointer-events:none}.t-input_cvc_hidden{-webkit-text-security:disc}.t-icons{position:absolute;z-index:1;display:flex;inset-inline-end:1rem;align-items:center;block-size:var(--t-height);gap:.25rem;pointer-events:none}.t-icon-outlet{display:flex;margin-inline-end:.25rem}.t-icon{cursor:pointer;pointer-events:auto}.t-icon:before{font-size:1rem}.t-label{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;margin:0 var(--t-padding);line-height:var(--t-height);color:var(--tui-text-secondary)}.t-label:empty:before{content:attr(data-label)}input[chrome-autofilled]~.t-label,input:-webkit-autofill~.t-label,.t-label_raised{font-size:var(--t-label-size);transform:translateY(var(--t-label))}:host([data-mode~=\"invalid\"]) input[chrome-autofilled]~.t-label,:host([data-mode~=\"invalid\"]) input:-webkit-autofill~.t-label,:host([data-mode~=\"invalid\"]) .t-label_raised{color:var(--tui-text-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"] }]
|
|
296
|
+
}] });
|
|
388
297
|
|
|
389
298
|
/**
|
|
390
299
|
* Generated bundle index. Do not edit.
|