@taiga-ui/addon-commerce 4.52.0-canary.932d3ef → 4.52.0-canary.9c7b1f0
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 -0
- package/components/input-card/input-card.component.d.ts +5 -5
- 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/index.d.ts +1 -0
- package/components/input-card-group/input-card-group.component.d.ts +33 -43
- package/components/input-card-group/input-card-group.directive.d.ts +7 -0
- package/components/input-card-group/input-card-group.options.d.ts +3 -5
- package/components/input-card-group/input-card-group.providers.d.ts +6 -6
- package/components/thumbnail-card/thumbnail-card.component.d.ts +5 -6
- package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs +124 -182
- package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs +72 -12
- package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs +10 -20
- 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 +1 -1
- package/fesm2022/taiga-ui-addon-commerce-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-commerce-pipes-amount.mjs +26 -24
- 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 +2 -3
- package/fesm2022/taiga-ui-addon-commerce-tokens.mjs.map +1 -1
- package/package.json +12 -17
- 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-cvc/index.d.ts +0 -1
- package/components/input-cvc/input-cvc.directive.d.ts +0 -12
- package/components/input-expire/index.d.ts +0 -1
- package/components/input-expire/input-expire.directive.d.ts +0 -8
- package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs +0 -48
- package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs.map +0 -1
- package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs +0 -39
- package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
1
|
import { DOCUMENT, isPlatformServer } from '@angular/common';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
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';
|
|
5
|
+
import * as i4 from '@angular/forms';
|
|
7
6
|
import { FormsModule } from '@angular/forms';
|
|
8
7
|
import { MaskitoDirective } from '@maskito/angular';
|
|
9
8
|
import { WaResizeObserver } from '@ng-web-apis/resize-observer';
|
|
10
9
|
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';
|
|
10
|
+
import { TuiFormatCardPipe } from '@taiga-ui/addon-commerce/pipes/format-card';
|
|
12
11
|
import { TUI_CARD_NUMBER_TEXTS, TUI_CARD_EXPIRY_TEXTS, TUI_CARD_CVC_TEXTS, TUI_PAYMENT_SYSTEM_ICONS } from '@taiga-ui/addon-commerce/tokens';
|
|
13
12
|
import { tuiGetPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
14
13
|
import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
@@ -16,78 +15,91 @@ import { TUI_NON_DIGIT_REGEXP, CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constan
|
|
|
16
15
|
import { tuiHovered, TuiHoveredService } from '@taiga-ui/cdk/directives/hovered';
|
|
17
16
|
import { TuiTransitioned } from '@taiga-ui/cdk/directives/transitioned';
|
|
18
17
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
19
|
-
import { tuiInjectId } from '@taiga-ui/cdk/services';
|
|
20
18
|
import { TUI_IS_MOBILE, TUI_IS_WEBKIT } from '@taiga-ui/cdk/tokens';
|
|
21
19
|
import { tuiInjectElement, tuiIsElement, tuiIsInput } from '@taiga-ui/cdk/utils/dom';
|
|
22
|
-
import { tuiFocusedIn,
|
|
23
|
-
import {
|
|
20
|
+
import { tuiFocusedIn, tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
|
|
21
|
+
import { tuiGenerateId } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
24
22
|
import { tuiAsDataListHost } from '@taiga-ui/core/components/data-list';
|
|
25
23
|
import { TuiIcon, TuiIconPipe } from '@taiga-ui/core/components/icon';
|
|
26
24
|
import { TUI_TEXTFIELD_OPTIONS } from '@taiga-ui/core/components/textfield';
|
|
27
25
|
import * as i1 from '@taiga-ui/core/directives/appearance';
|
|
28
26
|
import { tuiAppearanceMode, tuiAppearance, tuiAppearanceState, tuiAppearanceFocus, TuiAppearance } from '@taiga-ui/core/directives/appearance';
|
|
29
|
-
import * as i2 from '@taiga-ui/core/
|
|
30
|
-
import { TuiDropdownDirective,
|
|
31
|
-
import {
|
|
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';
|
|
32
30
|
import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
|
|
33
31
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
32
|
+
import { Subject, EMPTY, switchMap, timer } from 'rxjs';
|
|
33
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
34
|
+
|
|
35
|
+
class TuiInputCardGroupDirective {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.breakpoint = inject(TUI_BREAKPOINT);
|
|
38
|
+
this.compact = input(false);
|
|
39
|
+
}
|
|
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 }); }
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroupDirective, decorators: [{
|
|
44
|
+
type: Directive,
|
|
45
|
+
args: [{
|
|
46
|
+
host: { '[class._compact]': "compact() || breakpoint() === 'mobile'" },
|
|
47
|
+
}]
|
|
48
|
+
}] });
|
|
37
49
|
|
|
38
50
|
const TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS = {
|
|
39
51
|
cardValidator: tuiDefaultCardValidator,
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
placeholder: '0000 0000 0000 0000',
|
|
53
|
+
cvcPlaceholder: '000',
|
|
42
54
|
cvcHidden: true,
|
|
43
55
|
inputs: { cvc: true, expire: true },
|
|
44
56
|
};
|
|
45
|
-
const TUI_INPUT_CARD_GROUP_OPTIONS =
|
|
46
|
-
factory: () => TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS,
|
|
47
|
-
});
|
|
48
|
-
function tuiInputCardGroupOptionsProvider(options) {
|
|
49
|
-
return tuiProvideOptions(TUI_INPUT_CARD_GROUP_OPTIONS, options, TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS);
|
|
50
|
-
}
|
|
57
|
+
const [TUI_INPUT_CARD_GROUP_OPTIONS, tuiInputCardGroupOptionsProvider] = tuiCreateOptions(TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS);
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const TUI_INPUT_CARD_GROUP_TEXTS = new InjectionToken(ngDevMode ? 'TUI_INPUT_CARD_GROUP_TEXTS' : '');
|
|
60
|
+
const TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER = {
|
|
61
|
+
provide: TUI_INPUT_CARD_GROUP_TEXTS,
|
|
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);
|
|
60
72
|
const cvcTexts = inject(TUI_CARD_CVC_TEXTS);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expiryTexts,
|
|
67
|
-
cvcTexts,
|
|
68
|
-
])), map(([index, cardNumber, expiry, cvcTexts]) => ({
|
|
69
|
-
cardNumberText: cardNumber[index] ?? '',
|
|
70
|
-
expiryText: expiry[index] ?? '',
|
|
71
|
-
cvcText: cvcTexts[index] ?? '',
|
|
72
|
-
})));
|
|
73
|
+
return computed(() => cardGroupTexts?.() ?? {
|
|
74
|
+
cardNumberText: cardNumber()[Number(!compact())] ?? '',
|
|
75
|
+
expiryText: expiry()[Number(!compact())] ?? '',
|
|
76
|
+
cvcText: cvcTexts()[Number(!compact())] ?? '',
|
|
77
|
+
});
|
|
73
78
|
},
|
|
74
|
-
}
|
|
79
|
+
};
|
|
75
80
|
|
|
76
81
|
class TuiInputCardGroup extends TuiControl {
|
|
77
82
|
constructor() {
|
|
78
83
|
super(...arguments);
|
|
84
|
+
this.inputCard = viewChild('inputCard');
|
|
85
|
+
this.inputExpire = viewChild('inputExpire');
|
|
86
|
+
this.inputCVC = viewChild('inputCVC');
|
|
79
87
|
this.doc = inject(DOCUMENT);
|
|
80
88
|
this.isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
81
89
|
this.focus$ = new Subject();
|
|
82
|
-
this.expirePrefilled = false;
|
|
90
|
+
this.expirePrefilled = signal(false);
|
|
83
91
|
this.paymentSystems = inject(TUI_PAYMENT_SYSTEM_ICONS);
|
|
84
92
|
this.options = inject(TUI_INPUT_CARD_GROUP_OPTIONS);
|
|
85
93
|
this.el = tuiInjectElement();
|
|
86
94
|
this.hover = tuiHovered();
|
|
87
95
|
this.focusedIn = tuiFocusedIn(this.el);
|
|
88
|
-
this.
|
|
96
|
+
this.cvcMask = computed(() => TUI_MASK_CVC(this.codeLength() ?? 3));
|
|
89
97
|
this.cvcHidden = this.options.cvcHidden;
|
|
90
|
-
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());
|
|
91
103
|
this.isMobile = inject(TUI_IS_MOBILE);
|
|
92
104
|
this.isWebkit = inject(TUI_IS_WEBKIT);
|
|
93
105
|
this.dropdown = inject(TuiDropdownDirective);
|
|
@@ -95,145 +107,105 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
95
107
|
this.maskExpire = TUI_MASK_EXPIRE;
|
|
96
108
|
this.icons = inject(TUI_COMMON_ICONS);
|
|
97
109
|
this.textfield = inject(TUI_TEXTFIELD_OPTIONS);
|
|
98
|
-
this.texts =
|
|
99
|
-
this.open =
|
|
110
|
+
this.texts = inject(TUI_INPUT_CARD_GROUP_TEXTS);
|
|
111
|
+
this.open = inject(TuiDropdownOpen).open;
|
|
100
112
|
this.$ = this.isWebkit
|
|
101
113
|
? this.focus$
|
|
102
114
|
.pipe(switchMap(() => timer(100)), takeUntilDestroyed())
|
|
103
|
-
.subscribe(() => (this.expire ? this.focusCVC() : this.focusExpire()))
|
|
115
|
+
.subscribe(() => (this.expire() ? this.focusCVC() : this.focusExpire()))
|
|
104
116
|
: EMPTY;
|
|
117
|
+
this.card = computed(() => this.value()?.card || '');
|
|
118
|
+
this.expire = computed(() => this.value()?.expire || '');
|
|
119
|
+
this.cvc = computed(() => this.value()?.cvc || '');
|
|
105
120
|
this.m = tuiAppearanceMode(this.mode);
|
|
106
121
|
this.appearance = tuiAppearance(inject(TUI_TEXTFIELD_OPTIONS).appearance);
|
|
107
122
|
this.state = tuiAppearanceState(
|
|
108
123
|
// eslint-disable-next-line no-nested-ternary
|
|
109
124
|
computed(() => (this.disabled() ? 'disabled' : this.hover() ? 'hover' : null)));
|
|
110
125
|
this.focus = tuiAppearanceFocus(computed(() => this.open() || this.focusedIn()));
|
|
111
|
-
this.labelRaised = computed(() => (this.focus() && !this.readOnly()) || !!this.
|
|
112
|
-
this.hasCleaner = computed(() =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
122
|
-
this.binChange = new EventEmitter();
|
|
123
|
-
}
|
|
124
|
-
set codeLength(length) {
|
|
125
|
-
this.exampleTextCVC = '0'.repeat(length);
|
|
126
|
-
this.maskCVC = TUI_MASK_CVC(length);
|
|
127
|
-
}
|
|
128
|
-
get bin() {
|
|
129
|
-
return this.card.length < 6 ? null : this.card.slice(0, 6);
|
|
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();
|
|
130
137
|
}
|
|
131
138
|
writeValue(value) {
|
|
132
|
-
const
|
|
139
|
+
const bin = this.bin();
|
|
133
140
|
const { activeElement } = this.doc;
|
|
134
141
|
super.writeValue(value);
|
|
135
142
|
this.updateBin(bin);
|
|
136
|
-
this.expirePrefilled
|
|
143
|
+
this.expirePrefilled.set(!!this.expire() && this.cardPrefilled());
|
|
137
144
|
// Programmatic setting of expire input value breaks autofill in Chrome
|
|
138
|
-
|
|
145
|
+
const inputExpire = this.inputExpire();
|
|
146
|
+
if (!inputExpire ||
|
|
139
147
|
this.isMobile ||
|
|
140
148
|
this.isWebkit ||
|
|
141
149
|
this.isServer ||
|
|
142
|
-
|
|
150
|
+
inputExpire.nativeElement.value === this.expire()) {
|
|
143
151
|
return;
|
|
144
152
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
this.doc.execCommand('insertText', false, this.expire);
|
|
148
|
-
|
|
153
|
+
inputExpire.nativeElement.focus({ preventScroll: true });
|
|
154
|
+
inputExpire.nativeElement.select();
|
|
155
|
+
this.doc.execCommand('insertText', false, this.expire());
|
|
156
|
+
inputExpire.nativeElement.blur();
|
|
149
157
|
activeElement?.focus({ preventScroll: true });
|
|
150
158
|
}
|
|
151
|
-
/** Public API for manual focus management */
|
|
152
159
|
focusCard() {
|
|
153
|
-
this.inputCard?.nativeElement.focus({ preventScroll: true });
|
|
160
|
+
this.inputCard()?.nativeElement.focus({ preventScroll: true });
|
|
154
161
|
}
|
|
155
162
|
focusExpire() {
|
|
156
|
-
if (this.inputs.expire) {
|
|
157
|
-
this.inputExpire?.nativeElement.focus({ preventScroll: true });
|
|
163
|
+
if (this.inputs().expire) {
|
|
164
|
+
this.inputExpire()?.nativeElement.focus({ preventScroll: true });
|
|
158
165
|
}
|
|
159
166
|
else {
|
|
160
|
-
this.inputCVC?.nativeElement.focus({ preventScroll: true });
|
|
167
|
+
this.inputCVC()?.nativeElement.focus({ preventScroll: true });
|
|
161
168
|
}
|
|
162
169
|
}
|
|
163
170
|
focusCVC() {
|
|
164
|
-
this.inputCVC?.nativeElement.focus({ preventScroll: true });
|
|
171
|
+
this.inputCVC()?.nativeElement.focus({ preventScroll: true });
|
|
165
172
|
}
|
|
166
173
|
handleOption(option) {
|
|
167
174
|
const { card = '', expire = '', cvc = '' } = option || {};
|
|
168
|
-
const
|
|
169
|
-
const element = (!card && this.inputCard?.nativeElement) ||
|
|
170
|
-
(!expire && this.inputExpire?.nativeElement) ||
|
|
171
|
-
this.inputCVC?.nativeElement;
|
|
175
|
+
const bin = this.bin();
|
|
176
|
+
const element = (!card && this.inputCard()?.nativeElement) ||
|
|
177
|
+
(!expire && this.inputExpire()?.nativeElement) ||
|
|
178
|
+
this.inputCVC()?.nativeElement;
|
|
172
179
|
this.onChange({ card, expire, cvc });
|
|
173
180
|
this.updateBin(bin);
|
|
174
181
|
this.open.set(false);
|
|
175
|
-
this.expirePrefilled
|
|
182
|
+
this.expirePrefilled.set(!!expire);
|
|
176
183
|
element?.focus();
|
|
177
184
|
}
|
|
178
185
|
clear() {
|
|
179
|
-
this.expirePrefilled
|
|
180
|
-
[this.inputCVC, this.inputExpire, this.inputCard].forEach((e) => {
|
|
186
|
+
this.expirePrefilled.set(false);
|
|
187
|
+
[this.inputCVC(), this.inputExpire(), this.inputCard()].forEach((e) => {
|
|
181
188
|
e?.nativeElement.focus();
|
|
182
189
|
e?.nativeElement.select();
|
|
183
190
|
e?.nativeElement.ownerDocument.execCommand('delete');
|
|
184
191
|
});
|
|
185
192
|
this.onChange(null);
|
|
186
193
|
}
|
|
187
|
-
onResize() {
|
|
188
|
-
this.cdr.detectChanges();
|
|
189
|
-
}
|
|
190
|
-
get content() {
|
|
191
|
-
const system = this.getPaymentSystem(this.card);
|
|
192
|
-
return this.icon || (system && this.paymentSystems[system]);
|
|
193
|
-
}
|
|
194
|
-
get card() {
|
|
195
|
-
return this.value()?.card || '';
|
|
196
|
-
}
|
|
197
|
-
get expire() {
|
|
198
|
-
return this.value()?.expire || '';
|
|
199
|
-
}
|
|
200
|
-
get cvc() {
|
|
201
|
-
return this.value()?.cvc || '';
|
|
202
|
-
}
|
|
203
194
|
get cardCollapsed() {
|
|
204
|
-
return
|
|
205
|
-
!tuiIsNativeFocused(this.inputCard?.nativeElement));
|
|
206
|
-
}
|
|
207
|
-
get tailLength() {
|
|
208
|
-
return this.card.length % 4 > 0 ? 5 : 4;
|
|
209
|
-
}
|
|
210
|
-
get cardPrefilled() {
|
|
211
|
-
return !!this.card.match(TUI_NON_DIGIT_REGEXP);
|
|
212
|
-
}
|
|
213
|
-
get cvcPrefilled() {
|
|
214
|
-
return !this.inputs.cvc || !!this.cvc.match(TUI_NON_DIGIT_REGEXP);
|
|
215
|
-
}
|
|
216
|
-
get cardFocusable() {
|
|
217
|
-
return !this.cardPrefilled;
|
|
195
|
+
return this.focusable() && !tuiIsFocused(this.inputCard()?.nativeElement);
|
|
218
196
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
get cvcFocusable() {
|
|
223
|
-
return this.isFocusable(this.card);
|
|
224
|
-
}
|
|
225
|
-
get masked() {
|
|
226
|
-
return this.cardPrefilled ? `${this.card.slice(-4)}` : '';
|
|
197
|
+
onResize() {
|
|
198
|
+
this.cdr.detectChanges();
|
|
227
199
|
}
|
|
228
200
|
onCardChange(card) {
|
|
229
|
-
const
|
|
201
|
+
const bin = this.bin();
|
|
230
202
|
const parsed = card.split(CHAR_NO_BREAK_SPACE).join('');
|
|
231
|
-
if (
|
|
203
|
+
if (this.card() === parsed) {
|
|
232
204
|
return;
|
|
233
205
|
}
|
|
234
206
|
this.updateProperty(parsed, 'card');
|
|
235
207
|
this.updateBin(bin);
|
|
236
|
-
if (this.cardValidator(this.card) && !
|
|
208
|
+
if (this.cardValidator()(this.card()) && !this.expire() && this.inputExpire()) {
|
|
237
209
|
this.focusExpire();
|
|
238
210
|
// Safari autofill focus jerk workaround
|
|
239
211
|
this.focus$.next();
|
|
@@ -242,7 +214,7 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
242
214
|
onExpireChange(expire) {
|
|
243
215
|
this.updateProperty(expire, 'expire');
|
|
244
216
|
// MM/YY
|
|
245
|
-
if (Number(this.inputExpire?.nativeElement.selectionStart) === 5) {
|
|
217
|
+
if (Number(this.inputExpire()?.nativeElement.selectionStart) === 5) {
|
|
246
218
|
this.focusCVC();
|
|
247
219
|
}
|
|
248
220
|
}
|
|
@@ -264,16 +236,9 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
264
236
|
toggle() {
|
|
265
237
|
this.open.update((open) => !open);
|
|
266
238
|
}
|
|
267
|
-
isFocusable(card) {
|
|
268
|
-
return this.cardValidator(card) || this.cardPrefilled;
|
|
269
|
-
}
|
|
270
|
-
getPaymentSystem(value) {
|
|
271
|
-
return tuiGetPaymentSystem(value);
|
|
272
|
-
}
|
|
273
239
|
updateBin(oldBin) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.binChange.emit(bin);
|
|
240
|
+
if (this.bin() !== oldBin && !this.cardPrefilled()) {
|
|
241
|
+
this.binChange.emit(this.bin());
|
|
277
242
|
}
|
|
278
243
|
}
|
|
279
244
|
updateProperty(value, propName) {
|
|
@@ -283,26 +248,21 @@ class TuiInputCardGroup extends TuiControl {
|
|
|
283
248
|
this.onChange(newValue.expire || newValue.cvc || newValue.card ? newValue : null);
|
|
284
249
|
}
|
|
285
250
|
focusInput() {
|
|
286
|
-
const element = (this.
|
|
287
|
-
(this.expireFocusable && this.inputExpire?.nativeElement) ||
|
|
288
|
-
this.inputCVC?.nativeElement;
|
|
251
|
+
const element = (!this.cardPrefilled() && this.inputCard()?.nativeElement) ||
|
|
252
|
+
(this.expireFocusable() && this.inputExpire()?.nativeElement) ||
|
|
253
|
+
this.inputCVC()?.nativeElement;
|
|
289
254
|
element?.focus();
|
|
290
255
|
}
|
|
291
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
292
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
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: [
|
|
293
258
|
tuiAsDataListHost(TuiInputCardGroup),
|
|
294
259
|
tuiAsControl(TuiInputCardGroup),
|
|
295
260
|
tuiDropdownOptionsProvider({ limitWidth: 'fixed' }),
|
|
296
261
|
TuiHoveredService,
|
|
297
|
-
], 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 }], ngImport: i0, template: "@let formattedCard = value()?.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 || 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 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]=\"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 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 (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;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-text-ui-m)}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);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 :host-context(tui-root._mobile){min-inline-size:19rem;--t-translate: 4rem}: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;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:7rem}:host-context(tui-root._mobile) .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{left:1.375rem}: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%;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):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;display:flex;align-items:center;block-size:100%;gap:.25rem}@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}.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:-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: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.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: 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: ["box"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
262
|
+
TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER,
|
|
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:auto 100% 0 auto;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{inset:auto unset auto 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;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: ["box"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
298
264
|
}
|
|
299
|
-
|
|
300
|
-
tuiPure
|
|
301
|
-
], TuiInputCardGroup.prototype, "isFocusable", null);
|
|
302
|
-
__decorate([
|
|
303
|
-
tuiPure
|
|
304
|
-
], TuiInputCardGroup.prototype, "getPaymentSystem", null);
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputCardGroup, decorators: [{
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiInputCardGroup, decorators: [{
|
|
306
266
|
type: Component,
|
|
307
267
|
args: [{ selector: 'tui-input-card-group', imports: [
|
|
308
268
|
FormsModule,
|
|
@@ -321,41 +281,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
321
281
|
tuiAsControl(TuiInputCardGroup),
|
|
322
282
|
tuiDropdownOptionsProvider({ limitWidth: 'fixed' }),
|
|
323
283
|
TuiHoveredService,
|
|
324
|
-
|
|
284
|
+
TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER,
|
|
285
|
+
], hostDirectives: [
|
|
286
|
+
TuiAppearance,
|
|
287
|
+
TuiDropdownDirective,
|
|
288
|
+
TuiWithDropdownOpen,
|
|
289
|
+
{ directive: TuiInputCardGroupDirective, inputs: ['compact'] },
|
|
290
|
+
], host: {
|
|
325
291
|
'[attr.data-size]': 'textfield.size()',
|
|
326
292
|
'(pointerdown)': 'onPointerDown($event)',
|
|
327
293
|
'(scroll.zoneless)': '$event.target.scrollLeft = 0',
|
|
328
|
-
}, template: "@let formattedCard = value()?.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 || 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 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]=\"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 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 (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;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-text-ui-m)}:host[data-size=m]{--t-label: -.7em;--t-height: var(--tui-height-m);--t-padding: var(--tui-padding-m);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 :host-context(tui-root._mobile){min-inline-size:19rem;--t-translate: 4rem}: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;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:7rem}:host-context(tui-root._mobile) .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{left:1.375rem}: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%;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):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;display:flex;align-items:center;block-size:100%;gap:.25rem}@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}.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:-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"] }]
|
|
329
|
-
}], propDecorators: { inputCard: [{
|
|
330
|
-
|
|
331
|
-
args: ['inputCard', { static: true }]
|
|
332
|
-
}], inputExpire: [{
|
|
333
|
-
type: ViewChild,
|
|
334
|
-
args: ['inputExpire', { static: true }]
|
|
335
|
-
}], inputCVC: [{
|
|
336
|
-
type: ViewChild,
|
|
337
|
-
args: ['inputCVC', { static: true }]
|
|
338
|
-
}], exampleText: [{
|
|
339
|
-
type: Input
|
|
340
|
-
}], placeholder: [{
|
|
341
|
-
type: Input
|
|
342
|
-
}], inputs: [{
|
|
343
|
-
type: Input
|
|
344
|
-
}], cardValidator: [{
|
|
345
|
-
type: Input
|
|
346
|
-
}], icon: [{
|
|
347
|
-
type: Input
|
|
348
|
-
}], id: [{
|
|
349
|
-
type: Input
|
|
350
|
-
}], binChange: [{
|
|
351
|
-
type: Output
|
|
352
|
-
}], codeLength: [{
|
|
353
|
-
type: Input
|
|
354
|
-
}], 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:auto 100% 0 auto;clip-path:inset(0);transform:translate3d(calc(100% * var(--tui-inline)),0,0)}:host-context([dir=\"rtl\"]) .t-value{inset:auto unset auto 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;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
|
+
}] });
|
|
355
297
|
|
|
356
298
|
/**
|
|
357
299
|
* Generated bundle index. Do not edit.
|
|
358
300
|
*/
|
|
359
301
|
|
|
360
|
-
export { TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS, TUI_INPUT_CARD_GROUP_OPTIONS, TUI_INPUT_CARD_GROUP_TEXTS, TuiInputCardGroup, tuiInputCardGroupOptionsProvider };
|
|
302
|
+
export { TUI_INPUT_CARD_GROUP_DEFAULT_OPTIONS, TUI_INPUT_CARD_GROUP_OPTIONS, TUI_INPUT_CARD_GROUP_TEXTS, TUI_INPUT_CARD_GROUP_TEXTS_PROVIDER, TuiInputCardGroup, TuiInputCardGroupDirective, tuiInputCardGroupOptionsProvider };
|
|
361
303
|
//# sourceMappingURL=taiga-ui-addon-commerce-components-input-card-group.mjs.map
|