@recursyve/nice-stripe-kit.v2 12.0.0-beta.0 → 13.0.0-beta.4

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.
Files changed (20) hide show
  1. package/esm2020/lib/components/card-element/stripe-card-element.component.mjs +130 -0
  2. package/esm2020/lib/components/card-form/stripe-card-form.component.mjs +138 -0
  3. package/{esm2015/lib/components/card-form/stripe-card-form.form.js → esm2020/lib/components/card-form/stripe-card-form.form.mjs} +0 -0
  4. package/{esm2015/lib/nice-stripe-kit.constant.js → esm2020/lib/nice-stripe-kit.constant.mjs} +0 -0
  5. package/esm2020/lib/nice-stripe-kit.module.mjs +73 -0
  6. package/{esm2015/lib/nice-stripe-kit.options.js → esm2020/lib/nice-stripe-kit.options.mjs} +0 -0
  7. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  8. package/{esm2015/recursyve-nice-stripe-kit.v2.js → esm2020/recursyve-nice-stripe-kit.v2.mjs} +0 -0
  9. package/fesm2015/{recursyve-nice-stripe-kit.v2.js → recursyve-nice-stripe-kit.v2.mjs} +36 -53
  10. package/fesm2015/recursyve-nice-stripe-kit.v2.mjs.map +1 -0
  11. package/fesm2020/recursyve-nice-stripe-kit.v2.mjs +346 -0
  12. package/fesm2020/recursyve-nice-stripe-kit.v2.mjs.map +1 -0
  13. package/lib/nice-stripe-kit.module.d.ts +10 -11
  14. package/package.json +25 -12
  15. package/bundles/recursyve-nice-stripe-kit.v2.umd.js +0 -755
  16. package/bundles/recursyve-nice-stripe-kit.v2.umd.js.map +0 -1
  17. package/esm2015/lib/components/card-element/stripe-card-element.component.js +0 -141
  18. package/esm2015/lib/components/card-form/stripe-card-form.component.js +0 -144
  19. package/esm2015/lib/nice-stripe-kit.module.js +0 -80
  20. package/fesm2015/recursyve-nice-stripe-kit.v2.js.map +0 -1
@@ -2,8 +2,6 @@ import * as i10 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
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
5
  import * as i7 from '@angular/forms';
8
6
  import { ReactiveFormsModule } from '@angular/forms';
9
7
  import { MatButtonModule } from '@angular/material/button';
@@ -113,32 +111,28 @@ class NiceStripeCardElementComponent {
113
111
  onContainerClick(event) {
114
112
  }
115
113
  }
116
- NiceStripeCardElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeCardElementComponent, deps: [{ token: i7.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
117
- NiceStripeCardElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", 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
+ 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 });
115
+ 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: [
118
116
  {
119
117
  provide: MatFormFieldControl,
120
118
  useExisting: NiceStripeCardElementComponent
121
119
  }
122
- ], 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}"], encapsulation: i0.ViewEncapsulation.None });
123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
120
+ ], 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 });
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
124
122
  type: Component,
125
- args: [{
126
- selector: "nice-stripe-card-element",
127
- template: "<div class='stripe-element' #element></div>",
128
- styleUrls: ["./stripe-card-element.style.scss"],
129
- encapsulation: ViewEncapsulation.None,
130
- providers: [
123
+ args: [{ selector: "nice-stripe-card-element", template: "<div class='stripe-element' #element></div>", encapsulation: ViewEncapsulation.None, providers: [
131
124
  {
132
125
  provide: MatFormFieldControl,
133
126
  useExisting: NiceStripeCardElementComponent
134
127
  }
135
- ]
136
- }]
137
- }], ctorParameters: function () { return [{ type: i7.NgControl, decorators: [{
138
- type: Optional
139
- }, {
140
- type: Self
141
- }] }]; }, propDecorators: { elementRef: [{
128
+ ], styles: ["nice-stripe-card-element .stripe-element{height:15px}\n"] }]
129
+ }], ctorParameters: function () {
130
+ return [{ type: i7.NgControl, decorators: [{
131
+ type: Optional
132
+ }, {
133
+ type: Self
134
+ }] }];
135
+ }, propDecorators: { elementRef: [{
142
136
  type: ViewChild,
143
137
  args: ["element"]
144
138
  }], describedBy: [{
@@ -249,34 +243,29 @@ class NiceStripeCardFormComponent {
249
243
  return +date.getFullYear().toString().substr(-2);
250
244
  }
251
245
  }
252
- NiceStripeCardFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeCardFormComponent, deps: [{ token: NICE_STRIPE_OPTIONS, optional: true }, { token: i1.GeneratedFormGroup }, { token: i2.StripeService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
253
- NiceStripeCardFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NiceStripeCardFormComponent, selector: "nice-stripe-card-form", inputs: { appearance: "appearance", showIcons: "showIcons" }, providers: [
246
+ 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 });
247
+ 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: [
254
248
  {
255
249
  provide: GeneratedFormGroup,
256
250
  useFactory: ngxFormGeneratorFactory(StripeForm)
257
251
  }
258
- ], 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-12\" *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 fxLayout=\"column\" class=\"w-100-p\">\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=\"pl-12\" *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 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}"], 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", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], 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: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], 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: ["disabled", "formControlName", "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 });
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
252
+ ], 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"], 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: i5.MatError, selector: "mat-error", inputs: ["id"] }], pipes: { "translate": i3.TranslatePipe }, animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
260
254
  type: Component,
261
- args: [{
262
- selector: "nice-stripe-card-form",
263
- templateUrl: "stripe-card-form.template.html",
264
- styleUrls: ["stripe-card-form.style.scss"],
265
- encapsulation: ViewEncapsulation.None,
266
- providers: [
255
+ args: [{ selector: "nice-stripe-card-form", encapsulation: ViewEncapsulation.None, providers: [
267
256
  {
268
257
  provide: GeneratedFormGroup,
269
258
  useFactory: ngxFormGeneratorFactory(StripeForm)
270
259
  }
271
- ],
272
- animations: niceAnimations
273
- }]
274
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
275
- type: Optional
276
- }, {
277
- type: Inject,
278
- args: [NICE_STRIPE_OPTIONS]
279
- }] }, { type: i1.GeneratedFormGroup }, { type: i2.StripeService }, { type: i3.TranslateService }]; }, propDecorators: { appearance: [{
260
+ ], 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=\"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"] }]
261
+ }], ctorParameters: function () {
262
+ return [{ type: undefined, decorators: [{
263
+ type: Optional
264
+ }, {
265
+ type: Inject,
266
+ args: [NICE_STRIPE_OPTIONS]
267
+ }] }, { type: i1.GeneratedFormGroup }, { type: i2.StripeService }, { type: i3.TranslateService }];
268
+ }, propDecorators: { appearance: [{
280
269
  type: Input
281
270
  }], showIcons: [{
282
271
  type: Input
@@ -304,10 +293,9 @@ class NiceStripeModule {
304
293
  };
305
294
  }
306
295
  }
307
- NiceStripeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
308
- NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
309
- NiceStripeCardFormComponent], imports: [FlexModule,
310
- NgxStripeModule,
296
+ NiceStripeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
297
+ NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
298
+ NiceStripeCardFormComponent], imports: [NgxStripeModule,
311
299
  ReactiveFormsModule,
312
300
  TranslateModule,
313
301
  MatFormFieldModule,
@@ -315,10 +303,8 @@ NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
315
303
  MatListModule,
316
304
  NiceFormErrorModule,
317
305
  MatButtonModule,
318
- CommonModule,
319
- ExtendedModule], exports: [NiceStripeCardFormComponent] });
320
- NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeModule, imports: [[
321
- FlexModule,
306
+ CommonModule], exports: [NiceStripeCardFormComponent] });
307
+ NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, imports: [[
322
308
  NgxStripeModule,
323
309
  ReactiveFormsModule,
324
310
  TranslateModule,
@@ -327,14 +313,12 @@ NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
327
313
  MatListModule,
328
314
  NiceFormErrorModule,
329
315
  MatButtonModule,
330
- CommonModule,
331
- ExtendedModule
316
+ CommonModule
332
317
  ]] });
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceStripeModule, decorators: [{
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, decorators: [{
334
319
  type: NgModule,
335
320
  args: [{
336
321
  imports: [
337
- FlexModule,
338
322
  NgxStripeModule,
339
323
  ReactiveFormsModule,
340
324
  TranslateModule,
@@ -343,8 +327,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImpor
343
327
  MatListModule,
344
328
  NiceFormErrorModule,
345
329
  MatButtonModule,
346
- CommonModule,
347
- ExtendedModule
330
+ CommonModule
348
331
  ],
349
332
  declarations: [
350
333
  NiceStripeCardElementComponent,
@@ -365,4 +348,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImpor
365
348
  */
366
349
 
367
350
  export { NiceStripeCardElementComponent, NiceStripeCardFormComponent, NiceStripeModule };
368
- //# sourceMappingURL=recursyve-nice-stripe-kit.v2.js.map
351
+ //# 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=\"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":["uuidv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6GAXQ,gBAAgB;8GAAhB,gBAAgB,iBAPrB,8BAA8B;QAC9B,2BAA2B,aAb3B,eAAe;QACf,mBAAmB;QACnB,eAAe;QAEf,kBAAkB;QAClB,cAAc;QACd,aAAa;QACb,mBAAmB;QACnB,eAAe;QACf,YAAY,aAOZ,2BAA2B;8GAGtB,gBAAgB,YApBhB;YACL,eAAe;YACf,mBAAmB;YACnB,eAAe;YAEf,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,mBAAmB;YACnB,eAAe;YACf,YAAY;SACf;2FASQ,gBAAgB;kBArB5B,QAAQ;mBAAC;oBACN,OAAO,EAAE;wBACL,eAAe;wBACf,mBAAmB;wBACnB,eAAe;wBAEf,kBAAkB;wBAClB,cAAc;wBACd,aAAa;wBACb,mBAAmB;wBACnB,eAAe;wBACf,YAAY;qBACf;oBACD,YAAY,EAAE;wBACV,8BAA8B;wBAC9B,2BAA2B;qBAC9B;oBACD,OAAO,EAAE;wBACL,2BAA2B;qBAC9B;iBACJ;;;ACnCD;;;;ACAA;;;;;;"}
@@ -0,0 +1,346 @@
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 i7 from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
7
+ import { MatButtonModule } from '@angular/material/button';
8
+ import * as i5 from '@angular/material/form-field';
9
+ import { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
10
+ import * as i9 from '@angular/material/input';
11
+ import { MatInputModule } from '@angular/material/input';
12
+ import * as i4 from '@angular/material/list';
13
+ import { MatListModule } from '@angular/material/list';
14
+ import * as i3 from '@ngx-translate/core';
15
+ import { TranslateModule } from '@ngx-translate/core';
16
+ import * as i8 from '@recursyve/nice-ui-kit.v2';
17
+ import { niceAnimations, NiceFormErrorModule } from '@recursyve/nice-ui-kit.v2';
18
+ import * as i2 from 'ngx-stripe';
19
+ import { NgxStripeModule } from 'ngx-stripe';
20
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
21
+ import { Subject } from 'rxjs';
22
+ import { v4 } from 'uuid';
23
+ import * as i1 from '@recursyve/ngx-form-generator';
24
+ import { Control, Required, GeneratedFormGroup, ngxFormGeneratorFactory } from '@recursyve/ngx-form-generator';
25
+ import { map } from 'rxjs/operators';
26
+ import { __decorate, __metadata } from 'tslib';
27
+
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
+ set placeholder(placeholder) {
42
+ this._placeholder = placeholder;
43
+ this.stateChanges.next();
44
+ }
45
+ get placeholder() {
46
+ return this._placeholder;
47
+ }
48
+ set focused(focused) {
49
+ this._focused = focused;
50
+ this.stateChanges.next();
51
+ }
52
+ get focused() {
53
+ return this._focused;
54
+ }
55
+ get required() {
56
+ return this._required;
57
+ }
58
+ set required(req) {
59
+ this._required = coerceBooleanProperty(req);
60
+ this.stateChanges.next();
61
+ }
62
+ get disabled() {
63
+ return this._disabled;
64
+ }
65
+ set disabled(value) {
66
+ this._disabled = coerceBooleanProperty(value);
67
+ this.stateChanges.next();
68
+ }
69
+ get shouldLabelFloat() {
70
+ return this.focused || !this.empty;
71
+ }
72
+ setDescribedByIds(ids) {
73
+ this.describedBy = ids.join(" ");
74
+ }
75
+ async ngAfterViewInit() {
76
+ if (this.elementRef) {
77
+ this.empty = !this.value;
78
+ }
79
+ }
80
+ async init(element) {
81
+ this.element = element;
82
+ this.element.mount(this.elementRef.nativeElement);
83
+ this.stateChanges.next();
84
+ this.element.update({
85
+ placeholder: this.placeholder
86
+ });
87
+ this.element.on("blur", () => {
88
+ this.focused = false;
89
+ if (this.empty && this._required) {
90
+ this.errorState = true;
91
+ }
92
+ });
93
+ this.element.on("focus", () => {
94
+ this.focused = true;
95
+ });
96
+ this.element.on("change", event => {
97
+ this.empty = event.empty;
98
+ this.errorState = !!event.error;
99
+ this.complete = event.complete;
100
+ this.stateChanges.next();
101
+ });
102
+ }
103
+ markAsTouched() {
104
+ this.errorState = !!this.empty;
105
+ this.stateChanges.next();
106
+ }
107
+ onContainerClick(event) {
108
+ }
109
+ }
110
+ 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 });
111
+ 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: [
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: "13.0.3", ngImport: i0, type: NiceStripeCardElementComponent, decorators: [{
118
+ type: Component,
119
+ args: [{ selector: "nice-stripe-card-element", template: "<div class='stripe-element' #element></div>", encapsulation: ViewEncapsulation.None, providers: [
120
+ {
121
+ provide: MatFormFieldControl,
122
+ useExisting: NiceStripeCardElementComponent
123
+ }
124
+ ], styles: ["nice-stripe-card-element .stripe-element{height:15px}\n"] }]
125
+ }], ctorParameters: function () { return [{ type: i7.NgControl, decorators: [{
126
+ type: Optional
127
+ }, {
128
+ type: Self
129
+ }] }]; }, propDecorators: { elementRef: [{
130
+ type: ViewChild,
131
+ args: ["element"]
132
+ }], describedBy: [{
133
+ type: HostBinding,
134
+ args: ["attr.aria-describedby"]
135
+ }], id: [{
136
+ type: HostBinding
137
+ }], placeholder: [{
138
+ type: Input
139
+ }], focused: [{
140
+ type: Input
141
+ }], required: [{
142
+ type: Input
143
+ }], disabled: [{
144
+ type: Input
145
+ }], shouldLabelFloat: [{
146
+ type: HostBinding,
147
+ args: ["class.floating"]
148
+ }] } });
149
+
150
+ const NICE_STRIPE_OPTIONS = new InjectionToken("nice_stripe_options");
151
+
152
+ class StripeForm {
153
+ }
154
+ __decorate([
155
+ Control(),
156
+ Required(),
157
+ __metadata("design:type", String)
158
+ ], StripeForm.prototype, "name", void 0);
159
+
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
+ get isValid() {
169
+ return this.cardNumberInput.complete &&
170
+ this.cardExpiryInput.complete &&
171
+ this.cardCvcInput.complete &&
172
+ this.formGroup.valid;
173
+ }
174
+ get cardToken() {
175
+ if (!this.isValid) {
176
+ return null;
177
+ }
178
+ return this.stripeService.createToken(this.cardNumberElement, {
179
+ name: this.formGroup.get("name").value
180
+ }).pipe(map(x => x?.token?.id)).toPromise();
181
+ }
182
+ async ngOnInit() {
183
+ this.stripeOptions = {
184
+ placeholder: "",
185
+ style: {
186
+ base: this.options.styling
187
+ }
188
+ };
189
+ this.elements = await this.stripeService.elements({
190
+ locale: this.translateService.currentLang,
191
+ fonts: this.options?.fonts ?? []
192
+ }).toPromise();
193
+ this.initCardNumber();
194
+ this.initCardExpiry();
195
+ this.initCardCvc();
196
+ }
197
+ initCardNumber() {
198
+ this.cardNumberElement = this.elements.create("cardNumber", {
199
+ ...this.stripeOptions,
200
+ });
201
+ this.cardNumberElement.on("change", event => {
202
+ this.cardNumberError = event.error ? event.error.message : null;
203
+ });
204
+ this.cardNumberInput.init(this.cardNumberElement);
205
+ }
206
+ initCardExpiry() {
207
+ this.cardExpiryElement = this.elements.create("cardExpiry", {
208
+ ...this.stripeOptions,
209
+ });
210
+ this.cardExpiryElement.on("change", event => {
211
+ this.cardExpiryError = event.error ? event.error.message : null;
212
+ });
213
+ this.cardExpiryInput.init(this.cardExpiryElement);
214
+ }
215
+ initCardCvc() {
216
+ this.cardCvcElement = this.elements.create("cardCvc", {
217
+ ...this.stripeOptions,
218
+ });
219
+ this.cardCvcElement.on("change", event => {
220
+ this.cardCvcError = event.error ? event.error.message : null;
221
+ });
222
+ this.cardCvcInput.init(this.cardCvcElement);
223
+ }
224
+ ngOnDestroy() {
225
+ this.cardNumberElement.unmount();
226
+ this.cardExpiryElement.unmount();
227
+ this.cardCvcElement.unmount();
228
+ }
229
+ patchName(name) {
230
+ this.formGroup.get("name").patchValue(name);
231
+ }
232
+ markAllAsTouched() {
233
+ this.formGroup.markAllAsTouched();
234
+ this.cardCvcInput.markAsTouched();
235
+ this.cardNumberInput.markAsTouched();
236
+ this.cardExpiryInput.markAsTouched();
237
+ }
238
+ getYear() {
239
+ const date = new Date();
240
+ return +date.getFullYear().toString().substr(-2);
241
+ }
242
+ }
243
+ 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 });
244
+ 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: [
245
+ {
246
+ provide: GeneratedFormGroup,
247
+ useFactory: ngxFormGeneratorFactory(StripeForm)
248
+ }
249
+ ], 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"], 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: i5.MatError, selector: "mat-error", inputs: ["id"] }], pipes: { "translate": i3.TranslatePipe }, animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeCardFormComponent, decorators: [{
251
+ type: Component,
252
+ args: [{ selector: "nice-stripe-card-form", encapsulation: ViewEncapsulation.None, providers: [
253
+ {
254
+ provide: GeneratedFormGroup,
255
+ useFactory: ngxFormGeneratorFactory(StripeForm)
256
+ }
257
+ ], 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=\"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"] }]
258
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
259
+ type: Optional
260
+ }, {
261
+ type: Inject,
262
+ args: [NICE_STRIPE_OPTIONS]
263
+ }] }, { type: i1.GeneratedFormGroup }, { type: i2.StripeService }, { type: i3.TranslateService }]; }, propDecorators: { appearance: [{
264
+ type: Input
265
+ }], showIcons: [{
266
+ type: Input
267
+ }], cardNumberInput: [{
268
+ type: ViewChild,
269
+ args: ["cardNumber"]
270
+ }], cardExpiryInput: [{
271
+ type: ViewChild,
272
+ args: ["cardExpiry"]
273
+ }], cardCvcInput: [{
274
+ type: ViewChild,
275
+ args: ["cardCvc"]
276
+ }] } });
277
+
278
+ class NiceStripeModule {
279
+ static forRoot(options) {
280
+ return {
281
+ ngModule: NiceStripeModule,
282
+ providers: [
283
+ {
284
+ provide: NICE_STRIPE_OPTIONS,
285
+ useValue: options
286
+ }
287
+ ]
288
+ };
289
+ }
290
+ }
291
+ NiceStripeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
292
+ NiceStripeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, declarations: [NiceStripeCardElementComponent,
293
+ NiceStripeCardFormComponent], imports: [NgxStripeModule,
294
+ ReactiveFormsModule,
295
+ TranslateModule,
296
+ MatFormFieldModule,
297
+ MatInputModule,
298
+ MatListModule,
299
+ NiceFormErrorModule,
300
+ MatButtonModule,
301
+ CommonModule], exports: [NiceStripeCardFormComponent] });
302
+ NiceStripeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, imports: [[
303
+ NgxStripeModule,
304
+ ReactiveFormsModule,
305
+ TranslateModule,
306
+ MatFormFieldModule,
307
+ MatInputModule,
308
+ MatListModule,
309
+ NiceFormErrorModule,
310
+ MatButtonModule,
311
+ CommonModule
312
+ ]] });
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceStripeModule, decorators: [{
314
+ type: NgModule,
315
+ args: [{
316
+ imports: [
317
+ NgxStripeModule,
318
+ ReactiveFormsModule,
319
+ TranslateModule,
320
+ MatFormFieldModule,
321
+ MatInputModule,
322
+ MatListModule,
323
+ NiceFormErrorModule,
324
+ MatButtonModule,
325
+ CommonModule
326
+ ],
327
+ declarations: [
328
+ NiceStripeCardElementComponent,
329
+ NiceStripeCardFormComponent
330
+ ],
331
+ exports: [
332
+ NiceStripeCardFormComponent
333
+ ]
334
+ }]
335
+ }] });
336
+
337
+ /*
338
+ * Public API Surface of nice-stripe-kit
339
+ */
340
+
341
+ /**
342
+ * Generated bundle index. Do not edit.
343
+ */
344
+
345
+ export { NiceStripeCardElementComponent, NiceStripeCardFormComponent, NiceStripeModule };
346
+ //# sourceMappingURL=recursyve-nice-stripe-kit.v2.mjs.map