@taiga-ui/addon-commerce 2.23.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/README.md +7 -3
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-CVC.umd.js +4 -4
- 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 +22 -22
- 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 +4 -4
- 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 +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 +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 +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +1 -1
- 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-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 +7 -7
- package/bundles/taiga-ui-addon-commerce-validators.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce.umd.js +8 -8
- package/bundles/taiga-ui-addon-commerce.umd.min.js +1 -1
- package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +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/components/money/taiga-ui-addon-commerce-components-money.metadata.json +1 -1
- package/esm2015/components/card/card.component.js +2 -2
- package/esm2015/components/card/card.module.js +1 -1
- package/esm2015/components/input-CVC/input-CVC.component.js +5 -5
- package/esm2015/components/input-CVC/input-CVC.module.js +1 -1
- package/esm2015/components/input-card/input-card.component.js +5 -5
- package/esm2015/components/input-card/input-card.module.js +1 -1
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +23 -23
- package/esm2015/components/input-card-grouped/input-card-grouped.module.js +1 -1
- package/esm2015/components/input-expire/input-expire.component.js +5 -5
- package/esm2015/components/input-expire/input-expire.module.js +1 -1
- package/esm2015/components/money/money.component.js +2 -2
- package/esm2015/components/money/money.module.js +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/pipes/currency.module.js +1 -1
- package/esm2015/types/index.js +1 -1
- package/esm2015/utils/format-currency.js +1 -1
- package/esm2015/validators/index.js +2 -2
- package/esm5/components/card/card.component.js +2 -2
- package/esm5/components/card/card.module.js +1 -1
- package/esm5/components/input-CVC/input-CVC.component.js +5 -5
- package/esm5/components/input-CVC/input-CVC.module.js +1 -1
- package/esm5/components/input-card/input-card.component.js +5 -5
- package/esm5/components/input-card/input-card.module.js +1 -1
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +23 -23
- package/esm5/components/input-card-grouped/input-card-grouped.module.js +1 -1
- package/esm5/components/input-expire/input-expire.component.js +5 -5
- package/esm5/components/input-expire/input-expire.module.js +1 -1
- package/esm5/components/money/money.component.js +2 -2
- package/esm5/components/money/money.module.js +1 -1
- package/esm5/index.js +2 -2
- package/esm5/pipes/currency.module.js +1 -1
- package/esm5/types/index.js +1 -1
- package/esm5/utils/format-currency.js +1 -1
- package/esm5/validators/index.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-components-card.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-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-card-grouped.js +23 -23
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +5 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +5 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-pipes.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-validators.js +7 -7
- package/fesm2015/taiga-ui-addon-commerce-validators.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-card.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-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-card-grouped.js +23 -23
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js +5 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js +5 -5
- package/fesm5/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-pipes.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-validators.js +8 -8
- package/fesm5/taiga-ui-addon-commerce-validators.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +6 -5
- package/pipes/taiga-ui-addon-commerce-pipes.metadata.json +1 -1
- package/taiga-ui-addon-commerce.metadata.json +1 -1
- package/types/index.d.ts +1 -1
- package/types/taiga-ui-addon-commerce-types.metadata.json +1 -1
- package/validators/index.d.ts +1 -1
- package/validators/taiga-ui-addon-commerce-validators.metadata.json +1 -1
|
@@ -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,GAAG;IACV,mBAAwB,YAAY;IACpC,qBAAyB,aAAa;IACtC,6BAA6B,iBAAiB;IAC9C,iCAA+B,mBAAmB;IAClD,2BAA4B,gBAAgB;CAC/C,CAAC;SAEc,8BAA8B,CAC1C,SAAkD;IAElD,SAAS,GAAG,SAAS,IAAI,IAAI,gCAAgC,EAAE,CAAC;IAChE,SAAS,CAAC,WAAW,GAAG,qB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oDACc;AAIxD;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACa;AAI9B;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;kEACW;AAG5B;IADC,MAAM,EAAE;wDAC8C;AAhB9C,qBAAqB;IAjBjC,SAAS,CAAC;QACP,QAAQ,EAAE,gBAAgB;QAC1B,uuBAAyC;QAEzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,uBAAqB,CAAC;aACvD;YACD;gBACI,OAAO,EAAE,0BAA0B;gBACnC,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,gCAAgC,CAAC,CAAC;gBAC1D,UAAU,EAAE,8BAA8B;aAC7C;SACJ;;KACJ,CAAC;IA0BO,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GA7BrB,qBAAqB,CA6GjC;;IC9JY,kBAAkB,GAA/B,MAAa,kBAAkB;EAAG;AAArB,kBAAkB;IAV9B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;QACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACnC,CAAC;GACW,kBAAkB,CAAG;;ACjBlC;;;;;;"}
|
|
@@ -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,17 +66,17 @@ 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',
|
|
79
|
-
template: "<tui-primitive-textfield\n
|
|
79
|
+
template: "<tui-primitive-textfield\n tuiValueAccessor\n tuiTextfieldInputMode=\"numeric\"\n tuiTextfieldExampleText=\"00/00\"\n class=\"t-input\"\n [tuiTextfieldAutocomplete]=\"autocomplete\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHovered]=\"pseudoHovered\"\n [pseudoPressed]=\"pseudoPressed\"\n [pseudoFocused]=\"pseudoFocused\"\n [textMask]=\"textMaskOptions\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n>\n <ng-content></ng-content>\n</tui-primitive-textfield>\n",
|
|
80
80
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
81
81
|
providers: [
|
|
82
82
|
{
|
|
@@ -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;QAEn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AAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;KAC/B;IAES,gBAAgB;QACtB,OAAO,EAAE,CAAC;KACb;EACJ;;YArDgB,SAAS,uBAHjB,QAAQ,YACR,IAAI,YACJ,MAAM,SAAC,SAAS;YAE6B,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;;AAvB7B;IADC,SAAS,CAAC,8BAA8B,CAAC;sDACc;AAIxD;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oEACW;AATnB,uBAAuB;IAZnC,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;;;;;;"}
|
|
@@ -95,7 +95,7 @@ TuiMoneyComponent = __decorate([
|
|
|
95
95
|
Component({
|
|
96
96
|
selector: 'tui-money',
|
|
97
97
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
98
|
-
template: "<span automation-id=\"tui-money__sign\">{{signSymbol}}</span>\n<span automation-id=\"tui-money__integer-part\">{{integerPart}}</span>\n<span class=\"t-lighter\">\n <span automation-id=\"tui-money__fraction-part\">{{fractionPart}}</span>\n <span automation-id=\"tui-money__currency\" class=\"t-currency\">\n {{currency | tuiCurrency}}\n </span>\n</span>\n",
|
|
98
|
+
template: "<span automation-id=\"tui-money__sign\">{{ signSymbol }}</span>\n<span automation-id=\"tui-money__integer-part\">{{ integerPart }}</span>\n<span class=\"t-lighter\">\n <span automation-id=\"tui-money__fraction-part\">{{ fractionPart }}</span>\n <span automation-id=\"tui-money__currency\" class=\"t-currency\">\n {{ currency | tuiCurrency }}\n </span>\n</span>\n",
|
|
99
99
|
styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}"]
|
|
100
100
|
}),
|
|
101
101
|
__param(0, Inject(TUI_NUMBER_FORMAT))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = TuiCurrency.Ruble;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = 'negative-only';\n\n @Input()\n @tuiDefaultProp()\n colored = false;\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n singleColor = false;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n return CHAR_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === '+' ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\nimport {TuiMoneyComponent} from './money.component';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],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e,EAAE,uBAAuB,CAAC,MAAM;QAC/C,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = TuiCurrency.Ruble;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = 'negative-only';\n\n @Input()\n @tuiDefaultProp()\n colored = false;\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n singleColor = false;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n return CHAR_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === '+' ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAuBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAqF1B,YAEqB,YAAkC;QAAlC,iBAAY,GAAZ,YAAY,CAAsB;QApFvD,UAAK,GAAG,GAAG,CAAC;QAIZ,YAAO,GAAgB,UAAU,CAAC;QAIlC,aAAQ,qBAA0C;QAIlD,SAAI,GAAkB,eAAe,CAAC;QAItC,YAAO,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,CAAC,CAAC;QAId,gBAAW,GAAG,KAAK,CAAC;KA6DhB;IA3DJ,IAAI,WAAW;QACX,OAAO,YAAY,CACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAA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/currency.module.ts","ng://@taiga-ui/addon-commerce/pipes/taiga-ui-addon-commerce-pipes.ts"],"sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {formatCurrency} from '@taiga-ui/addon-commerce/utils';\n\n@Pipe({\n name: 'tuiCurrency',\n})\nexport class TuiCurrencyPipe implements PipeTransform {\n transform(currency: TuiCurrencyVariants): string {\n return formatCurrency(currency);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiCurrencyPipe} from './currency.pipe';\n\n@NgModule({\n declarations: [TuiCurrencyPipe],\n exports: [TuiCurrencyPipe],\n})\nexport class TuiCurrencyPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAOa,eAAe,GAA5B,MAAa,eAAe;IACxB,SAAS,CAAC,QAA6B;QACnC,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;KACnC;EACJ;AAJY,eAAe;IAH3B,IAAI,CAAC;QACF,IAAI,EAAE,aAAa;KACtB,CAAC;GACW,eAAe,CAI3B;;
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-pipes.js","sources":["ng://@taiga-ui/addon-commerce/pipes/currency.pipe.ts","ng://@taiga-ui/addon-commerce/pipes/currency.module.ts","ng://@taiga-ui/addon-commerce/pipes/taiga-ui-addon-commerce-pipes.ts"],"sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {formatCurrency} from '@taiga-ui/addon-commerce/utils';\n\n@Pipe({\n name: 'tuiCurrency',\n})\nexport class TuiCurrencyPipe implements PipeTransform {\n transform(currency: TuiCurrencyVariants): string {\n return formatCurrency(currency);\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiCurrencyPipe} from './currency.pipe';\n\n@NgModule({\n declarations: [TuiCurrencyPipe],\n exports: [TuiCurrencyPipe],\n})\nexport class TuiCurrencyPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAOa,eAAe,GAA5B,MAAa,eAAe;IACxB,SAAS,CAAC,QAA6B;QACnC,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;KACnC;EACJ;AAJY,eAAe;IAH3B,IAAI,CAAC;QACF,IAAI,EAAE,aAAa;KACtB,CAAC;GACW,eAAe,CAI3B;;ICHY,qBAAqB,GAAlC,MAAa,qBAAqB;EAAG;AAAxB,qBAAqB;IAJjC,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,eAAe,CAAC;QAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;KAC7B,CAAC;GACW,qBAAqB,CAAG;;ACRrC;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[\\/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = rawValue.substr(0, 2) + '/' + rawValue.substr(5);\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(2) : ''\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = '/';\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = '0';\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return '₽';\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n return '$';\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return 'S$';\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return 'A$';\n case TuiCurrency.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\n return 'HK$';\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return 'C$';\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return '€';\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return '£';\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return '฿';\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return '₺';\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return 'CN¥';\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return '¥';\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return '₪';\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return '₹';\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return '₣';\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return '֏';\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return '₩';\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return '₸';\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return '₴';\n default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === 'string'\n ? currency || ''\n : padStart(String(currency), 3, '0');\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === '') {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');\n\n const {length} = cardNumber;\n const arr = cardNumber.split('').map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n","export function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAC;;QAE9B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACrE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAC,MAAM,EAAC,KAAK,MAAM,KAAK,CAAC,CAAC,CAAC;YAEpD,cAAc,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,IACpD,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAC5B,EAAE,CAAC;SACN;QAED,M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AC,GAAG,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC;SAC9C;QAED,OAAO,KAAK,CAAC;KAChB,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD;;SCtBgB,aAAa,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF;;ACRA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[\\/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = rawValue.substr(0, 2) + '/' + rawValue.substr(5);\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(2) : ''\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = '/';\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = '0';\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return '₽';\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n return '$';\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return 'S$';\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return 'A$';\n case TuiCurrency.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\n return 'HK$';\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return 'C$';\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return '€';\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return '£';\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return '฿';\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return '₺';\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return 'CN¥';\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return '¥';\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return '₪';\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return '₹';\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return '₣';\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return '֏';\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return '₩';\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return '₸';\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return '₴';\n default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === 'string'\n ? currency || ''\n : padStart(String(currency), 3, '0');\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === '') {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');\n\n const {length} = cardNumber;\n const arr = cardNumber.split('').map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n","export function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAC;;QAE9B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACrE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,GAAG,KAAK,CAA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,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK;QAC7C,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE;YAC5B,MAAM,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC;YAE1B,OAAO,OAAO,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC;SAC9C;QAED,OAAO,KAAK,CAAC;KAChB,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD;;SCtBgB,aAAa,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF;;ACRA;;;;;;"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isExpireValid, isCardNumberValid } from '@taiga-ui/addon-commerce/utils';
|
|
2
2
|
import { TuiValidationError } from '@taiga-ui/cdk';
|
|
3
3
|
|
|
4
|
-
function tuiCreateLuhnValidator(message) {
|
|
5
|
-
return ({ value }) => {
|
|
6
|
-
return isCardNumberValid(value) ? null : { luhn: new TuiValidationError(message) };
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
4
|
function tuiCardExpireValidator({ value, }) {
|
|
11
5
|
var _a;
|
|
12
6
|
return ((_a = value === null || value === void 0 ? void 0 : value.expire) === null || _a === void 0 ? void 0 : _a.length) === 5 && !isExpireValid(value === null || value === void 0 ? void 0 : value.expire)
|
|
@@ -20,6 +14,12 @@ function tuiCardNumberValidator({ value, }) {
|
|
|
20
14
|
: null;
|
|
21
15
|
}
|
|
22
16
|
|
|
17
|
+
function tuiCreateLuhnValidator(message) {
|
|
18
|
+
return ({ value }) => {
|
|
19
|
+
return isCardNumberValid(value) ? null : { luhn: new TuiValidationError(message) };
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
23
|
/**
|
|
24
24
|
* Generated bundle index. Do not edit.
|
|
25
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-validators.js","sources":["ng://@taiga-ui/addon-commerce/validators/
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-validators.js","sources":["ng://@taiga-ui/addon-commerce/validators/card-expire.validator.ts","ng://@taiga-ui/addon-commerce/validators/card-number.validator.ts","ng://@taiga-ui/addon-commerce/validators/luhn.validator.ts","ng://@taiga-ui/addon-commerce/validators/taiga-ui-addon-commerce-validators.ts"],"sourcesContent":["import {AbstractControl, ValidationErrors} from '@angular/forms';\nimport {isExpireValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\n\nexport function tuiCardExpireValidator({\n value,\n}: AbstractControl): ValidationErrors | null {\n return value?.expire?.length === 5 && !isExpireValid(value?.expire)\n ? {expire: new TuiValidationError('Expire date')}\n : null;\n}\n","import {AbstractControl, ValidationErrors} from '@angular/forms';\nimport {isCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\n\nexport function tuiCardNumberValidator({\n value,\n}: AbstractControl): ValidationErrors | null {\n return value?.card && !isCardNumberValid(value.card)\n ? {card: new TuiValidationError('Invalid card number')}\n : null;\n}\n","import {AbstractControl, ValidatorFn} from '@angular/forms';\nimport {isCardNumberValid} from '@taiga-ui/addon-commerce/utils';\nimport {TuiValidationError} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport function tuiCreateLuhnValidator(message: PolymorpheusContent): ValidatorFn {\n return ({value}: AbstractControl) => {\n return isCardNumberValid(value) ? null : {luhn: new TuiValidationError(message)};\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;SAIgB,sBAAsB,CAAC,EACnC,KAAK,GACS;;IACd,OAAO,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,MAAM,MAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC;UAC7D,EAAC,MAAM,EAAE,IAAI,kBAAkB,CAAC,aAAa,CAAC,EAAC;UAC/C,IAAI,CAAC;AACf;;SCNgB,sBAAsB,CAAC,EACnC,KAAK,GACS;IACd,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC;UAC9C,EAAC,IAAI,EAAE,IAAI,kBAAkB,CAAC,qBAAqB,CAAC,EAAC;UACrD,IAAI,CAAC;AACf;;SCLgB,sBAAsB,CAAC,OAA4B;IAC/D,OAAO,CAAC,EAAC,KAAK,EAAkB;QAC5B,OAAO,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAC,IAAI,EAAE,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAC,CAAC;KACpF,CAAC;AACN;;ACTA;;;;;;"}
|
|
@@ -2,8 +2,8 @@ export * from '@taiga-ui/addon-commerce/components';
|
|
|
2
2
|
export * from '@taiga-ui/addon-commerce/constants';
|
|
3
3
|
export * from '@taiga-ui/addon-commerce/enums';
|
|
4
4
|
export * from '@taiga-ui/addon-commerce/pipes';
|
|
5
|
-
export * from '@taiga-ui/addon-commerce/utils';
|
|
6
5
|
export * from '@taiga-ui/addon-commerce/tokens';
|
|
6
|
+
export * from '@taiga-ui/addon-commerce/utils';
|
|
7
7
|
export * from '@taiga-ui/addon-commerce/validators';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -64,7 +64,7 @@ var TuiCardComponent = /** @class */ (function () {
|
|
|
64
64
|
TuiCardComponent = __decorate([
|
|
65
65
|
Component({
|
|
66
66
|
selector: 'tui-card',
|
|
67
|
-
template: "<div class=\"t-front\">\n <tui-svg\n *ngIf=\"hasBrandLogo\"\n class=\"t-brand-logo\"\n [src]=\"brandLogo\"\n ></tui-svg>\n <span class=\"t-number\">{{cardNumber}}</span>\n <tui-svg\n *ngIf=\"!!paymentSystem\"\n class=\"t-payment-system-logo\"\n [src]=\"paymentSystemLogo\"\n ></tui-svg>\n</div>\n<div class=\"t-back\"></div>\n",
|
|
67
|
+
template: "<div class=\"t-front\">\n <tui-svg\n *ngIf=\"hasBrandLogo\"\n class=\"t-brand-logo\"\n [src]=\"brandLogo\"\n ></tui-svg>\n <span class=\"t-number\">{{ cardNumber }}</span>\n <tui-svg\n *ngIf=\"!!paymentSystem\"\n class=\"t-payment-system-logo\"\n [src]=\"paymentSystemLogo\"\n ></tui-svg>\n</div>\n<div class=\"t-back\"></div>\n",
|
|
68
68
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
69
69
|
styles: [":host{position:relative;display:block;color:var(--tui-base-01);transform-style:preserve-3d;cursor:default;border-radius:var(--tui-radius-xs);background-size:100%}:host[data-tui-host-size='s']{width:2rem;height:1.5rem}:host[data-tui-host-size='m']{width:3rem;height:2rem}:host._active{box-shadow:0 0 0 1px var(--tui-base-01)}.t-front{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}.t-brand-logo{position:absolute;top:.1875rem;left:.125rem;height:.875rem;width:.875rem}.t-number{position:absolute;right:.25rem;display:flex;justify-content:center;align-items:center}:host[data-tui-host-size='s'] .t-number{top:.125rem;height:.625rem;width:1.1875rem;font-size:.5rem}:host[data-tui-host-size='m'] .t-number{top:.1875rem;height:.875rem;width:1.5rem;font-size:.625rem}.t-payment-system-logo{position:absolute;right:.25rem;bottom:-.5rem;width:2rem;height:2rem;transform:scale(.5);transform-origin:right}.t-back{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:rotateY(180deg) translate3d(0,0,1px);background-color:var(--tui-base-05);border-radius:var(--tui-radius-xs)}.t-back:after{content:'';position:absolute;top:20%;left:0;right:0;height:20%;background-color:var(--tui-base-06)}"]
|
|
70
70
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-card.js","sources":["ng://@taiga-ui/addon-commerce/components/card/card.component.ts","ng://@taiga-ui/addon-commerce/components/card/card.module.ts","ng://@taiga-ui/addon-commerce/components/card/taiga-ui-addon-commerce-components-card.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, HostBinding, Input} from '@angular/core';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\n\nexport function cardNumberAssertion({length}: string): boolean {\n return !length || length === 4;\n}\n\nexport const cardNumberAssertionMessage = 'cardNumber should contain 4 symbols';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: 'tuiIconMirMono',\n [TuiPaymentSystem.Visa]: 'tuiIconVisaMono',\n [TuiPaymentSystem.Electron]: 'tuiIconElectronMono',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n@Component({\n selector: 'tui-card',\n templateUrl: 'card.template.html',\n styleUrls: ['./card.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCardComponent {\n @Input()\n @HostBinding('class._active')\n @tuiDefaultProp()\n active = false;\n\n @Input()\n @tuiDefaultProp()\n brandLogo = '';\n\n @Input()\n @tuiDefaultProp(cardNumberAssertion, cardNumberAssertionMessage)\n cardNumber = '';\n\n @Input()\n @tuiDefaultProp()\n paymentSystem: TuiPaymentSystem | null = null;\n\n @Input()\n @HostBinding('attr.data-tui-host-size')\n @tuiDefaultProp()\n size: TuiSizeS = 'm';\n\n get hasBrandLogo(): boolean {\n return !!this.brandLogo && this.size === 'm';\n }\n\n get paymentSystemLogo(): string {\n return this.paymentSystem ? icons[this.paymentSystem] : '';\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\nimport {TuiCardComponent} from './card.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiCardComponent],\n exports: [TuiCardComponent],\n})\nexport class TuiCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAKgB,mBAAmB,CAAC,EAAgB;QAAf,kBAAM;IACvC,OAAO,CAAC,MAAM,IAAI,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC;IAEY,0BAA0B,GAAG,sCAAsC;AAEhF,IAAM,KAAK;IACP,sBAAwB,gBAAgB;IACxC,wBAAyB,iBAAiB;IAC1C,gCAA6B,qBAAqB;IAClD,oCAA+B,mBAAmB;IAClD,8BAA4B,gBAAgB;OAC/C,CAAC;;IAQF;QAII,WAAM,GAAG,KAAK,CAAC;QAIf,cAAS,GAAG,EAAE,CAAC;QAIf,eAAU,GAAG,EAAE,CAAC;QAIhB,kBAAa,GAA4B,IAAI,CAAC;QAK9C,SAAI,GAAa,GAAG,CAAC;KASxB;IAPG,sBAAI,0CAAY;aAAhB;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;SAChD;;;OAAA;IAED,sBAAI,+CAAiB;aAArB;YACI,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;SAC9D;;;OAAA;IAzBD;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,eAAe,CAAC;QAC5B,cAAc,EAAE;oDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;uDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;wDAChD;IAIhB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;2DAC6B;IAK9C;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,yBAAyB,CAAC;QACtC,cAAc,EAAE;kDACI;IArBZ,gBAAgB;QAN5B,SAAS,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-card.js","sources":["ng://@taiga-ui/addon-commerce/components/card/card.component.ts","ng://@taiga-ui/addon-commerce/components/card/card.module.ts","ng://@taiga-ui/addon-commerce/components/card/taiga-ui-addon-commerce-components-card.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, HostBinding, Input} from '@angular/core';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\n\nexport function cardNumberAssertion({length}: string): boolean {\n return !length || length === 4;\n}\n\nexport const cardNumberAssertionMessage = 'cardNumber should contain 4 symbols';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: 'tuiIconMirMono',\n [TuiPaymentSystem.Visa]: 'tuiIconVisaMono',\n [TuiPaymentSystem.Electron]: 'tuiIconElectronMono',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n@Component({\n selector: 'tui-card',\n templateUrl: 'card.template.html',\n styleUrls: ['./card.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCardComponent {\n @Input()\n @HostBinding('class._active')\n @tuiDefaultProp()\n active = false;\n\n @Input()\n @tuiDefaultProp()\n brandLogo = '';\n\n @Input()\n @tuiDefaultProp(cardNumberAssertion, cardNumberAssertionMessage)\n cardNumber = '';\n\n @Input()\n @tuiDefaultProp()\n paymentSystem: TuiPaymentSystem | null = null;\n\n @Input()\n @HostBinding('attr.data-tui-host-size')\n @tuiDefaultProp()\n size: TuiSizeS = 'm';\n\n get hasBrandLogo(): boolean {\n return !!this.brandLogo && this.size === 'm';\n }\n\n get paymentSystemLogo(): string {\n return this.paymentSystem ? icons[this.paymentSystem] : '';\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiCardComponent} from './card.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiCardComponent],\n exports: [TuiCardComponent],\n})\nexport class TuiCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAKgB,mBAAmB,CAAC,EAAgB;QAAf,kBAAM;IACvC,OAAO,CAAC,MAAM,IAAI,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC;IAEY,0BAA0B,GAAG,sCAAsC;AAEhF,IAAM,KAAK;IACP,sBAAwB,gBAAgB;IACxC,wBAAyB,iBAAiB;IAC1C,gCAA6B,qBAAqB;IAClD,oCAA+B,mBAAmB;IAClD,8BAA4B,gBAAgB;OAC/C,CAAC;;IAQF;QAII,WAAM,GAAG,KAAK,CAAC;QAIf,cAAS,GAAG,EAAE,CAAC;QAIf,eAAU,GAAG,EAAE,CAAC;QAIhB,kBAAa,GAA4B,IAAI,CAAC;QAK9C,SAAI,GAAa,GAAG,CAAC;KASxB;IAPG,sBAAI,0CAAY;aAAhB;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;SAChD;;;OAAA;IAED,sBAAI,+CAAiB;aAArB;YACI,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;SAC9D;;;OAAA;IAzBD;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,eAAe,CAAC;QAC5B,cAAc,EAAE;oDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;uDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;wDAChD;IAIhB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;2DAC6B;IAK9C;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,yBAAyB,CAAC;QACtC,cAAc,EAAE;kDACI;IArBZ,gBAAgB;QAN5B,SAAS,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,6YAAiC;YAEjC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;SAClD,CAAC;OACW,gBAAgB,CA8B5B;IAAD,uBAAC;CA9BD;;;ICdA;KAA6B;IAAhB,aAAa;QALzB,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;YACrC,YAAY,EAAE,CAAC,gBAAgB,CAAC;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC9B,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;ACXA;;;;;;"}
|
|
@@ -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,13 +91,10 @@ 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',
|
|
97
|
-
template: "<tui-primitive-textfield\n
|
|
97
|
+
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",
|
|
98
98
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
99
99
|
providers: [
|
|
100
100
|
{
|
|
@@ -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,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;gBAC9C,KAAK,EAAE,KAAK;aACf,CAAC;SACL;;;OAAA;IAqBD,sBAAI,wDAAsB;aAA1B;YACI,OAAO,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;SAChE;;;OAAA;IAED,sBAAI,yCAAO;aAAX;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,I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AAM,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);
|
|
@@ -500,7 +500,7 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
500
500
|
TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = __decorate([
|
|
501
501
|
Component({
|
|
502
502
|
selector: 'tui-input-card-grouped',
|
|
503
|
-
template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n appearance=\"textfield\"\n class=\"t-common-wrapper\"\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.currentTarget)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label tuiPreventDefault=\"click\">\n <input\n #inputCard\n type=\"text\"\n
|
|
503
|
+
template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n appearance=\"textfield\"\n class=\"t-common-wrapper\"\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.currentTarget)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label tuiPreventDefault=\"click\">\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]=\"isCardCollapsed\"\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 [class.t-collapsed_inactive]=\"!isCardCollapsed\"\n [attr.data-before]=\"masked\"\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",
|
|
504
504
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
505
505
|
providers: [
|
|
506
506
|
MODE_PROVIDER,
|
|
@@ -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;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)}.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}.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)}: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);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()),
|