@taiga-ui/addon-commerce 2.26.0 → 2.27.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-input-CVC.umd.js +3 -3
- 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 +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-card-grouped.umd.js +21 -21
- 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 +2 -2
- 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 +3 -3
- 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 +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-expire.umd.js +3 -3
- 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 +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.min.js.map +1 -1
- package/components/input-CVC/input-CVC.component.d.ts +1 -1
- package/components/input-CVC/taiga-ui-addon-commerce-components-input-CVC.metadata.json +1 -1
- package/components/input-card/input-card.component.d.ts +1 -1
- package/components/input-card/taiga-ui-addon-commerce-components-input-card.metadata.json +1 -1
- package/components/input-card-grouped/input-card-grouped.component.d.ts +8 -8
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
- package/components/input-expire/input-expire.component.d.ts +1 -1
- package/components/input-expire/taiga-ui-addon-commerce-components-input-expire.metadata.json +1 -1
- package/esm2015/components/input-CVC/input-CVC.component.js +4 -4
- package/esm2015/components/input-card/input-card.component.js +4 -4
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +22 -22
- package/esm2015/components/input-expire/input-expire.component.js +4 -4
- package/esm5/components/input-CVC/input-CVC.component.js +4 -4
- package/esm5/components/input-card/input-card.component.js +4 -4
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +22 -22
- package/esm5/components/input-expire/input-expire.component.js +4 -4
- package/fesm2015/taiga-ui-addon-commerce-components-input-CVC.js +4 -4
- package/fesm2015/taiga-ui-addon-commerce-components-input-CVC.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +22 -22
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +4 -4
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.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/fesm5/taiga-ui-addon-commerce-components-input-CVC.js +4 -4
- package/fesm5/taiga-ui-addon-commerce-components-input-CVC.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +22 -22
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js +4 -4
- package/fesm5/taiga-ui-addon-commerce-components-input-card.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/package.json +4 -4
|
@@ -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\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 setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\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 TuiBrightness,\n TuiDataListComponent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\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-tui-host-size': 'l',\n },\n})\nexport class TuiInputCardGroupedComponent\n extends AbstractTuiNullableControl<TuiCard>\n implements TuiFocusableElementAccessor, TuiDataListHost<Partial<TuiCard>>\n{\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiDefaultProp()\n cardSrc: PolymorpheusContent | null = null; // TODO(splincode): 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 exampleTextCVC = '000';\n\n maskCVC: TuiTextMaskOptions = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n readonly maskCard: TuiTextMaskOptions = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n readonly maskExpire: TuiTextMaskOptions = {\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 };\n\n open = false;\n\n @ContentChild(TuiDataListDirective, {read: TemplateRef})\n readonly dropdown: PolymorpheusContent = '';\n\n @ContentChild(TuiDataListComponent)\n readonly datalist?: TuiDataListComponent<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 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 ) {\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 && !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.substr(0, 6);\n }\n\n get placeholderRaised(): boolean {\n return (this.computedFocused && !this.readOnly) || !!this.value;\n }\n\n get formattedCard(): string {\n return this.value && !this.cardPrefilled\n ? this.value.card\n .split('')\n .map((char, index) => (index && index % 4 === 0 ? ` ${char}` : char))\n .join('')\n : '';\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 handleOption(option: Partial<TuiCard>) {\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 if (element) {\n setNativeFocused(element);\n }\n }\n\n onCardChange(card: string) {\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 setNativeFocused(this.inputExpire.nativeElement, true, true);\n }\n }\n\n onExpireChange(expire: string) {\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.substr(0, 2), 10) > 12) {\n expire = '12' + expire.substr(2);\n }\n\n if (expire.substr(0, 2) === '00') {\n expire = '01' + expire.substr(2);\n }\n\n this.inputExpire.nativeElement.value = expire;\n this.updateProperty(expire, 'expire');\n\n if (expire.length === 5 && this.inputCVC) {\n setNativeFocused(this.inputCVC.nativeElement);\n }\n }\n\n onCVCChange(cvc: string) {\n this.updateProperty(cvc, 'cvc');\n }\n\n onActiveZoneChange(active: boolean) {\n this.updateFocused(active);\n this.open = active && this.open;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onMouseDown(event: MouseEvent) {\n if ((event.target as HTMLElement).matches('input')) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n onScroll(element: HTMLElement) {\n element.scrollLeft = 0;\n }\n\n @HostListener('keydown.esc')\n onEsc() {\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) {\n this.open = this.hasDropdown;\n this.changeDetectorRef.detectChanges();\n this.datalist?.onKeyDownArrow(element, step);\n }\n\n clear() {\n this.updateValue(null);\n\n if (this.inputCard) {\n setNativeFocused(this.inputCard.nativeElement);\n }\n }\n\n toggle() {\n this.open = !this.open;\n }\n\n writeValue(value: TuiCard | null) {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expireInert = !!this.expire && this.cardPrefilled;\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) {\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') {\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() {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n if (element) {\n setNativeFocused(element);\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiHoveredModule,\n TuiInputModeModule,\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 ],\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;SAEa,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;;;ACAA,MAAM,IAAI,GAAY;IAClB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;CACV,CAAC;AACF,MAAM,KAAK,GAAG;IACV,mBAAwB,YAAY;I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AA4B,CAAC;KAC1C,CAAC;GACW,yBAAyB,CAAG;;ACpCzC;;;;;;"}
|
|
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\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 setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\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 TuiBrightness,\n TuiDataListComponent,\n TuiDataListDirective,\n TuiDataListHost,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\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-tui-host-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(splincode): 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: TuiTextMaskOptions = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n readonly maskCard: TuiTextMaskOptions = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n readonly maskExpire: TuiTextMaskOptions = {\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 };\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 ) {\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 && !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.substr(0, 6);\n }\n\n get placeholderRaised(): boolean {\n return (this.computedFocused && !this.readOnly) || !!this.value;\n }\n\n get formattedCard(): string {\n return this.value && !this.cardPrefilled\n ? this.value.card\n .split('')\n .map((char, index) => (index && index % 4 === 0 ? ` ${char}` : char))\n .join('')\n : '';\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() {\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) {\n this.open = this.hasDropdown;\n this.changeDetectorRef.detectChanges();\n this.datalist?.onKeyDownArrow(element, step);\n }\n\n handleOption(option: Partial<TuiCard>) {\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 if (element) {\n setNativeFocused(element);\n }\n }\n\n onCardChange(card: string) {\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 setNativeFocused(this.inputExpire.nativeElement, true, true);\n }\n }\n\n onExpireChange(expire: string) {\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.substr(0, 2), 10) > 12) {\n expire = '12' + expire.substr(2);\n }\n\n if (expire.substr(0, 2) === '00') {\n expire = '01' + expire.substr(2);\n }\n\n this.inputExpire.nativeElement.value = expire;\n this.updateProperty(expire, 'expire');\n\n if (expire.length === 5 && this.inputCVC) {\n setNativeFocused(this.inputCVC.nativeElement);\n }\n }\n\n onCVCChange(cvc: string) {\n this.updateProperty(cvc, 'cvc');\n }\n\n onActiveZoneChange(active: boolean) {\n this.updateFocused(active);\n this.open = active && this.open;\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onMouseDown(event: MouseEvent) {\n if ((event.target as HTMLElement).matches('input')) {\n return;\n }\n\n event.preventDefault();\n this.focusInput();\n }\n\n onScroll(element: HTMLElement) {\n element.scrollLeft = 0;\n }\n\n clear() {\n this.updateValue(null);\n\n if (this.inputCard) {\n setNativeFocused(this.inputCard.nativeElement);\n }\n }\n\n toggle() {\n this.open = !this.open;\n }\n\n writeValue(value: TuiCard | null) {\n const {bin} = this;\n\n super.writeValue(value);\n this.updateBin(bin);\n this.expireInert = !!this.expire && this.cardPrefilled;\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) {\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') {\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() {\n const element =\n (this.cardFocusable && this.inputCard?.nativeElement) ||\n (this.expireFocusable && this.inputExpire?.nativeElement) ||\n this.inputCVC?.nativeElement;\n\n if (element) {\n setNativeFocused(element);\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiHoveredModule,\n TuiInputModeModule,\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 ],\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;SAEa,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,OA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ACX,cAAc;YACd,kBAAkB;YAClB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,iBAAiB;YACjB,uBAAuB;YACvB,kBAAkB;SACrB;QACD,YAAY,EAAE,CAAC,4BAA4B,CAAC;QAC5C,OAAO,EAAE,CAAC,4BAA4B,CAAC;KAC1C,CAAC;GACW,yBAAyB,CAAG;;ACpCzC;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { EventEmitter, Optional, Self, Inject, ChangeDetectorRef, Input, Output,
|
|
2
|
+
import { EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Output, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl } from '@angular/forms';
|
|
4
4
|
import { TUI_CARD_MASK } from '@taiga-ui/addon-commerce/constants';
|
|
5
5
|
import { getPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
@@ -95,6 +95,9 @@ TuiInputCardComponent.ctorParameters = () => [
|
|
|
95
95
|
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
96
96
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
|
|
97
97
|
];
|
|
98
|
+
__decorate([
|
|
99
|
+
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
100
|
+
], TuiInputCardComponent.prototype, "input", void 0);
|
|
98
101
|
__decorate([
|
|
99
102
|
Input(),
|
|
100
103
|
tuiDefaultProp()
|
|
@@ -106,9 +109,6 @@ __decorate([
|
|
|
106
109
|
__decorate([
|
|
107
110
|
Output()
|
|
108
111
|
], TuiInputCardComponent.prototype, "binChange", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
111
|
-
], TuiInputCardComponent.prototype, "input", void 0);
|
|
112
112
|
TuiInputCardComponent = TuiInputCardComponent_1 = __decorate([
|
|
113
113
|
Component({
|
|
114
114
|
selector: 'tui-input-card',
|
|
@@ -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 TuiTextMaskOptions,\n} from '@taiga-ui/core';\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\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 @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: TuiTextMaskOptions = {\n mask: TUI_CARD_MASK,\n guide: false,\n pipe: conformedValue => conformedValue.trim(),\n };\n\n
|
|
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 TuiTextMaskOptions,\n} from '@taiga-ui/core';\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\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: TuiTextMaskOptions = {\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.substr(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) {\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) {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n writeValue(value: string | null) {\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,GA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
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef,
|
|
2
|
+
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl } from '@angular/forms';
|
|
4
4
|
import { tuiCreateAutoCorrectedExpirePipe } from '@taiga-ui/addon-commerce/utils';
|
|
5
5
|
import { AbstractTuiControl, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR } from '@taiga-ui/cdk';
|
|
@@ -66,13 +66,13 @@ TuiInputExpireComponent.ctorParameters = () => [
|
|
|
66
66
|
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
67
67
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
|
|
68
68
|
];
|
|
69
|
+
__decorate([
|
|
70
|
+
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
71
|
+
], TuiInputExpireComponent.prototype, "input", void 0);
|
|
69
72
|
__decorate([
|
|
70
73
|
Input(),
|
|
71
74
|
tuiDefaultProp()
|
|
72
75
|
], TuiInputExpireComponent.prototype, "autocompleteEnabled", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
75
|
-
], TuiInputExpireComponent.prototype, "input", void 0);
|
|
76
76
|
TuiInputExpireComponent = TuiInputExpireComponent_1 = __decorate([
|
|
77
77
|
Component({
|
|
78
78
|
selector: 'tui-input-expire',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-input-expire',\n templateUrl: './input-expire.template.html',\n styleUrls: ['./input-expire.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputExpireComponent),\n },\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TuiTextMaskOptions = {\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 };\n\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.component.ts","ng://@taiga-ui/addon-commerce/components/input-expire/input-expire.module.ts","ng://@taiga-ui/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiCreateAutoCorrectedExpirePipe} from '@taiga-ui/addon-commerce/utils';\nimport {\n AbstractTuiControl,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-input-expire',\n templateUrl: './input-expire.template.html',\n styleUrls: ['./input-expire.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputExpireComponent),\n },\n ],\n})\nexport class TuiInputExpireComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n readonly textMaskOptions: TuiTextMaskOptions = {\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 };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiCreditCardAutofillName {\n return this.autocompleteEnabled\n ? TuiCreditCardAutofillName.CcExp\n : TuiCreditCardAutofillName.Off;\n }\n\n onValueChange(value: string) {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input || !this.input.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.substr(0, 2), 10) > 12) {\n value = '12' + value.substr(2);\n }\n\n if (value.substr(0, 2) === '00') {\n value = '01' + value.substr(2);\n }\n\n this.input.nativeFocusableElement.value = value;\n\n if (this.value !== value) {\n this.updateValue(value);\n }\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputExpireComponent} from './input-expire.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputExpireComponent],\n exports: [TuiInputExpireComponent],\n})\nexport class TuiInputExpireModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAsCa,uBAAuB,+BAApC,MAAa,uBACT,SAAQ,kBAA0B;IAsBlC,YAII,OAAyB,EACE,iBAAoC;QAE/D,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QArBtC,wBAAmB,GAAG,KAAK,CAAC;QAEnB,oBAAe,GAAuB;YAC3C,IAAI,EAAE;gBACF,gBAAgB;gBAChB,gBAAgB;gBAChB,GAAG;gBACH,gBAAgB;gBAChB,gBAAgB;aACnB;YACD,IAAI,EAAE,gCAAgC,EAAE;YACxC,KAAK,EAAE,KAAK;SACf,CAAC;KAUD;IAED,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;KAChE;IAED,IAAI,OAAO;QACP,O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SAAS,CAAC;QACP,QAAQ,EAAE,kBAAkB;QAC5B,6rBAA2C;QAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,yBAAuB,CAAC;aACzD;SACJ;;KACJ,CAAC;IAyBO,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GA5BrB,uBAAuB,CAgFnC;;ICrGY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAVhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACjBpC;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __extends, __decorate, __param } from 'tslib';
|
|
2
|
-
import { Optional, Self, Inject, ChangeDetectorRef,
|
|
2
|
+
import { Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl } from '@angular/forms';
|
|
4
4
|
import { tuiDefaultProp, tuiRequiredSetter, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl } from '@taiga-ui/cdk';
|
|
5
5
|
import { TUI_DIGIT_REGEXP, TuiTextfieldLabelOutsideDirective, TUI_TEXTFIELD_LABEL_OUTSIDE, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule, TuiHintControllerModule } from '@taiga-ui/core';
|
|
@@ -80,6 +80,9 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
80
80
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
81
81
|
{ type: TuiTextfieldLabelOutsideDirective, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_LABEL_OUTSIDE,] }] }
|
|
82
82
|
]; };
|
|
83
|
+
__decorate([
|
|
84
|
+
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
85
|
+
], TuiInputCVCComponent.prototype, "input", void 0);
|
|
83
86
|
__decorate([
|
|
84
87
|
Input(),
|
|
85
88
|
tuiDefaultProp()
|
|
@@ -88,9 +91,6 @@ var TuiInputCVCComponent = /** @class */ (function (_super) {
|
|
|
88
91
|
Input(),
|
|
89
92
|
tuiRequiredSetter()
|
|
90
93
|
], TuiInputCVCComponent.prototype, "length", null);
|
|
91
|
-
__decorate([
|
|
92
|
-
ViewChild(TuiPrimitiveTextfieldComponent)
|
|
93
|
-
], TuiInputCVCComponent.prototype, "input", void 0);
|
|
94
94
|
TuiInputCVCComponent = TuiInputCVCComponent_1 = __decorate([
|
|
95
95
|
Component({
|
|
96
96
|
selector: 'tui-input-cvc',
|
|
@@ -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 TuiTextMaskOptions,\n} from '@taiga-ui/core';\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 @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: TuiTextMaskOptions = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n
|
|
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 TuiTextMaskOptions,\n} from '@taiga-ui/core';\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: TuiTextMaskOptions = {\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) {\n this.updateFocused(focused);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onCopy() {}\n\n onValueChange(value: string) {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return '';\n }\n}\n","import {NgModule} from '@angular/core';\nimport {\n TuiHintControllerModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n} from '@taiga-ui/core';\nimport {TuiValueAccessorModule} from '@taiga-ui/kit';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputCVCComponent} from './input-CVC.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\n TuiHintControllerModule,\n TuiValueAccessorModule,\n ],\n declarations: [TuiInputCVCComponent],\n exports: [TuiInputCVCComponent],\n})\nexport class TuiInputCVCModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IA2CY,wCAA0B;IA2BlC,8BAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD;QAP7E,YASI,kBAAM,OAAO,EAAE,iBAAiB,CAAC,SACpC;QAHoB,2BAAqB,GAArB,qBAAqB,CAAmC;QA1B7E,yBAAmB,GAAG,KAAK,CAAC;QAY5B,iBAAW,GAAG,KAAK,CAAC;QAEpB,qBAAe,GAAuB;YAClC,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACzC,KAAK,EAAE,KAAK;SACf,CAAC;;KAYD;6BAtCQ,oBAAoB;IAa7B,sBAAI,wCAAM;aAAV,UAAW,MAAwB;YAC/B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,CAAC,eAAe,GAAG;gBACnB,IAAI,EAAE,IAAI,K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AS,CAAC;YACP,QAAQ,EAAE,eAAe;YACzB,4tBAAwC;YAExC,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAA2B;oBACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,sBAAoB,GAAA,CAAC;iBACtD;aACJ;;SACJ,CAAC;QA8BO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,2BAA2B,CAAC,CAAA;OAlC/B,oBAAoB,CA2EhC;IAAD,2BAAC;CAAA,CA1EW,kBAAkB;;;ICrB9B;KAAiC;IAApB,iBAAiB;QAX7B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,cAAc;gBACd,2BAA2B;gBAC3B,4BAA4B;gBAC5B,uBAAuB;gBACvB,sBAAsB;aACzB;YACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;YACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;SAClC,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAjC;;ACtBA;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __read, __extends, __decorate, __param } from 'tslib';
|
|
2
|
-
import { InjectionToken, inject, EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ElementRef, Input, Output, ContentChild, TemplateRef,
|
|
2
|
+
import { InjectionToken, inject, EventEmitter, Optional, Self, Inject, ChangeDetectorRef, ElementRef, ViewChild, Input, Output, ContentChild, TemplateRef, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl, FormsModule } from '@angular/forms';
|
|
4
4
|
import { tuiDefaultCardValidator, TUI_CARD_MASK } from '@taiga-ui/addon-commerce/constants';
|
|
5
5
|
import { tuiCreateAutoCorrectedExpirePipe, getPaymentSystem } from '@taiga-ui/addon-commerce/utils';
|
|
@@ -60,12 +60,14 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
60
60
|
_this.elementRef = elementRef;
|
|
61
61
|
_this.mode$ = mode$;
|
|
62
62
|
_this.cardGroupedTexts$ = cardGroupedTexts$;
|
|
63
|
+
_this.expireInert = false;
|
|
63
64
|
_this.autocompleteEnabled = false;
|
|
64
65
|
_this.cardSrc = null; // TODO(splincode): will be deleted `null` in v3.0
|
|
65
66
|
_this.exampleText = '0000 0000 0000 0000';
|
|
66
67
|
_this.cardValidator = tuiDefaultCardValidator;
|
|
67
68
|
_this.autofilledChange = new EventEmitter();
|
|
68
69
|
_this.binChange = new EventEmitter();
|
|
70
|
+
_this.dropdown = '';
|
|
69
71
|
_this.exampleTextCVC = '000';
|
|
70
72
|
_this.maskCVC = {
|
|
71
73
|
mask: new Array(3).fill(TUI_DIGIT_REGEXP),
|
|
@@ -88,8 +90,6 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
88
90
|
guide: false,
|
|
89
91
|
};
|
|
90
92
|
_this.open = false;
|
|
91
|
-
_this.dropdown = '';
|
|
92
|
-
_this.expireInert = false;
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
|
95
95
|
TuiInputCardGroupedComponent_1 = TuiInputCardGroupedComponent;
|
|
@@ -305,6 +305,15 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
305
305
|
enumerable: true,
|
|
306
306
|
configurable: true
|
|
307
307
|
});
|
|
308
|
+
TuiInputCardGroupedComponent.prototype.onEsc = function () {
|
|
309
|
+
this.open = false;
|
|
310
|
+
};
|
|
311
|
+
TuiInputCardGroupedComponent.prototype.onArrow = function (element, step) {
|
|
312
|
+
var _a;
|
|
313
|
+
this.open = this.hasDropdown;
|
|
314
|
+
this.changeDetectorRef.detectChanges();
|
|
315
|
+
(_a = this.datalist) === null || _a === void 0 ? void 0 : _a.onKeyDownArrow(element, step);
|
|
316
|
+
};
|
|
308
317
|
TuiInputCardGroupedComponent.prototype.handleOption = function (option) {
|
|
309
318
|
var _a, _b;
|
|
310
319
|
var _c = option.card, card = _c === void 0 ? '' : _c, _d = option.expire, expire = _d === void 0 ? '' : _d, _e = option.cvc, cvc = _e === void 0 ? '' : _e;
|
|
@@ -368,15 +377,6 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
368
377
|
TuiInputCardGroupedComponent.prototype.onScroll = function (element) {
|
|
369
378
|
element.scrollLeft = 0;
|
|
370
379
|
};
|
|
371
|
-
TuiInputCardGroupedComponent.prototype.onEsc = function () {
|
|
372
|
-
this.open = false;
|
|
373
|
-
};
|
|
374
|
-
TuiInputCardGroupedComponent.prototype.onArrow = function (element, step) {
|
|
375
|
-
var _a;
|
|
376
|
-
this.open = this.hasDropdown;
|
|
377
|
-
this.changeDetectorRef.detectChanges();
|
|
378
|
-
(_a = this.datalist) === null || _a === void 0 ? void 0 : _a.onKeyDownArrow(element, step);
|
|
379
|
-
};
|
|
380
380
|
TuiInputCardGroupedComponent.prototype.clear = function () {
|
|
381
381
|
this.updateValue(null);
|
|
382
382
|
if (this.inputCard) {
|
|
@@ -446,6 +446,15 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
446
446
|
{ type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] },
|
|
447
447
|
{ type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_CARD_GROUPED_TEXTS,] }] }
|
|
448
448
|
]; };
|
|
449
|
+
__decorate([
|
|
450
|
+
ViewChild('inputCard')
|
|
451
|
+
], TuiInputCardGroupedComponent.prototype, "inputCard", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
ViewChild('inputExpire')
|
|
454
|
+
], TuiInputCardGroupedComponent.prototype, "inputExpire", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
ViewChild('inputCVC')
|
|
457
|
+
], TuiInputCardGroupedComponent.prototype, "inputCVC", void 0);
|
|
449
458
|
__decorate([
|
|
450
459
|
Input(),
|
|
451
460
|
tuiDefaultProp()
|
|
@@ -478,15 +487,6 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
478
487
|
__decorate([
|
|
479
488
|
ContentChild(TuiDataListComponent)
|
|
480
489
|
], TuiInputCardGroupedComponent.prototype, "datalist", void 0);
|
|
481
|
-
__decorate([
|
|
482
|
-
ViewChild('inputCard')
|
|
483
|
-
], TuiInputCardGroupedComponent.prototype, "inputCard", void 0);
|
|
484
|
-
__decorate([
|
|
485
|
-
ViewChild('inputExpire')
|
|
486
|
-
], TuiInputCardGroupedComponent.prototype, "inputExpire", void 0);
|
|
487
|
-
__decorate([
|
|
488
|
-
ViewChild('inputCVC')
|
|
489
|
-
], TuiInputCardGroupedComponent.prototype, "inputCVC", void 0);
|
|
490
490
|
__decorate([
|
|
491
491
|
HostListener('keydown.esc')
|
|
492
492
|
], TuiInputCardGroupedComponent.prototype, "onEsc", null);
|
|
@@ -517,7 +517,7 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
517
517
|
'($.data-mode.attr)': 'mode$',
|
|
518
518
|
'data-tui-host-size': 'l',
|
|
519
519
|
},
|
|
520
|
-
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)}@media screen and (max-width:47.9375em){:host{width:18rem}}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;z-index:2;height:100%;width:100%;overflow:hidden}.t-common-wrapper .t-icons,.t-common-wrapper .t-wrapper{z-index:1}.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)}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}@media screen and (max-width:47.9375em){.t-wrapper_cvc{margin-left:4.0625rem}.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;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;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;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 1000px var(--tui-autofill) inset!important}: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 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}:host._disabled .t-collapsed{pointer-events:none}:host._right-aligned .t-collapsed{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed:before{content:attr(data-before)}:-webkit-autofill~.t-collapsed{background:var(--tui-autofill)}.t-collapsed_inactive,:-webkit-autofill~.t-collapsed_inactive,:host._disabled .t-collapsed_inactive{color:transparent;background:0 0;-webkit-transition:color 0s var(--tui-duration),background 0s var(--tui-duration);transition:color 0s var(--tui-duration),background 0s var(--tui-duration)}.t-collapsed_inactive:before,:-webkit-autofill~.t-collapsed_inactive:before,:host._disabled .t-collapsed_inactive:before{color:transparent;-webkit-transition:color 0s var(--tui-duration);transition:color 0s var(--tui-duration)}.t-collapsed-wrapper{position:absolute;left:1.375rem;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;text-indent:-.375rem;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;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;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;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 1000px var(--tui-autofill) inset!important}: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 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-input{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-input{padding:0 var(--tui-padding-l)}:host._disabled .t-input{pointer-events:none}:host._right-aligned .t-input{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input:not(.t-input_prefilled)::-moz-placeholder{color:var(--tui-text-03);visibility:hidden}.t-input:not(.t-input_prefilled):-ms-input-placeholder{color:var(--tui-text-03);visibility:hidden}.t-input:not(.t-input_prefilled)::placeholder{color:var(--tui-text-03);visibility:hidden}:host[data-mode=onDark] .t-input::-moz-placeholder{color:var(--tui-text-03-night)}: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)}:host._focused .t-input:not(:read-only)::-moz-placeholder{visibility:visible}:host._focused .t-input:not(:read-only):-ms-input-placeholder{visibility:visible}:host._focused .t-input:not(:-moz-read-only)::placeholder{visibility:visible}:host._focused .t-input:not(:read-only)::placeholder{visibility:visible}.t-input_card{transition:color 0s var(--tui-duration)}.t-input_card::-webkit-textfield-decoration-container{display:none}:host._disabled .t-input_card{transition:color}.t-input_inert{pointer-events:none}.t-input_hidden,:host._disabled .t-input_hidden{color:transparent;transition:color}.t-input_hidden:-webkit-autofill,.t-input_hidden:-webkit-autofill:focus,.t-input_hidden:-webkit-autofill:hover,:host._disabled .t-input_hidden:-webkit-autofill,:host._disabled .t-input_hidden:-webkit-autofill:focus,:host._disabled .t-input_hidden:-webkit-autofill:hover{color:transparent!important;-webkit-text-fill-color:transparent!important}.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%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-tui-host-size='m'] .t-placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .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)._hovered .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-tui-host-size='l']._focused._label-outside .t-placeholder,:host[data-tui-host-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-tui-host-size='l'] .t-placeholder{font-size:.9375rem}:host[data-tui-host-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-tui-host-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-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-tui-host-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-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-tui-host-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-tui-host-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}"]
|
|
520
|
+
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)}@media screen and (max-width:47.9375em){:host{width:18rem}}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;z-index:2;height:100%;width:100%;overflow:hidden}.t-common-wrapper .t-icons,.t-common-wrapper .t-wrapper{z-index:1}.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)}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}@media screen and (max-width:47.9375em){.t-wrapper_cvc{margin-left:4.0625rem}.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;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;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;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 1000px var(--tui-autofill) inset!important}: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 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}:host._disabled .t-collapsed{pointer-events:none}:host._right-aligned .t-collapsed{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed:before{content:attr(data-before)}:-webkit-autofill~.t-collapsed{background:var(--tui-autofill)}.t-collapsed_inactive,:-webkit-autofill~.t-collapsed_inactive,:host._disabled .t-collapsed_inactive{color:transparent;background:0 0;-webkit-transition:color 0s var(--tui-duration),background 0s var(--tui-duration);transition:color 0s var(--tui-duration),background 0s var(--tui-duration)}.t-collapsed_inactive:before,:-webkit-autofill~.t-collapsed_inactive:before,:host._disabled .t-collapsed_inactive:before{color:transparent;-webkit-transition:color 0s var(--tui-duration);transition:color 0s var(--tui-duration)}.t-collapsed-wrapper{position:absolute;left:1.375rem;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;text-indent:-.375rem;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;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;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;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 1000px var(--tui-autofill) inset!important}: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 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-input{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-input{padding:0 var(--tui-padding-l)}:host._disabled .t-input{pointer-events:none}:host._right-aligned .t-input{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input:not(.t-input_prefilled)::-moz-placeholder{color:var(--tui-text-03);opacity:0}.t-input:not(.t-input_prefilled):-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-input:not(.t-input_prefilled)::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-input::-moz-placeholder{color:var(--tui-text-03-night)}: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)}:host._focused .t-input:not(:read-only)::-moz-placeholder{opacity:1}:host._focused .t-input:not(:read-only):-ms-input-placeholder{opacity:1}:host._focused .t-input:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-input:not(:read-only)::placeholder{opacity:1}.t-input_card{transition:color 0s var(--tui-duration)}.t-input_card::-webkit-textfield-decoration-container{display:none}:host._disabled .t-input_card{transition:color}.t-input_inert{pointer-events:none}.t-input_hidden,:host._disabled .t-input_hidden{color:transparent;transition:color}.t-input_hidden:-webkit-autofill,.t-input_hidden:-webkit-autofill:focus,.t-input_hidden:-webkit-autofill:hover,:host._disabled .t-input_hidden:-webkit-autofill,:host._disabled .t-input_hidden:-webkit-autofill:focus,:host._disabled .t-input_hidden:-webkit-autofill:hover{color:transparent!important;-webkit-text-fill-color:transparent!important}.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%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-tui-host-size='m'] .t-placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .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)._hovered .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-tui-host-size='l']._focused._label-outside .t-placeholder,:host[data-tui-host-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-tui-host-size='l'] .t-placeholder{font-size:.9375rem}:host[data-tui-host-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-tui-host-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-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-tui-host-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-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-tui-host-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-tui-host-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}"]
|
|
521
521
|
}),
|
|
522
522
|
__param(0, Optional()),
|
|
523
523
|
__param(0, Self()),
|