@taiga-ui/addon-commerce 2.55.0 → 2.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js +14 -14
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +37 -37
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +11 -11
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +5 -5
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +4 -4
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js +18 -18
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-constants.umd.js +30 -30
- package/bundles/taiga-ui-addon-commerce-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.js +14 -0
- package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js +6 -6
- package/bundles/taiga-ui-addon-commerce-pipes.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-pipes.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js +4 -4
- package/bundles/taiga-ui-addon-commerce-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js +30 -30
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-validators.umd.js +2 -2
- package/bundles/taiga-ui-addon-commerce-validators.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-validators.umd.min.js.map +1 -1
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
- package/enums/currency-code.d.ts +7 -0
- package/enums/currency.d.ts +7 -0
- package/esm2015/components/card/card.component.js +15 -15
- package/esm2015/components/input-card/input-card.component.js +12 -12
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +36 -36
- package/esm2015/components/input-card-grouped/input-card-grouped.providers.js +3 -3
- package/esm2015/components/input-cvc/input-cvc.component.js +6 -6
- package/esm2015/components/input-expire/input-expire.component.js +5 -5
- package/esm2015/components/money/money-options.js +4 -4
- package/esm2015/components/money/money.component.js +7 -7
- package/esm2015/components/money/pipes/fraction-part.pipe.js +2 -2
- package/esm2015/components/money/pipes/integer-part.pipe.js +2 -2
- package/esm2015/components/money/pipes/sign-symbol.pipe.js +2 -2
- package/esm2015/components/money/utils/format-fraction-part.js +4 -4
- package/esm2015/components/money/utils/format-sign-symbol.js +4 -4
- package/esm2015/constants/card-holder-mask.js +27 -27
- package/esm2015/constants/card-mask.js +5 -5
- package/esm2015/enums/currency-code.js +8 -1
- package/esm2015/enums/currency.js +8 -1
- package/esm2015/enums/money-sign.js +1 -1
- package/esm2015/enums/payment-system.js +1 -1
- package/esm2015/pipes/currency/currency.pipe.js +2 -2
- package/esm2015/pipes/format-card/format-card.pipe.js +6 -6
- package/esm2015/tokens/i18n.js +5 -5
- package/esm2015/utils/create-auto-corrected-expire-pipe.js +6 -6
- package/esm2015/utils/format-currency.js +4 -4
- package/esm2015/utils/get-currency-symbol.js +20 -20
- package/esm2015/utils/get-payment-system.js +2 -2
- package/esm2015/utils/is-card-number-valid.js +3 -3
- package/esm2015/validators/card-expire.validator.js +2 -2
- package/esm2015/validators/card-number.validator.js +2 -2
- package/esm5/components/card/card.component.js +15 -15
- package/esm5/components/input-card/input-card.component.js +12 -12
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +36 -36
- package/esm5/components/input-card-grouped/input-card-grouped.providers.js +3 -3
- package/esm5/components/input-cvc/input-cvc.component.js +6 -6
- package/esm5/components/input-expire/input-expire.component.js +5 -5
- package/esm5/components/money/money-options.js +4 -4
- package/esm5/components/money/money.component.js +7 -7
- package/esm5/components/money/pipes/fraction-part.pipe.js +2 -2
- package/esm5/components/money/pipes/integer-part.pipe.js +2 -2
- package/esm5/components/money/pipes/sign-symbol.pipe.js +2 -2
- package/esm5/components/money/utils/format-fraction-part.js +4 -4
- package/esm5/components/money/utils/format-sign-symbol.js +4 -4
- package/esm5/constants/card-holder-mask.js +27 -27
- package/esm5/constants/card-mask.js +5 -5
- package/esm5/enums/currency-code.js +8 -1
- package/esm5/enums/currency.js +8 -1
- package/esm5/enums/money-sign.js +1 -1
- package/esm5/enums/payment-system.js +1 -1
- package/esm5/pipes/currency/currency.pipe.js +2 -2
- package/esm5/pipes/format-card/format-card.pipe.js +6 -6
- package/esm5/tokens/i18n.js +5 -5
- package/esm5/utils/create-auto-corrected-expire-pipe.js +6 -6
- package/esm5/utils/format-currency.js +4 -4
- package/esm5/utils/get-currency-symbol.js +20 -20
- package/esm5/utils/get-payment-system.js +2 -2
- package/esm5/utils/is-card-number-valid.js +3 -3
- package/esm5/validators/card-expire.validator.js +2 -2
- package/esm5/validators/card-number.validator.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-components-card.js +14 -14
- package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +37 -37
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +11 -11
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +5 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +4 -4
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js +18 -18
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-constants.js +30 -30
- package/fesm2015/taiga-ui-addon-commerce-constants.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-enums.js +14 -0
- package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-pipes.js +6 -6
- package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-tokens.js +4 -4
- package/fesm2015/taiga-ui-addon-commerce-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js +30 -30
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-validators.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-validators.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-card.js +14 -14
- package/fesm5/taiga-ui-addon-commerce-components-card.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +37 -37
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js +11 -11
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js +5 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +4 -4
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js +18 -18
- package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-constants.js +30 -30
- package/fesm5/taiga-ui-addon-commerce-constants.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-enums.js +14 -0
- package/fesm5/taiga-ui-addon-commerce-enums.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-pipes.js +6 -6
- package/fesm5/taiga-ui-addon-commerce-pipes.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-tokens.js +4 -4
- package/fesm5/taiga-ui-addon-commerce-tokens.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js +30 -30
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-validators.js +2 -2
- package/fesm5/taiga-ui-addon-commerce-validators.js.map +1 -1
- package/package.json +4 -4
|
@@ -15,13 +15,13 @@ import { TuiFormatCardModule } from '@taiga-ui/addon-commerce/pipes';
|
|
|
15
15
|
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
16
16
|
import { TextMaskModule } from 'angular2-text-mask';
|
|
17
17
|
|
|
18
|
-
const TUI_INPUT_CARD_GROUPED_TEXTS = new InjectionToken(
|
|
18
|
+
const TUI_INPUT_CARD_GROUPED_TEXTS = new InjectionToken(`InputCardGrouped texts`, {
|
|
19
19
|
factory: () => inputGroupedTextsFactory(inject(WINDOW), inject(TUI_CARD_NUMBER_TEXTS), inject(TUI_CARD_EXPIRY_TEXTS), inject(TUI_CARD_CVC_TEXTS), inject(TUI_MEDIA)),
|
|
20
20
|
});
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
22
|
function inputGroupedTextsFactory(windowRef, cardNumberTexts, expiryTexts, cvcTexts, { desktopSmall }) {
|
|
23
23
|
const media = windowRef.matchMedia(`screen and (min-width: ${(desktopSmall - 1) / 16}em)`);
|
|
24
|
-
return typedFromEvent(media,
|
|
24
|
+
return typedFromEvent(media, `change`).pipe(startWith(null), switchMap(() => combineLatest([
|
|
25
25
|
of(Number(media.matches)),
|
|
26
26
|
cardNumberTexts,
|
|
27
27
|
expiryTexts,
|
|
@@ -35,16 +35,16 @@ function inputGroupedTextsFactory(windowRef, cardNumberTexts, expiryTexts, cvcTe
|
|
|
35
35
|
|
|
36
36
|
var TuiInputCardGroupedComponent_1;
|
|
37
37
|
const STUB = {
|
|
38
|
-
card:
|
|
39
|
-
expire:
|
|
40
|
-
cvc:
|
|
38
|
+
card: ``,
|
|
39
|
+
expire: ``,
|
|
40
|
+
cvc: ``,
|
|
41
41
|
};
|
|
42
42
|
const ICONS = {
|
|
43
|
-
["mir" /* Mir */]:
|
|
44
|
-
["visa" /* Visa */]:
|
|
45
|
-
["electron" /* Electron */]:
|
|
46
|
-
["mastercard" /* Mastercard */]:
|
|
47
|
-
["maestro" /* Maestro */]:
|
|
43
|
+
["mir" /* Mir */]: `tuiIconMir`,
|
|
44
|
+
["visa" /* Visa */]: `tuiIconVisa`,
|
|
45
|
+
["electron" /* Electron */]: `tuiIconElectron`,
|
|
46
|
+
["mastercard" /* Mastercard */]: `tuiIconMastercard`,
|
|
47
|
+
["maestro" /* Maestro */]: `tuiIconMaestro`,
|
|
48
48
|
};
|
|
49
49
|
// @dynamic
|
|
50
50
|
let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInputCardGroupedComponent extends AbstractTuiNullableControl {
|
|
@@ -57,12 +57,12 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
57
57
|
this.expireInert = false;
|
|
58
58
|
this.autocompleteEnabled = false;
|
|
59
59
|
this.cardSrc = null; // TODO: 3.0 will be deleted `null` in v3.0
|
|
60
|
-
this.exampleText =
|
|
60
|
+
this.exampleText = `0000 0000 0000 0000`;
|
|
61
61
|
this.cardValidator = tuiDefaultCardValidator;
|
|
62
62
|
this.autofilledChange = new EventEmitter();
|
|
63
63
|
this.binChange = new EventEmitter();
|
|
64
|
-
this.dropdown =
|
|
65
|
-
this.exampleTextCVC =
|
|
64
|
+
this.dropdown = ``;
|
|
65
|
+
this.exampleTextCVC = `000`;
|
|
66
66
|
this.maskCVC = {
|
|
67
67
|
mask: new Array(3).fill(TUI_DIGIT_REGEXP),
|
|
68
68
|
guide: false,
|
|
@@ -76,7 +76,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
76
76
|
mask: [
|
|
77
77
|
TUI_DIGIT_REGEXP,
|
|
78
78
|
TUI_DIGIT_REGEXP,
|
|
79
|
-
|
|
79
|
+
`/`,
|
|
80
80
|
TUI_DIGIT_REGEXP,
|
|
81
81
|
TUI_DIGIT_REGEXP,
|
|
82
82
|
],
|
|
@@ -86,7 +86,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
86
86
|
this.open = false;
|
|
87
87
|
}
|
|
88
88
|
set codeLength(length) {
|
|
89
|
-
this.exampleTextCVC =
|
|
89
|
+
this.exampleTextCVC = `0`.repeat(length);
|
|
90
90
|
this.maskCVC = {
|
|
91
91
|
mask: new Array(length).fill(TUI_DIGIT_REGEXP),
|
|
92
92
|
guide: false,
|
|
@@ -100,15 +100,15 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
100
100
|
}
|
|
101
101
|
get card() {
|
|
102
102
|
var _a, _b;
|
|
103
|
-
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.card) !== null && _b !== void 0 ? _b :
|
|
103
|
+
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.card) !== null && _b !== void 0 ? _b : ``;
|
|
104
104
|
}
|
|
105
105
|
get expire() {
|
|
106
106
|
var _a, _b;
|
|
107
|
-
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.expire) !== null && _b !== void 0 ? _b :
|
|
107
|
+
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.expire) !== null && _b !== void 0 ? _b : ``;
|
|
108
108
|
}
|
|
109
109
|
get cvc() {
|
|
110
110
|
var _a, _b;
|
|
111
|
-
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.cvc) !== null && _b !== void 0 ? _b :
|
|
111
|
+
return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.cvc) !== null && _b !== void 0 ? _b : ``;
|
|
112
112
|
}
|
|
113
113
|
get hasCleaner() {
|
|
114
114
|
var _a, _b;
|
|
@@ -166,7 +166,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
166
166
|
}
|
|
167
167
|
// Safari expiration date autofill workaround
|
|
168
168
|
get name() {
|
|
169
|
-
return this.autocompleteEnabled ?
|
|
169
|
+
return this.autocompleteEnabled ? `ccexpiryyear` : null;
|
|
170
170
|
}
|
|
171
171
|
get cardPrefilled() {
|
|
172
172
|
return !!this.card.match(TUI_NON_DIGIT_REGEXP);
|
|
@@ -184,7 +184,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
184
184
|
return this.isFocusable(this.card);
|
|
185
185
|
}
|
|
186
186
|
get masked() {
|
|
187
|
-
return this.cardPrefilled ? `*${this.card.slice(-4)}` :
|
|
187
|
+
return this.cardPrefilled ? `*${this.card.slice(-4)}` : `*`;
|
|
188
188
|
}
|
|
189
189
|
onEsc() {
|
|
190
190
|
this.open = false;
|
|
@@ -197,7 +197,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
197
197
|
}
|
|
198
198
|
handleOption(option) {
|
|
199
199
|
var _a, _b;
|
|
200
|
-
const { card =
|
|
200
|
+
const { card = ``, expire = ``, cvc = `` } = option;
|
|
201
201
|
const { bin } = this;
|
|
202
202
|
const element = (!expire && ((_a = this.inputExpire) === null || _a === void 0 ? void 0 : _a.nativeElement)) || ((_b = this.inputCVC) === null || _b === void 0 ? void 0 : _b.nativeElement);
|
|
203
203
|
this.updateValue({ card, expire, cvc });
|
|
@@ -208,11 +208,11 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
208
208
|
}
|
|
209
209
|
onCardChange(card) {
|
|
210
210
|
const { value, bin } = this;
|
|
211
|
-
const parsed = card.split(
|
|
211
|
+
const parsed = card.split(` `).join(``);
|
|
212
212
|
if (value && value.card === parsed) {
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
|
-
this.updateProperty(parsed,
|
|
215
|
+
this.updateProperty(parsed, `card`);
|
|
216
216
|
this.updateBin(bin);
|
|
217
217
|
if (this.cardValidator(this.card) && !this.expire && this.inputExpire) {
|
|
218
218
|
this.focusExpire();
|
|
@@ -227,17 +227,17 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
227
227
|
if (parseInt(expire.slice(0, 2), 10) > 12) {
|
|
228
228
|
expire = `12${expire.slice(2)}`;
|
|
229
229
|
}
|
|
230
|
-
if (expire.slice(0, 2) ===
|
|
230
|
+
if (expire.slice(0, 2) === `00`) {
|
|
231
231
|
expire = `01${expire.slice(2)}`;
|
|
232
232
|
}
|
|
233
233
|
this.inputExpire.nativeElement.value = expire;
|
|
234
|
-
this.updateProperty(expire,
|
|
234
|
+
this.updateProperty(expire, `expire`);
|
|
235
235
|
if (expire.length === 5) {
|
|
236
236
|
this.focusCVC();
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
onCVCChange(cvc) {
|
|
240
|
-
this.updateProperty(cvc,
|
|
240
|
+
this.updateProperty(cvc, `cvc`);
|
|
241
241
|
}
|
|
242
242
|
onActiveZoneChange(active) {
|
|
243
243
|
this.updateFocused(active);
|
|
@@ -248,7 +248,7 @@ let TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = class TuiInp
|
|
|
248
248
|
}
|
|
249
249
|
onMouseDown(event) {
|
|
250
250
|
tuiAssertIsHTMLElement(event.target);
|
|
251
|
-
if (event.target.matches(
|
|
251
|
+
if (event.target.matches(`input`)) {
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
event.preventDefault();
|
|
@@ -330,13 +330,13 @@ TuiInputCardGroupedComponent.ctorParameters = () => [
|
|
|
330
330
|
{ type: String, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_APPEARANCE,] }] }
|
|
331
331
|
];
|
|
332
332
|
__decorate([
|
|
333
|
-
ViewChild(
|
|
333
|
+
ViewChild(`inputCard`)
|
|
334
334
|
], TuiInputCardGroupedComponent.prototype, "inputCard", void 0);
|
|
335
335
|
__decorate([
|
|
336
|
-
ViewChild(
|
|
336
|
+
ViewChild(`inputExpire`)
|
|
337
337
|
], TuiInputCardGroupedComponent.prototype, "inputExpire", void 0);
|
|
338
338
|
__decorate([
|
|
339
|
-
ViewChild(
|
|
339
|
+
ViewChild(`inputCVC`)
|
|
340
340
|
], TuiInputCardGroupedComponent.prototype, "inputCVC", void 0);
|
|
341
341
|
__decorate([
|
|
342
342
|
Input(),
|
|
@@ -371,18 +371,18 @@ __decorate([
|
|
|
371
371
|
ContentChild(TuiDataListComponent)
|
|
372
372
|
], TuiInputCardGroupedComponent.prototype, "datalist", void 0);
|
|
373
373
|
__decorate([
|
|
374
|
-
HostListener(
|
|
374
|
+
HostListener(`keydown.esc`)
|
|
375
375
|
], TuiInputCardGroupedComponent.prototype, "onEsc", null);
|
|
376
376
|
__decorate([
|
|
377
|
-
HostListener(
|
|
378
|
-
HostListener(
|
|
377
|
+
HostListener(`keydown.arrowDown.prevent`, [`$event.target`, `1`]),
|
|
378
|
+
HostListener(`keydown.arrowUp.prevent`, [`$event.target`, `-1`])
|
|
379
379
|
], TuiInputCardGroupedComponent.prototype, "onArrow", null);
|
|
380
380
|
__decorate([
|
|
381
381
|
tuiPure
|
|
382
382
|
], TuiInputCardGroupedComponent.prototype, "isFocusable", null);
|
|
383
383
|
TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = __decorate([
|
|
384
384
|
Component({
|
|
385
|
-
selector:
|
|
385
|
+
selector: `tui-input-card-grouped`,
|
|
386
386
|
template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n class=\"t-common-wrapper\"\n [appearance]=\"appearance\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n [tuiDropdown]=\"open\"\n [tuiDropdownContent]=\"dropdown || ''\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (tuiActiveZoneChange)=\"onActiveZoneChange($event)\"\n (scroll)=\"onScroll($event)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label\n *tuiLet=\"value?.card | tuiFormatCard: cardPrefilled as formattedCard\"\n tuiPreventDefault=\"click\"\n >\n <input\n #inputCard\n type=\"text\"\n automation-id=\"tui-input-card-grouped__card\"\n tuiInputMode=\"numeric\"\n class=\"t-input t-input_card\"\n [class.t-input_inert]=\"cardPrefilled\"\n [class.t-input_hidden]=\"!card.length && focused\"\n [attr.id]=\"idCard\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [placeholder]=\"cardPrefilled ? '' : exampleText\"\n [autocomplete]=\"autocompleteCard\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [textMask]=\"maskCard\"\n [tuiFocusable]=\"cardFocusable\"\n [ngModel]=\"formattedCard\"\n (ngModelChange)=\"onCardChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n aria-hidden=\"true\"\n class=\"t-collapsed\"\n [attr.data-before]=\"masked\"\n [class.t-collapsed_enable-mask]=\"isCardCollapsed\"\n >\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [class.t-value_collapsed]=\"isCardCollapsed\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cardNumberText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputExpire\n type=\"text\"\n placeholder=\"00/00\"\n automation-id=\"tui-input-card-grouped__expire\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_inert]=\"!expireFocusable\"\n [attr.id]=\"idExpire\"\n [attr.name]=\"name\"\n [autocomplete]=\"autocompleteExpire\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiFocusable]=\"expireFocusable\"\n [textMask]=\"maskExpire\"\n [ngModel]=\"expire\"\n (ngModelChange)=\"onExpireChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.expiryText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputCVC\n type=\"text\"\n automation-id=\"tui-input-card-grouped__cvc\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [attr.id]=\"idCVC\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly || cvcPrefilled\"\n [autocomplete]=\"autocompleteCVC\"\n [textMask]=\"maskCVC\"\n [tuiFocusable]=\"cvcFocusable\"\n [ngModel]=\"cvc\"\n (ngModelChange)=\"onCVCChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cvcText }}\n </span>\n </label>\n </div>\n <div class=\"t-icons\">\n <div\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-icon-outlet\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n automation-id=\"tui-input-card-grouped__icon\"\n class=\"t-card\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </div>\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"t-icon\"\n (click)=\"clear()\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"hasDropdown\"\n src=\"tuiIconChevronDownLarge\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"open\"\n (click)=\"toggle()\"\n ></tui-svg>\n </div>\n</tui-wrapper>\n",
|
|
387
387
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
388
388
|
providers: [
|
|
@@ -397,10 +397,10 @@ TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = __decorate([
|
|
|
397
397
|
},
|
|
398
398
|
],
|
|
399
399
|
host: {
|
|
400
|
-
'($.data-mode.attr)':
|
|
401
|
-
'data-size':
|
|
400
|
+
'($.data-mode.attr)': `mode$`,
|
|
401
|
+
'data-size': `l`,
|
|
402
402
|
},
|
|
403
|
-
styles: [":host{display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-m)}:host[data-mode=onDark]{--tui-autofill:var(--tui-autofill-night)}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;height:100%;width:100%;overflow:hidden}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration,300ms);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;margin-right:.625rem}.t-collapsed{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 0 0 1rem;margin:0;border-radius:inherit;background:0 0;font-size:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none;line-height:2.25rem;pointer-events:none}.t-collapsed:-webkit-autofill,.t-collapsed:-webkit-autofill:focus,.t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-collapsed:-webkit-autofill,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:focus,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-collapsed :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-collapsed :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}.t-collapsed :host-context(tui-primitive-textfield._disabled),.t-collapsed :host-context(tui-text-area._disabled),:host._disabled .t-collapsed{pointer-events:none}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-collapsed{opacity:0;text-indent:-10em;-webkit-user-select: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,300ms);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;transform:translate3d(100%,0,0)}.t-value_collapsed{transform:translate3d(4ch,0,0)}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 1rem;margin:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-input::-ms-input-placeholder{color:var(--tui-text-03)}.t-input::placeholder{color:var(--tui-text-03)}:host[data-mode=onDark] .t-input::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input::placeholder{color:var(--tui-text-03-night)}.t-input_card:not(.t-input_hidden),.t-input_card:not(.t-input_hidden):-webkit-autofill,.t-input_card:not(.t-input_hidden)::placeholder{caret-color:var(--tui-base-09);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input_card::-webkit-credit-card-auto-fill-button{pointer-events:none;background-color:transparent!important;-webkit-mask-image:none!important}.t-input_inert{pointer-events:none}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:inherit}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}.t-icon_rotated{transform:rotate(180deg)}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0);margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{will-change:unset;transition-property:transform,color,letter-spacing}}"]
|
|
403
|
+
styles: [":host{display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-m)}:host[data-mode=onDark]{--tui-autofill:var(--tui-autofill-night)}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;height:100%;width:100%;overflow:hidden}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration,300ms);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;margin-right:.625rem}.t-collapsed{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 0 0 1rem;margin:0;border-radius:inherit;background:0 0;font-size:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none;line-height:2.25rem;pointer-events:none}.t-collapsed:-webkit-autofill,.t-collapsed:-webkit-autofill:focus,.t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:transparent!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-collapsed :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-collapsed:-webkit-autofill,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:focus,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:transparent!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-collapsed :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-collapsed :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}.t-collapsed :host-context(tui-primitive-textfield._disabled),.t-collapsed :host-context(tui-text-area._disabled),:host._disabled .t-collapsed{pointer-events:none}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.t-content .t-placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.t-content .t-placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-collapsed{opacity:0;text-indent:-10em;-webkit-user-select: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,300ms);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;transform:translate3d(100%,0,0)}.t-value_collapsed{transform:translate3d(4ch,0,0)}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 1rem;margin:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:transparent!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:transparent!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-input::-ms-input-placeholder{color:var(--tui-text-03)}.t-input::placeholder{color:var(--tui-text-03)}:host[data-mode=onDark] .t-input::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input::placeholder{color:var(--tui-text-03-night)}.t-input_card:not(.t-input_hidden),.t-input_card:not(.t-input_hidden):-webkit-autofill,.t-input_card:not(.t-input_hidden)::placeholder{caret-color:var(--tui-base-09);color:transparent!important;-webkit-text-fill-color:transparent!important}.t-input_card::-webkit-credit-card-auto-fill-button{pointer-events:none;background-color:transparent!important;-webkit-mask-image:none!important}.t-input_inert{pointer-events:none}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:inherit}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}.t-icon_rotated{transform:rotate(180deg)}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0);margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{will-change:unset;transition-property:transform,color,letter-spacing}}"]
|
|
404
404
|
}),
|
|
405
405
|
__param(0, Optional()),
|
|
406
406
|
__param(0, Self()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card-grouped.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.providers.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.module.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.ts"],"sourcesContent":["import {inject, InjectionToken} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n TUI_CARD_CVC_TEXTS,\n TUI_CARD_EXPIRY_TEXTS,\n TUI_CARD_NUMBER_TEXTS,\n} from '@taiga-ui/addon-commerce/tokens';\nimport {typedFromEvent} from '@taiga-ui/cdk';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport {combineLatest, Observable, of} from 'rxjs';\nimport {map, startWith, switchMap} from 'rxjs/operators';\n\nexport interface TuiCardGroupedTexts {\n readonly cardNumberText: string;\n readonly expiryText: string;\n readonly cvcText: string;\n}\n\nexport const TUI_INPUT_CARD_GROUPED_TEXTS = new InjectionToken<\n Observable<TuiCardGroupedTexts>\n>('InputCardGrouped texts', {\n factory: () =>\n inputGroupedTextsFactory(\n inject(WINDOW),\n inject(TUI_CARD_NUMBER_TEXTS),\n inject(TUI_CARD_EXPIRY_TEXTS),\n inject(TUI_CARD_CVC_TEXTS),\n inject(TUI_MEDIA),\n ),\n});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inputGroupedTextsFactory(\n windowRef: Window,\n cardNumberTexts: Observable<[string, string]>,\n expiryTexts: Observable<[string, string]>,\n cvcTexts: Observable<[string, string]>,\n {desktopSmall}: TuiMedia,\n): Observable<TuiCardGroupedTexts> {\n const media = windowRef.matchMedia(\n `screen and (min-width: ${(desktopSmall - 1) / 16}em)`,\n );\n\n return typedFromEvent(media, 'change').pipe(\n startWith(null),\n switchMap(() =>\n combineLatest([\n of(Number(media.matches)),\n cardNumberTexts,\n expiryTexts,\n cvcTexts,\n ]),\n ),\n map(([index, cardNumber, expiry, cvcTexts]) => ({\n cardNumberText: cardNumber[index],\n expiryText: expiry[index],\n cvcText: cvcTexts[index],\n })),\n );\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK, tuiDefaultCardValidator} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCard} from '@taiga-ui/addon-commerce/interfaces';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n getPaymentSystem,\n tuiCreateAutoCorrectedExpirePipe,\n} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiNullableControl,\n isNativeFocused,\n isNativeFocusedIn,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiAssertIsHTMLElement,\n TuiBooleanHandler,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiPure,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n MODE_PROVIDER,\n TUI_DATA_LIST_HOST,\n TUI_DIGIT_REGEXP,\n TUI_MODE,\n TUI_NON_DIGIT_REGEXP,\n TUI_TEXTFIELD_APPEARANCE,\n TuiBrightness,\n TuiDataListComponent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskConfig} from 'angular2-text-mask';\nimport {Observable} from 'rxjs';\n\nimport {\n TUI_INPUT_CARD_GROUPED_TEXTS,\n TuiCardGroupedTexts,\n} from './input-card-grouped.providers';\n\nconst STUB: TuiCard = {\n card: '',\n expire: '',\n cvc: '',\n};\nconst ICONS = {\n [TuiPaymentSystem.Mir]: 'tuiIconMir',\n [TuiPaymentSystem.Visa]: 'tuiIconVisa',\n [TuiPaymentSystem.Electron]: 'tuiIconElectron',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n// @dynamic\n@Component({\n selector: 'tui-input-card-grouped',\n templateUrl: './input-card-grouped.template.html',\n styleUrls: ['./input-card-grouped.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n ],\n host: {\n '($.data-mode.attr)': 'mode$',\n 'data-size': 'l',\n },\n})\nexport class TuiInputCardGroupedComponent\n extends AbstractTuiNullableControl<TuiCard>\n implements TuiFocusableElementAccessor, TuiDataListHost<Partial<TuiCard>>\n{\n @ViewChild('inputCard')\n private readonly inputCard?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputExpire')\n private readonly inputExpire?: ElementRef<HTMLInputElement>;\n\n @ViewChild('inputCVC')\n private readonly inputCVC?: ElementRef<HTMLInputElement>;\n\n private expireInert = false;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: PolymorpheusContent | null = null; // TODO: 3.0 will be deleted `null` in v3.0\n\n @Input()\n @tuiDefaultProp()\n exampleText = '0000 0000 0000 0000';\n\n @Input()\n @tuiDefaultProp()\n cardValidator: TuiBooleanHandler<string> = tuiDefaultCardValidator;\n\n @Input()\n @tuiRequiredSetter()\n set codeLength(length: TuiCodeCVCLength) {\n this.exampleTextCVC = '0'.repeat(length);\n this.maskCVC = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n @Output()\n readonly autofilledChange = new EventEmitter<boolean>();\n\n @Output()\n readonly binChange = new EventEmitter<string | null>();\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly dropdown: PolymorpheusContent = '';\n\n @ContentChild(TuiDataListComponent)\n readonly datalist?: TuiDataListComponent<TuiCard>;\n\n exampleTextCVC = '000';\n\n maskCVC: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n readonly maskCard: TextMaskConfig = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n readonly maskExpire: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n '/',\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_INPUT_CARD_GROUPED_TEXTS)\n readonly cardGroupedTexts$: Observable<TuiCardGroupedTexts>,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.inputCard ? this.inputCard.nativeElement : null;\n }\n\n get focused(): boolean {\n return this.open || isNativeFocusedIn(this.elementRef.nativeElement);\n }\n\n get card(): string {\n return this.value?.card ?? '';\n }\n\n get expire(): string {\n return this.value?.expire ?? '';\n }\n\n get cvc(): string {\n return this.value?.cvc ?? '';\n }\n\n get hasCleaner(): boolean {\n return !!this.value?.card?.trim() && !this.readOnly && !this.computedDisabled;\n }\n\n get hasDropdown(): boolean {\n return !!this.dropdown;\n }\n\n get defaultIcon(): string | null {\n const {paymentSystem} = this;\n\n return paymentSystem && ICONS[paymentSystem];\n }\n\n get icon(): PolymorpheusContent | null {\n return this.cardSrc ?? this.defaultIcon;\n }\n\n get bin(): string | null {\n return !this.value || this.value.card.length < 6\n ? null\n : this.value.card.slice(0, 6);\n }\n\n get placeholderRaised(): boolean {\n return (this.computedFocused && !this.readOnly) || this.hasCardNumber;\n }\n\n get hasCardNumber(): boolean {\n return !!this.value?.card?.trim();\n }\n\n get idCard(): string {\n return `${this.id}_card`;\n }\n\n get idExpire(): string {\n return `${this.id}_expire`;\n }\n\n get idCVC(): string {\n return `${this.id}_cvc`;\n }\n\n get isCardCollapsed(): boolean {\n return this.isFocusable(this.card) && !this.cardFocused;\n }\n\n get autocompleteCard(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcNumber\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteExpire(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteCVC(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n // Safari expiration date autofill workaround\n get name(): 'ccexpiryyear' | null {\n return this.autocompleteEnabled ? 'ccexpiryyear' : null;\n }\n\n get cardPrefilled(): boolean {\n return !!this.card.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cvcPrefilled(): boolean {\n return !!this.cvc.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cardFocusable(): boolean {\n return this.focusable && !this.cardPrefilled;\n }\n\n get expireFocusable(): boolean {\n return this.isFocusable(this.card) && !this.expireInert;\n }\n\n get cvcFocusable(): boolean {\n return this.isFocusable(this.card);\n }\n\n get masked(): string {\n return this.cardPrefilled ? `*${this.card.slice(-4)}` : '*';\n }\n\n @HostListener('keydown.esc')\n onEsc(): void {\n this.open = false;\n }\n\n @HostListener('keydown.arrowDown.prevent', ['$event.target', '1'])\n @HostListener('keydown.arrowUp.prevent', ['$event.target', '-1'])\n onArrow(element: HTMLElement, step: number): void {\n this.open = this.hasDropdown;\n this.changeDetectorRef.detectChanges();\n this.datalist?.onKeyDownArrow(element, step);\n }\n\n handleOption(option: Partial<TuiCard>): void {\n const {card = '', expire = '', cvc = ''} = option;\n const {bin} = this;\n const element =\n (!expire && this.inputExpire?.nativeElement) || this.inputCVC?.nativeElement;\n\n this.updateValue({card, expire, cvc});\n this.updateBin(bin);\n this.open = false;\n this.expireInert = !!expire;\n\n element?.focus();\n }\n\n onCardChange(card: string): void {\n const {value, bin} = this;\n const parsed = card.split(' ').join('');\n\n if (value && value.card === parsed) {\n return;\n }\n\n this.updateProperty(parsed, 'card');\n this.updateBin(bin);\n\n if (this.cardValidator(this.card) && !this.expire && this.inputExpire) {\n this.focusExpire();\n }\n }\n\n onExpireChange(expire: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.inputExpire) {\n return;\n }\n\n if (parseInt(expire.slice(0, 2), 10) > 12) {\n expire = `12${expire.slice(2)}`;\n }\n\n if (expire.slice(0, 2) === '00') {\n expire = `01${expire.slice(2)}`;\n }\n\n this.inputExpire.nativeElement.value = expire;\n this.updateProperty(expire, 'expire');\n\n if (expire.length === 5) {\n this.focusCVC();\n }\n }\n\n onCVCChange(cvc: string): void {\n this.updateProperty(cvc, 'cvc');\n }\n\n onActiveZoneChange(active: boolean): void {\n this.updateFocused(active);\n this.open = active && this.open;\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onMouseDown(event: MouseEvent): void {\n tuiAssertIsHTMLElement(event.target);\n\n if (event.target.matches('input')) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n onScroll({currentTarget}: Event): void {\n tuiAssertIsHTMLElement(currentTarget);\n\n currentTarget.scrollLeft = 0;\n }\n\n clear(): void {\n this.updateValue(null);\n this.focusCard();\n }\n\n toggle(): void {\n this.open = !this.open;\n }\n\n writeValue(value: TuiCard | null): void {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expireInert = !!this.expire && this.cardPrefilled;\n }\n\n /** Public API for manual focus management */\n focusCard(): void {\n this.inputCard?.nativeElement.focus();\n }\n\n focusExpire(): void {\n this.inputExpire?.nativeElement.focus({preventScroll: true});\n }\n\n focusCVC(): void {\n this.inputCVC?.nativeElement.focus();\n }\n\n private get cardFocused(): boolean {\n return !!this.inputCard && isNativeFocused(this.inputCard.nativeElement);\n }\n\n private get paymentSystem(): TuiPaymentSystem | null {\n return this.value && getPaymentSystem(this.value.card);\n }\n\n @tuiPure\n private isFocusable(card: string): boolean {\n return this.focusable && (this.cardValidator(card) || this.cardPrefilled);\n }\n\n private updateBin(oldBin: string | null): void {\n const {bin} = this;\n\n if (bin !== oldBin && !this.cardPrefilled) {\n this.binChange.emit(bin);\n }\n }\n\n private updateProperty(propValue: string, propName: 'card' | 'expire' | 'cvc'): void {\n const {card, expire, cvc} = this.value || STUB;\n const newValue: TuiCard = {\n card,\n expire,\n cvc,\n };\n\n newValue[propName] = propValue;\n\n if (!newValue.expire && !newValue.cvc && !newValue.card) {\n this.updateValue(null);\n } else {\n this.updateValue(newValue);\n }\n }\n\n private focusInput(): void {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n element?.focus();\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiFormatCardModule} from '@taiga-ui/addon-commerce/pipes';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiLetModule,\n TuiMapperPipeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownModule, TuiSvgModule, TuiWrapperModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCardGroupedComponent} from './input-card-grouped.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiSvgModule,\n TuiWrapperModule,\n TuiHoveredModule,\n TuiActiveZoneModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiDropdownModule,\n TuiPreventDefaultModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiFormatCardModule,\n ],\n declarations: [TuiInputCardGroupedComponent],\n exports: [TuiInputCardGroupedComponent],\n})\nexport class TuiInputCardGroupedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAmBa,4BAA4B,GAAG,IAAI,cAAc,CAE5D,wBAAwB,EAAE;IACxB,OAAO,EAAE,MACL,wBAAwB,CACpB,MAAM,CAAC,MAAM,CAAC,EACd,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,kBAAkB,CAAC,EAC1B,MAAM,CAAC,SAAS,CAAC,CACpB;CACR,EAAE;AAEH;SACgB,wBAAwB,CACpC,SAAiB,EACjB,eAA6C,EAC7C,WAAyC,EACzC,QAAsC,EACtC,EAAC,YAAY,EAAW;IAExB,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAC9B,0BAA0B,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,KAAK,CACzD,CAAC;IAEF,OAAO,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,IAAI,CACvC,SAAS,CAAC,IAAI,C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,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChB,WAAA,MAAM,CAAC,4BAA4B,CAAC,CAAA;IAEpC,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;GA1F5B,4BAA4B,CA+XxC;;ICvbY,yBAAyB,GAAtC,MAAa,yBAAyB;EAAG;AAA5B,yBAAyB;IArBrC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,cAAc;YACd,kBAAkB;YAClB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,iBAAiB;YACjB,uBAAuB;YACvB,kBAAkB;YAClB,YAAY;YACZ,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,4BAA4B,CAAC;QAC5C,OAAO,EAAE,CAAC,4BAA4B,CAAC;KAC1C,CAAC;GACW,yBAAyB,CAAG;;ACxCzC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card-grouped.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.providers.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.component.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/input-card-grouped.module.ts","ng://@taiga-ui/addon-commerce/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.ts"],"sourcesContent":["import {inject, InjectionToken} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n TUI_CARD_CVC_TEXTS,\n TUI_CARD_EXPIRY_TEXTS,\n TUI_CARD_NUMBER_TEXTS,\n} from '@taiga-ui/addon-commerce/tokens';\nimport {typedFromEvent} from '@taiga-ui/cdk';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\nimport {TUI_MEDIA} from '@taiga-ui/core/tokens';\nimport {combineLatest, Observable, of} from 'rxjs';\nimport {map, startWith, switchMap} from 'rxjs/operators';\n\nexport interface TuiCardGroupedTexts {\n readonly cardNumberText: string;\n readonly expiryText: string;\n readonly cvcText: string;\n}\n\nexport const TUI_INPUT_CARD_GROUPED_TEXTS = new InjectionToken<\n Observable<TuiCardGroupedTexts>\n>(`InputCardGrouped texts`, {\n factory: () =>\n inputGroupedTextsFactory(\n inject(WINDOW),\n inject(TUI_CARD_NUMBER_TEXTS),\n inject(TUI_CARD_EXPIRY_TEXTS),\n inject(TUI_CARD_CVC_TEXTS),\n inject(TUI_MEDIA),\n ),\n});\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function inputGroupedTextsFactory(\n windowRef: Window,\n cardNumberTexts: Observable<[string, string]>,\n expiryTexts: Observable<[string, string]>,\n cvcTexts: Observable<[string, string]>,\n {desktopSmall}: TuiMedia,\n): Observable<TuiCardGroupedTexts> {\n const media = windowRef.matchMedia(\n `screen and (min-width: ${(desktopSmall - 1) / 16}em)`,\n );\n\n return typedFromEvent(media, `change`).pipe(\n startWith(null),\n switchMap(() =>\n combineLatest([\n of(Number(media.matches)),\n cardNumberTexts,\n expiryTexts,\n cvcTexts,\n ]),\n ),\n map(([index, cardNumber, expiry, cvcTexts]) => ({\n cardNumberText: cardNumber[index],\n expiryText: expiry[index],\n cvcText: cvcTexts[index],\n })),\n );\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK, tuiDefaultCardValidator} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCard} from '@taiga-ui/addon-commerce/interfaces';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n getPaymentSystem,\n tuiCreateAutoCorrectedExpirePipe,\n} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiNullableControl,\n isNativeFocused,\n isNativeFocusedIn,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiAssertIsHTMLElement,\n TuiBooleanHandler,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiPure,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n MODE_PROVIDER,\n TUI_DATA_LIST_HOST,\n TUI_DIGIT_REGEXP,\n TUI_MODE,\n TUI_NON_DIGIT_REGEXP,\n TUI_TEXTFIELD_APPEARANCE,\n TuiBrightness,\n TuiDataListComponent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskConfig} from 'angular2-text-mask';\nimport {Observable} from 'rxjs';\n\nimport {\n TUI_INPUT_CARD_GROUPED_TEXTS,\n TuiCardGroupedTexts,\n} from './input-card-grouped.providers';\n\nconst STUB: TuiCard = {\n card: ``,\n expire: ``,\n cvc: ``,\n};\nconst ICONS = {\n [TuiPaymentSystem.Mir]: `tuiIconMir`,\n [TuiPaymentSystem.Visa]: `tuiIconVisa`,\n [TuiPaymentSystem.Electron]: `tuiIconElectron`,\n [TuiPaymentSystem.Mastercard]: `tuiIconMastercard`,\n [TuiPaymentSystem.Maestro]: `tuiIconMaestro`,\n};\n\n// @dynamic\n@Component({\n selector: `tui-input-card-grouped`,\n templateUrl: `./input-card-grouped.template.html`,\n styleUrls: [`./input-card-grouped.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MODE_PROVIDER,\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n {\n provide: TUI_DATA_LIST_HOST,\n useExisting: forwardRef(() => TuiInputCardGroupedComponent),\n },\n ],\n host: {\n '($.data-mode.attr)': `mode$`,\n 'data-size': `l`,\n },\n})\nexport class TuiInputCardGroupedComponent\n extends AbstractTuiNullableControl<TuiCard>\n implements TuiFocusableElementAccessor, TuiDataListHost<Partial<TuiCard>>\n{\n @ViewChild(`inputCard`)\n private readonly inputCard?: ElementRef<HTMLInputElement>;\n\n @ViewChild(`inputExpire`)\n private readonly inputExpire?: ElementRef<HTMLInputElement>;\n\n @ViewChild(`inputCVC`)\n private readonly inputCVC?: ElementRef<HTMLInputElement>;\n\n private expireInert = false;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: PolymorpheusContent | null = null; // TODO: 3.0 will be deleted `null` in v3.0\n\n @Input()\n @tuiDefaultProp()\n exampleText = `0000 0000 0000 0000`;\n\n @Input()\n @tuiDefaultProp()\n cardValidator: TuiBooleanHandler<string> = tuiDefaultCardValidator;\n\n @Input()\n @tuiRequiredSetter()\n set codeLength(length: TuiCodeCVCLength) {\n this.exampleTextCVC = `0`.repeat(length);\n this.maskCVC = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n @Output()\n readonly autofilledChange = new EventEmitter<boolean>();\n\n @Output()\n readonly binChange = new EventEmitter<string | null>();\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly dropdown: PolymorpheusContent = ``;\n\n @ContentChild(TuiDataListComponent)\n readonly datalist?: TuiDataListComponent<TuiCard>;\n\n exampleTextCVC = `000`;\n\n maskCVC: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n readonly maskCard: TextMaskConfig = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n readonly maskExpire: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n `/`,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n open = false;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_INPUT_CARD_GROUPED_TEXTS)\n readonly cardGroupedTexts$: Observable<TuiCardGroupedTexts>,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.inputCard ? this.inputCard.nativeElement : null;\n }\n\n get focused(): boolean {\n return this.open || isNativeFocusedIn(this.elementRef.nativeElement);\n }\n\n get card(): string {\n return this.value?.card ?? ``;\n }\n\n get expire(): string {\n return this.value?.expire ?? ``;\n }\n\n get cvc(): string {\n return this.value?.cvc ?? ``;\n }\n\n get hasCleaner(): boolean {\n return !!this.value?.card?.trim() && !this.readOnly && !this.computedDisabled;\n }\n\n get hasDropdown(): boolean {\n return !!this.dropdown;\n }\n\n get defaultIcon(): string | null {\n const {paymentSystem} = this;\n\n return paymentSystem && ICONS[paymentSystem];\n }\n\n get icon(): PolymorpheusContent | null {\n return this.cardSrc ?? this.defaultIcon;\n }\n\n get bin(): string | null {\n return !this.value || this.value.card.length < 6\n ? null\n : this.value.card.slice(0, 6);\n }\n\n get placeholderRaised(): boolean {\n return (this.computedFocused && !this.readOnly) || this.hasCardNumber;\n }\n\n get hasCardNumber(): boolean {\n return !!this.value?.card?.trim();\n }\n\n get idCard(): string {\n return `${this.id}_card`;\n }\n\n get idExpire(): string {\n return `${this.id}_expire`;\n }\n\n get idCVC(): string {\n return `${this.id}_cvc`;\n }\n\n get isCardCollapsed(): boolean {\n return this.isFocusable(this.card) && !this.cardFocused;\n }\n\n get autocompleteCard(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcNumber\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteExpire(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n get autocompleteCVC(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n // Safari expiration date autofill workaround\n get name(): 'ccexpiryyear' | null {\n return this.autocompleteEnabled ? `ccexpiryyear` : null;\n }\n\n get cardPrefilled(): boolean {\n return !!this.card.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cvcPrefilled(): boolean {\n return !!this.cvc.match(TUI_NON_DIGIT_REGEXP);\n }\n\n get cardFocusable(): boolean {\n return this.focusable && !this.cardPrefilled;\n }\n\n get expireFocusable(): boolean {\n return this.isFocusable(this.card) && !this.expireInert;\n }\n\n get cvcFocusable(): boolean {\n return this.isFocusable(this.card);\n }\n\n get masked(): string {\n return this.cardPrefilled ? `*${this.card.slice(-4)}` : `*`;\n }\n\n @HostListener(`keydown.esc`)\n onEsc(): void {\n this.open = false;\n }\n\n @HostListener(`keydown.arrowDown.prevent`, [`$event.target`, `1`])\n @HostListener(`keydown.arrowUp.prevent`, [`$event.target`, `-1`])\n onArrow(element: HTMLElement, step: number): void {\n this.open = this.hasDropdown;\n this.changeDetectorRef.detectChanges();\n this.datalist?.onKeyDownArrow(element, step);\n }\n\n handleOption(option: Partial<TuiCard>): void {\n const {card = ``, expire = ``, cvc = ``} = option;\n const {bin} = this;\n const element =\n (!expire && this.inputExpire?.nativeElement) || this.inputCVC?.nativeElement;\n\n this.updateValue({card, expire, cvc});\n this.updateBin(bin);\n this.open = false;\n this.expireInert = !!expire;\n\n element?.focus();\n }\n\n onCardChange(card: string): void {\n const {value, bin} = this;\n const parsed = card.split(` `).join(``);\n\n if (value && value.card === parsed) {\n return;\n }\n\n this.updateProperty(parsed, `card`);\n this.updateBin(bin);\n\n if (this.cardValidator(this.card) && !this.expire && this.inputExpire) {\n this.focusExpire();\n }\n }\n\n onExpireChange(expire: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.inputExpire) {\n return;\n }\n\n if (parseInt(expire.slice(0, 2), 10) > 12) {\n expire = `12${expire.slice(2)}`;\n }\n\n if (expire.slice(0, 2) === `00`) {\n expire = `01${expire.slice(2)}`;\n }\n\n this.inputExpire.nativeElement.value = expire;\n this.updateProperty(expire, `expire`);\n\n if (expire.length === 5) {\n this.focusCVC();\n }\n }\n\n onCVCChange(cvc: string): void {\n this.updateProperty(cvc, `cvc`);\n }\n\n onActiveZoneChange(active: boolean): void {\n this.updateFocused(active);\n this.open = active && this.open;\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onMouseDown(event: MouseEvent): void {\n tuiAssertIsHTMLElement(event.target);\n\n if (event.target.matches(`input`)) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n onScroll({currentTarget}: Event): void {\n tuiAssertIsHTMLElement(currentTarget);\n\n currentTarget.scrollLeft = 0;\n }\n\n clear(): void {\n this.updateValue(null);\n this.focusCard();\n }\n\n toggle(): void {\n this.open = !this.open;\n }\n\n writeValue(value: TuiCard | null): void {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expireInert = !!this.expire && this.cardPrefilled;\n }\n\n /** Public API for manual focus management */\n focusCard(): void {\n this.inputCard?.nativeElement.focus();\n }\n\n focusExpire(): void {\n this.inputExpire?.nativeElement.focus({preventScroll: true});\n }\n\n focusCVC(): void {\n this.inputCVC?.nativeElement.focus();\n }\n\n private get cardFocused(): boolean {\n return !!this.inputCard && isNativeFocused(this.inputCard.nativeElement);\n }\n\n private get paymentSystem(): TuiPaymentSystem | null {\n return this.value && getPaymentSystem(this.value.card);\n }\n\n @tuiPure\n private isFocusable(card: string): boolean {\n return this.focusable && (this.cardValidator(card) || this.cardPrefilled);\n }\n\n private updateBin(oldBin: string | null): void {\n const {bin} = this;\n\n if (bin !== oldBin && !this.cardPrefilled) {\n this.binChange.emit(bin);\n }\n }\n\n private updateProperty(propValue: string, propName: 'card' | 'expire' | 'cvc'): void {\n const {card, expire, cvc} = this.value || STUB;\n const newValue: TuiCard = {\n card,\n expire,\n cvc,\n };\n\n newValue[propName] = propValue;\n\n if (!newValue.expire && !newValue.cvc && !newValue.card) {\n this.updateValue(null);\n } else {\n this.updateValue(newValue);\n }\n }\n\n private focusInput(): void {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n element?.focus();\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiFormatCardModule} from '@taiga-ui/addon-commerce/pipes';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiLetModule,\n TuiMapperPipeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownModule, TuiSvgModule, TuiWrapperModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCardGroupedComponent} from './input-card-grouped.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiSvgModule,\n TuiWrapperModule,\n TuiHoveredModule,\n TuiActiveZoneModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiDropdownModule,\n TuiPreventDefaultModule,\n PolymorpheusModule,\n TuiLetModule,\n TuiFormatCardModule,\n ],\n declarations: [TuiInputCardGroupedComponent],\n exports: [TuiInputCardGroupedComponent],\n})\nexport class TuiInputCardGroupedModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAmBa,4BAA4B,GAAG,IAAI,cAAc,CAE5D,wBAAwB,EAAE;IACxB,OAAO,EAAE,MACL,wBAAwB,CACpB,MAAM,CAAC,MAAM,CAAC,EACd,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,qBAAqB,CAAC,EAC7B,MAAM,CAAC,kBAAkB,CAAC,EAC1B,MAAM,CAAC,SAAS,CAAC,CACpB;CACR,EAAE;AAEH;SACgB,wBAAwB,CACpC,SAAiB,EACjB,eAA6C,EAC7C,WAAyC,EACzC,QAAsC,EACtC,EAAC,YAAY,EAAW;IAExB,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAC9B,0BAA0B,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,KAAK,CACzD,CAAC;IAEF,OAAO,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,IAAI,CACvC,SAAS,CAAC,IAAI,CAAC,EACf,SAAS,CAAC,MACN,aAAa,CAAC;QACV,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzB,eAAe;QACf,WAAW;QACX,QAAQ;KACX,CAAC,CACL,EACD,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM;QAC5C,cAAc,EAAE,UAAU,CAAC,KAAK,CAAC;QACjC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;KAC3B,CAAC,CAAC,CACN,CAAC;AACN;;;ACCA,MAAM,IAAI,GAAY;IAClB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;CACV,CAAC;AACF,MAAM,KAAK,GAAG;IAC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,iBAAiB;YACjB,uBAAuB;YACvB,kBAAkB;YAClB,YAAY;YACZ,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,4BAA4B,CAAC;QAC5C,OAAO,EAAE,CAAC,4BAA4B,CAAC;KAC1C,CAAC;GACW,yBAAyB,CAAG;;ACxCzC;;;;;;"}
|
|
@@ -10,16 +10,16 @@ import { TextMaskModule } from 'angular2-text-mask';
|
|
|
10
10
|
|
|
11
11
|
var TuiInputCardComponent_1;
|
|
12
12
|
const icons = {
|
|
13
|
-
["mir" /* Mir */]:
|
|
14
|
-
["visa" /* Visa */]:
|
|
15
|
-
["electron" /* Electron */]:
|
|
16
|
-
["mastercard" /* Mastercard */]:
|
|
17
|
-
["maestro" /* Maestro */]:
|
|
13
|
+
["mir" /* Mir */]: `tuiIconMir`,
|
|
14
|
+
["visa" /* Visa */]: `tuiIconVisa`,
|
|
15
|
+
["electron" /* Electron */]: `tuiIconElectron`,
|
|
16
|
+
["mastercard" /* Mastercard */]: `tuiIconMastercard`,
|
|
17
|
+
["maestro" /* Maestro */]: `tuiIconMaestro`,
|
|
18
18
|
};
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
20
|
function cardTextfieldControllerFactory(directive) {
|
|
21
21
|
directive = directive || new TuiTextfieldExampleTextDirective();
|
|
22
|
-
directive.exampleText =
|
|
22
|
+
directive.exampleText = `0000 0000 0000 0000`;
|
|
23
23
|
return directive;
|
|
24
24
|
}
|
|
25
25
|
// @dynamic
|
|
@@ -61,12 +61,12 @@ let TuiInputCardComponent = TuiInputCardComponent_1 = class TuiInputCardComponen
|
|
|
61
61
|
}
|
|
62
62
|
get formattedCard() {
|
|
63
63
|
return this.value
|
|
64
|
-
.split(
|
|
64
|
+
.split(``)
|
|
65
65
|
.map((char, index) => (index && index % 4 === 0 ? ` ${char}` : char))
|
|
66
|
-
.join(
|
|
66
|
+
.join(``);
|
|
67
67
|
}
|
|
68
68
|
onValueChange(value) {
|
|
69
|
-
const parsed = value.split(
|
|
69
|
+
const parsed = value.split(` `).join(``);
|
|
70
70
|
const currentBin = this.bin;
|
|
71
71
|
this.updateValue(parsed);
|
|
72
72
|
const newBin = this.bin;
|
|
@@ -89,7 +89,7 @@ let TuiInputCardComponent = TuiInputCardComponent_1 = class TuiInputCardComponen
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
getFallbackValue() {
|
|
92
|
-
return
|
|
92
|
+
return ``;
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
TuiInputCardComponent.ctorParameters = () => [
|
|
@@ -112,7 +112,7 @@ __decorate([
|
|
|
112
112
|
], TuiInputCardComponent.prototype, "binChange", void 0);
|
|
113
113
|
TuiInputCardComponent = TuiInputCardComponent_1 = __decorate([
|
|
114
114
|
Component({
|
|
115
|
-
selector:
|
|
115
|
+
selector: `tui-input-card`,
|
|
116
116
|
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [tuiTextfieldCustomContent]=\"icon\"\n [readOnly]=\"readOnly\"\n [disabled]=\"disabled\"\n [focusable]=\"focusable\"\n [nativeId]=\"nativeId\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"formattedCard\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
117
117
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
118
118
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card/input-card.component.ts","ng://@taiga-ui/addon-commerce/components/input-card/input-card.module.ts","ng://@taiga-ui/addon-commerce/components/input-card/taiga-ui-addon-commerce-components-input-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {getPaymentSystem} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_TEXTFIELD_EXAMPLE_TEXT,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldExampleTextDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\nconst icons = {\n [TuiPaymentSystem.Mir]:
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card.js","sources":["ng://@taiga-ui/addon-commerce/components/input-card/input-card.component.ts","ng://@taiga-ui/addon-commerce/components/input-card/input-card.module.ts","ng://@taiga-ui/addon-commerce/components/input-card/taiga-ui-addon-commerce-components-input-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n Optional,\n Output,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TUI_CARD_MASK} from '@taiga-ui/addon-commerce/constants';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {getPaymentSystem} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_TEXTFIELD_EXAMPLE_TEXT,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldExampleTextDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: `tuiIconMir`,\n [TuiPaymentSystem.Visa]: `tuiIconVisa`,\n [TuiPaymentSystem.Electron]: `tuiIconElectron`,\n [TuiPaymentSystem.Mastercard]: `tuiIconMastercard`,\n [TuiPaymentSystem.Maestro]: `tuiIconMaestro`,\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function cardTextfieldControllerFactory(\n directive: TuiTextfieldExampleTextDirective | null,\n): TuiTextfieldExampleTextDirective {\n directive = directive || new TuiTextfieldExampleTextDirective();\n directive.exampleText = `0000 0000 0000 0000`;\n\n return directive;\n}\n\n// @dynamic\n@Component({\n selector: `tui-input-card`,\n templateUrl: `./input-card.template.html`,\n styleUrls: [`./input-card.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCardComponent),\n },\n {\n provide: TUI_TEXTFIELD_EXAMPLE_TEXT,\n deps: [[new Optional(), TuiTextfieldExampleTextDirective]],\n useFactory: cardTextfieldControllerFactory,\n },\n ],\n})\nexport class TuiInputCardComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: string | null = null;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Output()\n readonly binChange = new EventEmitter<string | null>();\n\n readonly textMaskOptions: TextMaskConfig = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get icon(): string | null {\n if (this.cardSrc !== null) {\n return this.cardSrc;\n }\n\n const {paymentSystem} = this;\n\n return paymentSystem ? icons[paymentSystem] : null;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcNumber\n : TuiCreditCardAutofillName.Off;\n }\n\n get paymentSystem(): TuiPaymentSystem | null {\n return getPaymentSystem(this.value);\n }\n\n get bin(): string | null {\n return this.value.length < 6 ? null : this.value.slice(0, 6);\n }\n\n get formattedCard(): string {\n return this.value\n .split(``)\n .map((char, index) => (index && index % 4 === 0 ? ` ${char}` : char))\n .join(``);\n }\n\n onValueChange(value: string): void {\n const parsed = value.split(` `).join(``);\n const currentBin = this.bin;\n\n this.updateValue(parsed);\n\n const newBin = this.bin;\n\n if (currentBin !== newBin) {\n this.binChange.emit(newBin);\n }\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n writeValue(value: string | null): void {\n const currentBin = this.bin;\n\n super.writeValue(value);\n\n const newBin = this.bin;\n\n if (currentBin !== newBin) {\n this.binChange.emit(newBin);\n }\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCardComponent} from './input-card.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCardComponent],\n exports: [TuiInputCardComponent],\n})\nexport class TuiInputCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA+BA,MAAM,KAAK,GAAG;IACV,mBAAwB,YAAY;IACpC,qBAAyB,aAAa;IACtC,6BAA6B,iBAAiB;IAC9C,iCAA+B,mBAAmB;IAClD,2BAA4B,gBAAgB;CAC/C,CAAC;AAEF;SACgB,8BAA8B,CAC1C,SAAkD;IAElD,SAAS,GAAG,SAAS,IAAI,IAAI,gCAAgC,EAAE,CAAC;IAChE,SAAS,CAAC,WAAW,GAAG,qBAAqB,CAAC;IAE9C,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;IAkBa,qBAAqB,6BAAlC,MAAa,qBACT,SAAQ,kBAA0B;IAuBlC,YAII,OAAyB,EACE,iBAAoC;QAE/D,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAtBtC,YAAO,GAAkB,IAAI,CAAC;QAI9B,wBAAmB,GAAG,KAAK,CAAC;QAGnB,cAAS,GAAG,IAAI,YAAY,EAAiB,CAAC;QAE9C,oBAAe,GAAmB;YACvC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,cAAc,IAAI,cAAc,CAAC,IAAI,EAAE;SAChD,CAAC;KAUD;IAED,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;KAChE;IAED,IAAI,OAAO;QACP,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;KAC7C;IAED,IAAI,IAAI;QACJ,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE;YACvB,OAAO,IAAI,CAAC,OAAO,CAAC;SACvB;QAED,MAAM,EAAC,aAAa,EAAC,GAAG,IAAI,CAAC;QAE7B,OAAO,aAAa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AC5B,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;QACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,kBAAkB,CAAG;;ACjBlC;;;;;;"}
|
|
@@ -12,14 +12,14 @@ let TuiInputCVCComponent = TuiInputCVCComponent_1 = class TuiInputCVCComponent e
|
|
|
12
12
|
super(control, changeDetectorRef);
|
|
13
13
|
this.textfieldLabelOutside = textfieldLabelOutside;
|
|
14
14
|
this.autocompleteEnabled = false;
|
|
15
|
-
this.exampleText =
|
|
15
|
+
this.exampleText = `000`;
|
|
16
16
|
this.textMaskOptions = {
|
|
17
17
|
mask: new Array(3).fill(TUI_DIGIT_REGEXP),
|
|
18
18
|
guide: false,
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
set length(length) {
|
|
22
|
-
this.exampleText =
|
|
22
|
+
this.exampleText = `0`.repeat(length);
|
|
23
23
|
this.textMaskOptions = {
|
|
24
24
|
mask: new Array(length).fill(TUI_DIGIT_REGEXP),
|
|
25
25
|
guide: false,
|
|
@@ -37,7 +37,7 @@ let TuiInputCVCComponent = TuiInputCVCComponent_1 = class TuiInputCVCComponent e
|
|
|
37
37
|
: "off" /* Off */;
|
|
38
38
|
}
|
|
39
39
|
get computedExampleText() {
|
|
40
|
-
return this.textfieldLabelOutside.labelOutside ?
|
|
40
|
+
return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;
|
|
41
41
|
}
|
|
42
42
|
onFocused(focused) {
|
|
43
43
|
this.updateFocused(focused);
|
|
@@ -50,7 +50,7 @@ let TuiInputCVCComponent = TuiInputCVCComponent_1 = class TuiInputCVCComponent e
|
|
|
50
50
|
this.updateValue(value);
|
|
51
51
|
}
|
|
52
52
|
getFallbackValue() {
|
|
53
|
-
return
|
|
53
|
+
return ``;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
TuiInputCVCComponent.ctorParameters = () => [
|
|
@@ -71,7 +71,7 @@ __decorate([
|
|
|
71
71
|
], TuiInputCVCComponent.prototype, "length", null);
|
|
72
72
|
TuiInputCVCComponent = TuiInputCVCComponent_1 = __decorate([
|
|
73
73
|
Component({
|
|
74
|
-
selector:
|
|
74
|
+
selector: `tui-input-cvc`,
|
|
75
75
|
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n class=\"t-input\"\n [tuiTextfieldExampleText]=\"computedExampleText\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
76
76
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
77
77
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector:
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.component.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/input-cvc.module.ts","ng://@taiga-ui/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {TuiCodeCVCLength} from '@taiga-ui/addon-commerce/types';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-cvc`,\n templateUrl: `./input-cvc.template.html`,\n styleUrls: [`./input-cvc.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputCVCComponent),\n },\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = `0`.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = `000`;\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcCsc\n : TuiCreditCardAutofillName.Off;\n }\n\n get computedExampleText(): string {\n return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean): void {\n this.updateHovered(hovered);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA0Ca,oBAAoB,4BAAjC,MAAa,oBACT,SAAQ,kBAA0B;IA2BlC,YAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD;QAEzE,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAFjB,0BAAqB,GAArB,qBAAqB,CAAmC;QA1B7E,wBAAmB,GAAG,KAAK,CAAC;QAY5B,gBAAW,GAAG,KAAK,CAAC;QAEpB,oBAAe,GAAmB;YAC9B,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACzC,KAAK,EAAE,KAAK;SACf,CAAC;KAYD;IAzBD,IAAI,MAAM,CAAC,MAAwB;QAC/B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,eAAe,GAAG;YACnB,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAC9C,KAAK,EAAE,KAAK;SACf,CAAC;KACL;IAqBD,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;KAChE;IAED,IAAI,OAAO;QACP,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;KAC7C;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,mBAAmB;;8BAEK;KACvC;IAED,IAAI,mBAAmB;QACnB,OAAO,IAAI,CAAC,qBAAqB,CAAC,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC;KAC1E;IAED,SAAS,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