@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js → BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-CRsFr9TH.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-CIVSoqFr.js → ContentWithAsideLayout-DczcgSrt.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs +75 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs → Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs} +5 -4
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs} +5 -5
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js} +1 -1
- package/dist/auto-DzZuCneB.mjs +14387 -0
- package/dist/auto-PpnAChnH.js +6 -0
- package/dist/{cloneDeep-Hs8Pp07F.js → cloneDeep-DranHQkY.js} +1 -1
- package/dist/{component-BkmcE85U.mjs → component-DEo_ndpK.mjs} +92 -78
- package/dist/component-XHQYFLA_.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +96 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +132 -5
- package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +580 -5
- package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
- package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +102 -5
- package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
- package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +236 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +150 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
- package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js} +41 -51
- package/dist/core/configuration.d.ts +2 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/registry.d.ts +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +40 -34
- package/dist/invoices-BW1notiX.js +1 -0
- package/dist/{invoices-C31Wz1Bu.mjs → invoices-M5oYVch6.mjs} +1 -1
- package/dist/{paymentMethods-CzUqDlvc.js → paymentMethods-BX80t2zk.js} +1 -1
- package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-CqKUfc3w.mjs} +1 -1
- package/dist/{payments-C3LPk9k9.js → payments-BHv4hCeJ.js} +1 -1
- package/dist/{payments-NtWI8KlU.mjs → payments-CosaPZwo.mjs} +1 -1
- package/dist/registry-BwKEYOf7.js +1 -0
- package/dist/registry-Cag1Jj7P.mjs +143 -0
- package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +5140 -5
- package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +134 -5
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1012 -0
- package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-Bs4DIE8f.mjs} +1 -1
- package/dist/{subscriptions-CqK7t-fF.js → subscriptions-CnxvsBXd.js} +1 -1
- package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-CgRcOqv3.mjs} +1 -1
- package/dist/useActionDispatchProvider-Cru69mAl.js +1 -0
- package/dist/{useCustomer-Dp8sGHI0.js → useCustomer-B0NK96dA.js} +1 -1
- package/dist/{useCustomer-BRY0tuBH.mjs → useCustomer-DlcjY3fP.mjs} +2 -2
- package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → useCustomerPaymentMethodOptions-BzEquyUV.mjs} +7 -6
- package/dist/{useCustomerPaymentMethodOptions-DYpMDnJR.js → useCustomerPaymentMethodOptions-C-8BLzqb.js} +1 -1
- package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-C7ToTmZK.mjs} +9 -7
- package/dist/useIncrementalLoading-D60Vttil.js +1 -0
- package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-CcueV3We.mjs} +2 -2
- package/dist/{useInvoiceData-DImEH1ca.js → useInvoiceData-DstXfI7t.js} +1 -1
- package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CXng3aUm.mjs} +4 -4
- package/dist/{useInvoicesList-BZQ9Y0qN.js → useInvoicesList-DmzjgMlW.js} +1 -1
- package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-DCGVRXA4.js} +1 -1
- package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-Db-1R6rI.mjs} +2 -2
- package/dist/{useService-Dz13Nxbi.mjs → useService-B4qv5N2D.mjs} +14 -5
- package/dist/useService-D-CUtlp3.js +1 -0
- package/dist/useWalletBalanceItems-BZyiAhcV.js +1 -0
- package/dist/useWalletBalanceItems-CHkLaccm.mjs +105 -0
- package/package.json +16 -3
- package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
- package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
- package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
- package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
- package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
- package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
- package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
- package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
- package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
- package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
- package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
- package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
- package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
- package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
- package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
- package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
- package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
- package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
- package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
- package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
- package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
- package/dist/auto-B_36W1Fc.js +0 -6
- package/dist/auto-BfMZdgp-.mjs +0 -14207
- package/dist/component-Df5eNqYX.js +0 -1
- package/dist/invoices-8M_3ur_U.js +0 -1
- package/dist/registry-By94DXE2.js +0 -1
- package/dist/registry-shRKDl3K.mjs +0 -127
- package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
- package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
- package/dist/useService-bNNi4GB8.js +0 -1
|
@@ -1,579 +0,0 @@
|
|
|
1
|
-
import { ref, computed, defineComponent, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode, Fragment, onMounted, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { F as useValidation, G as objectDiff, H as isOrganization, I as isIndividual, b as useIntl, _ as _sfc_main$2$1, J as _sfc_main$2a, K as _sfc_main$1$, L as _sfc_main$20, E as _sfc_main$16, m as _sfc_main$2H, M as getApiError, o as _sfc_main$4, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
|
|
3
|
-
import { e as email, r as required } from "./index-CzL1ZcGi.mjs";
|
|
4
|
-
import { c as cloneDeep } from "./cloneDeep-sm9cY-u2.mjs";
|
|
5
|
-
import { u as useCustomer } from "./useCustomer-BRY0tuBH.mjs";
|
|
6
|
-
const useForm = ({
|
|
7
|
-
initialState,
|
|
8
|
-
validationRules = {},
|
|
9
|
-
nullifyEmptyValues = false,
|
|
10
|
-
mode = "shallow"
|
|
11
|
-
}) => {
|
|
12
|
-
const initialFormState = ref(cloneDeep(initialState));
|
|
13
|
-
const form = ref(cloneDeep(initialState));
|
|
14
|
-
const validation = useValidation(validationRules, form);
|
|
15
|
-
const changes = computed(
|
|
16
|
-
() => objectDiff({ from: initialFormState.value, to: form.value, mode, nullifyEmptyValues })
|
|
17
|
-
);
|
|
18
|
-
const hasChanges = computed(() => Object.entries(changes.value).length > 0);
|
|
19
|
-
const updateInitialState = (state) => {
|
|
20
|
-
form.value = cloneDeep(state);
|
|
21
|
-
initialFormState.value = cloneDeep(state);
|
|
22
|
-
};
|
|
23
|
-
const reset = () => {
|
|
24
|
-
form.value = cloneDeep(initialState);
|
|
25
|
-
validation.value.$reset();
|
|
26
|
-
};
|
|
27
|
-
return {
|
|
28
|
-
form,
|
|
29
|
-
validation,
|
|
30
|
-
changes,
|
|
31
|
-
hasChanges,
|
|
32
|
-
reset,
|
|
33
|
-
updateInitialState,
|
|
34
|
-
initialState: initialFormState
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const DEFAULT_FORM_STATE = {
|
|
38
|
-
type: "INDIVIDUAL",
|
|
39
|
-
email: "",
|
|
40
|
-
country: "",
|
|
41
|
-
addressLine1: "",
|
|
42
|
-
postalCode: "",
|
|
43
|
-
city: "",
|
|
44
|
-
state: ""
|
|
45
|
-
};
|
|
46
|
-
function useBillingInformationForm({
|
|
47
|
-
initialState = {},
|
|
48
|
-
onSubmit
|
|
49
|
-
}) {
|
|
50
|
-
const {
|
|
51
|
-
form,
|
|
52
|
-
validation,
|
|
53
|
-
changes,
|
|
54
|
-
hasChanges,
|
|
55
|
-
updateInitialState: updateFormInitialState,
|
|
56
|
-
initialState: currentInitialState
|
|
57
|
-
} = useForm({
|
|
58
|
-
initialState: {
|
|
59
|
-
...DEFAULT_FORM_STATE,
|
|
60
|
-
...initialState
|
|
61
|
-
},
|
|
62
|
-
validationRules: {
|
|
63
|
-
email: { required, email }
|
|
64
|
-
},
|
|
65
|
-
nullifyEmptyValues: true,
|
|
66
|
-
mode: "deep"
|
|
67
|
-
});
|
|
68
|
-
const updateInitialState = (customer) => {
|
|
69
|
-
updateFormInitialState(mapCustomerToFormState(customer));
|
|
70
|
-
};
|
|
71
|
-
const submit = (customerId, data = form.value) => {
|
|
72
|
-
return onSubmit({
|
|
73
|
-
customerId,
|
|
74
|
-
payload: mapFormStateToCustomerPayload(data)
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
form,
|
|
79
|
-
isOrganization,
|
|
80
|
-
validation,
|
|
81
|
-
changes,
|
|
82
|
-
hasChanges,
|
|
83
|
-
updateInitialState,
|
|
84
|
-
submit,
|
|
85
|
-
initialState: currentInitialState
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
const mapCustomerToFormState = (customer) => {
|
|
89
|
-
var _a, _b;
|
|
90
|
-
if (isIndividual(customer)) {
|
|
91
|
-
const address2 = customer.individual.residential_address;
|
|
92
|
-
return {
|
|
93
|
-
type: "INDIVIDUAL",
|
|
94
|
-
email: customer.email ?? "",
|
|
95
|
-
country: (address2 == null ? void 0 : address2.country) ?? "",
|
|
96
|
-
addressLine1: (address2 == null ? void 0 : address2.line1) ?? "",
|
|
97
|
-
addressLine2: (address2 == null ? void 0 : address2.line2) ?? "",
|
|
98
|
-
postalCode: (address2 == null ? void 0 : address2.postal_code) ?? "",
|
|
99
|
-
city: (address2 == null ? void 0 : address2.city) ?? "",
|
|
100
|
-
state: (address2 == null ? void 0 : address2.state) ?? "",
|
|
101
|
-
firstName: ((_a = customer.individual.name) == null ? void 0 : _a.first_name) ?? "",
|
|
102
|
-
lastName: ((_b = customer.individual.name) == null ? void 0 : _b.last_name) ?? ""
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
const address = customer.organization.registered_address;
|
|
106
|
-
return {
|
|
107
|
-
type: "ORGANIZATION",
|
|
108
|
-
email: customer.email ?? "",
|
|
109
|
-
country: (address == null ? void 0 : address.country) ?? "",
|
|
110
|
-
addressLine1: (address == null ? void 0 : address.line1) ?? "",
|
|
111
|
-
addressLine2: (address == null ? void 0 : address.line2) ?? "",
|
|
112
|
-
postalCode: (address == null ? void 0 : address.postal_code) ?? "",
|
|
113
|
-
city: (address == null ? void 0 : address.city) ?? "",
|
|
114
|
-
state: (address == null ? void 0 : address.state) ?? "",
|
|
115
|
-
companyLegalName: customer.organization.legal_name ?? "",
|
|
116
|
-
companyVatNumber: customer.organization.tax_id ?? ""
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
const mapFormStateToCustomerPayload = (data) => data.type === "ORGANIZATION" ? {
|
|
120
|
-
type: "ORGANIZATION",
|
|
121
|
-
email: data.email,
|
|
122
|
-
organization: {
|
|
123
|
-
legal_name: data.companyLegalName ?? "",
|
|
124
|
-
tax_id: data.companyVatNumber ?? "",
|
|
125
|
-
registered_address: {
|
|
126
|
-
line1: data.addressLine1,
|
|
127
|
-
line2: data.addressLine2 ?? "",
|
|
128
|
-
postal_code: data.postalCode,
|
|
129
|
-
city: data.city,
|
|
130
|
-
country: data.country,
|
|
131
|
-
state: data.state ?? ""
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
} : {
|
|
135
|
-
type: "INDIVIDUAL",
|
|
136
|
-
email: data.email,
|
|
137
|
-
individual: {
|
|
138
|
-
name: {
|
|
139
|
-
first_name: data.firstName ?? "",
|
|
140
|
-
last_name: data.lastName ?? ""
|
|
141
|
-
},
|
|
142
|
-
residential_address: {
|
|
143
|
-
line1: data.addressLine1,
|
|
144
|
-
line2: data.addressLine2 ?? "",
|
|
145
|
-
postal_code: data.postalCode,
|
|
146
|
-
city: data.city,
|
|
147
|
-
country: data.country,
|
|
148
|
-
state: data.state ?? ""
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const _hoisted_1 = { class: "grid grid-cols-1 gap-4" };
|
|
153
|
-
const _hoisted_2 = { class: "flex grow flex-col" };
|
|
154
|
-
const _hoisted_3 = { class: "mt-6 flex items-center justify-between gap-4" };
|
|
155
|
-
const _hoisted_4 = { class: "flex flex-col gap-2" };
|
|
156
|
-
const _hoisted_5 = {
|
|
157
|
-
key: 0,
|
|
158
|
-
class: "grid grid-cols-2 gap-2"
|
|
159
|
-
};
|
|
160
|
-
const _hoisted_6 = { class: "grid grid-cols-3 gap-2" };
|
|
161
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
162
|
-
__name: "BillingInformationForm",
|
|
163
|
-
props: {
|
|
164
|
-
customer: { type: Object },
|
|
165
|
-
isLoading: { type: Boolean },
|
|
166
|
-
apiError: { type: null },
|
|
167
|
-
updateCustomer: { type: Function }
|
|
168
|
-
},
|
|
169
|
-
setup(__props) {
|
|
170
|
-
const props = __props;
|
|
171
|
-
const { $t } = useIntl();
|
|
172
|
-
const { validation, form, updateInitialState, submit, hasChanges } = useBillingInformationForm({
|
|
173
|
-
onSubmit: ({ customerId, payload }) => props.updateCustomer({ customerId, payload })
|
|
174
|
-
});
|
|
175
|
-
const hasHydratedFromCustomer = ref(false);
|
|
176
|
-
const isCompanyPurchase = computed(() => form.value.type === "ORGANIZATION");
|
|
177
|
-
const showCompanyPurchaseToggle = computed(() => !hasHydratedFromCustomer.value);
|
|
178
|
-
const companyPurchaseModel = computed({
|
|
179
|
-
get: () => isCompanyPurchase.value,
|
|
180
|
-
set: (value) => form.value.type = value ? "ORGANIZATION" : "INDIVIDUAL"
|
|
181
|
-
});
|
|
182
|
-
const handleSubmit = async () => {
|
|
183
|
-
var _a;
|
|
184
|
-
await validation.value.$validate();
|
|
185
|
-
const isValid = !validation.value.$invalid;
|
|
186
|
-
if (!isValid) return;
|
|
187
|
-
if (!((_a = props.customer) == null ? void 0 : _a.id)) return;
|
|
188
|
-
await submit(props.customer.id);
|
|
189
|
-
};
|
|
190
|
-
watch(
|
|
191
|
-
() => props.customer,
|
|
192
|
-
(customer) => {
|
|
193
|
-
if (!customer || hasHydratedFromCustomer.value) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
updateInitialState(customer);
|
|
197
|
-
hasHydratedFromCustomer.value = true;
|
|
198
|
-
},
|
|
199
|
-
{ immediate: true }
|
|
200
|
-
);
|
|
201
|
-
return (_ctx, _cache) => {
|
|
202
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
203
|
-
return openBlock(), createElementBlock("form", {
|
|
204
|
-
onSubmit: withModifiers(handleSubmit, ["prevent"])
|
|
205
|
-
}, [
|
|
206
|
-
createVNode(unref(_sfc_main$2$1), {
|
|
207
|
-
variant: "heading-3",
|
|
208
|
-
tag: "h2"
|
|
209
|
-
}, {
|
|
210
|
-
default: withCtx(() => [
|
|
211
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
212
|
-
defaultMessage: "Customer information",
|
|
213
|
-
id: "checkout.contact_information_block.title",
|
|
214
|
-
description: "The title of the contact information block in the checkout form"
|
|
215
|
-
})), 1)
|
|
216
|
-
]),
|
|
217
|
-
_: 1
|
|
218
|
-
}),
|
|
219
|
-
createElementVNode("div", _hoisted_1, [
|
|
220
|
-
createVNode(unref(_sfc_main$2a), {
|
|
221
|
-
modelValue: unref(form).email,
|
|
222
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(form).email = $event),
|
|
223
|
-
required: "",
|
|
224
|
-
type: "email",
|
|
225
|
-
label: unref($t)({
|
|
226
|
-
defaultMessage: "Email address",
|
|
227
|
-
id: "checkout.email_address.label",
|
|
228
|
-
description: "The email address of the customer in the checkout form"
|
|
229
|
-
}),
|
|
230
|
-
placeholder: unref($t)({
|
|
231
|
-
defaultMessage: "Email address...",
|
|
232
|
-
id: "checkout.email_address.placeholder",
|
|
233
|
-
description: "The email address of the customer in the checkout form"
|
|
234
|
-
}),
|
|
235
|
-
error: ((_a = unref(validation).email) == null ? void 0 : _a.$errors) || ((_b = __props.apiError) == null ? void 0 : _b.email)
|
|
236
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"]),
|
|
237
|
-
createVNode(unref(_sfc_main$1$), {
|
|
238
|
-
"single-model-value": unref(form).country,
|
|
239
|
-
"onUpdate:singleModelValue": _cache[1] || (_cache[1] = ($event) => unref(form).country = $event),
|
|
240
|
-
label: unref($t)({
|
|
241
|
-
defaultMessage: "Country",
|
|
242
|
-
id: "checkout.country.label",
|
|
243
|
-
description: "The country of the customer in the checkout form"
|
|
244
|
-
}),
|
|
245
|
-
error: (_c = __props.apiError) == null ? void 0 : _c.country
|
|
246
|
-
}, null, 8, ["single-model-value", "label", "error"]),
|
|
247
|
-
showCompanyPurchaseToggle.value ? (openBlock(), createBlock(unref(_sfc_main$20), {
|
|
248
|
-
key: 0,
|
|
249
|
-
modelValue: companyPurchaseModel.value,
|
|
250
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => companyPurchaseModel.value = $event),
|
|
251
|
-
"label-position": "before"
|
|
252
|
-
}, {
|
|
253
|
-
"inline-label": withCtx(() => [
|
|
254
|
-
createElementVNode("div", _hoisted_2, [
|
|
255
|
-
createVNode(unref(_sfc_main$2$1), { tag: "span" }, {
|
|
256
|
-
default: withCtx(() => [
|
|
257
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
258
|
-
defaultMessage: "Company purchase",
|
|
259
|
-
id: "checkout.company_purchase_toggle.title",
|
|
260
|
-
description: "The title of the company purchase toggle in the checkout"
|
|
261
|
-
})), 1)
|
|
262
|
-
]),
|
|
263
|
-
_: 1
|
|
264
|
-
}),
|
|
265
|
-
createVNode(unref(_sfc_main$2$1), {
|
|
266
|
-
tag: "span",
|
|
267
|
-
variant: "body-xs",
|
|
268
|
-
shade: "lighter"
|
|
269
|
-
}, {
|
|
270
|
-
default: withCtx(() => [
|
|
271
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
272
|
-
defaultMessage: "I am purchasing on behalf of a company",
|
|
273
|
-
id: "checkout.company_purchase_toggle.sub_title",
|
|
274
|
-
description: "The subtitle of the company purchase toggle in the checkout"
|
|
275
|
-
})), 1)
|
|
276
|
-
]),
|
|
277
|
-
_: 1
|
|
278
|
-
})
|
|
279
|
-
])
|
|
280
|
-
]),
|
|
281
|
-
_: 1
|
|
282
|
-
}, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
283
|
-
isCompanyPurchase.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
284
|
-
createVNode(unref(_sfc_main$2a), {
|
|
285
|
-
modelValue: unref(form).companyVatNumber,
|
|
286
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(form).companyVatNumber = $event),
|
|
287
|
-
name: "vat_number",
|
|
288
|
-
label: unref($t)({
|
|
289
|
-
defaultMessage: "VAT number",
|
|
290
|
-
id: "checkout.vat_number.label",
|
|
291
|
-
description: "The label for the vat number in the checkout form"
|
|
292
|
-
}),
|
|
293
|
-
placeholder: unref($t)({
|
|
294
|
-
defaultMessage: "VAT number...",
|
|
295
|
-
id: "checkout.vat_number.placeholder",
|
|
296
|
-
description: "The label for the vat number in the checkout form"
|
|
297
|
-
}),
|
|
298
|
-
error: (_d = __props.apiError) == null ? void 0 : _d.vat_number
|
|
299
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"]),
|
|
300
|
-
createVNode(unref(_sfc_main$2a), {
|
|
301
|
-
modelValue: unref(form).companyLegalName,
|
|
302
|
-
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(form).companyLegalName = $event),
|
|
303
|
-
required: "",
|
|
304
|
-
name: "legal_name",
|
|
305
|
-
label: unref($t)({
|
|
306
|
-
defaultMessage: "Legal entity name",
|
|
307
|
-
id: "checkout.legal_name.label",
|
|
308
|
-
description: "The legal name of the organization customer in the checkout form"
|
|
309
|
-
}),
|
|
310
|
-
placeholder: unref($t)({
|
|
311
|
-
defaultMessage: "Legal entity name...",
|
|
312
|
-
id: "checkout.legal_name.placeholder",
|
|
313
|
-
description: "The legal name of the organization customer in the checkout form"
|
|
314
|
-
}),
|
|
315
|
-
error: (_e = __props.apiError) == null ? void 0 : _e.legal_name
|
|
316
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"])
|
|
317
|
-
], 64)) : createCommentVNode("", true)
|
|
318
|
-
]),
|
|
319
|
-
createElementVNode("div", _hoisted_3, [
|
|
320
|
-
createVNode(unref(_sfc_main$2$1), {
|
|
321
|
-
variant: "heading-3",
|
|
322
|
-
tag: "h2"
|
|
323
|
-
}, {
|
|
324
|
-
default: withCtx(() => [
|
|
325
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
326
|
-
defaultMessage: "Billing details",
|
|
327
|
-
id: "checkout.billing_information_block.title",
|
|
328
|
-
description: "The title of the billing information block in the checkout form"
|
|
329
|
-
})), 1)
|
|
330
|
-
]),
|
|
331
|
-
_: 1
|
|
332
|
-
})
|
|
333
|
-
]),
|
|
334
|
-
createElementVNode("div", _hoisted_4, [
|
|
335
|
-
!isCompanyPurchase.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
336
|
-
createVNode(unref(_sfc_main$2a), {
|
|
337
|
-
modelValue: unref(form).firstName,
|
|
338
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(form).firstName = $event),
|
|
339
|
-
name: "first_name",
|
|
340
|
-
label: unref($t)({
|
|
341
|
-
defaultMessage: "First name",
|
|
342
|
-
id: "checkout.first_name.label",
|
|
343
|
-
description: "The first name of the customer in the checkout form"
|
|
344
|
-
}),
|
|
345
|
-
placeholder: unref($t)({
|
|
346
|
-
defaultMessage: "First name...",
|
|
347
|
-
id: "checkout.first_name.placeholder",
|
|
348
|
-
description: "The first name of the customer in the checkout form"
|
|
349
|
-
}),
|
|
350
|
-
error: (_f = __props.apiError) == null ? void 0 : _f.first_name
|
|
351
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"]),
|
|
352
|
-
createVNode(unref(_sfc_main$2a), {
|
|
353
|
-
modelValue: unref(form).lastName,
|
|
354
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(form).lastName = $event),
|
|
355
|
-
name: "last_name",
|
|
356
|
-
label: unref($t)({
|
|
357
|
-
defaultMessage: "Last name",
|
|
358
|
-
id: "checkout.last_name.label",
|
|
359
|
-
description: "The last name of the customer in the checkout form"
|
|
360
|
-
}),
|
|
361
|
-
placeholder: unref($t)({
|
|
362
|
-
defaultMessage: "Last name...",
|
|
363
|
-
id: "checkout.last_name.placeholder",
|
|
364
|
-
description: "The last name of the customer in the checkout form"
|
|
365
|
-
}),
|
|
366
|
-
error: (_g = __props.apiError) == null ? void 0 : _g.last_name
|
|
367
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"])
|
|
368
|
-
])) : createCommentVNode("", true),
|
|
369
|
-
createVNode(unref(_sfc_main$2a), {
|
|
370
|
-
modelValue: unref(form).addressLine1,
|
|
371
|
-
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(form).addressLine1 = $event),
|
|
372
|
-
name: "address_line_1",
|
|
373
|
-
label: unref($t)({
|
|
374
|
-
defaultMessage: "Billing address",
|
|
375
|
-
id: "checkout.address.title",
|
|
376
|
-
description: "Address line 1 of the customer address in the checkout form"
|
|
377
|
-
}),
|
|
378
|
-
placeholder: unref($t)({
|
|
379
|
-
defaultMessage: "Address line 1...",
|
|
380
|
-
id: "checkout.address.line1.placeholder",
|
|
381
|
-
description: "Address line 1 of the customer address in the checkout form"
|
|
382
|
-
}),
|
|
383
|
-
error: (_h = __props.apiError) == null ? void 0 : _h.address_line_1
|
|
384
|
-
}, null, 8, ["modelValue", "label", "placeholder", "error"]),
|
|
385
|
-
createVNode(unref(_sfc_main$2a), {
|
|
386
|
-
modelValue: unref(form).addressLine2,
|
|
387
|
-
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => unref(form).addressLine2 = $event),
|
|
388
|
-
name: "address_line_2",
|
|
389
|
-
placeholder: unref($t)({
|
|
390
|
-
defaultMessage: "Address line 2...",
|
|
391
|
-
id: "checkout.address.line2.placeholder",
|
|
392
|
-
description: "Address line 2 of the customer address in the checkout form"
|
|
393
|
-
}),
|
|
394
|
-
error: (_i = __props.apiError) == null ? void 0 : _i.address_line_2
|
|
395
|
-
}, null, 8, ["modelValue", "placeholder", "error"]),
|
|
396
|
-
createElementVNode("div", _hoisted_6, [
|
|
397
|
-
createVNode(unref(_sfc_main$2a), {
|
|
398
|
-
modelValue: unref(form).postalCode,
|
|
399
|
-
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(form).postalCode = $event),
|
|
400
|
-
name: "postal_code",
|
|
401
|
-
placeholder: unref($t)({
|
|
402
|
-
defaultMessage: "Postal code...",
|
|
403
|
-
id: "checkout.address.portal_code.placeholder",
|
|
404
|
-
description: "Postal code of the customer address in the checkout form"
|
|
405
|
-
}),
|
|
406
|
-
error: (_j = __props.apiError) == null ? void 0 : _j.postal_code
|
|
407
|
-
}, null, 8, ["modelValue", "placeholder", "error"]),
|
|
408
|
-
createVNode(unref(_sfc_main$2a), {
|
|
409
|
-
modelValue: unref(form).city,
|
|
410
|
-
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => unref(form).city = $event),
|
|
411
|
-
name: "city",
|
|
412
|
-
placeholder: unref($t)({
|
|
413
|
-
defaultMessage: "City...",
|
|
414
|
-
id: "checkout.address.city.placeholder",
|
|
415
|
-
description: "City of the customer address in the checkout form"
|
|
416
|
-
}),
|
|
417
|
-
error: (_k = __props.apiError) == null ? void 0 : _k.city
|
|
418
|
-
}, null, 8, ["modelValue", "placeholder", "error"]),
|
|
419
|
-
createVNode(unref(_sfc_main$2a), {
|
|
420
|
-
modelValue: unref(form).state,
|
|
421
|
-
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => unref(form).state = $event),
|
|
422
|
-
name: "state",
|
|
423
|
-
placeholder: unref($t)({
|
|
424
|
-
defaultMessage: "State...",
|
|
425
|
-
id: "checkout.address.state.placeholder",
|
|
426
|
-
description: "State of the customer address in the checkout form"
|
|
427
|
-
}),
|
|
428
|
-
error: (_l = __props.apiError) == null ? void 0 : _l.state
|
|
429
|
-
}, null, 8, ["modelValue", "placeholder", "error"])
|
|
430
|
-
])
|
|
431
|
-
]),
|
|
432
|
-
((_m = __props.apiError) == null ? void 0 : _m._generic) ? (openBlock(), createBlock(unref(_sfc_main$16), {
|
|
433
|
-
key: 0,
|
|
434
|
-
class: "mt-4",
|
|
435
|
-
title: __props.apiError._generic
|
|
436
|
-
}, null, 8, ["title"])) : createCommentVNode("", true),
|
|
437
|
-
createVNode(unref(_sfc_main$2H), {
|
|
438
|
-
type: "submit",
|
|
439
|
-
color: "primary",
|
|
440
|
-
disabled: !unref(hasChanges),
|
|
441
|
-
loading: __props.isLoading,
|
|
442
|
-
class: "mt-4"
|
|
443
|
-
}, {
|
|
444
|
-
default: withCtx(() => [
|
|
445
|
-
createTextVNode(toDisplayString(unref($t)({
|
|
446
|
-
defaultMessage: "Save changes",
|
|
447
|
-
id: "billing_information_form.submit_button.label",
|
|
448
|
-
description: "The label for the submit button of the billing information form"
|
|
449
|
-
})), 1)
|
|
450
|
-
]),
|
|
451
|
-
_: 1
|
|
452
|
-
}, 8, ["disabled", "loading"])
|
|
453
|
-
], 32);
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
458
|
-
__name: "BillingInformationForm",
|
|
459
|
-
props: {
|
|
460
|
-
customer: { type: Object },
|
|
461
|
-
apiError: { type: null },
|
|
462
|
-
updateCustomer: { type: Function },
|
|
463
|
-
isLoading: { type: Boolean }
|
|
464
|
-
},
|
|
465
|
-
setup(__props) {
|
|
466
|
-
return (_ctx, _cache) => {
|
|
467
|
-
return openBlock(), createBlock(_sfc_main$3, {
|
|
468
|
-
customer: __props.customer,
|
|
469
|
-
"update-customer": __props.updateCustomer,
|
|
470
|
-
"is-loading": __props.isLoading,
|
|
471
|
-
"api-error": __props.apiError
|
|
472
|
-
}, null, 8, ["customer", "update-customer", "is-loading", "api-error"]);
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
477
|
-
__name: "BillingInformationForm.entry.view",
|
|
478
|
-
props: {
|
|
479
|
-
environment: { type: String },
|
|
480
|
-
locale: { type: String },
|
|
481
|
-
dateLocale: { type: String },
|
|
482
|
-
messages: { type: Object },
|
|
483
|
-
showTimezones: { type: Boolean },
|
|
484
|
-
primaryColor: { type: String },
|
|
485
|
-
secondaryColor: { type: String },
|
|
486
|
-
isShadowRoot: { type: Boolean },
|
|
487
|
-
experimentalFeatures: { type: Array },
|
|
488
|
-
logLevel: { type: String },
|
|
489
|
-
onLog: { type: Function },
|
|
490
|
-
allowedPortalTypes: { type: Array },
|
|
491
|
-
portalObject: { type: Object },
|
|
492
|
-
customElementName: { type: String },
|
|
493
|
-
branding: { type: Object }
|
|
494
|
-
},
|
|
495
|
-
setup(__props) {
|
|
496
|
-
const props = __props;
|
|
497
|
-
const customerId = props.portalObject.customer_id;
|
|
498
|
-
const { customer, get, update } = useCustomer({ customerId });
|
|
499
|
-
onMounted(async () => {
|
|
500
|
-
await get.execute();
|
|
501
|
-
});
|
|
502
|
-
return (_ctx, _cache) => {
|
|
503
|
-
return renderSlot(_ctx.$slots, "default", {
|
|
504
|
-
customer: unref(customer),
|
|
505
|
-
isLoading: unref(get).isPending.value || unref(update).isPending.value,
|
|
506
|
-
updateCustomer: unref(update),
|
|
507
|
-
apiError: unref(getApiError)(unref(update).error)
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
513
|
-
__name: "BillingInformationForm.entry",
|
|
514
|
-
props: {
|
|
515
|
-
environment: { type: String },
|
|
516
|
-
locale: { type: String },
|
|
517
|
-
dateLocale: { type: String },
|
|
518
|
-
messages: { type: Object },
|
|
519
|
-
showTimezones: { type: Boolean },
|
|
520
|
-
primaryColor: { type: String },
|
|
521
|
-
secondaryColor: { type: String },
|
|
522
|
-
isShadowRoot: { type: Boolean },
|
|
523
|
-
experimentalFeatures: { type: Array },
|
|
524
|
-
logLevel: { type: String },
|
|
525
|
-
onLog: { type: Function },
|
|
526
|
-
allowedPortalTypes: { type: Array },
|
|
527
|
-
portalObject: { type: Object },
|
|
528
|
-
customElementName: { type: String },
|
|
529
|
-
branding: { type: Object }
|
|
530
|
-
},
|
|
531
|
-
emits: ["error"],
|
|
532
|
-
setup(__props) {
|
|
533
|
-
return (_ctx, _cache) => {
|
|
534
|
-
var _a, _b, _c, _d;
|
|
535
|
-
return openBlock(), createBlock(unref(_sfc_main$4), {
|
|
536
|
-
"custom-element-name": unref(COMPONENT_NAME),
|
|
537
|
-
environment: __props.environment,
|
|
538
|
-
locale: __props.locale,
|
|
539
|
-
"portal-object": __props.portalObject,
|
|
540
|
-
"allowed-portal-types": ["CUSTOMER"],
|
|
541
|
-
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
542
|
-
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
543
|
-
"experimental-features": __props.experimentalFeatures,
|
|
544
|
-
"log-level": __props.logLevel,
|
|
545
|
-
"on-log": __props.onLog,
|
|
546
|
-
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
547
|
-
}, {
|
|
548
|
-
default: withCtx(() => [
|
|
549
|
-
createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
550
|
-
default: withCtx(({ customer, updateCustomer, isLoading, apiError }) => [
|
|
551
|
-
customer ? (openBlock(), createBlock(_sfc_main$2, {
|
|
552
|
-
key: 0,
|
|
553
|
-
customer,
|
|
554
|
-
"is-loading": isLoading,
|
|
555
|
-
"update-customer": ({ payload }) => updateCustomer.execute(payload),
|
|
556
|
-
"api-error": apiError
|
|
557
|
-
}, null, 8, ["customer", "is-loading", "update-customer", "api-error"])) : createCommentVNode("", true)
|
|
558
|
-
]),
|
|
559
|
-
_: 1
|
|
560
|
-
}, 16)
|
|
561
|
-
]),
|
|
562
|
-
_: 1
|
|
563
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
const SolvimonBillingInformationForm = defineCustomElement(_sfc_main);
|
|
568
|
-
const COMPONENT_NAME = getComponentName("billing-information-form");
|
|
569
|
-
const defineSolvimonBillingInformationForm = () => {
|
|
570
|
-
if (!customElements.get(COMPONENT_NAME)) {
|
|
571
|
-
customElements.define(COMPONENT_NAME, SolvimonBillingInformationForm);
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
export {
|
|
575
|
-
COMPONENT_NAME as C,
|
|
576
|
-
SolvimonBillingInformationForm as S,
|
|
577
|
-
_sfc_main as _,
|
|
578
|
-
defineSolvimonBillingInformationForm as d
|
|
579
|
-
};
|