@taiga-ui/addon-commerce 4.0.0-rc.1 → 4.0.0-rc.10

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.
Files changed (67) hide show
  1. package/components/index.d.ts +1 -1
  2. package/components/input-card/input-card.directive.d.ts +1 -1
  3. package/components/input-card-group/index.d.ts +3 -0
  4. package/components/{input-card-grouped/input-card-grouped.component.d.ts → input-card-group/input-card-group.component.d.ts} +10 -10
  5. package/components/{input-card-grouped/input-card-grouped.options.d.ts → input-card-group/input-card-group.options.d.ts} +3 -3
  6. package/components/{input-card-grouped/input-card-grouped.providers.d.ts → input-card-group/input-card-group.providers.d.ts} +2 -2
  7. package/components/input-cvc/input-cvc.directive.d.ts +2 -4
  8. package/components/input-expire/input-expire.directive.d.ts +2 -4
  9. package/components/thumbnail-card/index.d.ts +1 -0
  10. package/components/thumbnail-card/thumbnail-card.component.d.ts +6 -5
  11. package/components/thumbnail-card/thumbnail-card.options.d.ts +9 -0
  12. package/esm2022/components/index.mjs +2 -2
  13. package/esm2022/components/input-card/input-card.directive.mjs +4 -5
  14. package/esm2022/components/input-card-group/index.mjs +4 -0
  15. package/esm2022/components/input-card-group/input-card-group.component.mjs +278 -0
  16. package/esm2022/components/input-card-group/input-card-group.options.mjs +15 -0
  17. package/esm2022/components/input-card-group/input-card-group.providers.mjs +29 -0
  18. package/esm2022/components/input-card-group/taiga-ui-addon-commerce-components-input-card-group.mjs +5 -0
  19. package/esm2022/components/input-cvc/input-cvc.directive.mjs +5 -10
  20. package/esm2022/components/input-expire/input-expire.directive.mjs +3 -6
  21. package/esm2022/components/thumbnail-card/index.mjs +2 -1
  22. package/esm2022/components/thumbnail-card/thumbnail-card.component.mjs +13 -20
  23. package/esm2022/components/thumbnail-card/thumbnail-card.options.mjs +9 -0
  24. package/esm2022/constants/default-card-validator.mjs +2 -2
  25. package/esm2022/constants/mask-card-holder.mjs +2 -2
  26. package/esm2022/constants/mask-cvc.mjs +2 -2
  27. package/esm2022/pipes/amount/amount.options.mjs +2 -2
  28. package/esm2022/pipes/amount/amount.pipe.mjs +4 -3
  29. package/esm2022/pipes/decimal/decimal.pipe.mjs +28 -0
  30. package/esm2022/pipes/decimal/index.mjs +2 -0
  31. package/esm2022/pipes/decimal/taiga-ui-addon-commerce-pipes-decimal.mjs +5 -0
  32. package/esm2022/pipes/index.mjs +2 -1
  33. package/esm2022/tokens/i18n.mjs +2 -2
  34. package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs +318 -0
  35. package/fesm2022/taiga-ui-addon-commerce-components-input-card-group.mjs.map +1 -0
  36. package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs +3 -4
  37. package/fesm2022/taiga-ui-addon-commerce-components-input-card.mjs.map +1 -1
  38. package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs +4 -9
  39. package/fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs.map +1 -1
  40. package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs +2 -5
  41. package/fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs.map +1 -1
  42. package/fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs +20 -20
  43. package/fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs.map +1 -1
  44. package/fesm2022/taiga-ui-addon-commerce-components.mjs +1 -1
  45. package/fesm2022/taiga-ui-addon-commerce-constants.mjs +3 -3
  46. package/fesm2022/taiga-ui-addon-commerce-constants.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-addon-commerce-pipes-amount.mjs +4 -3
  48. package/fesm2022/taiga-ui-addon-commerce-pipes-amount.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-addon-commerce-pipes-decimal.mjs +34 -0
  50. package/fesm2022/taiga-ui-addon-commerce-pipes-decimal.mjs.map +1 -0
  51. package/fesm2022/taiga-ui-addon-commerce-pipes.mjs +1 -0
  52. package/fesm2022/taiga-ui-addon-commerce-pipes.mjs.map +1 -1
  53. package/fesm2022/taiga-ui-addon-commerce-tokens.mjs +1 -1
  54. package/fesm2022/taiga-ui-addon-commerce-tokens.mjs.map +1 -1
  55. package/package.json +21 -15
  56. package/pipes/decimal/decimal.pipe.d.ts +11 -0
  57. package/pipes/decimal/index.d.ts +1 -0
  58. package/pipes/index.d.ts +1 -0
  59. package/tokens/i18n.d.ts +2 -2
  60. package/components/input-card-grouped/index.d.ts +0 -3
  61. package/esm2022/components/input-card-grouped/index.mjs +0 -4
  62. package/esm2022/components/input-card-grouped/input-card-grouped.component.mjs +0 -288
  63. package/esm2022/components/input-card-grouped/input-card-grouped.options.mjs +0 -15
  64. package/esm2022/components/input-card-grouped/input-card-grouped.providers.mjs +0 -29
  65. package/esm2022/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.mjs +0 -5
  66. package/fesm2022/taiga-ui-addon-commerce-components-input-card-grouped.mjs +0 -328
  67. package/fesm2022/taiga-ui-addon-commerce-components-input-card-grouped.mjs.map +0 -1
@@ -1,328 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import { NgIf } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { inject, computed, EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output } from '@angular/core';
5
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import * as i4 from '@angular/forms';
7
- import { FormsModule } from '@angular/forms';
8
- import { MaskitoDirective } from '@maskito/angular';
9
- import { ResizeObserverDirective } from '@ng-web-apis/resize-observer';
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';
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 { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
14
- import { TUI_NON_DIGIT_REGEXP } from '@taiga-ui/cdk/constants';
15
- import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
16
- import { tuiHovered, TuiHoveredService } from '@taiga-ui/cdk/directives/hovered';
17
- import { TuiLet } from '@taiga-ui/cdk/directives/let';
18
- import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
19
- import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
20
- import { TuiIdService } from '@taiga-ui/cdk/services';
21
- import { tuiInjectElement, tuiIsElement, tuiIsInput } from '@taiga-ui/cdk/utils/dom';
22
- import { tuiIsNativeFocusedIn, tuiIsNativeFocused } from '@taiga-ui/cdk/utils/focus';
23
- import { tuiCreateToken, tuiProvideOptions, tuiCreateTokenFromFactory, tuiDirectiveBinding, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
24
- import * as i3 from '@taiga-ui/core/components/data-list';
25
- import { tuiAsDataListHost, TuiWithDataList } from '@taiga-ui/core/components/data-list';
26
- import { TuiIcon, TuiIconPipe } from '@taiga-ui/core/components/icon';
27
- import { TUI_TEXTFIELD_OPTIONS } from '@taiga-ui/core/components/textfield';
28
- import * as i1 from '@taiga-ui/core/directives/appearance';
29
- import { TuiAppearance, tuiAppearanceOptionsProvider } from '@taiga-ui/core/directives/appearance';
30
- import * as i2 from '@taiga-ui/core/directives/dropdown';
31
- import { TuiDropdownDirective, TuiDropdownOpen, tuiDropdownOptionsProvider } from '@taiga-ui/core/directives/dropdown';
32
- import { TUI_MEDIA, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
33
- import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
34
- import { PolymorpheusOutlet, PolymorpheusTemplate } from '@taiga-ui/polymorpheus';
35
- import { startWith, switchMap, combineLatest, of, map, merge } from 'rxjs';
36
- import { TUI_INPUT_CARD_DEFAULT_OPTIONS } from '@taiga-ui/addon-commerce/components/input-card';
37
- import { WINDOW } from '@ng-web-apis/common';
38
-
39
- const TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS = {
40
- ...TUI_INPUT_CARD_DEFAULT_OPTIONS,
41
- cardValidator: tuiDefaultCardValidator,
42
- exampleText: '0000 0000 0000 0000',
43
- exampleTextCVC: '000',
44
- cvcHidden: true,
45
- };
46
- const TUI_INPUT_CARD_GROUPED_OPTIONS = tuiCreateToken(TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS);
47
- function tuiInputCardGroupedOptionsProvider(options) {
48
- return tuiProvideOptions(TUI_INPUT_CARD_GROUPED_OPTIONS, options, TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS);
49
- }
50
-
51
- /**
52
- * InputCardGrouped texts
53
- */
54
- const TUI_INPUT_CARD_GROUPED_TEXTS = tuiCreateTokenFromFactory(() => {
55
- const win = inject(WINDOW);
56
- const cardNumberTexts = inject(TUI_CARD_NUMBER_TEXTS);
57
- const expiryTexts = inject(TUI_CARD_EXPIRY_TEXTS);
58
- const cvcTexts = inject(TUI_CARD_CVC_TEXTS);
59
- const { desktopSmall } = inject(TUI_MEDIA);
60
- const media = win.matchMedia(`screen and (min-width: ${(desktopSmall - 1) / 16}em)`);
61
- return tuiTypedFromEvent(media, 'change').pipe(startWith(null), switchMap(() => combineLatest([
62
- of(Number(media.matches)),
63
- cardNumberTexts,
64
- expiryTexts,
65
- cvcTexts,
66
- ])), map(([index, cardNumber, expiry, cvcTexts]) => ({
67
- cardNumberText: cardNumber[index],
68
- expiryText: expiry[index],
69
- cvcText: cvcTexts[index],
70
- })));
71
- });
72
-
73
- class TuiInputCardGroup extends TuiControl {
74
- constructor() {
75
- super(...arguments);
76
- this.expirePrefilled = false;
77
- this.paymentSystems = inject(TUI_PAYMENT_SYSTEM_ICONS);
78
- this.options = inject(TUI_INPUT_CARD_GROUPED_OPTIONS);
79
- this.el = tuiInjectElement();
80
- this.hover = tuiHovered();
81
- this.focusedIn = toSignal(merge(tuiTypedFromEvent(this.el, 'focusin'), tuiTypedFromEvent(this.el, 'focusout')).pipe(map(() => tuiIsNativeFocusedIn(this.el))), { initialValue: false });
82
- this.exampleTextCVC = this.options.exampleTextCVC;
83
- this.cvcHidden = this.options.cvcHidden;
84
- this.maskCVC = TUI_MASK_CVC(3);
85
- this.dropdown = inject(TuiDropdownDirective);
86
- this.maskCard = TUI_MASK_CARD;
87
- this.maskExpire = TUI_MASK_EXPIRE;
88
- this.icons = inject(TUI_COMMON_ICONS);
89
- this.texts = toSignal(inject(TUI_INPUT_CARD_GROUPED_TEXTS));
90
- this.open = tuiDirectiveBinding(TuiDropdownOpen, 'tuiDropdownOpen', false);
91
- this.state = tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceState',
92
- // eslint-disable-next-line no-nested-ternary
93
- computed(() => (this.disabled() ? 'disabled' : this.hover() ? 'hover' : null)));
94
- this.focus = tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceFocus', computed(() => this.open() || this.focusedIn()));
95
- this.sub = inject(TuiDropdownOpen)
96
- .tuiDropdownOpenChange.pipe(takeUntilDestroyed())
97
- .subscribe(open => {
98
- this.open.set(open);
99
- });
100
- this.labelRaised = computed(() => (this.focus() && !this.readOnly()) || !!this.value()?.card);
101
- this.hasCleaner = computed(() => !!this.value()?.card && this.interactive());
102
- this.exampleText = this.options.exampleText;
103
- this.cardValidator = this.options.cardValidator;
104
- this.icon = this.options.icon;
105
- this.id = inject(TuiIdService).generate();
106
- this.autocomplete = this.options.autocomplete;
107
- this.binChange = new EventEmitter();
108
- }
109
- set codeLength(length) {
110
- this.exampleTextCVC = '0'.repeat(length);
111
- this.maskCVC = TUI_MASK_CVC(length);
112
- }
113
- get bin() {
114
- return this.card.length < 6 ? null : this.card.slice(0, 6);
115
- }
116
- writeValue(value) {
117
- const { bin } = this;
118
- super.writeValue(value);
119
- this.updateBin(bin);
120
- this.expirePrefilled = !!this.expire && this.cardPrefilled;
121
- }
122
- /** Public API for manual focus management */
123
- focusCard() {
124
- this.inputCard?.nativeElement.focus({ preventScroll: true });
125
- }
126
- focusExpire() {
127
- this.inputExpire?.nativeElement.focus({ preventScroll: true });
128
- }
129
- focusCVC() {
130
- this.inputCVC?.nativeElement.focus({ preventScroll: true });
131
- }
132
- handleOption(option) {
133
- const { card = '', expire = '', cvc = '' } = option || {};
134
- const { bin } = this;
135
- const element = (!card && this.inputCard?.nativeElement) ||
136
- (!expire && this.inputExpire?.nativeElement) ||
137
- this.inputCVC?.nativeElement;
138
- this.onChange({ card, expire, cvc });
139
- this.updateBin(bin);
140
- this.open.set(false);
141
- this.expirePrefilled = !!expire;
142
- element?.focus();
143
- }
144
- clear() {
145
- this.expirePrefilled = false;
146
- this.onChange(null);
147
- this.focusCard();
148
- }
149
- get content() {
150
- const system = this.getPaymentSystem(this.card);
151
- return this.icon || (system && this.paymentSystems[system]);
152
- }
153
- get card() {
154
- return this.value()?.card || '';
155
- }
156
- get expire() {
157
- return this.value()?.expire || '';
158
- }
159
- get cvc() {
160
- return this.value()?.cvc || '';
161
- }
162
- get cardCollapsed() {
163
- return (this.isFocusable(this.card) &&
164
- !tuiIsNativeFocused(this.inputCard?.nativeElement));
165
- }
166
- get tailLength() {
167
- return this.card.length % 4 > 0 ? 5 : 4;
168
- }
169
- get cardPrefilled() {
170
- return !!this.card.match(TUI_NON_DIGIT_REGEXP);
171
- }
172
- get cvcPrefilled() {
173
- return !!this.cvc.match(TUI_NON_DIGIT_REGEXP);
174
- }
175
- get cardFocusable() {
176
- return !this.cardPrefilled;
177
- }
178
- get expireFocusable() {
179
- return this.isFocusable(this.card) && !this.expirePrefilled;
180
- }
181
- get cvcFocusable() {
182
- return this.isFocusable(this.card);
183
- }
184
- get masked() {
185
- return this.cardPrefilled ? `*${this.card.slice(-4)}` : '*';
186
- }
187
- onCardChange(card) {
188
- const { value, bin } = this;
189
- const parsed = card.split(' ').join('');
190
- if (value()?.card === parsed) {
191
- return;
192
- }
193
- this.updateProperty(parsed, 'card');
194
- this.updateBin(bin);
195
- if (this.cardValidator(this.card) && !value()?.expire && this.inputExpire) {
196
- this.focusExpire();
197
- }
198
- }
199
- onExpireChange(expire) {
200
- this.updateProperty(expire, 'expire');
201
- if (Number(this.inputExpire?.nativeElement.selectionStart) === 5 // MM/YY
202
- ) {
203
- this.focusCVC();
204
- }
205
- }
206
- onCVCChange(cvc) {
207
- this.updateProperty(cvc, 'cvc');
208
- }
209
- transform({ offsetWidth }) {
210
- return this.cardCollapsed ? `translate3d(${offsetWidth}px, 0, 0)` : '';
211
- }
212
- onMouseDown(event) {
213
- if (tuiIsElement(event.target) && tuiIsInput(event.target)) {
214
- return;
215
- }
216
- event.preventDefault();
217
- this.focusInput();
218
- }
219
- toggle() {
220
- this.open.set(!this.open());
221
- }
222
- isFocusable(card) {
223
- return this.cardValidator(card) || this.cardPrefilled;
224
- }
225
- getPaymentSystem(value) {
226
- return this.options.paymentSystemHandler(value);
227
- }
228
- updateBin(oldBin) {
229
- const { bin } = this;
230
- if (bin !== oldBin && !this.cardPrefilled) {
231
- this.binChange.emit(bin);
232
- }
233
- }
234
- updateProperty(value, propName) {
235
- const { card = '', expire = '', cvc = '' } = this.value() || {};
236
- const newValue = { card, expire, cvc };
237
- newValue[propName] = value;
238
- this.onChange(newValue.expire || newValue.cvc || newValue.card ? newValue : null);
239
- }
240
- focusInput() {
241
- const element = (this.cardFocusable && this.inputCard?.nativeElement) ||
242
- (this.expireFocusable && this.inputExpire?.nativeElement) ||
243
- this.inputCVC?.nativeElement;
244
- element?.focus();
245
- }
246
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputCardGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
247
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputCardGroup, isStandalone: true, selector: "tui-input-card-grouped", inputs: { exampleText: "exampleText", cardValidator: "cardValidator", icon: "icon", id: "id", autocomplete: "autocomplete", codeLength: "codeLength" }, outputs: { binChange: "binChange" }, host: { attributes: { "data-size": "l" }, listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.data-mode": "mode()" } }, providers: [
248
- tuiAsDataListHost(TuiInputCardGroup),
249
- tuiAsControl(TuiInputCardGroup),
250
- tuiDropdownOptionsProvider({ limitWidth: 'fixed' }),
251
- tuiAppearanceOptionsProvider(TUI_TEXTFIELD_OPTIONS),
252
- TuiHoveredService,
253
- ], viewQueries: [{ propertyName: "inputCard", first: true, predicate: ["inputCard"], descendants: true }, { propertyName: "inputExpire", first: true, predicate: ["inputExpire"], descendants: true }, { propertyName: "inputCVC", first: true, predicate: ["inputCVC"], descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i1.TuiAppearance }, { directive: i2.TuiDropdownDirective }, { directive: i3.TuiWithDataList }, { directive: i2.TuiDropdownOpen, inputs: ["tuiDropdownOpen", "open"], outputs: ["tuiDropdownOpenChange", "openChange"] }], ngImport: i0, template: "<div class=\"t-wrapper\">\n <label\n *tuiLet=\"value()?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n (click.silent.prevent)=\"(0)\"\n >\n <input\n #inputCard\n automation-id=\"tui-input-card-grouped__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 [autocomplete]=\"autocomplete ? 'cc-number' : 'off'\"\n [class.t-input_hidden]=\"!card.length && focus()\"\n [class.t-input_inert]=\"cardPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [placeholder]=\"cardPrefilled ? '' : 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)=\"(0)\"\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.transform]=\"transform(ghost)\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.cardNumberText }}\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.silent.prevent)=\"(0)\">\n <input\n #inputExpire\n automation-id=\"tui-input-card-grouped__expire\"\n inputmode=\"numeric\"\n placeholder=\"00/00\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"id + '_expire'\"\n [attr.name]=\"autocomplete ? 'ccexpiryyear' : null\"\n [autocomplete]=\"autocomplete ? 'cc-exp' : 'off'\"\n [class.t-input_inert]=\"!expireFocusable\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"expireFocusable ? 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.silent.prevent)=\"(0)\">\n <input\n #inputCVC\n automation-id=\"tui-input-card-grouped__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"id + '_cvc'\"\n [autocomplete]=\"autocomplete ? 'cc-csc' : 'off'\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCVC\"\n [ngModel]=\"cvc\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [readOnly]=\"readOnly() || cvcPrefilled\"\n [tabIndex]=\"cvcFocusable ? 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-grouped__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n <tui-icon\n *ngIf=\"hasCleaner()\"\n automation-id=\"tui-input-card-grouped__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n (click)=\"clear()\"\n />\n <tui-icon\n *ngIf=\"dropdown.content\"\n automation-id=\"tui-input-card-grouped__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n (click)=\"toggle()\"\n />\n</div>\n", styles: [":host{position:relative;display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-l);overflow:clip}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;width:100%;height:100%}.t-wrapper_cvc{margin-left:7.1875rem;transform:translate3d(100%,0,0)}:host-context(tui-root._mobile) .t-wrapper_cvc{margin-left:4.0625rem}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}:host-context(tui-root._mobile) .t-wrapper_active{transform:translate3d(4.125rem,0,0)}.t-card{width:2rem;height:2rem}.t-collapsed{position:absolute;top:0;left:0;width:100%;height:100%;padding:1.25rem var(--tui-padding-l) 0;box-sizing:border-box;font:var(--tui-font-text-s);line-height:2.25rem;color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask .t-collapsed-wrapper{left:1.375rem}.t-collapsed-wrapper{position:absolute;top:0;display:block;width:100%;height:100%;overflow:hidden}.t-value{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;transform:translate3d(100%,0,0)}.t-input{position:absolute;top:0;left:0;width:100%;height:100%;border:0;margin:0;padding:1.25rem var(--tui-padding-l) 0;outline:none;background:transparent;box-sizing:border-box;font:var(--tui-font-text-s);color:var(--tui-text-primary)}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input.t-input.t-input_card:not(.t-input_hidden),.t-input.t-input.t-input_card:not(.t-input_hidden)::placeholder,.t-input.t-input.t-input_card:not(.t-input_hidden):-webkit-autofill{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:-62.4375rem;top:-62.4375rem;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}@supports (-webkit-touch-callout: none){.t-input:active{font-size:1rem}}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:flex;margin-right:.25rem}.t-icon{cursor:pointer;border:.25rem solid transparent}.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;margin:1.125rem 1rem;font:var(--tui-font-text-m);line-height:1.25rem;color:var(--tui-text-secondary)}.t-label_raised{font-size:.8156rem;transform:translateY(-.7em)}:host([data-mode=\"invalid\"]) .t-label{color:var(--tui-status-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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.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: ResizeObserverDirective, selector: "[waResizeObserver]", outputs: ["waResizeObserver"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "pipe", type: TuiFormatCardPipe, name: "tuiFormatCard" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiAppearance, selector: "[tuiAppearance]", inputs: ["tuiAppearance", "tuiAppearanceState", "tuiAppearanceFocus"] }, { kind: "pipe", type: TuiIconPipe, name: "tuiIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
254
- }
255
- __decorate([
256
- tuiPure
257
- ], TuiInputCardGroup.prototype, "isFocusable", null);
258
- __decorate([
259
- tuiPure
260
- ], TuiInputCardGroup.prototype, "getPaymentSystem", null);
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputCardGroup, decorators: [{
262
- type: Component,
263
- args: [{ standalone: true, selector: 'tui-input-card-grouped', imports: [
264
- NgIf,
265
- FormsModule,
266
- MaskitoDirective,
267
- ResizeObserverDirective,
268
- PolymorpheusOutlet,
269
- PolymorpheusTemplate,
270
- TuiActiveZone,
271
- TuiFormatCardPipe,
272
- TuiMapperPipe,
273
- TuiLet,
274
- TuiIcon,
275
- TuiChevron,
276
- TuiAppearance,
277
- TuiIconPipe,
278
- ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
279
- tuiAsDataListHost(TuiInputCardGroup),
280
- tuiAsControl(TuiInputCardGroup),
281
- tuiDropdownOptionsProvider({ limitWidth: 'fixed' }),
282
- tuiAppearanceOptionsProvider(TUI_TEXTFIELD_OPTIONS),
283
- TuiHoveredService,
284
- ], hostDirectives: [
285
- TuiAppearance,
286
- TuiDropdownDirective,
287
- TuiWithDataList,
288
- {
289
- directive: TuiDropdownOpen,
290
- inputs: ['tuiDropdownOpen: open'],
291
- outputs: ['tuiDropdownOpenChange: openChange'],
292
- },
293
- ], host: {
294
- 'data-size': 'l',
295
- '[attr.data-mode]': 'mode()',
296
- '(mousedown)': 'onMouseDown($event)',
297
- }, template: "<div class=\"t-wrapper\">\n <label\n *tuiLet=\"value()?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n (click.silent.prevent)=\"(0)\"\n >\n <input\n #inputCard\n automation-id=\"tui-input-card-grouped__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 [autocomplete]=\"autocomplete ? 'cc-number' : 'off'\"\n [class.t-input_hidden]=\"!card.length && focus()\"\n [class.t-input_inert]=\"cardPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [placeholder]=\"cardPrefilled ? '' : 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)=\"(0)\"\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.transform]=\"transform(ghost)\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.cardNumberText }}\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.silent.prevent)=\"(0)\">\n <input\n #inputExpire\n automation-id=\"tui-input-card-grouped__expire\"\n inputmode=\"numeric\"\n placeholder=\"00/00\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"id + '_expire'\"\n [attr.name]=\"autocomplete ? 'ccexpiryyear' : null\"\n [autocomplete]=\"autocomplete ? 'cc-exp' : 'off'\"\n [class.t-input_inert]=\"!expireFocusable\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"expireFocusable ? 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.silent.prevent)=\"(0)\">\n <input\n #inputCVC\n automation-id=\"tui-input-card-grouped__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"id + '_cvc'\"\n [autocomplete]=\"autocomplete ? 'cc-csc' : 'off'\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCVC\"\n [ngModel]=\"cvc\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [readOnly]=\"readOnly() || cvcPrefilled\"\n [tabIndex]=\"cvcFocusable ? 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-grouped__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n <tui-icon\n *ngIf=\"hasCleaner()\"\n automation-id=\"tui-input-card-grouped__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n (click)=\"clear()\"\n />\n <tui-icon\n *ngIf=\"dropdown.content\"\n automation-id=\"tui-input-card-grouped__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n (click)=\"toggle()\"\n />\n</div>\n", styles: [":host{position:relative;display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-l);overflow:clip}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;width:100%;height:100%}.t-wrapper_cvc{margin-left:7.1875rem;transform:translate3d(100%,0,0)}:host-context(tui-root._mobile) .t-wrapper_cvc{margin-left:4.0625rem}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}:host-context(tui-root._mobile) .t-wrapper_active{transform:translate3d(4.125rem,0,0)}.t-card{width:2rem;height:2rem}.t-collapsed{position:absolute;top:0;left:0;width:100%;height:100%;padding:1.25rem var(--tui-padding-l) 0;box-sizing:border-box;font:var(--tui-font-text-s);line-height:2.25rem;color:var(--tui-text-primary);white-space:nowrap;pointer-events:none}.t-collapsed_enable-mask:before{content:attr(data-before)}.t-collapsed_enable-mask .t-collapsed-wrapper{left:1.375rem}.t-collapsed-wrapper{position:absolute;top:0;display:block;width:100%;height:100%;overflow:hidden}.t-value{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;transform:translate3d(100%,0,0)}.t-input{position:absolute;top:0;left:0;width:100%;height:100%;border:0;margin:0;padding:1.25rem var(--tui-padding-l) 0;outline:none;background:transparent;box-sizing:border-box;font:var(--tui-font-text-s);color:var(--tui-text-primary)}.t-input::placeholder{color:var(--tui-text-tertiary)}.t-input.t-input.t-input_card:not(.t-input_hidden),.t-input.t-input.t-input_card:not(.t-input_hidden)::placeholder,.t-input.t-input.t-input_card:not(.t-input_hidden):-webkit-autofill{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:-62.4375rem;top:-62.4375rem;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}@supports (-webkit-touch-callout: none){.t-input:active{font-size:1rem}}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:flex;margin-right:.25rem}.t-icon{cursor:pointer;border:.25rem solid transparent}.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;margin:1.125rem 1rem;font:var(--tui-font-text-m);line-height:1.25rem;color:var(--tui-text-secondary)}.t-label_raised{font-size:.8156rem;transform:translateY(-.7em)}:host([data-mode=\"invalid\"]) .t-label{color:var(--tui-status-negative)}:host([data-focus=\"true\"]) .t-label{color:var(--tui-text-primary)}.t-ghost{visibility:hidden}\n"] }]
298
- }], propDecorators: { inputCard: [{
299
- type: ViewChild,
300
- args: ['inputCard']
301
- }], inputExpire: [{
302
- type: ViewChild,
303
- args: ['inputExpire']
304
- }], inputCVC: [{
305
- type: ViewChild,
306
- args: ['inputCVC']
307
- }], exampleText: [{
308
- type: Input
309
- }], cardValidator: [{
310
- type: Input
311
- }], icon: [{
312
- type: Input
313
- }], id: [{
314
- type: Input
315
- }], autocomplete: [{
316
- type: Input
317
- }], binChange: [{
318
- type: Output
319
- }], codeLength: [{
320
- type: Input
321
- }], isFocusable: [], getPaymentSystem: [] } });
322
-
323
- /**
324
- * Generated bundle index. Do not edit.
325
- */
326
-
327
- export { TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS, TUI_INPUT_CARD_GROUPED_OPTIONS, TUI_INPUT_CARD_GROUPED_TEXTS, TuiInputCardGroup, tuiInputCardGroupedOptionsProvider };
328
- //# sourceMappingURL=taiga-ui-addon-commerce-components-input-card-grouped.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-input-card-grouped.mjs","sources":["../../../projects/addon-commerce/components/input-card-grouped/input-card-grouped.options.ts","../../../projects/addon-commerce/components/input-card-grouped/input-card-grouped.providers.ts","../../../projects/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts","../../../projects/addon-commerce/components/input-card-grouped/input-card-grouped.template.html","../../../projects/addon-commerce/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.ts"],"sourcesContent":["import type {Provider} from '@angular/core';\nimport type {TuiInputCardOptions} from '@taiga-ui/addon-commerce/components/input-card';\nimport {TUI_INPUT_CARD_DEFAULT_OPTIONS} from '@taiga-ui/addon-commerce/components/input-card';\nimport {tuiDefaultCardValidator} from '@taiga-ui/addon-commerce/constants';\nimport type {TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport interface TuiInputCardGroupOptions extends TuiInputCardOptions {\n readonly cardValidator: TuiBooleanHandler<string>;\n readonly exampleText: string;\n readonly exampleTextCVC: string;\n readonly cvcHidden: boolean;\n}\n\nexport const TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS: TuiInputCardGroupOptions = {\n ...TUI_INPUT_CARD_DEFAULT_OPTIONS,\n cardValidator: tuiDefaultCardValidator,\n exampleText: '0000 0000 0000 0000',\n exampleTextCVC: '000',\n cvcHidden: true,\n};\n\nexport const TUI_INPUT_CARD_GROUPED_OPTIONS = tuiCreateToken(\n TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS,\n);\n\nexport function tuiInputCardGroupedOptionsProvider(\n options: Partial<TuiInputCardGroupOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_INPUT_CARD_GROUPED_OPTIONS,\n options,\n TUI_INPUT_CARD_GROUPED_DEFAULT_OPTIONS,\n );\n}\n","import {inject} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n TUI_CARD_CVC_TEXTS,\n TUI_CARD_EXPIRY_TEXTS,\n TUI_CARD_NUMBER_TEXTS,\n} from '@taiga-ui/addon-commerce/tokens';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiCreateTokenFromFactory} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport type {Observable} from 'rxjs';\nimport {combineLatest, map, of, startWith, switchMap} from 'rxjs';\n\nexport interface TuiCardGroupedTexts {\n readonly cardNumberText: string;\n readonly cvcText: string;\n readonly expiryText: string;\n}\n\n/**\n * InputCardGrouped texts\n */\nexport const TUI_INPUT_CARD_GROUPED_TEXTS = tuiCreateTokenFromFactory<\n Observable<TuiCardGroupedTexts>\n>(() => {\n const win = inject(WINDOW);\n const cardNumberTexts = inject(TUI_CARD_NUMBER_TEXTS);\n const expiryTexts = inject(TUI_CARD_EXPIRY_TEXTS);\n const cvcTexts = inject(TUI_CARD_CVC_TEXTS);\n const {desktopSmall} = inject(TUI_MEDIA);\n\n const media = win.matchMedia(`screen and (min-width: ${(desktopSmall - 1) / 16}em)`);\n\n return tuiTypedFromEvent(media, 'change').pipe(\n startWith(null),\n switchMap(() =>\n combineLatest([\n of(Number(media.matches)),\n cardNumberTexts,\n expiryTexts,\n cvcTexts,\n ]),\n ),\n map(([index, cardNumber, expiry, cvcTexts]) => ({\n cardNumberText: cardNumber[index],\n expiryText: expiry[index],\n cvcText: cvcTexts[index],\n })),\n );\n});\n","import {NgIf} from '@angular/common';\nimport type {ElementRef, WritableSignal} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n EventEmitter,\n inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {FormsModule} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {ResizeObserverDirective} from '@ng-web-apis/resize-observer';\nimport {\n TUI_MASK_CARD,\n TUI_MASK_CVC,\n TUI_MASK_EXPIRE,\n} from '@taiga-ui/addon-commerce/constants';\nimport {TuiFormatCardPipe} from '@taiga-ui/addon-commerce/pipes';\nimport {TUI_PAYMENT_SYSTEM_ICONS} from '@taiga-ui/addon-commerce/tokens';\nimport type {TuiPaymentSystem} from '@taiga-ui/addon-commerce/types';\nimport {tuiAsControl, TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_NON_DIGIT_REGEXP} from '@taiga-ui/cdk/constants';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {tuiHovered, TuiHoveredService} from '@taiga-ui/cdk/directives/hovered';\nimport {TuiLet} from '@taiga-ui/cdk/directives/let';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {TuiIdService} from '@taiga-ui/cdk/services';\nimport type {TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiInjectElement, tuiIsElement, tuiIsInput} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsNativeFocused, tuiIsNativeFocusedIn} from '@taiga-ui/cdk/utils/focus';\nimport {tuiDirectiveBinding, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiDataListHost} from '@taiga-ui/core/components/data-list';\nimport {tuiAsDataListHost, TuiWithDataList} from '@taiga-ui/core/components/data-list';\nimport {TuiIcon, TuiIconPipe} from '@taiga-ui/core/components/icon';\nimport {TUI_TEXTFIELD_OPTIONS} from '@taiga-ui/core/components/textfield';\nimport {\n TuiAppearance,\n tuiAppearanceOptionsProvider,\n} from '@taiga-ui/core/directives/appearance';\nimport {\n TuiDropdownDirective,\n TuiDropdownOpen,\n tuiDropdownOptionsProvider,\n} from '@taiga-ui/core/directives/dropdown';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {TuiChevron} from '@taiga-ui/kit/directives/chevron';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\nimport {map, merge} from 'rxjs';\n\nimport {TUI_INPUT_CARD_GROUPED_OPTIONS} from './input-card-grouped.options';\nimport {TUI_INPUT_CARD_GROUPED_TEXTS} from './input-card-grouped.providers';\n\nexport interface TuiCard {\n card: string;\n cvc: string;\n expire: string;\n}\n\n@Component({\n standalone: true,\n selector: 'tui-input-card-grouped',\n imports: [\n NgIf,\n FormsModule,\n MaskitoDirective,\n ResizeObserverDirective,\n PolymorpheusOutlet,\n PolymorpheusTemplate,\n TuiActiveZone,\n TuiFormatCardPipe,\n TuiMapperPipe,\n TuiLet,\n TuiIcon,\n TuiChevron,\n TuiAppearance,\n TuiIconPipe,\n ],\n templateUrl: './input-card-grouped.template.html',\n styleUrls: ['./input-card-grouped.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsDataListHost(TuiInputCardGroup),\n tuiAsControl(TuiInputCardGroup),\n tuiDropdownOptionsProvider({limitWidth: 'fixed'}),\n tuiAppearanceOptionsProvider(TUI_TEXTFIELD_OPTIONS),\n TuiHoveredService,\n ],\n hostDirectives: [\n TuiAppearance,\n TuiDropdownDirective,\n TuiWithDataList,\n {\n directive: TuiDropdownOpen,\n inputs: ['tuiDropdownOpen: open'],\n outputs: ['tuiDropdownOpenChange: openChange'],\n },\n ],\n host: {\n 'data-size': 'l',\n '[attr.data-mode]': 'mode()',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiInputCardGroup\n extends TuiControl<TuiCard | null>\n implements TuiDataListHost<Partial<TuiCard>>\n{\n @ViewChild('inputCard')\n private readonly inputCard?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputExpire')\n private readonly inputExpire?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputCVC')\n private readonly inputCVC?: ElementRef<HTMLInputElement>;\n\n private expirePrefilled = false;\n private readonly paymentSystems = inject(TUI_PAYMENT_SYSTEM_ICONS);\n private readonly options = inject(TUI_INPUT_CARD_GROUPED_OPTIONS);\n private readonly el = tuiInjectElement();\n private readonly hover = tuiHovered();\n private readonly focusedIn = toSignal(\n merge(\n tuiTypedFromEvent(this.el, 'focusin'),\n tuiTypedFromEvent(this.el, 'focusout'),\n ).pipe(map(() => tuiIsNativeFocusedIn(this.el))),\n {initialValue: false},\n );\n\n protected exampleTextCVC = this.options.exampleTextCVC;\n protected cvcHidden = this.options.cvcHidden;\n protected maskCVC = TUI_MASK_CVC(3);\n protected readonly dropdown = inject(TuiDropdownDirective);\n protected readonly maskCard = TUI_MASK_CARD;\n protected readonly maskExpire = TUI_MASK_EXPIRE;\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly texts = toSignal(inject(TUI_INPUT_CARD_GROUPED_TEXTS));\n\n protected readonly open: WritableSignal<boolean> = tuiDirectiveBinding(\n TuiDropdownOpen,\n 'tuiDropdownOpen',\n false,\n );\n\n protected readonly state = tuiDirectiveBinding(\n TuiAppearance,\n 'tuiAppearanceState',\n // eslint-disable-next-line no-nested-ternary\n computed(() => (this.disabled() ? 'disabled' : this.hover() ? 'hover' : null)),\n );\n\n protected readonly focus = tuiDirectiveBinding(\n TuiAppearance,\n 'tuiAppearanceFocus',\n computed(() => this.open() || this.focusedIn()),\n );\n\n protected readonly sub = inject(TuiDropdownOpen)\n .tuiDropdownOpenChange.pipe(takeUntilDestroyed())\n .subscribe(open => {\n this.open.set(open);\n });\n\n protected readonly labelRaised = computed(\n () => (this.focus() && !this.readOnly()) || !!this.value()?.card,\n );\n\n protected readonly hasCleaner = computed(\n () => !!this.value()?.card && this.interactive(),\n );\n\n @Input()\n public exampleText = this.options.exampleText;\n\n @Input()\n public cardValidator: TuiBooleanHandler<string> = this.options.cardValidator;\n\n @Input()\n public icon: PolymorpheusContent = this.options.icon;\n\n @Input()\n public id = inject(TuiIdService).generate();\n\n @Input()\n public autocomplete = this.options.autocomplete;\n\n @Output()\n public readonly binChange = new EventEmitter<string | null>();\n\n @Input()\n public set codeLength(length: 3 | 4) {\n this.exampleTextCVC = '0'.repeat(length);\n this.maskCVC = TUI_MASK_CVC(length);\n }\n\n public get bin(): string | null {\n return this.card.length < 6 ? null : this.card.slice(0, 6);\n }\n\n public override writeValue(value: TuiCard | null): void {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expirePrefilled = !!this.expire && this.cardPrefilled;\n }\n\n /** Public API for manual focus management */\n public focusCard(): void {\n this.inputCard?.nativeElement.focus({preventScroll: true});\n }\n\n public focusExpire(): void {\n this.inputExpire?.nativeElement.focus({preventScroll: true});\n }\n\n public focusCVC(): void {\n this.inputCVC?.nativeElement.focus({preventScroll: true});\n }\n\n public handleOption(option: Partial<TuiCard> | null): void {\n const {card = '', expire = '', cvc = ''} = option || {};\n const {bin} = this;\n const element =\n (!card && this.inputCard?.nativeElement) ||\n (!expire && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n this.onChange({card, expire, cvc});\n this.updateBin(bin);\n this.open.set(false);\n this.expirePrefilled = !!expire;\n\n element?.focus();\n }\n\n public clear(): void {\n this.expirePrefilled = false;\n this.onChange(null);\n this.focusCard();\n }\n\n protected get content(): PolymorpheusContent {\n const system = this.getPaymentSystem(this.card);\n\n return this.icon || (system && this.paymentSystems[system]);\n }\n\n protected get card(): string {\n return this.value()?.card || '';\n }\n\n protected get expire(): string {\n return this.value()?.expire || '';\n }\n\n protected get cvc(): string {\n return this.value()?.cvc || '';\n }\n\n protected get cardCollapsed(): boolean {\n return (\n this.isFocusable(this.card) &&\n !tuiIsNativeFocused(this.inputCard?.nativeElement)\n );\n }\n\n protected get tailLength(): number {\n return this.card.length % 4 > 0 ? 5 : 4;\n }\n\n protected get cardPrefilled(): boolean {\n return !!this.card.match(TUI_NON_DIGIT_REGEXP);\n }\n\n protected get cvcPrefilled(): boolean {\n return !!this.cvc.match(TUI_NON_DIGIT_REGEXP);\n }\n\n protected get cardFocusable(): boolean {\n return !this.cardPrefilled;\n }\n\n protected get expireFocusable(): boolean {\n return this.isFocusable(this.card) && !this.expirePrefilled;\n }\n\n protected get cvcFocusable(): boolean {\n return this.isFocusable(this.card);\n }\n\n protected get masked(): string {\n return this.cardPrefilled ? `*${this.card.slice(-4)}` : '*';\n }\n\n protected onCardChange(card: string): void {\n const {value, bin} = this;\n const parsed = card.split(' ').join('');\n\n if (value()?.card === parsed) {\n return;\n }\n\n this.updateProperty(parsed, 'card');\n this.updateBin(bin);\n\n if (this.cardValidator(this.card) && !value()?.expire && this.inputExpire) {\n this.focusExpire();\n }\n }\n\n protected onExpireChange(expire: string): void {\n this.updateProperty(expire, 'expire');\n\n if (\n Number(this.inputExpire?.nativeElement.selectionStart) === 5 // MM/YY\n ) {\n this.focusCVC();\n }\n }\n\n protected onCVCChange(cvc: string): void {\n this.updateProperty(cvc, 'cvc');\n }\n\n protected transform({offsetWidth}: HTMLSpanElement): string {\n return this.cardCollapsed ? `translate3d(${offsetWidth}px, 0, 0)` : '';\n }\n\n protected onMouseDown(event: MouseEvent): void {\n if (tuiIsElement(event.target) && tuiIsInput(event.target)) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n protected toggle(): void {\n this.open.set(!this.open());\n }\n\n @tuiPure\n private isFocusable(card: string): boolean {\n return this.cardValidator(card) || this.cardPrefilled;\n }\n\n @tuiPure\n private getPaymentSystem(value: string): TuiPaymentSystem | null {\n return this.options.paymentSystemHandler(value);\n }\n\n private updateBin(oldBin: string | null): void {\n const {bin} = this;\n\n if (bin !== oldBin && !this.cardPrefilled) {\n this.binChange.emit(bin);\n }\n }\n\n private updateProperty(value: string, propName: 'card' | 'cvc' | 'expire'): void {\n const {card = '', expire = '', cvc = ''} = this.value() || {};\n const newValue: TuiCard = {card, expire, cvc};\n\n newValue[propName] = value;\n\n this.onChange(newValue.expire || newValue.cvc || newValue.card ? newValue : null);\n }\n\n private focusInput(): void {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n element?.focus();\n }\n}\n","<div class=\"t-wrapper\">\n <label\n *tuiLet=\"value()?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n (click.silent.prevent)=\"(0)\"\n >\n <input\n #inputCard\n automation-id=\"tui-input-card-grouped__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 [autocomplete]=\"autocomplete ? 'cc-number' : 'off'\"\n [class.t-input_hidden]=\"!card.length && focus()\"\n [class.t-input_inert]=\"cardPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCard\"\n [ngModel]=\"formattedCard\"\n [placeholder]=\"cardPrefilled ? '' : 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)=\"(0)\"\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.transform]=\"transform(ghost)\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <div\n class=\"t-label\"\n [class.t-label_raised]=\"labelRaised()\"\n >\n {{ texts()?.cardNumberText }}\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.silent.prevent)=\"(0)\">\n <input\n #inputExpire\n automation-id=\"tui-input-card-grouped__expire\"\n inputmode=\"numeric\"\n placeholder=\"00/00\"\n translate=\"no\"\n class=\"t-input\"\n [attr.id]=\"id + '_expire'\"\n [attr.name]=\"autocomplete ? 'ccexpiryyear' : null\"\n [autocomplete]=\"autocomplete ? 'cc-exp' : 'off'\"\n [class.t-input_inert]=\"!expireFocusable\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskExpire\"\n [ngModel]=\"expire\"\n [readOnly]=\"readOnly()\"\n [tabIndex]=\"expireFocusable ? 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.silent.prevent)=\"(0)\">\n <input\n #inputCVC\n automation-id=\"tui-input-card-grouped__cvc\"\n inputmode=\"numeric\"\n translate=\"no\"\n type=\"text\"\n class=\"t-input\"\n [attr.id]=\"id + '_cvc'\"\n [autocomplete]=\"autocomplete ? 'cc-csc' : 'off'\"\n [class.t-input_cvc_hidden]=\"cvcHidden\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [disabled]=\"disabled()\"\n [maskito]=\"maskCVC\"\n [ngModel]=\"cvc\"\n [placeholder]=\"cvcPrefilled ? '•••' : exampleTextCVC\"\n [readOnly]=\"readOnly() || cvcPrefilled\"\n [tabIndex]=\"cvcFocusable ? 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-grouped__icon\"\n class=\"t-card\"\n [src]=\"src | tuiIcon\"\n />\n </div>\n <tui-icon\n *ngIf=\"hasCleaner()\"\n automation-id=\"tui-input-card-grouped__cleaner\"\n tuiAppearance=\"icon\"\n class=\"t-icon\"\n [icon]=\"icons.close\"\n (click)=\"clear()\"\n />\n <tui-icon\n *ngIf=\"dropdown.content\"\n automation-id=\"tui-input-card-grouped__dropdown\"\n tuiAppearance=\"icon\"\n tuiChevron\n (click)=\"toggle()\"\n />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAca,MAAA,sCAAsC,GAA6B;AAC5E,IAAA,GAAG,8BAA8B;AACjC,IAAA,aAAa,EAAE,uBAAuB;AACtC,IAAA,WAAW,EAAE,qBAAqB;AAClC,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,SAAS,EAAE,I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