@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js → BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-CRsFr9TH.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-CIVSoqFr.js → ContentWithAsideLayout-DczcgSrt.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs +75 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs → Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs} +5 -4
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs} +5 -5
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js} +1 -1
- package/dist/auto-DzZuCneB.mjs +14387 -0
- package/dist/auto-PpnAChnH.js +6 -0
- package/dist/{cloneDeep-Hs8Pp07F.js → cloneDeep-DranHQkY.js} +1 -1
- package/dist/{component-BkmcE85U.mjs → component-DEo_ndpK.mjs} +92 -78
- package/dist/component-XHQYFLA_.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +96 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +132 -5
- package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +580 -5
- package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
- package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +102 -5
- package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
- package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +236 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +150 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
- package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js} +41 -51
- package/dist/core/configuration.d.ts +2 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/registry.d.ts +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +40 -34
- package/dist/invoices-BW1notiX.js +1 -0
- package/dist/{invoices-C31Wz1Bu.mjs → invoices-M5oYVch6.mjs} +1 -1
- package/dist/{paymentMethods-CzUqDlvc.js → paymentMethods-BX80t2zk.js} +1 -1
- package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-CqKUfc3w.mjs} +1 -1
- package/dist/{payments-C3LPk9k9.js → payments-BHv4hCeJ.js} +1 -1
- package/dist/{payments-NtWI8KlU.mjs → payments-CosaPZwo.mjs} +1 -1
- package/dist/registry-BwKEYOf7.js +1 -0
- package/dist/registry-Cag1Jj7P.mjs +143 -0
- package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +5140 -5
- package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +134 -5
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1012 -0
- package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-Bs4DIE8f.mjs} +1 -1
- package/dist/{subscriptions-CqK7t-fF.js → subscriptions-CnxvsBXd.js} +1 -1
- package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-CgRcOqv3.mjs} +1 -1
- package/dist/useActionDispatchProvider-Cru69mAl.js +1 -0
- package/dist/{useCustomer-Dp8sGHI0.js → useCustomer-B0NK96dA.js} +1 -1
- package/dist/{useCustomer-BRY0tuBH.mjs → useCustomer-DlcjY3fP.mjs} +2 -2
- package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → useCustomerPaymentMethodOptions-BzEquyUV.mjs} +7 -6
- package/dist/{useCustomerPaymentMethodOptions-DYpMDnJR.js → useCustomerPaymentMethodOptions-C-8BLzqb.js} +1 -1
- package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-C7ToTmZK.mjs} +9 -7
- package/dist/useIncrementalLoading-D60Vttil.js +1 -0
- package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-CcueV3We.mjs} +2 -2
- package/dist/{useInvoiceData-DImEH1ca.js → useInvoiceData-DstXfI7t.js} +1 -1
- package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CXng3aUm.mjs} +4 -4
- package/dist/{useInvoicesList-BZQ9Y0qN.js → useInvoicesList-DmzjgMlW.js} +1 -1
- package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-DCGVRXA4.js} +1 -1
- package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-Db-1R6rI.mjs} +2 -2
- package/dist/{useService-Dz13Nxbi.mjs → useService-B4qv5N2D.mjs} +14 -5
- package/dist/useService-D-CUtlp3.js +1 -0
- package/dist/useWalletBalanceItems-BZyiAhcV.js +1 -0
- package/dist/useWalletBalanceItems-CHkLaccm.mjs +105 -0
- package/package.json +16 -3
- package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
- package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
- package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
- package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
- package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
- package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
- package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
- package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
- package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
- package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
- package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
- package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
- package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
- package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
- package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
- package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
- package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
- package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
- package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
- package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
- package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
- package/dist/auto-B_36W1Fc.js +0 -6
- package/dist/auto-BfMZdgp-.mjs +0 -14207
- package/dist/component-Df5eNqYX.js +0 -1
- package/dist/invoices-8M_3ur_U.js +0 -1
- package/dist/registry-By94DXE2.js +0 -1
- package/dist/registry-shRKDl3K.mjs +0 -127
- package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
- package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
- package/dist/useService-bNNi4GB8.js +0 -1
package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js}
RENAMED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps
|
|
2
|
-
import {
|
|
3
|
-
import { _ as _sfc_main$3 } from "
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
1
|
+
import { defineComponent, openBlock, createBlock, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
|
|
3
|
+
import { _ as _sfc_main$3, u as useCustomerWalletBalances, a as useWalletBalanceItems } from "../../useWalletBalanceItems-CHkLaccm.mjs";
|
|
4
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
5
|
+
import { p as _sfc_main$4, q as defineCustomElement, o as getComponentName } from "../../component-DEo_ndpK.mjs";
|
|
6
6
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7
|
-
__name: "
|
|
7
|
+
__name: "WalletBalances",
|
|
8
8
|
props: {
|
|
9
|
-
|
|
9
|
+
hasError: { type: Boolean },
|
|
10
10
|
isLoading: { type: Boolean },
|
|
11
|
-
|
|
11
|
+
walletBalances: { type: Array }
|
|
12
12
|
},
|
|
13
13
|
setup(__props) {
|
|
14
14
|
return (_ctx, _cache) => {
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})) : (openBlock(), createBlock(_sfc_main$4, {
|
|
21
|
-
key: 1,
|
|
22
|
-
invoice: __props.invoice
|
|
23
|
-
}, null, 8, ["invoice"]));
|
|
15
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
16
|
+
"has-error": __props.hasError,
|
|
17
|
+
"is-loading": __props.isLoading,
|
|
18
|
+
"wallet-balances": __props.walletBalances
|
|
19
|
+
}, null, 8, ["has-error", "is-loading", "wallet-balances"]);
|
|
24
20
|
};
|
|
25
21
|
}
|
|
26
22
|
});
|
|
27
23
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
28
|
-
__name: "
|
|
24
|
+
__name: "WalletBalances.entry.view",
|
|
29
25
|
props: {
|
|
26
|
+
portalObject: { type: Object },
|
|
30
27
|
environment: { type: String },
|
|
31
28
|
locale: { type: String },
|
|
32
29
|
dateLocale: { type: String },
|
|
@@ -39,26 +36,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
39
36
|
logLevel: { type: String },
|
|
40
37
|
onLog: { type: Function },
|
|
41
38
|
allowedPortalTypes: { type: Array },
|
|
42
|
-
portalObject: { type: Object },
|
|
43
39
|
customElementName: { type: String },
|
|
44
|
-
branding: { type: Object }
|
|
45
|
-
configuration: { type: Object }
|
|
40
|
+
branding: { type: Object }
|
|
46
41
|
},
|
|
47
42
|
setup(__props) {
|
|
48
43
|
const props = __props;
|
|
49
|
-
const
|
|
44
|
+
const customerId = props.portalObject.customer_id;
|
|
45
|
+
const customerWalletBalances = useCustomerWalletBalances({ customerId });
|
|
46
|
+
const walletBalanceItems = useWalletBalanceItems(customerWalletBalances.walletBalances);
|
|
47
|
+
const { isLoading } = useLoadInitialData(customerWalletBalances.fetch());
|
|
50
48
|
return (_ctx, _cache) => {
|
|
51
|
-
var _a;
|
|
52
49
|
return renderSlot(_ctx.$slots, "default", {
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
customerWalletBalances: unref(customerWalletBalances),
|
|
51
|
+
walletBalanceItems: unref(walletBalanceItems),
|
|
52
|
+
isLoading: unref(isLoading)
|
|
55
53
|
});
|
|
56
54
|
};
|
|
57
55
|
}
|
|
58
56
|
});
|
|
59
57
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
|
-
__name: "
|
|
58
|
+
__name: "WalletBalances.entry",
|
|
61
59
|
props: {
|
|
60
|
+
portalObject: { type: Object },
|
|
62
61
|
environment: { type: String },
|
|
63
62
|
locale: { type: String },
|
|
64
63
|
dateLocale: { type: String },
|
|
@@ -71,26 +70,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
70
|
logLevel: { type: String },
|
|
72
71
|
onLog: { type: Function },
|
|
73
72
|
allowedPortalTypes: { type: Array },
|
|
74
|
-
portalObject: { type: Object },
|
|
75
73
|
customElementName: { type: String },
|
|
76
|
-
branding: { type: Object }
|
|
77
|
-
configuration: { type: Object }
|
|
74
|
+
branding: { type: Object }
|
|
78
75
|
},
|
|
79
76
|
setup(__props) {
|
|
80
|
-
var _a;
|
|
81
|
-
const props = __props;
|
|
82
|
-
if (!((_a = props.configuration) == null ? void 0 : _a.invoiceId)) {
|
|
83
|
-
throw new Error("Missing invoice id");
|
|
84
|
-
}
|
|
85
77
|
return (_ctx, _cache) => {
|
|
86
|
-
var
|
|
87
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
78
|
+
var _a, _b, _c, _d;
|
|
79
|
+
return openBlock(), createBlock(unref(_sfc_main$4), {
|
|
88
80
|
"custom-element-name": unref(COMPONENT_NAME),
|
|
89
81
|
environment: __props.environment,
|
|
90
82
|
locale: __props.locale,
|
|
91
83
|
"portal-object": __props.portalObject,
|
|
92
84
|
"allowed-portal-types": ["CUSTOMER"],
|
|
93
|
-
"primary-color": (_b = (
|
|
85
|
+
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
94
86
|
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
95
87
|
"experimental-features": __props.experimentalFeatures,
|
|
96
88
|
"log-level": __props.logLevel,
|
|
@@ -99,13 +91,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
91
|
}, {
|
|
100
92
|
default: withCtx(() => [
|
|
101
93
|
createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
102
|
-
default: withCtx(({
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
default: withCtx(({ customerWalletBalances, walletBalanceItems, isLoading }) => [
|
|
95
|
+
createVNode(_sfc_main$2, {
|
|
96
|
+
"has-error": customerWalletBalances.apiStatus.value === unref(ApiStatus).Failed,
|
|
105
97
|
"is-loading": isLoading,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, null, 8, ["is-loading", "invoice", "configuration"])) : createCommentVNode("", true)
|
|
98
|
+
"wallet-balances": walletBalanceItems
|
|
99
|
+
}, null, 8, ["has-error", "is-loading", "wallet-balances"])
|
|
109
100
|
]),
|
|
110
101
|
_: 1
|
|
111
102
|
}, 16)
|
|
@@ -115,16 +106,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
115
106
|
};
|
|
116
107
|
}
|
|
117
108
|
});
|
|
118
|
-
const
|
|
119
|
-
const COMPONENT_NAME = getComponentName("
|
|
120
|
-
const
|
|
109
|
+
const SolvimonWalletBalances = defineCustomElement(_sfc_main);
|
|
110
|
+
const COMPONENT_NAME = getComponentName("wallet-balances");
|
|
111
|
+
const defineSolvimonWalletBalances = () => {
|
|
121
112
|
if (!customElements.get(COMPONENT_NAME)) {
|
|
122
|
-
customElements.define(COMPONENT_NAME,
|
|
113
|
+
customElements.define(COMPONENT_NAME, SolvimonWalletBalances);
|
|
123
114
|
}
|
|
124
115
|
};
|
|
125
116
|
export {
|
|
126
|
-
COMPONENT_NAME
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
defineSolvimonInvoiceDetails as d
|
|
117
|
+
COMPONENT_NAME,
|
|
118
|
+
SolvimonWalletBalances,
|
|
119
|
+
defineSolvimonWalletBalances
|
|
130
120
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { CoreConfiguration, SolvimonMountConfig } from './types';
|
|
2
|
-
export declare function createSolvimonCore
|
|
2
|
+
export declare function createSolvimonCore(): CoreConfiguration<SolvimonMountConfig>;
|
|
3
|
+
export declare function createSolvimonCore<TConfig extends SolvimonMountConfig>(config: TConfig): CoreConfiguration<TConfig>;
|
package/dist/core/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../registry-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../registry-BwKEYOf7.js");exports.createSolvimonCore=e.createSolvimonCore,exports.getRegisteredComponentIds=e.getRegisteredComponentIds,exports.getRegisteredScreenIds=e.getRegisteredScreenIds;
|
package/dist/core/index.es.js
CHANGED
package/dist/core/registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
1
|
+
import { Component } from '../../../node_modules/vue/dist/vue.d.ts';
|
|
2
2
|
import { RegisteredScreenId, RegisteredComponentId } from './types';
|
|
3
3
|
export declare function getScreenComponent(id: string): Component | undefined;
|
|
4
4
|
export declare function getComponent(id: string): Component | undefined;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ import { SolvimonPaymentMethodFormEntryProps } from '../components/PaymentMethod
|
|
|
10
10
|
import { SolvimonPaymentHistoryEntryProps } from '../components/PaymentHistory/PaymentHistory.entry.types';
|
|
11
11
|
import { SolvimonSubscriptionSchedulesEntryProps } from '../components/SubscriptionSchedules/SubscriptionSchedules.entry.types';
|
|
12
12
|
import { SolvimonSubscriptionsListEntryProps } from '../components/SubscriptionsList/SubscriptionsList.entry.types';
|
|
13
|
+
import { SolvimonWalletBalancesEntryProps } from '../components/WalletBalances/WalletBalances.entry.types';
|
|
13
14
|
import { SolvimonCheckoutEntryProps } from '../screens/Checkout/Checkout.entry.types';
|
|
14
15
|
import { SolvimonCustomerOverviewEntryProps } from '../screens/CustomerOverview/CustomerOverview.entry.types';
|
|
16
|
+
import { SolvimonUpgradeSubscriptionEntryProps } from '../screens/UpgradeSubscription/UpgradeSubscription.entry.types';
|
|
15
17
|
/**
|
|
16
18
|
* Shared configuration passed to all mounted Solvimon components and screens.
|
|
17
19
|
* Extends the base entry props (environment, locale, branding, etc.).
|
|
@@ -42,6 +44,7 @@ interface RegisteredComponentEntryPropsById {
|
|
|
42
44
|
'subscription-schedules': SolvimonSubscriptionSchedulesEntryProps;
|
|
43
45
|
'subscriptions-list': SolvimonSubscriptionsListEntryProps;
|
|
44
46
|
'customer-payment-methods': SolvimonCustomerPaymentMethodsEntryProps;
|
|
47
|
+
'wallet-balances': SolvimonWalletBalancesEntryProps;
|
|
45
48
|
'billing-information': SolvimonBillingInformationEntryProps;
|
|
46
49
|
'billing-information-form': SolvimonBillingInformationFormEntryProps;
|
|
47
50
|
'payment-method-form': SolvimonPaymentMethodFormEntryProps;
|
|
@@ -49,6 +52,7 @@ interface RegisteredComponentEntryPropsById {
|
|
|
49
52
|
interface RegisteredScreenEntryPropsById {
|
|
50
53
|
checkout: SolvimonCheckoutEntryProps;
|
|
51
54
|
'customer-overview': SolvimonCustomerOverviewEntryProps;
|
|
55
|
+
'upgrade-subscription': SolvimonUpgradeSubscriptionEntryProps;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Registered screen ids that can be used with createScreen.
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./registry-BwKEYOf7.js"),e=require("./screens/Checkout/Checkout.cjs.js"),i=require("./screens/CustomerOverview/CustomerOverview.cjs.js"),n=require("./screens/UpgradeSubscription/UpgradeSubscription.cjs.js"),s=require("./components/BillingInformation/BillingInformation.cjs.js"),t=require("./components/BillingInformationForm/BillingInformationForm.cjs.js"),r=require("./components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js"),m=require("./components/WalletBalances/WalletBalances.cjs.js"),l=require("./components/InvoiceDetails/InvoiceDetails.cjs.js"),S=require("./components/InvoicesList/InvoicesList.cjs.js"),c=require("./components/PaymentHistory/PaymentHistory.cjs.js"),v=require("./components/SubscriptionSchedules/SubscriptionSchedules.cjs.js"),p=require("./components/SubscriptionsList/SubscriptionsList.cjs.js"),a=require("./components/PaymentMethodForm/PaymentMethodForm.cjs.js");exports.createSolvimonCore=o.createSolvimonCore,exports.getRegisteredComponentIds=o.getRegisteredComponentIds,exports.getRegisteredScreenIds=o.getRegisteredScreenIds,exports.SolvimonCheckout=e.SolvimonCheckout,exports.defineSolvimonCheckout=e.defineSolvimonCheckout,exports.SolvimonCustomerOverview=i.SolvimonCustomerOverview,exports.defineSolvimonCustomerOverview=i.defineSolvimonCustomerOverview,exports.SolvimonUpgradeSubscription=n.SolvimonUpgradeSubscription,exports.defineSolvimonUpgradeSubscription=n.defineSolvimonUpgradeSubscription,exports.SolvimonBillingInformation=s.SolvimonBillingInformation,exports.defineSolvimonBillingInformation=s.defineSolvimonBillingInformation,exports.SolvimonBillingInformationForm=t.SolvimonBillingInformationForm,exports.defineSolvimonBillingInformationForm=t.defineSolvimonBillingInformationForm,exports.SolvimonCustomerPaymentMethods=r.SolvimonCustomerPaymentMethods,exports.defineSolvimonCustomerPaymentMethods=r.defineSolvimonCustomerPaymentMethods,exports.SolvimonWalletBalances=m.SolvimonWalletBalances,exports.defineSolvimonWalletBalances=m.defineSolvimonWalletBalances,exports.SolvimonInvoiceDetails=l.SolvimonInvoiceDetails,exports.defineSolvimonInvoiceDetails=l.defineSolvimonInvoiceDetails,exports.SolvimonInvoicesList=S.SolvimonInvoicesList,exports.defineSolvimonInvoicesList=S.defineSolvimonInvoicesList,exports.SolvimonPaymentHistory=c.SolvimonPaymentHistory,exports.defineSolvimonPaymentHistory=c.defineSolvimonPaymentHistory,exports.SolvimonSubscriptionSchedules=v.SolvimonSubscriptionSchedules,exports.defineSolvimonSubscriptionSchedules=v.defineSolvimonSubscriptionSchedules,exports.SolvimonSubscriptionsList=p.SolvimonSubscriptionsList,exports.defineSolvimonSubscriptionsList=p.defineSolvimonSubscriptionsList,exports.SolvimonPaymentMethodForm=a.SolvimonPaymentMethodForm,exports.defineSolvimonPaymentMethodForm=a.defineSolvimonPaymentMethodForm;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ export { createSolvimonCore, getRegisteredScreenIds, getRegisteredComponentIds,
|
|
|
2
2
|
export type { SolvimonMountConfig, CoreConfiguration, ComponentConfigurationById, ScreenConfigurationById, ComponentMountConfiguration, ScreenMountConfiguration, SolvimonMountInstance, RegisteredScreenId, RegisteredComponentId, ActionRequestDetail, RequestActionEvent, } from './public/core';
|
|
3
3
|
export { SolvimonCheckout, defineSolvimonCheckout, } from './public/screens/Checkout/Checkout.entry.ce';
|
|
4
4
|
export { SolvimonCustomerOverview, defineSolvimonCustomerOverview, } from './public/screens/CustomerOverview/CustomerOverview.entry.ce';
|
|
5
|
+
export { SolvimonUpgradeSubscription, defineSolvimonUpgradeSubscription, } from './public/screens/UpgradeSubscription/UpgradeSubscription.entry.ce';
|
|
5
6
|
export { SolvimonBillingInformation, defineSolvimonBillingInformation, } from './public/components/BillingInformation/BillingInformation.entry.ce';
|
|
6
7
|
export { SolvimonBillingInformationForm, defineSolvimonBillingInformationForm, } from './public/components/BillingInformationForm/BillingInformationForm.entry.ce';
|
|
7
8
|
export { SolvimonCustomerPaymentMethods, defineSolvimonCustomerPaymentMethods, } from './public/components/CustomerPaymentMethods/CustomerPaymentMethods.entry.ce';
|
|
9
|
+
export { SolvimonWalletBalances, defineSolvimonWalletBalances, } from './public/components/WalletBalances/WalletBalances.entry.ce';
|
|
8
10
|
export { SolvimonInvoiceDetails, defineSolvimonInvoiceDetails, } from './public/components/InvoiceDetails/InvoiceDetails.entry.ce';
|
|
9
11
|
export { SolvimonInvoicesList, defineSolvimonInvoicesList, } from './public/components/InvoicesList/InvoicesList.entry.ce';
|
|
10
12
|
export { SolvimonPaymentHistory, defineSolvimonPaymentHistory, } from './public/components/PaymentHistory/PaymentHistory.entry.ce';
|
package/dist/index.es.js
CHANGED
|
@@ -1,39 +1,45 @@
|
|
|
1
|
-
import { c, g, a } from "./registry-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { c, g, a } from "./registry-Cag1Jj7P.mjs";
|
|
2
|
+
import { SolvimonCheckout, defineSolvimonCheckout } from "./screens/Checkout/Checkout.es.js";
|
|
3
|
+
import { SolvimonCustomerOverview, defineSolvimonCustomerOverview } from "./screens/CustomerOverview/CustomerOverview.es.js";
|
|
4
|
+
import { SolvimonUpgradeSubscription, defineSolvimonUpgradeSubscription } from "./screens/UpgradeSubscription/UpgradeSubscription.es.js";
|
|
5
|
+
import { SolvimonBillingInformation, defineSolvimonBillingInformation } from "./components/BillingInformation/BillingInformation.es.js";
|
|
6
|
+
import { SolvimonBillingInformationForm, defineSolvimonBillingInformationForm } from "./components/BillingInformationForm/BillingInformationForm.es.js";
|
|
7
|
+
import { SolvimonCustomerPaymentMethods, defineSolvimonCustomerPaymentMethods } from "./components/CustomerPaymentMethods/CustomerPaymentMethods.es.js";
|
|
8
|
+
import { SolvimonWalletBalances, defineSolvimonWalletBalances } from "./components/WalletBalances/WalletBalances.es.js";
|
|
9
|
+
import { SolvimonInvoiceDetails, defineSolvimonInvoiceDetails } from "./components/InvoiceDetails/InvoiceDetails.es.js";
|
|
10
|
+
import { SolvimonInvoicesList, defineSolvimonInvoicesList } from "./components/InvoicesList/InvoicesList.es.js";
|
|
11
|
+
import { SolvimonPaymentHistory, defineSolvimonPaymentHistory } from "./components/PaymentHistory/PaymentHistory.es.js";
|
|
12
|
+
import { SolvimonSubscriptionSchedules, defineSolvimonSubscriptionSchedules } from "./components/SubscriptionSchedules/SubscriptionSchedules.es.js";
|
|
13
|
+
import { SolvimonSubscriptionsList, defineSolvimonSubscriptionsList } from "./components/SubscriptionsList/SubscriptionsList.es.js";
|
|
14
|
+
import { SolvimonPaymentMethodForm, defineSolvimonPaymentMethodForm } from "./components/PaymentMethodForm/PaymentMethodForm.es.js";
|
|
13
15
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
SolvimonBillingInformation,
|
|
17
|
+
SolvimonBillingInformationForm,
|
|
18
|
+
SolvimonCheckout,
|
|
19
|
+
SolvimonCustomerOverview,
|
|
20
|
+
SolvimonCustomerPaymentMethods,
|
|
21
|
+
SolvimonInvoiceDetails,
|
|
22
|
+
SolvimonInvoicesList,
|
|
23
|
+
SolvimonPaymentHistory,
|
|
24
|
+
SolvimonPaymentMethodForm,
|
|
25
|
+
SolvimonSubscriptionSchedules,
|
|
26
|
+
SolvimonSubscriptionsList,
|
|
27
|
+
SolvimonUpgradeSubscription,
|
|
28
|
+
SolvimonWalletBalances,
|
|
25
29
|
c as createSolvimonCore,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
defineSolvimonBillingInformation,
|
|
31
|
+
defineSolvimonBillingInformationForm,
|
|
32
|
+
defineSolvimonCheckout,
|
|
33
|
+
defineSolvimonCustomerOverview,
|
|
34
|
+
defineSolvimonCustomerPaymentMethods,
|
|
35
|
+
defineSolvimonInvoiceDetails,
|
|
36
|
+
defineSolvimonInvoicesList,
|
|
37
|
+
defineSolvimonPaymentHistory,
|
|
38
|
+
defineSolvimonPaymentMethodForm,
|
|
39
|
+
defineSolvimonSubscriptionSchedules,
|
|
40
|
+
defineSolvimonSubscriptionsList,
|
|
41
|
+
defineSolvimonUpgradeSubscription,
|
|
42
|
+
defineSolvimonWalletBalances,
|
|
37
43
|
g as getRegisteredComponentIds,
|
|
38
44
|
a as getRegisteredScreenIds
|
|
39
45
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=require("./component-XHQYFLA_.js");exports.createInvoicesService=function(){const i=n.createRequestService(),e=n.useConfig();return{getInvoice:function(n){return i({url:`${e.apiUrls.transaction}/portal/invoices/${n}`})},getInvoices:function({customerId:t,pagination:r,query:o}){const a=n.withPagination({customer_id:t,...o??{}},r),c=new URL(`${e.apiUrls.transaction}/portal/invoices`);return Object.entries(a).forEach(([n,i])=>{null!=i&&(Array.isArray(i)?i.forEach(i=>{c.searchParams.append(`${n}[]`,`${i}`)}):c.searchParams.append(n,`${i}`))}),i({url:c.toString(),isCollection:!0})},getInvoicePdf:async function(t){return i({url:`${e.apiUrls.transaction}/portal/invoices/${t}/pdf`,options:{headers:{"Content-Type":"application/pdf"}}}).then(i=>{const e=new Blob([i],{type:"application/pdf"});n.downloadFile(e,`invoice-${t}.pdf`)})},getInvoicePreview:function({customer:n,pricingPlanSubscriptionId:t,startAt:r,customizations:o,pricing_plan_schedule_customizations:a}){return i({url:`${e.apiUrls.transaction}/portal/invoices/preview`,options:{method:"POST"},data:{template_pricing_plan_subscription_id:t,...r&&{start_at:r},...o&&{pricing_plan_schedule_customizations:o},...a&&{pricing_plan_schedule_customizations:a},customer_details:{...n,reference:"preview"}}})}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createRequestService, u as useConfig, h as downloadFile, a as withPagination } from "./component-
|
|
1
|
+
import { c as createRequestService, u as useConfig, h as downloadFile, a as withPagination } from "./component-DEo_ndpK.mjs";
|
|
2
2
|
function createInvoicesService() {
|
|
3
3
|
const request = createRequestService();
|
|
4
4
|
const config = useConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("./component-
|
|
1
|
+
const t=require("./component-XHQYFLA_.js");exports.createPaymentMethodsService=function(){const e=t.createRequestService(),n=t.useConfig();return{getPaymentMethods:function({customerId:o,pagination:r,query:i}){const a=t.withPagination({customer_id:o,...i??{}},r),s=new URL(`${n.apiUrls.config}/portal/payment-methods`);return Object.entries(a).forEach(([t,e])=>{null!=e&&(Array.isArray(e)?e.forEach(e=>{s.searchParams.append(`${t}[]`,`${e}`)}):s.searchParams.append(t,`${e}`))}),e({url:s.toString(),isCollection:!0})},getPaymentMethodOptions:function({customerId:t,country:o,subscriptionId:r,amount:i}){return e({url:`${n.apiUrls.config}/portal/payment-method-options`,options:{method:"POST"},data:{...t&&{customer_id:t},...o&&{country:o},...r&&{pricing_plan_subscription_id:r},amount:i}})},tokenizePaymentMethod:function(t){return e({url:`${n.apiUrls.config}/portal/payment-methods/tokenize`,options:{method:"POST"},data:t})}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createRequestService, u as useConfig, a as withPagination } from "./component-
|
|
1
|
+
import { c as createRequestService, u as useConfig, a as withPagination } from "./component-DEo_ndpK.mjs";
|
|
2
2
|
function createPaymentMethodsService() {
|
|
3
3
|
const request = createRequestService();
|
|
4
4
|
const config = useConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("./component-
|
|
1
|
+
const t=require("./component-XHQYFLA_.js"),e="/portal/payments";exports.createPaymentsService=()=>{const a=t.createRequestService(),n=t.useConfig();return{getPayments:function(t){return a({url:`${n.apiUrls.transaction}${e}`,query:{invoice_id:t},isCollection:!0})},getPaymentDetails:function({paymentAcceptorId:t,paymentGatewayVariant:r,adyen:i}){return a({url:`${n.apiUrls.transaction}${e}/verify-details`,options:{method:"POST"},data:{payment_acceptor_id:t,payment_gateway_variant:r,adyen:i}})},authorizePayment:function(t){return a({url:`${n.apiUrls.transaction}${e}/authorize`,options:{method:"POST"},data:t})}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createRequestService, u as useConfig } from "./component-
|
|
1
|
+
import { c as createRequestService, u as useConfig } from "./component-DEo_ndpK.mjs";
|
|
2
2
|
const BASE_URL = "/portal/payments";
|
|
3
3
|
const createPaymentsService = () => {
|
|
4
4
|
const request = createRequestService();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./components/PaymentMethodForm/PaymentMethodForm.cjs.js"),n=require("./screens/CustomerOverview/CustomerOverview.cjs.js"),o=require("./screens/Checkout/Checkout.cjs.js"),i=require("./screens/UpgradeSubscription/UpgradeSubscription.cjs.js"),t=require("./components/Invoice/Invoice.cjs.js"),r=require("./components/InvoiceDetails/InvoiceDetails.cjs.js"),s=require("./components/InvoicesList/InvoicesList.cjs.js"),c=require("./components/PaymentHistory/PaymentHistory.cjs.js"),m=require("./components/SubscriptionsList/SubscriptionsList.cjs.js"),u=require("./components/SubscriptionSchedules/SubscriptionSchedules.cjs.js"),l=require("./components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js"),a=require("./components/WalletBalances/WalletBalances.cjs.js"),p=require("./components/BillingInformation/BillingInformation.cjs.js"),v=require("./components/BillingInformationForm/BillingInformationForm.cjs.js"),d=require("./component-XHQYFLA_.js");require("vue"),require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js");const f={"customer-overview":n.defineSolvimonCustomerOverview,checkout:o.defineSolvimonCheckout,"upgrade-subscription":i.defineSolvimonUpgradeSubscription},j={invoice:t.defineSolvimonInvoice,"invoice-details":r.defineSolvimonInvoiceDetails,"invoices-list":s.defineSolvimonInvoicesList,"payment-history":c.defineSolvimonPaymentHistory,"subscriptions-list":m.defineSolvimonSubscriptionsList,"subscription-schedules":u.defineSolvimonSubscriptionSchedules,"customer-payment-methods":l.defineSolvimonCustomerPaymentMethods,"wallet-balances":a.defineSolvimonWalletBalances,"billing-information":p.defineSolvimonBillingInformation,"billing-information-form":v.defineSolvimonBillingInformationForm,"payment-method-form":e.defineSolvimonPaymentMethodForm};function S(e,n){const o="screen"===n?(i=e,Object.hasOwn(f,i)&&f[e]):function(e){return Object.hasOwn(j,e)}(e)&&j[e];var i;if(!o)throw new Error(`Solvimon: unknown ${n} id "${e}". Registered ${n}s: ${Object.keys("screen"===n?f:j).join(", ")}.`);o()}function b(e,n,o,i){const t=function(e){if("string"==typeof e){const n=document.querySelector(e);if(!n)throw new Error(`Solvimon: container not found for selector "${e}"`);return n}return e}(e);S(n,o);const r=(s=n,d.getComponentName(s));var s;const c=document.createElement(r);return function(e,n){const o={};for(const[i,t]of Object.entries(n))void 0!==t&&(o[i]=t);Object.assign(e,o)}(c,i),t.appendChild(c),{unmount(){c.remove()}}}function h(e){const{container:n,...o}=e;return{container:n,props:Object.fromEntries(Object.entries(o))}}function g(e,n){return{...e,...n}}const y=["customer-overview","checkout","upgrade-subscription"],q=["invoice","invoice-details","invoices-list","payment-history","subscriptions-list","subscription-schedules","customer-payment-methods","wallet-balances","billing-information","billing-information-form","payment-method-form"];exports.createSolvimonCore=function(e={}){return{config:e,createComponent(n,o){const{container:i,props:t}=h(o);return b(i,n,"component",g(e,t)).unmount},createScreen(n,o){const{container:i,props:t}=h(o);return b(i,n,"screen",g(e,t)).unmount}}},exports.getRegisteredComponentIds=function(){return[...q]},exports.getRegisteredScreenIds=function(){return[...y]};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { defineSolvimonPaymentMethodForm } from "./components/PaymentMethodForm/PaymentMethodForm.es.js";
|
|
2
|
+
import { defineSolvimonCustomerOverview } from "./screens/CustomerOverview/CustomerOverview.es.js";
|
|
3
|
+
import { defineSolvimonCheckout } from "./screens/Checkout/Checkout.es.js";
|
|
4
|
+
import { defineSolvimonUpgradeSubscription } from "./screens/UpgradeSubscription/UpgradeSubscription.es.js";
|
|
5
|
+
import { defineSolvimonInvoice } from "./components/Invoice/Invoice.es.js";
|
|
6
|
+
import { defineSolvimonInvoiceDetails } from "./components/InvoiceDetails/InvoiceDetails.es.js";
|
|
7
|
+
import { defineSolvimonInvoicesList } from "./components/InvoicesList/InvoicesList.es.js";
|
|
8
|
+
import { defineSolvimonPaymentHistory } from "./components/PaymentHistory/PaymentHistory.es.js";
|
|
9
|
+
import { defineSolvimonSubscriptionsList } from "./components/SubscriptionsList/SubscriptionsList.es.js";
|
|
10
|
+
import { defineSolvimonSubscriptionSchedules } from "./components/SubscriptionSchedules/SubscriptionSchedules.es.js";
|
|
11
|
+
import { defineSolvimonCustomerPaymentMethods } from "./components/CustomerPaymentMethods/CustomerPaymentMethods.es.js";
|
|
12
|
+
import { defineSolvimonWalletBalances } from "./components/WalletBalances/WalletBalances.es.js";
|
|
13
|
+
import { defineSolvimonBillingInformation } from "./components/BillingInformation/BillingInformation.es.js";
|
|
14
|
+
import { defineSolvimonBillingInformationForm } from "./components/BillingInformationForm/BillingInformationForm.es.js";
|
|
15
|
+
import { o as getComponentName } from "./component-DEo_ndpK.mjs";
|
|
16
|
+
import "vue";
|
|
17
|
+
import "./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs";
|
|
18
|
+
const SCREEN_DEFINERS = {
|
|
19
|
+
"customer-overview": defineSolvimonCustomerOverview,
|
|
20
|
+
checkout: defineSolvimonCheckout,
|
|
21
|
+
"upgrade-subscription": defineSolvimonUpgradeSubscription
|
|
22
|
+
};
|
|
23
|
+
const COMPONENT_DEFINERS = {
|
|
24
|
+
invoice: defineSolvimonInvoice,
|
|
25
|
+
"invoice-details": defineSolvimonInvoiceDetails,
|
|
26
|
+
"invoices-list": defineSolvimonInvoicesList,
|
|
27
|
+
"payment-history": defineSolvimonPaymentHistory,
|
|
28
|
+
"subscriptions-list": defineSolvimonSubscriptionsList,
|
|
29
|
+
"subscription-schedules": defineSolvimonSubscriptionSchedules,
|
|
30
|
+
"customer-payment-methods": defineSolvimonCustomerPaymentMethods,
|
|
31
|
+
"wallet-balances": defineSolvimonWalletBalances,
|
|
32
|
+
"billing-information": defineSolvimonBillingInformation,
|
|
33
|
+
"billing-information-form": defineSolvimonBillingInformationForm,
|
|
34
|
+
"payment-method-form": defineSolvimonPaymentMethodForm
|
|
35
|
+
};
|
|
36
|
+
function isRegisteredScreenId(id) {
|
|
37
|
+
return Object.hasOwn(SCREEN_DEFINERS, id);
|
|
38
|
+
}
|
|
39
|
+
function isRegisteredComponentId(id) {
|
|
40
|
+
return Object.hasOwn(COMPONENT_DEFINERS, id);
|
|
41
|
+
}
|
|
42
|
+
function getCustomElementTagName(viewId) {
|
|
43
|
+
return getComponentName(viewId);
|
|
44
|
+
}
|
|
45
|
+
function ensureCustomElementDefined(viewId, type) {
|
|
46
|
+
const defineFn = type === "screen" ? isRegisteredScreenId(viewId) && SCREEN_DEFINERS[viewId] : isRegisteredComponentId(viewId) && COMPONENT_DEFINERS[viewId];
|
|
47
|
+
if (!defineFn) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Solvimon: unknown ${type} id "${viewId}". Registered ${type}s: ${Object.keys(
|
|
50
|
+
type === "screen" ? SCREEN_DEFINERS : COMPONENT_DEFINERS
|
|
51
|
+
).join(", ")}.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
defineFn();
|
|
55
|
+
}
|
|
56
|
+
function resolveContainer(container) {
|
|
57
|
+
if (typeof container === "string") {
|
|
58
|
+
const el = document.querySelector(container);
|
|
59
|
+
if (!el) {
|
|
60
|
+
throw new Error(`Solvimon: container not found for selector "${container}"`);
|
|
61
|
+
}
|
|
62
|
+
return el;
|
|
63
|
+
}
|
|
64
|
+
return container;
|
|
65
|
+
}
|
|
66
|
+
function setElementProps(element, props) {
|
|
67
|
+
const definedProps = {};
|
|
68
|
+
for (const [key, value] of Object.entries(props)) {
|
|
69
|
+
if (value === void 0) continue;
|
|
70
|
+
definedProps[key] = value;
|
|
71
|
+
}
|
|
72
|
+
Object.assign(element, definedProps);
|
|
73
|
+
}
|
|
74
|
+
function mountSolvimonElement(container, id, type, props) {
|
|
75
|
+
const parent = resolveContainer(container);
|
|
76
|
+
ensureCustomElementDefined(id, type);
|
|
77
|
+
const tagName = getCustomElementTagName(id);
|
|
78
|
+
const element = document.createElement(tagName);
|
|
79
|
+
setElementProps(element, props);
|
|
80
|
+
parent.appendChild(element);
|
|
81
|
+
return {
|
|
82
|
+
unmount() {
|
|
83
|
+
element.remove();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function splitContainer(configuration) {
|
|
88
|
+
const { container, ...props } = configuration;
|
|
89
|
+
return { container, props: Object.fromEntries(Object.entries(props)) };
|
|
90
|
+
}
|
|
91
|
+
function mergeElementProps(config, props) {
|
|
92
|
+
return {
|
|
93
|
+
...config,
|
|
94
|
+
...props
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function createSolvimonCore(config = {}) {
|
|
98
|
+
return {
|
|
99
|
+
config,
|
|
100
|
+
createComponent(id, configuration) {
|
|
101
|
+
const { container, props } = splitContainer(configuration);
|
|
102
|
+
return mountSolvimonElement(
|
|
103
|
+
container,
|
|
104
|
+
id,
|
|
105
|
+
"component",
|
|
106
|
+
mergeElementProps(config, props)
|
|
107
|
+
).unmount;
|
|
108
|
+
},
|
|
109
|
+
createScreen(id, configuration) {
|
|
110
|
+
const { container, props } = splitContainer(configuration);
|
|
111
|
+
return mountSolvimonElement(container, id, "screen", mergeElementProps(config, props)).unmount;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const REGISTERED_SCREEN_IDS = [
|
|
116
|
+
"customer-overview",
|
|
117
|
+
"checkout",
|
|
118
|
+
"upgrade-subscription"
|
|
119
|
+
];
|
|
120
|
+
const REGISTERED_COMPONENT_IDS = [
|
|
121
|
+
"invoice",
|
|
122
|
+
"invoice-details",
|
|
123
|
+
"invoices-list",
|
|
124
|
+
"payment-history",
|
|
125
|
+
"subscriptions-list",
|
|
126
|
+
"subscription-schedules",
|
|
127
|
+
"customer-payment-methods",
|
|
128
|
+
"wallet-balances",
|
|
129
|
+
"billing-information",
|
|
130
|
+
"billing-information-form",
|
|
131
|
+
"payment-method-form"
|
|
132
|
+
];
|
|
133
|
+
function getRegisteredScreenIds() {
|
|
134
|
+
return [...REGISTERED_SCREEN_IDS];
|
|
135
|
+
}
|
|
136
|
+
function getRegisteredComponentIds() {
|
|
137
|
+
return [...REGISTERED_COMPONENT_IDS];
|
|
138
|
+
}
|
|
139
|
+
export {
|
|
140
|
+
getRegisteredScreenIds as a,
|
|
141
|
+
createSolvimonCore as c,
|
|
142
|
+
getRegisteredComponentIds as g
|
|
143
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonCheckout: import('vue').VueElementConstructor<unknown>;
|
|
1
|
+
export declare const SolvimonCheckout: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonCheckout: () => void;
|