cja-phoenix 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cja-phoenix.es.js +703 -739
- package/dist/style.css +1 -1
- package/dist/types/components/{CheckboxInput.vue.d.ts → forms/CheckboxInput.vue.d.ts} +0 -0
- package/dist/types/components/{PhoneInput.vue.d.ts → forms/PhoneInput.vue.d.ts} +0 -0
- package/dist/types/components/forms/SelectionTiles.vue.d.ts +20 -0
- package/dist/types/components/{TextInput.vue.d.ts → forms/TextInput.vue.d.ts} +1 -1
- package/dist/types/components/index.d.ts +6 -8
- package/dist/types/components/{ComponentA.vue.d.ts → misc/ComponentA.vue.d.ts} +0 -0
- package/dist/types/components/{ComponentB.vue.d.ts → misc/ComponentB.vue.d.ts} +0 -0
- package/dist/types/components/{CjaButton.vue.d.ts → structural/CjaButton.vue.d.ts} +0 -0
- package/dist/types/components/{Modal.vue.d.ts → structural/Modal.vue.d.ts} +0 -0
- package/dist/types/types/TileOption.d.ts +7 -0
- package/package.json +4 -3
- package/public/fonts/ProximaNova-Black.woff +0 -0
- package/public/fonts/ProximaNova-Black.woff2 +0 -0
- package/public/fonts/ProximaNova-Bold.woff +0 -0
- package/public/fonts/ProximaNova-Bold.woff2 +0 -0
- package/public/fonts/ProximaNova-Extrabld.woff +0 -0
- package/public/fonts/ProximaNova-Extrabld.woff2 +0 -0
- package/public/fonts/ProximaNova-Regular.woff +0 -0
- package/public/fonts/ProximaNova-Regular.woff2 +0 -0
- package/public/fonts/ProximaNovaT-Thin.woff +0 -0
- package/public/fonts/ProximaNovaT-Thin.woff2 +0 -0
- package/public/iconia/fonts/CGG-icomoon.eot +0 -0
- package/public/iconia/fonts/CGG-icomoon.svg +507 -0
- package/public/iconia/fonts/CGG-icomoon.ttf +0 -0
- package/public/iconia/fonts/CGG-icomoon.woff +0 -0
- package/public/iconia/selection.json +1 -0
- package/public/iconia/style.css +1529 -0
- package/src/assets/fonts.scss +10 -10
- package/src/assets/main.scss +0 -2
- package/src/components/{CheckboxInput.vue → forms/CheckboxInput.vue} +0 -0
- package/src/components/{PhoneInput.vue → forms/PhoneInput.vue} +0 -0
- package/src/components/forms/SelectionTiles.vue +105 -0
- package/src/components/{TextInput.vue → forms/TextInput.vue} +0 -0
- package/src/components/index.ts +6 -16
- package/src/components/{ComponentA.vue → misc/ComponentA.vue} +0 -0
- package/src/components/{ComponentB.vue → misc/ComponentB.vue} +0 -0
- package/src/components/{CjaButton.vue → structural/CjaButton.vue} +0 -0
- package/src/components/{Modal.vue → structural/Modal.vue} +7 -0
- package/src/stories/Modal.story.vue +1 -1
- package/src/types/TileOption.ts +7 -0
package/dist/cja-phoenix.es.js
CHANGED
|
@@ -1,50 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as he, ref as X, watch as W, openBlock as ne, createBlock as un, Teleport as dn, createVNode as cn, Transition as fn, withCtx as hn, withDirectives as rt, createElementVNode as Z, withModifiers as vn, normalizeClass as at, createElementBlock as ie, toDisplayString as we, createCommentVNode as me, renderSlot as Ze, vShow as pn, pushScopeId as mn, popScopeId as gn, unref as b, computed as z, onMounted as ot, provide as Lt, isRef as xe, getCurrentInstance as Te, onBeforeUnmount as Ft, toRef as de, resolveDynamicComponent as lt, h as Re, inject as Nt, reactive as st, onUnmounted as Dt, nextTick as _e, warn as Tt, watchEffect as yn, markRaw as bn, resolveDirective as Mt } from "vue";
|
|
2
|
+
const Pt = (e, t) => {
|
|
3
3
|
const n = e.__vccOpts || e;
|
|
4
4
|
for (const [i, r] of t)
|
|
5
5
|
n[i] = r;
|
|
6
6
|
return n;
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
msg: null
|
|
11
|
-
},
|
|
12
|
-
setup(e) {
|
|
13
|
-
return (t, n) => (ee(), ne("div", wn, [
|
|
14
|
-
cn(" Hello " + he(e.msg) + "! ", 1),
|
|
15
|
-
kn
|
|
16
|
-
]));
|
|
17
|
-
}
|
|
18
|
-
}), Sn = /* @__PURE__ */ $e(In, [["__scopeId", "data-v-5800c09e"]]);
|
|
19
|
-
const On = (e) => (at("data-v-2c22e62b"), e = e(), ot(), e), En = { class: "flex align-content-center flex-wrap counter" }, An = /* @__PURE__ */ On(() => /* @__PURE__ */ U("label", { class: "flex align-items-center justify-content-center" }, "Counter:", -1)), Vn = { class: "flex align-items-center justify-content-center count" }, Ln = /* @__PURE__ */ oe({
|
|
20
|
-
__name: "ComponentB",
|
|
21
|
-
setup(e) {
|
|
22
|
-
const t = Y(0);
|
|
23
|
-
return (n, i) => (ee(), ne("div", En, [
|
|
24
|
-
An,
|
|
25
|
-
U("button", {
|
|
26
|
-
icon: "pi pi-plus",
|
|
27
|
-
class: "p-button-sm flex align-items-center justify-content-center",
|
|
28
|
-
onClick: i[0] || (i[0] = (r) => t.value++)
|
|
29
|
-
}),
|
|
30
|
-
U("span", Vn, he(t.value), 1),
|
|
31
|
-
U("button", {
|
|
32
|
-
icon: "pi pi-minus",
|
|
33
|
-
class: "p-button-sm flex align-items-center justify-content-center",
|
|
34
|
-
onClick: i[1] || (i[1] = (r) => t.value--)
|
|
35
|
-
})
|
|
36
|
-
]));
|
|
37
|
-
}
|
|
38
|
-
}), Fn = /* @__PURE__ */ $e(Ln, [["__scopeId", "data-v-2c22e62b"]]);
|
|
39
|
-
const Nn = (e) => (at("data-v-59185a17"), e = e(), ot(), e), Dn = { class: "modal-backdrop" }, Tn = ["onClick"], Mn = /* @__PURE__ */ Nn(() => /* @__PURE__ */ U("span", { class: "m-cgg-icon--cross" }, null, -1)), jn = [
|
|
40
|
-
Mn
|
|
41
|
-
], Pn = {
|
|
7
|
+
}, _n = (e) => (mn("data-v-4304a677"), e = e(), gn(), e), Cn = { class: "modal-backdrop" }, wn = ["onClick"], kn = /* @__PURE__ */ _n(() => /* @__PURE__ */ Z("span", { class: "m-cgg-icon--cross" }, null, -1)), In = [
|
|
8
|
+
kn
|
|
9
|
+
], Sn = {
|
|
42
10
|
key: 0,
|
|
43
11
|
class: "modal-header"
|
|
44
|
-
},
|
|
12
|
+
}, On = { class: "modal-body" }, En = {
|
|
45
13
|
key: 1,
|
|
46
14
|
class: "modal-footer"
|
|
47
|
-
},
|
|
15
|
+
}, An = /* @__PURE__ */ he({
|
|
48
16
|
__name: "Modal",
|
|
49
17
|
props: {
|
|
50
18
|
title: null,
|
|
@@ -52,8 +20,8 @@ const Nn = (e) => (at("data-v-59185a17"), e = e(), ot(), e), Dn = { class: "moda
|
|
|
52
20
|
},
|
|
53
21
|
emits: ["close"],
|
|
54
22
|
setup(e, { expose: t, emit: n }) {
|
|
55
|
-
const i =
|
|
56
|
-
|
|
23
|
+
const i = X(!1), r = X();
|
|
24
|
+
W(
|
|
57
25
|
() => i.value,
|
|
58
26
|
(m) => {
|
|
59
27
|
m ? (document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden") : (document.body.style.overflow = "", document.documentElement.style.overflow = "");
|
|
@@ -66,66 +34,66 @@ const Nn = (e) => (at("data-v-59185a17"), e = e(), ot(), e), Dn = { class: "moda
|
|
|
66
34
|
};
|
|
67
35
|
return t({ active: i, openModal: o, closeModal: u, toggleModal: () => {
|
|
68
36
|
i.value = !i.value;
|
|
69
|
-
} }), (m, p) => (
|
|
70
|
-
|
|
71
|
-
default:
|
|
72
|
-
|
|
73
|
-
|
|
37
|
+
} }), (m, p) => (ne(), un(dn, { to: "body" }, [
|
|
38
|
+
cn(fn, { name: "fade" }, {
|
|
39
|
+
default: hn(() => [
|
|
40
|
+
rt(Z("div", Cn, [
|
|
41
|
+
Z("div", {
|
|
74
42
|
class: "modal-overlay",
|
|
75
|
-
onClick:
|
|
43
|
+
onClick: vn(u, ["self"])
|
|
76
44
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
45
|
+
Z("div", {
|
|
46
|
+
class: at(["modal-container", e.class]),
|
|
79
47
|
ref_key: "modalContainer",
|
|
80
48
|
ref: r
|
|
81
49
|
}, [
|
|
82
|
-
|
|
50
|
+
Z("button", {
|
|
83
51
|
type: "button",
|
|
84
52
|
class: "btn-close",
|
|
85
53
|
"aria-label": "Close",
|
|
86
54
|
onClick: u
|
|
87
|
-
},
|
|
88
|
-
e.title ? (
|
|
89
|
-
|
|
90
|
-
|
|
55
|
+
}, In),
|
|
56
|
+
e.title ? (ne(), ie("div", Sn, we(e.title), 1)) : me("", !0),
|
|
57
|
+
Z("div", On, [
|
|
58
|
+
Ze(m.$slots, "body", {}, void 0, !0)
|
|
91
59
|
]),
|
|
92
|
-
m.$slots.footer ? (
|
|
93
|
-
|
|
94
|
-
])) :
|
|
60
|
+
m.$slots.footer ? (ne(), ie("div", En, [
|
|
61
|
+
Ze(m.$slots, "footer", {}, void 0, !0)
|
|
62
|
+
])) : me("", !0)
|
|
95
63
|
], 2)
|
|
96
|
-
], 8,
|
|
64
|
+
], 8, wn)
|
|
97
65
|
], 512), [
|
|
98
|
-
[
|
|
66
|
+
[pn, i.value]
|
|
99
67
|
])
|
|
100
68
|
]),
|
|
101
69
|
_: 3
|
|
102
70
|
})
|
|
103
71
|
]));
|
|
104
72
|
}
|
|
105
|
-
}),
|
|
106
|
-
const
|
|
107
|
-
function
|
|
108
|
-
return
|
|
109
|
-
|
|
73
|
+
}), Vn = /* @__PURE__ */ Pt(An, [["__scopeId", "data-v-4304a677"]]);
|
|
74
|
+
const Ln = {}, Fn = { class: "cja-btn" };
|
|
75
|
+
function Nn(e, t) {
|
|
76
|
+
return ne(), ie("button", Fn, [
|
|
77
|
+
Ze(e.$slots, "default", {}, void 0, !0)
|
|
110
78
|
]);
|
|
111
79
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
114
|
-
return
|
|
80
|
+
const Dn = /* @__PURE__ */ Pt(Ln, [["render", Nn], ["__scopeId", "data-v-7ee82961"]]);
|
|
81
|
+
function Tn() {
|
|
82
|
+
return jt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
115
83
|
}
|
|
116
|
-
function
|
|
84
|
+
function jt() {
|
|
117
85
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
118
86
|
}
|
|
119
|
-
const
|
|
120
|
-
let be,
|
|
121
|
-
function
|
|
87
|
+
const Mn = typeof Proxy == "function", Pn = "devtools-plugin:setup", jn = "plugin:settings:set";
|
|
88
|
+
let be, Ye;
|
|
89
|
+
function Bn() {
|
|
122
90
|
var e;
|
|
123
|
-
return be !== void 0 || (typeof window < "u" && window.performance ? (be = !0,
|
|
91
|
+
return be !== void 0 || (typeof window < "u" && window.performance ? (be = !0, Ye = window.performance) : typeof global < "u" && ((e = global.perf_hooks) === null || e === void 0 ? void 0 : e.performance) ? (be = !0, Ye = global.perf_hooks.performance) : be = !1), be;
|
|
124
92
|
}
|
|
125
|
-
function
|
|
126
|
-
return
|
|
93
|
+
function Un() {
|
|
94
|
+
return Bn() ? Ye.now() : Date.now();
|
|
127
95
|
}
|
|
128
|
-
class
|
|
96
|
+
class xn {
|
|
129
97
|
constructor(t, n) {
|
|
130
98
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
|
|
131
99
|
const i = {};
|
|
@@ -153,9 +121,9 @@ class Yn {
|
|
|
153
121
|
o = u;
|
|
154
122
|
},
|
|
155
123
|
now() {
|
|
156
|
-
return
|
|
124
|
+
return Un();
|
|
157
125
|
}
|
|
158
|
-
}, n && n.on(
|
|
126
|
+
}, n && n.on(jn, (u, d) => {
|
|
159
127
|
u === this.plugin.id && this.fallbacks.setSettings(d);
|
|
160
128
|
}), this.proxiedOn = new Proxy({}, {
|
|
161
129
|
get: (u, d) => this.target ? this.target.on[d] : (...m) => {
|
|
@@ -187,12 +155,12 @@ class Yn {
|
|
|
187
155
|
n.resolve(await this.target[n.method](...n.args));
|
|
188
156
|
}
|
|
189
157
|
}
|
|
190
|
-
function
|
|
191
|
-
const n = e, i =
|
|
158
|
+
function Rn(e, t) {
|
|
159
|
+
const n = e, i = jt(), r = Tn(), o = Mn && n.enableEarlyProxy;
|
|
192
160
|
if (r && (i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
|
|
193
|
-
r.emit(
|
|
161
|
+
r.emit(Pn, e, t);
|
|
194
162
|
else {
|
|
195
|
-
const u = o ? new
|
|
163
|
+
const u = o ? new xn(n, r) : null;
|
|
196
164
|
(i.__VUE_DEVTOOLS_PLUGINS__ = i.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
197
165
|
pluginDescriptor: n,
|
|
198
166
|
setupFn: t,
|
|
@@ -211,20 +179,20 @@ function ke(e) {
|
|
|
211
179
|
function Le(e) {
|
|
212
180
|
return e == null;
|
|
213
181
|
}
|
|
214
|
-
const
|
|
215
|
-
function
|
|
182
|
+
const fe = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
|
|
183
|
+
function Bt(e) {
|
|
216
184
|
return Number(e) >= 0;
|
|
217
185
|
}
|
|
218
|
-
function
|
|
186
|
+
function zn(e) {
|
|
219
187
|
const t = parseFloat(e);
|
|
220
188
|
return isNaN(t) ? e : t;
|
|
221
189
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
return
|
|
190
|
+
const Gn = {};
|
|
191
|
+
function $n(e) {
|
|
192
|
+
return Gn[e];
|
|
225
193
|
}
|
|
226
|
-
const Me = Symbol("vee-validate-form"),
|
|
227
|
-
function
|
|
194
|
+
const Me = Symbol("vee-validate-form"), Hn = Symbol("vee-validate-field-instance"), ze = Symbol("Default empty value"), Kn = typeof window < "u";
|
|
195
|
+
function Xe(e) {
|
|
228
196
|
return ke(e) && !!e.__locatorRef;
|
|
229
197
|
}
|
|
230
198
|
function Fe(e) {
|
|
@@ -233,35 +201,35 @@ function Fe(e) {
|
|
|
233
201
|
function Ie(e) {
|
|
234
202
|
return e === "checkbox" || e === "radio";
|
|
235
203
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
204
|
+
function qn(e) {
|
|
205
|
+
return fe(e) || Array.isArray(e);
|
|
238
206
|
}
|
|
239
|
-
function
|
|
240
|
-
return Array.isArray(e) ? e.length === 0 :
|
|
207
|
+
function Ut(e) {
|
|
208
|
+
return Array.isArray(e) ? e.length === 0 : fe(e) && Object.keys(e).length === 0;
|
|
241
209
|
}
|
|
242
210
|
function Ge(e) {
|
|
243
211
|
return /^\[.+\]$/i.test(e);
|
|
244
212
|
}
|
|
245
|
-
function
|
|
246
|
-
return
|
|
213
|
+
function Wn(e) {
|
|
214
|
+
return xt(e) && e.multiple;
|
|
247
215
|
}
|
|
248
|
-
function
|
|
216
|
+
function xt(e) {
|
|
249
217
|
return e.tagName === "SELECT";
|
|
250
218
|
}
|
|
251
|
-
function
|
|
219
|
+
function Jn(e, t) {
|
|
252
220
|
const n = ![!1, null, void 0, 0].includes(t.multiple) && !Number.isNaN(t.multiple);
|
|
253
221
|
return e === "select" && "multiple" in t && n;
|
|
254
222
|
}
|
|
255
|
-
function
|
|
256
|
-
return !
|
|
223
|
+
function Qn(e, t) {
|
|
224
|
+
return !Jn(e, t) && t.type !== "file" && !Ie(t.type);
|
|
257
225
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
226
|
+
function Rt(e) {
|
|
227
|
+
return ut(e) && e.target && "submit" in e.target;
|
|
260
228
|
}
|
|
261
|
-
function
|
|
229
|
+
function ut(e) {
|
|
262
230
|
return e ? !!(typeof Event < "u" && ke(Event) && e instanceof Event || e && e.srcElement) : !1;
|
|
263
231
|
}
|
|
264
|
-
function
|
|
232
|
+
function yt(e, t) {
|
|
265
233
|
return t in e && e[t] !== ze;
|
|
266
234
|
}
|
|
267
235
|
function G(e, t) {
|
|
@@ -290,7 +258,7 @@ function G(e, t) {
|
|
|
290
258
|
return !1;
|
|
291
259
|
return !0;
|
|
292
260
|
}
|
|
293
|
-
if (
|
|
261
|
+
if (bt(e) && bt(t))
|
|
294
262
|
return !(e.size !== t.size || e.name !== t.name || e.lastModified !== t.lastModified || e.type !== t.type);
|
|
295
263
|
if (e instanceof Set && t instanceof Set) {
|
|
296
264
|
if (e.size !== t.size)
|
|
@@ -328,10 +296,10 @@ function G(e, t) {
|
|
|
328
296
|
}
|
|
329
297
|
return e !== e && t !== t;
|
|
330
298
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
299
|
+
function bt(e) {
|
|
300
|
+
return Kn ? e instanceof File : !1;
|
|
333
301
|
}
|
|
334
|
-
function
|
|
302
|
+
function _t(e, t, n) {
|
|
335
303
|
typeof n.value == "object" && (n.value = T(n.value)), !n.enumerable || n.get || n.set || !n.configurable || !n.writable || t === "__proto__" ? Object.defineProperty(e, t, n) : e[t] = n.value;
|
|
336
304
|
}
|
|
337
305
|
function T(e) {
|
|
@@ -344,21 +312,21 @@ function T(e) {
|
|
|
344
312
|
r.set(T(d), T(u));
|
|
345
313
|
})) : o === "[object Date]" ? r = new Date(+e) : o === "[object RegExp]" ? r = new RegExp(e.source, e.flags) : o === "[object DataView]" ? r = new e.constructor(T(e.buffer)) : o === "[object ArrayBuffer]" ? r = e.slice(0) : o.slice(-6) === "Array]" && (r = new e.constructor(e)), r) {
|
|
346
314
|
for (i = Object.getOwnPropertySymbols(e); t < i.length; t++)
|
|
347
|
-
|
|
315
|
+
_t(r, i[t], Object.getOwnPropertyDescriptor(e, i[t]));
|
|
348
316
|
for (t = 0, i = Object.getOwnPropertyNames(e); t < i.length; t++)
|
|
349
|
-
Object.hasOwnProperty.call(r, n = i[t]) && r[n] === e[n] ||
|
|
317
|
+
Object.hasOwnProperty.call(r, n = i[t]) && r[n] === e[n] || _t(r, n, Object.getOwnPropertyDescriptor(e, n));
|
|
350
318
|
}
|
|
351
319
|
return r || e;
|
|
352
320
|
}
|
|
353
|
-
function
|
|
321
|
+
function dt(e) {
|
|
354
322
|
return Ge(e) ? e.replace(/\[|\]/gi, "") : e;
|
|
355
323
|
}
|
|
356
|
-
function
|
|
357
|
-
return e ? Ge(t) ? e[
|
|
324
|
+
function U(e, t, n) {
|
|
325
|
+
return e ? Ge(t) ? e[dt(t)] : (t || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((r, o) => qn(r) && o in r ? r[o] : n, e) : n;
|
|
358
326
|
}
|
|
359
|
-
function
|
|
327
|
+
function se(e, t, n) {
|
|
360
328
|
if (Ge(t)) {
|
|
361
|
-
e[
|
|
329
|
+
e[dt(t)] = n;
|
|
362
330
|
return;
|
|
363
331
|
}
|
|
364
332
|
const i = t.split(/\.|\[(\d+)\]/).filter(Boolean);
|
|
@@ -368,70 +336,70 @@ function ue(e, t, n) {
|
|
|
368
336
|
r[i[o]] = n;
|
|
369
337
|
return;
|
|
370
338
|
}
|
|
371
|
-
(!(i[o] in r) || Le(r[i[o]])) && (r[i[o]] =
|
|
339
|
+
(!(i[o] in r) || Le(r[i[o]])) && (r[i[o]] = Bt(i[o + 1]) ? [] : {}), r = r[i[o]];
|
|
372
340
|
}
|
|
373
341
|
}
|
|
374
|
-
function
|
|
375
|
-
if (Array.isArray(e) &&
|
|
342
|
+
function qe(e, t) {
|
|
343
|
+
if (Array.isArray(e) && Bt(t)) {
|
|
376
344
|
e.splice(Number(t), 1);
|
|
377
345
|
return;
|
|
378
346
|
}
|
|
379
|
-
|
|
347
|
+
fe(e) && delete e[t];
|
|
380
348
|
}
|
|
381
349
|
function Be(e, t) {
|
|
382
350
|
if (Ge(t)) {
|
|
383
|
-
delete e[
|
|
351
|
+
delete e[dt(t)];
|
|
384
352
|
return;
|
|
385
353
|
}
|
|
386
354
|
const n = t.split(/\.|\[(\d+)\]/).filter(Boolean);
|
|
387
355
|
let i = e;
|
|
388
356
|
for (let o = 0; o < n.length; o++) {
|
|
389
357
|
if (o === n.length - 1) {
|
|
390
|
-
|
|
358
|
+
qe(i, n[o]);
|
|
391
359
|
break;
|
|
392
360
|
}
|
|
393
361
|
if (!(n[o] in i) || Le(i[n[o]]))
|
|
394
362
|
break;
|
|
395
363
|
i = i[n[o]];
|
|
396
364
|
}
|
|
397
|
-
const r = n.map((o, u) =>
|
|
365
|
+
const r = n.map((o, u) => U(e, n.slice(0, u).join(".")));
|
|
398
366
|
for (let o = r.length - 1; o >= 0; o--)
|
|
399
|
-
if (!!
|
|
367
|
+
if (!!Ut(r[o])) {
|
|
400
368
|
if (o === 0) {
|
|
401
|
-
|
|
369
|
+
qe(e, n[0]);
|
|
402
370
|
continue;
|
|
403
371
|
}
|
|
404
|
-
|
|
372
|
+
qe(r[o - 1], n[o - 1]);
|
|
405
373
|
}
|
|
406
374
|
}
|
|
407
|
-
function
|
|
375
|
+
function R(e) {
|
|
408
376
|
return Object.keys(e);
|
|
409
377
|
}
|
|
410
|
-
function
|
|
378
|
+
function ct(e, t = void 0) {
|
|
411
379
|
const n = Te();
|
|
412
|
-
return (n == null ? void 0 : n.provides[e]) ||
|
|
380
|
+
return (n == null ? void 0 : n.provides[e]) || Nt(e, t);
|
|
413
381
|
}
|
|
414
|
-
function
|
|
415
|
-
|
|
382
|
+
function We(e) {
|
|
383
|
+
Tt(`[vee-validate]: ${e}`);
|
|
416
384
|
}
|
|
417
|
-
function
|
|
385
|
+
function Zn(e) {
|
|
418
386
|
return Array.isArray(e) ? e[0] : e;
|
|
419
387
|
}
|
|
420
|
-
function
|
|
388
|
+
function et(e, t, n) {
|
|
421
389
|
if (Array.isArray(e)) {
|
|
422
390
|
const i = [...e], r = i.findIndex((o) => G(o, t));
|
|
423
391
|
return r >= 0 ? i.splice(r, 1) : i.push(t), i;
|
|
424
392
|
}
|
|
425
393
|
return G(e, t) ? n : t;
|
|
426
394
|
}
|
|
427
|
-
function
|
|
395
|
+
function Yn(e, t) {
|
|
428
396
|
let n, i;
|
|
429
397
|
return function(...r) {
|
|
430
398
|
const o = this;
|
|
431
399
|
return n || (n = !0, setTimeout(() => n = !1, t), i = e.apply(o, r)), i;
|
|
432
400
|
};
|
|
433
401
|
}
|
|
434
|
-
function
|
|
402
|
+
function Ct(e, t = 0) {
|
|
435
403
|
let n = null, i = [];
|
|
436
404
|
return function(...r) {
|
|
437
405
|
return n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -440,10 +408,10 @@ function It(e, t = 0) {
|
|
|
440
408
|
}, t), new Promise((o) => i.push(o));
|
|
441
409
|
};
|
|
442
410
|
}
|
|
443
|
-
function
|
|
444
|
-
return
|
|
411
|
+
function Xn(e, t) {
|
|
412
|
+
return fe(t) && t.number ? zn(e) : e;
|
|
445
413
|
}
|
|
446
|
-
function
|
|
414
|
+
function tt(e, t) {
|
|
447
415
|
let n;
|
|
448
416
|
return async function(...r) {
|
|
449
417
|
const o = e(...r);
|
|
@@ -452,84 +420,84 @@ function nt(e, t) {
|
|
|
452
420
|
return o !== n || (n = void 0, t(u, r)), u;
|
|
453
421
|
};
|
|
454
422
|
}
|
|
455
|
-
function
|
|
456
|
-
const n =
|
|
457
|
-
return
|
|
423
|
+
function ei({ get: e, set: t }) {
|
|
424
|
+
const n = X(T(e()));
|
|
425
|
+
return W(e, (i) => {
|
|
458
426
|
G(i, n.value) || (n.value = T(i));
|
|
459
427
|
}, {
|
|
460
428
|
deep: !0
|
|
461
|
-
}),
|
|
429
|
+
}), W(n, (i) => {
|
|
462
430
|
G(i, e()) || t(T(i));
|
|
463
431
|
}, {
|
|
464
432
|
deep: !0
|
|
465
433
|
}), n;
|
|
466
434
|
}
|
|
467
|
-
const
|
|
435
|
+
const $e = (e, t, n) => t.slots.default ? typeof e == "string" || !e ? t.slots.default(n()) : {
|
|
468
436
|
default: () => {
|
|
469
437
|
var i, r;
|
|
470
438
|
return (r = (i = t.slots).default) === null || r === void 0 ? void 0 : r.call(i, n());
|
|
471
439
|
}
|
|
472
440
|
} : t.slots.default;
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
441
|
+
function Je(e) {
|
|
442
|
+
if (zt(e))
|
|
475
443
|
return e._value;
|
|
476
444
|
}
|
|
477
|
-
function
|
|
445
|
+
function zt(e) {
|
|
478
446
|
return "_value" in e;
|
|
479
447
|
}
|
|
480
|
-
function
|
|
481
|
-
if (!
|
|
448
|
+
function ft(e) {
|
|
449
|
+
if (!ut(e))
|
|
482
450
|
return e;
|
|
483
451
|
const t = e.target;
|
|
484
|
-
if (Ie(t.type) &&
|
|
485
|
-
return
|
|
452
|
+
if (Ie(t.type) && zt(t))
|
|
453
|
+
return Je(t);
|
|
486
454
|
if (t.type === "file" && t.files) {
|
|
487
455
|
const n = Array.from(t.files);
|
|
488
456
|
return t.multiple ? n : n[0];
|
|
489
457
|
}
|
|
490
|
-
if (
|
|
491
|
-
return Array.from(t.options).filter((n) => n.selected && !n.disabled).map(
|
|
492
|
-
if (
|
|
458
|
+
if (Wn(t))
|
|
459
|
+
return Array.from(t.options).filter((n) => n.selected && !n.disabled).map(Je);
|
|
460
|
+
if (xt(t)) {
|
|
493
461
|
const n = Array.from(t.options).find((i) => i.selected);
|
|
494
|
-
return n ?
|
|
462
|
+
return n ? Je(n) : t.value;
|
|
495
463
|
}
|
|
496
464
|
return t.value;
|
|
497
465
|
}
|
|
498
|
-
function
|
|
466
|
+
function Gt(e) {
|
|
499
467
|
const t = {};
|
|
500
468
|
return Object.defineProperty(t, "_$$isNormalized", {
|
|
501
469
|
value: !0,
|
|
502
470
|
writable: !1,
|
|
503
471
|
enumerable: !1,
|
|
504
472
|
configurable: !1
|
|
505
|
-
}), e ?
|
|
506
|
-
const r =
|
|
507
|
-
return e[i] !== !1 && (n[i] =
|
|
473
|
+
}), e ? fe(e) && e._$$isNormalized ? e : fe(e) ? Object.keys(e).reduce((n, i) => {
|
|
474
|
+
const r = ti(e[i]);
|
|
475
|
+
return e[i] !== !1 && (n[i] = wt(r)), n;
|
|
508
476
|
}, t) : typeof e != "string" ? t : e.split("|").reduce((n, i) => {
|
|
509
|
-
const r =
|
|
510
|
-
return r.name && (n[r.name] =
|
|
477
|
+
const r = ni(i);
|
|
478
|
+
return r.name && (n[r.name] = wt(r.params)), n;
|
|
511
479
|
}, t) : t;
|
|
512
480
|
}
|
|
513
|
-
function
|
|
514
|
-
return e === !0 ? [] : Array.isArray(e) ||
|
|
481
|
+
function ti(e) {
|
|
482
|
+
return e === !0 ? [] : Array.isArray(e) || fe(e) ? e : [e];
|
|
515
483
|
}
|
|
516
|
-
function
|
|
517
|
-
const t = (n) => typeof n == "string" && n[0] === "@" ?
|
|
484
|
+
function wt(e) {
|
|
485
|
+
const t = (n) => typeof n == "string" && n[0] === "@" ? ii(n.slice(1)) : n;
|
|
518
486
|
return Array.isArray(e) ? e.map(t) : e instanceof RegExp ? [e] : Object.keys(e).reduce((n, i) => (n[i] = t(e[i]), n), {});
|
|
519
487
|
}
|
|
520
|
-
const
|
|
488
|
+
const ni = (e) => {
|
|
521
489
|
let t = [];
|
|
522
490
|
const n = e.split(":")[0];
|
|
523
491
|
return e.includes(":") && (t = e.split(":").slice(1).join(":").split(",")), { name: n, params: t };
|
|
524
492
|
};
|
|
525
|
-
function
|
|
526
|
-
const t = (n) =>
|
|
493
|
+
function ii(e) {
|
|
494
|
+
const t = (n) => U(n, e) || n[e];
|
|
527
495
|
return t.__locatorRef = e, t;
|
|
528
496
|
}
|
|
529
|
-
function
|
|
530
|
-
return Array.isArray(e) ? e.filter(
|
|
497
|
+
function ri(e) {
|
|
498
|
+
return Array.isArray(e) ? e.filter(Xe) : R(e).filter((t) => Xe(e[t])).map((t) => e[t]);
|
|
531
499
|
}
|
|
532
|
-
const
|
|
500
|
+
const ai = {
|
|
533
501
|
generateMessage: ({ field: e }) => `${e} is not valid.`,
|
|
534
502
|
bails: !0,
|
|
535
503
|
validateOnBlur: !0,
|
|
@@ -537,24 +505,24 @@ const gi = {
|
|
|
537
505
|
validateOnInput: !1,
|
|
538
506
|
validateOnModelUpdate: !0
|
|
539
507
|
};
|
|
540
|
-
let
|
|
541
|
-
const
|
|
542
|
-
async function
|
|
508
|
+
let oi = Object.assign({}, ai);
|
|
509
|
+
const ht = () => oi;
|
|
510
|
+
async function $t(e, t, n = {}) {
|
|
543
511
|
const i = n == null ? void 0 : n.bails, r = {
|
|
544
512
|
name: (n == null ? void 0 : n.name) || "{field}",
|
|
545
513
|
rules: t,
|
|
546
514
|
label: n == null ? void 0 : n.label,
|
|
547
515
|
bails: i != null ? i : !0,
|
|
548
516
|
formData: (n == null ? void 0 : n.values) || {}
|
|
549
|
-
}, u = (await
|
|
517
|
+
}, u = (await li(r, e)).errors;
|
|
550
518
|
return {
|
|
551
519
|
errors: u,
|
|
552
520
|
valid: !u.length
|
|
553
521
|
};
|
|
554
522
|
}
|
|
555
|
-
async function
|
|
523
|
+
async function li(e, t) {
|
|
556
524
|
if (Fe(e.rules))
|
|
557
|
-
return
|
|
525
|
+
return si(t, e.rules, { bails: e.bails });
|
|
558
526
|
if (ke(e.rules) || Array.isArray(e.rules)) {
|
|
559
527
|
const u = {
|
|
560
528
|
field: e.label || e.name,
|
|
@@ -563,12 +531,12 @@ async function _i(e, t) {
|
|
|
563
531
|
form: e.formData,
|
|
564
532
|
value: t
|
|
565
533
|
}, d = Array.isArray(e.rules) ? e.rules : [e.rules], m = d.length, p = [];
|
|
566
|
-
for (let
|
|
567
|
-
const k = d[
|
|
534
|
+
for (let _ = 0; _ < m; _++) {
|
|
535
|
+
const k = d[_], S = await k(t, u);
|
|
568
536
|
if (typeof S != "string" && S)
|
|
569
537
|
continue;
|
|
570
|
-
const
|
|
571
|
-
if (p.push(
|
|
538
|
+
const j = typeof S == "string" ? S : Ht(u);
|
|
539
|
+
if (p.push(j), e.bails)
|
|
572
540
|
return {
|
|
573
541
|
errors: p
|
|
574
542
|
};
|
|
@@ -577,9 +545,9 @@ async function _i(e, t) {
|
|
|
577
545
|
errors: p
|
|
578
546
|
};
|
|
579
547
|
}
|
|
580
|
-
const n = Object.assign(Object.assign({}, e), { rules:
|
|
548
|
+
const n = Object.assign(Object.assign({}, e), { rules: Gt(e.rules) }), i = [], r = Object.keys(n.rules), o = r.length;
|
|
581
549
|
for (let u = 0; u < o; u++) {
|
|
582
|
-
const d = r[u], m = await
|
|
550
|
+
const d = r[u], m = await ui(n, t, {
|
|
583
551
|
name: d,
|
|
584
552
|
params: n.rules[d]
|
|
585
553
|
});
|
|
@@ -592,7 +560,7 @@ async function _i(e, t) {
|
|
|
592
560
|
errors: i
|
|
593
561
|
};
|
|
594
562
|
}
|
|
595
|
-
async function
|
|
563
|
+
async function si(e, t, n) {
|
|
596
564
|
var i;
|
|
597
565
|
return {
|
|
598
566
|
errors: await t.validate(e, {
|
|
@@ -604,11 +572,11 @@ async function bi(e, t, n) {
|
|
|
604
572
|
})
|
|
605
573
|
};
|
|
606
574
|
}
|
|
607
|
-
async function
|
|
608
|
-
const i =
|
|
575
|
+
async function ui(e, t, n) {
|
|
576
|
+
const i = $n(n.name);
|
|
609
577
|
if (!i)
|
|
610
578
|
throw new Error(`No such validator '${n.name}' exists.`);
|
|
611
|
-
const r =
|
|
579
|
+
const r = di(n.params, e.formData), o = {
|
|
612
580
|
field: e.label || e.name,
|
|
613
581
|
name: e.name,
|
|
614
582
|
label: e.label,
|
|
@@ -619,18 +587,18 @@ async function Ci(e, t, n) {
|
|
|
619
587
|
return typeof u == "string" ? {
|
|
620
588
|
error: u
|
|
621
589
|
} : {
|
|
622
|
-
error: u ? void 0 :
|
|
590
|
+
error: u ? void 0 : Ht(o)
|
|
623
591
|
};
|
|
624
592
|
}
|
|
625
|
-
function
|
|
626
|
-
const t =
|
|
593
|
+
function Ht(e) {
|
|
594
|
+
const t = ht().generateMessage;
|
|
627
595
|
return t ? t(e) : "Field is invalid";
|
|
628
596
|
}
|
|
629
|
-
function
|
|
630
|
-
const n = (i) =>
|
|
597
|
+
function di(e, t) {
|
|
598
|
+
const n = (i) => Xe(i) ? i(t) : i;
|
|
631
599
|
return Array.isArray(e) ? e.map(n) : Object.keys(e).reduce((i, r) => (i[r] = n(e[r]), i), {});
|
|
632
600
|
}
|
|
633
|
-
async function
|
|
601
|
+
async function ci(e, t) {
|
|
634
602
|
const n = await e.validate(t, { abortEarly: !1 }).then(() => []).catch((o) => {
|
|
635
603
|
if (o.name !== "ValidationError")
|
|
636
604
|
throw o;
|
|
@@ -646,16 +614,16 @@ async function ki(e, t) {
|
|
|
646
614
|
errors: r
|
|
647
615
|
};
|
|
648
616
|
}
|
|
649
|
-
async function
|
|
650
|
-
const r =
|
|
651
|
-
var
|
|
652
|
-
const A = (
|
|
617
|
+
async function fi(e, t, n) {
|
|
618
|
+
const r = R(e).map(async (p) => {
|
|
619
|
+
var _, k, S;
|
|
620
|
+
const A = (_ = n == null ? void 0 : n.names) === null || _ === void 0 ? void 0 : _[p], j = await $t(U(t, p), e[p], {
|
|
653
621
|
name: (A == null ? void 0 : A.name) || p,
|
|
654
622
|
label: A == null ? void 0 : A.label,
|
|
655
623
|
values: t,
|
|
656
624
|
bails: (S = (k = n == null ? void 0 : n.bailsMap) === null || k === void 0 ? void 0 : k[p]) !== null && S !== void 0 ? S : !0
|
|
657
625
|
});
|
|
658
|
-
return Object.assign(Object.assign({},
|
|
626
|
+
return Object.assign(Object.assign({}, j), { path: p });
|
|
659
627
|
});
|
|
660
628
|
let o = !0;
|
|
661
629
|
const u = await Promise.all(r), d = {}, m = {};
|
|
@@ -670,10 +638,10 @@ async function Ii(e, t, n) {
|
|
|
670
638
|
errors: m
|
|
671
639
|
};
|
|
672
640
|
}
|
|
673
|
-
let
|
|
674
|
-
function
|
|
675
|
-
const { value: n, initialValue: i, setInitialValue: r } =
|
|
676
|
-
function
|
|
641
|
+
let kt = 0;
|
|
642
|
+
function hi(e, t) {
|
|
643
|
+
const { value: n, initialValue: i, setInitialValue: r } = Kt(e, t.modelValue, t.form), { errorMessage: o, errors: u, setErrors: d } = pi(e, t.form), m = vi(n, i, u), p = kt >= Number.MAX_SAFE_INTEGER ? 0 : ++kt;
|
|
644
|
+
function _(k) {
|
|
677
645
|
var S;
|
|
678
646
|
"value" in k && (n.value = k.value), "errors" in k && d(k.errors), "touched" in k && (m.touched = (S = k.touched) !== null && S !== void 0 ? S : m.touched), "initialValue" in k && r(k.initialValue);
|
|
679
647
|
}
|
|
@@ -685,123 +653,123 @@ function Si(e, t) {
|
|
|
685
653
|
meta: m,
|
|
686
654
|
errors: u,
|
|
687
655
|
errorMessage: o,
|
|
688
|
-
setState:
|
|
656
|
+
setState: _
|
|
689
657
|
};
|
|
690
658
|
}
|
|
691
|
-
function
|
|
692
|
-
const i =
|
|
659
|
+
function Kt(e, t, n) {
|
|
660
|
+
const i = X(b(t));
|
|
693
661
|
function r() {
|
|
694
|
-
return n ?
|
|
662
|
+
return n ? U(n.meta.value.initialValues, b(e), b(i)) : b(i);
|
|
695
663
|
}
|
|
696
664
|
function o(p) {
|
|
697
665
|
if (!n) {
|
|
698
666
|
i.value = p;
|
|
699
667
|
return;
|
|
700
668
|
}
|
|
701
|
-
n.stageInitialValue(
|
|
669
|
+
n.stageInitialValue(b(e), p, !0);
|
|
702
670
|
}
|
|
703
|
-
const u =
|
|
671
|
+
const u = z(r);
|
|
704
672
|
if (!n)
|
|
705
673
|
return {
|
|
706
|
-
value:
|
|
674
|
+
value: X(r()),
|
|
707
675
|
initialValue: u,
|
|
708
676
|
setInitialValue: o
|
|
709
677
|
};
|
|
710
|
-
const d = t ?
|
|
711
|
-
return n.stageInitialValue(
|
|
712
|
-
value:
|
|
678
|
+
const d = t ? b(t) : U(n.values, b(e), b(u));
|
|
679
|
+
return n.stageInitialValue(b(e), d, !0), {
|
|
680
|
+
value: z({
|
|
713
681
|
get() {
|
|
714
|
-
return
|
|
682
|
+
return U(n.values, b(e));
|
|
715
683
|
},
|
|
716
684
|
set(p) {
|
|
717
|
-
n.setFieldValue(
|
|
685
|
+
n.setFieldValue(b(e), p);
|
|
718
686
|
}
|
|
719
687
|
}),
|
|
720
688
|
initialValue: u,
|
|
721
689
|
setInitialValue: o
|
|
722
690
|
};
|
|
723
691
|
}
|
|
724
|
-
function
|
|
725
|
-
const i =
|
|
692
|
+
function vi(e, t, n) {
|
|
693
|
+
const i = st({
|
|
726
694
|
touched: !1,
|
|
727
695
|
pending: !1,
|
|
728
696
|
valid: !0,
|
|
729
|
-
validated: !!
|
|
730
|
-
initialValue:
|
|
731
|
-
dirty:
|
|
697
|
+
validated: !!b(n).length,
|
|
698
|
+
initialValue: z(() => b(t)),
|
|
699
|
+
dirty: z(() => !G(b(e), b(t)))
|
|
732
700
|
});
|
|
733
|
-
return
|
|
701
|
+
return W(n, (r) => {
|
|
734
702
|
i.valid = !r.length;
|
|
735
703
|
}, {
|
|
736
704
|
immediate: !0,
|
|
737
705
|
flush: "sync"
|
|
738
706
|
}), i;
|
|
739
707
|
}
|
|
740
|
-
function
|
|
708
|
+
function pi(e, t) {
|
|
741
709
|
function n(r) {
|
|
742
710
|
return r ? Array.isArray(r) ? r : [r] : [];
|
|
743
711
|
}
|
|
744
712
|
if (!t) {
|
|
745
|
-
const r =
|
|
713
|
+
const r = X([]);
|
|
746
714
|
return {
|
|
747
715
|
errors: r,
|
|
748
|
-
errorMessage:
|
|
716
|
+
errorMessage: z(() => r.value[0]),
|
|
749
717
|
setErrors: (o) => {
|
|
750
718
|
r.value = n(o);
|
|
751
719
|
}
|
|
752
720
|
};
|
|
753
721
|
}
|
|
754
|
-
const i =
|
|
722
|
+
const i = z(() => t.errorBag.value[b(e)] || []);
|
|
755
723
|
return {
|
|
756
724
|
errors: i,
|
|
757
|
-
errorMessage:
|
|
725
|
+
errorMessage: z(() => i.value[0]),
|
|
758
726
|
setErrors: (r) => {
|
|
759
|
-
t.setFieldErrorBag(
|
|
727
|
+
t.setFieldErrorBag(b(e), n(r));
|
|
760
728
|
}
|
|
761
729
|
};
|
|
762
730
|
}
|
|
763
|
-
function
|
|
764
|
-
process.env.NODE_ENV !== "production" &&
|
|
731
|
+
function qt(e) {
|
|
732
|
+
process.env.NODE_ENV !== "production" && Rn({
|
|
765
733
|
id: "vee-validate-devtools-plugin",
|
|
766
734
|
label: "VeeValidate Plugin",
|
|
767
735
|
packageName: "vee-validate",
|
|
768
736
|
homepage: "https://vee-validate.logaretm.com/v4",
|
|
769
737
|
app: e,
|
|
770
738
|
logo: "https://vee-validate.logaretm.com/v4/logo.png"
|
|
771
|
-
},
|
|
739
|
+
}, yi);
|
|
772
740
|
}
|
|
773
741
|
const Ne = {}, De = {};
|
|
774
|
-
let
|
|
775
|
-
const Se =
|
|
742
|
+
let ue;
|
|
743
|
+
const Se = Yn(() => {
|
|
776
744
|
setTimeout(async () => {
|
|
777
|
-
await
|
|
745
|
+
await _e(), ue == null || ue.sendInspectorState(Ce), ue == null || ue.sendInspectorTree(Ce);
|
|
778
746
|
}, 100);
|
|
779
747
|
}, 100);
|
|
780
|
-
function
|
|
748
|
+
function mi(e) {
|
|
781
749
|
const t = Te();
|
|
782
|
-
if (!
|
|
750
|
+
if (!ue) {
|
|
783
751
|
const n = t == null ? void 0 : t.appContext.app;
|
|
784
752
|
if (!n)
|
|
785
753
|
return;
|
|
786
|
-
|
|
754
|
+
qt(n);
|
|
787
755
|
}
|
|
788
|
-
Ne[e.formId] = Object.assign({}, e), Ne[e.formId]._vm = t,
|
|
756
|
+
Ne[e.formId] = Object.assign({}, e), Ne[e.formId]._vm = t, Dt(() => {
|
|
789
757
|
delete Ne[e.formId], Se();
|
|
790
758
|
}), Se();
|
|
791
759
|
}
|
|
792
|
-
function
|
|
760
|
+
function gi(e) {
|
|
793
761
|
const t = Te();
|
|
794
|
-
if (!
|
|
762
|
+
if (!ue) {
|
|
795
763
|
const n = t == null ? void 0 : t.appContext.app;
|
|
796
764
|
if (!n)
|
|
797
765
|
return;
|
|
798
|
-
|
|
766
|
+
qt(n);
|
|
799
767
|
}
|
|
800
|
-
De[e.id] = Object.assign({}, e), De[e.id]._vm = t,
|
|
768
|
+
De[e.id] = Object.assign({}, e), De[e.id]._vm = t, Dt(() => {
|
|
801
769
|
delete De[e.id], Se();
|
|
802
770
|
}), Se();
|
|
803
771
|
}
|
|
804
|
-
const
|
|
772
|
+
const Ce = "vee-validate-inspector", Y = {
|
|
805
773
|
error: 12405579,
|
|
806
774
|
success: 448379,
|
|
807
775
|
unknown: 5522283,
|
|
@@ -812,10 +780,10 @@ const we = "vee-validate-inspector", X = {
|
|
|
812
780
|
orange: 16099682,
|
|
813
781
|
gray: 12304330
|
|
814
782
|
};
|
|
815
|
-
let
|
|
816
|
-
function
|
|
817
|
-
|
|
818
|
-
id:
|
|
783
|
+
let le = null;
|
|
784
|
+
function yi(e) {
|
|
785
|
+
ue = e, e.addInspector({
|
|
786
|
+
id: Ce,
|
|
819
787
|
icon: "rule",
|
|
820
788
|
label: "vee-validate",
|
|
821
789
|
noSelectionText: "Select a vee-validate node to inspect",
|
|
@@ -824,11 +792,11 @@ function Li(e) {
|
|
|
824
792
|
icon: "done_outline",
|
|
825
793
|
tooltip: "Validate selected item",
|
|
826
794
|
action: async () => {
|
|
827
|
-
if (!
|
|
795
|
+
if (!le) {
|
|
828
796
|
console.error("There is not a valid selected vee-validate node or component");
|
|
829
797
|
return;
|
|
830
798
|
}
|
|
831
|
-
const t = await
|
|
799
|
+
const t = await le.validate();
|
|
832
800
|
console.log(t);
|
|
833
801
|
}
|
|
834
802
|
},
|
|
@@ -836,62 +804,62 @@ function Li(e) {
|
|
|
836
804
|
icon: "delete_sweep",
|
|
837
805
|
tooltip: "Clear validation state of the selected item",
|
|
838
806
|
action: () => {
|
|
839
|
-
if (!
|
|
807
|
+
if (!le) {
|
|
840
808
|
console.error("There is not a valid selected vee-validate node or component");
|
|
841
809
|
return;
|
|
842
810
|
}
|
|
843
|
-
if ("id" in
|
|
844
|
-
|
|
811
|
+
if ("id" in le) {
|
|
812
|
+
le.resetField();
|
|
845
813
|
return;
|
|
846
814
|
}
|
|
847
|
-
|
|
815
|
+
le.resetForm();
|
|
848
816
|
}
|
|
849
817
|
}
|
|
850
818
|
]
|
|
851
819
|
}), e.on.getInspectorTree((t) => {
|
|
852
|
-
if (t.inspectorId !==
|
|
820
|
+
if (t.inspectorId !== Ce)
|
|
853
821
|
return;
|
|
854
822
|
const n = Object.values(Ne), i = Object.values(De);
|
|
855
823
|
t.rootNodes = [
|
|
856
|
-
...n.map(
|
|
857
|
-
...i.map((r) =>
|
|
824
|
+
...n.map(bi),
|
|
825
|
+
...i.map((r) => vt(r))
|
|
858
826
|
];
|
|
859
827
|
}), e.on.getInspectorState((t, n) => {
|
|
860
|
-
if (t.inspectorId !==
|
|
828
|
+
if (t.inspectorId !== Ce || n.currentTab !== `custom-inspector:${Ce}`)
|
|
861
829
|
return;
|
|
862
|
-
const { form: i, field: r, type: o } =
|
|
830
|
+
const { form: i, field: r, type: o } = _i(t.nodeId);
|
|
863
831
|
if (i && o === "form") {
|
|
864
|
-
t.state =
|
|
832
|
+
t.state = wi(i), le = i;
|
|
865
833
|
return;
|
|
866
834
|
}
|
|
867
835
|
if (r && o === "field") {
|
|
868
|
-
t.state =
|
|
836
|
+
t.state = Ci(r), le = r;
|
|
869
837
|
return;
|
|
870
838
|
}
|
|
871
|
-
|
|
839
|
+
le = null;
|
|
872
840
|
});
|
|
873
841
|
}
|
|
874
|
-
function
|
|
875
|
-
const { textColor: t, bgColor: n } =
|
|
842
|
+
function bi(e) {
|
|
843
|
+
const { textColor: t, bgColor: n } = Jt(e), i = {};
|
|
876
844
|
Object.values(e.fieldsByPath.value).forEach((u) => {
|
|
877
845
|
const d = Array.isArray(u) ? u[0] : u;
|
|
878
|
-
!d ||
|
|
846
|
+
!d || se(i, b(d.name), vt(d, e));
|
|
879
847
|
});
|
|
880
848
|
function r(u, d = []) {
|
|
881
849
|
const m = [...d].pop();
|
|
882
|
-
return "id" in u ? Object.assign(Object.assign({}, u), { label: m || u.label }) :
|
|
850
|
+
return "id" in u ? Object.assign(Object.assign({}, u), { label: m || u.label }) : fe(u) ? {
|
|
883
851
|
id: `${d.join(".")}`,
|
|
884
852
|
label: m || "",
|
|
885
853
|
children: Object.keys(u).map((p) => r(u[p], [...d, p]))
|
|
886
854
|
} : Array.isArray(u) ? {
|
|
887
855
|
id: `${d.join(".")}`,
|
|
888
856
|
label: `${m}[]`,
|
|
889
|
-
children: u.map((p,
|
|
857
|
+
children: u.map((p, _) => r(p, [...d, String(_)]))
|
|
890
858
|
} : { id: "", label: "", children: [] };
|
|
891
859
|
}
|
|
892
860
|
const { children: o } = r(i);
|
|
893
861
|
return {
|
|
894
|
-
id:
|
|
862
|
+
id: Wt(e),
|
|
895
863
|
label: "Form",
|
|
896
864
|
children: o,
|
|
897
865
|
tags: [
|
|
@@ -902,18 +870,18 @@ function Fi(e) {
|
|
|
902
870
|
},
|
|
903
871
|
{
|
|
904
872
|
label: `${Object.keys(e.fieldsByPath.value).length} fields`,
|
|
905
|
-
textColor:
|
|
906
|
-
backgroundColor:
|
|
873
|
+
textColor: Y.white,
|
|
874
|
+
backgroundColor: Y.unknown
|
|
907
875
|
}
|
|
908
876
|
]
|
|
909
877
|
};
|
|
910
878
|
}
|
|
911
|
-
function
|
|
912
|
-
const n =
|
|
879
|
+
function vt(e, t) {
|
|
880
|
+
const n = Zn(e), { textColor: i, bgColor: r } = Jt(n), o = Array.isArray(e) && e.length > 1;
|
|
913
881
|
return {
|
|
914
|
-
id:
|
|
915
|
-
label:
|
|
916
|
-
children: Array.isArray(e) ? e.map((u) =>
|
|
882
|
+
id: Wt(t, n, !o),
|
|
883
|
+
label: b(n.name),
|
|
884
|
+
children: Array.isArray(e) ? e.map((u) => vt(u, t)) : void 0,
|
|
917
885
|
tags: [
|
|
918
886
|
o ? void 0 : {
|
|
919
887
|
label: "Field",
|
|
@@ -922,35 +890,35 @@ function gt(e, t) {
|
|
|
922
890
|
},
|
|
923
891
|
t ? void 0 : {
|
|
924
892
|
label: "Standalone",
|
|
925
|
-
textColor:
|
|
926
|
-
backgroundColor:
|
|
893
|
+
textColor: Y.black,
|
|
894
|
+
backgroundColor: Y.gray
|
|
927
895
|
},
|
|
928
896
|
!o && n.type === "checkbox" ? {
|
|
929
897
|
label: "Checkbox",
|
|
930
|
-
textColor:
|
|
931
|
-
backgroundColor:
|
|
898
|
+
textColor: Y.white,
|
|
899
|
+
backgroundColor: Y.blue
|
|
932
900
|
} : void 0,
|
|
933
901
|
!o && n.type === "radio" ? {
|
|
934
902
|
label: "Radio",
|
|
935
|
-
textColor:
|
|
936
|
-
backgroundColor:
|
|
903
|
+
textColor: Y.white,
|
|
904
|
+
backgroundColor: Y.purple
|
|
937
905
|
} : void 0,
|
|
938
906
|
o ? {
|
|
939
907
|
label: "Group",
|
|
940
|
-
textColor:
|
|
941
|
-
backgroundColor:
|
|
908
|
+
textColor: Y.black,
|
|
909
|
+
backgroundColor: Y.orange
|
|
942
910
|
} : void 0
|
|
943
911
|
].filter(Boolean)
|
|
944
912
|
};
|
|
945
913
|
}
|
|
946
|
-
function
|
|
947
|
-
const i = e ?
|
|
914
|
+
function Wt(e, t, n = !0) {
|
|
915
|
+
const i = e ? b(t == null ? void 0 : t.name) : t == null ? void 0 : t.id, r = i ? e == null ? void 0 : e.fieldsByPath.value[i] : void 0;
|
|
948
916
|
let o;
|
|
949
917
|
n && t && Array.isArray(r) && (o = r.indexOf(t));
|
|
950
918
|
const u = { f: e == null ? void 0 : e.formId, ff: i, idx: o, type: t ? "field" : "form" };
|
|
951
919
|
return btoa(JSON.stringify(u));
|
|
952
920
|
}
|
|
953
|
-
function
|
|
921
|
+
function _i(e) {
|
|
954
922
|
try {
|
|
955
923
|
const t = JSON.parse(atob(e)), n = Ne[t.f];
|
|
956
924
|
if (!n && t.ff) {
|
|
@@ -972,7 +940,7 @@ function Ni(e) {
|
|
|
972
940
|
}
|
|
973
941
|
return {};
|
|
974
942
|
}
|
|
975
|
-
function
|
|
943
|
+
function Ci(e) {
|
|
976
944
|
const { errors: t, meta: n, value: i } = e;
|
|
977
945
|
return {
|
|
978
946
|
"Field state": [
|
|
@@ -1000,7 +968,7 @@ function Di(e) {
|
|
|
1000
968
|
]
|
|
1001
969
|
};
|
|
1002
970
|
}
|
|
1003
|
-
function
|
|
971
|
+
function wi(e) {
|
|
1004
972
|
const { errorBag: t, meta: n, values: i, isSubmitting: r, submitCount: o } = e;
|
|
1005
973
|
return {
|
|
1006
974
|
"Form state": [
|
|
@@ -1034,7 +1002,7 @@ function Ti(e) {
|
|
|
1034
1002
|
},
|
|
1035
1003
|
{
|
|
1036
1004
|
key: "errors",
|
|
1037
|
-
value:
|
|
1005
|
+
value: R(t.value).reduce((u, d) => {
|
|
1038
1006
|
var m;
|
|
1039
1007
|
const p = (m = t.value[d]) === null || m === void 0 ? void 0 : m[0];
|
|
1040
1008
|
return p && (u[d] = p), u;
|
|
@@ -1043,81 +1011,81 @@ function Ti(e) {
|
|
|
1043
1011
|
]
|
|
1044
1012
|
};
|
|
1045
1013
|
}
|
|
1046
|
-
function
|
|
1014
|
+
function Jt(e) {
|
|
1047
1015
|
const t = "id" in e ? e.meta.valid : e.meta.value.valid;
|
|
1048
1016
|
return {
|
|
1049
|
-
bgColor: t ?
|
|
1050
|
-
textColor: t ?
|
|
1017
|
+
bgColor: t ? Y.success : Y.error,
|
|
1018
|
+
textColor: t ? Y.black : Y.white
|
|
1051
1019
|
};
|
|
1052
1020
|
}
|
|
1053
|
-
function
|
|
1054
|
-
return Ie(n == null ? void 0 : n.type) ?
|
|
1021
|
+
function pt(e, t, n) {
|
|
1022
|
+
return Ie(n == null ? void 0 : n.type) ? Si(e, t, n) : Qt(e, t, n);
|
|
1055
1023
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const { initialValue: i, validateOnMount: r, bails: o, type: u, checkedValue: d, label: m, validateOnValueUpdate: p, uncheckedValue:
|
|
1024
|
+
function Qt(e, t, n) {
|
|
1025
|
+
const { initialValue: i, validateOnMount: r, bails: o, type: u, checkedValue: d, label: m, validateOnValueUpdate: p, uncheckedValue: _, controlled: k, keepValueOnUnmount: S, modelPropName: A, syncVModel: j, form: $ } = ki(b(e), n), L = k ? ct(Me) : void 0, v = $ || L;
|
|
1058
1026
|
let l = !1;
|
|
1059
|
-
const { id: a, value: s, initialValue: c, meta: f, setState: y, errors: C, errorMessage: O } =
|
|
1027
|
+
const { id: a, value: s, initialValue: c, meta: f, setState: y, errors: C, errorMessage: O } = hi(e, {
|
|
1060
1028
|
modelValue: i,
|
|
1061
1029
|
form: v
|
|
1062
1030
|
});
|
|
1063
|
-
|
|
1064
|
-
const
|
|
1031
|
+
j && Oi({ value: s, prop: A, handleChange: M });
|
|
1032
|
+
const P = () => {
|
|
1065
1033
|
f.touched = !0;
|
|
1066
|
-
},
|
|
1067
|
-
let w =
|
|
1068
|
-
const N =
|
|
1069
|
-
return N && !Fe(N) && (w =
|
|
1034
|
+
}, J = z(() => {
|
|
1035
|
+
let w = b(t);
|
|
1036
|
+
const N = b(v == null ? void 0 : v.schema);
|
|
1037
|
+
return N && !Fe(N) && (w = Ii(N, b(e)) || w), Fe(w) || ke(w) || Array.isArray(w) ? w : Gt(w);
|
|
1070
1038
|
});
|
|
1071
1039
|
async function B(w) {
|
|
1072
|
-
var N,
|
|
1073
|
-
return v != null && v.validateSchema ? (N = (await v.validateSchema(w)).results[
|
|
1074
|
-
name:
|
|
1075
|
-
label:
|
|
1076
|
-
values: (
|
|
1040
|
+
var N, Q;
|
|
1041
|
+
return v != null && v.validateSchema ? (N = (await v.validateSchema(w)).results[b(e)]) !== null && N !== void 0 ? N : { valid: !0, errors: [] } : $t(s.value, J.value, {
|
|
1042
|
+
name: b(e),
|
|
1043
|
+
label: b(m),
|
|
1044
|
+
values: (Q = v == null ? void 0 : v.values) !== null && Q !== void 0 ? Q : {},
|
|
1077
1045
|
bails: o
|
|
1078
1046
|
});
|
|
1079
1047
|
}
|
|
1080
|
-
const
|
|
1081
|
-
function
|
|
1082
|
-
return (w == null ? void 0 : w.mode) === "silent" ?
|
|
1048
|
+
const H = tt(async () => (f.pending = !0, f.validated = !0, B("validated-only")), (w) => (l && (w.valid = !0, w.errors = []), y({ errors: w.errors }), f.pending = !1, w)), ee = tt(async () => B("silent"), (w) => (l && (w.valid = !0), f.valid = w.valid, w));
|
|
1049
|
+
function x(w) {
|
|
1050
|
+
return (w == null ? void 0 : w.mode) === "silent" ? ee() : H();
|
|
1083
1051
|
}
|
|
1084
1052
|
function M(w, N = !0) {
|
|
1085
|
-
const
|
|
1086
|
-
s.value =
|
|
1053
|
+
const Q = ft(w);
|
|
1054
|
+
s.value = Q, !p && N && H();
|
|
1087
1055
|
}
|
|
1088
|
-
|
|
1056
|
+
ot(() => {
|
|
1089
1057
|
if (r)
|
|
1090
|
-
return
|
|
1091
|
-
(!v || !v.validateSchema) &&
|
|
1058
|
+
return H();
|
|
1059
|
+
(!v || !v.validateSchema) && ee();
|
|
1092
1060
|
});
|
|
1093
|
-
function
|
|
1061
|
+
function K(w) {
|
|
1094
1062
|
f.touched = w;
|
|
1095
1063
|
}
|
|
1096
|
-
let
|
|
1097
|
-
function
|
|
1098
|
-
|
|
1064
|
+
let te, Oe = T(s.value);
|
|
1065
|
+
function ce() {
|
|
1066
|
+
te = W(s, (w, N) => {
|
|
1099
1067
|
if (G(w, N) && G(w, Oe))
|
|
1100
1068
|
return;
|
|
1101
|
-
(p ?
|
|
1069
|
+
(p ? H : ee)(), Oe = T(w);
|
|
1102
1070
|
}, {
|
|
1103
1071
|
deep: !0
|
|
1104
1072
|
});
|
|
1105
1073
|
}
|
|
1106
|
-
|
|
1107
|
-
function
|
|
1074
|
+
ce();
|
|
1075
|
+
function ve(w) {
|
|
1108
1076
|
var N;
|
|
1109
|
-
|
|
1110
|
-
const
|
|
1077
|
+
te == null || te();
|
|
1078
|
+
const Q = w && "value" in w ? w.value : c.value;
|
|
1111
1079
|
y({
|
|
1112
|
-
value: T(
|
|
1113
|
-
initialValue: T(
|
|
1080
|
+
value: T(Q),
|
|
1081
|
+
initialValue: T(Q),
|
|
1114
1082
|
touched: (N = w == null ? void 0 : w.touched) !== null && N !== void 0 ? N : !1,
|
|
1115
1083
|
errors: (w == null ? void 0 : w.errors) || []
|
|
1116
|
-
}), f.pending = !1, f.validated = !1,
|
|
1117
|
-
|
|
1084
|
+
}), f.pending = !1, f.validated = !1, ee(), _e(() => {
|
|
1085
|
+
ce();
|
|
1118
1086
|
});
|
|
1119
1087
|
}
|
|
1120
|
-
function
|
|
1088
|
+
function ge(w) {
|
|
1121
1089
|
s.value = w;
|
|
1122
1090
|
}
|
|
1123
1091
|
function Ee(w) {
|
|
@@ -1133,47 +1101,47 @@ function Yt(e, t, n) {
|
|
|
1133
1101
|
errorMessage: O,
|
|
1134
1102
|
type: u,
|
|
1135
1103
|
checkedValue: d,
|
|
1136
|
-
uncheckedValue:
|
|
1104
|
+
uncheckedValue: _,
|
|
1137
1105
|
bails: o,
|
|
1138
1106
|
keepValueOnUnmount: S,
|
|
1139
|
-
resetField:
|
|
1140
|
-
handleReset: () =>
|
|
1141
|
-
validate:
|
|
1107
|
+
resetField: ve,
|
|
1108
|
+
handleReset: () => ve(),
|
|
1109
|
+
validate: x,
|
|
1142
1110
|
handleChange: M,
|
|
1143
|
-
handleBlur:
|
|
1111
|
+
handleBlur: P,
|
|
1144
1112
|
setState: y,
|
|
1145
|
-
setTouched:
|
|
1113
|
+
setTouched: K,
|
|
1146
1114
|
setErrors: Ee,
|
|
1147
|
-
setValue:
|
|
1115
|
+
setValue: ge
|
|
1148
1116
|
};
|
|
1149
|
-
if (
|
|
1150
|
-
G(w, N) || (f.validated ?
|
|
1117
|
+
if (Lt(Hn, re), xe(t) && typeof b(t) != "function" && W(t, (w, N) => {
|
|
1118
|
+
G(w, N) || (f.validated ? H() : ee());
|
|
1151
1119
|
}, {
|
|
1152
1120
|
deep: !0
|
|
1153
|
-
}), process.env.NODE_ENV !== "production" && (re._vm = Te(),
|
|
1121
|
+
}), process.env.NODE_ENV !== "production" && (re._vm = Te(), W(() => Object.assign(Object.assign({ errors: C.value }, f), { value: s.value }), Se, {
|
|
1154
1122
|
deep: !0
|
|
1155
|
-
}), v ||
|
|
1123
|
+
}), v || gi(re)), !v)
|
|
1156
1124
|
return re;
|
|
1157
|
-
v.register(re),
|
|
1125
|
+
v.register(re), Ft(() => {
|
|
1158
1126
|
l = !0, v.unregister(re);
|
|
1159
1127
|
});
|
|
1160
|
-
const
|
|
1161
|
-
const w =
|
|
1162
|
-
return !w || ke(w) || Fe(w) || Array.isArray(w) ? {} : Object.keys(w).reduce((N,
|
|
1163
|
-
const Ae =
|
|
1164
|
-
const
|
|
1165
|
-
return
|
|
1128
|
+
const He = z(() => {
|
|
1129
|
+
const w = J.value;
|
|
1130
|
+
return !w || ke(w) || Fe(w) || Array.isArray(w) ? {} : Object.keys(w).reduce((N, Q) => {
|
|
1131
|
+
const Ae = ri(w[Q]).map((pe) => pe.__locatorRef).reduce((pe, ye) => {
|
|
1132
|
+
const Pe = U(v.values, ye) || v.values[ye];
|
|
1133
|
+
return Pe !== void 0 && (pe[ye] = Pe), pe;
|
|
1166
1134
|
}, {});
|
|
1167
1135
|
return Object.assign(N, Ae), N;
|
|
1168
1136
|
}, {});
|
|
1169
1137
|
});
|
|
1170
|
-
return
|
|
1138
|
+
return W(He, (w, N) => {
|
|
1171
1139
|
if (!Object.keys(w).length)
|
|
1172
1140
|
return;
|
|
1173
|
-
!G(w, N) && (f.validated ?
|
|
1141
|
+
!G(w, N) && (f.validated ? H() : ee());
|
|
1174
1142
|
}), re;
|
|
1175
1143
|
}
|
|
1176
|
-
function
|
|
1144
|
+
function ki(e, t) {
|
|
1177
1145
|
const n = () => ({
|
|
1178
1146
|
initialValue: void 0,
|
|
1179
1147
|
validateOnMount: !1,
|
|
@@ -1190,55 +1158,55 @@ function Mi(e, t) {
|
|
|
1190
1158
|
const i = "valueProp" in t ? t.valueProp : t.checkedValue, r = "standalone" in t ? !t.standalone : t.controlled;
|
|
1191
1159
|
return Object.assign(Object.assign(Object.assign({}, n()), t || {}), { controlled: r != null ? r : !0, checkedValue: i });
|
|
1192
1160
|
}
|
|
1193
|
-
function
|
|
1161
|
+
function Ii(e, t) {
|
|
1194
1162
|
if (!!e)
|
|
1195
1163
|
return e[t];
|
|
1196
1164
|
}
|
|
1197
|
-
function
|
|
1198
|
-
const i = n != null && n.standalone ? void 0 :
|
|
1165
|
+
function Si(e, t, n) {
|
|
1166
|
+
const i = n != null && n.standalone ? void 0 : ct(Me), r = n == null ? void 0 : n.checkedValue, o = n == null ? void 0 : n.uncheckedValue;
|
|
1199
1167
|
function u(d) {
|
|
1200
|
-
const m = d.handleChange, p =
|
|
1201
|
-
const k =
|
|
1168
|
+
const m = d.handleChange, p = z(() => {
|
|
1169
|
+
const k = b(d.value), S = b(r);
|
|
1202
1170
|
return Array.isArray(k) ? k.findIndex((A) => G(A, S)) >= 0 : G(S, k);
|
|
1203
1171
|
});
|
|
1204
|
-
function
|
|
1172
|
+
function _(k, S = !0) {
|
|
1205
1173
|
var A;
|
|
1206
1174
|
if (p.value === ((A = k == null ? void 0 : k.target) === null || A === void 0 ? void 0 : A.checked)) {
|
|
1207
1175
|
S && d.validate();
|
|
1208
1176
|
return;
|
|
1209
1177
|
}
|
|
1210
|
-
let
|
|
1211
|
-
i || (
|
|
1178
|
+
let j = ft(k);
|
|
1179
|
+
i || (j = et(b(d.value), b(r), b(o))), m(j, S);
|
|
1212
1180
|
}
|
|
1213
1181
|
return Object.assign(Object.assign({}, d), {
|
|
1214
1182
|
checked: p,
|
|
1215
1183
|
checkedValue: r,
|
|
1216
1184
|
uncheckedValue: o,
|
|
1217
|
-
handleChange:
|
|
1185
|
+
handleChange: _
|
|
1218
1186
|
});
|
|
1219
1187
|
}
|
|
1220
|
-
return u(
|
|
1188
|
+
return u(Qt(e, t, n));
|
|
1221
1189
|
}
|
|
1222
|
-
function
|
|
1190
|
+
function Oi({ prop: e, value: t, handleChange: n }) {
|
|
1223
1191
|
const i = Te();
|
|
1224
1192
|
if (!i) {
|
|
1225
1193
|
process.env.NODE_ENV !== "production" && console.warn("Failed to setup model events because `useField` was not called in setup.");
|
|
1226
1194
|
return;
|
|
1227
1195
|
}
|
|
1228
1196
|
const r = e || "modelValue", o = `update:${r}`;
|
|
1229
|
-
r in i.props && (
|
|
1230
|
-
G(u,
|
|
1231
|
-
}),
|
|
1197
|
+
r in i.props && (W(t, (u) => {
|
|
1198
|
+
G(u, It(i, r)) || i.emit(o, u);
|
|
1199
|
+
}), W(() => It(i, r), (u) => {
|
|
1232
1200
|
if (u === ze && t.value === void 0)
|
|
1233
1201
|
return;
|
|
1234
1202
|
const d = u === ze ? void 0 : u;
|
|
1235
|
-
G(d,
|
|
1203
|
+
G(d, Xn(t.value, i.props.modelModifiers)) || n(d);
|
|
1236
1204
|
}));
|
|
1237
1205
|
}
|
|
1238
|
-
function
|
|
1206
|
+
function It(e, t) {
|
|
1239
1207
|
return e.props[t];
|
|
1240
1208
|
}
|
|
1241
|
-
|
|
1209
|
+
he({
|
|
1242
1210
|
name: "Field",
|
|
1243
1211
|
inheritAttrs: !1,
|
|
1244
1212
|
props: {
|
|
@@ -1276,7 +1244,7 @@ oe({
|
|
|
1276
1244
|
},
|
|
1277
1245
|
bails: {
|
|
1278
1246
|
type: Boolean,
|
|
1279
|
-
default: () =>
|
|
1247
|
+
default: () => ht().bails
|
|
1280
1248
|
},
|
|
1281
1249
|
label: {
|
|
1282
1250
|
type: String,
|
|
@@ -1308,33 +1276,33 @@ oe({
|
|
|
1308
1276
|
}
|
|
1309
1277
|
},
|
|
1310
1278
|
setup(e, t) {
|
|
1311
|
-
const n =
|
|
1279
|
+
const n = de(e, "rules"), i = de(e, "name"), r = de(e, "label"), o = de(e, "uncheckedValue"), u = de(e, "keepValue"), { errors: d, value: m, errorMessage: p, validate: _, handleChange: k, handleBlur: S, setTouched: A, resetField: j, handleReset: $, meta: L, checked: v, setErrors: l } = pt(i, n, {
|
|
1312
1280
|
validateOnMount: e.validateOnMount,
|
|
1313
1281
|
bails: e.bails,
|
|
1314
1282
|
standalone: e.standalone,
|
|
1315
1283
|
type: t.attrs.type,
|
|
1316
|
-
initialValue:
|
|
1284
|
+
initialValue: Ai(e, t),
|
|
1317
1285
|
checkedValue: t.attrs.value,
|
|
1318
1286
|
uncheckedValue: o,
|
|
1319
1287
|
label: r,
|
|
1320
1288
|
validateOnValueUpdate: !1,
|
|
1321
1289
|
keepValueOnUnmount: u
|
|
1322
|
-
}), a = function(O,
|
|
1323
|
-
k(O,
|
|
1290
|
+
}), a = function(O, P = !0) {
|
|
1291
|
+
k(O, P), t.emit("update:modelValue", m.value);
|
|
1324
1292
|
}, s = (C) => {
|
|
1325
|
-
Ie(t.attrs.type) || (m.value =
|
|
1293
|
+
Ie(t.attrs.type) || (m.value = ft(C));
|
|
1326
1294
|
}, c = function(O) {
|
|
1327
1295
|
s(O), t.emit("update:modelValue", m.value);
|
|
1328
|
-
}, f =
|
|
1329
|
-
const { validateOnInput: C, validateOnChange: O, validateOnBlur:
|
|
1296
|
+
}, f = z(() => {
|
|
1297
|
+
const { validateOnInput: C, validateOnChange: O, validateOnBlur: P, validateOnModelUpdate: J } = Ei(e), B = [S, t.attrs.onBlur, P ? _ : void 0].filter(Boolean), H = [(K) => a(K, C), t.attrs.onInput].filter(Boolean), ee = [(K) => a(K, O), t.attrs.onChange].filter(Boolean), x = {
|
|
1330
1298
|
name: e.name,
|
|
1331
1299
|
onBlur: B,
|
|
1332
|
-
onInput:
|
|
1333
|
-
onChange:
|
|
1300
|
+
onInput: H,
|
|
1301
|
+
onChange: ee
|
|
1334
1302
|
};
|
|
1335
|
-
|
|
1336
|
-
const M =
|
|
1337
|
-
return
|
|
1303
|
+
x["onUpdate:modelValue"] = (K) => a(K, J), Ie(t.attrs.type) && v && (x.checked = v.value);
|
|
1304
|
+
const M = St(e, t);
|
|
1305
|
+
return Qn(M, t.attrs) && (x.value = m.value), x;
|
|
1338
1306
|
});
|
|
1339
1307
|
function y() {
|
|
1340
1308
|
return {
|
|
@@ -1343,11 +1311,11 @@ oe({
|
|
|
1343
1311
|
meta: L,
|
|
1344
1312
|
errors: d.value,
|
|
1345
1313
|
errorMessage: p.value,
|
|
1346
|
-
validate:
|
|
1347
|
-
resetField:
|
|
1314
|
+
validate: _,
|
|
1315
|
+
resetField: j,
|
|
1348
1316
|
handleChange: a,
|
|
1349
1317
|
handleInput: c,
|
|
1350
|
-
handleReset:
|
|
1318
|
+
handleReset: $,
|
|
1351
1319
|
handleBlur: S,
|
|
1352
1320
|
setTouched: A,
|
|
1353
1321
|
setErrors: l
|
|
@@ -1356,22 +1324,22 @@ oe({
|
|
|
1356
1324
|
return t.expose({
|
|
1357
1325
|
setErrors: l,
|
|
1358
1326
|
setTouched: A,
|
|
1359
|
-
reset:
|
|
1360
|
-
validate:
|
|
1327
|
+
reset: j,
|
|
1328
|
+
validate: _,
|
|
1361
1329
|
handleChange: k
|
|
1362
1330
|
}), () => {
|
|
1363
|
-
const C =
|
|
1331
|
+
const C = lt(St(e, t)), O = $e(C, t, y);
|
|
1364
1332
|
return C ? Re(C, Object.assign(Object.assign({}, t.attrs), f.value), O) : O;
|
|
1365
1333
|
};
|
|
1366
1334
|
}
|
|
1367
1335
|
});
|
|
1368
|
-
function
|
|
1336
|
+
function St(e, t) {
|
|
1369
1337
|
let n = e.as || "";
|
|
1370
1338
|
return !e.as && !t.slots.default && (n = "input"), n;
|
|
1371
1339
|
}
|
|
1372
|
-
function
|
|
1340
|
+
function Ei(e) {
|
|
1373
1341
|
var t, n, i, r;
|
|
1374
|
-
const { validateOnInput: o, validateOnChange: u, validateOnBlur: d, validateOnModelUpdate: m } =
|
|
1342
|
+
const { validateOnInput: o, validateOnChange: u, validateOnBlur: d, validateOnModelUpdate: m } = ht();
|
|
1375
1343
|
return {
|
|
1376
1344
|
validateOnInput: (t = e.validateOnInput) !== null && t !== void 0 ? t : o,
|
|
1377
1345
|
validateOnChange: (n = e.validateOnChange) !== null && n !== void 0 ? n : u,
|
|
@@ -1379,74 +1347,74 @@ function xi(e) {
|
|
|
1379
1347
|
validateOnModelUpdate: (r = e.validateOnModelUpdate) !== null && r !== void 0 ? r : m
|
|
1380
1348
|
};
|
|
1381
1349
|
}
|
|
1382
|
-
function
|
|
1383
|
-
return Ie(t.attrs.type) ?
|
|
1350
|
+
function Ai(e, t) {
|
|
1351
|
+
return Ie(t.attrs.type) ? yt(e, "modelValue") ? e.modelValue : void 0 : yt(e, "modelValue") ? e.modelValue : t.attrs.value;
|
|
1384
1352
|
}
|
|
1385
|
-
let
|
|
1386
|
-
function
|
|
1353
|
+
let Vi = 0;
|
|
1354
|
+
function Li(e) {
|
|
1387
1355
|
var t;
|
|
1388
|
-
const n =
|
|
1356
|
+
const n = Vi++, i = /* @__PURE__ */ new Set();
|
|
1389
1357
|
let r = !1;
|
|
1390
|
-
const o =
|
|
1391
|
-
const I =
|
|
1358
|
+
const o = X({}), u = X(!1), d = X(0), m = [], p = st(T(b(e == null ? void 0 : e.initialValues) || {})), { errorBag: _, setErrorBag: k, setFieldErrorBag: S } = Di(e == null ? void 0 : e.initialErrors), A = z(() => R(_.value).reduce((h, g) => {
|
|
1359
|
+
const I = _.value[g];
|
|
1392
1360
|
return I && I.length && (h[g] = I[0]), h;
|
|
1393
1361
|
}, {}));
|
|
1394
|
-
function
|
|
1362
|
+
function j(h) {
|
|
1395
1363
|
const g = o.value[h];
|
|
1396
1364
|
return Array.isArray(g) ? g[0] : g;
|
|
1397
1365
|
}
|
|
1398
|
-
function
|
|
1366
|
+
function $(h) {
|
|
1399
1367
|
return !!o.value[h];
|
|
1400
1368
|
}
|
|
1401
|
-
const L =
|
|
1402
|
-
const I =
|
|
1403
|
-
return I && (h[g] = { name:
|
|
1404
|
-
}, {})), v =
|
|
1369
|
+
const L = z(() => R(o.value).reduce((h, g) => {
|
|
1370
|
+
const I = j(g);
|
|
1371
|
+
return I && (h[g] = { name: b(I.name) || "", label: b(I.label) || "" }), h;
|
|
1372
|
+
}, {})), v = z(() => R(o.value).reduce((h, g) => {
|
|
1405
1373
|
var I;
|
|
1406
|
-
const E =
|
|
1374
|
+
const E = j(g);
|
|
1407
1375
|
return E && (h[g] = (I = E.bails) !== null && I !== void 0 ? I : !0), h;
|
|
1408
|
-
}, {})), l = Object.assign({}, (e == null ? void 0 : e.initialErrors) || {}), a = (t = e == null ? void 0 : e.keepValuesOnUnmount) !== null && t !== void 0 ? t : !1, { initialValues: s, originalInitialValues: c, setInitialValues: f } =
|
|
1409
|
-
const I =
|
|
1410
|
-
return
|
|
1411
|
-
}, {})), O = e == null ? void 0 : e.validationSchema,
|
|
1412
|
-
const I = M.fieldsByPath.value || {}, E =
|
|
1376
|
+
}, {})), l = Object.assign({}, (e == null ? void 0 : e.initialErrors) || {}), a = (t = e == null ? void 0 : e.keepValuesOnUnmount) !== null && t !== void 0 ? t : !1, { initialValues: s, originalInitialValues: c, setInitialValues: f } = Ni(o, p, e == null ? void 0 : e.initialValues), y = Fi(o, p, c, A), C = z(() => [...i, ...R(o.value)].reduce((h, g) => {
|
|
1377
|
+
const I = U(p, g);
|
|
1378
|
+
return se(h, g, I), h;
|
|
1379
|
+
}, {})), O = e == null ? void 0 : e.validationSchema, P = Ct(gt, 5), J = Ct(gt, 5), B = tt(async (h) => await h === "silent" ? P() : J(), (h, [g]) => {
|
|
1380
|
+
const I = M.fieldsByPath.value || {}, E = R(M.errorBag.value);
|
|
1413
1381
|
return [
|
|
1414
|
-
.../* @__PURE__ */ new Set([...
|
|
1382
|
+
.../* @__PURE__ */ new Set([...R(h.results), ...R(I), ...E])
|
|
1415
1383
|
].reduce((V, F) => {
|
|
1416
|
-
const
|
|
1417
|
-
errors:
|
|
1418
|
-
valid: !
|
|
1384
|
+
const q = I[F], oe = (h.results[F] || { errors: [] }).errors, ae = {
|
|
1385
|
+
errors: oe,
|
|
1386
|
+
valid: !oe.length
|
|
1419
1387
|
};
|
|
1420
|
-
if (V.results[F] = ae, ae.valid || (V.errors[F] = ae.errors[0]), !
|
|
1421
|
-
return
|
|
1422
|
-
if (
|
|
1388
|
+
if (V.results[F] = ae, ae.valid || (V.errors[F] = ae.errors[0]), !q)
|
|
1389
|
+
return ce(F, oe), V;
|
|
1390
|
+
if (te(q, (Ve) => Ve.meta.valid = ae.valid), g === "silent")
|
|
1423
1391
|
return V;
|
|
1424
|
-
const
|
|
1425
|
-
return g === "validated-only" && !
|
|
1392
|
+
const sn = Array.isArray(q) ? q.some((Ve) => Ve.meta.validated) : q.meta.validated;
|
|
1393
|
+
return g === "validated-only" && !sn || te(q, (Ve) => Ve.setState({ errors: ae.errors })), V;
|
|
1426
1394
|
}, { valid: h.valid, results: {}, errors: {} });
|
|
1427
1395
|
});
|
|
1428
|
-
function
|
|
1396
|
+
function H(h) {
|
|
1429
1397
|
return function(I, E) {
|
|
1430
1398
|
return function(V) {
|
|
1431
|
-
return V instanceof Event && (V.preventDefault(), V.stopPropagation()), N(
|
|
1432
|
-
const
|
|
1399
|
+
return V instanceof Event && (V.preventDefault(), V.stopPropagation()), N(R(o.value).reduce((F, q) => (F[q] = !0, F), {})), u.value = !0, d.value++, je().then((F) => {
|
|
1400
|
+
const q = T(p);
|
|
1433
1401
|
if (F.valid && typeof I == "function") {
|
|
1434
|
-
const
|
|
1435
|
-
return I(h ?
|
|
1402
|
+
const oe = T(C.value);
|
|
1403
|
+
return I(h ? oe : q, {
|
|
1436
1404
|
evt: V,
|
|
1437
|
-
controlledValues:
|
|
1438
|
-
setErrors:
|
|
1439
|
-
setFieldError:
|
|
1405
|
+
controlledValues: oe,
|
|
1406
|
+
setErrors: ve,
|
|
1407
|
+
setFieldError: ce,
|
|
1440
1408
|
setTouched: N,
|
|
1441
1409
|
setFieldTouched: w,
|
|
1442
1410
|
setValues: Ee,
|
|
1443
|
-
setFieldValue:
|
|
1411
|
+
setFieldValue: ge,
|
|
1444
1412
|
resetForm: Ae,
|
|
1445
|
-
resetField:
|
|
1413
|
+
resetField: Q
|
|
1446
1414
|
});
|
|
1447
1415
|
}
|
|
1448
1416
|
!F.valid && typeof E == "function" && E({
|
|
1449
|
-
values:
|
|
1417
|
+
values: q,
|
|
1450
1418
|
evt: V,
|
|
1451
1419
|
errors: F.errors,
|
|
1452
1420
|
results: F.results
|
|
@@ -1457,14 +1425,14 @@ function zi(e) {
|
|
|
1457
1425
|
};
|
|
1458
1426
|
};
|
|
1459
1427
|
}
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1428
|
+
const x = H(!1);
|
|
1429
|
+
x.withControlled = H(!0);
|
|
1462
1430
|
const M = {
|
|
1463
1431
|
formId: n,
|
|
1464
1432
|
fieldsByPath: o,
|
|
1465
1433
|
values: p,
|
|
1466
1434
|
controlledValues: C,
|
|
1467
|
-
errorBag:
|
|
1435
|
+
errorBag: _,
|
|
1468
1436
|
errors: A,
|
|
1469
1437
|
schema: O,
|
|
1470
1438
|
submitCount: d,
|
|
@@ -1472,97 +1440,97 @@ function zi(e) {
|
|
|
1472
1440
|
isSubmitting: u,
|
|
1473
1441
|
fieldArrays: m,
|
|
1474
1442
|
keepValuesOnUnmount: a,
|
|
1475
|
-
validateSchema:
|
|
1476
|
-
validate:
|
|
1477
|
-
register:
|
|
1478
|
-
unregister:
|
|
1443
|
+
validateSchema: b(O) ? B : void 0,
|
|
1444
|
+
validate: je,
|
|
1445
|
+
register: Pe,
|
|
1446
|
+
unregister: rn,
|
|
1479
1447
|
setFieldErrorBag: S,
|
|
1480
|
-
validateField:
|
|
1481
|
-
setFieldValue:
|
|
1448
|
+
validateField: Ke,
|
|
1449
|
+
setFieldValue: ge,
|
|
1482
1450
|
setValues: Ee,
|
|
1483
|
-
setErrors:
|
|
1484
|
-
setFieldError:
|
|
1451
|
+
setErrors: ve,
|
|
1452
|
+
setFieldError: ce,
|
|
1485
1453
|
setFieldTouched: w,
|
|
1486
1454
|
setTouched: N,
|
|
1487
1455
|
resetForm: Ae,
|
|
1488
|
-
resetField:
|
|
1489
|
-
handleSubmit:
|
|
1490
|
-
stageInitialValue:
|
|
1491
|
-
unsetInitialValue:
|
|
1492
|
-
setFieldInitialValue:
|
|
1493
|
-
useFieldModel:
|
|
1456
|
+
resetField: Q,
|
|
1457
|
+
handleSubmit: x,
|
|
1458
|
+
stageInitialValue: on,
|
|
1459
|
+
unsetInitialValue: an,
|
|
1460
|
+
setFieldInitialValue: mt,
|
|
1461
|
+
useFieldModel: He
|
|
1494
1462
|
};
|
|
1495
|
-
function
|
|
1463
|
+
function K(h) {
|
|
1496
1464
|
return Array.isArray(h);
|
|
1497
1465
|
}
|
|
1498
|
-
function
|
|
1466
|
+
function te(h, g) {
|
|
1499
1467
|
return Array.isArray(h) ? h.forEach(g) : g(h);
|
|
1500
1468
|
}
|
|
1501
1469
|
function Oe(h) {
|
|
1502
1470
|
Object.values(o.value).forEach((g) => {
|
|
1503
|
-
!g ||
|
|
1471
|
+
!g || te(g, h);
|
|
1504
1472
|
});
|
|
1505
1473
|
}
|
|
1506
|
-
function
|
|
1474
|
+
function ce(h, g) {
|
|
1507
1475
|
S(h, g);
|
|
1508
1476
|
}
|
|
1509
|
-
function
|
|
1477
|
+
function ve(h) {
|
|
1510
1478
|
k(h);
|
|
1511
1479
|
}
|
|
1512
|
-
function
|
|
1480
|
+
function ge(h, g, { force: I } = { force: !1 }) {
|
|
1513
1481
|
var E;
|
|
1514
1482
|
const D = o.value[h], V = T(g);
|
|
1515
1483
|
if (!D) {
|
|
1516
|
-
|
|
1484
|
+
se(p, h, V);
|
|
1517
1485
|
return;
|
|
1518
1486
|
}
|
|
1519
|
-
if (
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1487
|
+
if (K(D) && ((E = D[0]) === null || E === void 0 ? void 0 : E.type) === "checkbox" && !Array.isArray(g)) {
|
|
1488
|
+
const q = T(et(U(p, h) || [], g, void 0));
|
|
1489
|
+
se(p, h, q);
|
|
1522
1490
|
return;
|
|
1523
1491
|
}
|
|
1524
1492
|
let F = V;
|
|
1525
|
-
!
|
|
1493
|
+
!K(D) && D.type === "checkbox" && !I && !r && (F = T(et(U(p, h), g, b(D.uncheckedValue)))), se(p, h, F);
|
|
1526
1494
|
}
|
|
1527
1495
|
function Ee(h) {
|
|
1528
|
-
|
|
1496
|
+
R(p).forEach((g) => {
|
|
1529
1497
|
delete p[g];
|
|
1530
|
-
}),
|
|
1531
|
-
|
|
1498
|
+
}), R(h).forEach((g) => {
|
|
1499
|
+
ge(g, h[g]);
|
|
1532
1500
|
}), m.forEach((g) => g && g.reset());
|
|
1533
1501
|
}
|
|
1534
1502
|
function re(h) {
|
|
1535
|
-
const { value: g } =
|
|
1536
|
-
return
|
|
1537
|
-
|
|
1503
|
+
const { value: g } = Kt(h, void 0, M);
|
|
1504
|
+
return W(g, () => {
|
|
1505
|
+
$(b(h)) || je({ mode: "validated-only" });
|
|
1538
1506
|
}, {
|
|
1539
1507
|
deep: !0
|
|
1540
|
-
}), i.add(
|
|
1508
|
+
}), i.add(b(h)), g;
|
|
1541
1509
|
}
|
|
1542
|
-
function
|
|
1510
|
+
function He(h) {
|
|
1543
1511
|
return Array.isArray(h) ? h.map(re) : re(h);
|
|
1544
1512
|
}
|
|
1545
1513
|
function w(h, g) {
|
|
1546
1514
|
const I = o.value[h];
|
|
1547
|
-
I &&
|
|
1515
|
+
I && te(I, (E) => E.setTouched(g));
|
|
1548
1516
|
}
|
|
1549
1517
|
function N(h) {
|
|
1550
|
-
|
|
1518
|
+
R(h).forEach((g) => {
|
|
1551
1519
|
w(g, !!h[g]);
|
|
1552
1520
|
});
|
|
1553
1521
|
}
|
|
1554
|
-
function
|
|
1522
|
+
function Q(h, g) {
|
|
1555
1523
|
const I = o.value[h];
|
|
1556
|
-
I &&
|
|
1524
|
+
I && te(I, (E) => E.resetField(g));
|
|
1557
1525
|
}
|
|
1558
1526
|
function Ae(h) {
|
|
1559
1527
|
r = !0, Oe((I) => I.resetField());
|
|
1560
1528
|
const g = h != null && h.values ? h.values : c.value;
|
|
1561
|
-
f(g), Ee(g), h != null && h.touched && N(h.touched),
|
|
1529
|
+
f(g), Ee(g), h != null && h.touched && N(h.touched), ve((h == null ? void 0 : h.errors) || {}), d.value = (h == null ? void 0 : h.submitCount) || 0, _e(() => {
|
|
1562
1530
|
r = !1;
|
|
1563
1531
|
});
|
|
1564
1532
|
}
|
|
1565
|
-
function
|
|
1533
|
+
function pe(h, g) {
|
|
1566
1534
|
const I = bn(h), E = g;
|
|
1567
1535
|
if (!o.value[E]) {
|
|
1568
1536
|
o.value[E] = I;
|
|
@@ -1571,14 +1539,14 @@ function zi(e) {
|
|
|
1571
1539
|
const D = o.value[E];
|
|
1572
1540
|
D && !Array.isArray(D) && (o.value[E] = [D]), o.value[E] = [...o.value[E], I];
|
|
1573
1541
|
}
|
|
1574
|
-
function
|
|
1542
|
+
function ye(h, g) {
|
|
1575
1543
|
const I = g, E = o.value[I];
|
|
1576
1544
|
if (!!E) {
|
|
1577
|
-
if (!
|
|
1545
|
+
if (!K(E) && h.id === E.id) {
|
|
1578
1546
|
delete o.value[I];
|
|
1579
1547
|
return;
|
|
1580
1548
|
}
|
|
1581
|
-
if (
|
|
1549
|
+
if (K(E)) {
|
|
1582
1550
|
const D = E.findIndex((V) => V.id === h.id);
|
|
1583
1551
|
if (D === -1)
|
|
1584
1552
|
return;
|
|
@@ -1586,45 +1554,45 @@ function zi(e) {
|
|
|
1586
1554
|
}
|
|
1587
1555
|
}
|
|
1588
1556
|
}
|
|
1589
|
-
function
|
|
1590
|
-
const g =
|
|
1591
|
-
|
|
1592
|
-
await
|
|
1557
|
+
function Pe(h) {
|
|
1558
|
+
const g = b(h.name);
|
|
1559
|
+
pe(h, g), xe(h.name) && W(h.name, async (E, D) => {
|
|
1560
|
+
await _e(), ye(h, D), pe(h, E), (A.value[D] || A.value[E]) && (ce(D, void 0), Ke(E)), await _e(), $(D) || Be(p, D);
|
|
1593
1561
|
});
|
|
1594
|
-
const I =
|
|
1595
|
-
I && (l == null ? void 0 : l[g]) !== I &&
|
|
1562
|
+
const I = b(h.errorMessage);
|
|
1563
|
+
I && (l == null ? void 0 : l[g]) !== I && Ke(g), delete l[g];
|
|
1596
1564
|
}
|
|
1597
|
-
function
|
|
1598
|
-
const g =
|
|
1599
|
-
|
|
1565
|
+
function rn(h) {
|
|
1566
|
+
const g = b(h.name), I = o.value[g], E = !!I && K(I);
|
|
1567
|
+
ye(h, g), _e(() => {
|
|
1600
1568
|
var D;
|
|
1601
|
-
const V = (D =
|
|
1569
|
+
const V = (D = b(h.keepValueOnUnmount)) !== null && D !== void 0 ? D : b(a), F = U(p, g);
|
|
1602
1570
|
if (E && (I === o.value[g] || !o.value[g]) && !V)
|
|
1603
1571
|
if (Array.isArray(F)) {
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1572
|
+
const oe = F.findIndex((ae) => G(ae, b(h.checkedValue)));
|
|
1573
|
+
if (oe > -1) {
|
|
1606
1574
|
const ae = [...F];
|
|
1607
|
-
ae.splice(
|
|
1575
|
+
ae.splice(oe, 1), ge(g, ae, { force: !0 });
|
|
1608
1576
|
}
|
|
1609
1577
|
} else
|
|
1610
|
-
F ===
|
|
1611
|
-
if (
|
|
1612
|
-
if (
|
|
1578
|
+
F === b(h.checkedValue) && Be(p, g);
|
|
1579
|
+
if (!$(g)) {
|
|
1580
|
+
if (ce(g, void 0), V || E && Array.isArray(F) && !Ut(F))
|
|
1613
1581
|
return;
|
|
1614
1582
|
Be(p, g);
|
|
1615
1583
|
}
|
|
1616
1584
|
});
|
|
1617
1585
|
}
|
|
1618
|
-
async function
|
|
1586
|
+
async function je(h) {
|
|
1619
1587
|
const g = (h == null ? void 0 : h.mode) || "force";
|
|
1620
1588
|
if (g === "force" && Oe((V) => V.meta.validated = !0), M.validateSchema)
|
|
1621
1589
|
return M.validateSchema(g);
|
|
1622
1590
|
const I = await Promise.all(Object.values(o.value).map((V) => {
|
|
1623
1591
|
const F = Array.isArray(V) ? V[0] : V;
|
|
1624
|
-
return F ? F.validate(h).then((
|
|
1625
|
-
key:
|
|
1626
|
-
valid:
|
|
1627
|
-
errors:
|
|
1592
|
+
return F ? F.validate(h).then((q) => ({
|
|
1593
|
+
key: b(F.name),
|
|
1594
|
+
valid: q.valid,
|
|
1595
|
+
errors: q.errors
|
|
1628
1596
|
})) : Promise.resolve({ key: "", valid: !0, errors: [] });
|
|
1629
1597
|
})), E = {}, D = {};
|
|
1630
1598
|
for (const V of I)
|
|
@@ -1638,73 +1606,73 @@ function zi(e) {
|
|
|
1638
1606
|
errors: D
|
|
1639
1607
|
};
|
|
1640
1608
|
}
|
|
1641
|
-
async function
|
|
1609
|
+
async function Ke(h) {
|
|
1642
1610
|
const g = o.value[h];
|
|
1643
|
-
return g ? Array.isArray(g) ? g.map((I) => I.validate())[0] : g.validate() : (
|
|
1611
|
+
return g ? Array.isArray(g) ? g.map((I) => I.validate())[0] : g.validate() : (Tt(`field with name ${h} was not found`), Promise.resolve({ errors: [], valid: !0 }));
|
|
1644
1612
|
}
|
|
1645
|
-
function
|
|
1613
|
+
function an(h) {
|
|
1646
1614
|
Be(s.value, h);
|
|
1647
1615
|
}
|
|
1648
|
-
function
|
|
1649
|
-
|
|
1616
|
+
function on(h, g, I = !1) {
|
|
1617
|
+
se(p, h, g), mt(h, g), I && !(e != null && e.initialValues) && se(c.value, h, T(g));
|
|
1650
1618
|
}
|
|
1651
|
-
function
|
|
1652
|
-
|
|
1619
|
+
function mt(h, g) {
|
|
1620
|
+
se(s.value, h, T(g));
|
|
1653
1621
|
}
|
|
1654
|
-
async function
|
|
1655
|
-
const h =
|
|
1656
|
-
return h ? Fe(h) ? await
|
|
1622
|
+
async function gt() {
|
|
1623
|
+
const h = b(O);
|
|
1624
|
+
return h ? Fe(h) ? await ci(h, p) : await fi(h, p, {
|
|
1657
1625
|
names: L.value,
|
|
1658
1626
|
bailsMap: v.value
|
|
1659
1627
|
}) : { valid: !0, results: {}, errors: {} };
|
|
1660
1628
|
}
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1629
|
+
const ln = x((h, { evt: g }) => {
|
|
1630
|
+
Rt(g) && g.target.submit();
|
|
1663
1631
|
});
|
|
1664
|
-
return
|
|
1665
|
-
if (e != null && e.initialErrors &&
|
|
1666
|
-
|
|
1632
|
+
return ot(() => {
|
|
1633
|
+
if (e != null && e.initialErrors && ve(e.initialErrors), e != null && e.initialTouched && N(e.initialTouched), e != null && e.validateOnMount) {
|
|
1634
|
+
je();
|
|
1667
1635
|
return;
|
|
1668
1636
|
}
|
|
1669
1637
|
M.validateSchema && M.validateSchema("silent");
|
|
1670
|
-
}),
|
|
1638
|
+
}), xe(O) && W(O, () => {
|
|
1671
1639
|
var h;
|
|
1672
1640
|
(h = M.validateSchema) === null || h === void 0 || h.call(M, "validated-only");
|
|
1673
|
-
}),
|
|
1641
|
+
}), Lt(Me, M), process.env.NODE_ENV !== "production" && (mi(M), W(() => Object.assign(Object.assign({ errors: _.value }, y.value), { values: p, isSubmitting: u.value, submitCount: d.value }), Se, {
|
|
1674
1642
|
deep: !0
|
|
1675
|
-
})), Object.assign(Object.assign({}, M), { handleReset: () => Ae(), submitForm:
|
|
1643
|
+
})), Object.assign(Object.assign({}, M), { handleReset: () => Ae(), submitForm: ln });
|
|
1676
1644
|
}
|
|
1677
|
-
function
|
|
1645
|
+
function Fi(e, t, n, i) {
|
|
1678
1646
|
const r = {
|
|
1679
1647
|
touched: "some",
|
|
1680
1648
|
pending: "some",
|
|
1681
1649
|
valid: "every"
|
|
1682
|
-
}, o =
|
|
1650
|
+
}, o = z(() => !G(t, b(n)));
|
|
1683
1651
|
function u() {
|
|
1684
1652
|
const m = Object.values(e.value).flat(1).filter(Boolean);
|
|
1685
|
-
return
|
|
1686
|
-
const k = r[
|
|
1687
|
-
return p[
|
|
1653
|
+
return R(r).reduce((p, _) => {
|
|
1654
|
+
const k = r[_];
|
|
1655
|
+
return p[_] = m[k]((S) => S.meta[_]), p;
|
|
1688
1656
|
}, {});
|
|
1689
1657
|
}
|
|
1690
|
-
const d =
|
|
1691
|
-
return
|
|
1658
|
+
const d = st(u());
|
|
1659
|
+
return yn(() => {
|
|
1692
1660
|
const m = u();
|
|
1693
1661
|
d.touched = m.touched, d.valid = m.valid, d.pending = m.pending;
|
|
1694
|
-
}),
|
|
1662
|
+
}), z(() => Object.assign(Object.assign({ initialValues: b(n) }, d), { valid: d.valid && !R(i.value).length, dirty: o.value }));
|
|
1695
1663
|
}
|
|
1696
|
-
function
|
|
1697
|
-
const i =
|
|
1664
|
+
function Ni(e, t, n) {
|
|
1665
|
+
const i = X(T(b(n)) || {}), r = X(T(b(n)) || {});
|
|
1698
1666
|
function o(u, d = !1) {
|
|
1699
|
-
i.value = T(u), r.value = T(u), d &&
|
|
1700
|
-
const p = e.value[m],
|
|
1701
|
-
if (!p ||
|
|
1667
|
+
i.value = T(u), r.value = T(u), d && R(e.value).forEach((m) => {
|
|
1668
|
+
const p = e.value[m], _ = Array.isArray(p) ? p.some((S) => S.meta.touched) : p == null ? void 0 : p.meta.touched;
|
|
1669
|
+
if (!p || _)
|
|
1702
1670
|
return;
|
|
1703
|
-
const k =
|
|
1704
|
-
|
|
1671
|
+
const k = U(i.value, m);
|
|
1672
|
+
se(t, m, T(k));
|
|
1705
1673
|
});
|
|
1706
1674
|
}
|
|
1707
|
-
return
|
|
1675
|
+
return xe(n) && W(n, (u) => {
|
|
1708
1676
|
o(u, !0);
|
|
1709
1677
|
}, {
|
|
1710
1678
|
deep: !0
|
|
@@ -1714,8 +1682,8 @@ function Gi(e, t, n) {
|
|
|
1714
1682
|
setInitialValues: o
|
|
1715
1683
|
};
|
|
1716
1684
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const t =
|
|
1685
|
+
function Di(e) {
|
|
1686
|
+
const t = X({});
|
|
1719
1687
|
function n(o) {
|
|
1720
1688
|
return Array.isArray(o) ? o : o ? [o] : [];
|
|
1721
1689
|
}
|
|
@@ -1727,7 +1695,7 @@ function Hi(e) {
|
|
|
1727
1695
|
t.value[o] = n(u);
|
|
1728
1696
|
}
|
|
1729
1697
|
function r(o) {
|
|
1730
|
-
t.value =
|
|
1698
|
+
t.value = R(o).reduce((u, d) => {
|
|
1731
1699
|
const m = o[d];
|
|
1732
1700
|
return m && (u[d] = n(m)), u;
|
|
1733
1701
|
}, {});
|
|
@@ -1738,7 +1706,7 @@ function Hi(e) {
|
|
|
1738
1706
|
setFieldErrorBag: i
|
|
1739
1707
|
};
|
|
1740
1708
|
}
|
|
1741
|
-
|
|
1709
|
+
he({
|
|
1742
1710
|
name: "Form",
|
|
1743
1711
|
inheritAttrs: !1,
|
|
1744
1712
|
props: {
|
|
@@ -1780,42 +1748,42 @@ oe({
|
|
|
1780
1748
|
}
|
|
1781
1749
|
},
|
|
1782
1750
|
setup(e, t) {
|
|
1783
|
-
const n =
|
|
1751
|
+
const n = de(e, "initialValues"), i = de(e, "validationSchema"), r = de(e, "keepValues"), { errors: o, values: u, meta: d, isSubmitting: m, submitCount: p, controlledValues: _, validate: k, validateField: S, handleReset: A, resetForm: j, handleSubmit: $, setErrors: L, setFieldError: v, setFieldValue: l, setValues: a, setFieldTouched: s, setTouched: c, resetField: f } = Li({
|
|
1784
1752
|
validationSchema: i.value ? i : void 0,
|
|
1785
1753
|
initialValues: n,
|
|
1786
1754
|
initialErrors: e.initialErrors,
|
|
1787
1755
|
initialTouched: e.initialTouched,
|
|
1788
1756
|
validateOnMount: e.validateOnMount,
|
|
1789
1757
|
keepValuesOnUnmount: r
|
|
1790
|
-
}), y =
|
|
1791
|
-
|
|
1792
|
-
}, e.onInvalidSubmit), C = e.onSubmit ?
|
|
1793
|
-
function O(
|
|
1794
|
-
|
|
1758
|
+
}), y = $((x, { evt: M }) => {
|
|
1759
|
+
Rt(M) && M.target.submit();
|
|
1760
|
+
}, e.onInvalidSubmit), C = e.onSubmit ? $(e.onSubmit, e.onInvalidSubmit) : y;
|
|
1761
|
+
function O(x) {
|
|
1762
|
+
ut(x) && x.preventDefault(), A(), typeof t.attrs.onReset == "function" && t.attrs.onReset();
|
|
1795
1763
|
}
|
|
1796
|
-
function
|
|
1797
|
-
return
|
|
1764
|
+
function P(x, M) {
|
|
1765
|
+
return $(typeof x == "function" && !M ? x : M, e.onInvalidSubmit)(x);
|
|
1798
1766
|
}
|
|
1799
|
-
function
|
|
1767
|
+
function J() {
|
|
1800
1768
|
return T(u);
|
|
1801
1769
|
}
|
|
1802
1770
|
function B() {
|
|
1803
1771
|
return T(d.value);
|
|
1804
1772
|
}
|
|
1805
|
-
function
|
|
1773
|
+
function H() {
|
|
1806
1774
|
return T(o.value);
|
|
1807
1775
|
}
|
|
1808
|
-
function
|
|
1776
|
+
function ee() {
|
|
1809
1777
|
return {
|
|
1810
1778
|
meta: d.value,
|
|
1811
1779
|
errors: o.value,
|
|
1812
1780
|
values: u,
|
|
1813
1781
|
isSubmitting: m.value,
|
|
1814
1782
|
submitCount: p.value,
|
|
1815
|
-
controlledValues:
|
|
1783
|
+
controlledValues: _.value,
|
|
1816
1784
|
validate: k,
|
|
1817
1785
|
validateField: S,
|
|
1818
|
-
handleSubmit:
|
|
1786
|
+
handleSubmit: P,
|
|
1819
1787
|
handleReset: A,
|
|
1820
1788
|
submitForm: y,
|
|
1821
1789
|
setErrors: L,
|
|
@@ -1824,11 +1792,11 @@ oe({
|
|
|
1824
1792
|
setValues: a,
|
|
1825
1793
|
setFieldTouched: s,
|
|
1826
1794
|
setTouched: c,
|
|
1827
|
-
resetForm:
|
|
1795
|
+
resetForm: j,
|
|
1828
1796
|
resetField: f,
|
|
1829
|
-
getValues:
|
|
1797
|
+
getValues: J,
|
|
1830
1798
|
getMeta: B,
|
|
1831
|
-
getErrors:
|
|
1799
|
+
getErrors: H
|
|
1832
1800
|
};
|
|
1833
1801
|
}
|
|
1834
1802
|
return t.expose({
|
|
@@ -1838,26 +1806,26 @@ oe({
|
|
|
1838
1806
|
setValues: a,
|
|
1839
1807
|
setFieldTouched: s,
|
|
1840
1808
|
setTouched: c,
|
|
1841
|
-
resetForm:
|
|
1809
|
+
resetForm: j,
|
|
1842
1810
|
validate: k,
|
|
1843
1811
|
validateField: S,
|
|
1844
1812
|
resetField: f,
|
|
1845
|
-
getValues:
|
|
1813
|
+
getValues: J,
|
|
1846
1814
|
getMeta: B,
|
|
1847
|
-
getErrors:
|
|
1815
|
+
getErrors: H
|
|
1848
1816
|
}), function() {
|
|
1849
|
-
const M = e.as === "form" ? e.as :
|
|
1817
|
+
const M = e.as === "form" ? e.as : lt(e.as), K = $e(M, t, ee);
|
|
1850
1818
|
if (!e.as)
|
|
1851
|
-
return
|
|
1852
|
-
const
|
|
1819
|
+
return K;
|
|
1820
|
+
const te = e.as === "form" ? {
|
|
1853
1821
|
novalidate: !0
|
|
1854
1822
|
} : {};
|
|
1855
|
-
return Re(M, Object.assign(Object.assign(Object.assign({},
|
|
1823
|
+
return Re(M, Object.assign(Object.assign(Object.assign({}, te), t.attrs), { onSubmit: C, onReset: O }), K);
|
|
1856
1824
|
};
|
|
1857
1825
|
}
|
|
1858
1826
|
});
|
|
1859
|
-
function
|
|
1860
|
-
const t =
|
|
1827
|
+
function Ti(e) {
|
|
1828
|
+
const t = ct(Me, void 0), n = X([]), i = () => {
|
|
1861
1829
|
}, r = {
|
|
1862
1830
|
fields: n,
|
|
1863
1831
|
remove: i,
|
|
@@ -1870,15 +1838,15 @@ function Ki(e) {
|
|
|
1870
1838
|
move: i
|
|
1871
1839
|
};
|
|
1872
1840
|
if (!t)
|
|
1873
|
-
return
|
|
1874
|
-
if (!
|
|
1875
|
-
return
|
|
1876
|
-
const o = t.fieldArrays.find((a) =>
|
|
1841
|
+
return We("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"), r;
|
|
1842
|
+
if (!b(e))
|
|
1843
|
+
return We("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"), r;
|
|
1844
|
+
const o = t.fieldArrays.find((a) => b(a.path) === b(e));
|
|
1877
1845
|
if (o)
|
|
1878
1846
|
return o;
|
|
1879
1847
|
let u = 0;
|
|
1880
1848
|
function d() {
|
|
1881
|
-
const a =
|
|
1849
|
+
const a = U(t == null ? void 0 : t.values, b(e), []) || [];
|
|
1882
1850
|
n.value = a.map(p), m();
|
|
1883
1851
|
}
|
|
1884
1852
|
d();
|
|
@@ -1893,95 +1861,95 @@ function Ki(e) {
|
|
|
1893
1861
|
const s = u++;
|
|
1894
1862
|
return {
|
|
1895
1863
|
key: s,
|
|
1896
|
-
value:
|
|
1864
|
+
value: ei({
|
|
1897
1865
|
get() {
|
|
1898
|
-
const f =
|
|
1866
|
+
const f = U(t == null ? void 0 : t.values, b(e), []) || [], y = n.value.findIndex((C) => C.key === s);
|
|
1899
1867
|
return y === -1 ? a : f[y];
|
|
1900
1868
|
},
|
|
1901
1869
|
set(f) {
|
|
1902
1870
|
const y = n.value.findIndex((C) => C.key === s);
|
|
1903
1871
|
if (y === -1) {
|
|
1904
|
-
|
|
1872
|
+
We("Attempting to update a non-existent array item");
|
|
1905
1873
|
return;
|
|
1906
1874
|
}
|
|
1907
|
-
|
|
1875
|
+
$(y, f);
|
|
1908
1876
|
}
|
|
1909
1877
|
}),
|
|
1910
1878
|
isFirst: !1,
|
|
1911
1879
|
isLast: !1
|
|
1912
1880
|
};
|
|
1913
1881
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const s =
|
|
1882
|
+
function _(a) {
|
|
1883
|
+
const s = b(e), c = U(t == null ? void 0 : t.values, s);
|
|
1916
1884
|
if (!c || !Array.isArray(c))
|
|
1917
1885
|
return;
|
|
1918
1886
|
const f = [...c];
|
|
1919
1887
|
f.splice(a, 1), t == null || t.unsetInitialValue(s + `[${a}]`), t == null || t.setFieldValue(s, f), n.value.splice(a, 1), m();
|
|
1920
1888
|
}
|
|
1921
1889
|
function k(a) {
|
|
1922
|
-
const s =
|
|
1890
|
+
const s = b(e), c = U(t == null ? void 0 : t.values, s), f = Le(c) ? [] : c;
|
|
1923
1891
|
if (!Array.isArray(f))
|
|
1924
1892
|
return;
|
|
1925
1893
|
const y = [...f];
|
|
1926
1894
|
y.push(a), t == null || t.stageInitialValue(s + `[${y.length - 1}]`, a), t == null || t.setFieldValue(s, y), n.value.push(p(a)), m();
|
|
1927
1895
|
}
|
|
1928
1896
|
function S(a, s) {
|
|
1929
|
-
const c =
|
|
1897
|
+
const c = b(e), f = U(t == null ? void 0 : t.values, c);
|
|
1930
1898
|
if (!Array.isArray(f) || !(a in f) || !(s in f))
|
|
1931
1899
|
return;
|
|
1932
1900
|
const y = [...f], C = [...n.value], O = y[a];
|
|
1933
1901
|
y[a] = y[s], y[s] = O;
|
|
1934
|
-
const
|
|
1935
|
-
C[a] = C[s], C[s] =
|
|
1902
|
+
const P = C[a];
|
|
1903
|
+
C[a] = C[s], C[s] = P, t == null || t.setFieldValue(c, y), n.value = C, m();
|
|
1936
1904
|
}
|
|
1937
1905
|
function A(a, s) {
|
|
1938
|
-
const c =
|
|
1906
|
+
const c = b(e), f = U(t == null ? void 0 : t.values, c);
|
|
1939
1907
|
if (!Array.isArray(f) || f.length < a)
|
|
1940
1908
|
return;
|
|
1941
1909
|
const y = [...f], C = [...n.value];
|
|
1942
1910
|
y.splice(a, 0, s), C.splice(a, 0, p(s)), t == null || t.setFieldValue(c, y), n.value = C, m();
|
|
1943
1911
|
}
|
|
1944
|
-
function
|
|
1945
|
-
const s =
|
|
1912
|
+
function j(a) {
|
|
1913
|
+
const s = b(e);
|
|
1946
1914
|
t == null || t.setFieldValue(s, a), d();
|
|
1947
1915
|
}
|
|
1948
|
-
function
|
|
1949
|
-
const c =
|
|
1916
|
+
function $(a, s) {
|
|
1917
|
+
const c = b(e), f = U(t == null ? void 0 : t.values, c);
|
|
1950
1918
|
!Array.isArray(f) || f.length - 1 < a || (t == null || t.setFieldValue(`${c}[${a}]`, s), t == null || t.validate({ mode: "validated-only" }));
|
|
1951
1919
|
}
|
|
1952
1920
|
function L(a) {
|
|
1953
|
-
const s =
|
|
1921
|
+
const s = b(e), c = U(t == null ? void 0 : t.values, s), f = Le(c) ? [] : c;
|
|
1954
1922
|
if (!Array.isArray(f))
|
|
1955
1923
|
return;
|
|
1956
1924
|
const y = [a, ...f];
|
|
1957
1925
|
t == null || t.stageInitialValue(s + `[${y.length - 1}]`, a), t == null || t.setFieldValue(s, y), n.value.unshift(p(a)), m();
|
|
1958
1926
|
}
|
|
1959
1927
|
function v(a, s) {
|
|
1960
|
-
const c =
|
|
1928
|
+
const c = b(e), f = U(t == null ? void 0 : t.values, c), y = Le(f) ? [] : [...f];
|
|
1961
1929
|
if (!Array.isArray(f) || !(a in f) || !(s in f))
|
|
1962
1930
|
return;
|
|
1963
1931
|
const C = [...n.value], O = C[a];
|
|
1964
1932
|
C.splice(a, 1), C.splice(s, 0, O);
|
|
1965
|
-
const
|
|
1966
|
-
y.splice(a, 1), y.splice(s, 0,
|
|
1933
|
+
const P = y[a];
|
|
1934
|
+
y.splice(a, 1), y.splice(s, 0, P), t == null || t.setFieldValue(c, y), n.value = C, m();
|
|
1967
1935
|
}
|
|
1968
1936
|
const l = {
|
|
1969
1937
|
fields: n,
|
|
1970
|
-
remove:
|
|
1938
|
+
remove: _,
|
|
1971
1939
|
push: k,
|
|
1972
1940
|
swap: S,
|
|
1973
1941
|
insert: A,
|
|
1974
|
-
update:
|
|
1975
|
-
replace:
|
|
1942
|
+
update: $,
|
|
1943
|
+
replace: j,
|
|
1976
1944
|
prepend: L,
|
|
1977
1945
|
move: v
|
|
1978
1946
|
};
|
|
1979
|
-
return t.fieldArrays.push(Object.assign({ path: e, reset: d }, l)),
|
|
1980
|
-
const a = t.fieldArrays.findIndex((s) =>
|
|
1947
|
+
return t.fieldArrays.push(Object.assign({ path: e, reset: d }, l)), Ft(() => {
|
|
1948
|
+
const a = t.fieldArrays.findIndex((s) => b(s.path) === b(e));
|
|
1981
1949
|
a >= 0 && t.fieldArrays.splice(a, 1);
|
|
1982
1950
|
}), l;
|
|
1983
1951
|
}
|
|
1984
|
-
|
|
1952
|
+
he({
|
|
1985
1953
|
name: "FieldArray",
|
|
1986
1954
|
inheritAttrs: !1,
|
|
1987
1955
|
props: {
|
|
@@ -1991,10 +1959,10 @@ oe({
|
|
|
1991
1959
|
}
|
|
1992
1960
|
},
|
|
1993
1961
|
setup(e, t) {
|
|
1994
|
-
const { push: n, remove: i, swap: r, insert: o, replace: u, update: d, prepend: m, move: p, fields:
|
|
1962
|
+
const { push: n, remove: i, swap: r, insert: o, replace: u, update: d, prepend: m, move: p, fields: _ } = Ti(de(e, "name"));
|
|
1995
1963
|
function k() {
|
|
1996
1964
|
return {
|
|
1997
|
-
fields:
|
|
1965
|
+
fields: _.value,
|
|
1998
1966
|
push: n,
|
|
1999
1967
|
remove: i,
|
|
2000
1968
|
swap: r,
|
|
@@ -2014,10 +1982,10 @@ oe({
|
|
|
2014
1982
|
replace: u,
|
|
2015
1983
|
prepend: m,
|
|
2016
1984
|
move: p
|
|
2017
|
-
}), () =>
|
|
1985
|
+
}), () => $e(void 0, t, k);
|
|
2018
1986
|
}
|
|
2019
1987
|
});
|
|
2020
|
-
|
|
1988
|
+
he({
|
|
2021
1989
|
name: "ErrorMessage",
|
|
2022
1990
|
props: {
|
|
2023
1991
|
as: {
|
|
@@ -2030,7 +1998,7 @@ oe({
|
|
|
2030
1998
|
}
|
|
2031
1999
|
},
|
|
2032
2000
|
setup(e, t) {
|
|
2033
|
-
const n =
|
|
2001
|
+
const n = Nt(Me, void 0), i = z(() => n == null ? void 0 : n.errors.value[e.name]);
|
|
2034
2002
|
function r() {
|
|
2035
2003
|
return {
|
|
2036
2004
|
message: i.value
|
|
@@ -2039,18 +2007,18 @@ oe({
|
|
|
2039
2007
|
return () => {
|
|
2040
2008
|
if (!i.value)
|
|
2041
2009
|
return;
|
|
2042
|
-
const o = e.as ?
|
|
2010
|
+
const o = e.as ? lt(e.as) : e.as, u = $e(o, t, r), d = Object.assign({ role: "alert" }, t.attrs);
|
|
2043
2011
|
return !o && (Array.isArray(u) || !u) && (u == null ? void 0 : u.length) ? u : (Array.isArray(u) || !u) && !(u != null && u.length) ? Re(o || "span", d, i.value) : Re(o, d, u);
|
|
2044
2012
|
};
|
|
2045
2013
|
}
|
|
2046
2014
|
});
|
|
2047
|
-
const
|
|
2015
|
+
const Mi = { class: "form-group" }, Pi = {
|
|
2048
2016
|
key: 0,
|
|
2049
2017
|
class: "input-title"
|
|
2050
|
-
},
|
|
2018
|
+
}, ji = ["id", "inputmode", "placeholder", "type", "value", "autocomplete"], Bi = {
|
|
2051
2019
|
key: 1,
|
|
2052
2020
|
class: "input-error"
|
|
2053
|
-
},
|
|
2021
|
+
}, Ui = /* @__PURE__ */ he({
|
|
2054
2022
|
__name: "TextInput",
|
|
2055
2023
|
props: {
|
|
2056
2024
|
mask: null,
|
|
@@ -2068,46 +2036,46 @@ const qi = { class: "form-group" }, Wi = {
|
|
|
2068
2036
|
},
|
|
2069
2037
|
emits: ["update:modelValue"],
|
|
2070
2038
|
setup(e, { expose: t, emit: n }) {
|
|
2071
|
-
const i = e, { value: r, errorMessage: o, meta: u, validate: d, setValue: m } =
|
|
2039
|
+
const i = e, { value: r, errorMessage: o, meta: u, validate: d, setValue: m } = pt(
|
|
2072
2040
|
"input",
|
|
2073
2041
|
i.validation,
|
|
2074
2042
|
{ initialValue: i.modelValue }
|
|
2075
2043
|
);
|
|
2076
|
-
return
|
|
2044
|
+
return W(
|
|
2077
2045
|
() => i.modelValue,
|
|
2078
2046
|
(p) => {
|
|
2079
2047
|
m(p);
|
|
2080
2048
|
}
|
|
2081
|
-
), t({ errorMessage: o, meta: u, validate: d }), (p,
|
|
2082
|
-
const k =
|
|
2083
|
-
return
|
|
2084
|
-
e.title ? (
|
|
2085
|
-
|
|
2086
|
-
class:
|
|
2087
|
-
error:
|
|
2049
|
+
), t({ errorMessage: o, meta: u, validate: d }), (p, _) => {
|
|
2050
|
+
const k = Mt("maska");
|
|
2051
|
+
return ne(), ie("div", Mi, [
|
|
2052
|
+
e.title ? (ne(), ie("div", Pi, we(e.title), 1)) : me("", !0),
|
|
2053
|
+
Z("div", {
|
|
2054
|
+
class: at(["input-container", {
|
|
2055
|
+
error: b(o)
|
|
2088
2056
|
}])
|
|
2089
2057
|
}, [
|
|
2090
|
-
|
|
2058
|
+
rt(Z("input", {
|
|
2091
2059
|
id: e.id,
|
|
2092
2060
|
inputmode: e.inputmode,
|
|
2093
2061
|
placeholder: e.placeholder && e.placeholder,
|
|
2094
2062
|
type: e.type,
|
|
2095
|
-
value:
|
|
2096
|
-
onInput:
|
|
2063
|
+
value: b(r),
|
|
2064
|
+
onInput: _[0] || (_[0] = (S) => n("update:modelValue", S.target.value)),
|
|
2097
2065
|
autocomplete: e.autocomplete
|
|
2098
|
-
}, null, 40,
|
|
2066
|
+
}, null, 40, ji), [
|
|
2099
2067
|
[k, e.mask]
|
|
2100
2068
|
])
|
|
2101
2069
|
], 2),
|
|
2102
|
-
|
|
2070
|
+
b(o) && e.errorDisplay ? (ne(), ie("div", Bi, we(b(o)), 1)) : me("", !0)
|
|
2103
2071
|
]);
|
|
2104
2072
|
};
|
|
2105
2073
|
}
|
|
2106
2074
|
});
|
|
2107
|
-
function
|
|
2075
|
+
function xi(e) {
|
|
2108
2076
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2109
2077
|
}
|
|
2110
|
-
var
|
|
2078
|
+
var Zt = { exports: {} }, Yt = { exports: {} };
|
|
2111
2079
|
(function(e) {
|
|
2112
2080
|
(function(t) {
|
|
2113
2081
|
e.exports ? e.exports = t() : window.intlTelInput = t();
|
|
@@ -2147,7 +2115,7 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2147
2115
|
}
|
|
2148
2116
|
};
|
|
2149
2117
|
typeof window == "object" && (window.intlTelInputGlobals = m);
|
|
2150
|
-
var p = 0,
|
|
2118
|
+
var p = 0, _ = {
|
|
2151
2119
|
allowDropdown: !0,
|
|
2152
2120
|
autoHideDialCode: !0,
|
|
2153
2121
|
autoPlaceholder: "polite",
|
|
@@ -2173,12 +2141,12 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2173
2141
|
S(window.intlTelInputGlobals.instances, function(l) {
|
|
2174
2142
|
window.intlTelInputGlobals.instances[l][v]();
|
|
2175
2143
|
});
|
|
2176
|
-
},
|
|
2144
|
+
}, j = /* @__PURE__ */ function() {
|
|
2177
2145
|
function L(v, l) {
|
|
2178
2146
|
var a = this;
|
|
2179
2147
|
o(this, L), this.id = p++, this.telInput = v, this.activeItem = null, this.highlightedItem = null;
|
|
2180
2148
|
var s = l || {};
|
|
2181
|
-
this.options = {}, S(
|
|
2149
|
+
this.options = {}, S(_, function(c, f) {
|
|
2182
2150
|
a.options[c] = s.hasOwnProperty(c) ? s[c] : f;
|
|
2183
2151
|
}), this.hadInitialPlaceholder = Boolean(v.getAttribute("placeholder"));
|
|
2184
2152
|
}
|
|
@@ -2260,8 +2228,8 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2260
2228
|
if (c.areaCodes)
|
|
2261
2229
|
for (var f = this.countryCodes[c.dialCode][0], y = 0; y < c.areaCodes.length; y++) {
|
|
2262
2230
|
for (var C = c.areaCodes[y], O = 1; O < C.length; O++) {
|
|
2263
|
-
var
|
|
2264
|
-
this._addCountryCode(f,
|
|
2231
|
+
var P = c.dialCode + C.substr(0, O);
|
|
2232
|
+
this._addCountryCode(f, P), this._addCountryCode(c.iso2, P);
|
|
2265
2233
|
}
|
|
2266
2234
|
this._addCountryCode(c.iso2, c.dialCode + C);
|
|
2267
2235
|
}
|
|
@@ -2342,8 +2310,8 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2342
2310
|
}, {
|
|
2343
2311
|
key: "_setInitialState",
|
|
2344
2312
|
value: function() {
|
|
2345
|
-
var l = this.telInput.getAttribute("value"), a = this.telInput.value, s = l && l.charAt(0) === "+" && (!a || a.charAt(0) !== "+"), c = s ? l : a, f = this._getDialCode(c), y = this._isRegionlessNanp(c), C = this.options, O = C.initialCountry,
|
|
2346
|
-
f && !y ? this._updateFlagFromNumber(c) : O !== "auto" && (O ? this._setFlag(O.toLowerCase()) : f && y ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, c || this._setFlag(this.defaultCountry)), !c && !
|
|
2313
|
+
var l = this.telInput.getAttribute("value"), a = this.telInput.value, s = l && l.charAt(0) === "+" && (!a || a.charAt(0) !== "+"), c = s ? l : a, f = this._getDialCode(c), y = this._isRegionlessNanp(c), C = this.options, O = C.initialCountry, P = C.nationalMode, J = C.autoHideDialCode, B = C.separateDialCode;
|
|
2314
|
+
f && !y ? this._updateFlagFromNumber(c) : O !== "auto" && (O ? this._setFlag(O.toLowerCase()) : f && y ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, c || this._setFlag(this.defaultCountry)), !c && !P && !J && !B && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode))), c && this._updateValFromNumber(c);
|
|
2347
2315
|
}
|
|
2348
2316
|
}, {
|
|
2349
2317
|
key: "_initListeners",
|
|
@@ -2538,8 +2506,8 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2538
2506
|
a && this.options.nationalMode && c && a.charAt(0) !== "+" && (a.charAt(0) !== "1" && (a = "1".concat(a)), a = "+".concat(a)), this.options.separateDialCode && s && a.charAt(0) !== "+" && (a = "+".concat(s).concat(a));
|
|
2539
2507
|
var f = this._getDialCode(a, !0), y = this._getNumeric(a), C = null;
|
|
2540
2508
|
if (f) {
|
|
2541
|
-
var O = this.countryCodes[this._getNumeric(f)],
|
|
2542
|
-
if (!
|
|
2509
|
+
var O = this.countryCodes[this._getNumeric(f)], P = O.indexOf(this.selectedCountryData.iso2) !== -1 && y.length <= f.length - 1, J = s === "1" && this._isRegionlessNanp(y);
|
|
2510
|
+
if (!J && !P) {
|
|
2543
2511
|
for (var B = 0; B < O.length; B++)
|
|
2544
2512
|
if (O[B]) {
|
|
2545
2513
|
C = O[B];
|
|
@@ -2634,13 +2602,13 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2634
2602
|
}, {
|
|
2635
2603
|
key: "_scrollTo",
|
|
2636
2604
|
value: function(l, a) {
|
|
2637
|
-
var s = this.countryList, c = window.pageYOffset || document.documentElement.scrollTop, f = s.offsetHeight, y = s.getBoundingClientRect().top + c, C = y + f, O = l.offsetHeight,
|
|
2638
|
-
if (
|
|
2639
|
-
a && (B -=
|
|
2640
|
-
else if (
|
|
2641
|
-
a && (B +=
|
|
2642
|
-
var
|
|
2643
|
-
s.scrollTop = B -
|
|
2605
|
+
var s = this.countryList, c = window.pageYOffset || document.documentElement.scrollTop, f = s.offsetHeight, y = s.getBoundingClientRect().top + c, C = y + f, O = l.offsetHeight, P = l.getBoundingClientRect().top + c, J = P + O, B = P - y + s.scrollTop, H = f / 2 - O / 2;
|
|
2606
|
+
if (P < y)
|
|
2607
|
+
a && (B -= H), s.scrollTop = B;
|
|
2608
|
+
else if (J > C) {
|
|
2609
|
+
a && (B += H);
|
|
2610
|
+
var ee = f - O;
|
|
2611
|
+
s.scrollTop = B - ee;
|
|
2644
2612
|
}
|
|
2645
2613
|
}
|
|
2646
2614
|
}, {
|
|
@@ -2791,7 +2759,7 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2791
2759
|
m.getCountryData = function() {
|
|
2792
2760
|
return n;
|
|
2793
2761
|
};
|
|
2794
|
-
var
|
|
2762
|
+
var $ = function(v, l, a) {
|
|
2795
2763
|
var s = document.createElement("script");
|
|
2796
2764
|
s.onload = function() {
|
|
2797
2765
|
A("handleUtils"), l && l();
|
|
@@ -2803,28 +2771,28 @@ var Xt = { exports: {} }, en = { exports: {} };
|
|
|
2803
2771
|
if (!window.intlTelInputUtils && !window.intlTelInputGlobals.startedLoadingUtilsScript) {
|
|
2804
2772
|
if (window.intlTelInputGlobals.startedLoadingUtilsScript = !0, typeof Promise < "u")
|
|
2805
2773
|
return new Promise(function(v, l) {
|
|
2806
|
-
return
|
|
2774
|
+
return $(L, v, l);
|
|
2807
2775
|
});
|
|
2808
|
-
|
|
2776
|
+
$(L);
|
|
2809
2777
|
}
|
|
2810
2778
|
return null;
|
|
2811
|
-
}, m.defaults =
|
|
2812
|
-
var l = new
|
|
2779
|
+
}, m.defaults = _, m.version = "17.0.19", function(L, v) {
|
|
2780
|
+
var l = new j(L, v);
|
|
2813
2781
|
return l._init(), L.setAttribute("data-intl-tel-input-id", l.id), window.intlTelInputGlobals.instances[l.id] = l, l;
|
|
2814
2782
|
};
|
|
2815
2783
|
}();
|
|
2816
2784
|
});
|
|
2817
|
-
})(
|
|
2785
|
+
})(Yt);
|
|
2818
2786
|
(function(e) {
|
|
2819
|
-
e.exports =
|
|
2820
|
-
})(
|
|
2821
|
-
const
|
|
2787
|
+
e.exports = Yt.exports;
|
|
2788
|
+
})(Zt);
|
|
2789
|
+
const Ri = /* @__PURE__ */ xi(Zt.exports), zi = { class: "form-group" }, Gi = {
|
|
2822
2790
|
key: 0,
|
|
2823
2791
|
class: "input-title"
|
|
2824
|
-
},
|
|
2792
|
+
}, $i = ["id", "placeholder", "value", "autocomplete"], Hi = {
|
|
2825
2793
|
key: 1,
|
|
2826
2794
|
class: "input-error"
|
|
2827
|
-
},
|
|
2795
|
+
}, Ki = /* @__PURE__ */ he({
|
|
2828
2796
|
__name: "PhoneInput",
|
|
2829
2797
|
props: {
|
|
2830
2798
|
placeholder: {
|
|
@@ -2853,56 +2821,56 @@ const Xi = /* @__PURE__ */ Yi(Xt.exports), er = { class: "form-group" }, tr = {
|
|
|
2853
2821
|
},
|
|
2854
2822
|
emits: ["update:modelValue", "update:phoneCountryCode"],
|
|
2855
2823
|
setup(e, { expose: t, emit: n }) {
|
|
2856
|
-
const i = e, r =
|
|
2824
|
+
const i = e, r = X(), { value: o, errorMessage: u, meta: d, validate: m, setValue: p } = pt(
|
|
2857
2825
|
"input",
|
|
2858
2826
|
i.validation,
|
|
2859
2827
|
{ initialValue: i.modelValue }
|
|
2860
2828
|
);
|
|
2861
|
-
return
|
|
2829
|
+
return W(
|
|
2862
2830
|
() => i.modelValue,
|
|
2863
|
-
(
|
|
2864
|
-
p(
|
|
2831
|
+
(_) => {
|
|
2832
|
+
p(_);
|
|
2865
2833
|
}
|
|
2866
|
-
), t({ errorMessage: u, meta: d, validate: m }),
|
|
2834
|
+
), t({ errorMessage: u, meta: d, validate: m }), ot(() => {
|
|
2867
2835
|
r.value.addEventListener(
|
|
2868
2836
|
"countrychange",
|
|
2869
2837
|
() => n(
|
|
2870
2838
|
"update:phoneCountryCode",
|
|
2871
2839
|
window.intlTelInputGlobals.getInstance(r.value).getSelectedCountryData().dialCode
|
|
2872
2840
|
)
|
|
2873
|
-
),
|
|
2841
|
+
), Ri(r.value, {
|
|
2874
2842
|
initialCountry: "pt",
|
|
2875
2843
|
preferredCountries: ["pt"],
|
|
2876
2844
|
separateDialCode: !0
|
|
2877
2845
|
});
|
|
2878
|
-
}), (
|
|
2879
|
-
const S =
|
|
2880
|
-
return
|
|
2881
|
-
e.title ? (
|
|
2882
|
-
|
|
2883
|
-
class:
|
|
2846
|
+
}), (_, k) => {
|
|
2847
|
+
const S = Mt("maska");
|
|
2848
|
+
return ne(), ie("div", zi, [
|
|
2849
|
+
e.title ? (ne(), ie("div", Gi, we(e.title), 1)) : me("", !0),
|
|
2850
|
+
Z("div", {
|
|
2851
|
+
class: at(["input-container", { error: b(u) }])
|
|
2884
2852
|
}, [
|
|
2885
|
-
|
|
2853
|
+
rt(Z("input", {
|
|
2886
2854
|
ref_key: "inputEl",
|
|
2887
2855
|
ref: r,
|
|
2888
2856
|
id: e.id,
|
|
2889
2857
|
placeholder: e.placeholder && e.placeholder,
|
|
2890
2858
|
type: "tel",
|
|
2891
|
-
value:
|
|
2859
|
+
value: b(o),
|
|
2892
2860
|
autocomplete: e.autocomplete,
|
|
2893
2861
|
onInput: k[0] || (k[0] = (A) => n("update:modelValue", A.target.value))
|
|
2894
|
-
}, null, 40,
|
|
2862
|
+
}, null, 40, $i), [
|
|
2895
2863
|
[S, "#########"]
|
|
2896
2864
|
])
|
|
2897
2865
|
], 2),
|
|
2898
|
-
|
|
2866
|
+
b(u) && e.errorDisplay ? (ne(), ie("div", Hi, we(b(u)), 1)) : me("", !0)
|
|
2899
2867
|
]);
|
|
2900
2868
|
};
|
|
2901
2869
|
}
|
|
2902
|
-
}),
|
|
2870
|
+
}), qi = { class: "form-group" }, Wi = { class: "input-container-checkbox" }, Ji = ["checked"], Qi = /* @__PURE__ */ Z("div", { class: "checkbox-icon m-cgg-icon--check2" }, null, -1), Zi = ["innerHTML"], Yi = {
|
|
2903
2871
|
key: 0,
|
|
2904
2872
|
class: "input-error"
|
|
2905
|
-
},
|
|
2873
|
+
}, Xi = /* @__PURE__ */ he({
|
|
2906
2874
|
__name: "CheckboxInput",
|
|
2907
2875
|
props: {
|
|
2908
2876
|
label: String,
|
|
@@ -2911,40 +2879,38 @@ const Xi = /* @__PURE__ */ Yi(Xt.exports), er = { class: "form-group" }, tr = {
|
|
|
2911
2879
|
},
|
|
2912
2880
|
emits: ["update:modelValue"],
|
|
2913
2881
|
setup(e, { emit: t }) {
|
|
2914
|
-
return (n, i) => (
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2882
|
+
return (n, i) => (ne(), ie("div", qi, [
|
|
2883
|
+
Z("div", Wi, [
|
|
2884
|
+
Z("label", null, [
|
|
2885
|
+
Z("input", {
|
|
2918
2886
|
type: "checkbox",
|
|
2919
2887
|
checked: e.modelValue,
|
|
2920
2888
|
onChange: i[0] || (i[0] = (r) => n.$emit("update:modelValue", r.target.checked))
|
|
2921
|
-
}, null, 40,
|
|
2922
|
-
|
|
2923
|
-
|
|
2889
|
+
}, null, 40, Ji),
|
|
2890
|
+
Qi,
|
|
2891
|
+
Z("div", {
|
|
2924
2892
|
class: "text-container",
|
|
2925
2893
|
innerHTML: e.label
|
|
2926
|
-
}, null, 8,
|
|
2894
|
+
}, null, 8, Zi)
|
|
2927
2895
|
])
|
|
2928
2896
|
]),
|
|
2929
|
-
e.error ? (
|
|
2897
|
+
e.error ? (ne(), ie("div", Yi, we(e.error), 1)) : me("", !0)
|
|
2930
2898
|
]));
|
|
2931
2899
|
}
|
|
2932
|
-
}),
|
|
2900
|
+
}), Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2933
2901
|
__proto__: null,
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
PhoneInput: rr,
|
|
2940
|
-
CheckboxInput: cr
|
|
2902
|
+
Modal: Vn,
|
|
2903
|
+
CjaButton: Dn,
|
|
2904
|
+
TextInput: Ui,
|
|
2905
|
+
PhoneInput: Ki,
|
|
2906
|
+
CheckboxInput: Xi
|
|
2941
2907
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2942
2908
|
/*!
|
|
2943
2909
|
* maska v1.5.2
|
|
2944
2910
|
* (c) 2019-2022 Alexander Shabunevich
|
|
2945
2911
|
* Released under the MIT License.
|
|
2946
2912
|
*/
|
|
2947
|
-
function
|
|
2913
|
+
function Et(e, t) {
|
|
2948
2914
|
var n = Object.keys(e);
|
|
2949
2915
|
if (Object.getOwnPropertySymbols) {
|
|
2950
2916
|
var i = Object.getOwnPropertySymbols(e);
|
|
@@ -2954,31 +2920,31 @@ function Lt(e, t) {
|
|
|
2954
2920
|
}
|
|
2955
2921
|
return n;
|
|
2956
2922
|
}
|
|
2957
|
-
function
|
|
2923
|
+
function Ue(e) {
|
|
2958
2924
|
for (var t = 1; t < arguments.length; t++) {
|
|
2959
2925
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
2960
|
-
t % 2 ?
|
|
2961
|
-
|
|
2962
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
2926
|
+
t % 2 ? Et(Object(n), !0).forEach(function(i) {
|
|
2927
|
+
nr(e, i, n[i]);
|
|
2928
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Et(Object(n)).forEach(function(i) {
|
|
2963
2929
|
Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(n, i));
|
|
2964
2930
|
});
|
|
2965
2931
|
}
|
|
2966
2932
|
return e;
|
|
2967
2933
|
}
|
|
2968
|
-
function
|
|
2934
|
+
function er(e, t) {
|
|
2969
2935
|
if (!(e instanceof t))
|
|
2970
2936
|
throw new TypeError("Cannot call a class as a function");
|
|
2971
2937
|
}
|
|
2972
|
-
function
|
|
2938
|
+
function tr(e, t) {
|
|
2973
2939
|
for (var n = 0; n < t.length; n++) {
|
|
2974
2940
|
var i = t[n];
|
|
2975
|
-
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e,
|
|
2941
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, Xt(i.key), i);
|
|
2976
2942
|
}
|
|
2977
2943
|
}
|
|
2978
|
-
function
|
|
2979
|
-
return (t =
|
|
2944
|
+
function nr(e, t, n) {
|
|
2945
|
+
return (t = Xt(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
2980
2946
|
}
|
|
2981
|
-
function
|
|
2947
|
+
function Xt(e) {
|
|
2982
2948
|
var t = function(n, i) {
|
|
2983
2949
|
if (typeof n != "object" || n === null)
|
|
2984
2950
|
return n;
|
|
@@ -2993,29 +2959,29 @@ function tn(e) {
|
|
|
2993
2959
|
}(e, "string");
|
|
2994
2960
|
return typeof t == "symbol" ? t : String(t);
|
|
2995
2961
|
}
|
|
2996
|
-
var
|
|
2997
|
-
function
|
|
2998
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2999
|
-
return
|
|
2962
|
+
var en = { "#": { pattern: /[0-9]/ }, X: { pattern: /[0-9a-zA-Z]/ }, S: { pattern: /[a-zA-Z]/ }, A: { pattern: /[a-zA-Z]/, uppercase: !0 }, a: { pattern: /[a-zA-Z]/, lowercase: !0 }, "!": { escape: !0 }, "*": { repeat: !0 } };
|
|
2963
|
+
function At(e, t) {
|
|
2964
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : en, i = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3];
|
|
2965
|
+
return tn(t).length > 1 ? ir(t)(e, t, n, i) : nt(e, t, n, i);
|
|
3000
2966
|
}
|
|
3001
|
-
function
|
|
2967
|
+
function tn(e) {
|
|
3002
2968
|
try {
|
|
3003
2969
|
return JSON.parse(e);
|
|
3004
2970
|
} catch {
|
|
3005
2971
|
return [e];
|
|
3006
2972
|
}
|
|
3007
2973
|
}
|
|
3008
|
-
function
|
|
3009
|
-
var t =
|
|
2974
|
+
function ir(e) {
|
|
2975
|
+
var t = tn(e).sort(function(i, r) {
|
|
3010
2976
|
return i.length - r.length;
|
|
3011
2977
|
});
|
|
3012
2978
|
return function(i, r, o) {
|
|
3013
|
-
var u = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3], d = t.map(function(
|
|
3014
|
-
return
|
|
2979
|
+
var u = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3], d = t.map(function(_) {
|
|
2980
|
+
return nt(i, _, o, !1);
|
|
3015
2981
|
}), m = d.pop();
|
|
3016
2982
|
for (var p in t)
|
|
3017
2983
|
if (n(m, t[p], o))
|
|
3018
|
-
return
|
|
2984
|
+
return nt(i, t[p], o, u);
|
|
3019
2985
|
return "";
|
|
3020
2986
|
};
|
|
3021
2987
|
function n(i, r, o) {
|
|
@@ -3026,16 +2992,16 @@ function pr(e) {
|
|
|
3026
2992
|
}).length >= i.length;
|
|
3027
2993
|
}
|
|
3028
2994
|
}
|
|
3029
|
-
function
|
|
2995
|
+
function nt(e, t, n) {
|
|
3030
2996
|
for (var i = !(arguments.length > 3 && arguments[3] !== void 0) || arguments[3], r = 0, o = 0, u = "", d = ""; r < t.length && o < e.length; ) {
|
|
3031
|
-
var m = t[r], p = e[o],
|
|
3032
|
-
if (
|
|
3033
|
-
|
|
3034
|
-
else if (
|
|
2997
|
+
var m = t[r], p = e[o], _ = n[m];
|
|
2998
|
+
if (_ && _.pattern)
|
|
2999
|
+
_.pattern.test(p) && (u += rr(p, _), r++, i && t[r] && (n[t[r]] ? n[t[r]] && n[t[r]].escape && (u += t[r + 1], r += 2) : (u += t[r], r++))), o++;
|
|
3000
|
+
else if (_ && _.repeat) {
|
|
3035
3001
|
var k = n[t[r - 1]];
|
|
3036
3002
|
k && !k.pattern.test(p) ? r++ : r--;
|
|
3037
3003
|
} else
|
|
3038
|
-
|
|
3004
|
+
_ && _.escape && (m = t[++r]), i && (u += m), p === m && o++, r++;
|
|
3039
3005
|
}
|
|
3040
3006
|
for (; i && r < t.length; ) {
|
|
3041
3007
|
var S = t[r];
|
|
@@ -3047,33 +3013,33 @@ function it(e, t, n) {
|
|
|
3047
3013
|
}
|
|
3048
3014
|
return u + d;
|
|
3049
3015
|
}
|
|
3050
|
-
function
|
|
3016
|
+
function rr(e, t) {
|
|
3051
3017
|
return t.transform && (e = t.transform(e)), t.uppercase ? e.toLocaleUpperCase() : t.lowercase ? e.toLocaleLowerCase() : e;
|
|
3052
3018
|
}
|
|
3053
|
-
function
|
|
3019
|
+
function Vt(e) {
|
|
3054
3020
|
return e instanceof HTMLInputElement ? e : e.querySelector("input") || e;
|
|
3055
3021
|
}
|
|
3056
|
-
function
|
|
3022
|
+
function it(e) {
|
|
3057
3023
|
return Object.prototype.toString.call(e) === "[object String]";
|
|
3058
3024
|
}
|
|
3059
|
-
var
|
|
3025
|
+
var ar = function() {
|
|
3060
3026
|
function e(i) {
|
|
3061
3027
|
var r = this, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3062
|
-
if (
|
|
3028
|
+
if (er(this, e), !i)
|
|
3063
3029
|
throw new Error("Maska: no element for mask");
|
|
3064
3030
|
if (o.preprocessor != null && typeof o.preprocessor != "function")
|
|
3065
3031
|
throw new Error("Maska: preprocessor must be a function");
|
|
3066
3032
|
if (o.tokens)
|
|
3067
3033
|
for (var u in o.tokens)
|
|
3068
|
-
o.tokens[u] =
|
|
3069
|
-
this._opts = { mask: o.mask, tokens:
|
|
3034
|
+
o.tokens[u] = Ue({}, o.tokens[u]), o.tokens[u].pattern && it(o.tokens[u].pattern) && (o.tokens[u].pattern = new RegExp(o.tokens[u].pattern));
|
|
3035
|
+
this._opts = { mask: o.mask, tokens: Ue(Ue({}, en), o.tokens), preprocessor: o.preprocessor }, this._el = it(i) ? document.querySelectorAll(i) : i.length ? i : [i], this.inputEvent = function(d) {
|
|
3070
3036
|
return r.updateValue(d.target, d);
|
|
3071
3037
|
}, this.init();
|
|
3072
3038
|
}
|
|
3073
3039
|
var t, n;
|
|
3074
3040
|
return t = e, n = [{ key: "init", value: function() {
|
|
3075
3041
|
for (var i = this, r = function(u) {
|
|
3076
|
-
var d =
|
|
3042
|
+
var d = Vt(i._el[u]);
|
|
3077
3043
|
!i._opts.mask || d.dataset.mask && d.dataset.mask === i._opts.mask || (d.dataset.mask = i._opts.mask), setTimeout(function() {
|
|
3078
3044
|
return i.updateValue(d);
|
|
3079
3045
|
}, 0), d.dataset.maskInited || (d.dataset.maskInited = !0, d.addEventListener("input", i.inputEvent), d.addEventListener("beforeinput", i.beforeInput));
|
|
@@ -3081,7 +3047,7 @@ var gr = function() {
|
|
|
3081
3047
|
r(o);
|
|
3082
3048
|
} }, { key: "destroy", value: function() {
|
|
3083
3049
|
for (var i = 0; i < this._el.length; i++) {
|
|
3084
|
-
var r =
|
|
3050
|
+
var r = Vt(this._el[i]);
|
|
3085
3051
|
r.removeEventListener("input", this.inputEvent), r.removeEventListener("beforeinput", this.beforeInput), delete r.dataset.mask, delete r.dataset.maskInited;
|
|
3086
3052
|
}
|
|
3087
3053
|
} }, { key: "updateValue", value: function(i, r) {
|
|
@@ -3090,13 +3056,13 @@ var gr = function() {
|
|
|
3090
3056
|
if (!i.value && !o || !i.dataset.mask)
|
|
3091
3057
|
return i.dataset.maskRawValue = "", void this.dispatch("maska", i, r);
|
|
3092
3058
|
var u = i.selectionEnd, d = i.value, m = d[u - 1];
|
|
3093
|
-
i.dataset.maskRawValue =
|
|
3059
|
+
i.dataset.maskRawValue = At(i.value, i.dataset.mask, this._opts.tokens, !1);
|
|
3094
3060
|
var p = i.value;
|
|
3095
|
-
this._opts.preprocessor && (p = this._opts.preprocessor(p)), i.value =
|
|
3096
|
-
for (; k && k <
|
|
3061
|
+
this._opts.preprocessor && (p = this._opts.preprocessor(p)), i.value = At(p, i.dataset.mask, this._opts.tokens), r && r.inputType === "insertText" && u === d.length && (u = i.value.length), function(_, k, S) {
|
|
3062
|
+
for (; k && k < _.value.length && _.value.charAt(k - 1) !== S; )
|
|
3097
3063
|
k++;
|
|
3098
|
-
(
|
|
3099
|
-
|
|
3064
|
+
(_.type ? _.type.match(/^(text|search|password|tel|url)$/i) : !_.type) && _ === document.activeElement && (_.setSelectionRange(k, k), setTimeout(function() {
|
|
3065
|
+
_.setSelectionRange(k, k);
|
|
3100
3066
|
}, 0));
|
|
3101
3067
|
}(i, u, m), this.dispatch("maska", i, r), i.value !== d && this.dispatch("input", i, r);
|
|
3102
3068
|
}
|
|
@@ -3107,44 +3073,42 @@ var gr = function() {
|
|
|
3107
3073
|
var d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, m = document.createEvent("Event");
|
|
3108
3074
|
return m.initEvent(u, !0, !0), d && (m.inputType = d), m;
|
|
3109
3075
|
}(i, o && o.inputType || null));
|
|
3110
|
-
} }], n &&
|
|
3111
|
-
}(),
|
|
3112
|
-
t.value && (
|
|
3113
|
-
return !(
|
|
3114
|
-
}(t) ||
|
|
3076
|
+
} }], n && tr(t.prototype, n), Object.defineProperty(t, "prototype", { writable: !1 }), e;
|
|
3077
|
+
}(), Qe, or = (Qe = /* @__PURE__ */ new WeakMap(), function(e, t) {
|
|
3078
|
+
t.value && (Qe.has(e) && !function(n) {
|
|
3079
|
+
return !(it(n.value) && n.value === n.oldValue || Array.isArray(n.value) && JSON.stringify(n.value) === JSON.stringify(n.oldValue) || n.value && n.value.mask && n.oldValue && n.oldValue.mask && n.value.mask === n.oldValue.mask);
|
|
3080
|
+
}(t) || Qe.set(e, new ar(e, function(n) {
|
|
3115
3081
|
var i = {};
|
|
3116
|
-
return n.mask ? (i.mask = Array.isArray(n.mask) ? JSON.stringify(n.mask) : n.mask, i.tokens = n.tokens ?
|
|
3082
|
+
return n.mask ? (i.mask = Array.isArray(n.mask) ? JSON.stringify(n.mask) : n.mask, i.tokens = n.tokens ? Ue({}, n.tokens) : {}, i.preprocessor = n.preprocessor) : i.mask = Array.isArray(n) ? JSON.stringify(n) : n, i;
|
|
3117
3083
|
}(t.value))));
|
|
3118
3084
|
});
|
|
3119
|
-
function
|
|
3120
|
-
e.directive("maska",
|
|
3085
|
+
function nn(e) {
|
|
3086
|
+
e.directive("maska", or);
|
|
3121
3087
|
}
|
|
3122
|
-
typeof window < "u" && window.Vue && window.Vue.use && window.Vue.use(
|
|
3123
|
-
const
|
|
3088
|
+
typeof window < "u" && window.Vue && window.Vue.use && window.Vue.use(nn);
|
|
3089
|
+
const lr = 100, cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3124
3090
|
__proto__: null,
|
|
3125
|
-
MAGIC_NUM:
|
|
3091
|
+
MAGIC_NUM: lr
|
|
3126
3092
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3127
|
-
function
|
|
3093
|
+
function sr(e, t) {
|
|
3128
3094
|
return e + t;
|
|
3129
3095
|
}
|
|
3130
|
-
const
|
|
3131
|
-
add:
|
|
3096
|
+
const fr = {
|
|
3097
|
+
add: sr
|
|
3132
3098
|
};
|
|
3133
|
-
function
|
|
3134
|
-
for (const t in
|
|
3135
|
-
e.component(t,
|
|
3136
|
-
e.use(
|
|
3099
|
+
function ur(e) {
|
|
3100
|
+
for (const t in Ot)
|
|
3101
|
+
e.component(t, Ot[t]);
|
|
3102
|
+
e.use(nn);
|
|
3137
3103
|
}
|
|
3138
|
-
const
|
|
3104
|
+
const hr = { install: ur };
|
|
3139
3105
|
export {
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
Zi as TextInput,
|
|
3149
|
-
Sr as default
|
|
3106
|
+
Xi as CheckboxInput,
|
|
3107
|
+
Dn as CjaButton,
|
|
3108
|
+
Vn as Modal,
|
|
3109
|
+
cr as MyConstants,
|
|
3110
|
+
fr as MyUtil,
|
|
3111
|
+
Ki as PhoneInput,
|
|
3112
|
+
Ui as TextInput,
|
|
3113
|
+
hr as default
|
|
3150
3114
|
};
|