pdap-design-system 2.0.3 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +3 -3
- package/dist/index.js +274 -270
- package/dist/utils/vuelidate.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent as j, reactive as C, openBlock as v, createElementBlock as b, normalizeClass as G, renderSlot as K, createBlock as A, resolveDynamicComponent as
|
1
|
+
import { defineComponent as j, reactive as C, openBlock as v, createElementBlock as b, normalizeClass as G, renderSlot as K, createBlock as A, resolveDynamicComponent as me, withCtx as E, inject as J, resolveComponent as Qe, createVNode as Y, createElementVNode as P, Fragment as ee, renderList as fe, unref as d, toDisplayString as D, createCommentVNode as q, createTextVNode as B, getCurrentInstance as Ze, ref as x, onBeforeMount as Ve, watch as X, isRef as ce, onBeforeUnmount as $e, computed as _, isReactive as Je, isReadonly as Ye, provide as be, nextTick as te, mergeProps as de, watchEffect as Pe, withModifiers as et, normalizeStyle as ge, onMounted as tt } from "vue";
|
2
2
|
import { RouterLink as Se, useRouter as rt } from "vue-router";
|
3
3
|
const nt = /* @__PURE__ */ j({
|
4
4
|
__name: "PdapButton",
|
@@ -30,7 +30,7 @@ const ke = /* @__PURE__ */ j({
|
|
30
30
|
"pdap-flex-container": !0,
|
31
31
|
[`pdap-flex-container-${e.alignment}`]: !0
|
32
32
|
});
|
33
|
-
return (n, a) => (v(), A(
|
33
|
+
return (n, a) => (v(), A(me(n.component), {
|
34
34
|
class: G(r)
|
35
35
|
}, {
|
36
36
|
default: E(() => [
|
@@ -56,7 +56,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
56
56
|
target: "_blank"
|
57
57
|
}, [
|
58
58
|
/* @__PURE__ */ P("img", { src: "https://widgets.guidestar.org/gximage2?o=9973356&l=v4" })
|
59
|
-
], -1), dt = ["href"], pt = ["src"],
|
59
|
+
], -1), dt = ["href"], pt = ["src"], mt = ["src"], Zr = /* @__PURE__ */ j({
|
60
60
|
__name: "PdapFooter",
|
61
61
|
props: {
|
62
62
|
logoImageSrc: { default: "node_modules/pdap-design-system/dist/images/acronym.svg" },
|
@@ -82,31 +82,31 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
82
82
|
}
|
83
83
|
]), n = t.logoImageAnchorPath.startsWith("/");
|
84
84
|
return (a, s) => {
|
85
|
-
const
|
85
|
+
const u = Qe("router-link");
|
86
86
|
return v(), b("footer", at, [
|
87
87
|
Y(ke, { alignment: "center" }, {
|
88
88
|
default: E(() => [
|
89
89
|
P("ul", st, [
|
90
|
-
(v(!0), b(ee, null,
|
91
|
-
key:
|
90
|
+
(v(!0), b(ee, null, fe(d(r), (i) => (v(), b("li", {
|
91
|
+
key: i.text,
|
92
92
|
class: "pdap-footer-link-container"
|
93
93
|
}, [
|
94
|
-
|
94
|
+
i.href ? (v(), b("a", {
|
95
95
|
key: 0,
|
96
96
|
class: "pdap-footer-social-link",
|
97
|
-
href:
|
97
|
+
href: i.href,
|
98
98
|
target: "_blank",
|
99
99
|
referrerpolicy: "no-referrer"
|
100
|
-
}, D(
|
101
|
-
|
100
|
+
}, D(i.text), 9, ot)) : q("", !0),
|
101
|
+
i.path ? (v(), A(u, {
|
102
102
|
key: 1,
|
103
103
|
"active-class": "pdap-footer-social-link-current",
|
104
104
|
"exact-active-class": "pdap-footer-social-link-current-exact",
|
105
105
|
class: "pdap-footer-social-link",
|
106
|
-
to:
|
106
|
+
to: i.path
|
107
107
|
}, {
|
108
108
|
default: E(() => [
|
109
|
-
B(D(
|
109
|
+
B(D(i.text), 1)
|
110
110
|
]),
|
111
111
|
_: 2
|
112
112
|
}, 1032, ["to"])) : q("", !0)
|
@@ -116,7 +116,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
116
116
|
ut,
|
117
117
|
P("div", lt, [
|
118
118
|
ct,
|
119
|
-
|
119
|
+
d(n) ? (v(), A(u, {
|
120
120
|
key: 1,
|
121
121
|
to: a.logoImageAnchorPath,
|
122
122
|
class: "pdap-footer-logo"
|
@@ -127,7 +127,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
127
127
|
loading: "lazy",
|
128
128
|
width: "250",
|
129
129
|
alt: "Police Data Accessibility Project Logo"
|
130
|
-
}, null, 8,
|
130
|
+
}, null, 8, mt)
|
131
131
|
]),
|
132
132
|
_: 1
|
133
133
|
}, 8, ["to"])) : (v(), b("a", {
|
@@ -164,14 +164,14 @@ function V(e) {
|
|
164
164
|
for (var t = 1; t < arguments.length; t++) {
|
165
165
|
var r = arguments[t] != null ? arguments[t] : {};
|
166
166
|
t % 2 ? xe(Object(r), !0).forEach(function(n) {
|
167
|
-
|
167
|
+
ft(e, n, r[n]);
|
168
168
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
|
169
169
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
170
170
|
});
|
171
171
|
}
|
172
172
|
return e;
|
173
173
|
}
|
174
|
-
function
|
174
|
+
function ft(e, t, r) {
|
175
175
|
return t in e ? Object.defineProperty(e, t, {
|
176
176
|
value: r,
|
177
177
|
enumerable: !0,
|
@@ -181,7 +181,7 @@ function mt(e, t, r) {
|
|
181
181
|
}
|
182
182
|
function Re(e) {
|
183
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] =
|
184
|
+
return Object.keys(e).reduce((r, n) => (t.includes(n) || (r[n] = d(e[n])), r), {});
|
185
185
|
}
|
186
186
|
function re(e) {
|
187
187
|
return typeof e == "function";
|
@@ -213,24 +213,24 @@ function Oe(e, t, r) {
|
|
213
213
|
}, []));
|
214
214
|
}
|
215
215
|
function Me(e, t, r, n) {
|
216
|
-
return e.call(n,
|
216
|
+
return e.call(n, d(t), d(r), n);
|
217
217
|
}
|
218
218
|
function De(e) {
|
219
219
|
return e.$valid !== void 0 ? !e.$valid : !e;
|
220
220
|
}
|
221
|
-
function gt(e, t, r, n, a, s,
|
221
|
+
function gt(e, t, r, n, a, s, u) {
|
222
222
|
let {
|
223
|
-
$lazy:
|
223
|
+
$lazy: i,
|
224
224
|
$rewardEarly: l
|
225
|
-
} = a,
|
225
|
+
} = a, c = 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
226
|
const h = x(!!n.value), o = x(0);
|
227
227
|
r.value = !1;
|
228
|
-
const
|
229
|
-
if (
|
228
|
+
const m = X([t, n].concat(c, g), () => {
|
229
|
+
if (i && !n.value || l && !f.value && !r.value)
|
230
230
|
return;
|
231
231
|
let $;
|
232
232
|
try {
|
233
|
-
$ = Me(e, t,
|
233
|
+
$ = Me(e, t, p, u);
|
234
234
|
} catch (y) {
|
235
235
|
$ = Promise.reject(y);
|
236
236
|
}
|
@@ -245,20 +245,20 @@ function gt(e, t, r, n, a, s, i) {
|
|
245
245
|
});
|
246
246
|
return {
|
247
247
|
$invalid: h,
|
248
|
-
$unwatch:
|
248
|
+
$unwatch: m
|
249
249
|
};
|
250
250
|
}
|
251
|
-
function ht(e, t, r, n, a, s,
|
251
|
+
function ht(e, t, r, n, a, s, u, i) {
|
252
252
|
let {
|
253
253
|
$lazy: l,
|
254
|
-
$rewardEarly:
|
254
|
+
$rewardEarly: c
|
255
255
|
} = n;
|
256
|
-
const
|
257
|
-
if (l && !r.value ||
|
256
|
+
const p = () => ({}), f = _(() => {
|
257
|
+
if (l && !r.value || c && !i.value)
|
258
258
|
return !1;
|
259
259
|
let g = !0;
|
260
260
|
try {
|
261
|
-
const h = Me(e, t,
|
261
|
+
const h = Me(e, t, u, s);
|
262
262
|
a.value = h, g = De(h);
|
263
263
|
} catch (h) {
|
264
264
|
a.value = h;
|
@@ -266,137 +266,137 @@ function ht(e, t, r, n, a, s, i, u) {
|
|
266
266
|
return g;
|
267
267
|
});
|
268
268
|
return {
|
269
|
-
$unwatch:
|
270
|
-
$invalid:
|
269
|
+
$unwatch: p,
|
270
|
+
$invalid: f
|
271
271
|
};
|
272
272
|
}
|
273
|
-
function vt(e, t, r, n, a, s,
|
274
|
-
const
|
275
|
-
let o,
|
273
|
+
function vt(e, t, r, n, a, s, u, i, l, c, p) {
|
274
|
+
const f = x(!1), g = e.$params || {}, h = x(null);
|
275
|
+
let o, m;
|
276
276
|
e.$async ? {
|
277
277
|
$invalid: o,
|
278
|
-
$unwatch:
|
279
|
-
} = gt(e.$validator, t,
|
278
|
+
$unwatch: m
|
279
|
+
} = gt(e.$validator, t, f, r, n, h, a, e.$watchTargets, l, c, p) : {
|
280
280
|
$invalid: o,
|
281
|
-
$unwatch:
|
282
|
-
} = ht(e.$validator, t, r, n, h, a, l,
|
281
|
+
$unwatch: m
|
282
|
+
} = ht(e.$validator, t, r, n, h, a, l, c);
|
283
283
|
const $ = e.$message;
|
284
284
|
return {
|
285
285
|
$message: re($) ? _(() => $(Re({
|
286
|
-
$pending:
|
286
|
+
$pending: f,
|
287
287
|
$invalid: o,
|
288
288
|
$params: Re(g),
|
289
289
|
$model: t,
|
290
290
|
$response: h,
|
291
291
|
$validator: s,
|
292
|
-
$propertyPath:
|
293
|
-
$property:
|
292
|
+
$propertyPath: i,
|
293
|
+
$property: u
|
294
294
|
}))) : $ || "",
|
295
295
|
$params: g,
|
296
|
-
$pending:
|
296
|
+
$pending: f,
|
297
297
|
$invalid: o,
|
298
298
|
$response: h,
|
299
|
-
$unwatch:
|
299
|
+
$unwatch: m
|
300
300
|
};
|
301
301
|
}
|
302
302
|
function yt() {
|
303
303
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
304
|
-
const t =
|
305
|
-
let
|
306
|
-
return r.forEach((
|
307
|
-
const l = t[
|
304
|
+
const t = d(e), r = Object.keys(t), n = {}, a = {}, s = {};
|
305
|
+
let u = null;
|
306
|
+
return r.forEach((i) => {
|
307
|
+
const l = t[i];
|
308
308
|
switch (!0) {
|
309
309
|
case re(l.$validator):
|
310
|
-
n[
|
310
|
+
n[i] = l;
|
311
311
|
break;
|
312
312
|
case re(l):
|
313
|
-
n[
|
313
|
+
n[i] = {
|
314
314
|
$validator: l
|
315
315
|
};
|
316
316
|
break;
|
317
|
-
case
|
318
|
-
|
317
|
+
case i === "$validationGroups":
|
318
|
+
u = l;
|
319
319
|
break;
|
320
|
-
case
|
321
|
-
s[
|
320
|
+
case i.startsWith("$"):
|
321
|
+
s[i] = l;
|
322
322
|
break;
|
323
323
|
default:
|
324
|
-
a[
|
324
|
+
a[i] = l;
|
325
325
|
}
|
326
326
|
}), {
|
327
327
|
rules: n,
|
328
328
|
nestedValidators: a,
|
329
329
|
config: s,
|
330
|
-
validationGroups:
|
330
|
+
validationGroups: u
|
331
331
|
};
|
332
332
|
}
|
333
333
|
const _t = "__root";
|
334
|
-
function wt(e, t, r, n, a, s,
|
335
|
-
const
|
336
|
-
if (
|
337
|
-
if (!
|
338
|
-
return
|
339
|
-
|
334
|
+
function wt(e, t, r, n, a, s, u, i, l) {
|
335
|
+
const c = 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
340
|
}
|
341
341
|
const o = {
|
342
|
-
$dirty:
|
342
|
+
$dirty: f,
|
343
343
|
$path: a,
|
344
344
|
$touch: () => {
|
345
|
-
|
345
|
+
f.value || (f.value = !0);
|
346
346
|
},
|
347
347
|
$reset: () => {
|
348
|
-
|
348
|
+
f.value && (f.value = !1);
|
349
349
|
},
|
350
350
|
$commit: () => {
|
351
351
|
}
|
352
352
|
};
|
353
|
-
return
|
354
|
-
o[
|
355
|
-
}), o.$externalResults = _(() =>
|
353
|
+
return c.length ? (c.forEach((m) => {
|
354
|
+
o[m] = vt(e[m], t, o.$dirty, s, u, m, r, a, l, g, h);
|
355
|
+
}), o.$externalResults = _(() => i.value ? [].concat(i.value).map((m, $) => ({
|
356
356
|
$propertyPath: a,
|
357
357
|
$property: r,
|
358
358
|
$validator: "$externalResults",
|
359
359
|
$uid: `${a}-externalResult-${$}`,
|
360
|
-
$message:
|
360
|
+
$message: m,
|
361
361
|
$params: {},
|
362
362
|
$response: null,
|
363
363
|
$pending: !1
|
364
364
|
})) : []), o.$invalid = _(() => {
|
365
|
-
const
|
366
|
-
return g.value =
|
367
|
-
}), o.$pending = _(() =>
|
368
|
-
const $ = o[
|
365
|
+
const m = c.some(($) => d(o[$].$invalid));
|
366
|
+
return g.value = m, !!o.$externalResults.value.length || m;
|
367
|
+
}), o.$pending = _(() => c.some((m) => d(o[m].$pending))), o.$error = _(() => o.$dirty.value ? o.$pending.value || o.$invalid.value : !1), o.$silentErrors = _(() => c.filter((m) => d(o[m].$invalid)).map((m) => {
|
368
|
+
const $ = o[m];
|
369
369
|
return C({
|
370
370
|
$propertyPath: a,
|
371
371
|
$property: r,
|
372
|
-
$validator:
|
373
|
-
$uid: `${a}-${
|
372
|
+
$validator: m,
|
373
|
+
$uid: `${a}-${m}`,
|
374
374
|
$message: $.$message,
|
375
375
|
$params: $.$params,
|
376
376
|
$response: $.$response,
|
377
377
|
$pending: $.$pending
|
378
378
|
});
|
379
|
-
}).concat(o.$externalResults.value)), o.$errors = _(() => o.$dirty.value ? o.$silentErrors.value : []), o.$unwatch = () =>
|
380
|
-
o[
|
379
|
+
}).concat(o.$externalResults.value)), o.$errors = _(() => o.$dirty.value ? o.$silentErrors.value : []), o.$unwatch = () => c.forEach((m) => {
|
380
|
+
o[m].$unwatch();
|
381
381
|
}), o.$commit = () => {
|
382
382
|
g.value = !0, h.value = Date.now();
|
383
|
-
}, n.set(a, e, o), o) : (
|
383
|
+
}, n.set(a, e, o), o) : (p && n.set(a, e, o), o);
|
384
384
|
}
|
385
|
-
function bt(e, t, r, n, a, s,
|
386
|
-
const
|
387
|
-
return
|
388
|
-
validations: e[
|
385
|
+
function bt(e, t, r, n, a, s, u) {
|
386
|
+
const i = Object.keys(e);
|
387
|
+
return i.length ? i.reduce((l, c) => (l[c] = pe({
|
388
|
+
validations: e[c],
|
389
389
|
state: t,
|
390
|
-
key:
|
390
|
+
key: c,
|
391
391
|
parentKey: r,
|
392
392
|
resultsCache: n,
|
393
393
|
globalConfig: a,
|
394
394
|
instance: s,
|
395
|
-
externalResults:
|
395
|
+
externalResults: u
|
396
396
|
}), l), {}) : {};
|
397
397
|
}
|
398
398
|
function Pt(e, t, r) {
|
399
|
-
const n = _(() => [t, r].filter((o) => o).reduce((o,
|
399
|
+
const n = _(() => [t, r].filter((o) => o).reduce((o, m) => o.concat(Object.values(d(m))), [])), a = _({
|
400
400
|
get() {
|
401
401
|
return e.$dirty.value || (n.value.length ? n.value.every((o) => o.$dirty) : !1);
|
402
402
|
},
|
@@ -404,12 +404,12 @@ function Pt(e, t, r) {
|
|
404
404
|
e.$dirty.value = o;
|
405
405
|
}
|
406
406
|
}), s = _(() => {
|
407
|
-
const o =
|
408
|
-
return o.concat(
|
409
|
-
}),
|
410
|
-
const o =
|
411
|
-
return o.concat(
|
412
|
-
}),
|
407
|
+
const o = d(e.$silentErrors) || [], m = n.value.filter(($) => (d($).$silentErrors || []).length).reduce(($, y) => $.concat(...y.$silentErrors), []);
|
408
|
+
return o.concat(m);
|
409
|
+
}), u = _(() => {
|
410
|
+
const o = d(e.$errors) || [], m = n.value.filter(($) => (d($).$errors || []).length).reduce(($, y) => $.concat(...y.$errors), []);
|
411
|
+
return o.concat(m);
|
412
|
+
}), i = _(() => n.value.some((o) => o.$invalid) || d(e.$invalid) || !1), l = _(() => n.value.some((o) => d(o.$pending)) || d(e.$pending) || !1), c = _(() => n.value.some((o) => o.$dirty) || n.value.some((o) => o.$anyDirty) || a.value), p = _(() => a.value ? l.value || i.value : !1), f = () => {
|
413
413
|
e.$touch(), n.value.forEach((o) => {
|
414
414
|
o.$touch();
|
415
415
|
});
|
@@ -422,14 +422,14 @@ function Pt(e, t, r) {
|
|
422
422
|
o.$reset();
|
423
423
|
});
|
424
424
|
};
|
425
|
-
return n.value.length && n.value.every((o) => o.$dirty) &&
|
425
|
+
return n.value.length && n.value.every((o) => o.$dirty) && f(), {
|
426
426
|
$dirty: a,
|
427
|
-
$errors:
|
428
|
-
$invalid:
|
429
|
-
$anyDirty:
|
430
|
-
$error:
|
427
|
+
$errors: u,
|
428
|
+
$invalid: i,
|
429
|
+
$anyDirty: c,
|
430
|
+
$error: p,
|
431
431
|
$pending: l,
|
432
|
-
$touch:
|
432
|
+
$touch: f,
|
433
433
|
$reset: h,
|
434
434
|
$silentErrors: s,
|
435
435
|
$commit: g
|
@@ -442,23 +442,23 @@ function pe(e) {
|
|
442
442
|
key: n,
|
443
443
|
parentKey: a,
|
444
444
|
childResults: s,
|
445
|
-
resultsCache:
|
446
|
-
globalConfig:
|
445
|
+
resultsCache: u,
|
446
|
+
globalConfig: i = {},
|
447
447
|
instance: l,
|
448
|
-
externalResults:
|
448
|
+
externalResults: c
|
449
449
|
} = e;
|
450
|
-
const
|
451
|
-
rules:
|
450
|
+
const p = a ? `${a}.${n}` : n, {
|
451
|
+
rules: f,
|
452
452
|
nestedValidators: g,
|
453
453
|
config: h,
|
454
454
|
validationGroups: o
|
455
|
-
} = yt(t),
|
456
|
-
const w =
|
457
|
-
return w ?
|
458
|
-
}) : r, y = V({}, c
|
459
|
-
const w = c
|
460
|
-
return n ? w ?
|
461
|
-
}), se = wt(
|
455
|
+
} = yt(t), m = V(V({}, i), h), $ = n ? _(() => {
|
456
|
+
const w = d(r);
|
457
|
+
return w ? d(w[n]) : void 0;
|
458
|
+
}) : r, y = V({}, d(c) || {}), F = _(() => {
|
459
|
+
const w = d(c);
|
460
|
+
return n ? w ? d(w[n]) : void 0 : w;
|
461
|
+
}), se = wt(f, $, n, u, p, m, l, F, r), O = bt(g, $, p, u, m, l, F), z = {};
|
462
462
|
o && Object.entries(o).forEach((w) => {
|
463
463
|
let [M, L] = w;
|
464
464
|
z[M] = {
|
@@ -481,22 +481,22 @@ function pe(e) {
|
|
481
481
|
$silentErrors: Ge,
|
482
482
|
$commit: we
|
483
483
|
} = Pt(se, O, s), Xe = n ? _({
|
484
|
-
get: () =>
|
484
|
+
get: () => d($),
|
485
485
|
set: (w) => {
|
486
486
|
I.value = !0;
|
487
|
-
const M =
|
487
|
+
const M = d(r), L = d(c);
|
488
488
|
L && (L[n] = y[n]), ce(M[n]) ? M[n].value = w : M[n] = w;
|
489
489
|
}
|
490
490
|
}) : null;
|
491
|
-
n &&
|
491
|
+
n && m.$autoDirty && X($, () => {
|
492
492
|
I.value || ue();
|
493
|
-
const w = c
|
493
|
+
const w = d(c);
|
494
494
|
w && (w[n] = y[n]);
|
495
495
|
}, {
|
496
496
|
flush: "sync"
|
497
497
|
});
|
498
498
|
async function We() {
|
499
|
-
return ue(),
|
499
|
+
return ue(), m.$rewardEarly && (we(), await te()), await te(), new Promise((w) => {
|
500
500
|
if (!ie.value)
|
501
501
|
return w(!oe.value);
|
502
502
|
const M = X(ie, () => {
|
@@ -508,9 +508,9 @@ function pe(e) {
|
|
508
508
|
return (s.value || {})[w];
|
509
509
|
}
|
510
510
|
function Ke() {
|
511
|
-
ce(
|
512
|
-
delete
|
513
|
-
}) : Object.assign(
|
511
|
+
ce(c) ? c.value = y : Object.keys(y).length === 0 ? Object.keys(c).forEach((w) => {
|
512
|
+
delete c[w];
|
513
|
+
}) : Object.assign(c, y);
|
514
514
|
}
|
515
515
|
return C(V(V(V({}, se), {}, {
|
516
516
|
$model: Xe,
|
@@ -522,7 +522,7 @@ function pe(e) {
|
|
522
522
|
$pending: ie,
|
523
523
|
$touch: ue,
|
524
524
|
$reset: He,
|
525
|
-
$path:
|
525
|
+
$path: p || _t,
|
526
526
|
$silentErrors: Ge,
|
527
527
|
$validate: We,
|
528
528
|
$commit: we
|
@@ -544,7 +544,7 @@ class xt {
|
|
544
544
|
}
|
545
545
|
checkRulesValidity(t, r, n) {
|
546
546
|
const a = Object.keys(n), s = Object.keys(r);
|
547
|
-
return s.length !== a.length || !s.every((
|
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((l) => d(n[i].$params[l]) === d(r[i].$params[l])) : !0);
|
548
548
|
}
|
549
549
|
get(t, r) {
|
550
550
|
const n = this.storage.get(t);
|
@@ -553,11 +553,11 @@ class xt {
|
|
553
553
|
const {
|
554
554
|
rules: a,
|
555
555
|
result: s
|
556
|
-
} = n,
|
557
|
-
return
|
556
|
+
} = n, u = this.checkRulesValidity(t, r, a), i = s.$unwatch ? s.$unwatch : () => ({});
|
557
|
+
return u ? s : {
|
558
558
|
$dirty: s.$dirty,
|
559
559
|
$partial: !0,
|
560
|
-
$unwatch:
|
560
|
+
$unwatch: i
|
561
561
|
};
|
562
562
|
}
|
563
563
|
}
|
@@ -570,27 +570,27 @@ function Rt(e) {
|
|
570
570
|
$scope: t,
|
571
571
|
instance: r
|
572
572
|
} = e;
|
573
|
-
const n = {}, a = x([]), s = _(() => a.value.reduce((
|
574
|
-
function
|
573
|
+
const n = {}, a = x([]), s = _(() => a.value.reduce((p, f) => (p[f] = d(n[f]), p), {}));
|
574
|
+
function u(p, f) {
|
575
575
|
let {
|
576
576
|
$registerAs: g,
|
577
577
|
$scope: h,
|
578
578
|
$stopPropagation: o
|
579
|
-
} =
|
580
|
-
o || t === Z.COLLECT_NONE || h === Z.COLLECT_NONE || t !== Z.COLLECT_ALL && t !== h || (n[g] =
|
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
581
|
}
|
582
|
-
r.__vuelidateInjectInstances = [].concat(r.__vuelidateInjectInstances || [],
|
583
|
-
function
|
584
|
-
a.value = a.value.filter((
|
582
|
+
r.__vuelidateInjectInstances = [].concat(r.__vuelidateInjectInstances || [], u);
|
583
|
+
function i(p) {
|
584
|
+
a.value = a.value.filter((f) => f !== p), delete n[p];
|
585
585
|
}
|
586
|
-
r.__vuelidateRemoveInstances = [].concat(r.__vuelidateRemoveInstances || [],
|
586
|
+
r.__vuelidateRemoveInstances = [].concat(r.__vuelidateRemoveInstances || [], i);
|
587
587
|
const l = J(Ee, []);
|
588
588
|
be(Ee, r.__vuelidateInjectInstances);
|
589
|
-
const
|
589
|
+
const c = J(Ce, []);
|
590
590
|
return be(Ce, r.__vuelidateRemoveInstances), {
|
591
591
|
childResults: s,
|
592
592
|
sendValidationResultsToParent: l,
|
593
|
-
removeValidationResultsFromParent:
|
593
|
+
removeValidationResultsFromParent: c
|
594
594
|
};
|
595
595
|
}
|
596
596
|
function qe(e) {
|
@@ -608,60 +608,60 @@ function Ot(e, t) {
|
|
608
608
|
let {
|
609
609
|
$registerAs: a,
|
610
610
|
$scope: s = Z.COLLECT_ALL,
|
611
|
-
$stopPropagation:
|
612
|
-
$externalResults:
|
611
|
+
$stopPropagation: u,
|
612
|
+
$externalResults: i,
|
613
613
|
currentVueInstance: l
|
614
614
|
} = n;
|
615
|
-
const
|
615
|
+
const c = l || ((r = Ze()) === null || r === void 0 ? void 0 : r.proxy), p = c ? c.$options : {};
|
616
616
|
a || (je += 1, a = `_vuelidate_${je}`);
|
617
|
-
const
|
617
|
+
const f = x({}), g = new xt(), {
|
618
618
|
childResults: h,
|
619
619
|
sendValidationResultsToParent: o,
|
620
|
-
removeValidationResultsFromParent:
|
621
|
-
} =
|
620
|
+
removeValidationResultsFromParent: m
|
621
|
+
} = c ? Rt({
|
622
622
|
$scope: s,
|
623
|
-
instance:
|
623
|
+
instance: c
|
624
624
|
}) : {
|
625
625
|
childResults: x({})
|
626
626
|
};
|
627
|
-
if (!e &&
|
628
|
-
const $ =
|
627
|
+
if (!e && p.validations) {
|
628
|
+
const $ = p.validations;
|
629
629
|
t = x({}), Ve(() => {
|
630
|
-
t.value =
|
631
|
-
|
630
|
+
t.value = c, X(() => re($) ? $.call(t.value, new qe(t.value)) : $, (y) => {
|
631
|
+
f.value = pe({
|
632
632
|
validations: y,
|
633
633
|
state: t,
|
634
634
|
childResults: h,
|
635
635
|
resultsCache: g,
|
636
636
|
globalConfig: n,
|
637
|
-
instance:
|
638
|
-
externalResults:
|
637
|
+
instance: c,
|
638
|
+
externalResults: i || c.vuelidateExternalResults
|
639
639
|
});
|
640
640
|
}, {
|
641
641
|
immediate: !0
|
642
642
|
});
|
643
|
-
}), n =
|
643
|
+
}), n = p.validationsConfig || n;
|
644
644
|
} else {
|
645
645
|
const $ = ce(e) || $t(e) ? e : C(e || {});
|
646
646
|
X($, (y) => {
|
647
|
-
|
647
|
+
f.value = pe({
|
648
648
|
validations: y,
|
649
649
|
state: t,
|
650
650
|
childResults: h,
|
651
651
|
resultsCache: g,
|
652
652
|
globalConfig: n,
|
653
|
-
instance:
|
654
|
-
externalResults:
|
653
|
+
instance: c ?? {},
|
654
|
+
externalResults: i
|
655
655
|
});
|
656
656
|
}, {
|
657
657
|
immediate: !0
|
658
658
|
});
|
659
659
|
}
|
660
|
-
return
|
660
|
+
return c && (o.forEach(($) => $(f, {
|
661
661
|
$registerAs: a,
|
662
662
|
$scope: s,
|
663
|
-
$stopPropagation:
|
664
|
-
})), $e(() =>
|
663
|
+
$stopPropagation: u
|
664
|
+
})), $e(() => m.forEach(($) => $(a)))), _(() => V(V({}, d(f.value)), h.value));
|
665
665
|
}
|
666
666
|
var T = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.TEXT = "text", e))(T || {});
|
667
667
|
const Et = ["id", "name", "placeholder", "value"], Ct = ["id", "name", "checked", "value"], jt = ["id"], At = ["for"], Tt = /* @__PURE__ */ j({
|
@@ -679,38 +679,38 @@ const Et = ["id", "name", "placeholder", "value"], Ct = ["id", "name", "checked"
|
|
679
679
|
emits: ["change", "input"],
|
680
680
|
setup(e, { emit: t }) {
|
681
681
|
const r = e, n = t, a = () => {
|
682
|
-
|
682
|
+
u.value = !u.value, n("change", u.value.toString());
|
683
683
|
}, s = (l) => {
|
684
684
|
n("input", l.target.value);
|
685
|
-
},
|
686
|
-
return (l,
|
687
|
-
var
|
688
|
-
return v(), A(
|
685
|
+
}, u = x(r.defaultChecked), i = _(() => `pdap-${r.name}-input-error`);
|
686
|
+
return (l, c) => {
|
687
|
+
var p;
|
688
|
+
return v(), A(d(Dr), {
|
689
689
|
class: G({
|
690
690
|
"pdap-input": !0,
|
691
|
-
"pdap-input-error": Number((
|
691
|
+
"pdap-input-error": Number((p = l.error) == null ? void 0 : p.length) >= 1
|
692
692
|
})
|
693
693
|
}, {
|
694
694
|
default: E(() => [
|
695
|
-
l.type ===
|
695
|
+
l.type === d(T).TEXT ? (v(), b("input", de({
|
696
696
|
key: 0,
|
697
697
|
id: l.id,
|
698
698
|
type: "text",
|
699
699
|
name: l.name,
|
700
700
|
placeholder: l.placeholder,
|
701
701
|
value: l.value
|
702
|
-
}, l.$attrs, { onInput: s }), null, 16, Et)) : l.type ===
|
702
|
+
}, l.$attrs, { onInput: s }), null, 16, Et)) : l.type === d(T).CHECKBOX ? (v(), b("input", de({
|
703
703
|
key: 1,
|
704
704
|
id: l.id,
|
705
705
|
class: "pdap-input-checkbox",
|
706
706
|
name: l.name,
|
707
|
-
checked:
|
707
|
+
checked: u.value,
|
708
708
|
type: "checkbox",
|
709
709
|
value: l.value
|
710
710
|
}, l.$attrs, { onChange: a }), null, 16, Ct)) : q("", !0),
|
711
711
|
l.error ? (v(), b("div", {
|
712
712
|
key: 2,
|
713
|
-
id:
|
713
|
+
id: i.value,
|
714
714
|
class: "pdap-input-error-message"
|
715
715
|
}, D(l.error), 9, jt)) : q("", !0),
|
716
716
|
P("label", {
|
@@ -781,7 +781,7 @@ function he(e, t) {
|
|
781
781
|
return r.$params = H(H({}, r.$params || {}), e), r;
|
782
782
|
}
|
783
783
|
function U(e, t) {
|
784
|
-
if (!W(e) && typeof
|
784
|
+
if (!W(e) && typeof d(e) != "string")
|
785
785
|
throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof e}`);
|
786
786
|
if (!ne(t) && !W(t))
|
787
787
|
throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");
|
@@ -801,13 +801,13 @@ function St(e) {
|
|
801
801
|
$validator(t) {
|
802
802
|
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
|
803
803
|
n[a - 1] = arguments[a];
|
804
|
-
return
|
805
|
-
const l = Object.entries(
|
806
|
-
let [
|
807
|
-
const h = e[
|
804
|
+
return d(t).reduce((s, u, i) => {
|
805
|
+
const l = Object.entries(u).reduce((c, p) => {
|
806
|
+
let [f, g] = p;
|
807
|
+
const h = e[f] || {}, o = Object.entries(h).reduce((m, $) => {
|
808
808
|
let [y, F] = $;
|
809
|
-
const O = N(F).call(this, g,
|
810
|
-
if (
|
809
|
+
const O = N(F).call(this, g, u, i, ...n), z = S(O);
|
810
|
+
if (m.$data[y] = O, m.$data.$invalid = !z || !!m.$data.$invalid, m.$data.$error = m.$data.$invalid, !z) {
|
811
811
|
let I = F.$message || "";
|
812
812
|
const Q = F.$params || {};
|
813
813
|
typeof I == "function" && (I = I({
|
@@ -816,8 +816,8 @@ function St(e) {
|
|
816
816
|
$params: Q,
|
817
817
|
$model: g,
|
818
818
|
$response: O
|
819
|
-
})),
|
820
|
-
$property:
|
819
|
+
})), m.$errors.push({
|
820
|
+
$property: f,
|
821
821
|
$message: I,
|
822
822
|
$params: Q,
|
823
823
|
$response: O,
|
@@ -827,19 +827,19 @@ function St(e) {
|
|
827
827
|
});
|
828
828
|
}
|
829
829
|
return {
|
830
|
-
$valid:
|
831
|
-
$data:
|
832
|
-
$errors:
|
830
|
+
$valid: m.$valid && z,
|
831
|
+
$data: m.$data,
|
832
|
+
$errors: m.$errors
|
833
833
|
};
|
834
834
|
}, {
|
835
835
|
$valid: !0,
|
836
836
|
$data: {},
|
837
837
|
$errors: []
|
838
838
|
});
|
839
|
-
return
|
840
|
-
$valid:
|
841
|
-
$data:
|
842
|
-
$errors:
|
839
|
+
return c.$data[f] = o.$data, c.$errors[f] = o.$errors, {
|
840
|
+
$valid: c.$valid && o.$valid,
|
841
|
+
$data: c.$data,
|
842
|
+
$errors: c.$errors
|
843
843
|
};
|
844
844
|
}, {
|
845
845
|
$valid: !0,
|
@@ -866,7 +866,7 @@ function St(e) {
|
|
866
866
|
};
|
867
867
|
}
|
868
868
|
const R = (e) => {
|
869
|
-
if (e =
|
869
|
+
if (e = d(e), Array.isArray(e))
|
870
870
|
return !!e.length;
|
871
871
|
if (e == null)
|
872
872
|
return !1;
|
@@ -880,11 +880,11 @@ const R = (e) => {
|
|
880
880
|
return !1;
|
881
881
|
}
|
882
882
|
return !!String(e).length;
|
883
|
-
}, ve = (e) => (e =
|
883
|
+
}, ve = (e) => (e = d(e), Array.isArray(e) ? e.length : typeof e == "object" ? Object.keys(e).length : String(e).length);
|
884
884
|
function k() {
|
885
885
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
886
886
|
t[r] = arguments[r];
|
887
|
-
return (n) => (n =
|
887
|
+
return (n) => (n = d(n), !R(n) || t.every((a) => (a.lastIndex = 0, a.test(n))));
|
888
888
|
}
|
889
889
|
var ye = /* @__PURE__ */ Object.freeze({
|
890
890
|
__proto__: null,
|
@@ -893,7 +893,7 @@ var ye = /* @__PURE__ */ Object.freeze({
|
|
893
893
|
normalizeValidatorObject: ae,
|
894
894
|
regex: k,
|
895
895
|
req: R,
|
896
|
-
unwrap:
|
896
|
+
unwrap: d,
|
897
897
|
unwrapNormalizedValidator: N,
|
898
898
|
unwrapValidatorResponse: S,
|
899
899
|
withAsync: Vt,
|
@@ -919,7 +919,7 @@ var ye = /* @__PURE__ */ Object.freeze({
|
|
919
919
|
}
|
920
920
|
};
|
921
921
|
function Ft(e, t) {
|
922
|
-
return (r) => !R(r) || (!/\s/.test(r) || r instanceof Date) && +
|
922
|
+
return (r) => !R(r) || (!/\s/.test(r) || r instanceof Date) && +d(e) <= +r && +d(t) >= +r;
|
923
923
|
}
|
924
924
|
function Bt(e, t) {
|
925
925
|
return {
|
@@ -969,7 +969,7 @@ var Kt = {
|
|
969
969
|
function Qt() {
|
970
970
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ":";
|
971
971
|
return (t) => {
|
972
|
-
if (e =
|
972
|
+
if (e = d(e), !R(t))
|
973
973
|
return !0;
|
974
974
|
if (typeof t != "string")
|
975
975
|
return !1;
|
@@ -988,7 +988,7 @@ function Jt(e) {
|
|
988
988
|
};
|
989
989
|
}
|
990
990
|
function Yt(e) {
|
991
|
-
return (t) => !R(t) || ve(t) <=
|
991
|
+
return (t) => !R(t) || ve(t) <= d(e);
|
992
992
|
}
|
993
993
|
function er(e) {
|
994
994
|
return {
|
@@ -1006,7 +1006,7 @@ function er(e) {
|
|
1006
1006
|
};
|
1007
1007
|
}
|
1008
1008
|
function tr(e) {
|
1009
|
-
return (t) => !R(t) || ve(t) >=
|
1009
|
+
return (t) => !R(t) || ve(t) >= d(e);
|
1010
1010
|
}
|
1011
1011
|
function rr(e) {
|
1012
1012
|
return {
|
@@ -1037,7 +1037,7 @@ const Te = (e, t) => e ? R(typeof t == "string" ? t.trim() : t) : !0;
|
|
1037
1037
|
function ar(e) {
|
1038
1038
|
return function(t, r) {
|
1039
1039
|
if (typeof e != "function")
|
1040
|
-
return Te(
|
1040
|
+
return Te(d(e), t);
|
1041
1041
|
const n = e.call(this, t, r);
|
1042
1042
|
return Te(n, t);
|
1043
1043
|
};
|
@@ -1056,7 +1056,7 @@ const Ie = (e, t) => e ? !0 : R(typeof t == "string" ? t.trim() : t);
|
|
1056
1056
|
function or(e) {
|
1057
1057
|
return function(t, r) {
|
1058
1058
|
if (typeof e != "function")
|
1059
|
-
return Ie(
|
1059
|
+
return Ie(d(e), t);
|
1060
1060
|
const n = e.call(this, t, r);
|
1061
1061
|
return Ie(n, t);
|
1062
1062
|
};
|
@@ -1072,7 +1072,7 @@ function ir(e) {
|
|
1072
1072
|
};
|
1073
1073
|
}
|
1074
1074
|
function ur(e) {
|
1075
|
-
return (t) =>
|
1075
|
+
return (t) => d(t) === d(e);
|
1076
1076
|
}
|
1077
1077
|
function lr(e) {
|
1078
1078
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "other";
|
@@ -1094,29 +1094,29 @@ var dr = k(cr), pr = {
|
|
1094
1094
|
type: "url"
|
1095
1095
|
}
|
1096
1096
|
};
|
1097
|
-
function
|
1097
|
+
function mr(e) {
|
1098
1098
|
return function() {
|
1099
1099
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1100
1100
|
r[n] = arguments[n];
|
1101
1101
|
return e.reduce((a, s) => S(a) ? a : N(s).apply(this, r), !1);
|
1102
1102
|
};
|
1103
1103
|
}
|
1104
|
-
function
|
1104
|
+
function fr(e) {
|
1105
1105
|
return function() {
|
1106
1106
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1107
1107
|
r[n] = arguments[n];
|
1108
1108
|
return e.reduce(async (a, s) => {
|
1109
|
-
const
|
1110
|
-
return S(
|
1109
|
+
const u = await a;
|
1110
|
+
return S(u) ? u : N(s).apply(this, r);
|
1111
1111
|
}, Promise.resolve(!1));
|
1112
1112
|
};
|
1113
1113
|
}
|
1114
1114
|
function $r() {
|
1115
1115
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
1116
1116
|
t[r] = arguments[r];
|
1117
|
-
const n = t.some((
|
1117
|
+
const n = t.some((u) => u.$async), a = t.reduce((u, i) => i.$watchTargets ? u.concat(i.$watchTargets) : u, []);
|
1118
1118
|
let s = () => !1;
|
1119
|
-
return t.length && (s = n ?
|
1119
|
+
return t.length && (s = n ? fr(t) : mr(t)), {
|
1120
1120
|
$async: n,
|
1121
1121
|
$validator: s,
|
1122
1122
|
$watchTargets: a
|
@@ -1139,15 +1139,15 @@ function vr(e) {
|
|
1139
1139
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1140
1140
|
r[n] = arguments[n];
|
1141
1141
|
return e.reduce(async (a, s) => {
|
1142
|
-
const
|
1143
|
-
return S(
|
1142
|
+
const u = await a;
|
1143
|
+
return S(u) ? N(s).apply(this, r) : u;
|
1144
1144
|
}, Promise.resolve(!0));
|
1145
1145
|
};
|
1146
1146
|
}
|
1147
1147
|
function yr() {
|
1148
1148
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
1149
1149
|
t[r] = arguments[r];
|
1150
|
-
const n = t.some((
|
1150
|
+
const n = t.some((u) => u.$async), a = t.reduce((u, i) => i.$watchTargets ? u.concat(i.$watchTargets) : u, []);
|
1151
1151
|
let s = () => !1;
|
1152
1152
|
return t.length && (s = n ? vr(t) : hr(t)), {
|
1153
1153
|
$async: n,
|
@@ -1178,7 +1178,7 @@ function br(e) {
|
|
1178
1178
|
};
|
1179
1179
|
}
|
1180
1180
|
function Pr(e) {
|
1181
|
-
return (t) => !R(t) || (!/\s/.test(t) || t instanceof Date) && +t >= +
|
1181
|
+
return (t) => !R(t) || (!/\s/.test(t) || t instanceof Date) && +t >= +d(e);
|
1182
1182
|
}
|
1183
1183
|
function xr(e) {
|
1184
1184
|
return {
|
@@ -1196,7 +1196,7 @@ function xr(e) {
|
|
1196
1196
|
};
|
1197
1197
|
}
|
1198
1198
|
function Rr(e) {
|
1199
|
-
return (t) => !R(t) || (!/\s/.test(t) || t instanceof Date) && +t <= +
|
1199
|
+
return (t) => !R(t) || (!/\s/.test(t) || t instanceof Date) && +t <= +d(e);
|
1200
1200
|
}
|
1201
1201
|
var Or = (e) => ({
|
1202
1202
|
$validator: Rr(e),
|
@@ -1236,24 +1236,24 @@ function Tr(e) {
|
|
1236
1236
|
} = e;
|
1237
1237
|
return function(s) {
|
1238
1238
|
let {
|
1239
|
-
withArguments:
|
1240
|
-
messagePath:
|
1239
|
+
withArguments: u = !1,
|
1240
|
+
messagePath: i = r,
|
1241
1241
|
messageParams: l = n
|
1242
1242
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
1243
|
-
function p
|
1244
|
-
return t(
|
1245
|
-
model:
|
1246
|
-
property:
|
1247
|
-
pending:
|
1248
|
-
invalid:
|
1249
|
-
response:
|
1250
|
-
validator:
|
1251
|
-
propertyPath:
|
1252
|
-
},
|
1243
|
+
function c(p) {
|
1244
|
+
return t(i(p), l(H({
|
1245
|
+
model: p.$model,
|
1246
|
+
property: p.$property,
|
1247
|
+
pending: p.$pending,
|
1248
|
+
invalid: p.$invalid,
|
1249
|
+
response: p.$response,
|
1250
|
+
validator: p.$validator,
|
1251
|
+
propertyPath: p.$propertyPath
|
1252
|
+
}, p.$params)));
|
1253
1253
|
}
|
1254
|
-
return
|
1255
|
-
return U(
|
1256
|
-
} : U(
|
1254
|
+
return u && typeof s == "function" ? function() {
|
1255
|
+
return U(c, s(...arguments));
|
1256
|
+
} : U(c, s);
|
1257
1257
|
};
|
1258
1258
|
}
|
1259
1259
|
const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
@@ -1332,68 +1332,69 @@ const zr = {
|
|
1332
1332
|
emits: ["submit"],
|
1333
1333
|
setup(e, { emit: t }) {
|
1334
1334
|
const r = e, n = t, a = x(
|
1335
|
-
r.schema.reduce((
|
1336
|
-
switch (
|
1335
|
+
r.schema.reduce((p, f) => {
|
1336
|
+
switch (f.type) {
|
1337
1337
|
case T.CHECKBOX:
|
1338
|
-
return { ...
|
1338
|
+
return { ...p, [f.name]: String(f.defaultChecked) };
|
1339
1339
|
case T.TEXT:
|
1340
1340
|
default:
|
1341
|
-
return { ...
|
1341
|
+
return { ...p, [f.name]: f.value };
|
1342
1342
|
}
|
1343
1343
|
}, {})
|
1344
|
-
), s = r.schema.reduce((
|
1345
|
-
const g = Object.entries(
|
1346
|
-
(h, [o,
|
1344
|
+
), s = r.schema.reduce((p, f) => {
|
1345
|
+
const g = Object.entries(f.validators ?? {}).reduce(
|
1346
|
+
(h, [o, m]) => ({
|
1347
1347
|
...h,
|
1348
|
-
...kr(o,
|
1348
|
+
...kr(o, m)
|
1349
1349
|
}),
|
1350
1350
|
{}
|
1351
1351
|
);
|
1352
1352
|
return {
|
1353
|
-
...
|
1354
|
-
[
|
1353
|
+
...p,
|
1354
|
+
[f.name]: {
|
1355
1355
|
...g
|
1356
1356
|
}
|
1357
1357
|
};
|
1358
|
-
}, {}),
|
1359
|
-
function l(
|
1360
|
-
a.value[
|
1358
|
+
}, {}), u = Ot(s, a, { $autoDirty: !1, $lazy: !0 }), i = x(r.error);
|
1359
|
+
function l(p, f) {
|
1360
|
+
a.value[p] = f;
|
1361
1361
|
}
|
1362
1362
|
Pe(() => {
|
1363
|
-
r.error ?
|
1363
|
+
r.error ? i.value = r.error : i.value && u.value.$errors.length === 0 ? i.value = null : !i.value && u.value.$errors.length > 0 && (i.value = "Please update this form to correct the errors");
|
1364
1364
|
}), Pe(() => {
|
1365
1365
|
console.debug(`PdapForm ${r.name}
|
1366
1366
|
`, {
|
1367
|
+
errorMessage: i.value,
|
1367
1368
|
props: r,
|
1368
1369
|
values: a,
|
1369
1370
|
vuelidate: {
|
1370
1371
|
rules: s,
|
1371
|
-
v$:
|
1372
|
+
v$: u
|
1372
1373
|
}
|
1373
1374
|
});
|
1374
1375
|
});
|
1375
|
-
async function p
|
1376
|
-
if (await
|
1377
|
-
n("submit", { ...a }),
|
1376
|
+
async function c(p) {
|
1377
|
+
if (await u.value.$validate()) {
|
1378
|
+
n("submit", { ...a.value }), u.value.$reset(), p.target.reset(), a.value = Object.entries(a.value).reduce((h, [o, m]) => ({ ...h, [o]: ["true", "false"].includes(m) ? m : "" }), {});
|
1378
1379
|
return;
|
1379
1380
|
}
|
1380
1381
|
}
|
1381
|
-
return (
|
1382
|
+
return (p, f) => (v(), b("form", {
|
1382
1383
|
class: "pdap-form",
|
1383
|
-
onSubmit:
|
1384
|
+
onSubmit: f[0] || (f[0] = et((g) => c(g), ["prevent"]))
|
1384
1385
|
}, [
|
1385
|
-
typeof
|
1386
|
-
(v(!0), b(ee, null,
|
1387
|
-
var h, o,
|
1386
|
+
typeof i.value == "string" ? (v(), b("div", zr, D(i.value), 1)) : q("", !0),
|
1387
|
+
(v(!0), b(ee, null, fe(p.schema, (g) => {
|
1388
|
+
var h, o, m, $;
|
1388
1389
|
return v(), A(Tt, de((delete g.validators, g), {
|
1389
1390
|
key: g.name,
|
1390
|
-
error: (h =
|
1391
|
+
error: (h = d(u)[g.name]) != null && h.$error ? ($ = (m = (o = d(u)[g.name]) == null ? void 0 : o.$errors) == null ? void 0 : m[0]) == null ? void 0 : $.$message : "",
|
1391
1392
|
value: a.value[g.name],
|
1392
|
-
onChange: (y) => g.type !==
|
1393
|
-
onInput: (y) => g.type ===
|
1393
|
+
onChange: (y) => g.type !== d(T).TEXT ? l(g.name, y) : void 0,
|
1394
|
+
onInput: (y) => g.type === d(T).TEXT ? l(g.name, y) : void 0
|
1394
1395
|
}), null, 16, ["error", "value", "onChange", "onInput"]);
|
1395
1396
|
}), 128)),
|
1396
|
-
K(
|
1397
|
+
K(p.$slots, "default")
|
1397
1398
|
], 32));
|
1398
1399
|
}
|
1399
1400
|
});
|
@@ -1416,12 +1417,12 @@ const Dr = /* @__PURE__ */ j({
|
|
1416
1417
|
},
|
1417
1418
|
...t.templateColumns && { gridTemplateColumns: t.templateColumns }
|
1418
1419
|
});
|
1419
|
-
return (
|
1420
|
+
return (u, i) => (v(), A(me(u.component), {
|
1420
1421
|
class: G(r),
|
1421
1422
|
style: ge(s)
|
1422
1423
|
}, {
|
1423
1424
|
default: E(() => [
|
1424
|
-
K(
|
1425
|
+
K(u.$slots, "default")
|
1425
1426
|
]),
|
1426
1427
|
_: 3
|
1427
1428
|
}, 8, ["class", "style"]));
|
@@ -1444,7 +1445,7 @@ const Jr = /* @__PURE__ */ j({
|
|
1444
1445
|
gridRow: `span ${t.spanRow} / span ${t.spanRow}`
|
1445
1446
|
}
|
1446
1447
|
});
|
1447
|
-
return (a, s) => (v(), A(
|
1448
|
+
return (a, s) => (v(), A(me(a.component), {
|
1448
1449
|
class: G(r),
|
1449
1450
|
style: ge(n)
|
1450
1451
|
}, {
|
@@ -1489,11 +1490,11 @@ const qr = /* @__PURE__ */ P("svg", {
|
|
1489
1490
|
window.innerWidth <= 1024 ? r.isMobile = !0 : r.isMobile = !1, await te();
|
1490
1491
|
}
|
1491
1492
|
async function s() {
|
1492
|
-
var
|
1493
|
-
const
|
1494
|
-
!r.isExpanded && r.isMobile ? (r.isExpanded = !0,
|
1493
|
+
var i, l;
|
1494
|
+
const u = document.querySelector("body");
|
1495
|
+
!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, (l = document.querySelector("body")) == null || l.classList.remove("lock-scroll")), await te();
|
1495
1496
|
}
|
1496
|
-
return (
|
1497
|
+
return (u, i) => (v(), b(ee, null, [
|
1497
1498
|
P("div", {
|
1498
1499
|
"aria-controls": "nav",
|
1499
1500
|
class: "pdap-nav-open-button",
|
@@ -1504,9 +1505,9 @@ const qr = /* @__PURE__ */ P("svg", {
|
|
1504
1505
|
id: "nav",
|
1505
1506
|
"aria-expanded": r.isMobile && r.isExpanded || !r.isMobile,
|
1506
1507
|
class: G(n),
|
1507
|
-
style: ge(r.isMobile ? { top: `${
|
1508
|
+
style: ge(r.isMobile ? { top: `${u.topPosition}px` } : {})
|
1508
1509
|
}, [
|
1509
|
-
(v(!0), b(ee, null,
|
1510
|
+
(v(!0), b(ee, null, fe(d(t), (l) => (v(), b("li", {
|
1510
1511
|
key: l.text,
|
1511
1512
|
class: "pdap-nav-link-container"
|
1512
1513
|
}, [
|
@@ -1518,7 +1519,7 @@ const qr = /* @__PURE__ */ P("svg", {
|
|
1518
1519
|
referrerpolicy: "no-referrer",
|
1519
1520
|
onClick: s
|
1520
1521
|
}, D(l.text), 9, Br)) : q("", !0),
|
1521
|
-
l.path ? (v(), A(
|
1522
|
+
l.path ? (v(), A(d(Se), {
|
1522
1523
|
key: 1,
|
1523
1524
|
"active-class": "pdap-nav-link-current",
|
1524
1525
|
"exact-active-class": "pdap-nav-link-current-exact",
|
@@ -1552,19 +1553,19 @@ const Gr = ["href"], Xr = ["src"], Wr = ["src"], Yr = /* @__PURE__ */ j({
|
|
1552
1553
|
function s() {
|
1553
1554
|
n.value && (r.value = n.value.offsetHeight);
|
1554
1555
|
}
|
1555
|
-
return (
|
1556
|
+
return (u, i) => (v(), b("header", {
|
1556
1557
|
ref_key: "el",
|
1557
1558
|
ref: n,
|
1558
1559
|
class: "pdap-header"
|
1559
1560
|
}, [
|
1560
|
-
|
1561
|
+
d(a) ? (v(), A(d(Se), {
|
1561
1562
|
key: 1,
|
1562
|
-
to:
|
1563
|
+
to: u.logoImageAnchorPath,
|
1563
1564
|
class: "logo"
|
1564
1565
|
}, {
|
1565
1566
|
default: E(() => [
|
1566
1567
|
P("img", {
|
1567
|
-
src:
|
1568
|
+
src: u.logoImageSrc,
|
1568
1569
|
loading: "lazy",
|
1569
1570
|
width: "250",
|
1570
1571
|
alt: "Police Data Accessibility Project Logo"
|
@@ -1573,11 +1574,11 @@ const Gr = ["href"], Xr = ["src"], Wr = ["src"], Yr = /* @__PURE__ */ j({
|
|
1573
1574
|
_: 1
|
1574
1575
|
}, 8, ["to"])) : (v(), b("a", {
|
1575
1576
|
key: 0,
|
1576
|
-
href:
|
1577
|
+
href: u.logoImageAnchorPath,
|
1577
1578
|
class: "logo"
|
1578
1579
|
}, [
|
1579
1580
|
P("img", {
|
1580
|
-
src:
|
1581
|
+
src: u.logoImageSrc,
|
1581
1582
|
loading: "lazy",
|
1582
1583
|
width: "250",
|
1583
1584
|
alt: "Police Data Accessibility Project Logo"
|
@@ -1610,19 +1611,21 @@ const en = /* @__PURE__ */ j({
|
|
1610
1611
|
placeholder: "Enter a state, county, municipality, or 'all'",
|
1611
1612
|
value: ""
|
1612
1613
|
}
|
1613
|
-
];
|
1614
|
-
function
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1614
|
+
], a = x(void 0);
|
1615
|
+
function s(u) {
|
1616
|
+
if (Object.values(u).every((c) => !c)) {
|
1617
|
+
a.value = "Either a search term or a location is required.";
|
1618
|
+
return;
|
1619
|
+
}
|
1620
|
+
let { location: i, searchTerm: l } = u;
|
1621
|
+
if (i = i && i.length > 0 ? i : "all", l = l && l.length > 0 ? l : "all", t.getRoutes().some((c) => c.path.includes("/search/")))
|
1622
|
+
t.push(`/search/${l}/${i}`);
|
1620
1623
|
else {
|
1621
|
-
const
|
1622
|
-
window.location.assign(`${
|
1624
|
+
const c = r.mode === "prod" ? "https://data-sources.pdap.io" : "https://data-sources.pdap.dev";
|
1625
|
+
window.location.assign(`${c}/search/${l}/${i}`);
|
1623
1626
|
}
|
1624
1627
|
}
|
1625
|
-
return (
|
1628
|
+
return (u, i) => (v(), A(ke, {
|
1626
1629
|
alignment: "center",
|
1627
1630
|
component: "div",
|
1628
1631
|
class: "pdap-quick-search-form"
|
@@ -1631,9 +1634,10 @@ const en = /* @__PURE__ */ j({
|
|
1631
1634
|
Y(Mr, {
|
1632
1635
|
id: "quick-search-form",
|
1633
1636
|
class: "small",
|
1637
|
+
error: a.value,
|
1634
1638
|
schema: n,
|
1635
1639
|
name: "quickSearchForm",
|
1636
|
-
onSubmit:
|
1640
|
+
onSubmit: s
|
1637
1641
|
}, {
|
1638
1642
|
default: E(() => [
|
1639
1643
|
Y(nt, { type: "submit" }, {
|
@@ -1644,7 +1648,7 @@ const en = /* @__PURE__ */ j({
|
|
1644
1648
|
})
|
1645
1649
|
]),
|
1646
1650
|
_: 1
|
1647
|
-
})
|
1651
|
+
}, 8, ["error"])
|
1648
1652
|
]),
|
1649
1653
|
_: 1
|
1650
1654
|
}));
|