@solvimon/solvimon-web 0.1.0-alpha.16 → 0.1.0-alpha.17
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-BYBAO4Au.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs} +2 -2
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js → BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs} +3 -3
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js +1 -0
- package/dist/{useWalletBalanceItems-COQDLfoZ.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs} +24 -56
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js +1 -0
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3cqlbGY.mjs +147 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-dwIv_xxf.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-wxP5IaGt.mjs} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-05NKI2A0.js} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-17v07F58.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BKMttUyk.mjs → PaymentHistoryBlock-BitwS9Re.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BGbTy4Se.js → PaymentHistoryBlock-ZtmPXXwI.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3ZUDUdw.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CMGK71zZ.js} +1 -1
- package/dist/{PaymentIntegrationForm-CypW6fZY.mjs → PaymentIntegrationForm-BK2aLPCo.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-D4QupHWl.js → PaymentIntegrationForm-BZTzCUiu.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs} +25 -14
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js +1 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-BQIN3zuf.mjs +156 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DyL2-vV0.js +1 -0
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js} +1 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BxqIfmkK.js +1 -0
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D1TcP9PR.mjs} +115 -68
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js +1 -0
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BMXr26gF.mjs +37 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs} +22 -119
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js +1 -0
- package/dist/component-CUJ_G2Nw.mjs +962 -0
- package/dist/component-CiKxWtdx.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +7 -7
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -58
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +8 -6
- package/dist/core/action-request.types.d.ts +3 -3
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -2
- package/dist/{customer-_W8gIX5m.js → customer-AfRcAZ5P.js} +1 -1
- package/dist/{customer-Bv_fqXzO.mjs → customer-DAgdegIW.mjs} +1 -1
- package/dist/{en-US-DAgOSlgv.mjs → en-US-DSzSbgL5.mjs} +68 -36
- package/dist/en-US-QzQnGXP1.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +7 -4
- package/dist/invoices-BHgajZHq.js +1 -0
- package/dist/{invoices-BGb0AwVF.mjs → invoices-BXDgW8ch.mjs} +32 -16
- package/dist/nl-NL-C4rr-1tr.js +1 -0
- package/dist/{nl-NL-DCsmrA8A.mjs → nl-NL-Li7RW89R.mjs} +72 -40
- package/dist/{paymentMethods-DIbB759g.js → paymentMethods-BMcc-eTl.js} +1 -1
- package/dist/{paymentMethods-DvqlWe96.mjs → paymentMethods-xzFD2L30.mjs} +2 -2
- package/dist/{payments-DMDDI3MK.js → payments-DMvmB5vg.js} +1 -1
- package/dist/{payments-CpzTVrQM.mjs → payments-DV6csRej.mjs} +1 -1
- package/dist/pricing-B1uImUm4.mjs +19 -0
- package/dist/pricing-BEjY_5wb.js +1 -0
- package/dist/pricingPlanSchedule-B9HFiXy-.js +1 -0
- package/dist/pricingPlanSchedule-C_cqUyTk.mjs +144 -0
- package/dist/registry-CeMxLjwU.js +1 -0
- package/dist/{registry-B-If1W_u.mjs → registry-CyENvS6l.mjs} +7 -4
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +414 -675
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +65 -19
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +10 -9
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +8 -8
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.ce.d.ts +3 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +542 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.ce.d.ts +3 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +725 -0
- package/dist/solvimon-web.css +1 -1
- package/dist/subscription-B4dBAY9C.mjs +89 -0
- package/dist/subscription-b0OPx8Du.js +1 -0
- package/dist/{subscriptions-BPYyv09M.mjs → subscriptions-CrNDM9qa.mjs} +6 -2
- package/dist/{subscriptions-CC61I6Nj.js → subscriptions-DC-mxa17.js} +1 -1
- package/dist/{url-1Lbg5Yni.mjs → url-BjZ1Pg0l.mjs} +1 -1
- package/dist/url-D8GJi5rF.js +1 -0
- package/dist/{useActionDispatchProvider-BHTknMoH.js → useActionDispatchProvider-bqR_FeM4.js} +1 -1
- package/dist/{useActionDispatchProvider-Dz8-e4gZ.mjs → useActionDispatchProvider-zB_GKeUR.mjs} +1 -1
- package/dist/{useCustomer-VVJi8z2w.mjs → useCustomer-VfeQ6rG2.mjs} +2 -2
- package/dist/{useCustomer-Z24KchWC.js → useCustomer-bO4D6e4Z.js} +1 -1
- package/dist/{useIncrementalLoading-CuSndpP2.js → useIncrementalLoading-BgWuwoMo.js} +1 -1
- package/dist/{useIncrementalLoading-DmOT2MXH.mjs → useIncrementalLoading-C59FXHzp.mjs} +1 -1
- package/dist/{useInvoiceData-Bl87gzIS.js → useInvoiceData-CxxkBTGY.js} +1 -1
- package/dist/{useInvoiceData-Di5pLPM0.mjs → useInvoiceData-Dhg-hx8C.mjs} +2 -2
- package/dist/useInvoicesList-BXZ9uV9i.js +1 -0
- package/dist/{useInvoicesList-z19cteaD.mjs → useInvoicesList-DBz7T7sM.mjs} +4 -4
- package/dist/{useLoadInitialData-CkpryfjF.mjs → useLoadInitialData-BhpIg7OF.mjs} +1 -1
- package/dist/{useLoadInitialData-CTqfiMTN.js → useLoadInitialData-BqiAFNFi.js} +1 -1
- package/dist/{usePaymentMethodOptions-BsCZnCQW.js → usePaymentMethodOptions-DszFvgKX.js} +1 -1
- package/dist/{usePaymentMethodOptions-BoGHJjng.mjs → usePaymentMethodOptions-PcMjtMSF.mjs} +2 -2
- package/dist/{usePaymentMethods-ocHmNoP7.mjs → usePaymentMethods-B5AbGWsn.mjs} +2 -2
- package/dist/{usePaymentMethods-AC-4rrR9.js → usePaymentMethods-Bb1Xbads.js} +1 -1
- package/dist/{usePayments-D85eB5l4.mjs → usePayments-DgoZoBZh.mjs} +3 -3
- package/dist/{usePayments-CgXZeWrU.js → usePayments-is5c66Z6.js} +1 -1
- package/dist/{usePortal-DVD7PcWI.js → usePortal-C4qWsJeq.js} +1 -1
- package/dist/{usePortal-B1O1zgdV.mjs → usePortal-DWLtNqBB.mjs} +1 -1
- package/dist/{useService-DF57xuDd.mjs → useService-BZqFkz7p.mjs} +1 -1
- package/dist/{useService-CHrkefKd.js → useService-DKm3QtT4.js} +1 -1
- package/dist/useSubscription-CEZJw6wZ.mjs +23 -0
- package/dist/useSubscription-DuUNc1_l.js +1 -0
- package/dist/useTopUpModal-DNyWrHDv.mjs +1012 -0
- package/dist/useTopUpModal-DeF-cfCK.js +1 -0
- package/dist/{vendor-ui-B8IlviSs.mjs → vendor-ui-BoGKOJ36.mjs} +8642 -7077
- package/dist/vendor-ui-BuRqLx74.js +1 -0
- package/package.json +14 -7
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js +0 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js +0 -1
- package/dist/component-Bg2JVC_O.mjs +0 -933
- package/dist/component-Bs8oszfD.js +0 -1
- package/dist/en-US-C0gIE4Q1.js +0 -1
- package/dist/invoices-D-OKipCg.js +0 -1
- package/dist/nl-NL-Br7muSHK.js +0 -1
- package/dist/registry-uG2isab0.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +0 -3
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +0 -1102
- package/dist/url-B6-3PkW2.js +0 -1
- package/dist/useInvoicesList-CFk-_oVK.js +0 -1
- package/dist/useWalletBalanceItems-BL-R5foK.js +0 -1
- package/dist/vendor-ui-C3Tq-qY_.js +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { u as useIncrementalLoading } from "./useIncrementalLoading-
|
|
2
|
-
import { c as createSubscriptionsService } from "./subscriptions-
|
|
1
|
+
import { u as useIncrementalLoading } from "./useIncrementalLoading-C59FXHzp.mjs";
|
|
2
|
+
import { c as createSubscriptionsService } from "./subscriptions-CrNDM9qa.mjs";
|
|
3
3
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createCommentVNode, createElementBlock, createSlots, Fragment, renderList } from "vue";
|
|
4
|
-
import { u as useIntl, _ as _sfc_main$3, e as _sfc_main$4,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { u as useIntl, _ as _sfc_main$3, e as _sfc_main$4, n as _sfc_main$5, c as _sfc_main$6 } from "./vendor-ui-BoGKOJ36.mjs";
|
|
5
|
+
import { g as getMostRecentPricingPlan, a as getSubscriptionName } from "./subscription-B4dBAY9C.mjs";
|
|
6
|
+
import { _ as _sfc_main$7 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
7
|
+
import { u as useActionDispatchProvider } from "./useActionDispatchProvider-zB_GKeUR.mjs";
|
|
7
8
|
function useSubscriptionsList({
|
|
8
9
|
customerId,
|
|
9
10
|
batchSize: pageSize = 15
|
|
@@ -29,34 +30,23 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
29
30
|
subscription: { type: Object },
|
|
30
31
|
paymentMethod: { type: Object },
|
|
31
32
|
customer: { type: Object },
|
|
32
|
-
showViewSubscriptionDetailsButton: { type: Boolean, default: true }
|
|
33
|
-
showCancelSubscriptionButton: { type: Boolean, default: true },
|
|
34
|
-
showRenewSubscriptionButton: { type: Boolean, default: true },
|
|
35
|
-
showUpgradeSubscriptionButton: { type: Boolean, default: true }
|
|
33
|
+
showViewSubscriptionDetailsButton: { type: Boolean, default: true }
|
|
36
34
|
},
|
|
37
|
-
emits: ["view-subscription-details"
|
|
35
|
+
emits: ["view-subscription-details"],
|
|
38
36
|
setup(__props) {
|
|
39
37
|
const props = __props;
|
|
40
38
|
const { $t } = useIntl();
|
|
41
39
|
const { formatDate } = useIntl();
|
|
42
|
-
const mostRecentPricingPlan = computed(() =>
|
|
43
|
-
var _a;
|
|
44
|
-
const scheduleInfos = props.subscription.pricing_plan_schedule_infos;
|
|
45
|
-
if (scheduleInfos.length === 0) {
|
|
46
|
-
return void 0;
|
|
47
|
-
}
|
|
48
|
-
const latestScheduleInfo = scheduleInfos[scheduleInfos.length - 1];
|
|
49
|
-
return (_a = latestScheduleInfo == null ? void 0 : latestScheduleInfo.pricing_plan_version) == null ? void 0 : _a.pricing_plan;
|
|
50
|
-
});
|
|
40
|
+
const mostRecentPricingPlan = computed(() => getMostRecentPricingPlan(props.subscription));
|
|
51
41
|
const subscriptionName = computed(
|
|
52
|
-
() => {
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
() => getSubscriptionName({
|
|
43
|
+
subscription: props.subscription,
|
|
44
|
+
fallback: $t({
|
|
55
45
|
defaultMessage: "Subscription",
|
|
56
46
|
description: "The fallback name for when no subscription name can be determined",
|
|
57
47
|
id: "customer_overview.subscriptions_block.fallback_subscription_name"
|
|
58
|
-
})
|
|
59
|
-
}
|
|
48
|
+
})
|
|
49
|
+
})
|
|
60
50
|
);
|
|
61
51
|
const subscriptionDescription = computed(
|
|
62
52
|
() => {
|
|
@@ -64,20 +54,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
64
54
|
return (_a = mostRecentPricingPlan.value) == null ? void 0 : _a.description;
|
|
65
55
|
}
|
|
66
56
|
);
|
|
67
|
-
const isCancellable = computed(() => {
|
|
68
|
-
const inactivePeriods = props.subscription.inactive_periods;
|
|
69
|
-
return !inactivePeriods || inactivePeriods.length === 0;
|
|
70
|
-
});
|
|
71
|
-
const isRenewable = computed(() => {
|
|
72
|
-
const inactivePeriods = props.subscription.inactive_periods;
|
|
73
|
-
return Array.isArray(inactivePeriods) && inactivePeriods.length > 0;
|
|
74
|
-
});
|
|
75
|
-
const isCancelButtonVisible = computed(
|
|
76
|
-
() => isCancellable.value && props.showCancelSubscriptionButton
|
|
77
|
-
);
|
|
78
|
-
const isRenewButtonVisible = computed(
|
|
79
|
-
() => isRenewable.value && props.showRenewSubscriptionButton
|
|
80
|
-
);
|
|
81
57
|
const isDetailButtonVisible = computed(() => props.showViewSubscriptionDetailsButton);
|
|
82
58
|
return (_ctx, _cache) => {
|
|
83
59
|
return openBlock(), createBlock(unref(_sfc_main$3), { class: "sv-subscriptions-list__item" }, {
|
|
@@ -163,55 +139,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
163
139
|
})), 1)
|
|
164
140
|
]),
|
|
165
141
|
_: 1
|
|
166
|
-
})) : createCommentVNode("", true),
|
|
167
|
-
__props.showUpgradeSubscriptionButton ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
168
|
-
key: 1,
|
|
169
|
-
variant: "outline",
|
|
170
|
-
color: "gray",
|
|
171
|
-
class: "sv-action sv-action--secondary sv-subscriptions-list__item-upgrade w-full md:w-auto",
|
|
172
|
-
type: "button",
|
|
173
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("upgrade-subscription", { subscriptionId: __props.subscription.id }))
|
|
174
|
-
}, {
|
|
175
|
-
default: withCtx(() => [
|
|
176
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
177
|
-
defaultMessage: "Upgrade subscription",
|
|
178
|
-
description: "The label for the upgrade subscription button in the subscriptions block",
|
|
179
|
-
id: "customer.subscriptions_block.upgrade_button_label"
|
|
180
|
-
})), 1)
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
})) : createCommentVNode("", true),
|
|
184
|
-
isCancelButtonVisible.value ? (openBlock(), createBlock(unref(_sfc_main$7), {
|
|
185
|
-
key: 2,
|
|
186
|
-
icon: "delete",
|
|
187
|
-
variant: "outline",
|
|
188
|
-
color: "gray",
|
|
189
|
-
size: "md",
|
|
190
|
-
class: "sv-action sv-subscriptions-list__item-cancel",
|
|
191
|
-
type: "button",
|
|
192
|
-
"aria-label": unref($t)({
|
|
193
|
-
defaultMessage: "Cancel subscription",
|
|
194
|
-
description: "Aria label for the cancel subscription icon button",
|
|
195
|
-
id: "customer.subscriptions_block.cancel_button_label"
|
|
196
|
-
}),
|
|
197
|
-
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("cancel-subscription", { subscriptionId: __props.subscription.id }))
|
|
198
|
-
}, null, 8, ["aria-label"])) : createCommentVNode("", true),
|
|
199
|
-
isRenewButtonVisible.value ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
200
|
-
key: 3,
|
|
201
|
-
variant: "outline",
|
|
202
|
-
color: "gray",
|
|
203
|
-
class: "sv-action sv-action--secondary sv-subscriptions-list__item-renew w-full md:w-auto",
|
|
204
|
-
type: "button",
|
|
205
|
-
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("renew-subscription", { subscriptionId: __props.subscription.id }))
|
|
206
|
-
}, {
|
|
207
|
-
default: withCtx(() => [
|
|
208
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
209
|
-
defaultMessage: "Renew subscription",
|
|
210
|
-
description: "The label for the renew subscription button in the subscriptions block",
|
|
211
|
-
id: "customer.subscriptions_block.renew_button_label"
|
|
212
|
-
})), 1)
|
|
213
|
-
]),
|
|
214
|
-
_: 1
|
|
215
142
|
})) : createCommentVNode("", true)
|
|
216
143
|
])
|
|
217
144
|
])
|
|
@@ -233,12 +160,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
233
160
|
paymentMethods: { default: () => [], type: Array },
|
|
234
161
|
isLoading: { type: Boolean },
|
|
235
162
|
showViewAllButton: { type: Boolean, default: true },
|
|
236
|
-
showViewDetailsButton: { type: Boolean, default: true }
|
|
237
|
-
showCancelButton: { type: Boolean, default: true },
|
|
238
|
-
showRenewButton: { type: Boolean, default: true },
|
|
239
|
-
showUpgradeButton: { type: Boolean, default: true }
|
|
163
|
+
showViewDetailsButton: { type: Boolean, default: true }
|
|
240
164
|
},
|
|
241
|
-
emits: ["view-subscription-details", "view-all-subscriptions", "
|
|
165
|
+
emits: ["view-subscription-details", "view-all-subscriptions", "load-more"],
|
|
242
166
|
setup(__props) {
|
|
243
167
|
const props = __props;
|
|
244
168
|
const { $t } = useIntl();
|
|
@@ -304,14 +228,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
304
228
|
"payment-method": getPaymentMethod(subscription.payment_method_id),
|
|
305
229
|
customer: __props.customer,
|
|
306
230
|
"show-view-subscription-details-button": __props.showViewDetailsButton,
|
|
307
|
-
"
|
|
308
|
-
|
|
309
|
-
"show-upgrade-subscription-button": __props.showUpgradeButton,
|
|
310
|
-
onViewSubscriptionDetails: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("view-subscription-details", $event)),
|
|
311
|
-
onCancelSubscription: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("cancel-subscription", $event)),
|
|
312
|
-
onRenewSubscription: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("renew-subscription", $event)),
|
|
313
|
-
onUpgradeSubscription: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("upgrade-subscription", $event))
|
|
314
|
-
}, null, 8, ["subscription", "payment-method", "customer", "show-view-subscription-details-button", "show-cancel-subscription-button", "show-renew-subscription-button", "show-upgrade-subscription-button"]);
|
|
231
|
+
onViewSubscriptionDetails: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("view-subscription-details", $event))
|
|
232
|
+
}, null, 8, ["subscription", "payment-method", "customer", "show-view-subscription-details-button"]);
|
|
315
233
|
}), 128))
|
|
316
234
|
]))
|
|
317
235
|
]),
|
|
@@ -358,8 +276,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
358
276
|
setup(__props) {
|
|
359
277
|
const { dispatchAction } = useActionDispatchProvider();
|
|
360
278
|
return (_ctx, _cache) => {
|
|
361
|
-
var _a, _b
|
|
362
|
-
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$
|
|
279
|
+
var _a, _b;
|
|
280
|
+
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$7, {
|
|
363
281
|
key: 0,
|
|
364
282
|
variant: "section",
|
|
365
283
|
class: "sv-subscriptions-list sv-root sv-component sv-loading min-h-[100px]",
|
|
@@ -373,28 +291,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
373
291
|
"is-loading": __props.isLoading,
|
|
374
292
|
"show-view-all-button": (_a = __props.configuration) == null ? void 0 : _a.showViewAllButton,
|
|
375
293
|
"show-view-details-button": (_b = __props.configuration) == null ? void 0 : _b.showViewDetailsButton,
|
|
376
|
-
"show-cancel-button": (_c = __props.configuration) == null ? void 0 : _c.showCancelButton,
|
|
377
|
-
"show-renew-button": (_d = __props.configuration) == null ? void 0 : _d.showRenewButton,
|
|
378
|
-
"show-upgrade-button": (_e = __props.configuration) == null ? void 0 : _e.showUpgradeButton,
|
|
379
294
|
onViewSubscriptionDetails: _cache[0] || (_cache[0] = ($event) => unref(dispatchAction)({
|
|
380
295
|
action: "view-subscription-details",
|
|
381
296
|
data: { subscriptionId: $event.subscriptionId }
|
|
382
297
|
})),
|
|
383
298
|
onViewAllSubscriptions: _cache[1] || (_cache[1] = ($event) => unref(dispatchAction)({ action: "view-all-subscriptions" })),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
data: { subscriptionId: $event.subscriptionId }
|
|
387
|
-
})),
|
|
388
|
-
onRenewSubscription: _cache[3] || (_cache[3] = ($event) => unref(dispatchAction)({
|
|
389
|
-
action: "renew-subscription",
|
|
390
|
-
data: { subscriptionId: $event.subscriptionId }
|
|
391
|
-
})),
|
|
392
|
-
onUpgradeSubscription: _cache[4] || (_cache[4] = ($event) => unref(dispatchAction)({
|
|
393
|
-
action: "upgrade-subscription",
|
|
394
|
-
data: { subscriptionId: $event.subscriptionId }
|
|
395
|
-
})),
|
|
396
|
-
onLoadMore: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("load-more"))
|
|
397
|
-
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "show-view-all-button", "show-view-details-button", "show-cancel-button", "show-renew-button", "show-upgrade-button"])) : createCommentVNode("", true);
|
|
299
|
+
onLoadMore: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("load-more"))
|
|
300
|
+
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "show-view-all-button", "show-view-details-button"])) : createCommentVNode("", true);
|
|
398
301
|
};
|
|
399
302
|
}
|
|
400
303
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./useIncrementalLoading-BgWuwoMo.js"),t=require("./subscriptions-DC-mxa17.js"),i=require("vue"),s=require("./vendor-ui-BuRqLx74.js"),o=require("./subscription-b0OPx8Du.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),r=require("./useActionDispatchProvider-bqR_FeM4.js");const c={class:"sv-subscriptions-list__item-body flex flex-col gap-4 md:flex-row"},a={class:"sv-subscriptions-list__item-content grow"},l={class:"sv-subscriptions-list__item-meta mt-4 flex items-center gap-6"},u={key:1,class:"sv-subscriptions-list__item-next-invoice flex gap-1"},p={class:"sv-subscriptions-list__item-actions flex flex-col items-center gap-2 md:flex-row"},d=i.defineComponent({__name:"SubscriptionsListItem",props:{subscription:{type:Object},paymentMethod:{type:Object},customer:{type:Object},showViewSubscriptionDetailsButton:{type:Boolean,default:!0}},emits:["view-subscription-details"],setup(e){const t=e,{$t:n}=s.useIntl(),{formatDate:r}=s.useIntl(),d=i.computed(()=>o.getMostRecentPricingPlan(t.subscription)),m=i.computed(()=>o.getSubscriptionName({subscription:t.subscription,fallback:n({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})})),b=i.computed(()=>{var e;return null==(e=d.value)?void 0:e.description}),_=i.computed(()=>t.showViewSubscriptionDetailsButton);return(t,o)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{class:"sv-subscriptions-list__item"},{default:i.withCtx(()=>[i.createElementVNode("div",c,[i.createElementVNode("div",a,[i.createVNode(i.unref(s._sfc_main$3),{tag:"h3",variant:"heading-2",class:"sv-subscriptions-list__item-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value),1)]),_:1}),b.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$3),{key:0,variant:"body-sm",tag:"span",shade:"lighter",class:"sv-subscriptions-list__item-description"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",l,[e.paymentMethod?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$6),{key:0,variant:"condensed",class:"sv-payment-methods__item","payment-method":e.paymentMethod},null,8,["payment-method"])):i.createCommentVNode("",!0),e.subscription.next_invoice?(i.openBlock(),i.createElementBlock("div",u,[i.createVNode(i.unref(s._sfc_main$3),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)({defaultMessage:"Next billing date",description:"The label for the next billing date",id:"customer.subscriptions_block.next_billing_date"})),1)]),_:1}),i.createVNode(i.unref(s._sfc_main$3),{tag:"span",variant:"body-xs",shade:"light"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)({date:e.subscription.next_invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:e.customer.timezone})),1)]),_:1})])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",p,[_.value?(i.openBlock(),i.createBlock(i.unref(s._sfc_main$1),{key:0,color:"primary",class:"sv-action sv-action--primary sv-subscriptions-list__item-details w-full md:w-auto",type:"button",onClick:o[0]||(o[0]=i=>t.$emit("view-subscription-details",{subscriptionId:e.subscription.id}))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.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})):i.createCommentVNode("",!0)])])]),_:1}))}}),m={key:1,class:"sv-subscriptions-list__items grid grid-cols-1 gap-4"},b=i.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}},emits:["view-subscription-details","view-all-subscriptions","load-more"],setup(e){const t=e,{$t:o}=s.useIntl(),n=i.computed(()=>t.subscriptions.length>0),r=e=>{if(e)return t.paymentMethods.find(({id:t})=>t===e)},c=i.computed(()=>t.showViewAllButton);return(t,a)=>(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{class:"sv-subscriptions-list","no-spacing":"","no-border":"",title:i.unref(o)({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)})},i.createSlots({default:i.withCtx(()=>[n.value?(i.openBlock(),i.createElementBlock("div",m,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.subscriptions,s=>(i.openBlock(),i.createBlock(d,{key:s.id,subscription:s,"payment-method":r(s.payment_method_id),customer:e.customer,"show-view-subscription-details-button":e.showViewDetailsButton,onViewSubscriptionDetails:a[1]||(a[1]=e=>t.$emit("view-subscription-details",e))},null,8,["subscription","payment-method","customer","show-view-subscription-details-button"]))),128))])):(i.openBlock(),i.createBlock(i.unref(s._sfc_main),{key:0,class:"sv-empty-state sv-subscriptions-list__empty"},{default:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main$3),{tag:"h3",variant:"heading-3"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({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}),i.createVNode(i.unref(s._sfc_main$3),{variant:"body-xs",shade:"lighter"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({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:i.withCtx(()=>[i.createVNode(i.unref(s._sfc_main$1),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-subscriptions-list__view-all",type:"button",onClick:a[0]||(a[0]=e=>t.$emit("view-all-subscriptions"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)({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"]))}}),_=i.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}=r.useActionDispatchProvider();return(s,o)=>{var r,c;return e.isLoading?(i.openBlock(),i.createBlock(n._sfc_main,{key:0,variant:"section",class:"sv-subscriptions-list sv-root sv-component sv-loading min-h-[100px]","data-testid":"subscriptions-list-skeleton"})):e.customer?(i.openBlock(),i.createBlock(b,{key:1,class:"sv-subscriptions-list sv-root sv-component",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,onViewSubscriptionDetails:o[0]||(o[0]=e=>i.unref(t)({action:"view-subscription-details",data:{subscriptionId:e.subscriptionId}})),onViewAllSubscriptions:o[1]||(o[1]=e=>i.unref(t)({action:"view-all-subscriptions"})),onLoadMore:o[2]||(o[2]=e=>s.$emit("load-more"))},null,8,["customer","subscriptions","payment-methods","is-loading","show-view-all-button","show-view-details-button"])):i.createCommentVNode("",!0)}}});exports._sfc_main=_,exports.useSubscriptionsList=function({customerId:i,batchSize:s=15}){const o=t.createSubscriptionsService();return e.useIncrementalLoading({service:async e=>o.getActiveSubscriptions({customerId:i,pagination:{page:e,pageSize:s}})})};
|