@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.9
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 +124 -0
- 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-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +6 -6
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
- package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
- package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +10 -16
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +21 -13
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +19 -9
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
- package/dist/PaymentHistoryBlock-BiiFJkpT.js +1 -0
- package/dist/PaymentHistoryBlock-D_B099M7.mjs +4 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +16 -13
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
- package/dist/PaymentIntegrationForm-D1oJA9mC.js +1 -0
- package/dist/PaymentIntegrationForm-DNkjhqMF.mjs +4 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs} +95 -199
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js +1 -0
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs} +5 -31
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +9 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +28 -22
- package/dist/adyen-B_QrYdaC.mjs +4 -0
- package/dist/adyen-Bwewy3HC.mjs +172 -0
- package/dist/adyen-R6aSZ0Yf.js +1 -0
- package/dist/adyen-mQEEOjgl.js +1 -0
- package/dist/adyen.css +1 -0
- package/dist/component-BOqPDAVk.js +1 -0
- package/dist/component-Djrf1L-Z.mjs +889 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +8 -9
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +14 -18
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +10 -10
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +70 -2673
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +10 -10
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +7 -8
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +10 -10
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +16 -38
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +17 -4826
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +11 -11
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +9 -9
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +6 -2
- package/dist/{customer-CJrpbGX4.mjs → customer-B31QzznT.mjs} +1 -1
- package/dist/{customer-CcQR-JIm.js → customer-hDxW1Dbp.js} +1 -1
- package/dist/en-US-CgPY97Vq.js +1 -0
- package/dist/en-US-N3CUCsVy.mjs +179 -0
- package/dist/index-CzL1ZcGi.mjs +85 -0
- package/dist/index-DIFK3mcJ.js +6 -0
- package/dist/index-DRdBmZ2-.js +1 -0
- package/dist/index-DyvRdSR7.mjs +9673 -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-CNK1Ushv.mjs → invoices-DIYPN2j_.mjs} +2 -15
- package/dist/invoices-DzkA1jDc.js +1 -0
- package/dist/nl-NL-B8U9b85I.mjs +197 -0
- package/dist/nl-NL-qMRaTRrM.js +1 -0
- package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-67b3UlTZ.mjs} +2 -2
- package/dist/paymentMethods-C_sdTkSF.js +1 -0
- package/dist/{payments-CLt0SExf.js → payments-DkHhTHto.js} +1 -1
- package/dist/{payments-CE9U7aKK.mjs → payments-Dq6R37Fz.mjs} +1 -1
- package/dist/registry-BkViv4tv.js +1 -0
- package/dist/{registry-B99ZnfEn.mjs → registry-Df_26rJy.mjs} +6 -4
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +632 -2538
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +23 -17
- 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 +458 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +147 -99
- package/dist/solvimon-web.css +1 -1
- package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-ClGIr_aS.mjs} +2 -2
- package/dist/subscriptions-jelITJcX.js +1 -0
- package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
- package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-rw9kWeE0.js} +1 -1
- package/dist/{useCustomer--jycAz--.mjs → useCustomer-Ba9WRtuT.mjs} +2 -2
- package/dist/{useCustomer-PthyTFLl.js → useCustomer-CUcaeQn_.js} +1 -1
- package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +3 -8
- package/dist/useIncrementalLoading-DoTTXM2Y.js +1 -0
- package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-BJwwDur7.mjs} +6 -12
- package/dist/useInvoiceData-D2jkdmlA.js +1 -0
- package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-CFzAxyae.mjs} +34 -267
- package/dist/useInvoicesList-CaBCGs4h.js +1 -0
- package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
- package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
- package/dist/usePaymentMethodOptions-C2k4npCQ.mjs +26 -0
- package/dist/usePaymentMethodOptions-DYO6xr3-.js +1 -0
- package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
- package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-ryN_YohI.js} +1 -1
- package/dist/usePayments-Cw5PPEJa.mjs +36 -0
- package/dist/usePayments-DWXPGFvp.js +1 -0
- package/dist/usePortal-CxX4nrE4.js +1 -0
- package/dist/usePortal-cmE08vYs.mjs +12 -0
- package/dist/useService-Bb9r_sOQ.js +1 -0
- package/dist/useService-BsSEI8DZ.mjs +53 -0
- package/dist/useViewport-Bu0cyeSi.mjs +38 -0
- package/dist/useViewport-CKRY1CKR.js +1 -0
- package/dist/useWalletBalanceItems-CkDqmk36.mjs +109 -0
- package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
- package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
- package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
- package/dist/vendor-ui-5pJF5KBP.js +1 -0
- package/dist/vendor-ui-C0K3osvz.mjs +27645 -0
- package/package.json +20 -12
- package/dist/Alert.vue.es-DMPvSykx.js +0 -1
- package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
- package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
- package/dist/Amount.vue.es-h8wulbBG.js +0 -1
- package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
- package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
- package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
- package/dist/Button.vue.es-BC4_TItq.js +0 -1
- package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
- package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
- package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
- package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
- package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
- package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
- package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
- package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
- package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
- package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
- package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
- package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
- package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
- package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
- package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
- package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
- package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
- package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
- package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
- package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
- package/dist/Section.vue.es-BuzTXRLP.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
- package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
- package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
- package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
- package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
- package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
- package/dist/_Uint8Array-DxISR7XF.js +0 -1
- package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
- package/dist/_flatRest.es-dFffnTpX.js +0 -1
- package/dist/adyen-51SvcyqV.mjs +0 -4
- package/dist/adyen-DZsyEXkw.js +0 -1
- package/dist/api.es-B4qAAJKr.js +0 -1
- package/dist/api.es-UkfpLiLL.mjs +0 -83
- package/dist/auto-DzZuCneB.mjs +0 -14387
- package/dist/auto-PpnAChnH.js +0 -6
- package/dist/cloneDeep-Hs8Pp07F.js +0 -1
- package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
- package/dist/cn.es-C7xoIs3C.js +0 -1
- package/dist/cn.es-tfxVlz02.mjs +0 -3191
- package/dist/component-ZRZIt3ZW.js +0 -1
- package/dist/component-dpA83LIN.mjs +0 -6569
- package/dist/countryData.es--zJAd6LA.mjs +0 -252
- package/dist/countryData.es-D3MFzU92.js +0 -1
- package/dist/customer.es-D42Md24r.js +0 -1
- package/dist/customer.es-LIW2YmLL.mjs +0 -30
- package/dist/formatting.es-9hM8aHSg.js +0 -1
- package/dist/formatting.es-D5H_ySFv.mjs +0 -68
- package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
- package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
- package/dist/index-2jo9BSPM.js +0 -1
- package/dist/index-BFZ0dPh9.mjs +0 -179
- package/dist/index-CI71bVGE.mjs +0 -2521
- package/dist/index-CWSXne1Q.js +0 -1
- package/dist/index-D3v7hAtc.mjs +0 -253
- package/dist/index-WLSPwi90.js +0 -1
- package/dist/index.es-BBJF2O2l.js +0 -1
- package/dist/index.es-LCAKs4tH.mjs +0 -438
- package/dist/invoices-3kVHsAXr.js +0 -1
- package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
- package/dist/isEmpty.es-Dycf-CD_.js +0 -1
- package/dist/paymentMethods-DZRf0WRl.js +0 -1
- package/dist/pick.es-BgDAfhAl.js +0 -1
- package/dist/pick.es-DdVOyp0Q.mjs +0 -45
- package/dist/registry-ClZ43bQn.js +0 -1
- package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
- package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
- package/dist/subscriptions-CS8HTxzC.js +0 -1
- package/dist/typeGuards.es-C4nR5FkL.js +0 -1
- package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
- package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
- package/dist/useInvoiceData-DvQO_nKz.js +0 -1
- package/dist/useInvoicesList-CHkwSNO9.js +0 -1
- package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
- package/dist/useService-B67YWAcN.js +0 -1
- package/dist/useService-DG_zedHV.mjs +0 -282
- package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
- package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { c as createInvoicesService } from "./invoices-DIYPN2j_.mjs";
|
|
2
|
+
import { u as useService } from "./useService-BsSEI8DZ.mjs";
|
|
3
|
+
import { c as createPaymentsService } from "./payments-Dq6R37Fz.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 @@
|
|
|
1
|
+
const e=require("./invoices-DzkA1jDc.js"),i=require("./useService-Bb9r_sOQ.js"),t=require("./payments-DkHhTHto.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 @@
|
|
|
1
|
+
const r=require("vue"),e=require("./component-BOqPDAVk.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,12 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
import { P as PORTAL_INJECTION_KEY } from "./component-Djrf1L-Z.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 e=require("./ApiStatus-oqvUEWJx.js"),t=require("vue"),r=require("./vendor-ui-5pJF5KBP.js");function n(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.useService=function({initialValue:i,service:u,isCollection:a=!1}){const o=t.shallowRef(i),l=t.ref(e.ApiStatus.Initial),s=t.ref(null),c=t.computed(()=>l.value===e.ApiStatus.Loading);return{data:o,execute:async(...t)=>{try{l.value=e.ApiStatus.Loading,s.value=null;const v=n(await u(...t),a);return i=o,c=v,r.isEqual(i.value,c)||(i.value=c),l.value=e.ApiStatus.Done,v}catch(v){return s.value=function(e){return e instanceof Error?e:new Error("Something went wrong while fetching data.")}(v),l.value=e.ApiStatus.Failed,Promise.reject()}var i,c},apiStatus:l,isPending:c,error:s}};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { A as ApiStatus } from "./ApiStatus-CyNDp_op.mjs";
|
|
2
|
+
import { shallowRef, ref, computed } from "vue";
|
|
3
|
+
import { k as isEqual } from "./vendor-ui-C0K3osvz.mjs";
|
|
4
|
+
function updateRefIfChanged(ref2, value) {
|
|
5
|
+
if (isEqual(ref2.value, value)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
ref2.value = value;
|
|
9
|
+
}
|
|
10
|
+
function toError(error) {
|
|
11
|
+
return error instanceof Error ? error : new Error("Something went wrong while fetching data.");
|
|
12
|
+
}
|
|
13
|
+
function isCollectionResponse(response) {
|
|
14
|
+
return typeof response === "object" && response !== null && "data" in response;
|
|
15
|
+
}
|
|
16
|
+
function getCollectionResponseData(response) {
|
|
17
|
+
if (!isCollectionResponse(response)) {
|
|
18
|
+
throw new Error("Expected collection response.");
|
|
19
|
+
}
|
|
20
|
+
return response.data;
|
|
21
|
+
}
|
|
22
|
+
function mapServiceResponse(response, isCollection) {
|
|
23
|
+
return isCollection ? getCollectionResponseData(response) : response;
|
|
24
|
+
}
|
|
25
|
+
function useService({
|
|
26
|
+
initialValue,
|
|
27
|
+
service,
|
|
28
|
+
isCollection = false
|
|
29
|
+
}) {
|
|
30
|
+
const data = shallowRef(initialValue);
|
|
31
|
+
const apiStatus = ref(ApiStatus.Initial);
|
|
32
|
+
const error = ref(null);
|
|
33
|
+
const isPending = computed(() => apiStatus.value === ApiStatus.Loading);
|
|
34
|
+
const execute = async (...args) => {
|
|
35
|
+
try {
|
|
36
|
+
apiStatus.value = ApiStatus.Loading;
|
|
37
|
+
error.value = null;
|
|
38
|
+
const response = await service(...args);
|
|
39
|
+
const mapped = mapServiceResponse(response, isCollection);
|
|
40
|
+
updateRefIfChanged(data, mapped);
|
|
41
|
+
apiStatus.value = ApiStatus.Done;
|
|
42
|
+
return mapped;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
error.value = toError(err);
|
|
45
|
+
apiStatus.value = ApiStatus.Failed;
|
|
46
|
+
return Promise.reject();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return { data, execute, apiStatus, isPending, error };
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
useService as u
|
|
53
|
+
};
|
|
@@ -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")}};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { computed, defineComponent, openBlock, createBlock, unref, createCommentVNode } from "vue";
|
|
2
|
+
import { c as createRequestService, u as useConfig } from "./component-Djrf1L-Z.mjs";
|
|
3
|
+
import { u as useService } from "./useService-BsSEI8DZ.mjs";
|
|
4
|
+
import { u as useIntl, A as _sfc_main$2, B as _sfc_main$4 } from "./vendor-ui-C0K3osvz.mjs";
|
|
5
|
+
import { _ as _sfc_main$3 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
6
|
+
function createWalletsService() {
|
|
7
|
+
const request = createRequestService();
|
|
8
|
+
const config = useConfig();
|
|
9
|
+
function getCustomerWalletBalances(customerId) {
|
|
10
|
+
return request({
|
|
11
|
+
url: `${config.apiUrls.config}/portal/customers/${customerId}/wallets/balance`,
|
|
12
|
+
options: { method: "POST" },
|
|
13
|
+
data: {}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
getCustomerWalletBalances
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function useCustomerWalletBalances({ customerId }) {
|
|
21
|
+
const { getCustomerWalletBalances } = createWalletsService();
|
|
22
|
+
const { data, execute, apiStatus, error, isPending } = useService({
|
|
23
|
+
service: () => getCustomerWalletBalances(customerId)
|
|
24
|
+
});
|
|
25
|
+
const walletBalances = computed(
|
|
26
|
+
() => data.value ?? null
|
|
27
|
+
);
|
|
28
|
+
return { walletBalances, apiStatus, error, fetch: execute, isPending };
|
|
29
|
+
}
|
|
30
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
31
|
+
__name: "CustomerWalletBalancesBlock",
|
|
32
|
+
props: {
|
|
33
|
+
walletBalances: { type: Array }
|
|
34
|
+
},
|
|
35
|
+
setup(__props) {
|
|
36
|
+
const { $t } = useIntl();
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
39
|
+
class: "sv-wallet-balances",
|
|
40
|
+
items: __props.walletBalances,
|
|
41
|
+
title: unref($t)(
|
|
42
|
+
{
|
|
43
|
+
defaultMessage: "{count, plural, one {Wallet} other {Wallets}}",
|
|
44
|
+
description: "Title for the wallets block on the customer overview page",
|
|
45
|
+
id: "customer_overview.wallet_balances_block.title"
|
|
46
|
+
},
|
|
47
|
+
{ count: String(__props.walletBalances.length) }
|
|
48
|
+
)
|
|
49
|
+
}, null, 8, ["items", "title"]);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
54
|
+
__name: "CustomerWalletBalances",
|
|
55
|
+
props: {
|
|
56
|
+
hasError: { type: Boolean },
|
|
57
|
+
isLoading: { type: Boolean },
|
|
58
|
+
walletBalances: { type: Array }
|
|
59
|
+
},
|
|
60
|
+
setup(__props) {
|
|
61
|
+
const { $t } = useIntl();
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$3, {
|
|
64
|
+
key: 0,
|
|
65
|
+
variant: "section",
|
|
66
|
+
class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48",
|
|
67
|
+
"data-testid": "customer-wallet-balances-skeleton"
|
|
68
|
+
})) : __props.hasError ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
69
|
+
key: 1,
|
|
70
|
+
class: "sv-wallet-balances sv-root sv-component sv-error",
|
|
71
|
+
title: unref($t)({
|
|
72
|
+
defaultMessage: "Could not load wallet balances",
|
|
73
|
+
description: "Error shown when wallet balances fail to load",
|
|
74
|
+
id: "wallet_balance.load_failed"
|
|
75
|
+
})
|
|
76
|
+
}, null, 8, ["title"])) : __props.walletBalances.length > 0 ? (openBlock(), createBlock(_sfc_main$1, {
|
|
77
|
+
key: 2,
|
|
78
|
+
class: "sv-wallet-balances sv-root sv-component",
|
|
79
|
+
"wallet-balances": __props.walletBalances
|
|
80
|
+
}, null, 8, ["wallet-balances"])) : createCommentVNode("", true);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
function useWalletBalanceItems(walletBalances) {
|
|
85
|
+
const { $t } = useIntl();
|
|
86
|
+
return computed(
|
|
87
|
+
() => {
|
|
88
|
+
var _a;
|
|
89
|
+
return (((_a = walletBalances.value) == null ? void 0 : _a.wallet_balances) ?? []).map((walletBalance) => {
|
|
90
|
+
var _a2;
|
|
91
|
+
return {
|
|
92
|
+
walletId: walletBalance.wallet_id,
|
|
93
|
+
title: $t({
|
|
94
|
+
defaultMessage: "Balance",
|
|
95
|
+
description: "Fallback wallet title in wallet balance components",
|
|
96
|
+
id: "wallet_balance.wallet_ballance_title"
|
|
97
|
+
}),
|
|
98
|
+
balance: walletBalance.wallet_balance.open_balance,
|
|
99
|
+
balanceAt: walletBalance.wallet_balance.balance_at ?? ((_a2 = walletBalances.value) == null ? void 0 : _a2.balance_at) ?? null
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
_sfc_main as _,
|
|
107
|
+
useWalletBalanceItems as a,
|
|
108
|
+
useCustomerWalletBalances as u
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),l=require("./component-BOqPDAVk.js"),a=require("./useService-Bb9r_sOQ.js"),t=require("./vendor-ui-5pJF5KBP.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.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),{class:"sv-wallet-balances",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,c)=>l.isLoading?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,variant:"section",class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"})):l.hasError?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:1,class:"sv-wallet-balances sv-root sv-component sv-error",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,class:"sv-wallet-balances sv-root sv-component","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:c,error:r,isPending:u}=a.useService({service:()=>n(t)});return{walletBalances:e.computed(()=>s.value??null),apiStatus:c,error:r,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
|
+
};
|