@vergelijkdirect/comparison-forms 2.0.0-rc.14 → 2.0.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wc-forms/VdInput-BaZx7lM7.js +1 -0
- package/dist/wc-forms/VdPopover-B_0EwmOm.js +1 -0
- package/dist/wc-forms/VdRadioGroup-BAy4077M.js +1 -0
- package/dist/wc-forms/VdSearchableSelect-BYsNA8so.js +9 -0
- package/dist/wc-forms/VdSelect-DS5ijaBw.js +1 -0
- package/dist/wc-forms/bike.js +1 -1647
- package/dist/wc-forms/birthdate.schema-B2IfhcT0.js +1 -0
- package/dist/wc-forms/business-car.js +1 -109
- package/dist/wc-forms/business-liability.js +1 -71
- package/dist/wc-forms/car.js +1 -112
- package/dist/wc-forms/caravan.js +1 -144
- package/dist/wc-forms/company.schema-D_-KvPAl.js +1 -0
- package/dist/wc-forms/date.util-Dn_Fq_ZZ.js +1 -0
- package/dist/wc-forms/familyComposition.schema-BckaOvgV.js +1 -0
- package/dist/wc-forms/floating-ui.dom-CZdxKWz5.js +1 -0
- package/dist/wc-forms/house.js +1 -101
- package/dist/wc-forms/houseOwnedBuilding.model-RQzmveyS.js +1 -0
- package/dist/wc-forms/legal.js +1 -153
- package/dist/wc-forms/liability.js +1 -89
- package/dist/wc-forms/loan.js +1 -173
- package/dist/wc-forms/messages-Da6go1uu.js +1 -0
- package/dist/wc-forms/moped.js +1 -115
- package/dist/wc-forms/motor.js +1 -112
- package/dist/wc-forms/package.js +1 -119
- package/dist/wc-forms/pet.js +1 -158
- package/dist/wc-forms/rolldown-runtime-Bm1jhNxk.js +1 -0
- package/dist/wc-forms/rules-4erM_5MW.js +1 -0
- package/dist/wc-forms/services-D6FlwWWO.js +1 -0
- package/dist/wc-forms/travel.js +1 -99
- package/dist/wc-forms/useAddress-mxYJ2B9-.js +1 -0
- package/dist/wc-forms/useLicensePlate-BK5GSqI6.js +1 -0
- package/dist/wc-forms/useValidator-BXvfnDwv.js +27 -0
- package/dist/wc-forms/yesNo-Dat_jmcx.js +1 -0
- package/package.json +1 -1
- package/dist/wc-forms/VdInput-PLH7DZsc.js +0 -331
- package/dist/wc-forms/VdPopover-CcRVedXS.js +0 -285
- package/dist/wc-forms/VdRadioGroup-BsMaGEuY.js +0 -166
- package/dist/wc-forms/VdSearchableSelect-CY7qBcIO.js +0 -4516
- package/dist/wc-forms/VdSelect-BPB3Jh_f.js +0 -108
- package/dist/wc-forms/birthdate.schema-DGsq2GQR.js +0 -89
- package/dist/wc-forms/company.schema-CUG4hnMP.js +0 -239
- package/dist/wc-forms/date.util-D9xNHiuY.js +0 -474
- package/dist/wc-forms/familyComposition.schema-fY4w6P1J.js +0 -74
- package/dist/wc-forms/floating-ui.dom-B6uyM6oK.js +0 -856
- package/dist/wc-forms/houseOwnedBuilding.model-CPULUrWv.js +0 -14
- package/dist/wc-forms/messages-kbFdNTrA.js +0 -40
- package/dist/wc-forms/rolldown-runtime-Dqa2HsxW.js +0 -20
- package/dist/wc-forms/rules-Cj1sWDmF.js +0 -13
- package/dist/wc-forms/services-CG6XsnRT.js +0 -16
- package/dist/wc-forms/useAddress-LSZ7sQk9.js +0 -243
- package/dist/wc-forms/useLicensePlate-KLwykzxF.js +0 -187
- package/dist/wc-forms/useValidator-DdXn8soU.js +0 -7197
- package/dist/wc-forms/yesNo-BvJlCm7Y.js +0 -6
package/dist/wc-forms/house.js
CHANGED
|
@@ -1,101 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as g } from "./VdRadioGroup-BsMaGEuY.js";
|
|
3
|
-
import { n as _, t as v } from "./useAddress-LSZ7sQk9.js";
|
|
4
|
-
import { i as y, r as b, t as x } from "./familyComposition.schema-fY4w6P1J.js";
|
|
5
|
-
import { n as S } from "./yesNo-BvJlCm7Y.js";
|
|
6
|
-
import { t as C } from "./messages-kbFdNTrA.js";
|
|
7
|
-
import { n as w, t as T } from "./houseOwnedBuilding.model-CPULUrWv.js";
|
|
8
|
-
//#region src/comparisons/house/house.schema.ts
|
|
9
|
-
var E = (e) => u({
|
|
10
|
-
address: e,
|
|
11
|
-
ownedBuilding: w,
|
|
12
|
-
familyComposition: x(C.house.familyCompositionRequired)
|
|
13
|
-
}), D = /* @__PURE__ */ o({
|
|
14
|
-
__name: "HouseForm",
|
|
15
|
-
props: /*@__PURE__*/ e({
|
|
16
|
-
initialData: {},
|
|
17
|
-
title: {},
|
|
18
|
-
description: {},
|
|
19
|
-
banner: {},
|
|
20
|
-
layout: {},
|
|
21
|
-
card: { type: Boolean },
|
|
22
|
-
flat: { type: Boolean },
|
|
23
|
-
fullWidth: { type: Boolean },
|
|
24
|
-
submitLabel: {},
|
|
25
|
-
submitDisabled: { type: Boolean }
|
|
26
|
-
}, {
|
|
27
|
-
...m,
|
|
28
|
-
title: "Woonverzekering vergelijken"
|
|
29
|
-
}),
|
|
30
|
-
emits: ["submit"],
|
|
31
|
-
setup(e, { emit: a }) {
|
|
32
|
-
let o = e, u = i(o), m = a, { addressSchema: x, draft: C, resolvedAddress: w, additionOptions: D } = v({ initial: o.initialData?.address }), { isSubmitting: O, handleSubmit: k, defineField: A } = p(E(x), {
|
|
33
|
-
ownedBuilding: o.initialData?.ownedBuilding ?? S.Yes,
|
|
34
|
-
familyComposition: o.initialData?.familyComposition ?? y.SingleWithoutChildren,
|
|
35
|
-
address: C
|
|
36
|
-
}), [j, M, N] = A("ownedBuilding"), [P, F, I] = A("familyComposition", { validateAt: "change" });
|
|
37
|
-
function L() {
|
|
38
|
-
k(({ ownedBuilding: e, familyComposition: t }) => {
|
|
39
|
-
m("submit", {
|
|
40
|
-
ownedBuilding: e,
|
|
41
|
-
familyComposition: t,
|
|
42
|
-
address: w.value
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return (i, a) => (n(), l(d(f), s(d(u), {
|
|
47
|
-
"submit-disabled": e.submitDisabled || d(O),
|
|
48
|
-
onSubmit: L
|
|
49
|
-
}), {
|
|
50
|
-
default: t(() => [
|
|
51
|
-
c(d(r), {
|
|
52
|
-
span: "4",
|
|
53
|
-
md: "6"
|
|
54
|
-
}, {
|
|
55
|
-
default: t(() => [c(d(_), {
|
|
56
|
-
"resolved-address": d(w),
|
|
57
|
-
"onUpdate:resolvedAddress": a[0] ||= (e) => h(w) ? w.value = e : null,
|
|
58
|
-
"addition-options": d(D)
|
|
59
|
-
}, null, 8, ["resolved-address", "addition-options"])]),
|
|
60
|
-
_: 1
|
|
61
|
-
}),
|
|
62
|
-
c(d(r), {
|
|
63
|
-
span: "3",
|
|
64
|
-
md: "3"
|
|
65
|
-
}, {
|
|
66
|
-
default: t(() => [c(d(g), s({
|
|
67
|
-
modelValue: d(j),
|
|
68
|
-
"onUpdate:modelValue": a[1] ||= (e) => h(j) ? j.value = e : null,
|
|
69
|
-
legend: "Jouw woning is...",
|
|
70
|
-
name: "ownedBuilding",
|
|
71
|
-
options: d(T),
|
|
72
|
-
variant: "boxed",
|
|
73
|
-
required: !1,
|
|
74
|
-
"error-message": d(N)
|
|
75
|
-
}, d(M)), null, 16, [
|
|
76
|
-
"modelValue",
|
|
77
|
-
"options",
|
|
78
|
-
"error-message"
|
|
79
|
-
])]),
|
|
80
|
-
_: 1
|
|
81
|
-
}),
|
|
82
|
-
c(d(r), {
|
|
83
|
-
span: "3",
|
|
84
|
-
md: "3"
|
|
85
|
-
}, {
|
|
86
|
-
default: t(() => [c(d(b), s({
|
|
87
|
-
modelValue: d(P),
|
|
88
|
-
"onUpdate:modelValue": a[2] ||= (e) => h(P) ? P.value = e : null,
|
|
89
|
-
"error-message": d(I)
|
|
90
|
-
}, d(F)), null, 16, ["modelValue", "error-message"])]),
|
|
91
|
-
_: 1
|
|
92
|
-
})
|
|
93
|
-
]),
|
|
94
|
-
_: 1
|
|
95
|
-
}, 16, ["submit-disabled"]));
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/entries/wc-forms/house.ts
|
|
100
|
-
customElements.define("vd-house-form", a(D, { shadowRoot: !1 }));
|
|
101
|
-
//#endregion
|
|
1
|
+
import{VdComparisonForm_default,VdFormCol_default,comparisonFormSharedDefaults,create$3,createBlock,createVNode,defineComponent,defineCustomElement,isRef,mergeDefaults,mergeProps,openBlock,unref,useComparisonFormProps,useValidator,withCtx}from"./useValidator-BXvfnDwv.js";import{VdRadioGroup_default}from"./VdRadioGroup-BAy4077M.js";import{VdAddress_default,useAddress}from"./useAddress-mxYJ2B9-.js";import{FamilyComposition,VdFamilyCompositionSelect_default,createFamilyCompositionSchema}from"./familyComposition.schema-BckaOvgV.js";import{YesNo}from"./yesNo-Dat_jmcx.js";import{VALIDATION_MESSAGES}from"./messages-Da6go1uu.js";import{houseOwnedBuilding_model_default,ownedBuildingSchema}from"./houseOwnedBuilding.model-RQzmveyS.js";var createHouseFormSchema=addressSchema=>create$3({address:addressSchema,ownedBuilding:ownedBuildingSchema,familyComposition:createFamilyCompositionSchema(VALIDATION_MESSAGES.house.familyCompositionRequired)}),HouseForm_default=defineComponent({__name:`HouseForm`,props:mergeDefaults({initialData:{},title:{},description:{},banner:{},layout:{},card:{type:Boolean},flat:{type:Boolean},fullWidth:{type:Boolean},submitLabel:{},submitDisabled:{type:Boolean}},{...comparisonFormSharedDefaults,title:`Woonverzekering vergelijken`}),emits:[`submit`],setup(__props,{emit:__emit}){let props=__props,baseFormProps=useComparisonFormProps(props),emit=__emit,{addressSchema,draft:addressDraft,resolvedAddress,additionOptions}=useAddress({initial:props.initialData?.address}),{isSubmitting,handleSubmit,defineField}=useValidator(createHouseFormSchema(addressSchema),{ownedBuilding:props.initialData?.ownedBuilding??YesNo.Yes,familyComposition:props.initialData?.familyComposition??FamilyComposition.SingleWithoutChildren,address:addressDraft}),[ownedBuilding,ownedBuildingAttrs,ownedBuildingError]=defineField(`ownedBuilding`),[familyComposition,familyCompositionAttrs,familyCompositionError]=defineField(`familyComposition`,{validateAt:`change`});function onSubmit(){handleSubmit(({ownedBuilding,familyComposition})=>{emit(`submit`,{ownedBuilding,familyComposition,address:resolvedAddress.value})})}return(_ctx,_cache)=>(openBlock(),createBlock(unref(VdComparisonForm_default),mergeProps(unref(baseFormProps),{"submit-disabled":__props.submitDisabled||unref(isSubmitting),onSubmit}),{default:withCtx(()=>[createVNode(unref(VdFormCol_default),{span:`4`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdAddress_default),{"resolved-address":unref(resolvedAddress),"onUpdate:resolvedAddress":_cache[0]||=$event=>isRef(resolvedAddress)?resolvedAddress.value=$event:null,"addition-options":unref(additionOptions)},null,8,[`resolved-address`,`addition-options`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`3`,md:`3`},{default:withCtx(()=>[createVNode(unref(VdRadioGroup_default),mergeProps({modelValue:unref(ownedBuilding),"onUpdate:modelValue":_cache[1]||=$event=>isRef(ownedBuilding)?ownedBuilding.value=$event:null,legend:`Jouw woning is...`,name:`ownedBuilding`,options:unref(houseOwnedBuilding_model_default),variant:`boxed`,required:!1,"error-message":unref(ownedBuildingError)},unref(ownedBuildingAttrs)),null,16,[`modelValue`,`options`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`3`,md:`3`},{default:withCtx(()=>[createVNode(unref(VdFamilyCompositionSelect_default),mergeProps({modelValue:unref(familyComposition),"onUpdate:modelValue":_cache[2]||=$event=>isRef(familyComposition)?familyComposition.value=$event:null,"error-message":unref(familyCompositionError)},unref(familyCompositionAttrs)),null,16,[`modelValue`,`error-message`])]),_:1})]),_:1},16,[`submit-disabled`]))}});customElements.define(`vd-house-form`,defineCustomElement(HouseForm_default,{shadowRoot:!1}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./useValidator-BXvfnDwv.js";import{YES_NO_VALUES,YesNo}from"./yesNo-Dat_jmcx.js";import{VALIDATION_MESSAGES}from"./messages-Da6go1uu.js";import{requiredOneOf}from"./rules-4erM_5MW.js";var ownedBuildingSchema=requiredOneOf(YES_NO_VALUES,VALIDATION_MESSAGES.ownedBuilding.required),houseOwnedBuilding_model_default=[{value:YesNo.Yes,label:`Gekocht`},{value:YesNo.No,label:`Verhuurd`}];export{houseOwnedBuilding_model_default,ownedBuildingSchema};
|
package/dist/wc-forms/legal.js
CHANGED
|
@@ -1,153 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as b } from "./VdSelect-BPB3Jh_f.js";
|
|
3
|
-
import { t as x } from "./VdRadioGroup-BsMaGEuY.js";
|
|
4
|
-
import { n as S, t as C } from "./useAddress-LSZ7sQk9.js";
|
|
5
|
-
import { a as w, t as T } from "./birthdate.schema-DGsq2GQR.js";
|
|
6
|
-
import { i as E, n as D, r as O } from "./familyComposition.schema-fY4w6P1J.js";
|
|
7
|
-
import { n as k } from "./yesNo-BvJlCm7Y.js";
|
|
8
|
-
import { t as A } from "./messages-kbFdNTrA.js";
|
|
9
|
-
import { n as j, t as M } from "./houseOwnedBuilding.model-CPULUrWv.js";
|
|
10
|
-
//#region src/comparisons/legal/constants.ts
|
|
11
|
-
var N = E.SingleWithChildren, P = (e) => m({
|
|
12
|
-
address: e,
|
|
13
|
-
ownedBuilding: j,
|
|
14
|
-
birthdate: T(),
|
|
15
|
-
familyComposition: D,
|
|
16
|
-
familySize: o().defined().when("familyComposition", {
|
|
17
|
-
is: N,
|
|
18
|
-
then: (e) => e.required(A.legal.familySizeRequired)
|
|
19
|
-
})
|
|
20
|
-
}), F = [{
|
|
21
|
-
title: "Alleenstaande met 1 kind",
|
|
22
|
-
value: "2"
|
|
23
|
-
}, {
|
|
24
|
-
title: "Alleenstaande met 2 of meer kinderen",
|
|
25
|
-
value: "3"
|
|
26
|
-
}], I = /* @__PURE__ */ u({
|
|
27
|
-
__name: "LegalForm",
|
|
28
|
-
props: /*@__PURE__*/ e({
|
|
29
|
-
initialData: {},
|
|
30
|
-
title: {},
|
|
31
|
-
description: {},
|
|
32
|
-
banner: {},
|
|
33
|
-
layout: {},
|
|
34
|
-
card: { type: Boolean },
|
|
35
|
-
flat: { type: Boolean },
|
|
36
|
-
fullWidth: { type: Boolean },
|
|
37
|
-
submitLabel: {},
|
|
38
|
-
submitDisabled: { type: Boolean }
|
|
39
|
-
}, {
|
|
40
|
-
...v,
|
|
41
|
-
title: "Rechtsbijstandverzekering vergelijken"
|
|
42
|
-
}),
|
|
43
|
-
emits: ["submit"],
|
|
44
|
-
setup(e, { emit: o }) {
|
|
45
|
-
let l = e, u = c(l), m = o, { addressSchema: v, draft: T, resolvedAddress: D, additionOptions: A } = C({ initial: l.initialData?.address }), { isSubmitting: j, handleSubmit: I, defineField: L, resetField: R } = _(P(v), {
|
|
46
|
-
ownedBuilding: l.initialData?.ownedBuilding ?? k.Yes,
|
|
47
|
-
birthdate: l.initialData?.birthdate ?? "",
|
|
48
|
-
familyComposition: l.initialData?.familyComposition ?? E.SingleWithoutChildren,
|
|
49
|
-
familySize: l.initialData?.familySize ?? "",
|
|
50
|
-
address: T
|
|
51
|
-
}), [z, B, V] = L("ownedBuilding"), [H, U, W] = L("birthdate"), [G, K, q] = L("familyComposition", { validateAt: "change" }), [J, Y, X] = L("familySize", { validateAt: "change" }), Z = t(() => G.value === N);
|
|
52
|
-
a(G, (e) => {
|
|
53
|
-
e !== N && R("familySize", { value: "" });
|
|
54
|
-
}, { immediate: !0 });
|
|
55
|
-
function Q() {
|
|
56
|
-
I(({ ownedBuilding: e, birthdate: t, familyComposition: n, familySize: r }) => {
|
|
57
|
-
m("submit", {
|
|
58
|
-
ownedBuilding: e,
|
|
59
|
-
birthdate: t,
|
|
60
|
-
familyComposition: n,
|
|
61
|
-
familySize: r,
|
|
62
|
-
address: D.value
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return (t, a) => (i(), p(h(g), d(h(u), {
|
|
67
|
-
"submit-disabled": e.submitDisabled || h(j),
|
|
68
|
-
onSubmit: Q
|
|
69
|
-
}), {
|
|
70
|
-
default: r(() => [
|
|
71
|
-
f(h(s), {
|
|
72
|
-
span: "3",
|
|
73
|
-
md: "6"
|
|
74
|
-
}, {
|
|
75
|
-
default: r(() => [f(h(S), {
|
|
76
|
-
"resolved-address": h(D),
|
|
77
|
-
"onUpdate:resolvedAddress": a[0] ||= (e) => y(D) ? D.value = e : null,
|
|
78
|
-
"addition-options": h(A)
|
|
79
|
-
}, null, 8, ["resolved-address", "addition-options"])]),
|
|
80
|
-
_: 1
|
|
81
|
-
}),
|
|
82
|
-
f(h(s), {
|
|
83
|
-
span: "3",
|
|
84
|
-
md: "6"
|
|
85
|
-
}, {
|
|
86
|
-
default: r(() => [f(h(x), d({
|
|
87
|
-
modelValue: h(z),
|
|
88
|
-
"onUpdate:modelValue": a[1] ||= (e) => y(z) ? z.value = e : null,
|
|
89
|
-
legend: "Jouw woning is...",
|
|
90
|
-
name: "ownedBuilding",
|
|
91
|
-
options: h(M),
|
|
92
|
-
variant: "boxed",
|
|
93
|
-
required: !1,
|
|
94
|
-
"error-message": h(V)
|
|
95
|
-
}, h(B)), null, 16, [
|
|
96
|
-
"modelValue",
|
|
97
|
-
"options",
|
|
98
|
-
"error-message"
|
|
99
|
-
])]),
|
|
100
|
-
_: 1
|
|
101
|
-
}),
|
|
102
|
-
f(h(s), {
|
|
103
|
-
span: "2",
|
|
104
|
-
md: "6"
|
|
105
|
-
}, {
|
|
106
|
-
default: r(() => [f(h(w), d({
|
|
107
|
-
modelValue: h(H),
|
|
108
|
-
"onUpdate:modelValue": a[2] ||= (e) => y(H) ? H.value = e : null,
|
|
109
|
-
"error-message": h(W)
|
|
110
|
-
}, h(U)), null, 16, ["modelValue", "error-message"])]),
|
|
111
|
-
_: 1
|
|
112
|
-
}),
|
|
113
|
-
f(h(s), {
|
|
114
|
-
span: "2",
|
|
115
|
-
md: "6"
|
|
116
|
-
}, {
|
|
117
|
-
default: r(() => [f(h(O), d({
|
|
118
|
-
modelValue: h(G),
|
|
119
|
-
"onUpdate:modelValue": a[3] ||= (e) => y(G) ? G.value = e : null,
|
|
120
|
-
"error-message": h(q)
|
|
121
|
-
}, h(K)), null, 16, ["modelValue", "error-message"])]),
|
|
122
|
-
_: 1
|
|
123
|
-
}),
|
|
124
|
-
Z.value ? (i(), p(h(s), {
|
|
125
|
-
key: 0,
|
|
126
|
-
span: "2",
|
|
127
|
-
md: "6"
|
|
128
|
-
}, {
|
|
129
|
-
default: r(() => [f(h(b), d({
|
|
130
|
-
modelValue: h(J),
|
|
131
|
-
"onUpdate:modelValue": a[4] ||= (e) => y(J) ? J.value = e : null,
|
|
132
|
-
label: "Aantal kinderen",
|
|
133
|
-
placeholder: "Maak een keuze",
|
|
134
|
-
options: h(F),
|
|
135
|
-
name: "familySize",
|
|
136
|
-
required: !1,
|
|
137
|
-
"error-message": h(X)
|
|
138
|
-
}, h(Y)), null, 16, [
|
|
139
|
-
"modelValue",
|
|
140
|
-
"options",
|
|
141
|
-
"error-message"
|
|
142
|
-
])]),
|
|
143
|
-
_: 1
|
|
144
|
-
})) : n("", !0)
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
}, 16, ["submit-disabled"]));
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/entries/wc-forms/legal.ts
|
|
152
|
-
customElements.define("vd-legal-form", l(I, { shadowRoot: !1 }));
|
|
153
|
-
//#endregion
|
|
1
|
+
import{VdComparisonForm_default,VdFormCol_default,comparisonFormSharedDefaults,computed,create$3,create$6,createBlock,createCommentVNode,createVNode,defineComponent,defineCustomElement,isRef,mergeDefaults,mergeProps,openBlock,unref,useComparisonFormProps,useValidator,watch,withCtx}from"./useValidator-BXvfnDwv.js";import{VdSelect_default}from"./VdSelect-DS5ijaBw.js";import{VdRadioGroup_default}from"./VdRadioGroup-BAy4077M.js";import{VdAddress_default,useAddress}from"./useAddress-mxYJ2B9-.js";import{VdBirthdateInput_default,createBirthdateSchema}from"./birthdate.schema-B2IfhcT0.js";import{FamilyComposition,VdFamilyCompositionSelect_default,familyCompositionSchema}from"./familyComposition.schema-BckaOvgV.js";import{YesNo}from"./yesNo-Dat_jmcx.js";import{VALIDATION_MESSAGES}from"./messages-Da6go1uu.js";import{houseOwnedBuilding_model_default,ownedBuildingSchema}from"./houseOwnedBuilding.model-RQzmveyS.js";var FAMILY_SIZE_REQUIRED_COMPOSITION=FamilyComposition.SingleWithChildren,createLegalFormSchema=addressSchema=>create$3({address:addressSchema,ownedBuilding:ownedBuildingSchema,birthdate:createBirthdateSchema(),familyComposition:familyCompositionSchema,familySize:create$6().defined().when(`familyComposition`,{is:FAMILY_SIZE_REQUIRED_COMPOSITION,then:schema=>schema.required(VALIDATION_MESSAGES.legal.familySizeRequired)})}),familySize_model_default=[{title:`Alleenstaande met 1 kind`,value:`2`},{title:`Alleenstaande met 2 of meer kinderen`,value:`3`}],LegalForm_default=defineComponent({__name:`LegalForm`,props:mergeDefaults({initialData:{},title:{},description:{},banner:{},layout:{},card:{type:Boolean},flat:{type:Boolean},fullWidth:{type:Boolean},submitLabel:{},submitDisabled:{type:Boolean}},{...comparisonFormSharedDefaults,title:`Rechtsbijstandverzekering vergelijken`}),emits:[`submit`],setup(__props,{emit:__emit}){let props=__props,baseFormProps=useComparisonFormProps(props),emit=__emit,{addressSchema,draft:addressDraft,resolvedAddress,additionOptions}=useAddress({initial:props.initialData?.address}),{isSubmitting,handleSubmit,defineField,resetField}=useValidator(createLegalFormSchema(addressSchema),{ownedBuilding:props.initialData?.ownedBuilding??YesNo.Yes,birthdate:props.initialData?.birthdate??``,familyComposition:props.initialData?.familyComposition??FamilyComposition.SingleWithoutChildren,familySize:props.initialData?.familySize??``,address:addressDraft}),[ownedBuilding,ownedBuildingAttrs,ownedBuildingError]=defineField(`ownedBuilding`),[birthdate,birthdateAttrs,birthdateError]=defineField(`birthdate`),[familyComposition,familyCompositionAttrs,familyCompositionError]=defineField(`familyComposition`,{validateAt:`change`}),[familySize,familySizeAttrs,familySizeError]=defineField(`familySize`,{validateAt:`change`}),isFamilySizeVisible=computed(()=>familyComposition.value===FAMILY_SIZE_REQUIRED_COMPOSITION);watch(familyComposition,value=>{value!==FAMILY_SIZE_REQUIRED_COMPOSITION&&resetField(`familySize`,{value:``})},{immediate:!0});function onSubmit(){handleSubmit(({ownedBuilding,birthdate,familyComposition,familySize})=>{emit(`submit`,{ownedBuilding,birthdate,familyComposition,familySize,address:resolvedAddress.value})})}return(_ctx,_cache)=>(openBlock(),createBlock(unref(VdComparisonForm_default),mergeProps(unref(baseFormProps),{"submit-disabled":__props.submitDisabled||unref(isSubmitting),onSubmit}),{default:withCtx(()=>[createVNode(unref(VdFormCol_default),{span:`3`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdAddress_default),{"resolved-address":unref(resolvedAddress),"onUpdate:resolvedAddress":_cache[0]||=$event=>isRef(resolvedAddress)?resolvedAddress.value=$event:null,"addition-options":unref(additionOptions)},null,8,[`resolved-address`,`addition-options`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`3`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdRadioGroup_default),mergeProps({modelValue:unref(ownedBuilding),"onUpdate:modelValue":_cache[1]||=$event=>isRef(ownedBuilding)?ownedBuilding.value=$event:null,legend:`Jouw woning is...`,name:`ownedBuilding`,options:unref(houseOwnedBuilding_model_default),variant:`boxed`,required:!1,"error-message":unref(ownedBuildingError)},unref(ownedBuildingAttrs)),null,16,[`modelValue`,`options`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdBirthdateInput_default),mergeProps({modelValue:unref(birthdate),"onUpdate:modelValue":_cache[2]||=$event=>isRef(birthdate)?birthdate.value=$event:null,"error-message":unref(birthdateError)},unref(birthdateAttrs)),null,16,[`modelValue`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdFamilyCompositionSelect_default),mergeProps({modelValue:unref(familyComposition),"onUpdate:modelValue":_cache[3]||=$event=>isRef(familyComposition)?familyComposition.value=$event:null,"error-message":unref(familyCompositionError)},unref(familyCompositionAttrs)),null,16,[`modelValue`,`error-message`])]),_:1}),isFamilySizeVisible.value?(openBlock(),createBlock(unref(VdFormCol_default),{key:0,span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdSelect_default),mergeProps({modelValue:unref(familySize),"onUpdate:modelValue":_cache[4]||=$event=>isRef(familySize)?familySize.value=$event:null,label:`Aantal kinderen`,placeholder:`Maak een keuze`,options:unref(familySize_model_default),name:`familySize`,required:!1,"error-message":unref(familySizeError)},unref(familySizeAttrs)),null,16,[`modelValue`,`options`,`error-message`])]),_:1})):createCommentVNode(``,!0)]),_:1},16,[`submit-disabled`]))}});customElements.define(`vd-legal-form`,defineCustomElement(LegalForm_default,{shadowRoot:!1}));
|
|
@@ -1,89 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { n as g, t as _ } from "./useAddress-LSZ7sQk9.js";
|
|
3
|
-
import { a as v, t as y } from "./birthdate.schema-DGsq2GQR.js";
|
|
4
|
-
import { i as b, n as x, r as S } from "./familyComposition.schema-fY4w6P1J.js";
|
|
5
|
-
//#region src/comparisons/liability/liability.schema.ts
|
|
6
|
-
var C = (e) => u({
|
|
7
|
-
address: e,
|
|
8
|
-
birthdate: y(),
|
|
9
|
-
familyComposition: x
|
|
10
|
-
}), w = /* @__PURE__ */ o({
|
|
11
|
-
__name: "LiabilityForm",
|
|
12
|
-
props: /*@__PURE__*/ e({
|
|
13
|
-
initialData: {},
|
|
14
|
-
title: {},
|
|
15
|
-
description: {},
|
|
16
|
-
banner: {},
|
|
17
|
-
layout: {},
|
|
18
|
-
card: { type: Boolean },
|
|
19
|
-
flat: { type: Boolean },
|
|
20
|
-
fullWidth: { type: Boolean },
|
|
21
|
-
submitLabel: {},
|
|
22
|
-
submitDisabled: { type: Boolean }
|
|
23
|
-
}, {
|
|
24
|
-
...m,
|
|
25
|
-
title: "Aansprakelijkheidsverzekering vergelijken"
|
|
26
|
-
}),
|
|
27
|
-
emits: ["submit"],
|
|
28
|
-
setup(e, { emit: a }) {
|
|
29
|
-
let o = e, u = i(o), m = a, { addressSchema: y, draft: x, resolvedAddress: w, additionOptions: T } = _({ initial: o.initialData?.address }), { isSubmitting: E, handleSubmit: D, defineField: O } = p(C(y), {
|
|
30
|
-
birthdate: o.initialData?.birthdate ?? "",
|
|
31
|
-
familyComposition: o.initialData?.familyComposition ?? b.SingleWithoutChildren,
|
|
32
|
-
address: x
|
|
33
|
-
}), [k, A, j] = O("birthdate"), [M, N, P] = O("familyComposition", { validateAt: "change" });
|
|
34
|
-
function F() {
|
|
35
|
-
D(({ birthdate: e, familyComposition: t }) => {
|
|
36
|
-
m("submit", {
|
|
37
|
-
birthdate: e,
|
|
38
|
-
familyComposition: t,
|
|
39
|
-
address: w.value
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return (i, a) => (n(), l(d(f), s(d(u), {
|
|
44
|
-
"submit-disabled": e.submitDisabled || d(E),
|
|
45
|
-
onSubmit: F
|
|
46
|
-
}), {
|
|
47
|
-
default: t(() => [
|
|
48
|
-
c(d(r), {
|
|
49
|
-
span: "5",
|
|
50
|
-
md: "6"
|
|
51
|
-
}, {
|
|
52
|
-
default: t(() => [c(d(g), {
|
|
53
|
-
"resolved-address": d(w),
|
|
54
|
-
"onUpdate:resolvedAddress": a[0] ||= (e) => h(w) ? w.value = e : null,
|
|
55
|
-
"addition-options": d(T)
|
|
56
|
-
}, null, 8, ["resolved-address", "addition-options"])]),
|
|
57
|
-
_: 1
|
|
58
|
-
}),
|
|
59
|
-
c(d(r), {
|
|
60
|
-
span: "2",
|
|
61
|
-
md: "6"
|
|
62
|
-
}, {
|
|
63
|
-
default: t(() => [c(d(v), s({
|
|
64
|
-
modelValue: d(k),
|
|
65
|
-
"onUpdate:modelValue": a[1] ||= (e) => h(k) ? k.value = e : null,
|
|
66
|
-
"error-message": d(j)
|
|
67
|
-
}, d(A)), null, 16, ["modelValue", "error-message"])]),
|
|
68
|
-
_: 1
|
|
69
|
-
}),
|
|
70
|
-
c(d(r), {
|
|
71
|
-
span: "3",
|
|
72
|
-
md: "6"
|
|
73
|
-
}, {
|
|
74
|
-
default: t(() => [c(d(S), s({
|
|
75
|
-
modelValue: d(M),
|
|
76
|
-
"onUpdate:modelValue": a[2] ||= (e) => h(M) ? M.value = e : null,
|
|
77
|
-
"error-message": d(P)
|
|
78
|
-
}, d(N)), null, 16, ["modelValue", "error-message"])]),
|
|
79
|
-
_: 1
|
|
80
|
-
})
|
|
81
|
-
]),
|
|
82
|
-
_: 1
|
|
83
|
-
}, 16, ["submit-disabled"]));
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/entries/wc-forms/liability.ts
|
|
88
|
-
customElements.define("vd-liability-form", a(w, { shadowRoot: !1 }));
|
|
89
|
-
//#endregion
|
|
1
|
+
import{VdComparisonForm_default,VdFormCol_default,comparisonFormSharedDefaults,create$3,createBlock,createVNode,defineComponent,defineCustomElement,isRef,mergeDefaults,mergeProps,openBlock,unref,useComparisonFormProps,useValidator,withCtx}from"./useValidator-BXvfnDwv.js";import{VdAddress_default,useAddress}from"./useAddress-mxYJ2B9-.js";import{VdBirthdateInput_default,createBirthdateSchema}from"./birthdate.schema-B2IfhcT0.js";import{FamilyComposition,VdFamilyCompositionSelect_default,familyCompositionSchema}from"./familyComposition.schema-BckaOvgV.js";var createLiabilityFormSchema=addressSchema=>create$3({address:addressSchema,birthdate:createBirthdateSchema(),familyComposition:familyCompositionSchema}),LiabilityForm_default=defineComponent({__name:`LiabilityForm`,props:mergeDefaults({initialData:{},title:{},description:{},banner:{},layout:{},card:{type:Boolean},flat:{type:Boolean},fullWidth:{type:Boolean},submitLabel:{},submitDisabled:{type:Boolean}},{...comparisonFormSharedDefaults,title:`Aansprakelijkheidsverzekering vergelijken`}),emits:[`submit`],setup(__props,{emit:__emit}){let props=__props,baseFormProps=useComparisonFormProps(props),emit=__emit,{addressSchema,draft:addressDraft,resolvedAddress,additionOptions}=useAddress({initial:props.initialData?.address}),{isSubmitting,handleSubmit,defineField}=useValidator(createLiabilityFormSchema(addressSchema),{birthdate:props.initialData?.birthdate??``,familyComposition:props.initialData?.familyComposition??FamilyComposition.SingleWithoutChildren,address:addressDraft}),[birthdate,birthdateAttrs,birthdateError]=defineField(`birthdate`),[familyComposition,familyCompositionAttrs,familyCompositionError]=defineField(`familyComposition`,{validateAt:`change`});function onSubmit(){handleSubmit(({birthdate,familyComposition})=>{emit(`submit`,{birthdate,familyComposition,address:resolvedAddress.value})})}return(_ctx,_cache)=>(openBlock(),createBlock(unref(VdComparisonForm_default),mergeProps(unref(baseFormProps),{"submit-disabled":__props.submitDisabled||unref(isSubmitting),onSubmit}),{default:withCtx(()=>[createVNode(unref(VdFormCol_default),{span:`5`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdAddress_default),{"resolved-address":unref(resolvedAddress),"onUpdate:resolvedAddress":_cache[0]||=$event=>isRef(resolvedAddress)?resolvedAddress.value=$event:null,"addition-options":unref(additionOptions)},null,8,[`resolved-address`,`addition-options`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdBirthdateInput_default),mergeProps({modelValue:unref(birthdate),"onUpdate:modelValue":_cache[1]||=$event=>isRef(birthdate)?birthdate.value=$event:null,"error-message":unref(birthdateError)},unref(birthdateAttrs)),null,16,[`modelValue`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`3`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdFamilyCompositionSelect_default),mergeProps({modelValue:unref(familyComposition),"onUpdate:modelValue":_cache[2]||=$event=>isRef(familyComposition)?familyComposition.value=$event:null,"error-message":unref(familyCompositionError)},unref(familyCompositionAttrs)),null,16,[`modelValue`,`error-message`])]),_:1})]),_:1},16,[`submit-disabled`]))}});customElements.define(`vd-liability-form`,defineCustomElement(LiabilityForm_default,{shadowRoot:!1}));
|
package/dist/wc-forms/loan.js
CHANGED
|
@@ -1,173 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as _ } from "./VdInput-PLH7DZsc.js";
|
|
3
|
-
import { t as v } from "./VdSelect-BPB3Jh_f.js";
|
|
4
|
-
import { a as y, t as b } from "./birthdate.schema-DGsq2GQR.js";
|
|
5
|
-
import { i as x, n as S, r as C } from "./familyComposition.schema-fY4w6P1J.js";
|
|
6
|
-
import { t as w } from "./messages-kbFdNTrA.js";
|
|
7
|
-
import { t as T } from "./rules-Cj1sWDmF.js";
|
|
8
|
-
//#region src/comparisons/loan/constants.ts
|
|
9
|
-
var E = {
|
|
10
|
-
min: 21,
|
|
11
|
-
max: 74
|
|
12
|
-
}, D = {
|
|
13
|
-
min: 3500,
|
|
14
|
-
max: 75e3
|
|
15
|
-
}, O = d({
|
|
16
|
-
LoanPurpose: r().required(w.loan.purposeRequired),
|
|
17
|
-
LoanAmount: T(w.loan.amountRequired).min(D.min, w.loan.amountMin(D.min)).max(D.max, w.loan.amountMax(D.max)),
|
|
18
|
-
birthdate: b(E),
|
|
19
|
-
familyComposition: S
|
|
20
|
-
}), k = [
|
|
21
|
-
{
|
|
22
|
-
title: "Aankoop auto",
|
|
23
|
-
value: "02"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: "Aankoop boot",
|
|
27
|
-
value: "03"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: "Aankoop caravan/camper",
|
|
31
|
-
value: "04"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: "Aankoop inboedel",
|
|
35
|
-
value: "32"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
title: "Aankoop motor",
|
|
39
|
-
value: "05"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
title: "Aankoop recreatiewoning",
|
|
43
|
-
value: "11"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: "Oversluiten lopende leningen",
|
|
47
|
-
value: "09"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
title: "Verbouwing woning",
|
|
51
|
-
value: "06"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: "Energie besparende maatregelen",
|
|
55
|
-
value: "07"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: "Aflossen restschuld woning",
|
|
59
|
-
value: "12"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: "Extra financiële ruimte",
|
|
63
|
-
value: "33"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: "Anders",
|
|
67
|
-
value: "99"
|
|
68
|
-
}
|
|
69
|
-
], A = /* @__PURE__ */ s({
|
|
70
|
-
__name: "LoanForm",
|
|
71
|
-
props: /*@__PURE__*/ e({
|
|
72
|
-
initialData: {},
|
|
73
|
-
title: {},
|
|
74
|
-
description: {},
|
|
75
|
-
banner: {},
|
|
76
|
-
layout: {},
|
|
77
|
-
card: { type: Boolean },
|
|
78
|
-
flat: { type: Boolean },
|
|
79
|
-
fullWidth: { type: Boolean },
|
|
80
|
-
submitLabel: {},
|
|
81
|
-
submitDisabled: { type: Boolean }
|
|
82
|
-
}, {
|
|
83
|
-
...h,
|
|
84
|
-
title: "Geld lenen"
|
|
85
|
-
}),
|
|
86
|
-
emits: ["submit"],
|
|
87
|
-
setup(e, { emit: r }) {
|
|
88
|
-
let o = e, s = a(o), d = r, { isSubmitting: h, handleSubmit: b, defineField: S } = m(O, {
|
|
89
|
-
LoanPurpose: o.initialData?.LoanPurpose ?? "",
|
|
90
|
-
LoanAmount: o.initialData?.LoanAmount ?? null,
|
|
91
|
-
birthdate: o.initialData?.birthdate ?? "",
|
|
92
|
-
familyComposition: o.initialData?.familyComposition ?? x.SingleWithoutChildren
|
|
93
|
-
}), [w, T, E] = S("LoanPurpose", { validateAt: "change" }), [D, A, j] = S("LoanAmount"), [M, N, P] = S("birthdate"), [F, I, L] = S("familyComposition", { validateAt: "change" });
|
|
94
|
-
function R() {
|
|
95
|
-
b((e) => {
|
|
96
|
-
d("submit", { ...e });
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return (r, a) => (n(), u(f(p), c(f(s), {
|
|
100
|
-
"submit-disabled": e.submitDisabled || f(h),
|
|
101
|
-
onSubmit: R
|
|
102
|
-
}), {
|
|
103
|
-
default: t(() => [
|
|
104
|
-
l(f(i), {
|
|
105
|
-
span: "3",
|
|
106
|
-
md: "6"
|
|
107
|
-
}, {
|
|
108
|
-
default: t(() => [l(f(v), c({
|
|
109
|
-
modelValue: f(w),
|
|
110
|
-
"onUpdate:modelValue": a[0] ||= (e) => g(w) ? w.value = e : null,
|
|
111
|
-
label: "Leendoel",
|
|
112
|
-
placeholder: "Maak een keuze",
|
|
113
|
-
options: f(k),
|
|
114
|
-
name: "LoanPurpose",
|
|
115
|
-
required: !1,
|
|
116
|
-
"error-message": f(E)
|
|
117
|
-
}, f(T)), null, 16, [
|
|
118
|
-
"modelValue",
|
|
119
|
-
"options",
|
|
120
|
-
"error-message"
|
|
121
|
-
])]),
|
|
122
|
-
_: 1
|
|
123
|
-
}),
|
|
124
|
-
l(f(i), {
|
|
125
|
-
span: "2",
|
|
126
|
-
md: "6"
|
|
127
|
-
}, {
|
|
128
|
-
default: t(() => [l(f(_), c({
|
|
129
|
-
modelValue: f(D),
|
|
130
|
-
"onUpdate:modelValue": a[1] ||= (e) => g(D) ? D.value = e : null,
|
|
131
|
-
modelModifiers: { number: !0 },
|
|
132
|
-
label: "Leenbedrag",
|
|
133
|
-
placeholder: "Van € 3.500,- tot € 75.000,-",
|
|
134
|
-
icon: "far fa-euro-sign",
|
|
135
|
-
name: "LoanAmount",
|
|
136
|
-
mask: "#####",
|
|
137
|
-
inputmode: "numeric",
|
|
138
|
-
required: !1,
|
|
139
|
-
"error-message": f(j)
|
|
140
|
-
}, f(A)), null, 16, ["modelValue", "error-message"])]),
|
|
141
|
-
_: 1
|
|
142
|
-
}),
|
|
143
|
-
l(f(i), {
|
|
144
|
-
span: "2",
|
|
145
|
-
md: "6"
|
|
146
|
-
}, {
|
|
147
|
-
default: t(() => [l(f(y), c({
|
|
148
|
-
modelValue: f(M),
|
|
149
|
-
"onUpdate:modelValue": a[2] ||= (e) => g(M) ? M.value = e : null,
|
|
150
|
-
"error-message": f(P)
|
|
151
|
-
}, f(N)), null, 16, ["modelValue", "error-message"])]),
|
|
152
|
-
_: 1
|
|
153
|
-
}),
|
|
154
|
-
l(f(i), {
|
|
155
|
-
span: "3",
|
|
156
|
-
md: "6"
|
|
157
|
-
}, {
|
|
158
|
-
default: t(() => [l(f(C), c({
|
|
159
|
-
modelValue: f(F),
|
|
160
|
-
"onUpdate:modelValue": a[3] ||= (e) => g(F) ? F.value = e : null,
|
|
161
|
-
"error-message": f(L)
|
|
162
|
-
}, f(I)), null, 16, ["modelValue", "error-message"])]),
|
|
163
|
-
_: 1
|
|
164
|
-
})
|
|
165
|
-
]),
|
|
166
|
-
_: 1
|
|
167
|
-
}, 16, ["submit-disabled"]));
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/entries/wc-forms/loan.ts
|
|
172
|
-
customElements.define("vd-loan-form", o(A, { shadowRoot: !1 }));
|
|
173
|
-
//#endregion
|
|
1
|
+
import{VdComparisonForm_default,VdFormCol_default,comparisonFormSharedDefaults,create$3,create$6,createBlock,createVNode,defineComponent,defineCustomElement,isRef,mergeDefaults,mergeProps,openBlock,unref,useComparisonFormProps,useValidator,withCtx}from"./useValidator-BXvfnDwv.js";import{VdInput_default}from"./VdInput-BaZx7lM7.js";import{VdSelect_default}from"./VdSelect-DS5ijaBw.js";import{VdBirthdateInput_default,createBirthdateSchema}from"./birthdate.schema-B2IfhcT0.js";import{FamilyComposition,VdFamilyCompositionSelect_default,familyCompositionSchema}from"./familyComposition.schema-BckaOvgV.js";import{VALIDATION_MESSAGES}from"./messages-Da6go1uu.js";import{requiredNumber}from"./rules-4erM_5MW.js";var AGE_RANGE={min:21,max:74},LOAN_AMOUNT_LIMITS={min:3500,max:75e3},loanFormSchema=create$3({LoanPurpose:create$6().required(VALIDATION_MESSAGES.loan.purposeRequired),LoanAmount:requiredNumber(VALIDATION_MESSAGES.loan.amountRequired).min(LOAN_AMOUNT_LIMITS.min,VALIDATION_MESSAGES.loan.amountMin(LOAN_AMOUNT_LIMITS.min)).max(LOAN_AMOUNT_LIMITS.max,VALIDATION_MESSAGES.loan.amountMax(LOAN_AMOUNT_LIMITS.max)),birthdate:createBirthdateSchema(AGE_RANGE),familyComposition:familyCompositionSchema}),loanPurposes_model_default=[{title:`Aankoop auto`,value:`02`},{title:`Aankoop boot`,value:`03`},{title:`Aankoop caravan/camper`,value:`04`},{title:`Aankoop inboedel`,value:`32`},{title:`Aankoop motor`,value:`05`},{title:`Aankoop recreatiewoning`,value:`11`},{title:`Oversluiten lopende leningen`,value:`09`},{title:`Verbouwing woning`,value:`06`},{title:`Energie besparende maatregelen`,value:`07`},{title:`Aflossen restschuld woning`,value:`12`},{title:`Extra financiële ruimte`,value:`33`},{title:`Anders`,value:`99`}],LoanForm_default=defineComponent({__name:`LoanForm`,props:mergeDefaults({initialData:{},title:{},description:{},banner:{},layout:{},card:{type:Boolean},flat:{type:Boolean},fullWidth:{type:Boolean},submitLabel:{},submitDisabled:{type:Boolean}},{...comparisonFormSharedDefaults,title:`Geld lenen`}),emits:[`submit`],setup(__props,{emit:__emit}){let props=__props,baseFormProps=useComparisonFormProps(props),emit=__emit,{isSubmitting,handleSubmit,defineField}=useValidator(loanFormSchema,{LoanPurpose:props.initialData?.LoanPurpose??``,LoanAmount:props.initialData?.LoanAmount??null,birthdate:props.initialData?.birthdate??``,familyComposition:props.initialData?.familyComposition??FamilyComposition.SingleWithoutChildren}),[loanPurpose,loanPurposeAttrs,loanPurposeError]=defineField(`LoanPurpose`,{validateAt:`change`}),[loanAmount,loanAmountAttrs,loanAmountError]=defineField(`LoanAmount`),[birthdate,birthdateAttrs,birthdateError]=defineField(`birthdate`),[familyComposition,familyCompositionAttrs,familyCompositionError]=defineField(`familyComposition`,{validateAt:`change`});function onSubmit(){handleSubmit(validFormData=>{emit(`submit`,{...validFormData})})}return(_ctx,_cache)=>(openBlock(),createBlock(unref(VdComparisonForm_default),mergeProps(unref(baseFormProps),{"submit-disabled":__props.submitDisabled||unref(isSubmitting),onSubmit}),{default:withCtx(()=>[createVNode(unref(VdFormCol_default),{span:`3`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdSelect_default),mergeProps({modelValue:unref(loanPurpose),"onUpdate:modelValue":_cache[0]||=$event=>isRef(loanPurpose)?loanPurpose.value=$event:null,label:`Leendoel`,placeholder:`Maak een keuze`,options:unref(loanPurposes_model_default),name:`LoanPurpose`,required:!1,"error-message":unref(loanPurposeError)},unref(loanPurposeAttrs)),null,16,[`modelValue`,`options`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdInput_default),mergeProps({modelValue:unref(loanAmount),"onUpdate:modelValue":_cache[1]||=$event=>isRef(loanAmount)?loanAmount.value=$event:null,modelModifiers:{number:!0},label:`Leenbedrag`,placeholder:`Van € 3.500,- tot € 75.000,-`,icon:`far fa-euro-sign`,name:`LoanAmount`,mask:`#####`,inputmode:`numeric`,required:!1,"error-message":unref(loanAmountError)},unref(loanAmountAttrs)),null,16,[`modelValue`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`2`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdBirthdateInput_default),mergeProps({modelValue:unref(birthdate),"onUpdate:modelValue":_cache[2]||=$event=>isRef(birthdate)?birthdate.value=$event:null,"error-message":unref(birthdateError)},unref(birthdateAttrs)),null,16,[`modelValue`,`error-message`])]),_:1}),createVNode(unref(VdFormCol_default),{span:`3`,md:`6`},{default:withCtx(()=>[createVNode(unref(VdFamilyCompositionSelect_default),mergeProps({modelValue:unref(familyComposition),"onUpdate:modelValue":_cache[3]||=$event=>isRef(familyComposition)?familyComposition.value=$event:null,"error-message":unref(familyCompositionError)},unref(familyCompositionAttrs)),null,16,[`modelValue`,`error-message`])]),_:1})]),_:1},16,[`submit-disabled`]))}});customElements.define(`vd-loan-form`,defineCustomElement(LoanForm_default,{shadowRoot:!1}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var VALIDATION_MESSAGES={birthdate:{required:`Geboortedatum is verplicht`,dateFormat:`Geboortedatum is incorrect`,tooYoung:min=>`De minimale leeftijd is ${min}.`,tooOld:max=>`De maximale leeftijd is ${max}.`},familyComposition:{required:`Gezinssituatie is verplicht`},ownedBuilding:{required:`Deze vraag is verplicht`},bike:{kindRequired:`Selecteer je fiets`,conditionRequired:`Is je fiets nieuw of tweedehands gekocht?`,priceRequired:`Vul de aankoopprijs in (afgerond bedrag)`,priceMax:max=>`Het ingevulde bedrag is te hoog. Voer een bedrag in tot maximaal € ${max},-`,brandRequired:`Kies het merk van je fiets`},caravan:{typeOfCaravanRequired:`Kies je type caravan`,newOrOccasionRequired:`Kies of je caravan nieuw of occasion is`,buildYearRequired:`Kies het bouwjaar van je caravan`},house:{familyCompositionRequired:`Kies een gezinsamenstelling`},legal:{familySizeRequired:`Kies het aantal kinderen`},loan:{purposeRequired:`Leendoel is verplicht`,amountRequired:`Leenbedrag is verplicht`,amountMin:min=>`Je kunt niet minder dan €${min},- lenen. Vul een hoger bedrag in`,amountMax:max=>`De input mag niet groter zijn dan de maximum waarde: ${max}`},pet:{kindRequired:`Selecteer je huisdier`,outOfRange:(earliest,latest)=>`Je huisdier dient geboren te zijn tussen ${earliest} en ${latest}`,zipcodeRequired:`Vul je postcode in`,zipcodeInvalid:`Postcode is incorrect`},travel:{paymentTermRequired:`Selecteer een dekking`}};export{VALIDATION_MESSAGES};
|