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