@solvimon/solvimon-web 0.1.0-alpha.6 → 0.1.0-alpha.8
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/dist/ApiStatus-CyNDp_op.mjs +9 -0
- package/dist/ApiStatus-oqvUEWJx.js +1 -0
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DZ1XkSJ3.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +4 -4
- package/dist/{ContentWithAsideLayout-D_T137tN.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
- package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DK6tiecN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +11 -11
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BWXmZmGZ.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs} +2 -2
- package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
- package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BSn_Zy0Y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +5 -5
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
- package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
- package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs +910 -0
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-X7-dfeZP.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -30
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-AxYjVFUM.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +20 -20
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
- package/dist/adyen-51SvcyqV.mjs +4 -0
- package/dist/adyen-DZsyEXkw.js +1 -0
- package/dist/adyenLoader-CEH4A2b2.js +1 -0
- package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
- package/dist/component-C2Gc-wsE.js +1 -0
- package/dist/component-CM9g6tbD.mjs +804 -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 +14 -14
- 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 +28 -32
- 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 +3 -7
- 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 +42 -75
- 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 +3 -7
- 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 +2 -6
- 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 +3 -7
- 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 +10 -34
- 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 +7 -10
- 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 +4 -8
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +1 -1
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/customer-C_Hz_npf.js +1 -0
- package/dist/customer-TIi7iZFw.mjs +32 -0
- package/dist/en-US-CBoPxQwX.mjs +199 -0
- package/dist/en-US-DJq-9dD8.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -1
- package/dist/{invoices-C7BHqB0g.mjs → invoices-BuVOuTOm.mjs} +2 -1
- package/dist/invoices-DbvwXAsm.js +1 -0
- package/dist/nl-NL-BB7KbK-h.mjs +181 -0
- package/dist/nl-NL-CtU1Lg2F.js +1 -0
- package/dist/paymentMethods-B4AYGf0K.js +1 -0
- package/dist/{paymentMethods-BA7Kt8ti.mjs → paymentMethods-Di32oJ39.mjs} +2 -1
- package/dist/{payments-NTHUh5je.mjs → payments-C5fD1PXB.mjs} +1 -1
- package/dist/{payments-B8W0W6wZ.js → payments-DeutKq9x.js} +1 -1
- package/dist/{registry-DgRnFEVF.mjs → registry-BLwMl1bK.mjs} +6 -5
- package/dist/registry-CMSmkLcy.js +1 -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 +589 -857
- 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 +13 -14
- package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
- package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +81 -57
- package/dist/solvimon-web.css +1 -1
- package/dist/source-DKDKBlUm.mjs +179 -0
- package/dist/source-dkMNFWDc.js +1 -0
- package/dist/{subscriptions-BEoXaAHw.mjs → subscriptions-mOgjjzUi.mjs} +2 -1
- package/dist/subscriptions-wdMADcQZ.js +1 -0
- package/dist/{useActionDispatchProvider-zSXRlc2S.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
- package/dist/{useActionDispatchProvider-DmTJ_bqE.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
- package/dist/useCustomer-DanZzn-l.js +1 -0
- package/dist/useCustomer-cbhDyWJL.mjs +25 -0
- package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
- package/dist/{useIncrementalLoading-Bgs0mqyb.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -4
- package/dist/useInvoiceData-CxxHa5R2.js +1 -0
- package/dist/{useInvoiceData-B6P2VShe.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
- package/dist/{useInvoicesList-23Ra-23Z.mjs → useInvoicesList-BQQxcPdz.mjs} +22 -22
- package/dist/useInvoicesList-CtJqmblZ.js +1 -0
- package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
- package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
- package/dist/{usePaymentMethods-BK4unvj2.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
- package/dist/{usePaymentMethods-B8Nft16c.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
- package/dist/usePayments-B13S_yai.js +1 -0
- package/dist/usePayments-D4uGKBsV.mjs +36 -0
- package/dist/usePortal-DJDJNLbo.mjs +12 -0
- package/dist/usePortal-DWJEVkTj.js +1 -0
- package/dist/useService-9fCKPTmu.js +1 -0
- package/dist/useService-BuWWE5ND.mjs +68 -0
- package/dist/useViewport-Bu0cyeSi.mjs +38 -0
- package/dist/useViewport-CKRY1CKR.js +1 -0
- package/dist/{useWalletBalanceItems-DreHuOra.mjs → useWalletBalanceItems-B53Gkjro.mjs} +8 -7
- package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
- package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
- package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
- package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
- package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
- package/package.json +30 -17
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-eRGZRjmq.js +0 -1
- package/dist/ContentWithAsideLayout-BZJPhvLh.js +0 -1
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BvmKLc2H.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DNWspHtC.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Cx4c8E4i.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ct26TY0a.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-WRXecMCj.mjs +0 -6568
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-KnhKv07X.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D9_G7CyE.js +0 -1
- package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
- package/dist/_Uint8Array-DxISR7XF.js +0 -1
- package/dist/cloneDeep-DranHQkY.js +0 -1
- package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
- package/dist/component-DI3AxwdD.mjs +0 -58733
- package/dist/component-yWF07boR.js +0 -1
- package/dist/index-2jo9BSPM.js +0 -1
- package/dist/index-BFZ0dPh9.mjs +0 -179
- package/dist/index-CWSXne1Q.js +0 -1
- package/dist/index-D3v7hAtc.mjs +0 -253
- package/dist/invoices-CjBHfDXp.js +0 -1
- package/dist/paymentMethods-A-5SBmy1.js +0 -1
- package/dist/registry-SwmYGFn7.js +0 -1
- package/dist/sprite-DZD704h3-CCc3Mz1x.js +0 -1
- package/dist/sprite-DZD704h3-DZD704h3.mjs +0 -4
- package/dist/subscriptions-DSi93KpN.js +0 -1
- package/dist/useCustomer-DkrBNt5f.mjs +0 -45
- package/dist/useCustomer-fK-w7ifj.js +0 -1
- package/dist/useIncrementalLoading-BK6N8sYW.js +0 -1
- package/dist/useInvoiceData-CS7hLTea.js +0 -1
- package/dist/useInvoicesList-CIFGVsDj.js +0 -1
- package/dist/useService-B4qv5N2D.mjs +0 -281
- package/dist/useService-D-CUtlp3.js +0 -1
- package/dist/useWalletBalanceItems-NlFk6jPD.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { u as useService } from "./useService-BuWWE5ND.mjs";
|
|
2
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-Di32oJ39.mjs";
|
|
3
|
+
function hasCustomerId(payload) {
|
|
4
|
+
return payload.customerId !== void 0;
|
|
5
|
+
}
|
|
6
|
+
function usePaymentMethodOptions() {
|
|
7
|
+
const { getPaymentMethodOptions } = createPaymentMethodsService();
|
|
8
|
+
const service = (payload) => hasCustomerId(payload) ? getPaymentMethodOptions({
|
|
9
|
+
customerId: payload.customerId,
|
|
10
|
+
amount: payload.amount,
|
|
11
|
+
country: payload.country
|
|
12
|
+
}) : getPaymentMethodOptions({
|
|
13
|
+
subscriptionId: payload.subscriptionId,
|
|
14
|
+
amount: payload.amount,
|
|
15
|
+
country: payload.country
|
|
16
|
+
});
|
|
17
|
+
const initialValue = [];
|
|
18
|
+
const { data, execute: get, apiStatus, error, isPending } = useService({
|
|
19
|
+
initialValue,
|
|
20
|
+
service
|
|
21
|
+
});
|
|
22
|
+
return { paymentMethodOptions: data, get, apiStatus, error, isPending };
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
usePaymentMethodOptions as u
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./useService-9fCKPTmu.js"),t=require("./paymentMethods-B4AYGf0K.js");exports.usePaymentMethodOptions=function(){const{getPaymentMethodOptions:n}=t.createPaymentMethodsService(),{data:o,execute:r,apiStatus:u,error:i,isPending:s}=e.useService({initialValue:[],service:e=>function(e){return void 0!==e.customerId}(e)?n({customerId:e.customerId,amount:e.amount,country:e.country}):n({subscriptionId:e.subscriptionId,amount:e.amount,country:e.country})});return{paymentMethodOptions:o,get:r,apiStatus:u,error:i,isPending:s}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./useIncrementalLoading-
|
|
1
|
+
const e=require("./useIncrementalLoading-DFe5Yh8M.js"),t=require("./paymentMethods-B4AYGf0K.js");exports.usePaymentMethods=function({customerId:n,pageSize:s=15}){const{getPaymentMethods:a}=t.createPaymentMethodsService();return e.useIncrementalLoading({service:async e=>a({customerId:n,pagination:{page:e,pageSize:s}})})};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
2
|
-
import { c as createPaymentMethodsService } from "./paymentMethods-
|
|
1
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-RRicokf1.mjs";
|
|
2
|
+
import { c as createPaymentMethodsService } from "./paymentMethods-Di32oJ39.mjs";
|
|
3
3
|
function usePaymentMethods({
|
|
4
4
|
customerId,
|
|
5
5
|
pageSize = 15
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./invoices-DbvwXAsm.js"),i=require("./useService-9fCKPTmu.js"),t=require("./payments-DeutKq9x.js");exports.useInvoice=function({invoiceId:t}){const{getInvoice:r,getInvoicePdf:n}=e.createInvoicesService(),{data:s,execute:c,apiStatus:o,error:a,isPending:u}=i.useService({service:()=>r(t)});return{invoice:s,downloadInvoicePdf:n,apiStatus:o,error:a,get:c,isPending:u}},exports.usePayments=function(){const{getPayments:e}=t.createPaymentsService(),{data:r,execute:n,error:s,apiStatus:c,isPending:o}=i.useService({service:e,isCollection:!0});return{payments:r,get:n,error:s,apiStatus:c,isPending:o}};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { c as createInvoicesService } from "./invoices-BuVOuTOm.mjs";
|
|
2
|
+
import { u as useService } from "./useService-BuWWE5ND.mjs";
|
|
3
|
+
import { c as createPaymentsService } from "./payments-C5fD1PXB.mjs";
|
|
4
|
+
function useInvoice({ invoiceId }) {
|
|
5
|
+
const { getInvoice, getInvoicePdf: downloadInvoicePdf } = createInvoicesService();
|
|
6
|
+
const service = () => getInvoice(invoiceId);
|
|
7
|
+
const {
|
|
8
|
+
data,
|
|
9
|
+
execute: get,
|
|
10
|
+
apiStatus,
|
|
11
|
+
error,
|
|
12
|
+
isPending
|
|
13
|
+
} = useService({
|
|
14
|
+
service
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
invoice: data,
|
|
18
|
+
downloadInvoicePdf,
|
|
19
|
+
apiStatus,
|
|
20
|
+
error,
|
|
21
|
+
get,
|
|
22
|
+
isPending
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function usePayments() {
|
|
26
|
+
const { getPayments } = createPaymentsService();
|
|
27
|
+
const { data, execute: get, error, apiStatus, isPending } = useService({
|
|
28
|
+
service: getPayments,
|
|
29
|
+
isCollection: true
|
|
30
|
+
});
|
|
31
|
+
return { payments: data, get, error, apiStatus, isPending };
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
usePayments as a,
|
|
35
|
+
useInvoice as u
|
|
36
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
import { P as PORTAL_INJECTION_KEY } from "./component-CM9g6tbD.mjs";
|
|
3
|
+
function usePortal() {
|
|
4
|
+
const portal = inject(PORTAL_INJECTION_KEY);
|
|
5
|
+
if (!portal) {
|
|
6
|
+
throw new Error("PortalProvider is not provided");
|
|
7
|
+
}
|
|
8
|
+
return portal;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
usePortal as u
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=require("vue"),e=require("./component-C2Gc-wsE.js");exports.usePortal=function(){const o=r.inject(e.PORTAL_INJECTION_KEY);if(!o)throw new Error("PortalProvider is not provided");return o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./ApiStatus-oqvUEWJx.js"),t=require("vue");function n(e,t){return void 0===t?"\0undefined":t}function r(e,t){return JSON.stringify(e,n)===JSON.stringify(t,n)}function i(e,t){return t?function(e){if(!function(e){return"object"==typeof e&&null!==e&&"data"in e}(e))throw new Error("Expected collection response.");return e.data}(e):e}exports.isEmpty=function(e){return null==e||("string"==typeof e||Array.isArray(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"!=typeof e||0===Object.keys(e).length)},exports.isEqual=r,exports.useService=function({initialValue:n,service:u,isCollection:a=!1}){const o=t.shallowRef(n),s=t.ref(e.ApiStatus.Initial),c=t.ref(null),l=t.computed(()=>s.value===e.ApiStatus.Loading);return{data:o,execute:async(...t)=>{try{s.value=e.ApiStatus.Loading,c.value=null;const f=i(await u(...t),a);return l=f,r((n=o).value,l)||(n.value=l),s.value=e.ApiStatus.Done,f}catch(f){return c.value=function(e){return e instanceof Error?e:new Error("Something went wrong while fetching data.")}(f),s.value=e.ApiStatus.Failed,Promise.reject()}var n,l},apiStatus:s,isPending:l,error:c}};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { A as ApiStatus } from "./ApiStatus-CyNDp_op.mjs";
|
|
2
|
+
import { shallowRef, ref, computed } from "vue";
|
|
3
|
+
const UNDEFINED_SENTINEL = "\0undefined";
|
|
4
|
+
function replacer(_key, value) {
|
|
5
|
+
return value === void 0 ? UNDEFINED_SENTINEL : value;
|
|
6
|
+
}
|
|
7
|
+
function isEqual(a, b) {
|
|
8
|
+
return JSON.stringify(a, replacer) === JSON.stringify(b, replacer);
|
|
9
|
+
}
|
|
10
|
+
function isEmpty(value) {
|
|
11
|
+
if (value == null) return true;
|
|
12
|
+
if (typeof value === "string" || Array.isArray(value)) return value.length === 0;
|
|
13
|
+
if (value instanceof Map || value instanceof Set) return value.size === 0;
|
|
14
|
+
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
function updateRefIfChanged(ref2, value) {
|
|
18
|
+
if (isEqual(ref2.value, value)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
ref2.value = value;
|
|
22
|
+
}
|
|
23
|
+
function toError(error) {
|
|
24
|
+
return error instanceof Error ? error : new Error("Something went wrong while fetching data.");
|
|
25
|
+
}
|
|
26
|
+
function isCollectionResponse(response) {
|
|
27
|
+
return typeof response === "object" && response !== null && "data" in response;
|
|
28
|
+
}
|
|
29
|
+
function getCollectionResponseData(response) {
|
|
30
|
+
if (!isCollectionResponse(response)) {
|
|
31
|
+
throw new Error("Expected collection response.");
|
|
32
|
+
}
|
|
33
|
+
return response.data;
|
|
34
|
+
}
|
|
35
|
+
function mapServiceResponse(response, isCollection) {
|
|
36
|
+
return isCollection ? getCollectionResponseData(response) : response;
|
|
37
|
+
}
|
|
38
|
+
function useService({
|
|
39
|
+
initialValue,
|
|
40
|
+
service,
|
|
41
|
+
isCollection = false
|
|
42
|
+
}) {
|
|
43
|
+
const data = shallowRef(initialValue);
|
|
44
|
+
const apiStatus = ref(ApiStatus.Initial);
|
|
45
|
+
const error = ref(null);
|
|
46
|
+
const isPending = computed(() => apiStatus.value === ApiStatus.Loading);
|
|
47
|
+
const execute = async (...args) => {
|
|
48
|
+
try {
|
|
49
|
+
apiStatus.value = ApiStatus.Loading;
|
|
50
|
+
error.value = null;
|
|
51
|
+
const response = await service(...args);
|
|
52
|
+
const mapped = mapServiceResponse(response, isCollection);
|
|
53
|
+
updateRefIfChanged(data, mapped);
|
|
54
|
+
apiStatus.value = ApiStatus.Done;
|
|
55
|
+
return mapped;
|
|
56
|
+
} catch (err) {
|
|
57
|
+
error.value = toError(err);
|
|
58
|
+
apiStatus.value = ApiStatus.Failed;
|
|
59
|
+
return Promise.reject();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return { data, execute, apiStatus, isPending, error };
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
isEmpty as a,
|
|
66
|
+
isEqual as i,
|
|
67
|
+
useService as u
|
|
68
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from "vue";
|
|
2
|
+
function useMediaQuery(query) {
|
|
3
|
+
const matches = ref(false);
|
|
4
|
+
let mediaQueryList;
|
|
5
|
+
const handler = (event) => {
|
|
6
|
+
matches.value = event.matches;
|
|
7
|
+
};
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
mediaQueryList = window.matchMedia(query);
|
|
10
|
+
matches.value = mediaQueryList.matches;
|
|
11
|
+
mediaQueryList.addEventListener("change", handler);
|
|
12
|
+
});
|
|
13
|
+
onUnmounted(() => {
|
|
14
|
+
mediaQueryList == null ? void 0 : mediaQueryList.removeEventListener("change", handler);
|
|
15
|
+
});
|
|
16
|
+
return matches;
|
|
17
|
+
}
|
|
18
|
+
const breakpoints = {
|
|
19
|
+
sm: 640,
|
|
20
|
+
md: 768,
|
|
21
|
+
lg: 1024,
|
|
22
|
+
xl: 1280,
|
|
23
|
+
"2xl": 1536
|
|
24
|
+
};
|
|
25
|
+
function useBreakpoints() {
|
|
26
|
+
const smaller = (bp) => useMediaQuery(`(max-width: ${breakpoints[bp] - 1}px)`);
|
|
27
|
+
const smallerOrEqual = (bp) => useMediaQuery(`(max-width: ${breakpoints[bp]}px)`);
|
|
28
|
+
const greaterOrEqual = (bp) => useMediaQuery(`(min-width: ${breakpoints[bp]}px)`);
|
|
29
|
+
return { smaller, smallerOrEqual, greaterOrEqual };
|
|
30
|
+
}
|
|
31
|
+
function useViewport() {
|
|
32
|
+
const breakpoints2 = useBreakpoints();
|
|
33
|
+
const isMobileViewport = breakpoints2.smallerOrEqual("sm");
|
|
34
|
+
return { isMobileViewport };
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
useViewport as u
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue");function t(t){const n=e.ref(!1);let r;const a=e=>{n.value=e.matches};return e.onMounted(()=>{r=window.matchMedia(t),n.value=r.matches,r.addEventListener("change",a)}),e.onUnmounted(()=>{null==r||r.removeEventListener("change",a)}),n}const n={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};exports.useViewport=function(){return{isMobileViewport:{smaller:e=>t(`(max-width: ${n[e]-1}px)`),smallerOrEqual:e=>t(`(max-width: ${n[e]}px)`),greaterOrEqual:e=>t(`(min-width: ${n[e]}px)`)}.smallerOrEqual("sm")}};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { computed, defineComponent, openBlock, createBlock, unref, createCommentVNode } from "vue";
|
|
2
|
-
import { c as createRequestService, u as useConfig
|
|
3
|
-
import { u as useService } from "./useService-
|
|
4
|
-
import {
|
|
2
|
+
import { c as createRequestService, u as useConfig } from "./component-CM9g6tbD.mjs";
|
|
3
|
+
import { u as useService } from "./useService-BuWWE5ND.mjs";
|
|
4
|
+
import { u as useIntl, z as _sfc_main$2, A as _sfc_main$4 } from "./vendor-ui-BwxuPDg8.mjs";
|
|
5
|
+
import { _ as _sfc_main$3 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs";
|
|
5
6
|
function createWalletsService() {
|
|
6
7
|
const request = createRequestService();
|
|
7
8
|
const config = useConfig();
|
|
@@ -34,7 +35,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
34
35
|
setup(__props) {
|
|
35
36
|
const { $t } = useIntl();
|
|
36
37
|
return (_ctx, _cache) => {
|
|
37
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
38
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
38
39
|
items: __props.walletBalances,
|
|
39
40
|
title: unref($t)(
|
|
40
41
|
{
|
|
@@ -58,12 +59,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
59
|
setup(__props) {
|
|
59
60
|
const { $t } = useIntl();
|
|
60
61
|
return (_ctx, _cache) => {
|
|
61
|
-
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$
|
|
62
|
+
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$3, {
|
|
62
63
|
key: 0,
|
|
63
64
|
variant: "section",
|
|
64
65
|
class: "min-h-48",
|
|
65
66
|
"data-testid": "customer-wallet-balances-skeleton"
|
|
66
|
-
})) : __props.hasError ? (openBlock(), createBlock(unref(_sfc_main$
|
|
67
|
+
})) : __props.hasError ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
67
68
|
key: 1,
|
|
68
69
|
title: unref($t)({
|
|
69
70
|
defaultMessage: "Could not load wallet balances",
|
|
@@ -89,7 +90,7 @@ function useWalletBalanceItems(walletBalances) {
|
|
|
89
90
|
title: $t({
|
|
90
91
|
defaultMessage: "Balance",
|
|
91
92
|
description: "Fallback wallet title in wallet balance components",
|
|
92
|
-
id: "
|
|
93
|
+
id: "wallet_balance.wallet_ballance_title"
|
|
93
94
|
}),
|
|
94
95
|
balance: walletBalance.wallet_balance.open_balance,
|
|
95
96
|
balanceAt: walletBalance.wallet_balance.balance_at ?? ((_a2 = walletBalances.value) == null ? void 0 : _a2.balance_at) ?? null
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),l=require("./component-C2Gc-wsE.js"),a=require("./useService-9fCKPTmu.js"),t=require("./vendor-ui-Ce_Yp7xA.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js");const s=e.defineComponent({__name:"CustomerWalletBalancesBlock",props:{walletBalances:{type:Array}},setup(l){const{$t:a}=t.useIntl();return(n,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$14),{items:l.walletBalances,title:e.unref(a)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(l.walletBalances.length)})},null,8,["items","title"]))}}),o=e.defineComponent({__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array}},setup(l){const{$t:a}=t.useIntl();return(o,r)=>l.isLoading?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,variant:"section",class:"min-h-48","data-testid":"customer-wallet-balances-skeleton"})):l.hasError?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:1,title:e.unref(a)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})},null,8,["title"])):l.walletBalances.length>0?(e.openBlock(),e.createBlock(s,{key:2,"wallet-balances":l.walletBalances},null,8,["wallet-balances"])):e.createCommentVNode("",!0)}});exports._sfc_main=o,exports.useCustomerWalletBalances=function({customerId:t}){const{getCustomerWalletBalances:n}=function(){const e=l.createRequestService(),a=l.useConfig();return{getCustomerWalletBalances:function(l){return e({url:`${a.apiUrls.config}/portal/customers/${l}/wallets/balance`,options:{method:"POST"},data:{}})}}}(),{data:s,execute:o,apiStatus:r,error:c,isPending:u}=a.useService({service:()=>n(t)});return{walletBalances:e.computed(()=>s.value??null),apiStatus:r,error:c,fetch:o,isPending:u}},exports.useWalletBalanceItems=function(l){const{$t:a}=t.useIntl();return e.computed(()=>{var e;return((null==(e=l.value)?void 0:e.wallet_balances)??[]).map(e=>{var t;return{walletId:e.wallet_id,title:a({defaultMessage:"Balance",description:"Fallback wallet title in wallet balance components",id:"wallet_balance.wallet_ballance_title"}),balance:e.wallet_balance.open_balance,balanceAt:e.wallet_balance.balance_at??(null==(t=l.value)?void 0:t.balance_at)??null}})})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue");exports.useWatchDebounced=function(t,o,u){let c;e.watch(t,(e,t)=>{clearTimeout(c),c=setTimeout(()=>o(e,t),u.debounce)}),e.onUnmounted(()=>clearTimeout(c))};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { watch, onUnmounted } from "vue";
|
|
2
|
+
function useWatchDebounced(source, callback, options) {
|
|
3
|
+
let timer;
|
|
4
|
+
watch(source, (value, oldValue) => {
|
|
5
|
+
clearTimeout(timer);
|
|
6
|
+
timer = setTimeout(() => callback(value, oldValue), options.debounce);
|
|
7
|
+
});
|
|
8
|
+
onUnmounted(() => clearTimeout(timer));
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useWatchDebounced as u
|
|
12
|
+
};
|