@mainmoneyapp/js-angular 0.1.1 → 0.1.5
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/fesm2022/mainmoneyapp-js-angular.mjs +27 -25
- package/fesm2022/mainmoneyapp-js-angular.mjs.map +1 -1
- package/package.json +6 -6
- package/types/mainmoneyapp-js-angular.d.ts +25 -0
- package/types/mainmoneyapp-js-angular.d.ts.map +1 -0
- package/index.d.ts +0 -21
- package/index.d.ts.map +0 -1
- package/mainmoneyapp-js-angular.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, PLATFORM_ID,
|
|
3
|
+
import { input, viewChild, inject, PLATFORM_ID, effect, Component } from '@angular/core';
|
|
4
4
|
import { mountCheckout } from '@mainmoneyapp/js-checkout';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -8,42 +8,44 @@ import { mountCheckout } from '@mainmoneyapp/js-checkout';
|
|
|
8
8
|
* (`angular.json` -> `styles`, or `src/main.ts`).
|
|
9
9
|
*
|
|
10
10
|
* The DOM mount only runs in the browser, so the component is safe under SSR.
|
|
11
|
+
* `colorScheme` follows your theme signal: every change calls `checkout.setColorScheme`, which only flips the
|
|
12
|
+
* palette (the form is not re-rendered, so a focused input keeps its focus and value).
|
|
11
13
|
*/
|
|
12
14
|
class CheckoutWizardComponent {
|
|
13
15
|
constructor() {
|
|
16
|
+
this.checkout = input.required(...(ngDevMode ? [{ debugName: "checkout" }] : /* istanbul ignore next */ []));
|
|
17
|
+
this.logoUrl = input(undefined, ...(ngDevMode ? [{ debugName: "logoUrl" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.colorScheme = input("auto", ...(ngDevMode ? [{ debugName: "colorScheme" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.variant = input("default", ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.host = viewChild.required("host");
|
|
14
21
|
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
22
|
+
effect((onCleanup) => {
|
|
23
|
+
if (!this.isBrowser) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const unmount = mountCheckout(this.host().nativeElement, this.checkout(), {
|
|
27
|
+
logoUrl: this.logoUrl(),
|
|
28
|
+
variant: this.variant(),
|
|
29
|
+
});
|
|
30
|
+
onCleanup(unmount);
|
|
31
|
+
});
|
|
32
|
+
effect(() => {
|
|
33
|
+
if (this.isBrowser) {
|
|
34
|
+
this.checkout().setColorScheme(this.colorScheme());
|
|
35
|
+
}
|
|
36
|
+
});
|
|
15
37
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (changes["checkout"] || changes["logoUrl"]) {
|
|
21
|
-
this.unmount?.();
|
|
22
|
-
this.unmount = mountCheckout(this.host.nativeElement, this.checkout, { logoUrl: this.logoUrl });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
ngOnDestroy() {
|
|
26
|
-
this.unmount?.();
|
|
27
|
-
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: CheckoutWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: CheckoutWizardComponent, isStandalone: true, selector: "mm-checkout-wizard", inputs: { checkout: "checkout", logoUrl: "logoUrl" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div #host></div>", isInline: true }); }
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: CheckoutWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.26", type: CheckoutWizardComponent, isStandalone: true, selector: "mm-checkout-wizard", inputs: { checkout: { classPropertyName: "checkout", publicName: "checkout", isSignal: true, isRequired: true, transformFunction: null }, logoUrl: { classPropertyName: "logoUrl", publicName: "logoUrl", isSignal: true, isRequired: false, transformFunction: null }, colorScheme: { classPropertyName: "colorScheme", publicName: "colorScheme", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #host></div>", isInline: true }); }
|
|
30
40
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: CheckoutWizardComponent, decorators: [{
|
|
32
42
|
type: Component,
|
|
33
43
|
args: [{
|
|
34
44
|
selector: "mm-checkout-wizard",
|
|
35
45
|
standalone: true,
|
|
36
46
|
template: "<div #host></div>",
|
|
37
47
|
}]
|
|
38
|
-
}], propDecorators: { checkout: [{
|
|
39
|
-
type: Input,
|
|
40
|
-
args: [{ required: true }]
|
|
41
|
-
}], logoUrl: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}], host: [{
|
|
44
|
-
type: ViewChild,
|
|
45
|
-
args: ["host", { static: true }]
|
|
46
|
-
}] } });
|
|
48
|
+
}], ctorParameters: () => [], propDecorators: { checkout: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkout", required: true }] }], logoUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoUrl", required: false }] }], colorScheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorScheme", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], host: [{ type: i0.ViewChild, args: ["host", { isSignal: true }] }] } });
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainmoneyapp-js-angular.mjs","sources":["../../src/index.ts","../../src/mainmoneyapp-js-angular.ts"],"sourcesContent":["import { isPlatformBrowser } from \"@angular/common\";\nimport {
|
|
1
|
+
{"version":3,"file":"mainmoneyapp-js-angular.mjs","sources":["../../src/index.ts","../../src/mainmoneyapp-js-angular.ts"],"sourcesContent":["import { isPlatformBrowser } from \"@angular/common\";\nimport { Component, ElementRef, PLATFORM_ID, effect, inject, input, viewChild } from \"@angular/core\";\n\nimport type { Checkout, CheckoutVariant, ColorScheme } from \"@mainmoneyapp/js-checkout\";\nimport { mountCheckout } from \"@mainmoneyapp/js-checkout\";\n\n/**\n * Checkout wizard. Import `@mainmoneyapp/js-checkout/styles.css` once in your app\n * (`angular.json` -> `styles`, or `src/main.ts`).\n *\n * The DOM mount only runs in the browser, so the component is safe under SSR.\n * `colorScheme` follows your theme signal: every change calls `checkout.setColorScheme`, which only flips the\n * palette (the form is not re-rendered, so a focused input keeps its focus and value).\n */\n@Component({\n selector: \"mm-checkout-wizard\",\n standalone: true,\n template: \"<div #host></div>\",\n})\nexport class CheckoutWizardComponent {\n readonly checkout = input.required<Checkout>();\n readonly logoUrl = input<string | undefined>(undefined);\n readonly colorScheme = input<ColorScheme>(\"auto\");\n readonly variant = input<CheckoutVariant>(\"default\");\n private readonly host = viewChild.required<ElementRef<HTMLElement>>(\"host\");\n\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n constructor() {\n effect((onCleanup) => {\n if (!this.isBrowser) {\n return;\n }\n const unmount = mountCheckout(this.host().nativeElement, this.checkout(), {\n logoUrl: this.logoUrl(),\n variant: this.variant(),\n });\n onCleanup(unmount);\n });\n effect(() => {\n if (this.isBrowser) {\n this.checkout().setColorScheme(this.colorScheme());\n }\n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IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,uBAAuB,8sBAFxB,mBAAmB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;4FAElB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,mBAAmB;AAC9B,iBAAA;6dAMqE,MAAM,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACxB5E;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainmoneyapp/js-angular",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Angular checkout wizard for the MainMoney JS/TS frontend SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@angular/common": ">=17",
|
|
29
|
-
"@angular/core": ">=17"
|
|
28
|
+
"@angular/common": ">=17.2",
|
|
29
|
+
"@angular/core": ">=17.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mainmoneyapp/js-checkout": "0.1.
|
|
32
|
+
"@mainmoneyapp/js-checkout": "0.1.5",
|
|
33
33
|
"tslib": "^2.8.1"
|
|
34
34
|
},
|
|
35
35
|
"module": "fesm2022/mainmoneyapp-js-angular.mjs",
|
|
36
|
-
"typings": "
|
|
36
|
+
"typings": "types/mainmoneyapp-js-angular.d.ts",
|
|
37
37
|
"exports": {
|
|
38
38
|
"./package.json": {
|
|
39
39
|
"default": "./package.json"
|
|
40
40
|
},
|
|
41
41
|
".": {
|
|
42
|
-
"types": "./
|
|
42
|
+
"types": "./types/mainmoneyapp-js-angular.d.ts",
|
|
43
43
|
"default": "./fesm2022/mainmoneyapp-js-angular.mjs"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Checkout, ColorScheme, CheckoutVariant } from '@mainmoneyapp/js-checkout';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checkout wizard. Import `@mainmoneyapp/js-checkout/styles.css` once in your app
|
|
6
|
+
* (`angular.json` -> `styles`, or `src/main.ts`).
|
|
7
|
+
*
|
|
8
|
+
* The DOM mount only runs in the browser, so the component is safe under SSR.
|
|
9
|
+
* `colorScheme` follows your theme signal: every change calls `checkout.setColorScheme`, which only flips the
|
|
10
|
+
* palette (the form is not re-rendered, so a focused input keeps its focus and value).
|
|
11
|
+
*/
|
|
12
|
+
declare class CheckoutWizardComponent {
|
|
13
|
+
readonly checkout: _angular_core.InputSignal<Checkout>;
|
|
14
|
+
readonly logoUrl: _angular_core.InputSignal<string | undefined>;
|
|
15
|
+
readonly colorScheme: _angular_core.InputSignal<ColorScheme>;
|
|
16
|
+
readonly variant: _angular_core.InputSignal<CheckoutVariant>;
|
|
17
|
+
private readonly host;
|
|
18
|
+
private readonly isBrowser;
|
|
19
|
+
constructor();
|
|
20
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckoutWizardComponent, never>;
|
|
21
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckoutWizardComponent, "mm-checkout-wizard", never, { "checkout": { "alias": "checkout"; "required": true; "isSignal": true; }; "logoUrl": { "alias": "logoUrl"; "required": false; "isSignal": true; }; "colorScheme": { "alias": "colorScheme"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { CheckoutWizardComponent };
|
|
25
|
+
//# sourceMappingURL=mainmoneyapp-js-angular.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mainmoneyapp-js-angular.d.ts","sources":["../../src/index.ts"],"mappings":";;;AAMA;;;;;;;AAOG;AACH,cAKa,uBAAuB;uBACjB,aAAA,CAAA,WAAA,CAAA,QAAA;sBACD,aAAA,CAAA,WAAA;0BACI,aAAA,CAAA,WAAA,CAAA,WAAA;sBACJ,aAAA,CAAA,WAAA,CAAA,eAAA;AAChB;AAEA;;oDAPW,uBAAuB;sDAAvB,uBAAuB;AA0BnC;;;;","names":[]}
|
package/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
|
|
2
|
-
import type { Checkout } from "@mainmoneyapp/js-checkout";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Checkout wizard. Import `@mainmoneyapp/js-checkout/styles.css` once in your app
|
|
6
|
-
* (`angular.json` -> `styles`, or `src/main.ts`).
|
|
7
|
-
*
|
|
8
|
-
* The DOM mount only runs in the browser, so the component is safe under SSR.
|
|
9
|
-
*/
|
|
10
|
-
export declare class CheckoutWizardComponent implements OnChanges, OnDestroy {
|
|
11
|
-
checkout: Checkout;
|
|
12
|
-
logoUrl?: string;
|
|
13
|
-
host: ElementRef<HTMLElement>;
|
|
14
|
-
private readonly isBrowser;
|
|
15
|
-
private unmount?;
|
|
16
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutWizardComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutWizardComponent, "mm-checkout-wizard", never, { "checkout": { "alias": "checkout"; "required": true; }; "logoUrl": { "alias": "logoUrl"; "required": false; }; }, {}, never, never, true, never>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EAGV,SAAS,EACT,SAAS,EAET,aAAa,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;;AAG1D;;;;;GAKG;AACH,qBAKa,uBAAwB,YAAW,SAAS,EAAE,SAAS;IACvC,QAAQ,EAAG,QAAQ,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACW,IAAI,EAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAEpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0C;IACpE,OAAO,CAAC,OAAO,CAAC,CAAa;IAE7B,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAUzC,WAAW,IAAI,IAAI;yCAlBR,uBAAuB;2CAAvB,uBAAuB;CAqBnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mainmoneyapp-js-angular.d.ts","sourceRoot":"","sources":["../src/mainmoneyapp-js-angular.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,SAAS,CAAC"}
|