@solvimon/solvimon-web 0.1.0-alpha.2 → 0.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -42
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js → BillingInformation.vue_vue_type_script_setup_true_lang-LQgNMjOT.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-_GGUwxEJ.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-CRsFr9TH.mjs → ContentWithAsideLayout-BJ0Ccghd.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-DczcgSrt.js → ContentWithAsideLayout-BQpDxDXI.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BgcSUvE1.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DxoeHBT0.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BKlI9Y8m.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CCJ-J0t4.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D_JmUGZS.mjs} +3 -3
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dhoaaymm.js} +1 -1
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js → PricingGroupContent.vue_vue_type_script_setup_true_lang-DCfpg7nK.js} +1 -1
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-wxetfLSR.mjs} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-C6AOtXAD.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DcunVa40.mjs} +4 -4
- package/dist/component-B5y7wYnP.js +1 -0
- package/dist/{component-DEo_ndpK.mjs → component-BhrlC5ZJ.mjs} +4 -6
- 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 +3 -3
- 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 +2 -2
- 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 -3
- 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 +26 -49
- 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 -3
- 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 +11 -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 -3
- 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 +4 -4
- 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 +2 -2
- 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 -4
- 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 +2 -2
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{invoices-BW1notiX.js → invoices-BYnoNgSR.js} +1 -1
- package/dist/{invoices-M5oYVch6.mjs → invoices-C8nfTLon.mjs} +1 -1
- package/dist/{paymentMethods-CqKUfc3w.mjs → paymentMethods-BJVTwjzp.mjs} +1 -1
- package/dist/{paymentMethods-BX80t2zk.js → paymentMethods-CwzFgccc.js} +1 -1
- package/dist/{payments-CosaPZwo.mjs → payments-AWzaFsBd.mjs} +1 -1
- package/dist/{payments-BHv4hCeJ.js → payments-Da5LVn5H.js} +1 -1
- package/dist/{registry-BwKEYOf7.js → registry-DN-NWLUK.js} +1 -1
- package/dist/{registry-Cag1Jj7P.mjs → registry-Dll2lIBv.mjs} +2 -2
- 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 +8 -8
- 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 +9 -9
- 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 +5 -5
- package/dist/{subscriptions-CnxvsBXd.js → subscriptions-0_i6paaS.js} +1 -1
- package/dist/{subscriptions-Bs4DIE8f.mjs → subscriptions-CMBt--lb.mjs} +1 -1
- package/dist/{useActionDispatchProvider-Cru69mAl.js → useActionDispatchProvider-C-uVJcgJ.js} +1 -1
- package/dist/{useActionDispatchProvider-CgRcOqv3.mjs → useActionDispatchProvider-J1S-vXqg.mjs} +1 -1
- package/dist/{useCustomer-B0NK96dA.js → useCustomer-ClGwkeNn.js} +1 -1
- package/dist/{useCustomer-DlcjY3fP.mjs → useCustomer-DZKD_AMw.mjs} +1 -1
- package/dist/{useCustomerPaymentMethodOptions-BzEquyUV.mjs → useCustomerPaymentMethodOptions-CbnzYwYp.mjs} +3 -3
- package/dist/{useCustomerPaymentMethodOptions-C-8BLzqb.js → useCustomerPaymentMethodOptions-D_5UvLze.js} +1 -1
- package/dist/{useIncrementalLoading-C7ToTmZK.mjs → useIncrementalLoading-DbQxYZ1J.mjs} +1 -1
- package/dist/{useIncrementalLoading-D60Vttil.js → useIncrementalLoading-DrgYXlRK.js} +1 -1
- package/dist/{useInvoiceData-DstXfI7t.js → useInvoiceData-BtxiSooD.js} +1 -1
- package/dist/{useInvoiceData-CcueV3We.mjs → useInvoiceData-ca_-ah5G.mjs} +2 -2
- package/dist/{useInvoicesList-DmzjgMlW.js → useInvoicesList-BMeLWF8r.js} +1 -1
- package/dist/{useInvoicesList-CXng3aUm.mjs → useInvoicesList-CbzCTBaM.mjs} +4 -4
- package/dist/{usePaymentMethods-DCGVRXA4.js → usePaymentMethods-CaE9qm2M.js} +1 -1
- package/dist/{usePaymentMethods-Db-1R6rI.mjs → usePaymentMethods-CuhSSaz4.mjs} +2 -2
- package/dist/{useWalletBalanceItems-BZyiAhcV.js → useWalletBalanceItems-B-6IRohi.js} +1 -1
- package/dist/{useWalletBalanceItems-CHkLaccm.mjs → useWalletBalanceItems-Cjis6nYZ.mjs} +1 -1
- package/package.json +3 -3
- package/dist/component-XHQYFLA_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./component-
|
|
1
|
+
const e=require("vue"),t=require("./component-B5y7wYnP.js"),n={class:"flex gap-1"},i=e.defineComponent({__name:"Kpi",props:{icon:{type:null},kpi:{type:String}},setup:i=>(a,o)=>(e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(t._sfc_main$4),{icon:i.icon,size:"xs"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.kpi),1)]),_:1})]))}),a={class:"flex items-start"},o={class:"flex flex-col grow"},r={class:"flex items-center gap-1"},s={class:"flex items-center ml-4 self-center"},c=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup:n=>(i,c)=>(e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",o,[e.createElementVNode("div",r,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.name),1)]),_:1}),e.renderSlot(i.$slots,"badge")]),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.description),1)]),_:1})]),e.createElementVNode("div",s,[e.renderSlot(i.$slots,"default")])]))});exports._sfc_main=c,exports._sfc_main$1=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, renderSlot } from "vue";
|
|
2
|
-
import { n as _sfc_main$4, _ as _sfc_main$2 } from "./component-
|
|
2
|
+
import { n as _sfc_main$4, _ as _sfc_main$2 } from "./component-BhrlC5ZJ.mjs";
|
|
3
3
|
const _hoisted_1$1 = { class: "flex gap-1" };
|
|
4
4
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "Kpi",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./useIncrementalLoading-D60Vttil.js"),t=require("./subscriptions-CnxvsBXd.js"),o=require("vue"),i=require("./component-XHQYFLA_.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),s=require("./useActionDispatchProvider-Cru69mAl.js");const r={class:"flex flex-col gap-4 md:flex-row"},c={class:"grow"},a={class:"mt-4 flex items-center gap-6"},u={key:1,class:"flex gap-1"},l={class:"flex flex-col items-center gap-2 md:flex-row"},p=o.defineComponent({__name:"SubscriptionsListItem",props:{subscription:{type:Object},paymentMethod:{type:Object},customer:{type:Object},showViewSubscriptionDetailsButton:{type:Boolean,default:!0},showCancelSubscriptionButton:{type:Boolean,default:!0},showRenewSubscriptionButton:{type:Boolean,default:!0}},emits:["view-subscription-details","cancel-subscription","renew-subscription"],setup(e){const t=e,{$t:n}=i.useIntl(),{formatDate:s}=i.useIntl(),p=o.computed(()=>{var e;const o=t.subscription.pricing_plan_schedule_infos;if(0===o.length)return;const i=o[o.length-1];return null==(e=null==i?void 0:i.pricing_plan_version)?void 0:e.pricing_plan}),d=o.computed(()=>{var e;return t.subscription.name||(null==(e=p.value)?void 0:e.name)||n({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),b=o.computed(()=>{var e;return null==(e=p.value)?void 0:e.description}),m=o.computed(()=>{const e=t.subscription.inactive_periods;return!e||0===e.length}),w=o.computed(()=>{const e=t.subscription.inactive_periods;return Array.isArray(e)&&e.length>0}),h=o.computed(()=>m.value&&t.showCancelSubscriptionButton),f=o.computed(()=>w.value&&t.showRenewSubscriptionButton),_=o.computed(()=>t.showViewSubscriptionDetailsButton);return(t,p)=>(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),null,{default:o.withCtx(()=>[o.createElementVNode("div",r,[o.createElementVNode("div",c,[o.createVNode(o.unref(i._sfc_main$2),{tag:"h3",variant:"heading-2"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1}),b.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2),{key:0,variant:"body-sm",tag:"span",shade:"lighter"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",a,[e.paymentMethod?(o.openBlock(),o.createBlock(o.unref(i._sfc_main),{key:0,variant:"condensed","payment-method":e.paymentMethod},null,8,["payment-method"])):o.createCommentVNode("",!0),e.subscription.next_invoice?(o.openBlock(),o.createElementBlock("div",u,[o.createVNode(o.unref(i._sfc_main$2),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Next billing date",description:"The label for the next billing date",id:"customer.subscriptions_block.next_billing_date"})),1)]),_:1}),o.createVNode(o.unref(i._sfc_main$2),{tag:"span",variant:"body-xs",shade:"light"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)({date:e.subscription.next_invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:e.customer.timezone})),1)]),_:1})])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",l,[_.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:0,color:"primary",class:"w-full md:w-auto",type:"button",onClick:p[0]||(p[0]=o=>t.$emit("view-subscription-details",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Subscription details",description:"The label for the subscription details button in the subscriptions block",id:"customer.subscriptions_block.show_details_button_label"})),1)]),_:1})):o.createCommentVNode("",!0),h.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:1,variant:"outline",color:"gray",class:"w-full md:w-auto",type:"button",onClick:p[1]||(p[1]=o=>t.$emit("cancel-subscription",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Cancel subscription",description:"The label for the cancel subscription button in the subscriptions block",id:"customer.subscriptions_block.cancel_button_label"})),1)]),_:1})):f.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:2,variant:"outline",color:"gray",class:"w-full md:w-auto",type:"button",onClick:p[2]||(p[2]=o=>t.$emit("renew-subscription",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Renew subscription",description:"The label for the renew subscription button in the subscriptions block",id:"customer.subscriptions_block.renew_button_label"})),1)]),_:1})):o.createCommentVNode("",!0)])])]),_:1}))}}),d={key:1,class:"grid grid-cols-1 gap-4"},b=o.defineComponent({__name:"SubscriptionsList",props:{customer:{type:Object},subscriptions:{type:Array},paymentMethods:{default:()=>[],type:Array},isLoading:{type:Boolean},showViewAllButton:{type:Boolean,default:!0},showViewDetailsButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},showRenewButton:{type:Boolean,default:!0}},emits:["view-subscription-details","view-all-subscriptions","cancel-subscription","renew-subscription","load-more"],setup(e){const t=e,{$t:n}=i.useIntl(),s=o.computed(()=>t.subscriptions.length>0),r=e=>{if(e)return t.paymentMethods.find(({id:t})=>t===e)},c=o.computed(()=>t.showViewAllButton);return(t,a)=>(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),{"no-spacing":"","no-border":"",title:o.unref(n)({defaultMessage:"{count, plural, one {My subscription} other {My subscriptions}}",description:"Title for the subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.title"},{count:String(e.subscriptions.length)})},o.createSlots({default:o.withCtx(()=>[s.value?(o.openBlock(),o.createElementBlock("div",d,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.subscriptions,i=>(o.openBlock(),o.createBlock(p,{key:i.id,subscription:i,"payment-method":r(i.payment_method_id),customer:e.customer,"show-view-subscription-details-button":e.showViewDetailsButton,"show-cancel-subscription-button":e.showCancelButton,"show-renew-subscription-button":e.showRenewButton,"show-view-all-button":e.showViewAllButton,"show-cancel-button":e.showCancelButton,"show-renew-button":e.showRenewButton,onViewSubscriptionDetails:a[1]||(a[1]=e=>t.$emit("view-subscription-details",e)),onCancelSubscription:a[2]||(a[2]=e=>t.$emit("cancel-subscription",e)),onRenewSubscription:a[3]||(a[3]=e=>t.$emit("renew-subscription",e))},null,8,["subscription","payment-method","customer","show-view-subscription-details-button","show-cancel-subscription-button","show-renew-subscription-button","show-view-all-button","show-cancel-button","show-renew-button"]))),128))])):(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(i._sfc_main$2),{tag:"h3",variant:"heading-3"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"No subscriptions",description:"Title for the my subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.no_active_subscription_title"})),1)]),_:1}),o.createVNode(o.unref(i._sfc_main$2),{variant:"body-xs",shade:"lighter"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"There’s no active subscription to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.subscriptions_block.no_active_subscription_content"})),1)]),_:1})]),_:1}))]),_:2},[c.value?{name:"right",fn:o.withCtx(()=>[o.createVNode(o.unref(i._sfc_main$2H),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",type:"button",onClick:a[0]||(a[0]=e=>t.$emit("view-all-subscriptions"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"View all",description:"The text for the view all subscriptions button",id:"customer_overview.subscriptions_block.view_all_button_label"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),m=o.defineComponent({__name:"SubscriptionsList",props:{customer:{type:null},subscriptions:{type:Array},paymentMethods:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},emits:["load-more"],setup(e){const{dispatchAction:t}=s.useActionDispatchProvider();return(i,s)=>{var r,c,a,u;return e.isLoading?(o.openBlock(),o.createBlock(n._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"subscriptions-list-skeleton"})):e.customer?(o.openBlock(),o.createBlock(b,{key:1,customer:e.customer,subscriptions:e.subscriptions,"payment-methods":e.paymentMethods,"is-loading":e.isLoading,"show-view-all-button":null==(r=e.configuration)?void 0:r.showViewAllButton,"show-view-details-button":null==(c=e.configuration)?void 0:c.showViewDetailsButton,"show-cancel-button":null==(a=e.configuration)?void 0:a.showCancelButton,"show-renew-button":null==(u=e.configuration)?void 0:u.showRenewButton,onViewSubscriptionDetails:s[0]||(s[0]=e=>o.unref(t)({action:"view-subscription-details",data:{subscriptionId:e.subscriptionId}})),onViewAllSubscriptions:s[1]||(s[1]=e=>o.unref(t)({action:"view-all-subscriptions"})),onCancelSubscription:s[2]||(s[2]=e=>o.unref(t)({action:"cancel-subscription",data:{subscriptionId:e.subscriptionId}})),onRenewSubscription:s[3]||(s[3]=e=>o.unref(t)({action:"renew-subscription",data:{subscriptionId:e.subscriptionId}})),onLoadMore:s[4]||(s[4]=e=>i.$emit("load-more"))},null,8,["customer","subscriptions","payment-methods","is-loading","show-view-all-button","show-view-details-button","show-cancel-button","show-renew-button"])):o.createCommentVNode("",!0)}}});exports._sfc_main=m,exports.useSubscriptionsList=function({customerId:o,batchSize:i=15}){const n=t.createSubscriptionsService();return e.useIncrementalLoading({service:async e=>n.getActiveSubscriptions({customerId:o,pagination:{page:e,pageSize:i}})})};
|
|
1
|
+
const e=require("./useIncrementalLoading-DrgYXlRK.js"),t=require("./subscriptions-0_i6paaS.js"),o=require("vue"),i=require("./component-B5y7wYnP.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),s=require("./useActionDispatchProvider-C-uVJcgJ.js");const r={class:"flex flex-col gap-4 md:flex-row"},c={class:"grow"},a={class:"mt-4 flex items-center gap-6"},u={key:1,class:"flex gap-1"},l={class:"flex flex-col items-center gap-2 md:flex-row"},p=o.defineComponent({__name:"SubscriptionsListItem",props:{subscription:{type:Object},paymentMethod:{type:Object},customer:{type:Object},showViewSubscriptionDetailsButton:{type:Boolean,default:!0},showCancelSubscriptionButton:{type:Boolean,default:!0},showRenewSubscriptionButton:{type:Boolean,default:!0}},emits:["view-subscription-details","cancel-subscription","renew-subscription"],setup(e){const t=e,{$t:n}=i.useIntl(),{formatDate:s}=i.useIntl(),p=o.computed(()=>{var e;const o=t.subscription.pricing_plan_schedule_infos;if(0===o.length)return;const i=o[o.length-1];return null==(e=null==i?void 0:i.pricing_plan_version)?void 0:e.pricing_plan}),d=o.computed(()=>{var e;return t.subscription.name||(null==(e=p.value)?void 0:e.name)||n({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),b=o.computed(()=>{var e;return null==(e=p.value)?void 0:e.description}),m=o.computed(()=>{const e=t.subscription.inactive_periods;return!e||0===e.length}),w=o.computed(()=>{const e=t.subscription.inactive_periods;return Array.isArray(e)&&e.length>0}),h=o.computed(()=>m.value&&t.showCancelSubscriptionButton),f=o.computed(()=>w.value&&t.showRenewSubscriptionButton),_=o.computed(()=>t.showViewSubscriptionDetailsButton);return(t,p)=>(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),null,{default:o.withCtx(()=>[o.createElementVNode("div",r,[o.createElementVNode("div",c,[o.createVNode(o.unref(i._sfc_main$2),{tag:"h3",variant:"heading-2"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1}),b.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2),{key:0,variant:"body-sm",tag:"span",shade:"lighter"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",a,[e.paymentMethod?(o.openBlock(),o.createBlock(o.unref(i._sfc_main),{key:0,variant:"condensed","payment-method":e.paymentMethod},null,8,["payment-method"])):o.createCommentVNode("",!0),e.subscription.next_invoice?(o.openBlock(),o.createElementBlock("div",u,[o.createVNode(o.unref(i._sfc_main$2),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Next billing date",description:"The label for the next billing date",id:"customer.subscriptions_block.next_billing_date"})),1)]),_:1}),o.createVNode(o.unref(i._sfc_main$2),{tag:"span",variant:"body-xs",shade:"light"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)({date:e.subscription.next_invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:e.customer.timezone})),1)]),_:1})])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",l,[_.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:0,color:"primary",class:"w-full md:w-auto",type:"button",onClick:p[0]||(p[0]=o=>t.$emit("view-subscription-details",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Subscription details",description:"The label for the subscription details button in the subscriptions block",id:"customer.subscriptions_block.show_details_button_label"})),1)]),_:1})):o.createCommentVNode("",!0),h.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:1,variant:"outline",color:"gray",class:"w-full md:w-auto",type:"button",onClick:p[1]||(p[1]=o=>t.$emit("cancel-subscription",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Cancel subscription",description:"The label for the cancel subscription button in the subscriptions block",id:"customer.subscriptions_block.cancel_button_label"})),1)]),_:1})):f.value?(o.openBlock(),o.createBlock(o.unref(i._sfc_main$2H),{key:2,variant:"outline",color:"gray",class:"w-full md:w-auto",type:"button",onClick:p[2]||(p[2]=o=>t.$emit("renew-subscription",{subscriptionId:e.subscription.id}))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"Renew subscription",description:"The label for the renew subscription button in the subscriptions block",id:"customer.subscriptions_block.renew_button_label"})),1)]),_:1})):o.createCommentVNode("",!0)])])]),_:1}))}}),d={key:1,class:"grid grid-cols-1 gap-4"},b=o.defineComponent({__name:"SubscriptionsList",props:{customer:{type:Object},subscriptions:{type:Array},paymentMethods:{default:()=>[],type:Array},isLoading:{type:Boolean},showViewAllButton:{type:Boolean,default:!0},showViewDetailsButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},showRenewButton:{type:Boolean,default:!0}},emits:["view-subscription-details","view-all-subscriptions","cancel-subscription","renew-subscription","load-more"],setup(e){const t=e,{$t:n}=i.useIntl(),s=o.computed(()=>t.subscriptions.length>0),r=e=>{if(e)return t.paymentMethods.find(({id:t})=>t===e)},c=o.computed(()=>t.showViewAllButton);return(t,a)=>(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),{"no-spacing":"","no-border":"",title:o.unref(n)({defaultMessage:"{count, plural, one {My subscription} other {My subscriptions}}",description:"Title for the subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.title"},{count:String(e.subscriptions.length)})},o.createSlots({default:o.withCtx(()=>[s.value?(o.openBlock(),o.createElementBlock("div",d,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.subscriptions,i=>(o.openBlock(),o.createBlock(p,{key:i.id,subscription:i,"payment-method":r(i.payment_method_id),customer:e.customer,"show-view-subscription-details-button":e.showViewDetailsButton,"show-cancel-subscription-button":e.showCancelButton,"show-renew-subscription-button":e.showRenewButton,"show-view-all-button":e.showViewAllButton,"show-cancel-button":e.showCancelButton,"show-renew-button":e.showRenewButton,onViewSubscriptionDetails:a[1]||(a[1]=e=>t.$emit("view-subscription-details",e)),onCancelSubscription:a[2]||(a[2]=e=>t.$emit("cancel-subscription",e)),onRenewSubscription:a[3]||(a[3]=e=>t.$emit("renew-subscription",e))},null,8,["subscription","payment-method","customer","show-view-subscription-details-button","show-cancel-subscription-button","show-renew-subscription-button","show-view-all-button","show-cancel-button","show-renew-button"]))),128))])):(o.openBlock(),o.createBlock(o.unref(i._sfc_main$1g),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(i._sfc_main$2),{tag:"h3",variant:"heading-3"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"No subscriptions",description:"Title for the my subscriptions block on the customer overview page",id:"customer_overview.subscriptions_block.no_active_subscription_title"})),1)]),_:1}),o.createVNode(o.unref(i._sfc_main$2),{variant:"body-xs",shade:"lighter"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"There’s no active subscription to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.subscriptions_block.no_active_subscription_content"})),1)]),_:1})]),_:1}))]),_:2},[c.value?{name:"right",fn:o.withCtx(()=>[o.createVNode(o.unref(i._sfc_main$2H),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",type:"button",onClick:a[0]||(a[0]=e=>t.$emit("view-all-subscriptions"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)({defaultMessage:"View all",description:"The text for the view all subscriptions button",id:"customer_overview.subscriptions_block.view_all_button_label"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),m=o.defineComponent({__name:"SubscriptionsList",props:{customer:{type:null},subscriptions:{type:Array},paymentMethods:{type:Array},isLoading:{type:Boolean},configuration:{type:Object}},emits:["load-more"],setup(e){const{dispatchAction:t}=s.useActionDispatchProvider();return(i,s)=>{var r,c,a,u;return e.isLoading?(o.openBlock(),o.createBlock(n._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"subscriptions-list-skeleton"})):e.customer?(o.openBlock(),o.createBlock(b,{key:1,customer:e.customer,subscriptions:e.subscriptions,"payment-methods":e.paymentMethods,"is-loading":e.isLoading,"show-view-all-button":null==(r=e.configuration)?void 0:r.showViewAllButton,"show-view-details-button":null==(c=e.configuration)?void 0:c.showViewDetailsButton,"show-cancel-button":null==(a=e.configuration)?void 0:a.showCancelButton,"show-renew-button":null==(u=e.configuration)?void 0:u.showRenewButton,onViewSubscriptionDetails:s[0]||(s[0]=e=>o.unref(t)({action:"view-subscription-details",data:{subscriptionId:e.subscriptionId}})),onViewAllSubscriptions:s[1]||(s[1]=e=>o.unref(t)({action:"view-all-subscriptions"})),onCancelSubscription:s[2]||(s[2]=e=>o.unref(t)({action:"cancel-subscription",data:{subscriptionId:e.subscriptionId}})),onRenewSubscription:s[3]||(s[3]=e=>o.unref(t)({action:"renew-subscription",data:{subscriptionId:e.subscriptionId}})),onLoadMore:s[4]||(s[4]=e=>i.$emit("load-more"))},null,8,["customer","subscriptions","payment-methods","is-loading","show-view-all-button","show-view-details-button","show-cancel-button","show-renew-button"])):o.createCommentVNode("",!0)}}});exports._sfc_main=m,exports.useSubscriptionsList=function({customerId:o,batchSize:i=15}){const n=t.createSubscriptionsService();return e.useIncrementalLoading({service:async e=>n.getActiveSubscriptions({customerId:o,pagination:{page:e,pageSize:i}})})};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
2
|
-
import { c as createSubscriptionsService } from "./subscriptions-
|
|
1
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-DbQxYZ1J.mjs";
|
|
2
|
+
import { c as createSubscriptionsService } from "./subscriptions-CMBt--lb.mjs";
|
|
3
3
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createCommentVNode, createElementBlock, createSlots, Fragment, renderList } from "vue";
|
|
4
|
-
import { b as useIntl, d as _sfc_main$1g, _ as _sfc_main$2$1, g as _sfc_main$3, m as _sfc_main$2H } from "./component-
|
|
4
|
+
import { b as useIntl, d as _sfc_main$1g, _ as _sfc_main$2$1, g as _sfc_main$3, m as _sfc_main$2H } from "./component-BhrlC5ZJ.mjs";
|
|
5
5
|
import { _ as _sfc_main$4 } from "./Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs";
|
|
6
|
-
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-
|
|
6
|
+
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-J1S-vXqg.mjs";
|
|
7
7
|
function useSubscriptionsList({
|
|
8
8
|
customerId,
|
|
9
9
|
batchSize: pageSize = 15
|