@recursyve/nice-stripe-kit.v2 14.0.0-beta.5 → 16.0.0-beta.7
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/esm2022/lib/components/card-element/stripe-card-element.component.mjs +130 -0
- package/esm2022/lib/components/card-form/stripe-card-form.component.mjs +145 -0
- package/{esm2020 → esm2022}/lib/components/card-form/stripe-card-form.form.mjs +1 -1
- package/{esm2020 → esm2022}/lib/nice-stripe-kit.module.mjs +22 -22
- package/{fesm2020 → fesm2022}/recursyve-nice-stripe-kit.v2.mjs +59 -59
- package/fesm2022/recursyve-nice-stripe-kit.v2.mjs.map +1 -0
- package/lib/components/card-element/stripe-card-element.component.d.ts +1 -1
- package/lib/components/card-form/stripe-card-form.component.d.ts +1 -1
- package/package.json +11 -17
- package/esm2020/lib/components/card-element/stripe-card-element.component.mjs +0 -130
- package/esm2020/lib/components/card-form/stripe-card-form.component.mjs +0 -144
- package/fesm2015/recursyve-nice-stripe-kit.v2.mjs +0 -355
- package/fesm2015/recursyve-nice-stripe-kit.v2.mjs.map +0 -1
- package/fesm2020/recursyve-nice-stripe-kit.v2.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/nice-stripe-kit.constant.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/nice-stripe-kit.options.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/recursyve-nice-stripe-kit.v2.mjs +0 -0
|
@@ -18,7 +18,7 @@ import { niceAnimations, NiceFormErrorModule } from '@recursyve/nice-ui-kit.v2';
|
|
|
18
18
|
import * as i2 from 'ngx-stripe';
|
|
19
19
|
import { NgxStripeModule } from 'ngx-stripe';
|
|
20
20
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
21
|
-
import { Subject } from 'rxjs';
|
|
21
|
+
import { Subject, lastValueFrom } from 'rxjs';
|
|
22
22
|
import { v4 } from 'uuid';
|
|
23
23
|
import * as i1 from '@recursyve/ngx-form-generator';
|
|
24
24
|
import { Control, Required, GeneratedFormGroup, ngxFormGeneratorFactory } from '@recursyve/ngx-form-generator';
|
|
@@ -26,18 +26,6 @@ import { map } from 'rxjs/operators';
|
|
|
26
26
|
import { __decorate, __metadata } from 'tslib';
|
|
27
27
|
|
|
28
28
|
class NiceStripeCardElementComponent {
|
|
29
|
-
constructor(ngControl) {
|
|
30
|
-
this.ngControl = ngControl;
|
|
31
|
-
this._focused = false;
|
|
32
|
-
this._required = false;
|
|
33
|
-
this._disabled = false;
|
|
34
|
-
this.stateChanges = new Subject();
|
|
35
|
-
this.empty = true;
|
|
36
|
-
this.errorState = false;
|
|
37
|
-
this.complete = false;
|
|
38
|
-
this.describedBy = "";
|
|
39
|
-
this.id = v4();
|
|
40
|
-
}
|
|
41
29
|
set placeholder(placeholder) {
|
|
42
30
|
this._placeholder = placeholder;
|
|
43
31
|
this.stateChanges.next();
|
|
@@ -72,6 +60,18 @@ class NiceStripeCardElementComponent {
|
|
|
72
60
|
setDescribedByIds(ids) {
|
|
73
61
|
this.describedBy = ids.join(" ");
|
|
74
62
|
}
|
|
63
|
+
constructor(ngControl) {
|
|
64
|
+
this.ngControl = ngControl;
|
|
65
|
+
this._focused = false;
|
|
66
|
+
this._required = false;
|
|
67
|
+
this._disabled = false;
|
|
68
|
+
this.stateChanges = new Subject();
|
|
69
|
+
this.empty = true;
|
|
70
|
+
this.errorState = false;
|
|
71
|
+
this.complete = false;
|
|
72
|
+
this.describedBy = "";
|
|
73
|
+
this.id = v4();
|
|
74
|
+
}
|
|
75
75
|
async ngAfterViewInit() {
|
|
76
76
|
if (this.elementRef) {
|
|
77
77
|
this.empty = !this.value;
|
|
@@ -106,15 +106,15 @@ class NiceStripeCardElementComponent {
|
|
|
106
106
|
}
|
|
107
107
|
onContainerClick(event) {
|
|
108
108
|
}
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeCardElementComponent, deps: [{ token: i4.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.5", 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: [
|
|
111
|
+
{
|
|
112
|
+
provide: MatFormFieldControl,
|
|
113
|
+
useExisting: NiceStripeCardElementComponent
|
|
114
|
+
}
|
|
115
|
+
], 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 }); }
|
|
109
116
|
}
|
|
110
|
-
|
|
111
|
-
NiceStripeCardElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.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: [
|
|
112
|
-
{
|
|
113
|
-
provide: MatFormFieldControl,
|
|
114
|
-
useExisting: NiceStripeCardElementComponent
|
|
115
|
-
}
|
|
116
|
-
], 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 });
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
|
|
118
118
|
type: Component,
|
|
119
119
|
args: [{ selector: "nice-stripe-card-element", template: "<div class='stripe-element' #element></div>", encapsulation: ViewEncapsulation.None, providers: [
|
|
120
120
|
{
|
|
@@ -158,13 +158,6 @@ __decorate([
|
|
|
158
158
|
], StripeForm.prototype, "name", void 0);
|
|
159
159
|
|
|
160
160
|
class NiceStripeCardFormComponent {
|
|
161
|
-
constructor(options, formGroup, stripeService, translateService) {
|
|
162
|
-
this.options = options;
|
|
163
|
-
this.formGroup = formGroup;
|
|
164
|
-
this.stripeService = stripeService;
|
|
165
|
-
this.translateService = translateService;
|
|
166
|
-
this.showIcons = false;
|
|
167
|
-
}
|
|
168
161
|
get isValid() {
|
|
169
162
|
return this.cardNumberInput.complete &&
|
|
170
163
|
this.cardExpiryInput.complete &&
|
|
@@ -179,6 +172,13 @@ class NiceStripeCardFormComponent {
|
|
|
179
172
|
name: this.formGroup.get("name").value
|
|
180
173
|
}).pipe(map(x => x?.token?.id)).toPromise();
|
|
181
174
|
}
|
|
175
|
+
constructor(options, formGroup, stripeService, translateService) {
|
|
176
|
+
this.options = options;
|
|
177
|
+
this.formGroup = formGroup;
|
|
178
|
+
this.stripeService = stripeService;
|
|
179
|
+
this.translateService = translateService;
|
|
180
|
+
this.showIcons = false;
|
|
181
|
+
}
|
|
182
182
|
async ngOnInit() {
|
|
183
183
|
this.stripeOptions = {
|
|
184
184
|
placeholder: "",
|
|
@@ -186,10 +186,10 @@ class NiceStripeCardFormComponent {
|
|
|
186
186
|
base: this.options.styling
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
this.elements = await this.stripeService.elements({
|
|
189
|
+
this.elements = await lastValueFrom(this.stripeService.elements({
|
|
190
190
|
locale: this.translateService.currentLang,
|
|
191
191
|
fonts: this.options?.fonts ?? []
|
|
192
|
-
})
|
|
192
|
+
}));
|
|
193
193
|
this.initCardNumber();
|
|
194
194
|
this.initCardExpiry();
|
|
195
195
|
this.initCardCvc();
|
|
@@ -245,15 +245,15 @@ class NiceStripeCardFormComponent {
|
|
|
245
245
|
const date = new Date();
|
|
246
246
|
return +date.getFullYear().toString().substr(-2);
|
|
247
247
|
}
|
|
248
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeCardFormComponent, deps: [{ token: NICE_STRIPE_OPTIONS, optional: true }, { token: i1.GeneratedFormGroup }, { token: i2.StripeService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
249
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.5", type: NiceStripeCardFormComponent, selector: "nice-stripe-card-form", inputs: { appearance: "appearance", showIcons: "showIcons" }, providers: [
|
|
250
|
+
{
|
|
251
|
+
provide: GeneratedFormGroup,
|
|
252
|
+
useFactory: ngxFormGeneratorFactory(StripeForm)
|
|
253
|
+
}
|
|
254
|
+
], 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=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle accent-fg\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div class=\"flex flex-col w-full\">\n <div class=\"flex flex-row\">\n <mat-form-field class=\"flex-full max-w-full\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate }}</mat-label>\n <div matPrefix class=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card accent-fg\"></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 class=\"flex flex-row gap-4\">\n <mat-form-field class=\"flex flex-full max-w-1/2\" [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 class=\"flex flex-full max-w-1/2\" [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"], dependencies: [{ kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i8.NiceControlStatusDirective, selector: "[niceControlStatus]" }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NiceStripeCardElementComponent, selector: "nice-stripe-card-element", inputs: ["placeholder", "focused", "required", "disabled"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None }); }
|
|
248
255
|
}
|
|
249
|
-
|
|
250
|
-
NiceStripeCardFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: NiceStripeCardFormComponent, selector: "nice-stripe-card-form", inputs: { appearance: "appearance", showIcons: "showIcons" }, providers: [
|
|
251
|
-
{
|
|
252
|
-
provide: GeneratedFormGroup,
|
|
253
|
-
useFactory: ngxFormGeneratorFactory(StripeForm)
|
|
254
|
-
}
|
|
255
|
-
], 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=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle accent-fg\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div class=\"flex flex-col w-full\">\n <div class=\"flex flex-row\">\n <mat-form-field class=\"flex-full max-w-full\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate }}</mat-label>\n <div matPrefix class=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card accent-fg\"></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 class=\"flex flex-row gap-4\">\n <mat-form-field class=\"flex flex-full max-w-1/2\" [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 class=\"flex flex-full max-w-1/2\" [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"], dependencies: [{ kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i5.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i8.NiceControlStatusDirective, selector: "[niceControlStatus]" }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NiceStripeCardElementComponent, selector: "nice-stripe-card-element", inputs: ["placeholder", "focused", "required", "disabled"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
|
|
257
257
|
type: Component,
|
|
258
258
|
args: [{ selector: "nice-stripe-card-form", encapsulation: ViewEncapsulation.None, providers: [
|
|
259
259
|
{
|
|
@@ -293,28 +293,28 @@ class NiceStripeModule {
|
|
|
293
293
|
]
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
297
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
|
|
298
|
+
NiceStripeCardFormComponent], imports: [NgxStripeModule,
|
|
299
|
+
ReactiveFormsModule,
|
|
300
|
+
TranslateModule,
|
|
301
|
+
MatFormFieldModule,
|
|
302
|
+
MatInputModule,
|
|
303
|
+
MatListModule,
|
|
304
|
+
NiceFormErrorModule,
|
|
305
|
+
MatButtonModule,
|
|
306
|
+
CommonModule], exports: [NiceStripeCardFormComponent] }); }
|
|
307
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeModule, imports: [NgxStripeModule,
|
|
308
|
+
ReactiveFormsModule,
|
|
309
|
+
TranslateModule,
|
|
310
|
+
MatFormFieldModule,
|
|
311
|
+
MatInputModule,
|
|
312
|
+
MatListModule,
|
|
313
|
+
NiceFormErrorModule,
|
|
314
|
+
MatButtonModule,
|
|
315
|
+
CommonModule] }); }
|
|
296
316
|
}
|
|
297
|
-
|
|
298
|
-
NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
|
|
299
|
-
NiceStripeCardFormComponent], imports: [NgxStripeModule,
|
|
300
|
-
ReactiveFormsModule,
|
|
301
|
-
TranslateModule,
|
|
302
|
-
MatFormFieldModule,
|
|
303
|
-
MatInputModule,
|
|
304
|
-
MatListModule,
|
|
305
|
-
NiceFormErrorModule,
|
|
306
|
-
MatButtonModule,
|
|
307
|
-
CommonModule], exports: [NiceStripeCardFormComponent] });
|
|
308
|
-
NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeModule, imports: [NgxStripeModule,
|
|
309
|
-
ReactiveFormsModule,
|
|
310
|
-
TranslateModule,
|
|
311
|
-
MatFormFieldModule,
|
|
312
|
-
MatInputModule,
|
|
313
|
-
MatListModule,
|
|
314
|
-
NiceFormErrorModule,
|
|
315
|
-
MatButtonModule,
|
|
316
|
-
CommonModule] });
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeModule, decorators: [{
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NiceStripeModule, decorators: [{
|
|
318
318
|
type: NgModule,
|
|
319
319
|
args: [{
|
|
320
320
|
imports: [
|
|
@@ -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 { lastValueFrom } from \"rxjs\";\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 lastValueFrom(\n this.stripeService.elements({\n locale: this.translateService.currentLang as any,\n fonts: this.options?.fonts ?? []\n })\n );\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 if (this.cardNumberElement) {\n this.cardNumberElement.unmount();\n }\n\n if (this.cardExpiryElement) {\n this.cardExpiryElement.unmount();\n }\n\n if (this.cardCvcElement) {\n this.cardCvcElement.unmount();\n }\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=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-user-circle accent-fg\"></i>\n </div>\n </mat-form-field>\n </mat-list-item>\n <mat-list-item>\n <div class=\"flex flex-col w-full\">\n <div class=\"flex flex-row\">\n <mat-form-field class=\"flex-full max-w-full\" [appearance]=\"appearance\" floatLabel=\"always\">\n <mat-label>{{ \"nice_ui_kit.stripe.card_number.label\" | translate }}</mat-label>\n <div matPrefix class=\"pl-2\" *ngIf=\"showIcons\">\n <i class=\"fad fa-credit-card accent-fg\"></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 class=\"flex flex-row gap-4\">\n <mat-form-field class=\"flex flex-full max-w-1/2\" [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 class=\"flex flex-full max-w-1/2\" [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 { 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 NgxStripeModule,\n ReactiveFormsModule,\n TranslateModule,\n\n MatFormFieldModule,\n MatInputModule,\n MatListModule,\n NiceFormErrorModule,\n MatButtonModule,\n CommonModule\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","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Ba,8BAA8B,CAAA;IAsBvC,IACW,WAAW,CAAC,WAAmB,EAAA;AACtC,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;AAChC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC5B;AAED,IAAA,IAAW,WAAW,GAAA;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;KAC5B;IAED,IACW,OAAO,CAAC,OAAgB,EAAA;AAC/B,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AACxB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC5B;AAED,IAAA,IAAW,OAAO,GAAA;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;KACxB;AAED,IAAA,IACW,QAAQ,GAAA;QACf,OAAO,IAAI,CAAC,SAA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EAAA;AAGtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAnBrB,eAAe;YACf,mBAAmB;YACnB,eAAe;YAEf,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,mBAAmB;YACnB,eAAe;YACf,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAUP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBArB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,eAAe;wBACf,mBAAmB;wBACnB,eAAe;wBAEf,kBAAkB;wBAClB,cAAc;wBACd,aAAa;wBACb,mBAAmB;wBACnB,eAAe;wBACf,YAAY;AACf,qBAAA;AACD,oBAAA,YAAY,EAAE;wBACV,8BAA8B;wBAC9B,2BAA2B;AAC9B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,2BAA2B;AAC9B,qBAAA;AACJ,iBAAA,CAAA;;;ACnCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -35,5 +35,5 @@ export declare class NiceStripeCardElementComponent implements AfterViewInit, Ma
|
|
|
35
35
|
markAsTouched(): void;
|
|
36
36
|
onContainerClick(event: MouseEvent): void;
|
|
37
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceStripeCardElementComponent, [{ optional: true; self: true; }]>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NiceStripeCardElementComponent, "nice-stripe-card-element", never, { "placeholder": "placeholder"; "focused": "focused"; "required": "required"; "disabled": "disabled"; }, {}, never, never, false>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NiceStripeCardElementComponent, "nice-stripe-card-element", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
|
|
39
39
|
}
|
|
@@ -38,5 +38,5 @@ export declare class NiceStripeCardFormComponent implements OnInit, OnDestroy {
|
|
|
38
38
|
markAllAsTouched(): void;
|
|
39
39
|
private getYear;
|
|
40
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<NiceStripeCardFormComponent, [{ optional: true; }, null, null, null]>;
|
|
41
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NiceStripeCardFormComponent, "nice-stripe-card-form", never, { "appearance": "appearance"; "showIcons": "showIcons"; }, {}, never, never, false>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NiceStripeCardFormComponent, "nice-stripe-card-form", never, { "appearance": { "alias": "appearance"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; }, {}, never, never, false, never>;
|
|
42
42
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recursyve/nice-stripe-kit.v2",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0-beta.7",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.0.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@angular/common": "^
|
|
9
|
-
"@angular/core": "^
|
|
10
|
-
"@recursyve/nice-ui-kit.v2": "
|
|
11
|
-
"@recursyve/ngx-form-generator": "
|
|
12
|
-
"@stripe/stripe-js": "^
|
|
13
|
-
"ngx-stripe": "^
|
|
8
|
+
"@angular/common": "^16.0.0",
|
|
9
|
+
"@angular/core": "^16.0.0",
|
|
10
|
+
"@recursyve/nice-ui-kit.v2": ">= 16.0.0-beta.136",
|
|
11
|
+
"@recursyve/ngx-form-generator": ">= 16.0.0-beta.47",
|
|
12
|
+
"@stripe/stripe-js": "^3.4.0",
|
|
13
|
+
"ngx-stripe": "^16.4.0",
|
|
14
14
|
"uuid": ">= 9.0.0"
|
|
15
15
|
},
|
|
16
|
-
"module": "
|
|
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",
|
|
16
|
+
"module": "fesm2022/recursyve-nice-stripe-kit.v2.mjs",
|
|
21
17
|
"typings": "index.d.ts",
|
|
22
18
|
"exports": {
|
|
23
19
|
"./package.json": {
|
|
@@ -25,11 +21,9 @@
|
|
|
25
21
|
},
|
|
26
22
|
".": {
|
|
27
23
|
"types": "./index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"node": "./fesm2015/recursyve-nice-stripe-kit.v2.mjs",
|
|
32
|
-
"default": "./fesm2020/recursyve-nice-stripe-kit.v2.mjs"
|
|
24
|
+
"esm2022": "./esm2022/recursyve-nice-stripe-kit.v2.mjs",
|
|
25
|
+
"esm": "./esm2022/recursyve-nice-stripe-kit.v2.mjs",
|
|
26
|
+
"default": "./fesm2022/recursyve-nice-stripe-kit.v2.mjs"
|
|
33
27
|
}
|
|
34
28
|
},
|
|
35
29
|
"sideEffects": false
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
|
-
import { Component, ElementRef, HostBinding, Input, Optional, Self, ViewChild, ViewEncapsulation } from "@angular/core";
|
|
3
|
-
import { NgControl } from "@angular/forms";
|
|
4
|
-
import { MatFormFieldControl } from "@angular/material/form-field";
|
|
5
|
-
import { Subject } from "rxjs";
|
|
6
|
-
import { v4 as uuidv4 } from "uuid";
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "@angular/forms";
|
|
9
|
-
export class NiceStripeCardElementComponent {
|
|
10
|
-
constructor(ngControl) {
|
|
11
|
-
this.ngControl = ngControl;
|
|
12
|
-
this._focused = false;
|
|
13
|
-
this._required = false;
|
|
14
|
-
this._disabled = false;
|
|
15
|
-
this.stateChanges = new Subject();
|
|
16
|
-
this.empty = true;
|
|
17
|
-
this.errorState = false;
|
|
18
|
-
this.complete = false;
|
|
19
|
-
this.describedBy = "";
|
|
20
|
-
this.id = uuidv4();
|
|
21
|
-
}
|
|
22
|
-
set placeholder(placeholder) {
|
|
23
|
-
this._placeholder = placeholder;
|
|
24
|
-
this.stateChanges.next();
|
|
25
|
-
}
|
|
26
|
-
get placeholder() {
|
|
27
|
-
return this._placeholder;
|
|
28
|
-
}
|
|
29
|
-
set focused(focused) {
|
|
30
|
-
this._focused = focused;
|
|
31
|
-
this.stateChanges.next();
|
|
32
|
-
}
|
|
33
|
-
get focused() {
|
|
34
|
-
return this._focused;
|
|
35
|
-
}
|
|
36
|
-
get required() {
|
|
37
|
-
return this._required;
|
|
38
|
-
}
|
|
39
|
-
set required(req) {
|
|
40
|
-
this._required = coerceBooleanProperty(req);
|
|
41
|
-
this.stateChanges.next();
|
|
42
|
-
}
|
|
43
|
-
get disabled() {
|
|
44
|
-
return this._disabled;
|
|
45
|
-
}
|
|
46
|
-
set disabled(value) {
|
|
47
|
-
this._disabled = coerceBooleanProperty(value);
|
|
48
|
-
this.stateChanges.next();
|
|
49
|
-
}
|
|
50
|
-
get shouldLabelFloat() {
|
|
51
|
-
return this.focused || !this.empty;
|
|
52
|
-
}
|
|
53
|
-
setDescribedByIds(ids) {
|
|
54
|
-
this.describedBy = ids.join(" ");
|
|
55
|
-
}
|
|
56
|
-
async ngAfterViewInit() {
|
|
57
|
-
if (this.elementRef) {
|
|
58
|
-
this.empty = !this.value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async init(element) {
|
|
62
|
-
this.element = element;
|
|
63
|
-
this.element.mount(this.elementRef.nativeElement);
|
|
64
|
-
this.stateChanges.next();
|
|
65
|
-
this.element.update({
|
|
66
|
-
placeholder: this.placeholder
|
|
67
|
-
});
|
|
68
|
-
this.element.on("blur", () => {
|
|
69
|
-
this.focused = false;
|
|
70
|
-
if (this.empty && this._required) {
|
|
71
|
-
this.errorState = true;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
this.element.on("focus", () => {
|
|
75
|
-
this.focused = true;
|
|
76
|
-
});
|
|
77
|
-
this.element.on("change", event => {
|
|
78
|
-
this.empty = event.empty;
|
|
79
|
-
this.errorState = !!event.error;
|
|
80
|
-
this.complete = event.complete;
|
|
81
|
-
this.stateChanges.next();
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
markAsTouched() {
|
|
85
|
-
this.errorState = !!this.empty;
|
|
86
|
-
this.stateChanges.next();
|
|
87
|
-
}
|
|
88
|
-
onContainerClick(event) {
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
NiceStripeCardElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeCardElementComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
92
|
-
NiceStripeCardElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.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: [
|
|
93
|
-
{
|
|
94
|
-
provide: MatFormFieldControl,
|
|
95
|
-
useExisting: NiceStripeCardElementComponent
|
|
96
|
-
}
|
|
97
|
-
], 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 });
|
|
98
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
|
|
99
|
-
type: Component,
|
|
100
|
-
args: [{ selector: "nice-stripe-card-element", template: "<div class='stripe-element' #element></div>", encapsulation: ViewEncapsulation.None, providers: [
|
|
101
|
-
{
|
|
102
|
-
provide: MatFormFieldControl,
|
|
103
|
-
useExisting: NiceStripeCardElementComponent
|
|
104
|
-
}
|
|
105
|
-
], styles: ["nice-stripe-card-element .stripe-element{height:15px}\n"] }]
|
|
106
|
-
}], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
|
|
107
|
-
type: Optional
|
|
108
|
-
}, {
|
|
109
|
-
type: Self
|
|
110
|
-
}] }]; }, propDecorators: { elementRef: [{
|
|
111
|
-
type: ViewChild,
|
|
112
|
-
args: ["element"]
|
|
113
|
-
}], describedBy: [{
|
|
114
|
-
type: HostBinding,
|
|
115
|
-
args: ["attr.aria-describedby"]
|
|
116
|
-
}], id: [{
|
|
117
|
-
type: HostBinding
|
|
118
|
-
}], placeholder: [{
|
|
119
|
-
type: Input
|
|
120
|
-
}], focused: [{
|
|
121
|
-
type: Input
|
|
122
|
-
}], required: [{
|
|
123
|
-
type: Input
|
|
124
|
-
}], disabled: [{
|
|
125
|
-
type: Input
|
|
126
|
-
}], shouldLabelFloat: [{
|
|
127
|
-
type: HostBinding,
|
|
128
|
-
args: ["class.floating"]
|
|
129
|
-
}] } });
|
|
130
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaXBlLWNhcmQtZWxlbWVudC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uaWNlLXN0cmlwZS1raXQtdjIvc3JjL2xpYi9jb21wb25lbnRzL2NhcmQtZWxlbWVudC9zdHJpcGUtY2FyZC1lbGVtZW50LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHB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