@taiga-ui/addon-commerce 3.0.0-rc.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +4 -13
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js +36 -26
- package/bundles/taiga-ui-addon-commerce-components-input-card.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js +3 -8
- package/bundles/taiga-ui-addon-commerce-components-input-cvc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js +2 -4
- package/bundles/taiga-ui-addon-commerce-components-input-expire.umd.js.map +1 -1
- package/components/input-card/index.d.ts +1 -0
- package/components/input-card/input-card.component.d.ts +3 -3
- package/components/input-card/input-card.directive.d.ts +10 -0
- package/components/input-card/input-card.module.d.ts +5 -4
- package/components/input-card-grouped/input-card-grouped.component.d.ts +4 -4
- package/components/input-card-grouped/input-card-grouped.module.d.ts +1 -1
- package/components/input-cvc/input-cvc.component.d.ts +3 -3
- package/components/input-cvc/input-cvc.module.d.ts +1 -1
- package/components/input-expire/input-expire.component.d.ts +2 -2
- package/esm2015/components/input-card/index.js +2 -1
- package/esm2015/components/input-card/input-card.component.js +4 -24
- package/esm2015/components/input-card/input-card.directive.js +27 -0
- package/esm2015/components/input-card/input-card.module.js +7 -6
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +5 -11
- package/esm2015/components/input-card-grouped/input-card-grouped.module.js +2 -5
- package/esm2015/components/input-cvc/input-cvc.component.js +4 -6
- package/esm2015/components/input-cvc/input-cvc.module.js +2 -5
- package/esm2015/components/input-expire/input-expire.component.js +3 -5
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +5 -14
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js +33 -29
- package/fesm2015/taiga-ui-addon-commerce-components-input-card.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js +4 -9
- package/fesm2015/taiga-ui-addon-commerce-components-input-cvc.js.map +1 -1
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js +2 -4
- package/fesm2015/taiga-ui-addon-commerce-components-input-expire.js.map +1 -1
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import * as i4 from '@angular/forms';
|
|
|
5
5
|
import { NgControl } from '@angular/forms';
|
|
6
6
|
import { AbstractTuiControl, tuiAsFocusableItemAccessor, tuiAsControl, tuiDefaultProp, tuiRequiredSetter } from '@taiga-ui/cdk';
|
|
7
7
|
import * as i1 from '@taiga-ui/core';
|
|
8
|
-
import { TUI_DIGIT_REGEXP, TUI_TEXTFIELD_LABEL_OUTSIDE, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule
|
|
8
|
+
import { TUI_DIGIT_REGEXP, TUI_TEXTFIELD_LABEL_OUTSIDE, TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
9
9
|
import * as i2 from '@taiga-ui/kit';
|
|
10
10
|
import { TuiValueAccessorModule } from '@taiga-ui/kit';
|
|
11
11
|
import * as i3 from 'angular2-text-mask';
|
|
@@ -36,11 +36,9 @@ class TuiInputCVCComponent extends AbstractTuiControl {
|
|
|
36
36
|
return !!this.input && this.input.focused;
|
|
37
37
|
}
|
|
38
38
|
get autocomplete() {
|
|
39
|
-
return this.autocompleteEnabled
|
|
40
|
-
? "cc-csc" /* CcCsc */
|
|
41
|
-
: "off" /* Off */;
|
|
39
|
+
return this.autocompleteEnabled ? `cc-csc` : `off`;
|
|
42
40
|
}
|
|
43
|
-
get
|
|
41
|
+
get computedPlaceholder() {
|
|
44
42
|
return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;
|
|
45
43
|
}
|
|
46
44
|
onFocused(focused) {
|
|
@@ -58,7 +56,7 @@ TuiInputCVCComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
|
|
|
58
56
|
TuiInputCVCComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiInputCVCComponent, selector: "tui-input-cvc", inputs: { autocompleteEnabled: "autocompleteEnabled", length: "length" }, providers: [
|
|
59
57
|
tuiAsFocusableItemAccessor(TuiInputCVCComponent),
|
|
60
58
|
tuiAsControl(TuiInputCVCComponent),
|
|
61
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-primitive-textfield\n tuiValueAccessor\n
|
|
59
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-primitive-textfield\n tuiValueAccessor\n class=\"t-input\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n <input\n tuiTextfield\n inputmode=\"numeric\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.placeholder]=\"computedPlaceholder\"\n />\n</tui-primitive-textfield>\n", styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}\n"], components: [{ type: i1.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }, { type: i1.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }], directives: [{ type: i1.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2.TuiValueAccessorDirective, selector: "[tuiValueAccessor]" }, { type: i3.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
62
60
|
__decorate([
|
|
63
61
|
tuiDefaultProp()
|
|
64
62
|
], TuiInputCVCComponent.prototype, "autocompleteEnabled", void 0);
|
|
@@ -105,13 +103,11 @@ TuiInputCVCModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
|
|
|
105
103
|
TuiInputCVCModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputCVCModule, declarations: [TuiInputCVCComponent], imports: [TextMaskModule,
|
|
106
104
|
TuiPrimitiveTextfieldModule,
|
|
107
105
|
TuiTextfieldControllerModule,
|
|
108
|
-
TuiHintControllerModule,
|
|
109
106
|
TuiValueAccessorModule], exports: [TuiInputCVCComponent] });
|
|
110
107
|
TuiInputCVCModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputCVCModule, imports: [[
|
|
111
108
|
TextMaskModule,
|
|
112
109
|
TuiPrimitiveTextfieldModule,
|
|
113
110
|
TuiTextfieldControllerModule,
|
|
114
|
-
TuiHintControllerModule,
|
|
115
111
|
TuiValueAccessorModule,
|
|
116
112
|
]] });
|
|
117
113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiInputCVCModule, decorators: [{
|
|
@@ -121,7 +117,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
121
117
|
TextMaskModule,
|
|
122
118
|
TuiPrimitiveTextfieldModule,
|
|
123
119
|
TuiTextfieldControllerModule,
|
|
124
|
-
TuiHintControllerModule,
|
|
125
120
|
TuiValueAccessorModule,
|
|
126
121
|
],
|
|
127
122
|
declarations: [TuiInputCVCComponent],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["../../../projects/addon-commerce/components/input-cvc/input-cvc.component.ts","../../../projects/addon-commerce/components/input-cvc/input-cvc.template.html","../../../projects/addon-commerce/components/input-cvc/input-cvc.module.ts","../../../projects/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\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 tuiAsControl,\n tuiAsFocusableItemAccessor,\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-cvc.js","sources":["../../../projects/addon-commerce/components/input-cvc/input-cvc.component.ts","../../../projects/addon-commerce/components/input-cvc/input-cvc.template.html","../../../projects/addon-commerce/components/input-cvc/input-cvc.module.ts","../../../projects/addon-commerce/components/input-cvc/taiga-ui-addon-commerce-components-input-cvc.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\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 tuiAsControl,\n tuiAsFocusableItemAccessor,\n TuiAutofillFieldName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TUI_TEXTFIELD_LABEL_OUTSIDE,\n TuiPrimitiveTextfieldComponent,\n TuiTextfieldLabelOutsideDirective,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\n\n@Component({\n selector: `tui-input-cvc`,\n templateUrl: `./input-cvc.template.html`,\n styleUrls: [`./input-cvc.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsFocusableItemAccessor(TuiInputCVCComponent),\n tuiAsControl(TuiInputCVCComponent),\n ],\n})\nexport class TuiInputCVCComponent\n extends AbstractTuiControl<string>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiPrimitiveTextfieldComponent)\n private readonly input?: TuiPrimitiveTextfieldComponent;\n\n @Input()\n @tuiDefaultProp()\n autocompleteEnabled = false;\n\n @Input()\n @tuiRequiredSetter()\n set length(length: TuiCodeCVCLength) {\n this.exampleText = `0`.repeat(length);\n this.textMaskOptions = {\n mask: new Array(length).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n }\n\n exampleText = `000`;\n\n textMaskOptions: TextMaskConfig = {\n mask: new Array(3).fill(TUI_DIGIT_REGEXP),\n guide: false,\n };\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_LABEL_OUTSIDE)\n private readonly textfieldLabelOutside: TuiTextfieldLabelOutsideDirective,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.input ? this.input.nativeFocusableElement : null;\n }\n\n get focused(): boolean {\n return !!this.input && this.input.focused;\n }\n\n get autocomplete(): TuiAutofillFieldName {\n return this.autocompleteEnabled ? `cc-csc` : `off`;\n }\n\n get computedPlaceholder(): string {\n return this.textfieldLabelOutside.labelOutside ? `` : this.exampleText;\n }\n\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n\n onCopy(): void {}\n\n onValueChange(value: string): void {\n this.updateValue(value);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","<tui-primitive-textfield\n tuiValueAccessor\n class=\"t-input\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [nativeId]=\"nativeId\"\n [textMask]=\"textMaskOptions\"\n [invalid]=\"computedInvalid\"\n [focusable]=\"focusable\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n (copy.prevent)=\"onCopy()\"\n>\n <ng-content></ng-content>\n <input\n tuiTextfield\n inputmode=\"numeric\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.placeholder]=\"computedPlaceholder\"\n />\n</tui-primitive-textfield>\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 {TuiInputCVCComponent} from './input-cvc.component';\n\n@NgModule({\n imports: [\n TextMaskModule,\n TuiPrimitiveTextfieldModule,\n TuiTextfieldControllerModule,\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":";;;;;;;;;;;;;AAwCM,MAAO,oBACT,SAAQ,kBAA0B,CAAA;AA2BlC,IAAA,WAAA,CAII,OAAyB,EACE,iBAAoC,EAE9C,qBAAwD,EAAA;AAEzE,QAAA,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAFjB,IAAqB,CAAA,qBAAA,GAArB,qBAAqB,CAAmC;QA1B7E,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;QAY5B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AA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AA;sBAFlB,KAAK;gBAMF,MAAM,EAAA,CAAA;sBAFT,KAAK;;;MElCG,iBAAiB,CAAA;;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAjB,iBAAiB,EAAA,YAAA,EAAA,CAHX,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAL/B,cAAc;QACd,2BAA2B;QAC3B,4BAA4B;AAC5B,QAAA,sBAAsB,aAGhB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAErB,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,EATjB,OAAA,EAAA,CAAA;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;AACzB,SAAA,CAAA,EAAA,CAAA,CAAA;4FAIQ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAV7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,2BAA2B;wBAC3B,4BAA4B;wBAC5B,sBAAsB;AACzB,qBAAA;oBACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAClC,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -35,9 +35,7 @@ class TuiInputExpireComponent extends AbstractTuiControl {
|
|
|
35
35
|
return !!this.input && this.input.focused;
|
|
36
36
|
}
|
|
37
37
|
get autocomplete() {
|
|
38
|
-
return this.autocompleteEnabled
|
|
39
|
-
? "cc-exp" /* CcExp */
|
|
40
|
-
: "off" /* Off */;
|
|
38
|
+
return this.autocompleteEnabled ? `cc-exp` : `off`;
|
|
41
39
|
}
|
|
42
40
|
onValueChange(value) {
|
|
43
41
|
var _a;
|
|
@@ -68,7 +66,7 @@ TuiInputExpireComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0",
|
|
|
68
66
|
TuiInputExpireComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TuiInputExpireComponent, selector: "tui-input-expire", inputs: { autocompleteEnabled: "autocompleteEnabled" }, providers: [
|
|
69
67
|
tuiAsFocusableItemAccessor(TuiInputExpireComponent),
|
|
70
68
|
tuiAsControl(TuiInputExpireComponent),
|
|
71
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-primitive-textfield\n tuiValueAccessor\n
|
|
69
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: TuiPrimitiveTextfieldComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-primitive-textfield\n tuiValueAccessor\n class=\"t-input\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [textMask]=\"textMaskOptions\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n>\n <input\n tuiTextfield\n inputmode=\"numeric\"\n placeholder=\"00/00\"\n [attr.autocomplete]=\"autocomplete\"\n />\n <ng-content></ng-content>\n</tui-primitive-textfield>\n", styles: [":host{display:block;max-width:11rem;border-radius:var(--tui-radius-m);text-align:left}.t-input{border-radius:inherit;text-align:inherit}\n"], components: [{ type: i1.TuiPrimitiveTextfieldComponent, selector: "tui-primitive-textfield", inputs: ["editable", "filler", "iconCleaner", "readOnly", "invalid", "disabled", "prefix", "postfix", "value"], outputs: ["valueChange"] }, { type: i1.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }], directives: [{ type: i1.TuiPrimitiveTextfieldDirective, selector: "tui-primitive-textfield" }, { type: i2.TuiValueAccessorDirective, selector: "[tuiValueAccessor]" }, { type: i3.MaskedInputDirective, selector: "[textMask]", inputs: ["textMask"], exportAs: ["textMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
70
|
__decorate([
|
|
73
71
|
tuiDefaultProp()
|
|
74
72
|
], TuiInputExpireComponent.prototype, "autocompleteEnabled", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["../../../projects/addon-commerce/components/input-expire/input-expire.component.ts","../../../projects/addon-commerce/components/input-expire/input-expire.template.html","../../../projects/addon-commerce/components/input-expire/input-expire.module.ts","../../../projects/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\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 tuiAsControl,\n tuiAsFocusableItemAccessor,\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-expire.js","sources":["../../../projects/addon-commerce/components/input-expire/input-expire.component.ts","../../../projects/addon-commerce/components/input-expire/input-expire.template.html","../../../projects/addon-commerce/components/input-expire/input-expire.module.ts","../../../projects/addon-commerce/components/input-expire/taiga-ui-addon-commerce-components-input-expire.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\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 tuiAsControl,\n tuiAsFocusableItemAccessor,\n TuiAutofillFieldName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_DIGIT_REGEXP,\n TuiPrimitiveTextfieldComponent,\n TuiTextMaskOptions,\n} from '@taiga-ui/core';\nimport {TextMaskConfig} from 'angular2-text-mask';\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 tuiAsFocusableItemAccessor(TuiInputExpireComponent),\n tuiAsControl(TuiInputExpireComponent),\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: TextMaskConfig = {\n mask: [\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n `/`,\n TUI_DIGIT_REGEXP,\n TUI_DIGIT_REGEXP,\n ],\n pipe: tuiCreateAutoCorrectedExpirePipe(),\n guide: false,\n } as TuiTextMaskOptions as unknown as TextMaskConfig;\n\n 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(): TuiAutofillFieldName {\n return this.autocompleteEnabled ? `cc-exp` : `off`;\n }\n\n onValueChange(value: string): void {\n // @bad TODO: Workaround until mask pipe can replace chars and keep caret position\n // @bad TODO: Think about a solution without mask at all\n if (!this.input?.nativeFocusableElement) {\n return;\n }\n\n if (parseInt(value.slice(0, 2), 10) > 12) {\n value = `12${value.slice(2)}`;\n }\n\n if (value.slice(0, 2) === `00`) {\n value = `01${value.slice(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): void {\n this.updateFocused(focused);\n }\n\n protected getFallbackValue(): string {\n return ``;\n }\n}\n","<tui-primitive-textfield\n tuiValueAccessor\n class=\"t-input\"\n [nativeId]=\"nativeId\"\n [disabled]=\"disabled\"\n [textMask]=\"textMaskOptions\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n [pseudoHover]=\"pseudoHover\"\n [pseudoActive]=\"pseudoActive\"\n [pseudoFocus]=\"pseudoFocus\"\n [value]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (focusedChange)=\"onFocused($event)\"\n>\n <input\n tuiTextfield\n inputmode=\"numeric\"\n placeholder=\"00/00\"\n [attr.autocomplete]=\"autocomplete\"\n />\n <ng-content></ng-content>\n</tui-primitive-textfield>\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":";;;;;;;;;;;;;;AAqCM,MAAO,uBACT,SAAQ,kBAA0B,CAAA;IAsBlC,WAII,CAAA,OAAyB,EACE,iBAAoC,EAAA;AAE/D,QAAA,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QArBtC,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;AAEnB,QAAA,IAAA,CAAA,eAAe,GAAmB;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AA;;kHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mHAApB,oBAAoB,EAAA,YAAA,EAAA,CAHd,uBAAuB,CAAA,EAAA,OAAA,EAAA,CALlC,cAAc;QACd,2BAA2B;QAC3B,4BAA4B;AAC5B,QAAA,sBAAsB,aAGhB,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAExB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EATpB,OAAA,EAAA,CAAA;YACL,cAAc;YACd,2BAA2B;YAC3B,4BAA4B;YAC5B,sBAAsB;AACzB,SAAA,CAAA,EAAA,CAAA,CAAA;4FAIQ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAVhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,cAAc;wBACd,2BAA2B;wBAC3B,4BAA4B;wBAC5B,sBAAsB;AACzB,qBAAA;oBACD,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-commerce",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Extension package for Taiga UI related to commerce, payment systems, currencies etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@angular/core": ">=9.0.0",
|
|
22
22
|
"@angular/forms": ">=9.0.0",
|
|
23
23
|
"@ng-web-apis/common": ">=2.0.0",
|
|
24
|
-
"@taiga-ui/cdk": ">=3.0.0
|
|
25
|
-
"@taiga-ui/core": ">=3.0.0
|
|
26
|
-
"@taiga-ui/i18n": ">=3.0.0
|
|
24
|
+
"@taiga-ui/cdk": ">=3.0.0",
|
|
25
|
+
"@taiga-ui/core": ">=3.0.0",
|
|
26
|
+
"@taiga-ui/i18n": ">=3.0.0",
|
|
27
27
|
"@tinkoff/ng-polymorpheus": ">=4.0.0",
|
|
28
28
|
"angular2-text-mask": ">=9.0.0",
|
|
29
29
|
"rxjs": ">=6.0.0"
|