@vergelijkdirect/comparison-forms 2.0.2 → 2.1.0-ver-9053.1

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.
Files changed (60) hide show
  1. package/README.md +5 -5
  2. package/dist/vue/VdInput-CRb-iTiH.js +145 -0
  3. package/dist/vue/VdPopover-B78nVpNU.js +200 -0
  4. package/dist/vue/VdRadioGroup-D5kHcpsY.js +166 -0
  5. package/dist/vue/VdSearchableSelect-THqVGo_Q.js +209 -0
  6. package/dist/vue/VdSelect-Dv35x4sz.js +112 -0
  7. package/dist/vue/bike-Ch7ZcSpI.js +2 -0
  8. package/dist/vue/bike.presenter-CdCny1-M.js +1673 -0
  9. package/dist/vue/birthdate.schema-B9q6IeIR.js +91 -0
  10. package/dist/vue/businessCar.presenter-DR-Ozf6B.js +121 -0
  11. package/dist/vue/businessLiability-w4xhGnik.js +2 -0
  12. package/dist/vue/businessLiability.presenter-8iyRbLgw.js +80 -0
  13. package/dist/vue/car-business-DMYPV4UK.js +2 -0
  14. package/dist/vue/car-jPvIXEVK.js +2 -0
  15. package/dist/vue/car.presenter-gd62kiqS.js +130 -0
  16. package/dist/vue/caravan-B8l6zEkk.js +2 -0
  17. package/dist/vue/caravan.presenter-Cr5vuB_r.js +157 -0
  18. package/dist/vue/company.schema-DStHJpGH.js +241 -0
  19. package/dist/vue/comparison-forms.d.ts +34 -34
  20. package/dist/vue/comparison-forms.js +119 -5590
  21. package/dist/vue/date.util-DjJZwKvn.js +24 -0
  22. package/dist/vue/familyComposition.enum-D26VYo_a.js +6 -0
  23. package/dist/vue/familyComposition.schema-CNMH-wP0.js +75 -0
  24. package/dist/vue/house-BtQscoRa.js +2 -0
  25. package/dist/vue/house.presenter-DLeGfJAY.js +118 -0
  26. package/dist/vue/houseOwnedBuilding.model-BLLI1Vm0.js +14 -0
  27. package/dist/vue/itc-KSDsJZsI.js +10 -0
  28. package/dist/vue/legal-BjG3LO5G.js +2 -0
  29. package/dist/vue/legal.presenter-CwEVdXZJ.js +100 -0
  30. package/dist/vue/liability-_Sp33TSY.js +2 -0
  31. package/dist/vue/liability.presenter-C_5O-OQm.js +110 -0
  32. package/dist/vue/loan-T0OYMmxG.js +2 -0
  33. package/dist/vue/loan.presenter-CEZ3PcSo.js +198 -0
  34. package/dist/vue/messages-DRFu-PCu.js +40 -0
  35. package/dist/vue/moped-D9KUmwn6.js +2 -0
  36. package/dist/vue/moped.presenter-DazWxVEM.js +133 -0
  37. package/dist/vue/motor-BEAQ5N4w.js +2 -0
  38. package/dist/vue/motor.presenter-e_ESWwhI.js +130 -0
  39. package/dist/vue/package-DjsxU0ny.js +2 -0
  40. package/dist/vue/package.presenter-BA6S0X_L.js +137 -0
  41. package/dist/vue/pet-Bguvk2H4.js +2 -0
  42. package/dist/vue/pet.presenter-BpDDlFSQ.js +170 -0
  43. package/dist/vue/rules-3BZkSj_K.js +13 -0
  44. package/dist/vue/travel-C_cvpQNA.js +2 -0
  45. package/dist/vue/travel.presenter-DeoXBmrT.js +108 -0
  46. package/dist/vue/useAddress-C-h1pGI5.js +245 -0
  47. package/dist/vue/useLicensePlate-wAVrX9tr.js +187 -0
  48. package/dist/vue/useValidator-B8ZuqyvJ.js +535 -0
  49. package/dist/vue/yesNo-BvJlCm7Y.js +6 -0
  50. package/dist/wc/comparison-forms.js +14836 -14413
  51. package/dist/wc-noitc/comparison-forms.umd.cjs +3 -3
  52. package/package.json +1 -1
  53. package/dist/client/.vite/ssr-manifest.json +0 -600
  54. package/dist/client/assets/index-6Enzr9rU.css +0 -4
  55. package/dist/client/assets/index-6Enzr9rU.css.br +0 -0
  56. package/dist/client/assets/index-DUchBxEo.js +0 -57
  57. package/dist/client/assets/index-DUchBxEo.js.br +0 -0
  58. package/dist/client/index.html +0 -15
  59. package/dist/server/entry-server.js +0 -9981
  60. package/dist/server/entry-server.js.br +0 -0
@@ -0,0 +1,24 @@
1
+ import e from "dayjs";
2
+ import t from "dayjs/plugin/customParseFormat.js";
3
+ //#region src/utils/date.util.ts
4
+ e.extend(t);
5
+ function n() {
6
+ return e().startOf("day");
7
+ }
8
+ function r() {
9
+ return n().year();
10
+ }
11
+ function i(t, n) {
12
+ let r = e(t ?? "", n, !0);
13
+ return r.isValid() ? r.startOf("day") : null;
14
+ }
15
+ function a(e, t) {
16
+ let r = n();
17
+ return {
18
+ today: r,
19
+ earliest: r.subtract(t.value + 1, t.unit).add(1, "day"),
20
+ latest: r.subtract(e.value, e.unit)
21
+ };
22
+ }
23
+ //#endregion
24
+ export { r as n, i as r, a as t };
@@ -0,0 +1,6 @@
1
+ //#region src/enums/familyComposition.enum.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.FamilyWithChildren = "I", e.FamilyWithoutChildren = "H", e.SingleWithoutChildren = "A", e.SingleWithChildren = "K", e;
4
+ }({});
5
+ //#endregion
6
+ export { e as t };
@@ -0,0 +1,75 @@
1
+ import { t as e } from "./familyComposition.enum-D26VYo_a.js";
2
+ import { t } from "./VdSelect-Dv35x4sz.js";
3
+ import { t as n } from "./messages-DRFu-PCu.js";
4
+ import { n as r } from "./rules-3BZkSj_K.js";
5
+ import { createBlock as i, createSlots as a, defineComponent as o, mergeModels as s, mergeProps as c, openBlock as l, renderSlot as u, unref as d, useModel as f, useSlots as p, withCtx as m } from "vue";
6
+ import "yup";
7
+ //#endregion
8
+ //#region src/components/fields/VdFamilyCompositionSelect.vue
9
+ var h = /* @__PURE__ */ o({
10
+ inheritAttrs: !1,
11
+ __name: "VdFamilyCompositionSelect",
12
+ props: /*@__PURE__*/ s({
13
+ label: { default: "Gezinssituatie" },
14
+ name: { default: "familyComposition" },
15
+ required: {
16
+ type: Boolean,
17
+ default: !1
18
+ }
19
+ }, {
20
+ modelValue: { required: !0 },
21
+ modelModifiers: {}
22
+ }),
23
+ emits: ["update:modelValue"],
24
+ setup(n) {
25
+ let r = [
26
+ {
27
+ value: e.SingleWithoutChildren,
28
+ title: "Alleenstaand zonder kinderen"
29
+ },
30
+ {
31
+ value: e.FamilyWithoutChildren,
32
+ title: "Gezin zonder kinderen"
33
+ },
34
+ {
35
+ value: e.SingleWithChildren,
36
+ title: "Alleenstaand met kinderen"
37
+ },
38
+ {
39
+ value: e.FamilyWithChildren,
40
+ title: "Gezin met kinderen"
41
+ }
42
+ ], o = p(), s = f(n, "modelValue");
43
+ return (e, f) => (l(), i(t, c({
44
+ modelValue: s.value,
45
+ "onUpdate:modelValue": f[0] ||= (e) => s.value = e,
46
+ label: n.label,
47
+ name: n.name,
48
+ required: n.required,
49
+ options: r,
50
+ placeholder: ""
51
+ }, e.$attrs), a({ _: 2 }, [d(o).popover ? {
52
+ name: "popover",
53
+ fn: m(() => [u(e.$slots, "popover")]),
54
+ key: "0"
55
+ } : void 0]), 1040, [
56
+ "modelValue",
57
+ "label",
58
+ "name",
59
+ "required"
60
+ ]));
61
+ }
62
+ }), g = [
63
+ e.SingleWithoutChildren,
64
+ e.FamilyWithoutChildren,
65
+ e.SingleWithChildren,
66
+ e.FamilyWithChildren
67
+ ];
68
+ //#endregion
69
+ //#region src/schemas/familyComposition.schema.ts
70
+ function _(e = n.familyComposition.required) {
71
+ return r(g, e);
72
+ }
73
+ var v = _();
74
+ //#endregion
75
+ export { v as n, h as r, _ as t };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./house.presenter-DLeGfJAY.js";
2
+ export { e as Form, t as presenter };
@@ -0,0 +1,118 @@
1
+ import { i as e, o as t, r as n, s as r, t as i, u as a } from "./useValidator-B8ZuqyvJ.js";
2
+ import { t as o } from "./familyComposition.enum-D26VYo_a.js";
3
+ import { n as s } from "./yesNo-BvJlCm7Y.js";
4
+ import { t as c } from "./VdRadioGroup-D5kHcpsY.js";
5
+ import { n as l, t as u } from "./useAddress-C-h1pGI5.js";
6
+ import { r as d, t as f } from "./familyComposition.schema-CNMH-wP0.js";
7
+ import { t as p } from "./messages-DRFu-PCu.js";
8
+ import { n as m, t as h } from "./houseOwnedBuilding.model-BLLI1Vm0.js";
9
+ import { createBlock as g, createVNode as _, defineComponent as v, isRef as y, mergeDefaults as b, mergeProps as x, openBlock as S, unref as C, withCtx as w } from "vue";
10
+ import { object as T } from "yup";
11
+ //#region src/comparisons/house/house.schema.ts
12
+ var E = (e) => T({
13
+ address: e,
14
+ ownedBuilding: m,
15
+ familyComposition: f(p.house.familyCompositionRequired)
16
+ }), D = /* @__PURE__ */ v({
17
+ __name: "HouseForm",
18
+ props: /*@__PURE__*/ b({
19
+ initialData: {},
20
+ title: {},
21
+ description: {},
22
+ banner: {},
23
+ layout: {},
24
+ card: { type: Boolean },
25
+ flat: { type: Boolean },
26
+ fullWidth: { type: Boolean },
27
+ submitLabel: {},
28
+ submitDisabled: { type: Boolean }
29
+ }, {
30
+ ...t,
31
+ title: "Woonverzekering vergelijken"
32
+ }),
33
+ emits: ["submitted"],
34
+ setup(t, { emit: a }) {
35
+ let f = t, p = r(f), m = a, { addressSchema: v, draft: b, resolvedAddress: T, additionOptions: D } = u({ initial: f.initialData?.address }), { isSubmitting: O, handleSubmit: k, defineField: A } = i(E(v), {
36
+ ownedBuilding: f.initialData?.ownedBuilding ?? s.Yes,
37
+ familyComposition: f.initialData?.familyComposition ?? o.SingleWithoutChildren,
38
+ address: b
39
+ }), [j, M, N] = A("ownedBuilding"), [P, F, I] = A("familyComposition", { validateAt: "change" });
40
+ function L() {
41
+ k(({ ownedBuilding: e, familyComposition: t }) => {
42
+ m("submitted", {
43
+ ownedBuilding: e,
44
+ familyComposition: t,
45
+ address: T.value
46
+ });
47
+ });
48
+ }
49
+ return (r, i) => (S(), g(C(n), x(C(p), {
50
+ "submit-disabled": t.submitDisabled || C(O),
51
+ onSubmit: L
52
+ }), {
53
+ default: w(() => [
54
+ _(C(e), {
55
+ span: "4",
56
+ md: "6"
57
+ }, {
58
+ default: w(() => [_(C(l), {
59
+ "resolved-address": C(T),
60
+ "onUpdate:resolvedAddress": i[0] ||= (e) => y(T) ? T.value = e : null,
61
+ "addition-options": C(D)
62
+ }, null, 8, ["resolved-address", "addition-options"])]),
63
+ _: 1
64
+ }),
65
+ _(C(e), {
66
+ span: "3",
67
+ md: "3"
68
+ }, {
69
+ default: w(() => [_(C(c), x({
70
+ modelValue: C(j),
71
+ "onUpdate:modelValue": i[1] ||= (e) => y(j) ? j.value = e : null,
72
+ legend: "Jouw woning is...",
73
+ name: "ownedBuilding",
74
+ options: C(h),
75
+ variant: "boxed",
76
+ required: !1,
77
+ "error-message": C(N)
78
+ }, C(M)), null, 16, [
79
+ "modelValue",
80
+ "options",
81
+ "error-message"
82
+ ])]),
83
+ _: 1
84
+ }),
85
+ _(C(e), {
86
+ span: "3",
87
+ md: "3"
88
+ }, {
89
+ default: w(() => [_(C(d), x({
90
+ modelValue: C(P),
91
+ "onUpdate:modelValue": i[2] ||= (e) => y(P) ? P.value = e : null,
92
+ "error-message": C(I)
93
+ }, C(F)), null, 16, ["modelValue", "error-message"])]),
94
+ _: 1
95
+ })
96
+ ]),
97
+ _: 1
98
+ }, 16, ["submit-disabled"]));
99
+ }
100
+ });
101
+ //#endregion
102
+ //#region src/comparisons/house/house.presenter.ts
103
+ function O(e) {
104
+ return {
105
+ comparison: a.Housing,
106
+ detail: { house: { ownedBuilding: e.ownedBuilding } },
107
+ user: {
108
+ zipCode: e.address.zipCode,
109
+ houseNumber: e.address.houseNumber,
110
+ houseNumberAddition: e.address.houseNumberAddition,
111
+ street: e.address.street,
112
+ city: e.address.city,
113
+ familyComposition: e.familyComposition
114
+ }
115
+ };
116
+ }
117
+ //#endregion
118
+ export { D as n, O as t };
@@ -0,0 +1,14 @@
1
+ import { n as e, t } from "./yesNo-BvJlCm7Y.js";
2
+ import { t as n } from "./messages-DRFu-PCu.js";
3
+ import { n as r } from "./rules-3BZkSj_K.js";
4
+ import "yup";
5
+ //#region src/schemas/ownedBuilding.schema.ts
6
+ var i = r(t, n.ownedBuilding.required), a = [{
7
+ value: e.Yes,
8
+ label: "Gekocht"
9
+ }, {
10
+ value: e.No,
11
+ label: "Gehuurd"
12
+ }];
13
+ //#endregion
14
+ export { i as n, a as t };
@@ -0,0 +1,10 @@
1
+ import { ComparisonService as e, DataService as t, DataValidationService as n, HomeService as r, User as i } from "@vergelijkdirect/insurance-transmission-client";
2
+ //#region src/data/itc.ts
3
+ var a, o = () => ({
4
+ dataService: new t(),
5
+ dataValidationService: new n(),
6
+ homeService: new r(),
7
+ comparisonService: new e()
8
+ }), s = () => (a ||= o(), a);
9
+ //#endregion
10
+ export { s as n, i as t };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./legal.presenter-CwEVdXZJ.js";
2
+ export { e as Form, t as presenter };
@@ -0,0 +1,100 @@
1
+ import { i as e, o as t, r as n, s as r, t as i, u as a } from "./useValidator-B8ZuqyvJ.js";
2
+ import { n as o } from "./yesNo-BvJlCm7Y.js";
3
+ import { t as s } from "./VdRadioGroup-D5kHcpsY.js";
4
+ import { n as c, t as l } from "./useAddress-C-h1pGI5.js";
5
+ import { n as u, t as d } from "./houseOwnedBuilding.model-BLLI1Vm0.js";
6
+ import { createBlock as f, createVNode as p, defineComponent as m, isRef as h, mergeDefaults as g, mergeProps as _, openBlock as v, unref as y, withCtx as b } from "vue";
7
+ import { object as x } from "yup";
8
+ //#region src/comparisons/legal/legal.schema.ts
9
+ var S = (e) => x({
10
+ address: e,
11
+ ownedBuilding: u
12
+ }), C = /* @__PURE__ */ m({
13
+ __name: "LegalForm",
14
+ props: /*@__PURE__*/ g({
15
+ initialData: {},
16
+ title: {},
17
+ description: {},
18
+ banner: {},
19
+ layout: {},
20
+ card: { type: Boolean },
21
+ flat: { type: Boolean },
22
+ fullWidth: { type: Boolean },
23
+ submitLabel: {},
24
+ submitDisabled: { type: Boolean }
25
+ }, {
26
+ ...t,
27
+ title: "Rechtsbijstandverzekering vergelijken"
28
+ }),
29
+ emits: ["submitted"],
30
+ setup(t, { emit: a }) {
31
+ let u = t, m = r(u), g = a, { addressSchema: x, draft: C, resolvedAddress: w, additionOptions: T } = l({ initial: u.initialData?.address }), { isSubmitting: E, handleSubmit: D, defineField: O } = i(S(x), {
32
+ ownedBuilding: u.initialData?.ownedBuilding ?? o.Yes,
33
+ address: C
34
+ }), [k, A, j] = O("ownedBuilding");
35
+ function M() {
36
+ D(({ ownedBuilding: e }) => {
37
+ g("submitted", {
38
+ ownedBuilding: e,
39
+ address: w.value
40
+ });
41
+ });
42
+ }
43
+ return (r, i) => (v(), f(y(n), _(y(m), {
44
+ "submit-disabled": t.submitDisabled || y(E),
45
+ onSubmit: M
46
+ }), {
47
+ default: b(() => [p(y(e), {
48
+ span: "5",
49
+ md: "6"
50
+ }, {
51
+ default: b(() => [p(y(c), {
52
+ "resolved-address": y(w),
53
+ "onUpdate:resolvedAddress": i[0] ||= (e) => h(w) ? w.value = e : null,
54
+ "addition-options": y(T)
55
+ }, null, 8, ["resolved-address", "addition-options"])]),
56
+ _: 1
57
+ }), p(y(e), {
58
+ span: "5",
59
+ md: "6"
60
+ }, {
61
+ default: b(() => [p(y(s), _({
62
+ modelValue: y(k),
63
+ "onUpdate:modelValue": i[1] ||= (e) => h(k) ? k.value = e : null,
64
+ legend: "Jouw woning is...",
65
+ name: "ownedBuilding",
66
+ options: y(d),
67
+ variant: "boxed",
68
+ required: !1,
69
+ "error-message": y(j)
70
+ }, y(A)), null, 16, [
71
+ "modelValue",
72
+ "options",
73
+ "error-message"
74
+ ])]),
75
+ _: 1
76
+ })]),
77
+ _: 1
78
+ }, 16, ["submit-disabled"]));
79
+ }
80
+ });
81
+ //#endregion
82
+ //#region src/comparisons/legal/legal.presenter.ts
83
+ function w(e) {
84
+ return {
85
+ comparison: a.LegalAssistance,
86
+ detail: { comparison: {
87
+ deductables: 300,
88
+ ownedBuilding: e.ownedBuilding
89
+ } },
90
+ user: {
91
+ zipCode: e.address.zipCode,
92
+ houseNumber: e.address.houseNumber,
93
+ houseNumberAddition: e.address.houseNumberAddition,
94
+ street: e.address.street,
95
+ city: e.address.city
96
+ }
97
+ };
98
+ }
99
+ //#endregion
100
+ export { C as n, w as t };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./liability.presenter-C_5O-OQm.js";
2
+ export { e as Form, t as presenter };
@@ -0,0 +1,110 @@
1
+ import { i as e, o as t, r as n, s as r, t as i, u as a } from "./useValidator-B8ZuqyvJ.js";
2
+ import { t as o } from "./familyComposition.enum-D26VYo_a.js";
3
+ import { n as s, t as c } from "./useAddress-C-h1pGI5.js";
4
+ import { a as l, t as u } from "./birthdate.schema-B9q6IeIR.js";
5
+ import { n as d, r as f } from "./familyComposition.schema-CNMH-wP0.js";
6
+ import { createBlock as p, createVNode as m, defineComponent as h, isRef as g, mergeDefaults as _, mergeProps as v, openBlock as y, unref as b, withCtx as x } from "vue";
7
+ import { object as S } from "yup";
8
+ //#region src/comparisons/liability/liability.schema.ts
9
+ var C = (e) => S({
10
+ address: e,
11
+ birthdate: u(),
12
+ familyComposition: d
13
+ }), w = /* @__PURE__ */ h({
14
+ __name: "LiabilityForm",
15
+ props: /*@__PURE__*/ _({
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
+ ...t,
28
+ title: "Aansprakelijkheidsverzekering vergelijken"
29
+ }),
30
+ emits: ["submitted"],
31
+ setup(t, { emit: a }) {
32
+ let u = t, d = r(u), h = a, { addressSchema: _, draft: S, resolvedAddress: w, additionOptions: T } = c({ initial: u.initialData?.address }), { isSubmitting: E, handleSubmit: D, defineField: O } = i(C(_), {
33
+ birthdate: u.initialData?.birthdate ?? "",
34
+ familyComposition: u.initialData?.familyComposition ?? o.SingleWithoutChildren,
35
+ address: S
36
+ }), [k, A, j] = O("birthdate"), [M, N, P] = O("familyComposition", { validateAt: "change" });
37
+ function F() {
38
+ D(({ birthdate: e, familyComposition: t }) => {
39
+ h("submitted", {
40
+ birthdate: e,
41
+ familyComposition: t,
42
+ address: w.value
43
+ });
44
+ });
45
+ }
46
+ return (r, i) => (y(), p(b(n), v(b(d), {
47
+ "submit-disabled": t.submitDisabled || b(E),
48
+ onSubmit: F
49
+ }), {
50
+ default: x(() => [
51
+ m(b(e), {
52
+ span: "5",
53
+ md: "6"
54
+ }, {
55
+ default: x(() => [m(b(s), {
56
+ "resolved-address": b(w),
57
+ "onUpdate:resolvedAddress": i[0] ||= (e) => g(w) ? w.value = e : null,
58
+ "addition-options": b(T)
59
+ }, null, 8, ["resolved-address", "addition-options"])]),
60
+ _: 1
61
+ }),
62
+ m(b(e), {
63
+ span: "2",
64
+ md: "6"
65
+ }, {
66
+ default: x(() => [m(b(l), v({
67
+ modelValue: b(k),
68
+ "onUpdate:modelValue": i[1] ||= (e) => g(k) ? k.value = e : null,
69
+ "error-message": b(j)
70
+ }, b(A)), null, 16, ["modelValue", "error-message"])]),
71
+ _: 1
72
+ }),
73
+ m(b(e), {
74
+ span: "3",
75
+ md: "6"
76
+ }, {
77
+ default: x(() => [m(b(f), v({
78
+ modelValue: b(M),
79
+ "onUpdate:modelValue": i[2] ||= (e) => g(M) ? M.value = e : null,
80
+ "error-message": b(P)
81
+ }, b(N)), null, 16, ["modelValue", "error-message"])]),
82
+ _: 1
83
+ })
84
+ ]),
85
+ _: 1
86
+ }, 16, ["submit-disabled"]));
87
+ }
88
+ });
89
+ //#endregion
90
+ //#region src/comparisons/liability/liability.presenter.ts
91
+ function T(e) {
92
+ return {
93
+ comparison: a.Liability,
94
+ detail: { liability: {
95
+ Amount: 15e5,
96
+ Deductables: 100
97
+ } },
98
+ user: {
99
+ zipCode: e.address.zipCode,
100
+ houseNumber: e.address.houseNumber,
101
+ houseNumberAddition: e.address.houseNumberAddition,
102
+ birthdate: e.birthdate,
103
+ street: e.address.street,
104
+ city: e.address.city,
105
+ familyComposition: e.familyComposition
106
+ }
107
+ };
108
+ }
109
+ //#endregion
110
+ export { w as n, T as t };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./loan.presenter-CEZ3PcSo.js";
2
+ export { e as Form, t as presenter };
@@ -0,0 +1,198 @@
1
+ import { i as e, o as t, r as n, s as r, t as i, u as a } from "./useValidator-B8ZuqyvJ.js";
2
+ import { t as o } from "./familyComposition.enum-D26VYo_a.js";
3
+ import { t as s } from "./VdInput-CRb-iTiH.js";
4
+ import { t as c } from "./VdSelect-Dv35x4sz.js";
5
+ import { a as l, i as u, t as d } from "./birthdate.schema-B9q6IeIR.js";
6
+ import { n as f, r as p } from "./familyComposition.schema-CNMH-wP0.js";
7
+ import { r as m } from "./date.util-DjJZwKvn.js";
8
+ import { t as h } from "./messages-DRFu-PCu.js";
9
+ import { t as g } from "./rules-3BZkSj_K.js";
10
+ import { createBlock as _, createVNode as v, defineComponent as y, isRef as b, mergeDefaults as x, mergeProps as S, openBlock as C, unref as w, withCtx as T } from "vue";
11
+ import { object as E, string as D } from "yup";
12
+ import O from "dayjs";
13
+ //#region src/comparisons/loan/constants.ts
14
+ var k = {
15
+ min: 21,
16
+ max: 74
17
+ }, A = {
18
+ min: 3500,
19
+ max: 75e3
20
+ }, j = E({
21
+ LoanPurpose: D().required(h.loan.purposeRequired),
22
+ LoanAmount: g(h.loan.amountRequired).min(A.min, h.loan.amountMin(A.min)).max(A.max, h.loan.amountMax(A.max)),
23
+ birthdate: d(k),
24
+ familyComposition: f
25
+ }), M = [
26
+ {
27
+ title: "Aankoop auto",
28
+ value: "02"
29
+ },
30
+ {
31
+ title: "Aankoop boot",
32
+ value: "03"
33
+ },
34
+ {
35
+ title: "Aankoop caravan/camper",
36
+ value: "04"
37
+ },
38
+ {
39
+ title: "Aankoop inboedel",
40
+ value: "32"
41
+ },
42
+ {
43
+ title: "Aankoop motor",
44
+ value: "05"
45
+ },
46
+ {
47
+ title: "Aankoop recreatiewoning",
48
+ value: "11"
49
+ },
50
+ {
51
+ title: "Oversluiten lopende leningen",
52
+ value: "09"
53
+ },
54
+ {
55
+ title: "Verbouwing woning",
56
+ value: "06"
57
+ },
58
+ {
59
+ title: "Energie besparende maatregelen",
60
+ value: "07"
61
+ },
62
+ {
63
+ title: "Aflossen restschuld woning",
64
+ value: "12"
65
+ },
66
+ {
67
+ title: "Extra financiële ruimte",
68
+ value: "33"
69
+ },
70
+ {
71
+ title: "Anders",
72
+ value: "99"
73
+ }
74
+ ], N = /* @__PURE__ */ y({
75
+ __name: "LoanForm",
76
+ props: /*@__PURE__*/ x({
77
+ initialData: {},
78
+ title: {},
79
+ description: {},
80
+ banner: {},
81
+ layout: {},
82
+ card: { type: Boolean },
83
+ flat: { type: Boolean },
84
+ fullWidth: { type: Boolean },
85
+ submitLabel: {},
86
+ submitDisabled: { type: Boolean }
87
+ }, {
88
+ ...t,
89
+ title: "Geld lenen"
90
+ }),
91
+ emits: ["submitted"],
92
+ setup(t, { emit: a }) {
93
+ let u = t, d = r(u), f = a, { isSubmitting: m, handleSubmit: h, defineField: g } = i(j, {
94
+ LoanPurpose: u.initialData?.LoanPurpose ?? "",
95
+ LoanAmount: u.initialData?.LoanAmount ?? null,
96
+ birthdate: u.initialData?.birthdate ?? "",
97
+ familyComposition: u.initialData?.familyComposition ?? o.SingleWithoutChildren
98
+ }), [y, x, E] = g("LoanPurpose", { validateAt: "change" }), [D, O, k] = g("LoanAmount"), [A, N, P] = g("birthdate"), [F, I, L] = g("familyComposition", { validateAt: "change" });
99
+ function R() {
100
+ h((e) => {
101
+ f("submitted", { ...e });
102
+ });
103
+ }
104
+ return (r, i) => (C(), _(w(n), S(w(d), {
105
+ "submit-disabled": t.submitDisabled || w(m),
106
+ onSubmit: R
107
+ }), {
108
+ default: T(() => [
109
+ v(w(e), {
110
+ span: "3",
111
+ md: "6"
112
+ }, {
113
+ default: T(() => [v(w(c), S({
114
+ modelValue: w(y),
115
+ "onUpdate:modelValue": i[0] ||= (e) => b(y) ? y.value = e : null,
116
+ label: "Leendoel",
117
+ placeholder: "Maak een keuze",
118
+ options: w(M),
119
+ name: "LoanPurpose",
120
+ required: !1,
121
+ "error-message": w(E)
122
+ }, w(x)), null, 16, [
123
+ "modelValue",
124
+ "options",
125
+ "error-message"
126
+ ])]),
127
+ _: 1
128
+ }),
129
+ v(w(e), {
130
+ span: "2",
131
+ md: "6"
132
+ }, {
133
+ default: T(() => [v(w(s), S({
134
+ modelValue: w(D),
135
+ "onUpdate:modelValue": i[1] ||= (e) => b(D) ? D.value = e : null,
136
+ modelModifiers: { number: !0 },
137
+ label: "Leenbedrag",
138
+ placeholder: "Van € 3.500,- tot € 75.000,-",
139
+ icon: "far fa-euro-sign",
140
+ name: "LoanAmount",
141
+ mask: "#####",
142
+ inputmode: "numeric",
143
+ required: !1,
144
+ "error-message": w(k)
145
+ }, w(O)), null, 16, ["modelValue", "error-message"])]),
146
+ _: 1
147
+ }),
148
+ v(w(e), {
149
+ span: "2",
150
+ md: "6"
151
+ }, {
152
+ default: T(() => [v(w(l), S({
153
+ modelValue: w(A),
154
+ "onUpdate:modelValue": i[2] ||= (e) => b(A) ? A.value = e : null,
155
+ "error-message": w(P)
156
+ }, w(N)), null, 16, ["modelValue", "error-message"])]),
157
+ _: 1
158
+ }),
159
+ v(w(e), {
160
+ span: "3",
161
+ md: "6"
162
+ }, {
163
+ default: T(() => [v(w(p), S({
164
+ modelValue: w(F),
165
+ "onUpdate:modelValue": i[3] ||= (e) => b(F) ? F.value = e : null,
166
+ "error-message": w(L)
167
+ }, w(I)), null, 16, ["modelValue", "error-message"])]),
168
+ _: 1
169
+ })
170
+ ]),
171
+ _: 1
172
+ }, 16, ["submit-disabled"]));
173
+ }
174
+ });
175
+ //#endregion
176
+ //#region src/comparisons/loan/loan.presenter.ts
177
+ function P(e) {
178
+ let t = m(e, u);
179
+ if (!t) return 120;
180
+ let n = t.add(76, "year").diff(O(), "month", !0), r = Math.floor(n / 12) * 12;
181
+ return Math.min(r, 120);
182
+ }
183
+ function F(e) {
184
+ return {
185
+ comparison: a.Loan,
186
+ detail: { loan: {
187
+ LoanPurpose: e.LoanPurpose,
188
+ LoanAmount: e.LoanAmount,
189
+ MaxDurationByLegalLimit: P(e.birthdate)
190
+ } },
191
+ user: {
192
+ birthdate: e.birthdate,
193
+ familyComposition: e.familyComposition
194
+ }
195
+ };
196
+ }
197
+ //#endregion
198
+ export { N as n, F as t };