@overgaming/valiform 0.2.0 → 0.2.1

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/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { inject as A, shallowRef as B, isRef as te, ref as h, readonly as w, provide as x, defineComponent as R, useModel as W, isReactive as ne, reactive as re, computed as b, openBlock as L, createElementBlock as _, withModifiers as se, renderSlot as z, normalizeProps as I, guardReactiveProps as K, mergeModels as U, watch as Z, toValue as $, useId as oe, onMounted as ae, onUnmounted as ue, unref as ie } from "vue";
1
+ import { inject as A, shallowRef as B, isRef as ne, ref as h, readonly as w, provide as j, defineComponent as R, useModel as W, isReactive as re, reactive as se, computed as b, openBlock as L, createElementBlock as _, withModifiers as oe, renderSlot as z, normalizeProps as I, guardReactiveProps as K, mergeModels as U, watch as Z, toValue as $, useId as ae, onMounted as ue, onUnmounted as ie, unref as ce } from "vue";
2
2
  const k = Symbol("locale-context"), Y = (e = null) => {
3
3
  const t = A(k, e);
4
4
  if (!t && t !== null)
5
5
  throw new Error("Context with localeContextKey not found");
6
6
  return t;
7
- }, ce = {
7
+ }, le = {
8
8
  required: "This field is required",
9
9
  email: "Please enter a valid email address",
10
10
  min: ({ value: e }) => `Must be at least ${e}`,
@@ -39,227 +39,227 @@ const k = Symbol("locale-context"), Y = (e = null) => {
39
39
  symbol: "Must contain only symbols",
40
40
  uppercase: "Must contain only uppercase characters",
41
41
  url: "Must be a valid URL"
42
- }, G = B(/* @__PURE__ */ new Map()), le = (e, t) => {
42
+ }, G = B(/* @__PURE__ */ new Map()), fe = (e, t) => {
43
43
  G.value.set(e, t);
44
44
  }, P = (e) => {
45
45
  Object.entries(e).forEach(([t, n]) => {
46
- le(t, n);
46
+ fe(t, n);
47
47
  });
48
- }, fe = (e) => G.value.get(e);
49
- function me(e) {
48
+ }, me = (e) => G.value.get(e);
49
+ function de(e) {
50
50
  const t = e.accepted;
51
51
  return typeof t == "function" ? t({}) : t ?? "Must be accepted";
52
52
  }
53
- function de(e) {
53
+ function ge(e) {
54
54
  return e ? ["yes", "on", "1", "true"].includes(String(e).toLowerCase()) : !1;
55
55
  }
56
- function ge(e, t = {}) {
56
+ function pe(e, t = {}) {
57
57
  const { messages: n = {} } = t;
58
- return de(e) ? !0 : me(n);
58
+ return ge(e) ? !0 : de(n);
59
59
  }
60
- function pe(e) {
60
+ function be(e) {
61
61
  const t = e.alpha;
62
62
  return typeof t == "function" ? t({}) : t ?? "Must contain only alphabetical characters";
63
63
  }
64
- function be(e) {
64
+ function ye(e) {
65
65
  return e ? /^[a-zA-Z]+$/.test(String(e)) : !0;
66
66
  }
67
- function ye(e, t = {}) {
67
+ function $e(e, t = {}) {
68
68
  const { messages: n = {} } = t;
69
- return be(e) ? !0 : pe(n);
69
+ return ye(e) ? !0 : be(n);
70
70
  }
71
- function $e(e) {
71
+ function he(e) {
72
72
  const t = e.alphanumeric;
73
73
  return typeof t == "function" ? t({}) : t ?? "Must contain only letters and numbers";
74
74
  }
75
- function he(e) {
75
+ function ve(e) {
76
76
  return e ? /^[a-zA-Z0-9]+$/.test(String(e)) : !0;
77
77
  }
78
- function ve(e, t = {}) {
78
+ function Me(e, t = {}) {
79
79
  const { messages: n = {} } = t;
80
- return he(e) ? !0 : $e(n);
80
+ return ve(e) ? !0 : he(n);
81
81
  }
82
- function Me(e) {
82
+ function Ne(e) {
83
83
  const t = e.alphaSpaces;
84
84
  return typeof t == "function" ? t({}) : t ?? "Must contain only letters and spaces";
85
85
  }
86
- function Ne(e) {
86
+ function we(e) {
87
87
  return e ? /^[a-zA-Z\s]+$/.test(String(e)) : !0;
88
88
  }
89
- function we(e, t = {}) {
89
+ function Ae(e, t = {}) {
90
90
  const { messages: n = {} } = t;
91
- return Ne(e) ? !0 : Me(n);
91
+ return we(e) ? !0 : Ne(n);
92
92
  }
93
- function Ae(e, t, n) {
93
+ function De(e, t, n) {
94
94
  const r = e.between;
95
95
  return typeof r == "function" ? r({ min: t, max: n }) : r ?? `Must be between ${t} and ${n}`;
96
96
  }
97
- function De(e, t, n) {
97
+ function Se(e, t, n) {
98
98
  if (!e && e !== 0) return !0;
99
99
  const r = Number(e);
100
100
  if (isNaN(r)) return !1;
101
101
  const s = Number(t), o = Number(n);
102
102
  return isNaN(s) || isNaN(o) ? !1 : r >= s && r <= o;
103
103
  }
104
- function Se(e, t = {}) {
104
+ function Fe(e, t = {}) {
105
105
  const { args: n = [], messages: r = {} } = t, [s, o] = n;
106
- return De(e, s, o) ? !0 : Ae(r, s, o);
106
+ return Se(e, s, o) ? !0 : De(r, s, o);
107
107
  }
108
- function Fe(e, t) {
108
+ function xe(e, t) {
109
109
  const n = e.confirm;
110
110
  return typeof n == "function" ? n({ fieldName: t }) : n ?? `Must match ${t}`;
111
111
  }
112
- function xe(e, t, n) {
112
+ function je(e, t, n) {
113
113
  var r;
114
114
  return e ? n ? e === ((r = n[t]) == null ? void 0 : r.value) : !1 : !0;
115
115
  }
116
- function je(e, t = {}) {
116
+ function Te(e, t = {}) {
117
117
  const { args: n = [], messages: r = {}, fields: s = {} } = t, [o] = n;
118
- return xe(e, o, s) ? !0 : Fe(r, o);
118
+ return je(e, o, s) ? !0 : xe(r, o);
119
119
  }
120
- function Te(e) {
120
+ function Ve(e) {
121
121
  const t = e.containsAlpha;
122
122
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one letter";
123
123
  }
124
- function Ve(e) {
124
+ function qe(e) {
125
125
  return e ? /[a-zA-Z]/.test(String(e)) : !0;
126
126
  }
127
- function qe(e, t = {}) {
127
+ function Ce(e, t = {}) {
128
128
  const { messages: n = {} } = t;
129
- return Ve(e) ? !0 : Te(n);
129
+ return qe(e) ? !0 : Ve(n);
130
130
  }
131
- function Ce(e) {
131
+ function Pe(e) {
132
132
  const t = e.containsAlphanumeric;
133
133
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one letter or number";
134
134
  }
135
- function Pe(e) {
135
+ function Ee(e) {
136
136
  return e ? /[a-zA-Z0-9]/.test(String(e)) : !0;
137
137
  }
138
- function Ee(e, t = {}) {
138
+ function Oe(e, t = {}) {
139
139
  const { messages: n = {} } = t;
140
- return Pe(e) ? !0 : Ce(n);
140
+ return Ee(e) ? !0 : Pe(n);
141
141
  }
142
- function Oe(e) {
142
+ function Be(e) {
143
143
  const t = e.containsAlphaSpaces;
144
144
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one letter or space";
145
145
  }
146
- function Be(e) {
146
+ function Re(e) {
147
147
  return e ? /[a-zA-Z\s]/.test(String(e)) : !0;
148
148
  }
149
- function Re(e, t = {}) {
149
+ function We(e, t = {}) {
150
150
  const { messages: n = {} } = t;
151
- return Be(e) ? !0 : Oe(n);
151
+ return Re(e) ? !0 : Be(n);
152
152
  }
153
- function We(e) {
153
+ function Le(e) {
154
154
  const t = e.containsLowercase;
155
155
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one lowercase letter";
156
156
  }
157
- function Le(e) {
157
+ function _e(e) {
158
158
  return e ? /[a-z]/.test(String(e)) : !0;
159
159
  }
160
- function _e(e, t = {}) {
160
+ function ze(e, t = {}) {
161
161
  const { messages: n = {} } = t;
162
- return Le(e) ? !0 : We(n);
162
+ return _e(e) ? !0 : Le(n);
163
163
  }
164
- function ze(e) {
164
+ function Ie(e) {
165
165
  const t = e.containsNumeric;
166
166
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one number";
167
167
  }
168
- function Ie(e) {
168
+ function Ke(e) {
169
169
  return e ? /\d/.test(String(e)) : !0;
170
170
  }
171
- function Ke(e, t = {}) {
171
+ function Ue(e, t = {}) {
172
172
  const { messages: n = {} } = t;
173
- return Ie(e) ? !0 : ze(n);
173
+ return Ke(e) ? !0 : Ie(n);
174
174
  }
175
- function Ue(e) {
175
+ function Ze(e) {
176
176
  const t = e.containsSymbol;
177
177
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one symbol";
178
178
  }
179
- function Ze(e) {
179
+ function ke(e) {
180
180
  return e ? /[^\w\s]/.test(String(e)) : !0;
181
181
  }
182
- function ke(e, t = {}) {
182
+ function Ye(e, t = {}) {
183
183
  const { messages: n = {} } = t;
184
- return Ze(e) ? !0 : Ue(n);
184
+ return ke(e) ? !0 : Ze(n);
185
185
  }
186
- function Ye(e) {
186
+ function Ge(e) {
187
187
  const t = e.containsUppercase;
188
188
  return typeof t == "function" ? t({}) : t ?? "Must contain at least one uppercase letter";
189
189
  }
190
- function Ge(e) {
190
+ function He(e) {
191
191
  return e ? /[A-Z]/.test(String(e)) : !0;
192
192
  }
193
- function He(e, t = {}) {
193
+ function Je(e, t = {}) {
194
194
  const { messages: n = {} } = t;
195
- return Ge(e) ? !0 : Ye(n);
195
+ return He(e) ? !0 : Ge(n);
196
196
  }
197
- function Je(e, t) {
197
+ function Qe(e, t) {
198
198
  const n = e.dateAfter;
199
199
  return typeof n == "function" ? n({ date: t }) : n ?? (t ? `Must be after ${t}` : "Must be after today");
200
200
  }
201
- function Qe(e, t) {
201
+ function Xe(e, t) {
202
202
  if (!e) return !0;
203
203
  const n = new Date(String(e)), r = t ? new Date(t) : /* @__PURE__ */ new Date();
204
204
  return !isNaN(n.getTime()) && !isNaN(r.getTime()) && n > r;
205
205
  }
206
- function Xe(e, t = {}) {
206
+ function et(e, t = {}) {
207
207
  const { args: n = [], messages: r = {} } = t, [s] = n;
208
- return Qe(e, s) ? !0 : Je(r, s);
208
+ return Xe(e, s) ? !0 : Qe(r, s);
209
209
  }
210
- function et(e, t) {
210
+ function tt(e, t) {
211
211
  const n = e.dateAfterOrEqual;
212
212
  return typeof n == "function" ? n({ date: t }) : n ?? (t ? `Must be after or equal to ${t}` : "Must be after or equal to today");
213
213
  }
214
- function tt(e, t) {
214
+ function nt(e, t) {
215
215
  if (!e) return !0;
216
216
  const n = new Date(String(e)), r = t ? new Date(t) : /* @__PURE__ */ new Date();
217
217
  return !isNaN(n.getTime()) && !isNaN(r.getTime()) && n >= r;
218
218
  }
219
- function nt(e, t = {}) {
219
+ function rt(e, t = {}) {
220
220
  const { args: n = [], messages: r = {} } = t, [s] = n;
221
- return tt(e, s) ? !0 : et(r, s);
221
+ return nt(e, s) ? !0 : tt(r, s);
222
222
  }
223
- function rt(e, t) {
223
+ function st(e, t) {
224
224
  const n = e.dateBefore;
225
225
  return typeof n == "function" ? n({ date: t }) : n ?? (t ? `Must be before ${t}` : "Must be before today");
226
226
  }
227
- function st(e, t) {
227
+ function ot(e, t) {
228
228
  if (!e) return !0;
229
229
  const n = new Date(String(e)), r = t ? new Date(t) : /* @__PURE__ */ new Date();
230
230
  return !isNaN(n.getTime()) && !isNaN(r.getTime()) && n < r;
231
231
  }
232
- function ot(e, t = {}) {
232
+ function at(e, t = {}) {
233
233
  const { args: n = [], messages: r = {} } = t, [s] = n;
234
- return st(e, s) ? !0 : rt(r, s);
234
+ return ot(e, s) ? !0 : st(r, s);
235
235
  }
236
- function at(e, t) {
236
+ function ut(e, t) {
237
237
  const n = e.dateBeforeOrEqual;
238
238
  return typeof n == "function" ? n({ date: t }) : n ?? (t ? `Must be before or equal to ${t}` : "Must be before or equal to today");
239
239
  }
240
- function ut(e, t) {
240
+ function it(e, t) {
241
241
  if (!e) return !0;
242
242
  const n = new Date(String(e)), r = t ? new Date(t) : /* @__PURE__ */ new Date();
243
243
  return !isNaN(n.getTime()) && !isNaN(r.getTime()) && n <= r;
244
244
  }
245
- function it(e, t = {}) {
245
+ function ct(e, t = {}) {
246
246
  const { args: n = [], messages: r = {} } = t, [s] = n;
247
- return ut(e, s) ? !0 : at(r, s);
247
+ return it(e, s) ? !0 : ut(r, s);
248
248
  }
249
- function ct(e, t, n) {
249
+ function lt(e, t, n) {
250
250
  const r = e.dateBetween;
251
251
  return typeof r == "function" ? r({ startDate: t, endDate: n }) : r ?? `Must be between ${t} and ${n}`;
252
252
  }
253
- function lt(e, t, n) {
253
+ function ft(e, t, n) {
254
254
  if (!e) return !0;
255
255
  const r = new Date(String(e)), s = new Date(t), o = new Date(n);
256
256
  return !isNaN(r.getTime()) && !isNaN(s.getTime()) && !isNaN(o.getTime()) && r >= s && r <= o;
257
257
  }
258
- function ft(e, t = {}) {
258
+ function mt(e, t = {}) {
259
259
  const { args: n = [], messages: r = {} } = t, [s, o] = n;
260
- return lt(e, s, o) ? !0 : ct(r, s, o);
260
+ return ft(e, s, o) ? !0 : lt(r, s, o);
261
261
  }
262
- const mt = (e) => {
262
+ const dt = (e) => {
263
263
  const t = e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), n = {
264
264
  YYYY: "\\d{4}",
265
265
  YY: "\\d{2}",
@@ -273,57 +273,57 @@ const mt = (e) => {
273
273
  r = r.replace(new RegExp(s, "g"), n[s]);
274
274
  }), new RegExp(`^${r}$`);
275
275
  };
276
- function dt(e, t) {
276
+ function gt(e, t) {
277
277
  const n = e.dateFormat;
278
278
  return typeof n == "function" ? n({ format: t }) : n ?? `Must match the format ${t}`;
279
279
  }
280
- function gt(e, t) {
281
- return e ? t && typeof t == "string" ? mt(t).test(String(e)) : !isNaN(Date.parse(String(e))) : !0;
280
+ function pt(e, t) {
281
+ return e ? t && typeof t == "string" ? dt(t).test(String(e)) : !isNaN(Date.parse(String(e))) : !0;
282
282
  }
283
- function pt(e, t = {}) {
283
+ function bt(e, t = {}) {
284
284
  const { args: n = [], messages: r = {} } = t, [s] = n;
285
- return gt(e, s) ? !0 : dt(r, s);
285
+ return pt(e, s) ? !0 : gt(r, s);
286
286
  }
287
- function bt(e) {
287
+ function yt(e) {
288
288
  const t = e.email;
289
289
  return typeof t == "function" ? t({}) : t ?? "Please enter a valid email address";
290
290
  }
291
- function yt(e) {
291
+ function $t(e) {
292
292
  return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e)) : !0;
293
293
  }
294
- function $t(e, t = {}) {
294
+ function ht(e, t = {}) {
295
295
  const { messages: n = {} } = t;
296
- return yt(e) ? !0 : bt(n);
296
+ return $t(e) ? !0 : yt(n);
297
297
  }
298
- function ht(e, t) {
298
+ function vt(e, t) {
299
299
  const n = e.endsWith;
300
300
  return typeof n == "function" ? n({ suffix: t.length === 1 ? t[0] : t }) : n ?? `Must end with: ${t.join(", ")}`;
301
301
  }
302
- function vt(e, ...t) {
302
+ function Mt(e, ...t) {
303
303
  if (!e) return !0;
304
304
  const n = String(e);
305
305
  return t.some((r) => n.endsWith(r));
306
306
  }
307
- function Mt(e, t = {}) {
307
+ function Nt(e, t = {}) {
308
308
  const { args: n = [], messages: r = {} } = t;
309
- return vt(e, ...n) ? !0 : ht(r, n);
309
+ return Mt(e, ...n) ? !0 : vt(r, n);
310
310
  }
311
- function Nt(e, t) {
311
+ function wt(e, t) {
312
312
  const n = e.is;
313
313
  return typeof n == "function" ? n({ allowedValues: t }) : n ?? `Must be one of: ${t.join(", ")}`;
314
314
  }
315
- function wt(e, ...t) {
315
+ function At(e, ...t) {
316
316
  return !e && e !== 0 && e !== !1 ? !0 : t.includes(String(e));
317
317
  }
318
- function At(e, t = {}) {
318
+ function Dt(e, t = {}) {
319
319
  const { args: n = [], messages: r = {} } = t;
320
- return wt(e, ...n) ? !0 : Nt(r, n);
320
+ return At(e, ...n) ? !0 : wt(r, n);
321
321
  }
322
- function Dt(e, t, n) {
322
+ function St(e, t, n) {
323
323
  const r = e.length;
324
324
  return n !== void 0 ? typeof r == "function" ? r({ min: t, max: n }) : r ?? `Must be between ${t} and ${n} characters` : typeof r == "function" ? r({ value: t }) : r ?? `Must be exactly ${t} characters`;
325
325
  }
326
- function St(e, t, n) {
326
+ function Ft(e, t, n) {
327
327
  if (!e && e !== 0) return !0;
328
328
  let r = 0;
329
329
  if (typeof e == "string")
@@ -341,26 +341,26 @@ function St(e, t, n) {
341
341
  const s = Number(t);
342
342
  return !isNaN(s) && r === s;
343
343
  }
344
- function Ft(e, t = {}) {
344
+ function xt(e, t = {}) {
345
345
  const { args: n = [], messages: r = {} } = t, [s, o] = n;
346
- return St(e, s, o) ? !0 : Dt(r, s, o);
346
+ return Ft(e, s, o) ? !0 : St(r, s, o);
347
347
  }
348
- function xt(e) {
348
+ function jt(e) {
349
349
  const t = e.lowercase;
350
350
  return typeof t == "function" ? t({}) : t ?? "Must contain only lowercase characters";
351
351
  }
352
- function jt(e) {
352
+ function Tt(e) {
353
353
  return e ? /^[a-z]+$/.test(String(e)) : !0;
354
354
  }
355
- function Tt(e, t = {}) {
355
+ function Vt(e, t = {}) {
356
356
  const { messages: n = {} } = t;
357
- return jt(e) ? !0 : xt(n);
357
+ return Tt(e) ? !0 : jt(n);
358
358
  }
359
- function Vt(e, t, n) {
359
+ function qt(e, t, n) {
360
360
  const r = t.matches;
361
361
  return typeof r == "function" ? r({ value: e, pattern: n }) : r ?? "Format is not valid";
362
362
  }
363
- function qt(e, t) {
363
+ function Ct(e, t) {
364
364
  if (!e) return !0;
365
365
  if (!t) return !1;
366
366
  try {
@@ -373,15 +373,15 @@ function qt(e, t) {
373
373
  return !1;
374
374
  }
375
375
  }
376
- function Ct(e, t = {}) {
376
+ function Pt(e, t = {}) {
377
377
  const { args: n = [], messages: r = {} } = t, [s] = n;
378
- return qt(e, s) ? !0 : Vt(e, r, s);
378
+ return Ct(e, s) ? !0 : qt(e, r, s);
379
379
  }
380
- function Pt(e, t) {
380
+ function Et(e, t) {
381
381
  const n = e.max;
382
382
  return typeof n == "function" ? n({ value: t }) : n ?? `Must be at most ${t}`;
383
383
  }
384
- function Et(e, t) {
384
+ function Ot(e, t) {
385
385
  if (!e && e !== 0) return !0;
386
386
  const n = Number(t);
387
387
  if (isNaN(n)) return !1;
@@ -392,15 +392,15 @@ function Et(e, t) {
392
392
  }
393
393
  return Array.isArray(e) ? e.length <= n : !1;
394
394
  }
395
- function Ot(e, t = {}) {
395
+ function Bt(e, t = {}) {
396
396
  const { args: n = [], messages: r = {} } = t, [s] = n;
397
- return Et(e, s) ? !0 : Pt(r, s);
397
+ return Ot(e, s) ? !0 : Et(r, s);
398
398
  }
399
- function Bt(e, t) {
399
+ function Rt(e, t) {
400
400
  const n = e.min;
401
401
  return typeof n == "function" ? n({ value: t }) : n ?? `Must be at least ${t}`;
402
402
  }
403
- function Rt(e, t) {
403
+ function Wt(e, t) {
404
404
  if (!e && e !== 0) return !0;
405
405
  const n = Number(t);
406
406
  if (isNaN(n)) return !1;
@@ -411,86 +411,86 @@ function Rt(e, t) {
411
411
  }
412
412
  return Array.isArray(e) ? e.length >= n : !1;
413
413
  }
414
- function Wt(e, t = {}) {
414
+ function Lt(e, t = {}) {
415
415
  const { args: n = [], messages: r = {} } = t, [s] = n;
416
- return Rt(e, s) ? !0 : Bt(r, s);
416
+ return Wt(e, s) ? !0 : Rt(r, s);
417
417
  }
418
- function Lt(e, t) {
418
+ function _t(e, t) {
419
419
  const n = e.not;
420
420
  return typeof n == "function" ? n({ disallowedValues: t }) : n ?? `Must not be one of: ${t.join(", ")}`;
421
421
  }
422
- function _t(e, ...t) {
422
+ function zt(e, ...t) {
423
423
  return !e && e !== 0 && e !== !1 ? !0 : !t.includes(String(e));
424
424
  }
425
- function zt(e, t = {}) {
425
+ function It(e, t = {}) {
426
426
  const { args: n = [], messages: r = {} } = t;
427
- return _t(e, ...n) ? !0 : Lt(r, n);
427
+ return zt(e, ...n) ? !0 : _t(r, n);
428
428
  }
429
- function It(e) {
429
+ function Kt(e) {
430
430
  const t = e.number;
431
431
  return typeof t == "function" ? t({}) : t ?? "Must be a valid number";
432
432
  }
433
- function Kt(e) {
433
+ function Ut(e) {
434
434
  if (e == null || e === "") return !0;
435
435
  if (Number.isNaN(e)) return !1;
436
436
  const t = Number(e);
437
437
  return !isNaN(t) && isFinite(t);
438
438
  }
439
- function Ut(e, t = {}) {
439
+ function Zt(e, t = {}) {
440
440
  const { messages: n = {} } = t;
441
- return Kt(e) ? !0 : It(n);
441
+ return Ut(e) ? !0 : Kt(n);
442
442
  }
443
- function Zt(e) {
443
+ function kt(e) {
444
444
  const t = e.required;
445
445
  return typeof t == "function" ? t({}) : t ?? "This field is required";
446
446
  }
447
- function kt(e) {
447
+ function Yt(e) {
448
448
  return e == null || e === "" ? !1 : typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : typeof e == "object" ? Object.keys(e).length > 0 : e === 0 ? !0 : !!e;
449
449
  }
450
- function Yt(e, t = {}) {
450
+ function Gt(e, t = {}) {
451
451
  const { messages: n = {} } = t;
452
- return kt(e) ? !0 : Zt(n);
452
+ return Yt(e) ? !0 : kt(n);
453
453
  }
454
- function Gt(e, t) {
454
+ function Ht(e, t) {
455
455
  const n = e.startsWith;
456
456
  return typeof n == "function" ? n({ prefix: t.length === 1 ? t[0] : t }) : n ?? `Must start with: ${t.join(", ")}`;
457
457
  }
458
- function Ht(e, ...t) {
458
+ function Jt(e, ...t) {
459
459
  if (!e) return !0;
460
460
  const n = String(e);
461
461
  return t.some((r) => n.startsWith(r));
462
462
  }
463
- function Jt(e, t = {}) {
463
+ function Qt(e, t = {}) {
464
464
  const { args: n = [], messages: r = {} } = t;
465
- return Ht(e, ...n) ? !0 : Gt(r, n);
465
+ return Jt(e, ...n) ? !0 : Ht(r, n);
466
466
  }
467
- function Qt(e) {
467
+ function Xt(e) {
468
468
  const t = e.symbol;
469
469
  return typeof t == "function" ? t({}) : t ?? "Must contain only symbols";
470
470
  }
471
- function Xt(e) {
471
+ function en(e) {
472
472
  return e ? /^[^\w\s]+$/.test(String(e)) : !0;
473
473
  }
474
- function en(e, t = {}) {
474
+ function tn(e, t = {}) {
475
475
  const { messages: n = {} } = t;
476
- return Xt(e) ? !0 : Qt(n);
476
+ return en(e) ? !0 : Xt(n);
477
477
  }
478
- function tn(e) {
478
+ function nn(e) {
479
479
  const t = e.uppercase;
480
480
  return typeof t == "function" ? t({}) : t ?? "Must contain only uppercase characters";
481
481
  }
482
- function nn(e) {
482
+ function rn(e) {
483
483
  return e ? /^[A-Z]+$/.test(String(e)) : !0;
484
484
  }
485
- function rn(e, t = {}) {
485
+ function sn(e, t = {}) {
486
486
  const { messages: n = {} } = t;
487
- return nn(e) ? !0 : tn(n);
487
+ return rn(e) ? !0 : nn(n);
488
488
  }
489
- function sn(e) {
489
+ function on(e) {
490
490
  const t = e.url;
491
491
  return typeof t == "function" ? t({}) : t ?? "Must be a valid URL";
492
492
  }
493
- function on(e) {
493
+ function an(e) {
494
494
  if (!e) return !0;
495
495
  try {
496
496
  const t = new URL(String(e));
@@ -499,50 +499,50 @@ function on(e) {
499
499
  return !1;
500
500
  }
501
501
  }
502
- function an(e, t = {}) {
502
+ function un(e, t = {}) {
503
503
  const { messages: n = {} } = t;
504
- return on(e) ? !0 : sn(n);
504
+ return an(e) ? !0 : on(n);
505
505
  }
506
- const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
+ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
507
  __proto__: null,
508
- accepted: ge,
509
- alpha: ye,
510
- alphaSpaces: we,
511
- alphanumeric: ve,
512
- between: Se,
513
- confirm: je,
514
- containsAlpha: qe,
515
- containsAlphaSpaces: Re,
516
- containsAlphanumeric: Ee,
517
- containsLowercase: _e,
518
- containsNumeric: Ke,
519
- containsSymbol: ke,
520
- containsUppercase: He,
521
- dateAfter: Xe,
522
- dateAfterOrEqual: nt,
523
- dateBefore: ot,
524
- dateBeforeOrEqual: it,
525
- dateBetween: ft,
526
- dateFormat: pt,
527
- email: $t,
528
- endsWith: Mt,
529
- is: At,
530
- length: Ft,
531
- lowercase: Tt,
532
- matches: Ct,
533
- max: Ot,
534
- min: Wt,
535
- not: zt,
536
- number: Ut,
537
- required: Yt,
538
- startsWith: Jt,
539
- symbol: en,
540
- uppercase: rn,
541
- url: an
542
- }, Symbol.toStringTag, { value: "Module" })), An = {
508
+ accepted: pe,
509
+ alpha: $e,
510
+ alphaSpaces: Ae,
511
+ alphanumeric: Me,
512
+ between: Fe,
513
+ confirm: Te,
514
+ containsAlpha: Ce,
515
+ containsAlphaSpaces: We,
516
+ containsAlphanumeric: Oe,
517
+ containsLowercase: ze,
518
+ containsNumeric: Ue,
519
+ containsSymbol: Ye,
520
+ containsUppercase: Je,
521
+ dateAfter: et,
522
+ dateAfterOrEqual: rt,
523
+ dateBefore: at,
524
+ dateBeforeOrEqual: ct,
525
+ dateBetween: mt,
526
+ dateFormat: bt,
527
+ email: ht,
528
+ endsWith: Nt,
529
+ is: Dt,
530
+ length: xt,
531
+ lowercase: Vt,
532
+ matches: Pt,
533
+ max: Bt,
534
+ min: Lt,
535
+ not: It,
536
+ number: Zt,
537
+ required: Gt,
538
+ startsWith: Qt,
539
+ symbol: tn,
540
+ uppercase: sn,
541
+ url: un
542
+ }, Symbol.toStringTag, { value: "Module" })), Dn = {
543
543
  install(e, t = {}) {
544
- P(un), t.rules && P(t.rules);
545
- const n = te(t.locale) ? t.locale : h(t.locale ?? "en"), r = { en: ce };
544
+ P(cn), t.rules && P(t.rules);
545
+ const n = ne(t.locale) ? t.locale : h(t.locale ?? "en"), r = { en: le };
546
546
  t.locales && Object.keys(t.locales).forEach((o) => {
547
547
  r[o] = { ...r[o] ?? {}, ...t.locales[o] };
548
548
  });
@@ -555,37 +555,37 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
555
555
  }
556
556
  });
557
557
  }
558
- }, H = Symbol("form-state-context"), cn = (e) => {
559
- x(H, e);
560
- }, ln = (e = null) => {
558
+ }, H = Symbol("form-state-context"), ln = (e) => {
559
+ j(H, e);
560
+ }, fn = (e = null) => {
561
561
  const t = A(H, e);
562
562
  if (!t && t !== null)
563
563
  throw new Error("Context with formStateContextKey not found");
564
564
  return t;
565
- }, J = Symbol("form-context"), fn = (e) => {
566
- x(J, e);
567
- }, Dn = (e = null) => {
565
+ }, J = Symbol("form-context"), mn = (e) => {
566
+ j(J, e);
567
+ }, Sn = (e = null) => {
568
568
  const t = A(J, e);
569
569
  if (!t && t !== null)
570
570
  throw new Error("Context with formContextKey not found");
571
571
  return t;
572
572
  };
573
- function mn(e, t) {
573
+ function dn(e, t) {
574
574
  if (!(!e || !t))
575
575
  return t.split(".").reduce((n, r) => n == null ? void 0 : n[r], e);
576
576
  }
577
- function dn(e, t, n) {
577
+ function gn(e, t, n) {
578
578
  if (!e || !t) return e;
579
- const r = t.split("."), s = r.pop(), o = r.reduce((a, m, i) => {
580
- if (a[m] === null || a[m] === void 0) {
579
+ const r = t.split("."), s = r.pop(), o = r.reduce((a, d, i) => {
580
+ if (a[d] === null || a[d] === void 0) {
581
581
  const y = r[i + 1] || s;
582
- a[m] = /^\d+$/.test(y) ? [] : {};
582
+ a[d] = /^\d+$/.test(y) ? [] : {};
583
583
  }
584
- return a[m];
584
+ return a[d];
585
585
  }, e);
586
586
  return o[s] = n, e;
587
587
  }
588
- const Sn = /* @__PURE__ */ R({
588
+ const Fn = /* @__PURE__ */ R({
589
589
  __name: "Form",
590
590
  props: {
591
591
  modelValue: {
@@ -596,75 +596,75 @@ const Sn = /* @__PURE__ */ R({
596
596
  emits: /* @__PURE__ */ U(["submit"], ["update:modelValue"]),
597
597
  setup(e, { emit: t }) {
598
598
  const n = t, r = W(e, "modelValue");
599
- ne(r.value) || (r.value = re(r.value ?? {}));
600
- const s = h({}), o = h([]), a = b(() => r.value), m = b(() => o.value[0] ?? null), i = b(
599
+ re(r.value) || (r.value = se(r.value ?? {}));
600
+ const s = h({}), o = h([]), a = b(() => r.value), d = b(() => o.value[0] ?? null), i = b(
601
601
  () => Object.keys(s.value).every((u) => s.value[u].isValid)
602
602
  ), y = () => {
603
603
  Object.keys(s.value).forEach((u) => {
604
- var g, d;
605
- (d = (g = s.value[u]).validate) == null || d.call(g);
604
+ var p, g;
605
+ (g = (p = s.value[u]).validate) == null || g.call(p);
606
606
  });
607
- }, c = () => {
608
- y(), i.value && (o.value = [], n("submit", r.value, { setErrors: l, reset: f }));
609
- }, l = (...u) => {
610
- var g;
607
+ }, l = () => {
608
+ y(), i.value && (o.value = [], n("submit", r.value, { setErrors: f, reset: c }));
609
+ }, f = (...u) => {
610
+ var p;
611
611
  if (u.length === 1) {
612
- const d = u[0];
613
- if (typeof d == "object" && !Array.isArray(d) && d !== null) {
614
- Object.keys(d).forEach((v) => {
615
- l(v, d[v]);
612
+ const g = u[0];
613
+ if (typeof g == "object" && !Array.isArray(g) && g !== null) {
614
+ Object.keys(g).forEach((v) => {
615
+ f(v, g[v]);
616
616
  });
617
617
  return;
618
618
  }
619
- o.value = Array.isArray(d) ? d : [d];
619
+ o.value = Array.isArray(g) ? g : [g];
620
620
  } else if (u.length === 2) {
621
- const [d, v] = u;
622
- (g = s.value[d]) == null || g.setErrors(v);
621
+ const [g, v] = u;
622
+ (p = s.value[g]) == null || p.setErrors(v);
623
623
  }
624
- }, f = () => {
624
+ }, c = () => {
625
625
  o.value = [], Object.keys(s.value).forEach((u) => {
626
626
  s.value[u].reset();
627
627
  });
628
628
  };
629
- return cn({
629
+ return ln({
630
630
  getFields() {
631
631
  return s.value;
632
632
  },
633
633
  getField(u) {
634
634
  return s.value[u];
635
635
  },
636
- addField(u, g) {
637
- s.value[u] = g;
636
+ addField(u, p) {
637
+ s.value[u] = p;
638
638
  },
639
639
  removeField(u) {
640
640
  delete s.value[u];
641
641
  },
642
- setFieldValue(u, g) {
643
- dn(r.value, u, g);
642
+ setFieldValue(u, p) {
643
+ gn(r.value, u, p);
644
644
  },
645
645
  getFieldValue(u) {
646
- return mn(r.value, u);
646
+ return dn(r.value, u);
647
647
  }
648
- }), fn({
648
+ }), mn({
649
649
  values: a,
650
650
  isValid: i,
651
- error: m,
651
+ error: d,
652
652
  errors: o,
653
653
  fields: s,
654
- reset: f,
655
- setErrors: l,
654
+ reset: c,
655
+ setErrors: f,
656
656
  validate: y
657
- }), (u, g) => (L(), _("form", {
658
- onSubmit: se(c, ["prevent"])
657
+ }), (u, p) => (L(), _("form", {
658
+ onSubmit: oe(l, ["prevent"])
659
659
  }, [
660
660
  z(u.$slots, "default", I(K({
661
661
  isValid: i.value,
662
- error: m.value,
662
+ error: d.value,
663
663
  errors: o.value,
664
664
  values: a.value,
665
665
  fields: s.value,
666
- reset: f,
667
- setErrors: l,
666
+ reset: c,
667
+ setErrors: f,
668
668
  validate: y
669
669
  })))
670
670
  ], 32));
@@ -685,26 +685,26 @@ function Q(e) {
685
685
  }
686
686
  return n;
687
687
  }
688
- const gn = (e, t, n = {}, r = {}) => {
688
+ const pn = (e, t, n = {}, r = {}) => {
689
689
  if (!t) return !0;
690
690
  const s = Q(t), o = [];
691
- for (const [a, m] of Object.entries(s)) {
692
- const i = fe(a);
691
+ for (const [a, d] of Object.entries(s)) {
692
+ const i = me(a);
693
693
  if (i) {
694
- const c = { args: m === !0 ? [] : Array.isArray(m) ? m : [m], messages: n, fields: r }, l = i(e, c);
695
- l !== !0 && o.push(l ?? "Invalid value");
694
+ const l = { args: d === !0 ? [] : Array.isArray(d) ? d : [d], messages: n, fields: r }, f = i(e, l);
695
+ f !== !0 && o.push(f ?? "Invalid value");
696
696
  } else
697
697
  console.warn(`[Forms] Validation rule "${a}" not found.`);
698
698
  }
699
699
  return o.length === 0 ? !0 : o;
700
- }, pn = (e, t) => {
700
+ }, bn = (e, t) => {
701
701
  const n = t(e);
702
702
  return n === !0 ? !0 : typeof n == "string" ? [n] : Array.isArray(n) ? n : !!n ? !0 : ["Invalid value"];
703
703
  };
704
704
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
705
705
  const E = () => {
706
706
  };
707
- function bn(e, t) {
707
+ function yn(e, t) {
708
708
  function n(...r) {
709
709
  return new Promise((s, o) => {
710
710
  Promise.resolve(e(() => t.apply(this, r), {
@@ -716,51 +716,51 @@ function bn(e, t) {
716
716
  }
717
717
  return n;
718
718
  }
719
- const yn = (e) => e();
720
- function $n(e, t = {}) {
719
+ const $n = (e) => e();
720
+ function hn(e, t = {}) {
721
721
  let n, r, s = E;
722
722
  const o = (i) => {
723
723
  clearTimeout(i), s(), s = E;
724
724
  };
725
725
  let a;
726
726
  return (i) => {
727
- const y = $(e), c = $(t.maxWait);
728
- return n && o(n), y <= 0 || c !== void 0 && c <= 0 ? (r && (o(r), r = void 0), Promise.resolve(i())) : new Promise((l, f) => {
729
- s = t.rejectOnCancel ? f : l, a = i, c && !r && (r = setTimeout(() => {
730
- n && o(n), r = void 0, l(a());
731
- }, c)), n = setTimeout(() => {
732
- r && o(r), r = void 0, l(i());
727
+ const y = $(e), l = $(t.maxWait);
728
+ return n && o(n), y <= 0 || l !== void 0 && l <= 0 ? (r && (o(r), r = void 0), Promise.resolve(i())) : new Promise((f, c) => {
729
+ s = t.rejectOnCancel ? c : f, a = i, l && !r && (r = setTimeout(() => {
730
+ n && o(n), r = void 0, f(a());
731
+ }, l)), n = setTimeout(() => {
732
+ r && o(r), r = void 0, f(i());
733
733
  }, y);
734
734
  });
735
735
  };
736
736
  }
737
- function hn(e, t, n = {}) {
738
- const { eventFilter: r = yn, ...s } = n;
739
- return Z(e, bn(r, t), s);
737
+ function vn(e, t, n = {}) {
738
+ const { eventFilter: r = $n, ...s } = n;
739
+ return Z(e, yn(r, t), s);
740
740
  }
741
741
  function O(e, t, n = {}) {
742
742
  const { debounce: r = 0, maxWait: s = void 0, ...o } = n;
743
- return hn(e, t, {
743
+ return vn(e, t, {
744
744
  ...o,
745
- eventFilter: $n(r, { maxWait: s })
745
+ eventFilter: hn(r, { maxWait: s })
746
746
  });
747
747
  }
748
- function vn(e, t = {}) {
749
- const n = h(!0), r = h(!1), s = h([]), o = h(null), a = b(() => $(t.rules) ?? null), m = b(() => $(t.messages) ?? {}), i = b(() => $(t.fields) ?? {}), y = b(() => {
748
+ function Mn(e, t = {}) {
749
+ const n = h(!0), r = h(!1), s = h([]), o = h(null), a = b(() => $(t.rules) ?? null), d = b(() => $(t.messages) ?? {}), i = b(() => $(t.fields) ?? {}), y = b(() => {
750
750
  if (!a.value || typeof a.value != "string") return null;
751
751
  const u = Q(a.value).confirm;
752
752
  if (!u || u === !0) return null;
753
- const g = i.value[u];
754
- return (g == null ? void 0 : g.value) ?? null;
755
- }), c = () => {
756
- let f;
757
- return typeof a.value == "function" ? f = pn($(e), a.value) : f = gn(
753
+ const p = i.value[u];
754
+ return (p == null ? void 0 : p.value) ?? null;
755
+ }), l = () => {
756
+ let c;
757
+ return typeof a.value == "function" ? c = bn($(e), a.value) : c = pn(
758
758
  $(e),
759
759
  a.value,
760
- m.value,
760
+ d.value,
761
761
  i.value
762
- ), f === !0 ? (n.value = !0, s.value = [], !0) : Array.isArray(f) ? (n.value = !1, s.value = f, !1) : f;
763
- }, l = () => {
762
+ ), c === !0 ? (n.value = !0, s.value = [], !0) : Array.isArray(c) ? (n.value = !1, s.value = c, !1) : c;
763
+ }, f = () => {
764
764
  o.value && clearTimeout(o.value), r.value = !0, n.value = !0, s.value = [], o.value = setTimeout(() => {
765
765
  r.value = !1, o.value = null;
766
766
  }, 1e3);
@@ -768,30 +768,30 @@ function vn(e, t = {}) {
768
768
  return O(
769
769
  () => $(e),
770
770
  () => {
771
- r.value || c();
771
+ r.value || l();
772
772
  },
773
773
  { debounce: 300 }
774
774
  ), O(
775
775
  () => $(y),
776
776
  () => {
777
- r.value || $(e) && c();
777
+ r.value || $(e) && l();
778
778
  },
779
779
  { debounce: 300 }
780
780
  ), {
781
- validate: c,
782
- reset: l,
781
+ validate: l,
782
+ reset: f,
783
783
  isValid: w(n),
784
784
  errors: w(s)
785
785
  };
786
786
  }
787
- const X = Symbol("field-context"), Mn = (e) => {
788
- x(X, e);
789
- }, Fn = (e = null) => {
787
+ const X = Symbol("field-context"), Nn = (e) => {
788
+ j(X, e);
789
+ }, xn = (e = null) => {
790
790
  const t = A(X, e);
791
791
  if (!t && t !== null)
792
792
  throw new Error("Context with fieldContextKey not found");
793
793
  return t;
794
- }, xn = /* @__PURE__ */ R({
794
+ }, jn = /* @__PURE__ */ R({
795
795
  __name: "Field",
796
796
  props: /* @__PURE__ */ U({
797
797
  id: {},
@@ -805,27 +805,29 @@ const X = Symbol("field-context"), Mn = (e) => {
805
805
  }),
806
806
  emits: ["update:modelValue"],
807
807
  setup(e) {
808
- const t = e, n = W(e, "modelValue"), r = oe(), s = ln(), o = Y(), a = b({
808
+ const t = e, n = W(e, "modelValue"), r = ae(), s = fn(), o = Y(), a = b({
809
809
  get: () => s ? s.getFieldValue(t.name) : n.value,
810
- set: (p) => {
811
- s ? s.setFieldValue(t.name, p) : n.value = p;
810
+ set: (m) => {
811
+ s ? s.setFieldValue(t.name, m) : n.value = m;
812
812
  }
813
- }), m = b(() => t.validation ?? null), i = b(() => ({
813
+ }), d = b(() => t.validation ?? null), i = b(() => ({
814
814
  ...o ? o.locales.value[o.locale.value] : {},
815
815
  ...t.validationMessages ?? {}
816
816
  })), y = b({
817
817
  get: () => s ? s.getFields() : {},
818
818
  set: () => {
819
819
  }
820
- }), c = vn(a, { rules: m, messages: i, fields: y }), l = h(!1), f = h(!1), u = h([]), g = b(() => a.value ?? null), d = b(() => c.isValid.value && u.value.length === 0), v = b(() => [...c.errors.value, ...u.value]), M = b(() => v.value[0] ?? null), j = $(a), N = t.id ?? r, D = `${N}-error`, S = `${N}-help`, ee = (p) => {
821
- u.value = Array.isArray(p) ? p : [p];
822
- }, F = () => {
823
- a.value = j, l.value = !1, f.value = !1, u.value = [], c.reset();
820
+ }), l = Mn(a, { rules: d, messages: i, fields: y }), f = h(!1), c = h(!1), u = h([]), p = b(() => a.value ?? null), g = b(() => l.isValid.value && u.value.length === 0), v = b(() => [...l.errors.value, ...u.value]), M = b(() => v.value[0] ?? null), D = $(a), N = t.id ?? r, S = `${N}-error`, F = `${N}-help`, ee = (m) => {
821
+ u.value = Array.isArray(m) ? m : [m];
822
+ }, te = (m) => {
823
+ a.value = m, !c.value && m !== D && (c.value = !0);
824
+ }, x = () => {
825
+ a.value = D, f.value = !1, c.value = !1, u.value = [], l.reset();
824
826
  };
825
827
  Z(
826
828
  () => t.error,
827
- (p) => {
828
- p ? u.value = Array.isArray(p) ? p : [p] : u.value = [];
829
+ (m) => {
830
+ m ? u.value = Array.isArray(m) ? m : [m] : u.value = [];
829
831
  },
830
832
  { immediate: !0 }
831
833
  );
@@ -834,61 +836,62 @@ const X = Symbol("field-context"), Mn = (e) => {
834
836
  name: t.name,
835
837
  modelValue: a.value,
836
838
  "aria-invalid": !!M.value,
837
- "aria-describedby": M.value ? `${D} ${S}` : S,
838
- "aria-errormessage": M.value ? D : void 0,
839
- "onUpdate:modelValue": (p) => {
840
- a.value = p, !f.value && p !== j && (f.value = !0);
839
+ "aria-describedby": M.value ? `${S} ${F}` : F,
840
+ "aria-errormessage": M.value ? S : void 0,
841
+ "onUpdate:modelValue": (m) => {
842
+ a.value = m, !c.value && m !== D && (c.value = !0);
841
843
  },
842
844
  onBlur: () => {
843
- l.value || (l.value = !0, c.validate());
845
+ f.value || (f.value = !0, l.validate());
844
846
  }
845
- })), V = { for: N }, q = { id: D, role: "alert", "aria-live": "polite" }, C = { id: S };
846
- return ae(() => {
847
+ })), V = { for: N }, q = { id: S, role: "alert", "aria-live": "polite" }, C = { id: F };
848
+ return ue(() => {
847
849
  s && s.addField(t.name, {
848
- value: g,
849
- isValid: d,
850
- isTouched: l,
851
- isDirty: f,
850
+ value: p,
851
+ isValid: g,
852
+ isTouched: f,
853
+ isDirty: c,
852
854
  error: M,
853
855
  errors: v,
854
856
  setErrors: ee,
855
- reset: F,
856
- validate: c.validate
857
+ reset: x,
858
+ validate: l.validate
857
859
  });
858
- }), ue(() => {
860
+ }), ie(() => {
859
861
  s && s.removeField(t.name);
860
- }), Mn({
862
+ }), Nn({
861
863
  inputValue: a,
862
864
  inputProps: T,
863
865
  labelProps: V,
864
866
  helpProps: C,
865
867
  errorProps: q,
866
- isValid: d,
867
- isTouched: l,
868
- isDirty: f,
868
+ isValid: g,
869
+ isTouched: f,
870
+ isDirty: c,
869
871
  error: M,
870
872
  errors: v,
871
- validate: c.validate,
872
- reset: F
873
- }), (p, Nn) => (L(), _("div", null, [
874
- z(p.$slots, "default", I(K({
873
+ validate: l.validate,
874
+ reset: x
875
+ }), (m, wn) => (L(), _("div", null, [
876
+ z(m.$slots, "default", I(K({
875
877
  inputValue: a.value,
876
878
  inputProps: T.value,
877
879
  labelProps: V,
878
880
  helpProps: C,
879
881
  errorProps: q,
880
- isValid: d.value,
881
- isTouched: l.value,
882
- isDirty: f.value,
882
+ isValid: g.value,
883
+ isTouched: f.value,
884
+ isDirty: c.value,
883
885
  error: M.value,
884
886
  errors: v.value,
885
- validate: ie(c).validate,
886
- reset: F
887
+ setValue: te,
888
+ validate: ce(l).validate,
889
+ reset: x
887
890
  })))
888
891
  ]));
889
892
  }
890
893
  });
891
- function jn() {
894
+ function Tn() {
892
895
  const e = Y();
893
896
  if (!e)
894
897
  throw new Error(
@@ -900,7 +903,7 @@ function jn() {
900
903
  setLocale: e.setLocale
901
904
  };
902
905
  }
903
- const Tn = {
906
+ const Vn = {
904
907
  required: "Este campo es obligatorio",
905
908
  email: "Por favor ingresa un email válido",
906
909
  min: ({ value: e }) => `Debe ser al menos ${e}`,
@@ -937,12 +940,12 @@ const Tn = {
937
940
  url: "Debe ser una URL válida"
938
941
  };
939
942
  export {
940
- xn as Field,
941
- Sn as Form,
942
- An as FormsPlugin,
943
- ce as en,
944
- Tn as es,
945
- Fn as useFieldContext,
946
- Dn as useFormContext,
947
- jn as useLocale
943
+ jn as Field,
944
+ Fn as Form,
945
+ Dn as FormsPlugin,
946
+ le as en,
947
+ Vn as es,
948
+ xn as useFieldContext,
949
+ Sn as useFormContext,
950
+ Tn as useLocale
948
951
  };