@recursyve/nice-stripe-kit.v2 12.0.0-beta.2 → 13.0.0-beta.3

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursyve-nice-stripe-kit.v2.mjs","sources":["../../../projects/nice-stripe-kit-v2/src/lib/components/card-element/stripe-card-element.component.ts","../../../projects/nice-stripe-kit-v2/src/lib/nice-stripe-kit.constant.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.form.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.component.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.template.html","../../../projects/nice-stripe-kit-v2/src/lib/nice-stripe-kit.module.ts","../../../projects/nice-stripe-kit-v2/src/public-api.ts","../../../projects/nice-stripe-kit-v2/src/recursyve-nice-stripe-kit.v2.ts"],"sourcesContent":["import { coerceBooleanProperty } from \"@angular/cdk/coercion\";\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostBinding,\n Input,\n Optional,\n Self,\n ViewChild,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { MatFormFieldControl } from \"@angular/material/form-field\";\nimport { StripeCardCvcElement, StripeCardExpiryElement, StripeCardNumberElement } from \"@stripe/stripe-js\";\nimport { Subject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n@Component({\n selector: \"nice-stripe-card-element\",\n template: \"<div class='stripe-element' #element></div>\",\n styleUrls: [\"./stripe-card-element.style.scss\"],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: NiceStripeCardElementComponent\n }\n ]\n})\nexport class NiceStripeCardElementComponent implements AfterViewInit, MatFormFieldControl<string> {\n private _placeholder: string;\n private _focused = false;\n private _required = false;\n private _disabled = false;\n\n @ViewChild(\"element\")\n private elementRef?: ElementRef;\n\n public element?: StripeCardNumberElement | StripeCardExpiryElement | StripeCardCvcElement;\n public value: string;\n public stateChanges = new Subject<void>();\n public empty = true;\n public errorState = false;\n public complete = false;\n\n @HostBinding(\"attr.aria-describedby\")\n public describedBy = \"\";\n\n @HostBinding()\n public id: string = uuidv4();\n\n @Input()\n public set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n this.stateChanges.next();\n }\n\n public get placeholder() {\n return this._placeholder;\n }\n\n @Input()\n public set focused(focused: boolean) {\n this._focused = focused;\n this.stateChanges.next();\n }\n\n public get focused() {\n return this._focused;\n }\n\n @Input()\n public get required() {\n return this._required;\n }\n\n public set required(req) {\n this._required = coerceBooleanProperty(req);\n this.stateChanges.next();\n }\n\n @Input()\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n @HostBinding(\"class.floating\")\n public get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n\n public setDescribedByIds(ids: string[]) {\n this.describedBy = ids.join(\" \");\n }\n\n constructor(@Optional() @Self() public ngControl: NgControl) {\n }\n\n public async ngAfterViewInit() {\n if (this.elementRef) {\n this.empty = !this.value;\n }\n }\n\n public async init(element: StripeCardNumberElement | StripeCardExpiryElement | StripeCardCvcElement) {\n this.element = element;\n this.element.mount(this.elementRef.nativeElement);\n this.stateChanges.next();\n\n this.element.update({\n placeholder: this.placeholder\n });\n\n (this.element as StripeCardNumberElement).on(\"blur\", () => {\n this.focused = false;\n if (this.empty && this._required) {\n this.errorState = true;\n }\n });\n (this.element as StripeCardNumberElement).on(\"focus\", () => {\n this.focused = true;\n });\n\n (this.element as StripeCardNumberElement).on(\"change\", event => {\n this.empty = event.empty;\n this.errorState = !!event.error;\n this.complete = event.complete;\n this.stateChanges.next();\n });\n }\n\n public markAsTouched(): void {\n this.errorState = !!this.empty;\n this.stateChanges.next();\n }\n\n public onContainerClick(event: MouseEvent): void {\n }\n}\n","import { InjectionToken } from \"@angular/core\";\n\nexport const NICE_STRIPE_OPTIONS = new InjectionToken(\"nice_stripe_options\");\n","import { Control, Required } from \"@recursyve/ngx-form-generator\";\n\nexport class StripeForm {\n @Control()\n @Required()\n public name: string;\n}\n","import { Component, Inject, Input, OnDestroy, OnInit, Optional, ViewChild, ViewEncapsulation } from \"@angular/core\";\nimport { MatFormFieldAppearance } from \"@angular/material/form-field\";\nimport { TranslateService } from \"@ngx-translate/core\";\nimport { GeneratedFormGroup, ngxFormGeneratorFactory } from \"@recursyve/ngx-form-generator\";\nimport { niceAnimations } from \"@recursyve/nice-ui-kit.v2\";\nimport {\n StripeCardCvcElement,\n StripeCardExpiryElement,\n StripeCardNumberElement,\n StripeCardNumberElementOptions,\n StripeElements\n} from \"@stripe/stripe-js\";\nimport { StripeService } from \"ngx-stripe\";\nimport { map } from \"rxjs/operators\";\nimport { NICE_STRIPE_OPTIONS } from \"../../nice-stripe-kit.constant\";\nimport { NiceStripeKitOptions } from \"../../nice-stripe-kit.options\";\nimport { NiceStripeCardElementComponent } from \"../card-element/stripe-card-element.component\";\nimport { StripeForm } from \"./stripe-card-form.form\";\n\n@Component({\n selector: \"nice-stripe-card-form\",\n templateUrl: \"stripe-card-form.template.html\",\n styleUrls: [\"stripe-card-form.style.scss\"],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: GeneratedFormGroup,\n useFactory: ngxFormGeneratorFactory(StripeForm)\n }\n ],\n animations: niceAnimations\n})\nexport class NiceStripeCardFormComponent implements OnInit, OnDestroy {\n @Input()\n public appearance: MatFormFieldAppearance;\n\n @Input()\n public showIcons = false;\n\n @ViewChild(\"cardNumber\")\n public cardNumberInput: NiceStripeCardElementComponent;\n\n @ViewChild(\"cardExpiry\")\n public cardExpiryInput: NiceStripeCardElementComponent;\n\n @ViewChild(\"cardCvc\")\n public cardCvcInput: NiceStripeCardElementComponent;\n\n public cardNumberElement: StripeCardNumberElement;\n public cardNumberError: string;\n public cardExpiryElement: StripeCardExpiryElement;\n public cardExpiryError: string;\n public cardCvcElement: StripeCardCvcElement;\n public cardCvcError: string;\n\n public stripeOptions: StripeCardNumberElementOptions;\n\n private elements: StripeElements;\n\n public get isValid(): boolean {\n return this.cardNumberInput.complete &&\n this.cardExpiryInput.complete &&\n this.cardCvcInput.complete &&\n this.formGroup.valid;\n }\n\n public get cardToken(): Promise<string> {\n if (!this.isValid) {\n return null;\n }\n\n return this.stripeService.createToken(this.cardNumberElement, {\n name: this.formGroup.get(\"name\").value\n }).pipe(\n map(x => x?.token?.id)\n ).toPromise();\n }\n\n constructor(\n @Optional() @Inject(NICE_STRIPE_OPTIONS) public options: NiceStripeKitOptions,\n public formGroup: GeneratedFormGroup<StripeForm>,\n private stripeService: StripeService,\n private translateService: TranslateService\n ) {\n }\n\n public async ngOnInit(): Promise<void> {\n this.stripeOptions = {\n placeholder: \"\",\n style: {\n base: this.options.styling\n }\n };\n\n this.elements = await this.stripeService.elements({\n locale: this.translateService.currentLang as any,\n fonts: this.options?.fonts ?? []\n }).toPromise();\n\n this.initCardNumber();\n this.initCardExpiry();\n this.initCardCvc();\n }\n\n public initCardNumber() {\n this.cardNumberElement = this.elements.create(\"cardNumber\", {\n ...this.stripeOptions,\n });\n this.cardNumberElement.on(\"change\", event => {\n this.cardNumberError = event.error ? event.error.message : null;\n });\n this.cardNumberInput.init(this.cardNumberElement);\n }\n\n public initCardExpiry() {\n this.cardExpiryElement = this.elements.create(\"cardExpiry\", {\n ...this.stripeOptions,\n });\n this.cardExpiryElement.on(\"change\", event => {\n this.cardExpiryError = event.error ? event.error.message : null;\n });\n this.cardExpiryInput.init(this.cardExpiryElement);\n }\n\n public initCardCvc() {\n this.cardCvcElement = this.elements.create(\"cardCvc\", {\n ...this.stripeOptions,\n });\n this.cardCvcElement.on(\"change\", event => {\n this.cardCvcError = event.error ? event.error.message : null;\n });\n this.cardCvcInput.init(this.cardCvcElement);\n }\n\n public ngOnDestroy(): void {\n this.cardNumberElement.unmount();\n this.cardExpiryElement.unmount();\n this.cardCvcElement.unmount();\n }\n\n public patchName(name: string) {\n this.formGroup.get(\"name\").patchValue(name);\n }\n\n public markAllAsTouched(): void {\n this.formGroup.markAllAsTouched();\n this.cardCvcInput.markAsTouched();\n this.cardNumberInput.markAsTouched();\n this.cardExpiryInput.markAsTouched();\n }\n\n private getYear(): number {\n const date = new Date();\n return +date.getFullYear().toString().substr(-2);\n }\n}\n","<mat-list [formGroup]=\"formGroup\">\n <mat-list-item>\n <mat-form-field [appearance]=\"appearance\" niceControlStatus floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.name_on_card.label\" | translate}}</mat-label>\n <input [placeholder]=\"'nice_ui_kit.stripe.name_on_card.placeholder' | translate\" matInput type=\"text\"\n formControlName=\"name\" required/>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle text-accent form-icons\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div fxLayout=\"column\" class=\"w-full\">\n <div fxLayout=\"row\">\n <mat-form-field fxFlex=\"100\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate}}</mat-label>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card text-accent form-icons\"></i>\n </div>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.card_number.placeholder' | translate\"\n #cardNumber required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardNumberError\">{{ cardNumberError }}</mat-error>\n </mat-form-field>\n </div>\n <div fxLayout=\"row\" fxLayoutGap=\"15px\">\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.expiration.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.expiration.placeholder' | translate\"\n #cardExpiry required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardExpiryError\">{{ cardExpiryError }}</mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.cvc.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.cvc.placeholder' | translate\" #cardCvc\n required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardCvcError\">{{ cardCvcError }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n </mat-list-item>\n</mat-list>\n","import { CommonModule } from \"@angular/common\";\nimport { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { ExtendedModule, FlexModule } from \"@angular/flex-layout\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatListModule } from \"@angular/material/list\";\nimport { TranslateModule } from \"@ngx-translate/core\";\nimport { NiceFormErrorModule } from \"@recursyve/nice-ui-kit.v2\";\nimport { NgxStripeModule } from \"ngx-stripe\";\nimport { NiceStripeCardElementComponent } from \"./components/card-element/stripe-card-element.component\";\nimport { NiceStripeCardFormComponent } from \"./components/card-form/stripe-card-form.component\";\nimport { NICE_STRIPE_OPTIONS } from \"./nice-stripe-kit.constant\";\nimport { NiceStripeKitOptions } from \"./nice-stripe-kit.options\";\n\n@NgModule({\n imports: [\n FlexModule,\n NgxStripeModule,\n ReactiveFormsModule,\n TranslateModule,\n\n MatFormFieldModule,\n MatInputModule,\n MatListModule,\n NiceFormErrorModule,\n MatButtonModule,\n CommonModule,\n ExtendedModule\n ],\n declarations: [\n NiceStripeCardElementComponent,\n NiceStripeCardFormComponent\n ],\n exports: [\n NiceStripeCardFormComponent\n ]\n})\nexport class NiceStripeModule {\n public static forRoot(options?: NiceStripeKitOptions): ModuleWithProviders<NiceStripeModule> {\n return {\n ngModule: NiceStripeModule,\n providers: [\n {\n provide: NICE_STRIPE_OPTIONS,\n useValue: options\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of nice-stripe-kit\n */\n\nexport * from \"./lib/nice-stripe-kit.module\";\nexport * from \"./lib/components/card-element/stripe-card-element.component\";\nexport * from \"./lib/components/card-form/stripe-card-form.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Ba,8BAA8B;IAuEvC,YAAuC,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QArEnD,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAOnB,iBAAY,GAAG,IAAI,OAAO,EAAQ,CAAC;QACnC,UAAK,GAAG,IAAI,CAAC;QACb,eAAU,GAAG,KAAK,CAAC;QACnB,aAAQ,GAAG,KAAK,CAAC;QAGjB,gBAAW,GAAG,EAAE,CAAC;QAGjB,OAAE,GAAWA,EAAM,EAAE,CAAC;KAoD5B;IAlDD,IACW,WAAW,CAAC,WAAmB;QACtC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC5B;IAED,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;KAC5B;IAED,IACW,OAAO,CAAC,OAAgB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC5B;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;KACxB;IAED,IACW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;KACzB;IAED,IAAW,QAAQ,CAAC,GAAG;QACnB,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,GAAG,CA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AAS;uBAAC,YAAY;gBAIhB,eAAe;sBADrB,SAAS;uBAAC,YAAY;gBAIhB,YAAY;sBADlB,SAAS;uBAAC,SAAS;;;MENX,gBAAgB;IAClB,OAAO,OAAO,CAAC,OAA8B;QAChD,OAAO;YACH,QAAQ,EAAE,gBAAgB;YAC1B,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,OAAO;iBACpB;aACJ;SACJ,CAAC;KACL;;6GAXQ,gBAAgB;8GAAhB,gBAAgB,iBAPrB,8BAA8B;QAC9B,2BAA2B,aAf3B,UAAU;QACV,eAAe;QACf,mBAAmB;QACnB,eAAe;QAEf,kBAAkB;QAClB,cAAc;QACd,aAAa;QACb,mBAAmB;QACnB,eAAe;QACf,YAAY;QACZ,cAAc,aAOd,2BAA2B;8GAGtB,gBAAgB,YAtBhB;YACL,UAAU;YACV,eAAe;YACf,mBAAmB;YACnB,eAAe;YAEf,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,mBAAmB;YACnB,eAAe;YACf,YAAY;YACZ,cAAc;SACjB;2FASQ,gBAAgB;kBAvB5B,QAAQ;mBAAC;oBACN,OAAO,EAAE;wBACL,UAAU;wBACV,eAAe;wBACf,mBAAmB;wBACnB,eAAe;wBAEf,kBAAkB;wBAClB,cAAc;wBACd,aAAa;wBACb,mBAAmB;wBACnB,eAAe;wBACf,YAAY;wBACZ,cAAc;qBACjB;oBACD,YAAY,EAAE;wBACV,8BAA8B;wBAC9B,2BAA2B;qBAC9B;oBACD,OAAO,EAAE;wBACL,2BAA2B;qBAC9B;iBACJ;;;ACtCD;;;;ACAA;;;;;;"}
@@ -0,0 +1,354 @@
1
+ import * as i10 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ViewEncapsulation, Optional, Self, ViewChild, HostBinding, Input, InjectionToken, Inject, NgModule } from '@angular/core';
5
+ import * as i11 from '@angular/flex-layout';
6
+ import { FlexModule, ExtendedModule } from '@angular/flex-layout';
7
+ import * as i7 from '@angular/forms';
8
+ import { ReactiveFormsModule } from '@angular/forms';
9
+ import { MatButtonModule } from '@angular/material/button';
10
+ import * as i5 from '@angular/material/form-field';
11
+ import { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
12
+ import * as i9 from '@angular/material/input';
13
+ import { MatInputModule } from '@angular/material/input';
14
+ import * as i4 from '@angular/material/list';
15
+ import { MatListModule } from '@angular/material/list';
16
+ import * as i3 from '@ngx-translate/core';
17
+ import { TranslateModule } from '@ngx-translate/core';
18
+ import * as i8 from '@recursyve/nice-ui-kit.v2';
19
+ import { niceAnimations, NiceFormErrorModule } from '@recursyve/nice-ui-kit.v2';
20
+ import * as i2 from 'ngx-stripe';
21
+ import { NgxStripeModule } from 'ngx-stripe';
22
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
23
+ import { Subject } from 'rxjs';
24
+ import { v4 } from 'uuid';
25
+ import * as i1 from '@recursyve/ngx-form-generator';
26
+ import { Control, Required, GeneratedFormGroup, ngxFormGeneratorFactory } from '@recursyve/ngx-form-generator';
27
+ import { map } from 'rxjs/operators';
28
+ import { __decorate, __metadata } from 'tslib';
29
+
30
+ class NiceStripeCardElementComponent {
31
+ constructor(ngControl) {
32
+ this.ngControl = ngControl;
33
+ this._focused = false;
34
+ this._required = false;
35
+ this._disabled = false;
36
+ this.stateChanges = new Subject();
37
+ this.empty = true;
38
+ this.errorState = false;
39
+ this.complete = false;
40
+ this.describedBy = "";
41
+ this.id = v4();
42
+ }
43
+ set placeholder(placeholder) {
44
+ this._placeholder = placeholder;
45
+ this.stateChanges.next();
46
+ }
47
+ get placeholder() {
48
+ return this._placeholder;
49
+ }
50
+ set focused(focused) {
51
+ this._focused = focused;
52
+ this.stateChanges.next();
53
+ }
54
+ get focused() {
55
+ return this._focused;
56
+ }
57
+ get required() {
58
+ return this._required;
59
+ }
60
+ set required(req) {
61
+ this._required = coerceBooleanProperty(req);
62
+ this.stateChanges.next();
63
+ }
64
+ get disabled() {
65
+ return this._disabled;
66
+ }
67
+ set disabled(value) {
68
+ this._disabled = coerceBooleanProperty(value);
69
+ this.stateChanges.next();
70
+ }
71
+ get shouldLabelFloat() {
72
+ return this.focused || !this.empty;
73
+ }
74
+ setDescribedByIds(ids) {
75
+ this.describedBy = ids.join(" ");
76
+ }
77
+ async ngAfterViewInit() {
78
+ if (this.elementRef) {
79
+ this.empty = !this.value;
80
+ }
81
+ }
82
+ async init(element) {
83
+ this.element = element;
84
+ this.element.mount(this.elementRef.nativeElement);
85
+ this.stateChanges.next();
86
+ this.element.update({
87
+ placeholder: this.placeholder
88
+ });
89
+ this.element.on("blur", () => {
90
+ this.focused = false;
91
+ if (this.empty && this._required) {
92
+ this.errorState = true;
93
+ }
94
+ });
95
+ this.element.on("focus", () => {
96
+ this.focused = true;
97
+ });
98
+ this.element.on("change", event => {
99
+ this.empty = event.empty;
100
+ this.errorState = !!event.error;
101
+ this.complete = event.complete;
102
+ this.stateChanges.next();
103
+ });
104
+ }
105
+ markAsTouched() {
106
+ this.errorState = !!this.empty;
107
+ this.stateChanges.next();
108
+ }
109
+ onContainerClick(event) {
110
+ }
111
+ }
112
+ NiceStripeCardElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardElementComponent, deps: [{ token: i7.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
113
+ NiceStripeCardElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: NiceStripeCardElementComponent, selector: "nice-stripe-card-element", inputs: { placeholder: "placeholder", focused: "focused", required: "required", disabled: "disabled" }, host: { properties: { "attr.aria-describedby": "this.describedBy", "id": "this.id", "class.floating": "this.shouldLabelFloat" } }, providers: [
114
+ {
115
+ provide: MatFormFieldControl,
116
+ useExisting: NiceStripeCardElementComponent
117
+ }
118
+ ], viewQueries: [{ propertyName: "elementRef", first: true, predicate: ["element"], descendants: true }], ngImport: i0, template: "<div class='stripe-element' #element></div>", isInline: true, styles: ["nice-stripe-card-element .stripe-element{height:15px}\n"], encapsulation: i0.ViewEncapsulation.None });
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
120
+ type: Component,
121
+ args: [{ selector: "nice-stripe-card-element", template: "<div class='stripe-element' #element></div>", encapsulation: ViewEncapsulation.None, providers: [
122
+ {
123
+ provide: MatFormFieldControl,
124
+ useExisting: NiceStripeCardElementComponent
125
+ }
126
+ ], styles: ["nice-stripe-card-element .stripe-element{height:15px}\n"] }]
127
+ }], ctorParameters: function () { return [{ type: i7.NgControl, decorators: [{
128
+ type: Optional
129
+ }, {
130
+ type: Self
131
+ }] }]; }, propDecorators: { elementRef: [{
132
+ type: ViewChild,
133
+ args: ["element"]
134
+ }], describedBy: [{
135
+ type: HostBinding,
136
+ args: ["attr.aria-describedby"]
137
+ }], id: [{
138
+ type: HostBinding
139
+ }], placeholder: [{
140
+ type: Input
141
+ }], focused: [{
142
+ type: Input
143
+ }], required: [{
144
+ type: Input
145
+ }], disabled: [{
146
+ type: Input
147
+ }], shouldLabelFloat: [{
148
+ type: HostBinding,
149
+ args: ["class.floating"]
150
+ }] } });
151
+
152
+ const NICE_STRIPE_OPTIONS = new InjectionToken("nice_stripe_options");
153
+
154
+ class StripeForm {
155
+ }
156
+ __decorate([
157
+ Control(),
158
+ Required(),
159
+ __metadata("design:type", String)
160
+ ], StripeForm.prototype, "name", void 0);
161
+
162
+ class NiceStripeCardFormComponent {
163
+ constructor(options, formGroup, stripeService, translateService) {
164
+ this.options = options;
165
+ this.formGroup = formGroup;
166
+ this.stripeService = stripeService;
167
+ this.translateService = translateService;
168
+ this.showIcons = false;
169
+ }
170
+ get isValid() {
171
+ return this.cardNumberInput.complete &&
172
+ this.cardExpiryInput.complete &&
173
+ this.cardCvcInput.complete &&
174
+ this.formGroup.valid;
175
+ }
176
+ get cardToken() {
177
+ if (!this.isValid) {
178
+ return null;
179
+ }
180
+ return this.stripeService.createToken(this.cardNumberElement, {
181
+ name: this.formGroup.get("name").value
182
+ }).pipe(map(x => x?.token?.id)).toPromise();
183
+ }
184
+ async ngOnInit() {
185
+ this.stripeOptions = {
186
+ placeholder: "",
187
+ style: {
188
+ base: this.options.styling
189
+ }
190
+ };
191
+ this.elements = await this.stripeService.elements({
192
+ locale: this.translateService.currentLang,
193
+ fonts: this.options?.fonts ?? []
194
+ }).toPromise();
195
+ this.initCardNumber();
196
+ this.initCardExpiry();
197
+ this.initCardCvc();
198
+ }
199
+ initCardNumber() {
200
+ this.cardNumberElement = this.elements.create("cardNumber", {
201
+ ...this.stripeOptions,
202
+ });
203
+ this.cardNumberElement.on("change", event => {
204
+ this.cardNumberError = event.error ? event.error.message : null;
205
+ });
206
+ this.cardNumberInput.init(this.cardNumberElement);
207
+ }
208
+ initCardExpiry() {
209
+ this.cardExpiryElement = this.elements.create("cardExpiry", {
210
+ ...this.stripeOptions,
211
+ });
212
+ this.cardExpiryElement.on("change", event => {
213
+ this.cardExpiryError = event.error ? event.error.message : null;
214
+ });
215
+ this.cardExpiryInput.init(this.cardExpiryElement);
216
+ }
217
+ initCardCvc() {
218
+ this.cardCvcElement = this.elements.create("cardCvc", {
219
+ ...this.stripeOptions,
220
+ });
221
+ this.cardCvcElement.on("change", event => {
222
+ this.cardCvcError = event.error ? event.error.message : null;
223
+ });
224
+ this.cardCvcInput.init(this.cardCvcElement);
225
+ }
226
+ ngOnDestroy() {
227
+ this.cardNumberElement.unmount();
228
+ this.cardExpiryElement.unmount();
229
+ this.cardCvcElement.unmount();
230
+ }
231
+ patchName(name) {
232
+ this.formGroup.get("name").patchValue(name);
233
+ }
234
+ markAllAsTouched() {
235
+ this.formGroup.markAllAsTouched();
236
+ this.cardCvcInput.markAsTouched();
237
+ this.cardNumberInput.markAsTouched();
238
+ this.cardExpiryInput.markAsTouched();
239
+ }
240
+ getYear() {
241
+ const date = new Date();
242
+ return +date.getFullYear().toString().substr(-2);
243
+ }
244
+ }
245
+ NiceStripeCardFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardFormComponent, deps: [{ token: NICE_STRIPE_OPTIONS, optional: true }, { token: i1.GeneratedFormGroup }, { token: i2.StripeService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
246
+ NiceStripeCardFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: NiceStripeCardFormComponent, selector: "nice-stripe-card-form", inputs: { appearance: "appearance", showIcons: "showIcons" }, providers: [
247
+ {
248
+ provide: GeneratedFormGroup,
249
+ useFactory: ngxFormGeneratorFactory(StripeForm)
250
+ }
251
+ ], viewQueries: [{ propertyName: "cardNumberInput", first: true, predicate: ["cardNumber"], descendants: true }, { propertyName: "cardExpiryInput", first: true, predicate: ["cardExpiry"], descendants: true }, { propertyName: "cardCvcInput", first: true, predicate: ["cardCvc"], descendants: true }], ngImport: i0, template: "<mat-list [formGroup]=\"formGroup\">\n <mat-list-item>\n <mat-form-field [appearance]=\"appearance\" niceControlStatus floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.name_on_card.label\" | translate}}</mat-label>\n <input [placeholder]=\"'nice_ui_kit.stripe.name_on_card.placeholder' | translate\" matInput type=\"text\"\n formControlName=\"name\" required/>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle text-accent form-icons\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div fxLayout=\"column\" class=\"w-full\">\n <div fxLayout=\"row\">\n <mat-form-field fxFlex=\"100\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate}}</mat-label>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card text-accent form-icons\"></i>\n </div>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.card_number.placeholder' | translate\"\n #cardNumber required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardNumberError\">{{ cardNumberError }}</mat-error>\n </mat-form-field>\n </div>\n <div fxLayout=\"row\" fxLayoutGap=\"15px\">\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.expiration.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.expiration.placeholder' | translate\"\n #cardExpiry required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardExpiryError\">{{ cardExpiryError }}</mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.cvc.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.cvc.placeholder' | translate\" #cardCvc\n required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardCvcError\">{{ cardCvcError }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n </mat-list-item>\n</mat-list>\n", styles: ["nice-stripe-card-form mat-list-item{height:auto!important}nice-stripe-card-form .form-icons{font-size:24px!important;width:24px!important;height:24px!important;line-height:24px!important}\n"], components: [{ type: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: NiceStripeCardElementComponent, selector: "nice-stripe-card-element", inputs: ["placeholder", "focused", "required", "disabled"] }], directives: [{ type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.NiceControlStatusDirective, selector: "[niceControlStatus]" }, { type: i5.MatLabel, selector: "mat-label" }, { type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.MatPrefix, selector: "[matPrefix]" }, { type: i11.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i11.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5.MatError, selector: "mat-error", inputs: ["id"] }, { type: i11.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }], pipes: { "translate": i3.TranslatePipe }, animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
253
+ type: Component,
254
+ args: [{ selector: "nice-stripe-card-form", encapsulation: ViewEncapsulation.None, providers: [
255
+ {
256
+ provide: GeneratedFormGroup,
257
+ useFactory: ngxFormGeneratorFactory(StripeForm)
258
+ }
259
+ ], animations: niceAnimations, template: "<mat-list [formGroup]=\"formGroup\">\n <mat-list-item>\n <mat-form-field [appearance]=\"appearance\" niceControlStatus floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.name_on_card.label\" | translate}}</mat-label>\n <input [placeholder]=\"'nice_ui_kit.stripe.name_on_card.placeholder' | translate\" matInput type=\"text\"\n formControlName=\"name\" required/>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle text-accent form-icons\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div fxLayout=\"column\" class=\"w-full\">\n <div fxLayout=\"row\">\n <mat-form-field fxFlex=\"100\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate}}</mat-label>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card text-accent form-icons\"></i>\n </div>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.card_number.placeholder' | translate\"\n #cardNumber required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardNumberError\">{{ cardNumberError }}</mat-error>\n </mat-form-field>\n </div>\n <div fxLayout=\"row\" fxLayoutGap=\"15px\">\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.expiration.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.expiration.placeholder' | translate\"\n #cardExpiry required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardExpiryError\">{{ cardExpiryError }}</mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.cvc.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.cvc.placeholder' | translate\" #cardCvc\n required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardCvcError\">{{ cardCvcError }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n </mat-list-item>\n</mat-list>\n", styles: ["nice-stripe-card-form mat-list-item{height:auto!important}nice-stripe-card-form .form-icons{font-size:24px!important;width:24px!important;height:24px!important;line-height:24px!important}\n"] }]
260
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
261
+ type: Optional
262
+ }, {
263
+ type: Inject,
264
+ args: [NICE_STRIPE_OPTIONS]
265
+ }] }, { type: i1.GeneratedFormGroup }, { type: i2.StripeService }, { type: i3.TranslateService }]; }, propDecorators: { appearance: [{
266
+ type: Input
267
+ }], showIcons: [{
268
+ type: Input
269
+ }], cardNumberInput: [{
270
+ type: ViewChild,
271
+ args: ["cardNumber"]
272
+ }], cardExpiryInput: [{
273
+ type: ViewChild,
274
+ args: ["cardExpiry"]
275
+ }], cardCvcInput: [{
276
+ type: ViewChild,
277
+ args: ["cardCvc"]
278
+ }] } });
279
+
280
+ class NiceStripeModule {
281
+ static forRoot(options) {
282
+ return {
283
+ ngModule: NiceStripeModule,
284
+ providers: [
285
+ {
286
+ provide: NICE_STRIPE_OPTIONS,
287
+ useValue: options
288
+ }
289
+ ]
290
+ };
291
+ }
292
+ }
293
+ NiceStripeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
294
+ NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
295
+ NiceStripeCardFormComponent], imports: [FlexModule,
296
+ NgxStripeModule,
297
+ ReactiveFormsModule,
298
+ TranslateModule,
299
+ MatFormFieldModule,
300
+ MatInputModule,
301
+ MatListModule,
302
+ NiceFormErrorModule,
303
+ MatButtonModule,
304
+ CommonModule,
305
+ ExtendedModule], exports: [NiceStripeCardFormComponent] });
306
+ NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, imports: [[
307
+ FlexModule,
308
+ NgxStripeModule,
309
+ ReactiveFormsModule,
310
+ TranslateModule,
311
+ MatFormFieldModule,
312
+ MatInputModule,
313
+ MatListModule,
314
+ NiceFormErrorModule,
315
+ MatButtonModule,
316
+ CommonModule,
317
+ ExtendedModule
318
+ ]] });
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, decorators: [{
320
+ type: NgModule,
321
+ args: [{
322
+ imports: [
323
+ FlexModule,
324
+ NgxStripeModule,
325
+ ReactiveFormsModule,
326
+ TranslateModule,
327
+ MatFormFieldModule,
328
+ MatInputModule,
329
+ MatListModule,
330
+ NiceFormErrorModule,
331
+ MatButtonModule,
332
+ CommonModule,
333
+ ExtendedModule
334
+ ],
335
+ declarations: [
336
+ NiceStripeCardElementComponent,
337
+ NiceStripeCardFormComponent
338
+ ],
339
+ exports: [
340
+ NiceStripeCardFormComponent
341
+ ]
342
+ }]
343
+ }] });
344
+
345
+ /*
346
+ * Public API Surface of nice-stripe-kit
347
+ */
348
+
349
+ /**
350
+ * Generated bundle index. Do not edit.
351
+ */
352
+
353
+ export { NiceStripeCardElementComponent, NiceStripeCardFormComponent, NiceStripeModule };
354
+ //# sourceMappingURL=recursyve-nice-stripe-kit.v2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursyve-nice-stripe-kit.v2.mjs","sources":["../../../projects/nice-stripe-kit-v2/src/lib/components/card-element/stripe-card-element.component.ts","../../../projects/nice-stripe-kit-v2/src/lib/nice-stripe-kit.constant.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.form.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.component.ts","../../../projects/nice-stripe-kit-v2/src/lib/components/card-form/stripe-card-form.template.html","../../../projects/nice-stripe-kit-v2/src/lib/nice-stripe-kit.module.ts","../../../projects/nice-stripe-kit-v2/src/public-api.ts","../../../projects/nice-stripe-kit-v2/src/recursyve-nice-stripe-kit.v2.ts"],"sourcesContent":["import { coerceBooleanProperty } from \"@angular/cdk/coercion\";\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostBinding,\n Input,\n Optional,\n Self,\n ViewChild,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { MatFormFieldControl } from \"@angular/material/form-field\";\nimport { StripeCardCvcElement, StripeCardExpiryElement, StripeCardNumberElement } from \"@stripe/stripe-js\";\nimport { Subject } from \"rxjs\";\nimport { v4 as uuidv4 } from \"uuid\";\n\n@Component({\n selector: \"nice-stripe-card-element\",\n template: \"<div class='stripe-element' #element></div>\",\n styleUrls: [\"./stripe-card-element.style.scss\"],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: NiceStripeCardElementComponent\n }\n ]\n})\nexport class NiceStripeCardElementComponent implements AfterViewInit, MatFormFieldControl<string> {\n private _placeholder: string;\n private _focused = false;\n private _required = false;\n private _disabled = false;\n\n @ViewChild(\"element\")\n private elementRef?: ElementRef;\n\n public element?: StripeCardNumberElement | StripeCardExpiryElement | StripeCardCvcElement;\n public value: string;\n public stateChanges = new Subject<void>();\n public empty = true;\n public errorState = false;\n public complete = false;\n\n @HostBinding(\"attr.aria-describedby\")\n public describedBy = \"\";\n\n @HostBinding()\n public id: string = uuidv4();\n\n @Input()\n public set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n this.stateChanges.next();\n }\n\n public get placeholder() {\n return this._placeholder;\n }\n\n @Input()\n public set focused(focused: boolean) {\n this._focused = focused;\n this.stateChanges.next();\n }\n\n public get focused() {\n return this._focused;\n }\n\n @Input()\n public get required() {\n return this._required;\n }\n\n public set required(req) {\n this._required = coerceBooleanProperty(req);\n this.stateChanges.next();\n }\n\n @Input()\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n @HostBinding(\"class.floating\")\n public get shouldLabelFloat() {\n return this.focused || !this.empty;\n }\n\n public setDescribedByIds(ids: string[]) {\n this.describedBy = ids.join(\" \");\n }\n\n constructor(@Optional() @Self() public ngControl: NgControl) {\n }\n\n public async ngAfterViewInit() {\n if (this.elementRef) {\n this.empty = !this.value;\n }\n }\n\n public async init(element: StripeCardNumberElement | StripeCardExpiryElement | StripeCardCvcElement) {\n this.element = element;\n this.element.mount(this.elementRef.nativeElement);\n this.stateChanges.next();\n\n this.element.update({\n placeholder: this.placeholder\n });\n\n (this.element as StripeCardNumberElement).on(\"blur\", () => {\n this.focused = false;\n if (this.empty && this._required) {\n this.errorState = true;\n }\n });\n (this.element as StripeCardNumberElement).on(\"focus\", () => {\n this.focused = true;\n });\n\n (this.element as StripeCardNumberElement).on(\"change\", event => {\n this.empty = event.empty;\n this.errorState = !!event.error;\n this.complete = event.complete;\n this.stateChanges.next();\n });\n }\n\n public markAsTouched(): void {\n this.errorState = !!this.empty;\n this.stateChanges.next();\n }\n\n public onContainerClick(event: MouseEvent): void {\n }\n}\n","import { InjectionToken } from \"@angular/core\";\n\nexport const NICE_STRIPE_OPTIONS = new InjectionToken(\"nice_stripe_options\");\n","import { Control, Required } from \"@recursyve/ngx-form-generator\";\n\nexport class StripeForm {\n @Control()\n @Required()\n public name: string;\n}\n","import { Component, Inject, Input, OnDestroy, OnInit, Optional, ViewChild, ViewEncapsulation } from \"@angular/core\";\nimport { MatFormFieldAppearance } from \"@angular/material/form-field\";\nimport { TranslateService } from \"@ngx-translate/core\";\nimport { GeneratedFormGroup, ngxFormGeneratorFactory } from \"@recursyve/ngx-form-generator\";\nimport { niceAnimations } from \"@recursyve/nice-ui-kit.v2\";\nimport {\n StripeCardCvcElement,\n StripeCardExpiryElement,\n StripeCardNumberElement,\n StripeCardNumberElementOptions,\n StripeElements\n} from \"@stripe/stripe-js\";\nimport { StripeService } from \"ngx-stripe\";\nimport { map } from \"rxjs/operators\";\nimport { NICE_STRIPE_OPTIONS } from \"../../nice-stripe-kit.constant\";\nimport { NiceStripeKitOptions } from \"../../nice-stripe-kit.options\";\nimport { NiceStripeCardElementComponent } from \"../card-element/stripe-card-element.component\";\nimport { StripeForm } from \"./stripe-card-form.form\";\n\n@Component({\n selector: \"nice-stripe-card-form\",\n templateUrl: \"stripe-card-form.template.html\",\n styleUrls: [\"stripe-card-form.style.scss\"],\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: GeneratedFormGroup,\n useFactory: ngxFormGeneratorFactory(StripeForm)\n }\n ],\n animations: niceAnimations\n})\nexport class NiceStripeCardFormComponent implements OnInit, OnDestroy {\n @Input()\n public appearance: MatFormFieldAppearance;\n\n @Input()\n public showIcons = false;\n\n @ViewChild(\"cardNumber\")\n public cardNumberInput: NiceStripeCardElementComponent;\n\n @ViewChild(\"cardExpiry\")\n public cardExpiryInput: NiceStripeCardElementComponent;\n\n @ViewChild(\"cardCvc\")\n public cardCvcInput: NiceStripeCardElementComponent;\n\n public cardNumberElement: StripeCardNumberElement;\n public cardNumberError: string;\n public cardExpiryElement: StripeCardExpiryElement;\n public cardExpiryError: string;\n public cardCvcElement: StripeCardCvcElement;\n public cardCvcError: string;\n\n public stripeOptions: StripeCardNumberElementOptions;\n\n private elements: StripeElements;\n\n public get isValid(): boolean {\n return this.cardNumberInput.complete &&\n this.cardExpiryInput.complete &&\n this.cardCvcInput.complete &&\n this.formGroup.valid;\n }\n\n public get cardToken(): Promise<string> {\n if (!this.isValid) {\n return null;\n }\n\n return this.stripeService.createToken(this.cardNumberElement, {\n name: this.formGroup.get(\"name\").value\n }).pipe(\n map(x => x?.token?.id)\n ).toPromise();\n }\n\n constructor(\n @Optional() @Inject(NICE_STRIPE_OPTIONS) public options: NiceStripeKitOptions,\n public formGroup: GeneratedFormGroup<StripeForm>,\n private stripeService: StripeService,\n private translateService: TranslateService\n ) {\n }\n\n public async ngOnInit(): Promise<void> {\n this.stripeOptions = {\n placeholder: \"\",\n style: {\n base: this.options.styling\n }\n };\n\n this.elements = await this.stripeService.elements({\n locale: this.translateService.currentLang as any,\n fonts: this.options?.fonts ?? []\n }).toPromise();\n\n this.initCardNumber();\n this.initCardExpiry();\n this.initCardCvc();\n }\n\n public initCardNumber() {\n this.cardNumberElement = this.elements.create(\"cardNumber\", {\n ...this.stripeOptions,\n });\n this.cardNumberElement.on(\"change\", event => {\n this.cardNumberError = event.error ? event.error.message : null;\n });\n this.cardNumberInput.init(this.cardNumberElement);\n }\n\n public initCardExpiry() {\n this.cardExpiryElement = this.elements.create(\"cardExpiry\", {\n ...this.stripeOptions,\n });\n this.cardExpiryElement.on(\"change\", event => {\n this.cardExpiryError = event.error ? event.error.message : null;\n });\n this.cardExpiryInput.init(this.cardExpiryElement);\n }\n\n public initCardCvc() {\n this.cardCvcElement = this.elements.create(\"cardCvc\", {\n ...this.stripeOptions,\n });\n this.cardCvcElement.on(\"change\", event => {\n this.cardCvcError = event.error ? event.error.message : null;\n });\n this.cardCvcInput.init(this.cardCvcElement);\n }\n\n public ngOnDestroy(): void {\n this.cardNumberElement.unmount();\n this.cardExpiryElement.unmount();\n this.cardCvcElement.unmount();\n }\n\n public patchName(name: string) {\n this.formGroup.get(\"name\").patchValue(name);\n }\n\n public markAllAsTouched(): void {\n this.formGroup.markAllAsTouched();\n this.cardCvcInput.markAsTouched();\n this.cardNumberInput.markAsTouched();\n this.cardExpiryInput.markAsTouched();\n }\n\n private getYear(): number {\n const date = new Date();\n return +date.getFullYear().toString().substr(-2);\n }\n}\n","<mat-list [formGroup]=\"formGroup\">\n <mat-list-item>\n <mat-form-field [appearance]=\"appearance\" niceControlStatus floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.name_on_card.label\" | translate}}</mat-label>\n <input [placeholder]=\"'nice_ui_kit.stripe.name_on_card.placeholder' | translate\" matInput type=\"text\"\n formControlName=\"name\" required/>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle text-accent form-icons\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div fxLayout=\"column\" class=\"w-full\">\n <div fxLayout=\"row\">\n <mat-form-field fxFlex=\"100\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate}}</mat-label>\n <div matPrefix class=\"pr-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card text-accent form-icons\"></i>\n </div>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.card_number.placeholder' | translate\"\n #cardNumber required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardNumberError\">{{ cardNumberError }}</mat-error>\n </mat-form-field>\n </div>\n <div fxLayout=\"row\" fxLayoutGap=\"15px\">\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.expiration.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.expiration.placeholder' | translate\"\n #cardExpiry required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardExpiryError\">{{ cardExpiryError }}</mat-error>\n </mat-form-field>\n <mat-form-field fxFlex=\"50\" fxFlex.lt-md=\"48\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.cvc.label\" | translate}}</mat-label>\n <nice-stripe-card-element [placeholder]=\"'nice_ui_kit.stripe.cvc.placeholder' | translate\" #cardCvc\n required></nice-stripe-card-element>\n <mat-error [@slideInBottom] *ngIf=\"cardCvcError\">{{ cardCvcError }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n </mat-list-item>\n</mat-list>\n","import { CommonModule } from \"@angular/common\";\nimport { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { ExtendedModule, FlexModule } from \"@angular/flex-layout\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatListModule } from \"@angular/material/list\";\nimport { TranslateModule } from \"@ngx-translate/core\";\nimport { NiceFormErrorModule } from \"@recursyve/nice-ui-kit.v2\";\nimport { NgxStripeModule } from \"ngx-stripe\";\nimport { NiceStripeCardElementComponent } from \"./components/card-element/stripe-card-element.component\";\nimport { NiceStripeCardFormComponent } from \"./components/card-form/stripe-card-form.component\";\nimport { NICE_STRIPE_OPTIONS } from \"./nice-stripe-kit.constant\";\nimport { NiceStripeKitOptions } from \"./nice-stripe-kit.options\";\n\n@NgModule({\n imports: [\n FlexModule,\n NgxStripeModule,\n ReactiveFormsModule,\n TranslateModule,\n\n MatFormFieldModule,\n MatInputModule,\n MatListModule,\n NiceFormErrorModule,\n MatButtonModule,\n CommonModule,\n ExtendedModule\n ],\n declarations: [\n NiceStripeCardElementComponent,\n NiceStripeCardFormComponent\n ],\n exports: [\n NiceStripeCardFormComponent\n ]\n})\nexport class NiceStripeModule {\n public static forRoot(options?: NiceStripeKitOptions): ModuleWithProviders<NiceStripeModule> {\n return {\n ngModule: NiceStripeModule,\n providers: [\n {\n provide: NICE_STRIPE_OPTIONS,\n useValue: options\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of nice-stripe-kit\n */\n\nexport * from \"./lib/nice-stripe-kit.module\";\nexport * from \"./lib/components/card-element/stripe-card-element.component\";\nexport * from \"./lib/components/card-form/stripe-card-form.component\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;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9B,2BAA2B,aAf3B,UAAU;QACV,eAAe;QACf,mBAAmB;QACnB,eAAe;QAEf,kBAAkB;QAClB,cAAc;QACd,aAAa;QACb,mBAAmB;QACnB,eAAe;QACf,YAAY;QACZ,cAAc,aAOd,2BAA2B;8GAGtB,gBAAgB,YAtBhB;YACL,UAAU;YACV,eAAe;YACf,mBAAmB;YACnB,eAAe;YAEf,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,mBAAmB;YACnB,eAAe;YACf,YAAY;YACZ,cAAc;SACjB;2FASQ,gBAAgB;kBAvB5B,QAAQ;mBAAC;oBACN,OAAO,EAAE;wBACL,UAAU;wBACV,eAAe;wBACf,mBAAmB;wBACnB,eAAe;wBAEf,kBAAkB;wBAClB,cAAc;wBACd,aAAa;wBACb,mBAAmB;wBACnB,eAAe;wBACf,YAAY;wBACZ,cAAc;qBACjB;oBACD,YAAY,EAAE;wBACV,8BAA8B;wBAC9B,2BAA2B;qBAC9B;oBACD,OAAO,EAAE;wBACL,2BAA2B;qBAC9B;iBACJ;;;ACtCD;;;;ACAA;;;;;;"}
package/package.json CHANGED
@@ -1,23 +1,36 @@
1
1
  {
2
2
  "name": "@recursyve/nice-stripe-kit.v2",
3
- "version": "12.0.0-beta.2",
3
+ "version": "13.0.0-beta.3",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
7
7
  "peerDependencies": {
8
- "@angular/common": "^12.0.0",
9
- "@angular/core": "^12.0.0",
10
- "@recursyve/nice-ui-kit.v2": "^12.0.0-beta.13",
11
- "@recursyve/ngx-form-generator": "^12.0.0-beta.17",
12
- "@stripe/stripe-js": "^1.16.0",
13
- "ngx-stripe": "^12.3.0",
8
+ "@angular/common": "^13.0.0",
9
+ "@angular/core": "^13.0.0",
10
+ "@recursyve/nice-ui-kit.v2": "^13.0.0-beta.42",
11
+ "@recursyve/ngx-form-generator": "^13.0.0-beta.19",
12
+ "@stripe/stripe-js": "^1.21.0",
13
+ "ngx-stripe": "^13.0.0",
14
14
  "uuid": "^3.4.0"
15
15
  },
16
- "main": "bundles/recursyve-nice-stripe-kit.v2.umd.js",
17
- "module": "fesm2015/recursyve-nice-stripe-kit.v2.js",
18
- "es2015": "fesm2015/recursyve-nice-stripe-kit.v2.js",
19
- "esm2015": "esm2015/recursyve-nice-stripe-kit.v2.js",
20
- "fesm2015": "fesm2015/recursyve-nice-stripe-kit.v2.js",
16
+ "module": "fesm2015/recursyve-nice-stripe-kit.v2.mjs",
17
+ "es2020": "fesm2020/recursyve-nice-stripe-kit.v2.mjs",
18
+ "esm2020": "esm2020/recursyve-nice-stripe-kit.v2.mjs",
19
+ "fesm2020": "fesm2020/recursyve-nice-stripe-kit.v2.mjs",
20
+ "fesm2015": "fesm2015/recursyve-nice-stripe-kit.v2.mjs",
21
21
  "typings": "recursyve-nice-stripe-kit.v2.d.ts",
22
+ "exports": {
23
+ "./package.json": {
24
+ "default": "./package.json"
25
+ },
26
+ ".": {
27
+ "types": "./recursyve-nice-stripe-kit.v2.d.ts",
28
+ "esm2020": "./esm2020/recursyve-nice-stripe-kit.v2.mjs",
29
+ "es2020": "./fesm2020/recursyve-nice-stripe-kit.v2.mjs",
30
+ "es2015": "./fesm2015/recursyve-nice-stripe-kit.v2.mjs",
31
+ "node": "./fesm2015/recursyve-nice-stripe-kit.v2.mjs",
32
+ "default": "./fesm2020/recursyve-nice-stripe-kit.v2.mjs"
33
+ }
34
+ },
22
35
  "sideEffects": false
23
36
  }