@vergelijkdirect/comparison-forms 2.0.2-rc.0 → 2.1.0-ver-9053.0
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/vue/VdInput-CRb-iTiH.js +145 -0
- package/dist/vue/VdPopover-B78nVpNU.js +200 -0
- package/dist/vue/VdRadioGroup-D5kHcpsY.js +166 -0
- package/dist/vue/VdSearchableSelect-THqVGo_Q.js +209 -0
- package/dist/vue/VdSelect-Dv35x4sz.js +112 -0
- package/dist/vue/bike-BmAOIT7K.js +2 -0
- package/dist/vue/bike.presenter-B28PW7O5.js +1673 -0
- package/dist/vue/birthdate.schema-DX1aYftY.js +91 -0
- package/dist/vue/businessCar.presenter-DR-Ozf6B.js +121 -0
- package/dist/vue/businessLiability-w4xhGnik.js +2 -0
- package/dist/vue/businessLiability.presenter-8iyRbLgw.js +80 -0
- package/dist/vue/car-business-DMYPV4UK.js +2 -0
- package/dist/vue/car-pxn56jlK.js +2 -0
- package/dist/vue/car.presenter-CMGN_MtF.js +130 -0
- package/dist/vue/caravan-CuhGro4y.js +2 -0
- package/dist/vue/caravan.presenter-DCV4ltB7.js +157 -0
- package/dist/vue/company.schema-DStHJpGH.js +241 -0
- package/dist/vue/comparison-forms.d.ts +36 -35
- package/dist/vue/comparison-forms.js +119 -5590
- package/dist/vue/date.util-DjJZwKvn.js +24 -0
- package/dist/vue/familyComposition.enum-D26VYo_a.js +6 -0
- package/dist/vue/familyComposition.schema-A9W0CwZq.js +75 -0
- package/dist/vue/house-DJhbPxyX.js +2 -0
- package/dist/vue/house.presenter-C7k4TwbP.js +118 -0
- package/dist/vue/houseOwnedBuilding.model-DskEdrSG.js +14 -0
- package/dist/vue/itc-KSDsJZsI.js +10 -0
- package/dist/vue/legal-Ce2WzBp6.js +2 -0
- package/dist/vue/legal.presenter-Ddiovxkq.js +175 -0
- package/dist/vue/liability-NHH24ecQ.js +2 -0
- package/dist/vue/liability.presenter-gHGQxRPP.js +110 -0
- package/dist/vue/loan-C9dmM3Vm.js +2 -0
- package/dist/vue/loan.presenter-p24T0XvQ.js +198 -0
- package/dist/vue/messages-DfcG9Qfd.js +41 -0
- package/dist/vue/moped-CnYiLYBp.js +2 -0
- package/dist/vue/moped.presenter-C5TcsOIe.js +133 -0
- package/dist/vue/motor-DSFijIK7.js +2 -0
- package/dist/vue/motor.presenter-Chlott4j.js +130 -0
- package/dist/vue/package-TSBIFNzu.js +2 -0
- package/dist/vue/package.presenter-Bit_w4np.js +137 -0
- package/dist/vue/pet-DRap9f-q.js +2 -0
- package/dist/vue/pet.presenter-BrWNvh7j.js +170 -0
- package/dist/vue/rules-3BZkSj_K.js +13 -0
- package/dist/vue/travel-DB9sfL8A.js +2 -0
- package/dist/vue/travel.presenter-CVkNDJwI.js +108 -0
- package/dist/vue/useAddress-C-h1pGI5.js +245 -0
- package/dist/vue/useLicensePlate-wAVrX9tr.js +187 -0
- package/dist/vue/useValidator-B8ZuqyvJ.js +535 -0
- package/dist/vue/yesNo-BvJlCm7Y.js +6 -0
- package/dist/wc/comparison-forms.js +14922 -14424
- package/dist/wc-forms/bike.cjs +1 -1
- package/dist/wc-forms/{birthdate.schema-rpmbSDZH.cjs → birthdate.schema-C-y732mA.cjs} +1 -1
- package/dist/wc-forms/car.cjs +1 -1
- package/dist/wc-forms/caravan.cjs +1 -1
- package/dist/wc-forms/{familyComposition.schema-DW6scNvt.cjs → familyComposition.schema-gvSnx-ea.cjs} +1 -1
- package/dist/wc-forms/house.cjs +1 -1
- package/dist/wc-forms/houseOwnedBuilding.model-G9AqKTZo.cjs +1 -0
- package/dist/wc-forms/legal.cjs +1 -1
- package/dist/wc-forms/liability.cjs +1 -1
- package/dist/wc-forms/loan.cjs +1 -1
- package/dist/wc-forms/{messages-stJTqN-x.cjs → messages-CX8jVyEo.cjs} +1 -1
- package/dist/wc-forms/moped.cjs +1 -1
- package/dist/wc-forms/motor.cjs +1 -1
- package/dist/wc-forms/package.cjs +1 -1
- package/dist/wc-forms/pet.cjs +1 -1
- package/dist/wc-forms/travel.cjs +1 -1
- package/dist/wc-noitc/comparison-forms.umd.cjs +3 -3
- package/package.json +1 -1
- package/dist/client/.vite/ssr-manifest.json +0 -600
- package/dist/client/assets/index-6Enzr9rU.css +0 -4
- package/dist/client/assets/index-6Enzr9rU.css.br +0 -0
- package/dist/client/assets/index-DUchBxEo.js +0 -57
- package/dist/client/assets/index-DUchBxEo.js.br +0 -0
- package/dist/client/index.html +0 -15
- package/dist/server/entry-server.js +0 -9981
- package/dist/server/entry-server.js.br +0 -0
- package/dist/wc-forms/houseOwnedBuilding.model-DgIQ2pQN.cjs +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { u as e } from "./useValidator-B8ZuqyvJ.js";
|
|
2
|
+
import { t } from "./VdInput-CRb-iTiH.js";
|
|
3
|
+
import { n } from "./itc-KSDsJZsI.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createTextVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, useAttrs as y, useModel as b, useSlots as x, watch as S, withCtx as C } from "vue";
|
|
5
|
+
import { string as w } from "yup";
|
|
6
|
+
//#region src/components/fields/licensePlate/licensePlate.model.ts
|
|
7
|
+
var T = {
|
|
8
|
+
[e.Car]: {
|
|
9
|
+
apiTypes: ["Car", "Van"],
|
|
10
|
+
dutch: "auto",
|
|
11
|
+
icon: "fa-car"
|
|
12
|
+
},
|
|
13
|
+
[e.Motor]: {
|
|
14
|
+
apiTypes: ["Motor", "MP3Motor"],
|
|
15
|
+
dutch: "motor",
|
|
16
|
+
icon: "fa-motorcycle"
|
|
17
|
+
},
|
|
18
|
+
[e.Moped]: {
|
|
19
|
+
apiTypes: ["Moped"],
|
|
20
|
+
dutch: "brommer",
|
|
21
|
+
icon: "moped-solid"
|
|
22
|
+
},
|
|
23
|
+
[e.Caravan]: {
|
|
24
|
+
apiTypes: ["Caravan"],
|
|
25
|
+
dutch: "caravan",
|
|
26
|
+
icon: "fa-caravan-alt"
|
|
27
|
+
}
|
|
28
|
+
}, E = Object.fromEntries(Object.values(T).flatMap(({ apiTypes: e, icon: t }) => e.map((e) => [e.toLowerCase(), t]))), D = {
|
|
29
|
+
brommobiel: "fa-car-side",
|
|
30
|
+
"speed pedelec": "fa-bicycle"
|
|
31
|
+
}, O = (e) => !!e?.Brand && !!e.Model && !!e.ManufacturingYear, k = (e) => {
|
|
32
|
+
if (!e) return "";
|
|
33
|
+
let t = String(e.Model ?? "").toLowerCase().trim(), n = String(e.VehicleType ?? "").toLowerCase();
|
|
34
|
+
return D[t] ?? E[n] ?? "";
|
|
35
|
+
}, A = (e) => e ? `${e.Brand} ${e.Model} (${e.ManufacturingYear})` : "", j = [
|
|
36
|
+
"@@-##-@@",
|
|
37
|
+
"##-##-@@",
|
|
38
|
+
"##-@@-@@",
|
|
39
|
+
"@@-@@-##",
|
|
40
|
+
"##-@@-##",
|
|
41
|
+
"@@-##-##",
|
|
42
|
+
"##-@@@-#",
|
|
43
|
+
"@@-###-@",
|
|
44
|
+
"@-###-@@",
|
|
45
|
+
"#-@@@-##",
|
|
46
|
+
"@@@-##-@",
|
|
47
|
+
"@-##-@@@",
|
|
48
|
+
"#-@@-###",
|
|
49
|
+
"###-@@-#"
|
|
50
|
+
];
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/fields/licensePlate/licensePlate.util.ts
|
|
53
|
+
function M(e) {
|
|
54
|
+
return e.replace(/[\s\\-]/g, "");
|
|
55
|
+
}
|
|
56
|
+
var N = "*".repeat(6), P = j.map((e) => e.replace(/-/g, ""));
|
|
57
|
+
function F(e) {
|
|
58
|
+
let t = M(e).slice(0, 6);
|
|
59
|
+
if (t.length < 6) return N;
|
|
60
|
+
let n = [...t].map((e) => /[0-9]/.test(e) ? "#" : "@").join(""), r = P.indexOf(n);
|
|
61
|
+
return r === -1 ? N : j[r];
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/fields/licensePlate/VdLicensePlate.vue?vue&type=script&setup=true&lang.ts
|
|
65
|
+
var I = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "vd-input-license-plate__loading-information"
|
|
68
|
+
}, L = ["src"], R = /* @__PURE__ */ d({
|
|
69
|
+
inheritAttrs: !1,
|
|
70
|
+
__name: "VdLicensePlate",
|
|
71
|
+
props: /*@__PURE__*/ f({
|
|
72
|
+
name: {},
|
|
73
|
+
label: { default: "Kenteken" },
|
|
74
|
+
errorMessage: { default: null },
|
|
75
|
+
loading: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !1
|
|
78
|
+
},
|
|
79
|
+
required: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: !1
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
modelValue: { default: "" },
|
|
85
|
+
modelModifiers: {},
|
|
86
|
+
vehicleData: { default: null },
|
|
87
|
+
vehicleDataModifiers: {}
|
|
88
|
+
}),
|
|
89
|
+
emits: /*@__PURE__*/ f(["input"], ["update:modelValue", "update:vehicleData"]),
|
|
90
|
+
setup(e, { emit: n }) {
|
|
91
|
+
let d = { mask: F }, f = e, h = b(e, "modelValue"), w = b(e, "vehicleData"), T = n, E = y(), D = x(), j = i({
|
|
92
|
+
get: () => h.value ?? "",
|
|
93
|
+
set: (e) => {
|
|
94
|
+
h.value = e, T("input", e);
|
|
95
|
+
}
|
|
96
|
+
}), N = (e, t) => M(e).toUpperCase() === M(t).toUpperCase();
|
|
97
|
+
S(h, (e) => {
|
|
98
|
+
w.value && !N(e, w.value.LicensePlate) && (w.value = null);
|
|
99
|
+
});
|
|
100
|
+
let P = i(() => O(w.value) ? w.value : null), R = i(() => f.loading || !!P.value && !f.errorMessage), z = i(() => k(P.value)), B = i(() => A(P.value));
|
|
101
|
+
return (n, i) => (m(), a(t, p(v(E), {
|
|
102
|
+
modelValue: j.value,
|
|
103
|
+
"onUpdate:modelValue": i[0] ||= (e) => j.value = e,
|
|
104
|
+
capitalize: "",
|
|
105
|
+
autocomplete: "",
|
|
106
|
+
name: e.name,
|
|
107
|
+
label: e.label,
|
|
108
|
+
required: e.required,
|
|
109
|
+
"error-message": e.errorMessage || null,
|
|
110
|
+
loading: e.loading,
|
|
111
|
+
mask: d,
|
|
112
|
+
class: "vd-input-license-plate"
|
|
113
|
+
}), l({ _: 2 }, [
|
|
114
|
+
v(D).label ? {
|
|
115
|
+
name: "label",
|
|
116
|
+
fn: C(() => [g(n.$slots, "label")]),
|
|
117
|
+
key: "0"
|
|
118
|
+
} : void 0,
|
|
119
|
+
v(D).popover ? {
|
|
120
|
+
name: "popover",
|
|
121
|
+
fn: C(() => [g(n.$slots, "popover")]),
|
|
122
|
+
key: "1"
|
|
123
|
+
} : void 0,
|
|
124
|
+
R.value ? {
|
|
125
|
+
name: "information",
|
|
126
|
+
fn: C(() => [e.loading ? (m(), s("div", I, [...i[1] ||= [c("i", { class: "fas fa-circle-notch vd-input-license-plate__loading-icon" }, null, -1), u(" Voertuig gegevens ophalen... ", -1)]])) : P.value ? (m(), s(r, { key: 1 }, [z.value ? (m(), s("img", {
|
|
127
|
+
key: 0,
|
|
128
|
+
src: `https://d12bmfj3oyxu0t.cloudfront.net/vergelijkdirect/icons/${z.value}.svg`,
|
|
129
|
+
class: "vd-field__svg-message-icon",
|
|
130
|
+
alt: "vehicle-icon"
|
|
131
|
+
}, null, 8, L)) : o("", !0), u(" " + _(B.value), 1)], 64)) : o("", !0)]),
|
|
132
|
+
key: "2"
|
|
133
|
+
} : void 0
|
|
134
|
+
]), 1040, [
|
|
135
|
+
"modelValue",
|
|
136
|
+
"name",
|
|
137
|
+
"label",
|
|
138
|
+
"required",
|
|
139
|
+
"error-message",
|
|
140
|
+
"loading"
|
|
141
|
+
]));
|
|
142
|
+
}
|
|
143
|
+
}), z = /* @__PURE__ */ new Map(), B = (e, t) => `${t}:${e}`, V = {
|
|
144
|
+
"wrong-type": (e) => `Het ingevoerde kenteken is geen ${T[e].dutch}`,
|
|
145
|
+
unknown: () => "Voertuig onbekend - Voer ander kenteken in of neem contact op",
|
|
146
|
+
"not-found": () => "Kenteken onbekend",
|
|
147
|
+
error: () => "Kenteken is incorrect"
|
|
148
|
+
}, H = async (e, t) => {
|
|
149
|
+
try {
|
|
150
|
+
let r = await n().dataService.findVehicle(e, t);
|
|
151
|
+
if (Array.isArray(r) || !r || !Object.keys(r).length) return { status: "not-found" };
|
|
152
|
+
let i = r;
|
|
153
|
+
return i.VehicleType ? T[t].apiTypes.includes(i.VehicleType) ? {
|
|
154
|
+
status: "found",
|
|
155
|
+
data: i
|
|
156
|
+
} : { status: "wrong-type" } : { status: "unknown" };
|
|
157
|
+
} catch (e) {
|
|
158
|
+
return console.error("Error on ITC findVehicle", e), { status: "error" };
|
|
159
|
+
}
|
|
160
|
+
}, U = (e, t) => {
|
|
161
|
+
let n = B(e, t), r = z.get(n);
|
|
162
|
+
return r || (r = H(e, t), z.set(n, r), r.then(({ status: e }) => {
|
|
163
|
+
e === "error" && z.delete(n);
|
|
164
|
+
}, () => z.delete(n))), r;
|
|
165
|
+
}, W = (e, t = {}) => {
|
|
166
|
+
let n = h(t.initialData ?? null), r = 0;
|
|
167
|
+
t.initialData?.LicensePlate && z.set(B(M(t.initialData.LicensePlate), e), Promise.resolve({
|
|
168
|
+
status: "found",
|
|
169
|
+
data: t.initialData
|
|
170
|
+
}));
|
|
171
|
+
let i = async (t) => {
|
|
172
|
+
let i = M(t), a = ++r, o = await U(i, e);
|
|
173
|
+
return a === r && (n.value = o.status === "found" ? o.data : null), o;
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
vehicleData: n,
|
|
177
|
+
licensePlateSchema: w().required("Dit veld is verplicht").test("license-plate-lookup", async (t, n) => {
|
|
178
|
+
if (!t) return !0;
|
|
179
|
+
let r = M(t);
|
|
180
|
+
if (r.length < 6) return n.createError({ message: "Kenteken is incorrect" });
|
|
181
|
+
let { status: a } = await i(r);
|
|
182
|
+
return a === "found" || n.createError({ message: V[a](e) });
|
|
183
|
+
})
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
//#endregion
|
|
187
|
+
export { R as n, W as t };
|