@taiga-ui/addon-commerce 4.52.0-canary.eb5ffe3 → 4.52.0-canary.facf139
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.
|
@@ -45,11 +45,11 @@ class TuiInputCard {
|
|
|
45
45
|
[src]="image() | tuiIcon"
|
|
46
46
|
/>
|
|
47
47
|
}
|
|
48
|
-
`, isInline: true, styles: ["tui-textfield .t-payment-system:not(:first-child){display:none}tui-textfield .t-payment-system{inline-size:1.5rem}tui-textfield[data-size=l] .t-payment-system{inline-size:2rem}\n"], dependencies: [{ kind: "
|
|
48
|
+
`, isInline: true, styles: ["tui-textfield .t-payment-system:not(:first-child){display:none}tui-textfield .t-payment-system{inline-size:1.5rem}tui-textfield[data-size=l] .t-payment-system{inline-size:2rem}\n"], dependencies: [{ kind: "pipe", type: TuiIconPipe, name: "tuiIcon" }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
49
49
|
}
|
|
50
50
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiInputCard, decorators: [{
|
|
51
51
|
type: Component,
|
|
52
|
-
args: [{ selector: 'input[tuiInputCard]', imports: [
|
|
52
|
+
args: [{ selector: 'input[tuiInputCard]', imports: [TuiIconPipe, TuiTextfieldContent], template: `
|
|
53
53
|
@if (image()) {
|
|
54
54
|
<img
|
|
55
55
|
*tuiTextfieldContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card.mjs","sources":["../../../projects/addon-commerce/components/input-card/input-card.component.ts","../../../projects/addon-commerce/components/input-card/taiga-ui-addon-commerce-components-input-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {outputFromObservable, toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {DefaultValueAccessor, NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {TUI_MASK_CARD} from '@taiga-ui/addon-commerce/constants';\nimport {TUI_PAYMENT_SYSTEM_ICONS} from '@taiga-ui/addon-commerce/tokens';\nimport {tuiGetPaymentSystem} from '@taiga-ui/addon-commerce/utils';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {TuiIconPipe} from '@taiga-ui/core/components/icon';\nimport {TuiTextfieldContent, TuiWithTextfield} from '@taiga-ui/core/components/textfield';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\nimport {distinctUntilChanged, map, skip, startWith, switchMap, timer} from 'rxjs';\n\n@Component({\n selector: 'input[tuiInputCard]',\n imports: [
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-commerce-components-input-card.mjs","sources":["../../../projects/addon-commerce/components/input-card/input-card.component.ts","../../../projects/addon-commerce/components/input-card/taiga-ui-addon-commerce-components-input-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {outputFromObservable, toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {DefaultValueAccessor, NgControl} from '@angular/forms';\nimport {MaskitoDirective} from '@maskito/angular';\nimport {TUI_MASK_CARD} from '@taiga-ui/addon-commerce/constants';\nimport {TUI_PAYMENT_SYSTEM_ICONS} from '@taiga-ui/addon-commerce/tokens';\nimport {tuiGetPaymentSystem} from '@taiga-ui/addon-commerce/utils';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk/constants';\nimport {tuiControlValue} from '@taiga-ui/cdk/observables';\nimport {TuiIconPipe} from '@taiga-ui/core/components/icon';\nimport {TuiTextfieldContent, TuiWithTextfield} from '@taiga-ui/core/components/textfield';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\nimport {distinctUntilChanged, map, skip, startWith, switchMap, timer} from 'rxjs';\n\n@Component({\n selector: 'input[tuiInputCard]',\n imports: [TuiIconPipe, TuiTextfieldContent],\n template: `\n @if (image()) {\n <img\n *tuiTextfieldContent\n alt=\"\"\n class=\"t-payment-system\"\n [src]=\"image() | tuiIcon\"\n />\n }\n `,\n styleUrl: './input-card.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [MaskitoDirective, TuiWithTextfield],\n host: {\n inputmode: 'numeric',\n placeholder: '0000 0000 0000 0000',\n ngSkipHydration: 'true',\n autocomplete: 'cc-number',\n },\n})\nexport class TuiInputCard implements OnInit {\n private readonly icons = inject(TUI_PAYMENT_SYSTEM_ICONS);\n private readonly control = inject(NgControl);\n private readonly value = toSignal(\n timer(0).pipe(switchMap(() => tuiControlValue<string>(this.control))),\n {initialValue: ''},\n );\n\n private readonly accessor = inject(DefaultValueAccessor, {\n self: true,\n optional: true,\n });\n\n protected readonly mask = tuiMaskito(TUI_MASK_CARD);\n protected readonly image = computed(\n (s = tuiGetPaymentSystem(this.value())) => (s && this.icons[s]) || '',\n );\n\n public readonly binChange = outputFromObservable(\n toObservable(this.value).pipe(\n map((v) => (v.length < 6 ? null : v.replace(' ', '').slice(0, 6))),\n startWith(null),\n distinctUntilChanged(),\n skip(1),\n ),\n );\n\n public ngOnInit(): void {\n if (!this.accessor) {\n return;\n }\n\n const onChanges = this.accessor.onChange.bind(this.accessor);\n\n this.accessor.onChange = (value: string) =>\n onChanges(value.replaceAll(CHAR_NO_BREAK_SPACE, ''));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MA6Ca,YAAY,CAAA;AAxBzB,IAAA,WAAA,GAAA;AAyBqB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACxC,QAAA,IAA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,EACjC,QAAA,EAAA;;;;;;;;;AAST,IAAA,CAAA,EAAA,aAAA,EAEc,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAC9C,IAAA,EAAA;AACF,wBAAA,SAAS,EAAE,SAAS;AACpB,wBAAA,WAAW,EAAE,qBAAqB;AAClC,wBAAA,eAAe,EAAE,MAAM;AACvB,wBAAA,YAAY,EAAE,WAAW;AAC5B,qBAAA,EAAA,MAAA,EAAA,CAAA,oLAAA,CAAA,EAAA;;;AC3CL;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-commerce",
|
|
3
|
-
"version": "4.52.0-canary.
|
|
3
|
+
"version": "4.52.0-canary.facf139",
|
|
4
4
|
"description": "Extension package for Taiga UI related to commerce, payment systems, currencies etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -78,6 +78,10 @@
|
|
|
78
78
|
"types": "./components/input-cvc/index.d.ts",
|
|
79
79
|
"default": "./fesm2022/taiga-ui-addon-commerce-components-input-cvc.mjs"
|
|
80
80
|
},
|
|
81
|
+
"./components/input-expire": {
|
|
82
|
+
"types": "./components/input-expire/index.d.ts",
|
|
83
|
+
"default": "./fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs"
|
|
84
|
+
},
|
|
81
85
|
"./components/thumbnail-card": {
|
|
82
86
|
"types": "./components/thumbnail-card/index.d.ts",
|
|
83
87
|
"default": "./fesm2022/taiga-ui-addon-commerce-components-thumbnail-card.mjs"
|
|
@@ -90,10 +94,6 @@
|
|
|
90
94
|
"types": "./pipes/currency/index.d.ts",
|
|
91
95
|
"default": "./fesm2022/taiga-ui-addon-commerce-pipes-currency.mjs"
|
|
92
96
|
},
|
|
93
|
-
"./components/input-expire": {
|
|
94
|
-
"types": "./components/input-expire/index.d.ts",
|
|
95
|
-
"default": "./fesm2022/taiga-ui-addon-commerce-components-input-expire.mjs"
|
|
96
|
-
},
|
|
97
97
|
"./pipes/decimal": {
|
|
98
98
|
"types": "./pipes/decimal/index.d.ts",
|
|
99
99
|
"default": "./fesm2022/taiga-ui-addon-commerce-pipes-decimal.mjs"
|