pdap-design-system 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +34 -0
- package/README.md +35 -49
- package/bin/pdap-design-system-cli.js +12 -8
- package/dist/components/Button/PdapButton.vue.d.ts +36 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/FlexContainer/FlexContainer.vue.d.ts +36 -0
- package/dist/components/FlexContainer/index.d.ts +2 -0
- package/dist/components/FlexContainer/types.d.ts +4 -0
- package/dist/components/Footer/PdapFooter.vue.d.ts +29 -0
- package/dist/components/Footer/index.d.ts +2 -0
- package/dist/components/Footer/types.d.ts +9 -0
- package/dist/components/Form/InputsGenerator/FormInputsGenerator.vue.d.ts +37 -0
- package/dist/components/Form/InputsGenerator/index.d.ts +2 -0
- package/dist/components/Form/PdapForm.vue.d.ts +39 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types.d.ts +35 -0
- package/dist/components/GridContainer/GridContainer.vue.d.ts +39 -0
- package/dist/components/GridContainer/index.d.ts +2 -0
- package/dist/components/GridContainer/types.d.ts +7 -0
- package/dist/components/GridItem/GridItem.vue.d.ts +39 -0
- package/dist/components/GridItem/index.d.ts +2 -0
- package/dist/components/GridItem/types.d.ts +5 -0
- package/dist/components/Header/PdapHeader.vue.d.ts +29 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Header/types.d.ts +4 -0
- package/dist/components/Input/Checkbox/InputCheckbox.vue.d.ts +24 -0
- package/dist/components/Input/Checkbox/index.d.ts +2 -0
- package/dist/components/Input/PdapInput.vue.d.ts +19 -0
- package/dist/components/Input/Text/InputText.vue.d.ts +24 -0
- package/dist/components/Input/Text/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types.d.ts +20 -0
- package/dist/components/Input/utils.d.ts +4 -0
- package/dist/components/Nav/PdapNav.vue.d.ts +12 -0
- package/dist/components/Nav/index.d.ts +2 -0
- package/dist/components/Nav/types.d.ts +12 -0
- package/dist/components/TileIcon/TileIcon.vue.d.ts +12 -0
- package/dist/components/TileIcon/index.d.ts +2 -0
- package/dist/components/TileIcon/types.d.ts +4 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1728 -0
- package/dist/styles.css +1 -0
- package/dist/tools/testing/serializer.d.ts +7 -0
- package/dist/tools/testing/setup.d.ts +1 -0
- package/dist/utils/vuelidate.d.ts +36 -0
- package/package.json +50 -20
- package/dist/css/global-styles.css +0 -2133
- package/system/README.md +0 -1
- package/system/css/global-styles.css +0 -735
- package/system/css/normalize.css +0 -349
- package/system/images/acronym.svg +0 -16
- package/system/images/favicon.png +0 -0
- package/system/images/icons/automation.svg +0 -50
- package/system/images/icons/community.svg +0 -38
- package/system/images/icons/scrapers.svg +0 -64
- package/system/images/icons/sources.svg +0 -43
- package/system/images/icons/standard.svg +0 -38
- package/system/images/lockup.svg +0 -68
- package/system/images/logo.svg +0 -8
- package/system/images/webclip.gif +0 -0
package/dist/index.js
ADDED
@@ -0,0 +1,1728 @@
|
|
1
|
+
import { defineComponent as C, reactive as E, openBlock as v, createElementBlock as b, normalizeClass as H, renderSlot as B, createBlock as j, resolveDynamicComponent as re, withCtx as I, inject as J, resolveComponent as Le, createVNode as me, createElementVNode as P, Fragment as Q, renderList as fe, unref as d, toDisplayString as S, createCommentVNode as q, createTextVNode as G, getCurrentInstance as Xe, ref as x, onBeforeMount as Ve, watch as U, isRef as ce, onBeforeUnmount as $e, computed as y, isReactive as Ze, isReadonly as Je, provide as be, nextTick as Y, watchEffect as ne, mergeProps as Qe, withModifiers as Ye, normalizeProps as et, guardReactiveProps as tt, normalizeStyle as ge, onMounted as rt } from "vue";
|
2
|
+
import { RouterLink as De } from "vue-router";
|
3
|
+
const rn = /* @__PURE__ */ C({
|
4
|
+
__name: "PdapButton",
|
5
|
+
props: {
|
6
|
+
intent: { default: "primary" },
|
7
|
+
isLoading: { type: Boolean, default: !1 }
|
8
|
+
},
|
9
|
+
setup(e) {
|
10
|
+
const t = e, r = E({
|
11
|
+
"pdap-button": !0,
|
12
|
+
[`pdap-button-${t.intent}`]: !!t.intent,
|
13
|
+
"pdap-button-loading": t.isLoading
|
14
|
+
});
|
15
|
+
return (n, a) => (v(), b("button", {
|
16
|
+
class: H(r)
|
17
|
+
}, [
|
18
|
+
B(n.$slots, "default")
|
19
|
+
], 2));
|
20
|
+
}
|
21
|
+
});
|
22
|
+
const nt = /* @__PURE__ */ C({
|
23
|
+
__name: "FlexContainer",
|
24
|
+
props: {
|
25
|
+
alignment: { default: "start" },
|
26
|
+
component: { default: "div" }
|
27
|
+
},
|
28
|
+
setup(e) {
|
29
|
+
const r = E({
|
30
|
+
"pdap-flex-container": !0,
|
31
|
+
[`pdap-flex-container-${e.alignment}`]: !0
|
32
|
+
});
|
33
|
+
return (n, a) => (v(), j(re(n.component), {
|
34
|
+
class: H(r)
|
35
|
+
}, {
|
36
|
+
default: I(() => [
|
37
|
+
B(n.$slots, "default")
|
38
|
+
]),
|
39
|
+
_: 3
|
40
|
+
}, 8, ["class"]));
|
41
|
+
}
|
42
|
+
});
|
43
|
+
const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" }, ot = ["href"], it = /* @__PURE__ */ P("p", { class: "pdap-footer-copyright" }, [
|
44
|
+
/* @__PURE__ */ G(" © 2023 Police Data Accessibility Project"),
|
45
|
+
/* @__PURE__ */ P("br")
|
46
|
+
], -1), ut = /* @__PURE__ */ P("p", { class: "pdap-footer-copyright" }, [
|
47
|
+
/* @__PURE__ */ G(" PDAP is a non-profit. EIN: 85-4207132. "),
|
48
|
+
/* @__PURE__ */ P("a", {
|
49
|
+
href: "https://docs.pdap.io/meta/policy/pdap-privacy-policy",
|
50
|
+
alt: "Privacy Policy"
|
51
|
+
}, " Privacy Policy"),
|
52
|
+
/* @__PURE__ */ G(". "),
|
53
|
+
/* @__PURE__ */ P("a", { href: "mailto:contact@pdap.io" }, "contact@pdap.io")
|
54
|
+
], -1), lt = { class: "pdap-footer-widget-links" }, ct = /* @__PURE__ */ P("a", {
|
55
|
+
href: "https://www.guidestar.org/profile/85-4207132",
|
56
|
+
target: "_blank"
|
57
|
+
}, [
|
58
|
+
/* @__PURE__ */ P("img", { src: "https://widgets.guidestar.org/gximage2?o=9973356&l=v4" })
|
59
|
+
], -1), dt = ["href"], pt = ["src"], mt = ["src"], nn = /* @__PURE__ */ C({
|
60
|
+
__name: "PdapFooter",
|
61
|
+
props: {
|
62
|
+
logoImageSrc: { default: "node_modules/pdap-design-system/dist/images/acronym.svg" },
|
63
|
+
logoImageAnchorPath: { default: "/" }
|
64
|
+
},
|
65
|
+
setup(e) {
|
66
|
+
const t = e, r = J("footerLinks", [
|
67
|
+
{
|
68
|
+
href: "https://github.com/orgs/Police-Data-Accessibility-Project",
|
69
|
+
text: "Github"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
href: "ttps://discord.gg/wMqex8nKZJ",
|
73
|
+
text: "Discord"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
href: "https://www.linkedin.com/company/pdap",
|
77
|
+
text: "LinkedIn"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
path: "/jobs",
|
81
|
+
text: "Jobs"
|
82
|
+
}
|
83
|
+
]), n = t.logoImageAnchorPath.startsWith("/");
|
84
|
+
return (a, s) => {
|
85
|
+
const u = Le("router-link");
|
86
|
+
return v(), b("footer", at, [
|
87
|
+
me(nt, { alignment: "center" }, {
|
88
|
+
default: I(() => [
|
89
|
+
P("ul", st, [
|
90
|
+
(v(!0), b(Q, null, fe(d(r), (i) => (v(), b("li", {
|
91
|
+
key: i.text,
|
92
|
+
class: "pdap-footer-link-container"
|
93
|
+
}, [
|
94
|
+
i.href ? (v(), b("a", {
|
95
|
+
key: 0,
|
96
|
+
class: "pdap-footer-social-link",
|
97
|
+
href: i.href,
|
98
|
+
target: "_blank",
|
99
|
+
referrerpolicy: "no-referrer"
|
100
|
+
}, S(i.text), 9, ot)) : q("", !0),
|
101
|
+
i.path ? (v(), j(u, {
|
102
|
+
key: 1,
|
103
|
+
"active-class": "pdap-footer-social-link-current",
|
104
|
+
"exact-active-class": "pdap-footer-social-link-current-exact",
|
105
|
+
class: "pdap-footer-social-link",
|
106
|
+
to: i.path
|
107
|
+
}, {
|
108
|
+
default: I(() => [
|
109
|
+
G(S(i.text), 1)
|
110
|
+
]),
|
111
|
+
_: 2
|
112
|
+
}, 1032, ["to"])) : q("", !0)
|
113
|
+
]))), 128))
|
114
|
+
]),
|
115
|
+
it,
|
116
|
+
ut,
|
117
|
+
P("div", lt, [
|
118
|
+
ct,
|
119
|
+
d(n) ? (v(), j(u, {
|
120
|
+
key: 1,
|
121
|
+
to: a.logoImageAnchorPath,
|
122
|
+
class: "pdap-footer-logo"
|
123
|
+
}, {
|
124
|
+
default: I(() => [
|
125
|
+
P("img", {
|
126
|
+
src: a.logoImageSrc,
|
127
|
+
loading: "lazy",
|
128
|
+
width: "250",
|
129
|
+
alt: "Police Data Accessibility Project Logo"
|
130
|
+
}, null, 8, mt)
|
131
|
+
]),
|
132
|
+
_: 1
|
133
|
+
}, 8, ["to"])) : (v(), b("a", {
|
134
|
+
key: 0,
|
135
|
+
href: a.logoImageAnchorPath,
|
136
|
+
class: "pdap-footer-logo"
|
137
|
+
}, [
|
138
|
+
P("img", {
|
139
|
+
src: a.logoImageSrc,
|
140
|
+
loading: "lazy",
|
141
|
+
width: "250",
|
142
|
+
alt: "Police Data Accessibility Project Logo"
|
143
|
+
}, null, 8, pt)
|
144
|
+
], 8, dt))
|
145
|
+
])
|
146
|
+
]),
|
147
|
+
_: 1
|
148
|
+
})
|
149
|
+
]);
|
150
|
+
};
|
151
|
+
}
|
152
|
+
});
|
153
|
+
function Pe(e, t) {
|
154
|
+
var r = Object.keys(e);
|
155
|
+
if (Object.getOwnPropertySymbols) {
|
156
|
+
var n = Object.getOwnPropertySymbols(e);
|
157
|
+
t && (n = n.filter(function(a) {
|
158
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
159
|
+
})), r.push.apply(r, n);
|
160
|
+
}
|
161
|
+
return r;
|
162
|
+
}
|
163
|
+
function L(e) {
|
164
|
+
for (var t = 1; t < arguments.length; t++) {
|
165
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
166
|
+
t % 2 ? Pe(Object(r), !0).forEach(function(n) {
|
167
|
+
ft(e, n, r[n]);
|
168
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Pe(Object(r)).forEach(function(n) {
|
169
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
170
|
+
});
|
171
|
+
}
|
172
|
+
return e;
|
173
|
+
}
|
174
|
+
function ft(e, t, r) {
|
175
|
+
return t in e ? Object.defineProperty(e, t, {
|
176
|
+
value: r,
|
177
|
+
enumerable: !0,
|
178
|
+
configurable: !0,
|
179
|
+
writable: !0
|
180
|
+
}) : e[t] = r, e;
|
181
|
+
}
|
182
|
+
function xe(e) {
|
183
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
184
|
+
return Object.keys(e).reduce((r, n) => (t.includes(n) || (r[n] = d(e[n])), r), {});
|
185
|
+
}
|
186
|
+
function ee(e) {
|
187
|
+
return typeof e == "function";
|
188
|
+
}
|
189
|
+
function $t(e) {
|
190
|
+
return Ze(e) || Je(e);
|
191
|
+
}
|
192
|
+
function ke(e, t, r) {
|
193
|
+
let n = e;
|
194
|
+
const a = t.split(".");
|
195
|
+
for (let s = 0; s < a.length; s++) {
|
196
|
+
if (!n[a[s]])
|
197
|
+
return r;
|
198
|
+
n = n[a[s]];
|
199
|
+
}
|
200
|
+
return n;
|
201
|
+
}
|
202
|
+
function le(e, t, r) {
|
203
|
+
return y(() => e.some((n) => ke(t, n, {
|
204
|
+
[r]: !1
|
205
|
+
})[r]));
|
206
|
+
}
|
207
|
+
function Oe(e, t, r) {
|
208
|
+
return y(() => e.reduce((n, a) => {
|
209
|
+
const s = ke(t, a, {
|
210
|
+
[r]: !1
|
211
|
+
})[r] || [];
|
212
|
+
return n.concat(s);
|
213
|
+
}, []));
|
214
|
+
}
|
215
|
+
function ze(e, t, r, n) {
|
216
|
+
return e.call(n, d(t), d(r), n);
|
217
|
+
}
|
218
|
+
function Se(e) {
|
219
|
+
return e.$valid !== void 0 ? !e.$valid : !e;
|
220
|
+
}
|
221
|
+
function gt(e, t, r, n, a, s, u) {
|
222
|
+
let {
|
223
|
+
$lazy: i,
|
224
|
+
$rewardEarly: c
|
225
|
+
} = a, l = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : [], p = arguments.length > 8 ? arguments[8] : void 0, f = arguments.length > 9 ? arguments[9] : void 0, g = arguments.length > 10 ? arguments[10] : void 0;
|
226
|
+
const h = x(!!n.value), o = x(0);
|
227
|
+
r.value = !1;
|
228
|
+
const m = U([t, n].concat(l, g), () => {
|
229
|
+
if (i && !n.value || c && !f.value && !r.value)
|
230
|
+
return;
|
231
|
+
let $;
|
232
|
+
try {
|
233
|
+
$ = ze(e, t, p, u);
|
234
|
+
} catch (_) {
|
235
|
+
$ = Promise.reject(_);
|
236
|
+
}
|
237
|
+
o.value++, r.value = !!o.value, h.value = !1, Promise.resolve($).then((_) => {
|
238
|
+
o.value--, r.value = !!o.value, s.value = _, h.value = Se(_);
|
239
|
+
}).catch((_) => {
|
240
|
+
o.value--, r.value = !!o.value, s.value = _, h.value = !0;
|
241
|
+
});
|
242
|
+
}, {
|
243
|
+
immediate: !0,
|
244
|
+
deep: typeof t == "object"
|
245
|
+
});
|
246
|
+
return {
|
247
|
+
$invalid: h,
|
248
|
+
$unwatch: m
|
249
|
+
};
|
250
|
+
}
|
251
|
+
function ht(e, t, r, n, a, s, u, i) {
|
252
|
+
let {
|
253
|
+
$lazy: c,
|
254
|
+
$rewardEarly: l
|
255
|
+
} = n;
|
256
|
+
const p = () => ({}), f = y(() => {
|
257
|
+
if (c && !r.value || l && !i.value)
|
258
|
+
return !1;
|
259
|
+
let g = !0;
|
260
|
+
try {
|
261
|
+
const h = ze(e, t, u, s);
|
262
|
+
a.value = h, g = Se(h);
|
263
|
+
} catch (h) {
|
264
|
+
a.value = h;
|
265
|
+
}
|
266
|
+
return g;
|
267
|
+
});
|
268
|
+
return {
|
269
|
+
$unwatch: p,
|
270
|
+
$invalid: f
|
271
|
+
};
|
272
|
+
}
|
273
|
+
function vt(e, t, r, n, a, s, u, i, c, l, p) {
|
274
|
+
const f = x(!1), g = e.$params || {}, h = x(null);
|
275
|
+
let o, m;
|
276
|
+
e.$async ? {
|
277
|
+
$invalid: o,
|
278
|
+
$unwatch: m
|
279
|
+
} = gt(e.$validator, t, f, r, n, h, a, e.$watchTargets, c, l, p) : {
|
280
|
+
$invalid: o,
|
281
|
+
$unwatch: m
|
282
|
+
} = ht(e.$validator, t, r, n, h, a, c, l);
|
283
|
+
const $ = e.$message;
|
284
|
+
return {
|
285
|
+
$message: ee($) ? y(() => $(xe({
|
286
|
+
$pending: f,
|
287
|
+
$invalid: o,
|
288
|
+
$params: xe(g),
|
289
|
+
$model: t,
|
290
|
+
$response: h,
|
291
|
+
$validator: s,
|
292
|
+
$propertyPath: i,
|
293
|
+
$property: u
|
294
|
+
}))) : $ || "",
|
295
|
+
$params: g,
|
296
|
+
$pending: f,
|
297
|
+
$invalid: o,
|
298
|
+
$response: h,
|
299
|
+
$unwatch: m
|
300
|
+
};
|
301
|
+
}
|
302
|
+
function yt() {
|
303
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
304
|
+
const t = d(e), r = Object.keys(t), n = {}, a = {}, s = {};
|
305
|
+
let u = null;
|
306
|
+
return r.forEach((i) => {
|
307
|
+
const c = t[i];
|
308
|
+
switch (!0) {
|
309
|
+
case ee(c.$validator):
|
310
|
+
n[i] = c;
|
311
|
+
break;
|
312
|
+
case ee(c):
|
313
|
+
n[i] = {
|
314
|
+
$validator: c
|
315
|
+
};
|
316
|
+
break;
|
317
|
+
case i === "$validationGroups":
|
318
|
+
u = c;
|
319
|
+
break;
|
320
|
+
case i.startsWith("$"):
|
321
|
+
s[i] = c;
|
322
|
+
break;
|
323
|
+
default:
|
324
|
+
a[i] = c;
|
325
|
+
}
|
326
|
+
}), {
|
327
|
+
rules: n,
|
328
|
+
nestedValidators: a,
|
329
|
+
config: s,
|
330
|
+
validationGroups: u
|
331
|
+
};
|
332
|
+
}
|
333
|
+
const _t = "__root";
|
334
|
+
function wt(e, t, r, n, a, s, u, i, c) {
|
335
|
+
const l = Object.keys(e), p = n.get(a, e), f = x(!1), g = x(!1), h = x(0);
|
336
|
+
if (p) {
|
337
|
+
if (!p.$partial)
|
338
|
+
return p;
|
339
|
+
p.$unwatch(), f.value = p.$dirty.value;
|
340
|
+
}
|
341
|
+
const o = {
|
342
|
+
$dirty: f,
|
343
|
+
$path: a,
|
344
|
+
$touch: () => {
|
345
|
+
f.value || (f.value = !0);
|
346
|
+
},
|
347
|
+
$reset: () => {
|
348
|
+
f.value && (f.value = !1);
|
349
|
+
},
|
350
|
+
$commit: () => {
|
351
|
+
}
|
352
|
+
};
|
353
|
+
return l.length ? (l.forEach((m) => {
|
354
|
+
o[m] = vt(e[m], t, o.$dirty, s, u, m, r, a, c, g, h);
|
355
|
+
}), o.$externalResults = y(() => i.value ? [].concat(i.value).map((m, $) => ({
|
356
|
+
$propertyPath: a,
|
357
|
+
$property: r,
|
358
|
+
$validator: "$externalResults",
|
359
|
+
$uid: `${a}-externalResult-${$}`,
|
360
|
+
$message: m,
|
361
|
+
$params: {},
|
362
|
+
$response: null,
|
363
|
+
$pending: !1
|
364
|
+
})) : []), o.$invalid = y(() => {
|
365
|
+
const m = l.some(($) => d(o[$].$invalid));
|
366
|
+
return g.value = m, !!o.$externalResults.value.length || m;
|
367
|
+
}), o.$pending = y(() => l.some((m) => d(o[m].$pending))), o.$error = y(() => o.$dirty.value ? o.$pending.value || o.$invalid.value : !1), o.$silentErrors = y(() => l.filter((m) => d(o[m].$invalid)).map((m) => {
|
368
|
+
const $ = o[m];
|
369
|
+
return E({
|
370
|
+
$propertyPath: a,
|
371
|
+
$property: r,
|
372
|
+
$validator: m,
|
373
|
+
$uid: `${a}-${m}`,
|
374
|
+
$message: $.$message,
|
375
|
+
$params: $.$params,
|
376
|
+
$response: $.$response,
|
377
|
+
$pending: $.$pending
|
378
|
+
});
|
379
|
+
}).concat(o.$externalResults.value)), o.$errors = y(() => o.$dirty.value ? o.$silentErrors.value : []), o.$unwatch = () => l.forEach((m) => {
|
380
|
+
o[m].$unwatch();
|
381
|
+
}), o.$commit = () => {
|
382
|
+
g.value = !0, h.value = Date.now();
|
383
|
+
}, n.set(a, e, o), o) : (p && n.set(a, e, o), o);
|
384
|
+
}
|
385
|
+
function bt(e, t, r, n, a, s, u) {
|
386
|
+
const i = Object.keys(e);
|
387
|
+
return i.length ? i.reduce((c, l) => (c[l] = de({
|
388
|
+
validations: e[l],
|
389
|
+
state: t,
|
390
|
+
key: l,
|
391
|
+
parentKey: r,
|
392
|
+
resultsCache: n,
|
393
|
+
globalConfig: a,
|
394
|
+
instance: s,
|
395
|
+
externalResults: u
|
396
|
+
}), c), {}) : {};
|
397
|
+
}
|
398
|
+
function Pt(e, t, r) {
|
399
|
+
const n = y(() => [t, r].filter((o) => o).reduce((o, m) => o.concat(Object.values(d(m))), [])), a = y({
|
400
|
+
get() {
|
401
|
+
return e.$dirty.value || (n.value.length ? n.value.every((o) => o.$dirty) : !1);
|
402
|
+
},
|
403
|
+
set(o) {
|
404
|
+
e.$dirty.value = o;
|
405
|
+
}
|
406
|
+
}), s = y(() => {
|
407
|
+
const o = d(e.$silentErrors) || [], m = n.value.filter(($) => (d($).$silentErrors || []).length).reduce(($, _) => $.concat(..._.$silentErrors), []);
|
408
|
+
return o.concat(m);
|
409
|
+
}), u = y(() => {
|
410
|
+
const o = d(e.$errors) || [], m = n.value.filter(($) => (d($).$errors || []).length).reduce(($, _) => $.concat(..._.$errors), []);
|
411
|
+
return o.concat(m);
|
412
|
+
}), i = y(() => n.value.some((o) => o.$invalid) || d(e.$invalid) || !1), c = y(() => n.value.some((o) => d(o.$pending)) || d(e.$pending) || !1), l = y(() => n.value.some((o) => o.$dirty) || n.value.some((o) => o.$anyDirty) || a.value), p = y(() => a.value ? c.value || i.value : !1), f = () => {
|
413
|
+
e.$touch(), n.value.forEach((o) => {
|
414
|
+
o.$touch();
|
415
|
+
});
|
416
|
+
}, g = () => {
|
417
|
+
e.$commit(), n.value.forEach((o) => {
|
418
|
+
o.$commit();
|
419
|
+
});
|
420
|
+
}, h = () => {
|
421
|
+
e.$reset(), n.value.forEach((o) => {
|
422
|
+
o.$reset();
|
423
|
+
});
|
424
|
+
};
|
425
|
+
return n.value.length && n.value.every((o) => o.$dirty) && f(), {
|
426
|
+
$dirty: a,
|
427
|
+
$errors: u,
|
428
|
+
$invalid: i,
|
429
|
+
$anyDirty: l,
|
430
|
+
$error: p,
|
431
|
+
$pending: c,
|
432
|
+
$touch: f,
|
433
|
+
$reset: h,
|
434
|
+
$silentErrors: s,
|
435
|
+
$commit: g
|
436
|
+
};
|
437
|
+
}
|
438
|
+
function de(e) {
|
439
|
+
let {
|
440
|
+
validations: t,
|
441
|
+
state: r,
|
442
|
+
key: n,
|
443
|
+
parentKey: a,
|
444
|
+
childResults: s,
|
445
|
+
resultsCache: u,
|
446
|
+
globalConfig: i = {},
|
447
|
+
instance: c,
|
448
|
+
externalResults: l
|
449
|
+
} = e;
|
450
|
+
const p = a ? `${a}.${n}` : n, {
|
451
|
+
rules: f,
|
452
|
+
nestedValidators: g,
|
453
|
+
config: h,
|
454
|
+
validationGroups: o
|
455
|
+
} = yt(t), m = L(L({}, i), h), $ = n ? y(() => {
|
456
|
+
const w = d(r);
|
457
|
+
return w ? d(w[n]) : void 0;
|
458
|
+
}) : r, _ = L({}, d(l) || {}), N = y(() => {
|
459
|
+
const w = d(l);
|
460
|
+
return n ? w ? d(w[n]) : void 0 : w;
|
461
|
+
}), se = wt(f, $, n, u, p, m, c, N, r), R = bt(g, $, p, u, m, c, N), k = {};
|
462
|
+
o && Object.entries(o).forEach((w) => {
|
463
|
+
let [z, T] = w;
|
464
|
+
k[z] = {
|
465
|
+
$invalid: le(T, R, "$invalid"),
|
466
|
+
$error: le(T, R, "$error"),
|
467
|
+
$pending: le(T, R, "$pending"),
|
468
|
+
$errors: Oe(T, R, "$errors"),
|
469
|
+
$silentErrors: Oe(T, R, "$silentErrors")
|
470
|
+
};
|
471
|
+
});
|
472
|
+
const {
|
473
|
+
$dirty: A,
|
474
|
+
$errors: X,
|
475
|
+
$invalid: oe,
|
476
|
+
$anyDirty: qe,
|
477
|
+
$error: Fe,
|
478
|
+
$pending: ie,
|
479
|
+
$touch: ue,
|
480
|
+
$reset: He,
|
481
|
+
$silentErrors: Be,
|
482
|
+
$commit: we
|
483
|
+
} = Pt(se, R, s), Ge = n ? y({
|
484
|
+
get: () => d($),
|
485
|
+
set: (w) => {
|
486
|
+
A.value = !0;
|
487
|
+
const z = d(r), T = d(l);
|
488
|
+
T && (T[n] = _[n]), ce(z[n]) ? z[n].value = w : z[n] = w;
|
489
|
+
}
|
490
|
+
}) : null;
|
491
|
+
n && m.$autoDirty && U($, () => {
|
492
|
+
A.value || ue();
|
493
|
+
const w = d(l);
|
494
|
+
w && (w[n] = _[n]);
|
495
|
+
}, {
|
496
|
+
flush: "sync"
|
497
|
+
});
|
498
|
+
async function Ue() {
|
499
|
+
return ue(), m.$rewardEarly && (we(), await Y()), await Y(), new Promise((w) => {
|
500
|
+
if (!ie.value)
|
501
|
+
return w(!oe.value);
|
502
|
+
const z = U(ie, () => {
|
503
|
+
w(!oe.value), z();
|
504
|
+
});
|
505
|
+
});
|
506
|
+
}
|
507
|
+
function We(w) {
|
508
|
+
return (s.value || {})[w];
|
509
|
+
}
|
510
|
+
function Ke() {
|
511
|
+
ce(l) ? l.value = _ : Object.keys(_).length === 0 ? Object.keys(l).forEach((w) => {
|
512
|
+
delete l[w];
|
513
|
+
}) : Object.assign(l, _);
|
514
|
+
}
|
515
|
+
return E(L(L(L({}, se), {}, {
|
516
|
+
$model: Ge,
|
517
|
+
$dirty: A,
|
518
|
+
$error: Fe,
|
519
|
+
$errors: X,
|
520
|
+
$invalid: oe,
|
521
|
+
$anyDirty: qe,
|
522
|
+
$pending: ie,
|
523
|
+
$touch: ue,
|
524
|
+
$reset: He,
|
525
|
+
$path: p || _t,
|
526
|
+
$silentErrors: Be,
|
527
|
+
$validate: Ue,
|
528
|
+
$commit: we
|
529
|
+
}, s && {
|
530
|
+
$getResultsForChild: We,
|
531
|
+
$clearExternalResults: Ke,
|
532
|
+
$validationGroups: k
|
533
|
+
}), R));
|
534
|
+
}
|
535
|
+
class xt {
|
536
|
+
constructor() {
|
537
|
+
this.storage = /* @__PURE__ */ new Map();
|
538
|
+
}
|
539
|
+
set(t, r, n) {
|
540
|
+
this.storage.set(t, {
|
541
|
+
rules: r,
|
542
|
+
result: n
|
543
|
+
});
|
544
|
+
}
|
545
|
+
checkRulesValidity(t, r, n) {
|
546
|
+
const a = Object.keys(n), s = Object.keys(r);
|
547
|
+
return s.length !== a.length || !s.every((i) => a.includes(i)) ? !1 : s.every((i) => r[i].$params ? Object.keys(r[i].$params).every((c) => d(n[i].$params[c]) === d(r[i].$params[c])) : !0);
|
548
|
+
}
|
549
|
+
get(t, r) {
|
550
|
+
const n = this.storage.get(t);
|
551
|
+
if (!n)
|
552
|
+
return;
|
553
|
+
const {
|
554
|
+
rules: a,
|
555
|
+
result: s
|
556
|
+
} = n, u = this.checkRulesValidity(t, r, a), i = s.$unwatch ? s.$unwatch : () => ({});
|
557
|
+
return u ? s : {
|
558
|
+
$dirty: s.$dirty,
|
559
|
+
$partial: !0,
|
560
|
+
$unwatch: i
|
561
|
+
};
|
562
|
+
}
|
563
|
+
}
|
564
|
+
const Z = {
|
565
|
+
COLLECT_ALL: !0,
|
566
|
+
COLLECT_NONE: !1
|
567
|
+
}, Re = Symbol("vuelidate#injectChildResults"), Ce = Symbol("vuelidate#removeChildResults");
|
568
|
+
function Ot(e) {
|
569
|
+
let {
|
570
|
+
$scope: t,
|
571
|
+
instance: r
|
572
|
+
} = e;
|
573
|
+
const n = {}, a = x([]), s = y(() => a.value.reduce((p, f) => (p[f] = d(n[f]), p), {}));
|
574
|
+
function u(p, f) {
|
575
|
+
let {
|
576
|
+
$registerAs: g,
|
577
|
+
$scope: h,
|
578
|
+
$stopPropagation: o
|
579
|
+
} = f;
|
580
|
+
o || t === Z.COLLECT_NONE || h === Z.COLLECT_NONE || t !== Z.COLLECT_ALL && t !== h || (n[g] = p, a.value.push(g));
|
581
|
+
}
|
582
|
+
r.__vuelidateInjectInstances = [].concat(r.__vuelidateInjectInstances || [], u);
|
583
|
+
function i(p) {
|
584
|
+
a.value = a.value.filter((f) => f !== p), delete n[p];
|
585
|
+
}
|
586
|
+
r.__vuelidateRemoveInstances = [].concat(r.__vuelidateRemoveInstances || [], i);
|
587
|
+
const c = J(Re, []);
|
588
|
+
be(Re, r.__vuelidateInjectInstances);
|
589
|
+
const l = J(Ce, []);
|
590
|
+
return be(Ce, r.__vuelidateRemoveInstances), {
|
591
|
+
childResults: s,
|
592
|
+
sendValidationResultsToParent: c,
|
593
|
+
removeValidationResultsFromParent: l
|
594
|
+
};
|
595
|
+
}
|
596
|
+
function Me(e) {
|
597
|
+
return new Proxy(e, {
|
598
|
+
get(t, r) {
|
599
|
+
return typeof t[r] == "object" ? Me(t[r]) : y(() => t[r]);
|
600
|
+
}
|
601
|
+
});
|
602
|
+
}
|
603
|
+
let Ee = 0;
|
604
|
+
function Rt(e, t) {
|
605
|
+
var r;
|
606
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
607
|
+
arguments.length === 1 && (n = e, e = void 0, t = void 0);
|
608
|
+
let {
|
609
|
+
$registerAs: a,
|
610
|
+
$scope: s = Z.COLLECT_ALL,
|
611
|
+
$stopPropagation: u,
|
612
|
+
$externalResults: i,
|
613
|
+
currentVueInstance: c
|
614
|
+
} = n;
|
615
|
+
const l = c || ((r = Xe()) === null || r === void 0 ? void 0 : r.proxy), p = l ? l.$options : {};
|
616
|
+
a || (Ee += 1, a = `_vuelidate_${Ee}`);
|
617
|
+
const f = x({}), g = new xt(), {
|
618
|
+
childResults: h,
|
619
|
+
sendValidationResultsToParent: o,
|
620
|
+
removeValidationResultsFromParent: m
|
621
|
+
} = l ? Ot({
|
622
|
+
$scope: s,
|
623
|
+
instance: l
|
624
|
+
}) : {
|
625
|
+
childResults: x({})
|
626
|
+
};
|
627
|
+
if (!e && p.validations) {
|
628
|
+
const $ = p.validations;
|
629
|
+
t = x({}), Ve(() => {
|
630
|
+
t.value = l, U(() => ee($) ? $.call(t.value, new Me(t.value)) : $, (_) => {
|
631
|
+
f.value = de({
|
632
|
+
validations: _,
|
633
|
+
state: t,
|
634
|
+
childResults: h,
|
635
|
+
resultsCache: g,
|
636
|
+
globalConfig: n,
|
637
|
+
instance: l,
|
638
|
+
externalResults: i || l.vuelidateExternalResults
|
639
|
+
});
|
640
|
+
}, {
|
641
|
+
immediate: !0
|
642
|
+
});
|
643
|
+
}), n = p.validationsConfig || n;
|
644
|
+
} else {
|
645
|
+
const $ = ce(e) || $t(e) ? e : E(e || {});
|
646
|
+
U($, (_) => {
|
647
|
+
f.value = de({
|
648
|
+
validations: _,
|
649
|
+
state: t,
|
650
|
+
childResults: h,
|
651
|
+
resultsCache: g,
|
652
|
+
globalConfig: n,
|
653
|
+
instance: l ?? {},
|
654
|
+
externalResults: i
|
655
|
+
});
|
656
|
+
}, {
|
657
|
+
immediate: !0
|
658
|
+
});
|
659
|
+
}
|
660
|
+
return l && (o.forEach(($) => $(f, {
|
661
|
+
$registerAs: a,
|
662
|
+
$scope: s,
|
663
|
+
$stopPropagation: u
|
664
|
+
})), $e(() => m.forEach(($) => $(a)))), y(() => L(L({}, d(f.value)), h.value));
|
665
|
+
}
|
666
|
+
const Ct = ["for"], Et = ["id"], It = /* @__PURE__ */ C({
|
667
|
+
__name: "PdapInput",
|
668
|
+
props: {
|
669
|
+
id: {},
|
670
|
+
label: {},
|
671
|
+
name: {},
|
672
|
+
error: {}
|
673
|
+
},
|
674
|
+
setup(e) {
|
675
|
+
const t = e, r = y(() => `pdap-${t.name}-input-error`);
|
676
|
+
return ne(() => {
|
677
|
+
console.debug(
|
678
|
+
`Hello from PDAP Input ${t.name} rendered at ${window.location.pathname}`,
|
679
|
+
{
|
680
|
+
props: t
|
681
|
+
}
|
682
|
+
);
|
683
|
+
}), (n, a) => {
|
684
|
+
var s;
|
685
|
+
return v(), b("div", {
|
686
|
+
class: H({
|
687
|
+
"pdap-input": !0,
|
688
|
+
"pdap-input-error": ((s = n.error) == null ? void 0 : s.length) >= 1
|
689
|
+
})
|
690
|
+
}, [
|
691
|
+
B(n.$slots, "default"),
|
692
|
+
P("label", {
|
693
|
+
class: "pdap-input-label",
|
694
|
+
for: n.id
|
695
|
+
}, S(n.label), 9, Ct),
|
696
|
+
n.error ? (v(), b("div", {
|
697
|
+
key: 0,
|
698
|
+
id: r.value,
|
699
|
+
class: "pdap-input-error-message"
|
700
|
+
}, S(n.error), 9, Et)) : q("", !0)
|
701
|
+
], 2);
|
702
|
+
};
|
703
|
+
}
|
704
|
+
});
|
705
|
+
const jt = ["id", "name", "value", "placeholder"], At = /* @__PURE__ */ C({
|
706
|
+
__name: "InputText",
|
707
|
+
props: {
|
708
|
+
placeholder: {},
|
709
|
+
type: {},
|
710
|
+
value: {},
|
711
|
+
id: {},
|
712
|
+
label: {},
|
713
|
+
name: {},
|
714
|
+
error: {}
|
715
|
+
},
|
716
|
+
emits: ["input"],
|
717
|
+
setup(e, { emit: t }) {
|
718
|
+
const r = e, n = t, a = (s) => {
|
719
|
+
n("input", s.target.value);
|
720
|
+
};
|
721
|
+
return ne(() => {
|
722
|
+
console.debug(
|
723
|
+
`Hello from PDAP InputText ${r.name} rendered at ${window.location.pathname}`,
|
724
|
+
{
|
725
|
+
props: r
|
726
|
+
}
|
727
|
+
);
|
728
|
+
}), (s, u) => (v(), b("input", {
|
729
|
+
id: s.id,
|
730
|
+
type: "text",
|
731
|
+
name: s.name,
|
732
|
+
value: s.value,
|
733
|
+
placeholder: s.placeholder,
|
734
|
+
onInput: a
|
735
|
+
}, null, 40, jt));
|
736
|
+
}
|
737
|
+
}), Tt = ["id", "name", "checked", "value"], Lt = /* @__PURE__ */ C({
|
738
|
+
__name: "InputCheckbox",
|
739
|
+
props: {
|
740
|
+
defaultChecked: { type: Boolean },
|
741
|
+
type: {},
|
742
|
+
value: {},
|
743
|
+
id: {},
|
744
|
+
label: {},
|
745
|
+
name: {},
|
746
|
+
error: {}
|
747
|
+
},
|
748
|
+
emits: ["change"],
|
749
|
+
setup(e, { emit: t }) {
|
750
|
+
const r = e, n = t, a = (s) => {
|
751
|
+
n("change", s.target.checked.toString());
|
752
|
+
};
|
753
|
+
return ne(() => {
|
754
|
+
console.debug(
|
755
|
+
`Hello from PDAP InputCheckbox ${r.name} rendered at ${window.location.pathname}`,
|
756
|
+
{
|
757
|
+
props: r
|
758
|
+
}
|
759
|
+
);
|
760
|
+
}), (s, u) => (v(), b("input", {
|
761
|
+
id: s.id,
|
762
|
+
class: "pdap-input-checkbox",
|
763
|
+
name: s.name,
|
764
|
+
checked: s.defaultChecked,
|
765
|
+
value: s.value,
|
766
|
+
type: "checkbox",
|
767
|
+
onChange: a
|
768
|
+
}, null, 40, Tt));
|
769
|
+
}
|
770
|
+
});
|
771
|
+
var pe = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.TEXT = "text", e))(pe || {});
|
772
|
+
const Vt = {
|
773
|
+
[pe.CHECKBOX]: "InputCheckbox",
|
774
|
+
[pe.TEXT]: "InputText"
|
775
|
+
}, Dt = {
|
776
|
+
name: "InputsGenerator",
|
777
|
+
components: { InputText: At, InputCheckbox: Lt, PdapInput: It },
|
778
|
+
props: {
|
779
|
+
schema: { type: Object },
|
780
|
+
values: { type: Object },
|
781
|
+
v$: {
|
782
|
+
type: Object
|
783
|
+
}
|
784
|
+
},
|
785
|
+
emits: ["blur", "input"],
|
786
|
+
setup(e, { emit: t }) {
|
787
|
+
t("input"), t("blur");
|
788
|
+
},
|
789
|
+
data() {
|
790
|
+
return {
|
791
|
+
formData: this.values || {},
|
792
|
+
INPUT_COMPONENT_MAP: Vt,
|
793
|
+
v: this.$props.v$
|
794
|
+
};
|
795
|
+
},
|
796
|
+
methods: {
|
797
|
+
updateForm(e, t) {
|
798
|
+
this.formData[e] = t, this.$emit("input", this.formData);
|
799
|
+
},
|
800
|
+
updateValidations(e) {
|
801
|
+
var t, r;
|
802
|
+
(r = (t = this.v$) == null ? void 0 : t.value) == null || r[e].$touch;
|
803
|
+
}
|
804
|
+
}
|
805
|
+
}, kt = (e, t) => {
|
806
|
+
const r = e.__vccOpts || e;
|
807
|
+
for (const [n, a] of t)
|
808
|
+
r[n] = a;
|
809
|
+
return r;
|
810
|
+
};
|
811
|
+
function zt(e, t, r, n, a, s) {
|
812
|
+
const u = Le("PdapInput");
|
813
|
+
return v(!0), b(Q, null, fe(r.schema, (i) => {
|
814
|
+
var c, l, p, f;
|
815
|
+
return v(), j(u, {
|
816
|
+
id: i.id,
|
817
|
+
key: i.name,
|
818
|
+
error: (f = (p = (l = (c = a.v) == null ? void 0 : c[i.name]) == null ? void 0 : l.$errors) == null ? void 0 : p[0]) == null ? void 0 : f.$message,
|
819
|
+
name: i.name,
|
820
|
+
label: i.label
|
821
|
+
}, {
|
822
|
+
default: I(() => [
|
823
|
+
(v(), j(re(a.INPUT_COMPONENT_MAP[i.type]), Qe(i, {
|
824
|
+
value: a.formData[i.name],
|
825
|
+
onBlur: (g) => s.updateValidations(i.name),
|
826
|
+
onInput: (g) => s.updateForm(i.name, g)
|
827
|
+
}), null, 16, ["value", "onBlur", "onInput"]))
|
828
|
+
]),
|
829
|
+
_: 2
|
830
|
+
}, 1032, ["id", "error", "name", "label"]);
|
831
|
+
}), 128);
|
832
|
+
}
|
833
|
+
const St = /* @__PURE__ */ kt(Dt, [["render", zt]]);
|
834
|
+
function Ie(e, t) {
|
835
|
+
var r = Object.keys(e);
|
836
|
+
if (Object.getOwnPropertySymbols) {
|
837
|
+
var n = Object.getOwnPropertySymbols(e);
|
838
|
+
t && (n = n.filter(function(a) {
|
839
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
840
|
+
})), r.push.apply(r, n);
|
841
|
+
}
|
842
|
+
return r;
|
843
|
+
}
|
844
|
+
function F(e) {
|
845
|
+
for (var t = 1; t < arguments.length; t++) {
|
846
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
847
|
+
t % 2 ? Ie(Object(r), !0).forEach(function(n) {
|
848
|
+
Mt(e, n, r[n]);
|
849
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ie(Object(r)).forEach(function(n) {
|
850
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
851
|
+
});
|
852
|
+
}
|
853
|
+
return e;
|
854
|
+
}
|
855
|
+
function Mt(e, t, r) {
|
856
|
+
return t in e ? Object.defineProperty(e, t, {
|
857
|
+
value: r,
|
858
|
+
enumerable: !0,
|
859
|
+
configurable: !0,
|
860
|
+
writable: !0
|
861
|
+
}) : e[t] = r, e;
|
862
|
+
}
|
863
|
+
function W(e) {
|
864
|
+
return typeof e == "function";
|
865
|
+
}
|
866
|
+
function te(e) {
|
867
|
+
return e !== null && typeof e == "object" && !Array.isArray(e);
|
868
|
+
}
|
869
|
+
function ae(e) {
|
870
|
+
return W(e.$validator) ? F({}, e) : {
|
871
|
+
$validator: e
|
872
|
+
};
|
873
|
+
}
|
874
|
+
function Nt(e) {
|
875
|
+
return te(e) && W(e.then);
|
876
|
+
}
|
877
|
+
function V(e) {
|
878
|
+
return typeof e == "object" ? e.$valid : e;
|
879
|
+
}
|
880
|
+
function M(e) {
|
881
|
+
return e.$validator || e;
|
882
|
+
}
|
883
|
+
function he(e, t) {
|
884
|
+
if (!te(e))
|
885
|
+
throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof e}`);
|
886
|
+
if (!te(t) && !W(t))
|
887
|
+
throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");
|
888
|
+
const r = ae(t);
|
889
|
+
return r.$params = F(F({}, r.$params || {}), e), r;
|
890
|
+
}
|
891
|
+
function K(e, t) {
|
892
|
+
if (!W(e) && typeof d(e) != "string")
|
893
|
+
throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof e}`);
|
894
|
+
if (!te(t) && !W(t))
|
895
|
+
throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");
|
896
|
+
const r = ae(t);
|
897
|
+
return r.$message = e, r;
|
898
|
+
}
|
899
|
+
function qt(e) {
|
900
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
901
|
+
const r = ae(e);
|
902
|
+
return F(F({}, r), {}, {
|
903
|
+
$async: !0,
|
904
|
+
$watchTargets: t
|
905
|
+
});
|
906
|
+
}
|
907
|
+
function Ft(e) {
|
908
|
+
return {
|
909
|
+
$validator(t) {
|
910
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
|
911
|
+
n[a - 1] = arguments[a];
|
912
|
+
return d(t).reduce((s, u, i) => {
|
913
|
+
const c = Object.entries(u).reduce((l, p) => {
|
914
|
+
let [f, g] = p;
|
915
|
+
const h = e[f] || {}, o = Object.entries(h).reduce((m, $) => {
|
916
|
+
let [_, N] = $;
|
917
|
+
const R = M(N).call(this, g, u, i, ...n), k = V(R);
|
918
|
+
if (m.$data[_] = R, m.$data.$invalid = !k || !!m.$data.$invalid, m.$data.$error = m.$data.$invalid, !k) {
|
919
|
+
let A = N.$message || "";
|
920
|
+
const X = N.$params || {};
|
921
|
+
typeof A == "function" && (A = A({
|
922
|
+
$pending: !1,
|
923
|
+
$invalid: !k,
|
924
|
+
$params: X,
|
925
|
+
$model: g,
|
926
|
+
$response: R
|
927
|
+
})), m.$errors.push({
|
928
|
+
$property: f,
|
929
|
+
$message: A,
|
930
|
+
$params: X,
|
931
|
+
$response: R,
|
932
|
+
$model: g,
|
933
|
+
$pending: !1,
|
934
|
+
$validator: _
|
935
|
+
});
|
936
|
+
}
|
937
|
+
return {
|
938
|
+
$valid: m.$valid && k,
|
939
|
+
$data: m.$data,
|
940
|
+
$errors: m.$errors
|
941
|
+
};
|
942
|
+
}, {
|
943
|
+
$valid: !0,
|
944
|
+
$data: {},
|
945
|
+
$errors: []
|
946
|
+
});
|
947
|
+
return l.$data[f] = o.$data, l.$errors[f] = o.$errors, {
|
948
|
+
$valid: l.$valid && o.$valid,
|
949
|
+
$data: l.$data,
|
950
|
+
$errors: l.$errors
|
951
|
+
};
|
952
|
+
}, {
|
953
|
+
$valid: !0,
|
954
|
+
$data: {},
|
955
|
+
$errors: {}
|
956
|
+
});
|
957
|
+
return {
|
958
|
+
$valid: s.$valid && c.$valid,
|
959
|
+
$data: s.$data.concat(c.$data),
|
960
|
+
$errors: s.$errors.concat(c.$errors)
|
961
|
+
};
|
962
|
+
}, {
|
963
|
+
$valid: !0,
|
964
|
+
$data: [],
|
965
|
+
$errors: []
|
966
|
+
});
|
967
|
+
},
|
968
|
+
$message: (t) => {
|
969
|
+
let {
|
970
|
+
$response: r
|
971
|
+
} = t;
|
972
|
+
return r ? r.$errors.map((n) => Object.values(n).map((a) => a.map((s) => s.$message)).reduce((a, s) => a.concat(s), [])) : [];
|
973
|
+
}
|
974
|
+
};
|
975
|
+
}
|
976
|
+
const O = (e) => {
|
977
|
+
if (e = d(e), Array.isArray(e))
|
978
|
+
return !!e.length;
|
979
|
+
if (e == null)
|
980
|
+
return !1;
|
981
|
+
if (e === !1)
|
982
|
+
return !0;
|
983
|
+
if (e instanceof Date)
|
984
|
+
return !isNaN(e.getTime());
|
985
|
+
if (typeof e == "object") {
|
986
|
+
for (let t in e)
|
987
|
+
return !0;
|
988
|
+
return !1;
|
989
|
+
}
|
990
|
+
return !!String(e).length;
|
991
|
+
}, ve = (e) => (e = d(e), Array.isArray(e) ? e.length : typeof e == "object" ? Object.keys(e).length : String(e).length);
|
992
|
+
function D() {
|
993
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
994
|
+
t[r] = arguments[r];
|
995
|
+
return (n) => (n = d(n), !O(n) || t.every((a) => (a.lastIndex = 0, a.test(n))));
|
996
|
+
}
|
997
|
+
var ye = /* @__PURE__ */ Object.freeze({
|
998
|
+
__proto__: null,
|
999
|
+
forEach: Ft,
|
1000
|
+
len: ve,
|
1001
|
+
normalizeValidatorObject: ae,
|
1002
|
+
regex: D,
|
1003
|
+
req: O,
|
1004
|
+
unwrap: d,
|
1005
|
+
unwrapNormalizedValidator: M,
|
1006
|
+
unwrapValidatorResponse: V,
|
1007
|
+
withAsync: qt,
|
1008
|
+
withMessage: K,
|
1009
|
+
withParams: he
|
1010
|
+
}), Ht = D(/^[a-zA-Z]*$/), Bt = {
|
1011
|
+
$validator: Ht,
|
1012
|
+
$message: "The value is not alphabetical",
|
1013
|
+
$params: {
|
1014
|
+
type: "alpha"
|
1015
|
+
}
|
1016
|
+
}, Gt = D(/^[a-zA-Z0-9]*$/), Ut = {
|
1017
|
+
$validator: Gt,
|
1018
|
+
$message: "The value must be alpha-numeric",
|
1019
|
+
$params: {
|
1020
|
+
type: "alphaNum"
|
1021
|
+
}
|
1022
|
+
}, Wt = D(/^\d*(\.\d+)?$/), Kt = {
|
1023
|
+
$validator: Wt,
|
1024
|
+
$message: "Value must be numeric",
|
1025
|
+
$params: {
|
1026
|
+
type: "numeric"
|
1027
|
+
}
|
1028
|
+
};
|
1029
|
+
function Xt(e, t) {
|
1030
|
+
return (r) => !O(r) || (!/\s/.test(r) || r instanceof Date) && +d(e) <= +r && +d(t) >= +r;
|
1031
|
+
}
|
1032
|
+
function Zt(e, t) {
|
1033
|
+
return {
|
1034
|
+
$validator: Xt(e, t),
|
1035
|
+
$message: (r) => {
|
1036
|
+
let {
|
1037
|
+
$params: n
|
1038
|
+
} = r;
|
1039
|
+
return `The value must be between ${n.min} and ${n.max}`;
|
1040
|
+
},
|
1041
|
+
$params: {
|
1042
|
+
min: e,
|
1043
|
+
max: t,
|
1044
|
+
type: "between"
|
1045
|
+
}
|
1046
|
+
};
|
1047
|
+
}
|
1048
|
+
const Jt = /^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
|
1049
|
+
var Qt = D(Jt), Yt = {
|
1050
|
+
$validator: Qt,
|
1051
|
+
$message: "Value is not a valid email address",
|
1052
|
+
$params: {
|
1053
|
+
type: "email"
|
1054
|
+
}
|
1055
|
+
};
|
1056
|
+
function er(e) {
|
1057
|
+
if (!O(e))
|
1058
|
+
return !0;
|
1059
|
+
if (typeof e != "string")
|
1060
|
+
return !1;
|
1061
|
+
const t = e.split(".");
|
1062
|
+
return t.length === 4 && t.every(tr);
|
1063
|
+
}
|
1064
|
+
const tr = (e) => {
|
1065
|
+
if (e.length > 3 || e.length === 0 || e[0] === "0" && e !== "0" || !e.match(/^\d+$/))
|
1066
|
+
return !1;
|
1067
|
+
const t = +e | 0;
|
1068
|
+
return t >= 0 && t <= 255;
|
1069
|
+
};
|
1070
|
+
var rr = {
|
1071
|
+
$validator: er,
|
1072
|
+
$message: "The value is not a valid IP address",
|
1073
|
+
$params: {
|
1074
|
+
type: "ipAddress"
|
1075
|
+
}
|
1076
|
+
};
|
1077
|
+
function nr() {
|
1078
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ":";
|
1079
|
+
return (t) => {
|
1080
|
+
if (e = d(e), !O(t))
|
1081
|
+
return !0;
|
1082
|
+
if (typeof t != "string")
|
1083
|
+
return !1;
|
1084
|
+
const r = typeof e == "string" && e !== "" ? t.split(e) : t.length === 12 || t.length === 16 ? t.match(/.{2}/g) : null;
|
1085
|
+
return r !== null && (r.length === 6 || r.length === 8) && r.every(ar);
|
1086
|
+
};
|
1087
|
+
}
|
1088
|
+
const ar = (e) => e.toLowerCase().match(/^[0-9a-f]{2}$/);
|
1089
|
+
function sr(e) {
|
1090
|
+
return {
|
1091
|
+
$validator: nr(e),
|
1092
|
+
$message: "The value is not a valid MAC Address",
|
1093
|
+
$params: {
|
1094
|
+
type: "macAddress"
|
1095
|
+
}
|
1096
|
+
};
|
1097
|
+
}
|
1098
|
+
function or(e) {
|
1099
|
+
return (t) => !O(t) || ve(t) <= d(e);
|
1100
|
+
}
|
1101
|
+
function ir(e) {
|
1102
|
+
return {
|
1103
|
+
$validator: or(e),
|
1104
|
+
$message: (t) => {
|
1105
|
+
let {
|
1106
|
+
$params: r
|
1107
|
+
} = t;
|
1108
|
+
return `The maximum length allowed is ${r.max}`;
|
1109
|
+
},
|
1110
|
+
$params: {
|
1111
|
+
max: e,
|
1112
|
+
type: "maxLength"
|
1113
|
+
}
|
1114
|
+
};
|
1115
|
+
}
|
1116
|
+
function ur(e) {
|
1117
|
+
return (t) => !O(t) || ve(t) >= d(e);
|
1118
|
+
}
|
1119
|
+
function lr(e) {
|
1120
|
+
return {
|
1121
|
+
$validator: ur(e),
|
1122
|
+
$message: (t) => {
|
1123
|
+
let {
|
1124
|
+
$params: r
|
1125
|
+
} = t;
|
1126
|
+
return `This field should be at least ${r.min} characters long`;
|
1127
|
+
},
|
1128
|
+
$params: {
|
1129
|
+
min: e,
|
1130
|
+
type: "minLength"
|
1131
|
+
}
|
1132
|
+
};
|
1133
|
+
}
|
1134
|
+
function cr(e) {
|
1135
|
+
return typeof e == "string" && (e = e.trim()), O(e);
|
1136
|
+
}
|
1137
|
+
var _e = {
|
1138
|
+
$validator: cr,
|
1139
|
+
$message: "Value is required",
|
1140
|
+
$params: {
|
1141
|
+
type: "required"
|
1142
|
+
}
|
1143
|
+
};
|
1144
|
+
const je = (e, t) => e ? O(typeof t == "string" ? t.trim() : t) : !0;
|
1145
|
+
function dr(e) {
|
1146
|
+
return function(t, r) {
|
1147
|
+
if (typeof e != "function")
|
1148
|
+
return je(d(e), t);
|
1149
|
+
const n = e.call(this, t, r);
|
1150
|
+
return je(n, t);
|
1151
|
+
};
|
1152
|
+
}
|
1153
|
+
function pr(e) {
|
1154
|
+
return {
|
1155
|
+
$validator: dr(e),
|
1156
|
+
$message: "The value is required",
|
1157
|
+
$params: {
|
1158
|
+
type: "requiredIf",
|
1159
|
+
prop: e
|
1160
|
+
}
|
1161
|
+
};
|
1162
|
+
}
|
1163
|
+
const Ae = (e, t) => e ? !0 : O(typeof t == "string" ? t.trim() : t);
|
1164
|
+
function mr(e) {
|
1165
|
+
return function(t, r) {
|
1166
|
+
if (typeof e != "function")
|
1167
|
+
return Ae(d(e), t);
|
1168
|
+
const n = e.call(this, t, r);
|
1169
|
+
return Ae(n, t);
|
1170
|
+
};
|
1171
|
+
}
|
1172
|
+
function fr(e) {
|
1173
|
+
return {
|
1174
|
+
$validator: mr(e),
|
1175
|
+
$message: "The value is required",
|
1176
|
+
$params: {
|
1177
|
+
type: "requiredUnless",
|
1178
|
+
prop: e
|
1179
|
+
}
|
1180
|
+
};
|
1181
|
+
}
|
1182
|
+
function $r(e) {
|
1183
|
+
return (t) => d(t) === d(e);
|
1184
|
+
}
|
1185
|
+
function gr(e) {
|
1186
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "other";
|
1187
|
+
return {
|
1188
|
+
$validator: $r(e),
|
1189
|
+
$message: (r) => `The value must be equal to the ${t} value`,
|
1190
|
+
$params: {
|
1191
|
+
equalTo: e,
|
1192
|
+
otherName: t,
|
1193
|
+
type: "sameAs"
|
1194
|
+
}
|
1195
|
+
};
|
1196
|
+
}
|
1197
|
+
const hr = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;
|
1198
|
+
var vr = D(hr), yr = {
|
1199
|
+
$validator: vr,
|
1200
|
+
$message: "The value is not a valid URL address",
|
1201
|
+
$params: {
|
1202
|
+
type: "url"
|
1203
|
+
}
|
1204
|
+
};
|
1205
|
+
function _r(e) {
|
1206
|
+
return function() {
|
1207
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1208
|
+
r[n] = arguments[n];
|
1209
|
+
return e.reduce((a, s) => V(a) ? a : M(s).apply(this, r), !1);
|
1210
|
+
};
|
1211
|
+
}
|
1212
|
+
function wr(e) {
|
1213
|
+
return function() {
|
1214
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1215
|
+
r[n] = arguments[n];
|
1216
|
+
return e.reduce(async (a, s) => {
|
1217
|
+
const u = await a;
|
1218
|
+
return V(u) ? u : M(s).apply(this, r);
|
1219
|
+
}, Promise.resolve(!1));
|
1220
|
+
};
|
1221
|
+
}
|
1222
|
+
function br() {
|
1223
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
1224
|
+
t[r] = arguments[r];
|
1225
|
+
const n = t.some((u) => u.$async), a = t.reduce((u, i) => i.$watchTargets ? u.concat(i.$watchTargets) : u, []);
|
1226
|
+
let s = () => !1;
|
1227
|
+
return t.length && (s = n ? wr(t) : _r(t)), {
|
1228
|
+
$async: n,
|
1229
|
+
$validator: s,
|
1230
|
+
$watchTargets: a
|
1231
|
+
};
|
1232
|
+
}
|
1233
|
+
function Pr() {
|
1234
|
+
return he({
|
1235
|
+
type: "or"
|
1236
|
+
}, K("The value does not match any of the provided validators", br(...arguments)));
|
1237
|
+
}
|
1238
|
+
function xr(e) {
|
1239
|
+
return function() {
|
1240
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1241
|
+
r[n] = arguments[n];
|
1242
|
+
return e.reduce((a, s) => V(a) ? M(s).apply(this, r) : a, !0);
|
1243
|
+
};
|
1244
|
+
}
|
1245
|
+
function Or(e) {
|
1246
|
+
return function() {
|
1247
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1248
|
+
r[n] = arguments[n];
|
1249
|
+
return e.reduce(async (a, s) => {
|
1250
|
+
const u = await a;
|
1251
|
+
return V(u) ? M(s).apply(this, r) : u;
|
1252
|
+
}, Promise.resolve(!0));
|
1253
|
+
};
|
1254
|
+
}
|
1255
|
+
function Rr() {
|
1256
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
1257
|
+
t[r] = arguments[r];
|
1258
|
+
const n = t.some((u) => u.$async), a = t.reduce((u, i) => i.$watchTargets ? u.concat(i.$watchTargets) : u, []);
|
1259
|
+
let s = () => !1;
|
1260
|
+
return t.length && (s = n ? Or(t) : xr(t)), {
|
1261
|
+
$async: n,
|
1262
|
+
$validator: s,
|
1263
|
+
$watchTargets: a
|
1264
|
+
};
|
1265
|
+
}
|
1266
|
+
function Cr() {
|
1267
|
+
return he({
|
1268
|
+
type: "and"
|
1269
|
+
}, K("The value does not match all of the provided validators", Rr(...arguments)));
|
1270
|
+
}
|
1271
|
+
function Er(e) {
|
1272
|
+
return function(t, r) {
|
1273
|
+
if (!O(t))
|
1274
|
+
return !0;
|
1275
|
+
const n = M(e).call(this, t, r);
|
1276
|
+
return Nt(n) ? n.then((a) => !V(a)) : !V(n);
|
1277
|
+
};
|
1278
|
+
}
|
1279
|
+
function Ir(e) {
|
1280
|
+
return {
|
1281
|
+
$validator: Er(e),
|
1282
|
+
$message: "The value does not match the provided validator",
|
1283
|
+
$params: {
|
1284
|
+
type: "not"
|
1285
|
+
}
|
1286
|
+
};
|
1287
|
+
}
|
1288
|
+
function jr(e) {
|
1289
|
+
return (t) => !O(t) || (!/\s/.test(t) || t instanceof Date) && +t >= +d(e);
|
1290
|
+
}
|
1291
|
+
function Ar(e) {
|
1292
|
+
return {
|
1293
|
+
$validator: jr(e),
|
1294
|
+
$message: (t) => {
|
1295
|
+
let {
|
1296
|
+
$params: r
|
1297
|
+
} = t;
|
1298
|
+
return `The minimum value allowed is ${r.min}`;
|
1299
|
+
},
|
1300
|
+
$params: {
|
1301
|
+
min: e,
|
1302
|
+
type: "minValue"
|
1303
|
+
}
|
1304
|
+
};
|
1305
|
+
}
|
1306
|
+
function Tr(e) {
|
1307
|
+
return (t) => !O(t) || (!/\s/.test(t) || t instanceof Date) && +t <= +d(e);
|
1308
|
+
}
|
1309
|
+
var Lr = (e) => ({
|
1310
|
+
$validator: Tr(e),
|
1311
|
+
$message: (t) => {
|
1312
|
+
let {
|
1313
|
+
$params: r
|
1314
|
+
} = t;
|
1315
|
+
return `The maximum value allowed is ${r.max}`;
|
1316
|
+
},
|
1317
|
+
$params: {
|
1318
|
+
max: e,
|
1319
|
+
type: "maxValue"
|
1320
|
+
}
|
1321
|
+
}), Vr = D(/(^[0-9]*$)|(^-[0-9]+$)/), Dr = {
|
1322
|
+
$validator: Vr,
|
1323
|
+
$message: "Value is not an integer",
|
1324
|
+
$params: {
|
1325
|
+
type: "integer"
|
1326
|
+
}
|
1327
|
+
}, kr = D(/^[-]?\d*(\.\d+)?$/), zr = {
|
1328
|
+
$validator: kr,
|
1329
|
+
$message: "Value must be decimal",
|
1330
|
+
$params: {
|
1331
|
+
type: "decimal"
|
1332
|
+
}
|
1333
|
+
};
|
1334
|
+
function Sr(e) {
|
1335
|
+
let {
|
1336
|
+
t,
|
1337
|
+
messagePath: r = (a) => {
|
1338
|
+
let {
|
1339
|
+
$validator: s
|
1340
|
+
} = a;
|
1341
|
+
return `validations.${s}`;
|
1342
|
+
},
|
1343
|
+
messageParams: n = (a) => a
|
1344
|
+
} = e;
|
1345
|
+
return function(s) {
|
1346
|
+
let {
|
1347
|
+
withArguments: u = !1,
|
1348
|
+
messagePath: i = r,
|
1349
|
+
messageParams: c = n
|
1350
|
+
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
1351
|
+
function l(p) {
|
1352
|
+
return t(i(p), c(F({
|
1353
|
+
model: p.$model,
|
1354
|
+
property: p.$property,
|
1355
|
+
pending: p.$pending,
|
1356
|
+
invalid: p.$invalid,
|
1357
|
+
response: p.$response,
|
1358
|
+
validator: p.$validator,
|
1359
|
+
propertyPath: p.$propertyPath
|
1360
|
+
}, p.$params)));
|
1361
|
+
}
|
1362
|
+
return u && typeof s == "function" ? function() {
|
1363
|
+
return K(l, s(...arguments));
|
1364
|
+
} : K(l, s);
|
1365
|
+
};
|
1366
|
+
}
|
1367
|
+
const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1368
|
+
__proto__: null,
|
1369
|
+
alpha: Bt,
|
1370
|
+
alphaNum: Ut,
|
1371
|
+
and: Cr,
|
1372
|
+
between: Zt,
|
1373
|
+
createI18nMessage: Sr,
|
1374
|
+
decimal: zr,
|
1375
|
+
email: Yt,
|
1376
|
+
helpers: ye,
|
1377
|
+
integer: Dr,
|
1378
|
+
ipAddress: rr,
|
1379
|
+
macAddress: sr,
|
1380
|
+
maxLength: ir,
|
1381
|
+
maxValue: Lr,
|
1382
|
+
minLength: lr,
|
1383
|
+
minValue: Ar,
|
1384
|
+
not: Ir,
|
1385
|
+
numeric: Kt,
|
1386
|
+
or: Pr,
|
1387
|
+
required: _e,
|
1388
|
+
requiredIf: pr,
|
1389
|
+
requiredUnless: fr,
|
1390
|
+
sameAs: gr,
|
1391
|
+
url: yr
|
1392
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
1393
|
+
function Te(e) {
|
1394
|
+
return ["maxLength", "minLength"].includes(e);
|
1395
|
+
}
|
1396
|
+
function Mr(e, t) {
|
1397
|
+
return {
|
1398
|
+
[e]: Ne[e](t)
|
1399
|
+
};
|
1400
|
+
}
|
1401
|
+
function Nr(e, t, r) {
|
1402
|
+
return {
|
1403
|
+
[e]: ye.withMessage(r, Ne[e](t))
|
1404
|
+
};
|
1405
|
+
}
|
1406
|
+
function qr() {
|
1407
|
+
return { required: _e };
|
1408
|
+
}
|
1409
|
+
function Fr(e) {
|
1410
|
+
return {
|
1411
|
+
required: ye.withMessage(e, _e)
|
1412
|
+
};
|
1413
|
+
}
|
1414
|
+
function Hr(e, t) {
|
1415
|
+
if (Te(e) && typeof t.message == "string" && typeof t.value == "number")
|
1416
|
+
return Nr(
|
1417
|
+
e,
|
1418
|
+
t.value,
|
1419
|
+
t.message
|
1420
|
+
);
|
1421
|
+
if (Te(e) && typeof t.message > "u" && typeof t.value == "number")
|
1422
|
+
return Mr(e, t.value);
|
1423
|
+
if (e === "required" && typeof t.message == "string")
|
1424
|
+
return Fr(t.message);
|
1425
|
+
if (e === "required" && typeof t.message > "u")
|
1426
|
+
return qr();
|
1427
|
+
throw new Error("No valid rule detected");
|
1428
|
+
}
|
1429
|
+
const Br = {
|
1430
|
+
key: 0,
|
1431
|
+
class: "pdap-form-error-message"
|
1432
|
+
}, an = /* @__PURE__ */ C({
|
1433
|
+
__name: "PdapForm",
|
1434
|
+
props: {
|
1435
|
+
error: { default: null },
|
1436
|
+
id: {},
|
1437
|
+
name: {},
|
1438
|
+
schema: {}
|
1439
|
+
},
|
1440
|
+
emits: ["submit"],
|
1441
|
+
setup(e, { emit: t }) {
|
1442
|
+
const r = e, n = t, a = x(
|
1443
|
+
r.schema.reduce((c, l) => {
|
1444
|
+
switch (l.type) {
|
1445
|
+
case "checkbox":
|
1446
|
+
return { ...c, [l.name]: l.defaultChecked };
|
1447
|
+
case "text":
|
1448
|
+
return { ...c, [l.name]: l.value };
|
1449
|
+
default:
|
1450
|
+
return c;
|
1451
|
+
}
|
1452
|
+
}, {})
|
1453
|
+
), s = r.schema.reduce((c, l) => {
|
1454
|
+
const p = Object.entries(l.validators ?? {}).reduce(
|
1455
|
+
(f, [g, h]) => ({
|
1456
|
+
...f,
|
1457
|
+
...Hr(g, h)
|
1458
|
+
}),
|
1459
|
+
{}
|
1460
|
+
);
|
1461
|
+
return {
|
1462
|
+
...c,
|
1463
|
+
[l.name]: {
|
1464
|
+
...p
|
1465
|
+
}
|
1466
|
+
};
|
1467
|
+
}, {}), u = Rt(s, a, { $autoDirty: !1, $lazy: !1 });
|
1468
|
+
ne(
|
1469
|
+
() => console.debug(
|
1470
|
+
`Hello from PDAP Form ${r.name} rendered at ${window.location.pathname}`,
|
1471
|
+
{
|
1472
|
+
props: r,
|
1473
|
+
values: a,
|
1474
|
+
rules: s,
|
1475
|
+
vuelidate: u.value
|
1476
|
+
}
|
1477
|
+
)
|
1478
|
+
);
|
1479
|
+
async function i(c) {
|
1480
|
+
const l = await u.value.$validate();
|
1481
|
+
if (l) {
|
1482
|
+
const p = c.target, f = new FormData(p), g = {};
|
1483
|
+
for (const [h, o] of f)
|
1484
|
+
Object.assign(g, { [h]: o });
|
1485
|
+
console.debug("Hello from Form's onSubmit handler", {
|
1486
|
+
values: g,
|
1487
|
+
isCorrectSubmission: l,
|
1488
|
+
vuelidate: u.value
|
1489
|
+
}), n("submit", g), u.value.$reset(), p.reset();
|
1490
|
+
return;
|
1491
|
+
} else {
|
1492
|
+
console.error("is invalid form data", { v$: u.value });
|
1493
|
+
return;
|
1494
|
+
}
|
1495
|
+
}
|
1496
|
+
return (c, l) => (v(), b("form", {
|
1497
|
+
class: "pdap-form",
|
1498
|
+
onSubmit: l[0] || (l[0] = Ye((p) => i(p), ["prevent"]))
|
1499
|
+
}, [
|
1500
|
+
typeof c.error == "string" && c.error.length > 0 ? (v(), b("div", Br, S(c.error), 1)) : q("", !0),
|
1501
|
+
me(St, et(tt({
|
1502
|
+
schema: c.schema,
|
1503
|
+
values: a.value,
|
1504
|
+
...typeof d(u) < "u" ? { v$: d(u) } : {}
|
1505
|
+
})), null, 16),
|
1506
|
+
B(c.$slots, "default")
|
1507
|
+
], 32));
|
1508
|
+
}
|
1509
|
+
});
|
1510
|
+
const sn = /* @__PURE__ */ C({
|
1511
|
+
__name: "GridContainer",
|
1512
|
+
props: {
|
1513
|
+
columns: { default: "auto" },
|
1514
|
+
component: { default: "div" },
|
1515
|
+
rows: { default: "auto" },
|
1516
|
+
templateColumns: {},
|
1517
|
+
templateRows: {}
|
1518
|
+
},
|
1519
|
+
setup(e) {
|
1520
|
+
const t = e, r = E({
|
1521
|
+
"pdap-grid-container": !0,
|
1522
|
+
[`pdap-grid-container-column-${t.columns}`]: t.columns !== "auto"
|
1523
|
+
}), n = t.templateRows || typeof t.rows == "number", a = t.templateRows ?? `repeat(${t.rows}, minmax(0, 1fr))`, s = E({
|
1524
|
+
...n && {
|
1525
|
+
gridTemplateRows: a
|
1526
|
+
},
|
1527
|
+
...t.templateColumns && { gridTemplateColumns: t.templateColumns }
|
1528
|
+
});
|
1529
|
+
return (u, i) => (v(), j(re(u.component), {
|
1530
|
+
class: H(r),
|
1531
|
+
style: ge(s)
|
1532
|
+
}, {
|
1533
|
+
default: I(() => [
|
1534
|
+
B(u.$slots, "default")
|
1535
|
+
]),
|
1536
|
+
_: 3
|
1537
|
+
}, 8, ["class", "style"]));
|
1538
|
+
}
|
1539
|
+
});
|
1540
|
+
const on = /* @__PURE__ */ C({
|
1541
|
+
__name: "GridItem",
|
1542
|
+
props: {
|
1543
|
+
component: { default: "div" },
|
1544
|
+
spanColumn: { default: 1 },
|
1545
|
+
spanRow: { default: 1 }
|
1546
|
+
},
|
1547
|
+
setup(e) {
|
1548
|
+
const t = e, r = E({
|
1549
|
+
"pdap-grid-item": !0,
|
1550
|
+
[`pdap-grid-item-span-column-${t.spanColumn}`]: t.spanColumn > 1
|
1551
|
+
}), n = E({
|
1552
|
+
// Only add inline property if it is passed and exceeds the default
|
1553
|
+
...t.spanRow > 1 && {
|
1554
|
+
gridRow: `span ${t.spanRow} / span ${t.spanRow}`
|
1555
|
+
}
|
1556
|
+
});
|
1557
|
+
return (a, s) => (v(), j(re(a.component), {
|
1558
|
+
class: H(r),
|
1559
|
+
style: ge(n)
|
1560
|
+
}, {
|
1561
|
+
default: I(() => [
|
1562
|
+
B(a.$slots, "default")
|
1563
|
+
]),
|
1564
|
+
_: 3
|
1565
|
+
}, 8, ["class", "style"]));
|
1566
|
+
}
|
1567
|
+
});
|
1568
|
+
const Gr = /* @__PURE__ */ P("svg", {
|
1569
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1570
|
+
viewBox: "0 0 448 512"
|
1571
|
+
}, [
|
1572
|
+
/* @__PURE__ */ P("path", { d: "M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z" })
|
1573
|
+
], -1), Ur = [
|
1574
|
+
Gr
|
1575
|
+
], Wr = ["aria-expanded"], Kr = ["href"], Xr = /* @__PURE__ */ C({
|
1576
|
+
__name: "PdapNav",
|
1577
|
+
props: {
|
1578
|
+
topPosition: {}
|
1579
|
+
},
|
1580
|
+
setup(e) {
|
1581
|
+
let t = J("navLinks");
|
1582
|
+
typeof t > "u" && (t = [], console.error(
|
1583
|
+
`Hey, PDAP developer
|
1584
|
+
`,
|
1585
|
+
"Did you forget to inject some linkData for the Nav component?"
|
1586
|
+
));
|
1587
|
+
const r = E({
|
1588
|
+
isExpanded: !1,
|
1589
|
+
isMobile: !0
|
1590
|
+
}), n = E({
|
1591
|
+
"pdap-nav": !0
|
1592
|
+
});
|
1593
|
+
Ve(() => {
|
1594
|
+
a(), window.addEventListener("resize", a);
|
1595
|
+
}), $e(() => {
|
1596
|
+
window.removeEventListener("resize", a);
|
1597
|
+
});
|
1598
|
+
async function a() {
|
1599
|
+
window.innerWidth <= 1024 ? r.isMobile = !0 : r.isMobile = !1, await Y();
|
1600
|
+
}
|
1601
|
+
async function s() {
|
1602
|
+
var i, c;
|
1603
|
+
const u = document.querySelector("body");
|
1604
|
+
!r.isExpanded && r.isMobile ? (r.isExpanded = !0, u != null && u.classList.contains("lock-scroll") || (i = document.querySelector("body")) == null || i.classList.add("lock-scroll")) : r.isExpanded && r.isMobile && (r.isExpanded = !1, (c = document.querySelector("body")) == null || c.classList.remove("lock-scroll")), await Y();
|
1605
|
+
}
|
1606
|
+
return (u, i) => (v(), b(Q, null, [
|
1607
|
+
P("div", {
|
1608
|
+
"aria-controls": "nav",
|
1609
|
+
class: "pdap-nav-open-button",
|
1610
|
+
role: "button",
|
1611
|
+
onClick: s
|
1612
|
+
}, Ur),
|
1613
|
+
P("nav", {
|
1614
|
+
id: "nav",
|
1615
|
+
"aria-expanded": r.isMobile && r.isExpanded || !r.isMobile,
|
1616
|
+
class: H(n),
|
1617
|
+
style: ge(r.isMobile ? { top: `${u.topPosition}px` } : {})
|
1618
|
+
}, [
|
1619
|
+
(v(!0), b(Q, null, fe(d(t), (c) => (v(), b("li", {
|
1620
|
+
key: c.text,
|
1621
|
+
class: "pdap-nav-link-container"
|
1622
|
+
}, [
|
1623
|
+
c.href ? (v(), b("a", {
|
1624
|
+
key: 0,
|
1625
|
+
class: "pdap-nav-link",
|
1626
|
+
href: c.href,
|
1627
|
+
target: "_blank",
|
1628
|
+
referrerpolicy: "no-referrer",
|
1629
|
+
onClick: s
|
1630
|
+
}, S(c.text), 9, Kr)) : q("", !0),
|
1631
|
+
c.path ? (v(), j(d(De), {
|
1632
|
+
key: 1,
|
1633
|
+
"active-class": "pdap-nav-link-current",
|
1634
|
+
"exact-active-class": "pdap-nav-link-current-exact",
|
1635
|
+
class: "pdap-nav-link",
|
1636
|
+
to: c.path,
|
1637
|
+
onClick: s
|
1638
|
+
}, {
|
1639
|
+
default: I(() => [
|
1640
|
+
G(S(c.text), 1)
|
1641
|
+
]),
|
1642
|
+
_: 2
|
1643
|
+
}, 1032, ["to"])) : q("", !0)
|
1644
|
+
]))), 128))
|
1645
|
+
], 14, Wr)
|
1646
|
+
], 64));
|
1647
|
+
}
|
1648
|
+
});
|
1649
|
+
const Zr = ["href"], Jr = ["src"], Qr = ["src"], un = /* @__PURE__ */ C({
|
1650
|
+
__name: "PdapHeader",
|
1651
|
+
props: {
|
1652
|
+
logoImageSrc: { default: "node_modules/pdap-design-system/dist/images/lockup.svg" },
|
1653
|
+
logoImageAnchorPath: { default: "/" }
|
1654
|
+
},
|
1655
|
+
setup(e) {
|
1656
|
+
const t = e, r = x(), n = x(null), a = t.logoImageAnchorPath.startsWith("/");
|
1657
|
+
rt(() => {
|
1658
|
+
s(), window.addEventListener("resize", s);
|
1659
|
+
}), $e(() => {
|
1660
|
+
window.removeEventListener("resize", s);
|
1661
|
+
});
|
1662
|
+
function s() {
|
1663
|
+
n.value && (r.value = n.value.offsetHeight);
|
1664
|
+
}
|
1665
|
+
return (u, i) => (v(), b("header", {
|
1666
|
+
ref_key: "el",
|
1667
|
+
ref: n,
|
1668
|
+
class: "pdap-header"
|
1669
|
+
}, [
|
1670
|
+
d(a) ? (v(), j(d(De), {
|
1671
|
+
key: 1,
|
1672
|
+
to: u.logoImageAnchorPath,
|
1673
|
+
class: "logo"
|
1674
|
+
}, {
|
1675
|
+
default: I(() => [
|
1676
|
+
P("img", {
|
1677
|
+
src: u.logoImageSrc,
|
1678
|
+
loading: "lazy",
|
1679
|
+
width: "250",
|
1680
|
+
alt: "Police Data Accessibility Project Logo"
|
1681
|
+
}, null, 8, Qr)
|
1682
|
+
]),
|
1683
|
+
_: 1
|
1684
|
+
}, 8, ["to"])) : (v(), b("a", {
|
1685
|
+
key: 0,
|
1686
|
+
href: u.logoImageAnchorPath,
|
1687
|
+
class: "logo"
|
1688
|
+
}, [
|
1689
|
+
P("img", {
|
1690
|
+
src: u.logoImageSrc,
|
1691
|
+
loading: "lazy",
|
1692
|
+
width: "250",
|
1693
|
+
alt: "Police Data Accessibility Project Logo"
|
1694
|
+
}, null, 8, Jr)
|
1695
|
+
], 8, Zr)),
|
1696
|
+
me(Xr, { "top-position": r.value }, null, 8, ["top-position"])
|
1697
|
+
], 512));
|
1698
|
+
}
|
1699
|
+
});
|
1700
|
+
const Yr = ["alt", "src"], ln = /* @__PURE__ */ C({
|
1701
|
+
__name: "TileIcon",
|
1702
|
+
props: {
|
1703
|
+
imgAltText: {},
|
1704
|
+
imgSrc: {}
|
1705
|
+
},
|
1706
|
+
setup(e) {
|
1707
|
+
return (t, r) => (v(), b("img", {
|
1708
|
+
class: "pdap-tile-icon",
|
1709
|
+
alt: t.imgAltText,
|
1710
|
+
src: t.imgSrc
|
1711
|
+
}, null, 8, Yr));
|
1712
|
+
}
|
1713
|
+
});
|
1714
|
+
export {
|
1715
|
+
rn as Button,
|
1716
|
+
nt as FlexContainer,
|
1717
|
+
nn as Footer,
|
1718
|
+
an as Form,
|
1719
|
+
sn as GridContainer,
|
1720
|
+
on as GridItem,
|
1721
|
+
un as Header,
|
1722
|
+
It as Input,
|
1723
|
+
Lt as InputCheckbox,
|
1724
|
+
At as InputText,
|
1725
|
+
Xr as Nav,
|
1726
|
+
pe as PdapInputTypes,
|
1727
|
+
ln as TileIcon
|
1728
|
+
};
|