ep-lib-ts 0.1.11 → 0.1.14

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.
Files changed (123) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/README.md +1 -0
  3. package/package.json +7 -4
  4. package/src/components/basics/EpImg.vue +49 -26
  5. package/src/components/medias/EpLinkVersion.vue +7 -4
  6. package/src/components/medias/EpTimeLine.vue +95 -4
  7. package/src/components/signages/EpHeader.vue +3 -63
  8. package/src/components/tools/TimelineItem.vue +128 -0
  9. package/dist/BgAudio-b12a8d0d.js +0 -5
  10. package/dist/DisplayBox-7f75756f.js +0 -5
  11. package/dist/EpAlert-8bea1cc6.js +0 -5
  12. package/dist/EpAudio-15f6ad49.js +0 -5
  13. package/dist/EpBadge-3c86b448.js +0 -5
  14. package/dist/EpBarChart-8d6c96e7.js +0 -5
  15. package/dist/EpBtn-87f90799.js +0 -5
  16. package/dist/EpCard-61fc7afd.js +0 -5
  17. package/dist/EpCheckbox-fe632df9.js +0 -36
  18. package/dist/EpChip-16e2c87e.js +0 -5
  19. package/dist/EpDivider-407d1497.js +0 -5
  20. package/dist/EpEdu-f9179a45.js +0 -5
  21. package/dist/EpFlex-9e2d21f7.js +0 -5
  22. package/dist/EpHeader-1397bf98.js +0 -5
  23. package/dist/EpIcon-f4dc52bb.js +0 -5
  24. package/dist/EpIframe-2cbac751.js +0 -5
  25. package/dist/EpImg-b94ff028.js +0 -5
  26. package/dist/EpInput-b270aaaa.js +0 -1171
  27. package/dist/EpLineChart-d9a0b34b.js +0 -5
  28. package/dist/EpLink-2eab8bbf.js +0 -5
  29. package/dist/EpLinkVersion-d4c4a373.js +0 -5
  30. package/dist/EpModal-fe287280.js +0 -5
  31. package/dist/EpNothing-75cd2a42.js +0 -10
  32. package/dist/EpQuestion-56464bb7.js +0 -5
  33. package/dist/EpQuote-fd55d7eb.js +0 -5
  34. package/dist/EpRadio-05507d50.js +0 -5
  35. package/dist/EpReading-14b168eb.js +0 -5
  36. package/dist/EpResource-efee3fa3.js +0 -5
  37. package/dist/EpScope-ec8113aa.js +0 -5
  38. package/dist/EpSection-d5a8818f.js +0 -5
  39. package/dist/EpSelect-623f5cf1.js +0 -31
  40. package/dist/EpSoftware-556eab4b.js +0 -5
  41. package/dist/EpSpinner-35e73665.js +0 -5
  42. package/dist/EpSwitch-1eaf9d3f.js +0 -44
  43. package/dist/EpTable-af31a993.js +0 -5
  44. package/dist/EpTerm-9088ca28.js +0 -5
  45. package/dist/EpText-4cbda071.js +0 -5
  46. package/dist/EpTextarea-67f751e9.js +0 -41
  47. package/dist/EpToggle-9755056a.js +0 -44
  48. package/dist/EpVideo-08e65cdf.js +0 -5
  49. package/dist/EpVideoPanopto-84e6e091.js +0 -5
  50. package/dist/components/basics/EpBadge.vue.d.ts +0 -38
  51. package/dist/components/basics/EpBtn.vue.d.ts +0 -108
  52. package/dist/components/basics/EpCard.vue.d.ts +0 -95
  53. package/dist/components/basics/EpChip.vue.d.ts +0 -72
  54. package/dist/components/basics/EpDivider.vue.d.ts +0 -51
  55. package/dist/components/basics/EpFlex.vue.d.ts +0 -9
  56. package/dist/components/basics/EpIcon.vue.d.ts +0 -37
  57. package/dist/components/basics/EpImg.vue.d.ts +0 -70
  58. package/dist/components/basics/EpSection.vue.d.ts +0 -84
  59. package/dist/components/basics/EpSpinner.vue.d.ts +0 -41
  60. package/dist/components/basics/EpTable.vue.d.ts +0 -24
  61. package/dist/components/basics/EpText.vue.d.ts +0 -34
  62. package/dist/components/charts/EpBarChart.vue.d.ts +0 -82
  63. package/dist/components/charts/EpLineChart.vue.d.ts +0 -82
  64. package/dist/components/charts/EpPieChart.vue.d.ts +0 -2
  65. package/dist/components/educationals/EpEdu.vue.d.ts +0 -81
  66. package/dist/components/educationals/EpReading.vue.d.ts +0 -152
  67. package/dist/components/educationals/EpResource.vue.d.ts +0 -35
  68. package/dist/components/educationals/EpScope.vue.d.ts +0 -23
  69. package/dist/components/forms/EpCheckbox.vue.d.ts +0 -72
  70. package/dist/components/forms/EpInput.vue.d.ts +0 -98
  71. package/dist/components/forms/EpRadio.vue.d.ts +0 -69
  72. package/dist/components/forms/EpSelect.vue.d.ts +0 -83
  73. package/dist/components/forms/EpSwitch.vue.d.ts +0 -81
  74. package/dist/components/forms/EpTextarea.vue.d.ts +0 -90
  75. package/dist/components/forms/EpToggle.vue.d.ts +0 -81
  76. package/dist/components/interactions/EpAccordeon.vue.d.ts +0 -54
  77. package/dist/components/interactions/EpContentSlider.vue.d.ts +0 -2
  78. package/dist/components/interactions/EpModal.vue.d.ts +0 -70
  79. package/dist/components/interactions/EpQuestion.vue.d.ts +0 -91
  80. package/dist/components/interactions/EpTabs.vue.d.ts +0 -2
  81. package/dist/components/medias/EpAudio.vue.d.ts +0 -74
  82. package/dist/components/medias/EpCarousel.vue.d.ts +0 -41
  83. package/dist/components/medias/EpIframe.vue.d.ts +0 -58
  84. package/dist/components/medias/EpKatex.vue.d.ts +0 -52
  85. package/dist/components/medias/EpLink.vue.d.ts +0 -74
  86. package/dist/components/medias/EpLinkVersion.vue.d.ts +0 -27
  87. package/dist/components/medias/EpSoftware.vue.d.ts +0 -89
  88. package/dist/components/medias/EpSvg.vue.d.ts +0 -2
  89. package/dist/components/medias/EpTerm.vue.d.ts +0 -80
  90. package/dist/components/medias/EpTimeLine.vue.d.ts +0 -2
  91. package/dist/components/medias/EpVideo.vue.d.ts +0 -65
  92. package/dist/components/medias/EpVideoPanopto.vue.d.ts +0 -65
  93. package/dist/components/signages/EpAlert.vue.d.ts +0 -61
  94. package/dist/components/signages/EpHeader.vue.d.ts +0 -101
  95. package/dist/components/signages/EpNothing.vue.d.ts +0 -2
  96. package/dist/components/signages/EpQuote.vue.d.ts +0 -39
  97. package/dist/components/tools/BgAudio.vue.d.ts +0 -14
  98. package/dist/components/tools/DisplayBox.vue.d.ts +0 -17
  99. package/dist/composables/isHtml.d.ts +0 -1
  100. package/dist/composables/useColors.d.ts +0 -1
  101. package/dist/composables/useComponent.d.ts +0 -6
  102. package/dist/composables/useIcons.d.ts +0 -23
  103. package/dist/composables/useMarkdown.d.ts +0 -1
  104. package/dist/composables/useRenderText.d.ts +0 -1
  105. package/dist/ep-lib-ts.js +0 -43
  106. package/dist/ep-lib-ts.umd.cjs +0 -310
  107. package/dist/index-8c79cd61.js +0 -18814
  108. package/dist/index.d.ts +0 -40
  109. package/dist/main.d.ts +0 -0
  110. package/dist/router.d.ts +0 -2
  111. package/dist/style.css +0 -1
  112. package/dist/types/Accordeon.d.ts +0 -43
  113. package/dist/types/Alert.d.ts +0 -31
  114. package/dist/types/Answer.d.ts +0 -15
  115. package/dist/types/Border.d.ts +0 -2
  116. package/dist/types/Btn.d.ts +0 -41
  117. package/dist/types/Card.d.ts +0 -6
  118. package/dist/types/Chip.d.ts +0 -41
  119. package/dist/types/MandateLevel.d.ts +0 -5
  120. package/dist/types/MediaCarousel.d.ts +0 -7
  121. package/dist/types/Medias.d.ts +0 -11
  122. package/dist/types/Radio.d.ts +0 -11
  123. package/dist/vite.svg +0 -1
@@ -1,1171 +0,0 @@
1
- import { computed as E, toValue as J, unref as s, onMounted as qe, getCurrentInstance as $, watch as P, warn as Ye, provide as Xe, isRef as ue, onBeforeUnmount as Ze, inject as et, ref as re, reactive as tt, onUnmounted as rt, nextTick as nt, defineComponent as ot, toRefs as it, toRef as lt, openBlock as me, createElementBlock as ge, Fragment as at, createTextVNode as ye, toDisplayString as W, createElementVNode as C, createVNode as ut, withDirectives as st, vModelText as ct, createCommentVNode as dt } from "vue";
2
- import { b as ft, s as vt } from "./index-8c79cd61.js";
3
- function pt() {
4
- return Ee().__VUE_DEVTOOLS_GLOBAL_HOOK__;
5
- }
6
- function Ee() {
7
- return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
8
- }
9
- const ht = typeof Proxy == "function", bt = "devtools-plugin:setup", mt = "plugin:settings:set";
10
- let L, ne;
11
- function gt() {
12
- var e;
13
- return L !== void 0 || (typeof window < "u" && window.performance ? (L = !0, ne = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? (L = !0, ne = global.perf_hooks.performance) : L = !1), L;
14
- }
15
- function yt() {
16
- return gt() ? ne.now() : Date.now();
17
- }
18
- class _t {
19
- constructor(t, r) {
20
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = r;
21
- const n = {};
22
- if (t.settings)
23
- for (const i in t.settings) {
24
- const u = t.settings[i];
25
- n[i] = u.defaultValue;
26
- }
27
- const o = `__vue-devtools-plugin-settings__${t.id}`;
28
- let l = Object.assign({}, n);
29
- try {
30
- const i = localStorage.getItem(o), u = JSON.parse(i);
31
- Object.assign(l, u);
32
- } catch {
33
- }
34
- this.fallbacks = {
35
- getSettings() {
36
- return l;
37
- },
38
- setSettings(i) {
39
- try {
40
- localStorage.setItem(o, JSON.stringify(i));
41
- } catch {
42
- }
43
- l = i;
44
- },
45
- now() {
46
- return yt();
47
- }
48
- }, r && r.on(mt, (i, u) => {
49
- i === this.plugin.id && this.fallbacks.setSettings(u);
50
- }), this.proxiedOn = new Proxy({}, {
51
- get: (i, u) => this.target ? this.target.on[u] : (...c) => {
52
- this.onQueue.push({
53
- method: u,
54
- args: c
55
- });
56
- }
57
- }), this.proxiedTarget = new Proxy({}, {
58
- get: (i, u) => this.target ? this.target[u] : u === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(u) ? (...c) => (this.targetQueue.push({
59
- method: u,
60
- args: c,
61
- resolve: () => {
62
- }
63
- }), this.fallbacks[u](...c)) : (...c) => new Promise((f) => {
64
- this.targetQueue.push({
65
- method: u,
66
- args: c,
67
- resolve: f
68
- });
69
- })
70
- });
71
- }
72
- async setRealTarget(t) {
73
- this.target = t;
74
- for (const r of this.onQueue)
75
- this.target.on[r.method](...r.args);
76
- for (const r of this.targetQueue)
77
- r.resolve(await this.target[r.method](...r.args));
78
- }
79
- }
80
- function Vt(e, t) {
81
- const r = e, n = Ee(), o = pt(), l = ht && r.enableEarlyProxy;
82
- if (o && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
83
- o.emit(bt, e, t);
84
- else {
85
- const i = l ? new _t(r, o) : null;
86
- (n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
87
- pluginDescriptor: r,
88
- setupFn: t,
89
- proxy: i
90
- }), i && t(i.proxiedTarget);
91
- }
92
- }
93
- /**
94
- * vee-validate v4.11.1
95
- * (c) 2023 Abdelrahman Awad
96
- * @license MIT
97
- */
98
- function T(e) {
99
- return typeof e == "function";
100
- }
101
- function Ot(e) {
102
- return e == null;
103
- }
104
- const F = (e) => e !== null && !!e && typeof e == "object" && !Array.isArray(e);
105
- function Ne(e) {
106
- return Number(e) >= 0;
107
- }
108
- function St(e) {
109
- const t = parseFloat(e);
110
- return isNaN(t) ? e : t;
111
- }
112
- function wt(e) {
113
- const t = e.split(".");
114
- if (!t.length)
115
- return "";
116
- let r = String(t[0]);
117
- for (let n = 1; n < t.length; n++) {
118
- if (Ne(t[n])) {
119
- r += `[${t[n]}]`;
120
- continue;
121
- }
122
- r += `.${t[n]}`;
123
- }
124
- return r;
125
- }
126
- const At = {};
127
- function kt(e) {
128
- return At[e];
129
- }
130
- const je = Symbol("vee-validate-form"), xt = Symbol("vee-validate-field-instance"), _e = Symbol("Default empty value"), Et = typeof window < "u";
131
- function oe(e) {
132
- return T(e) && !!e.__locatorRef;
133
- }
134
- function q(e) {
135
- return !!e && T(e.parse) && e.__type === "VVTypedSchema";
136
- }
137
- function ie(e) {
138
- return !!e && T(e.validate);
139
- }
140
- function Ce(e) {
141
- return e === "checkbox" || e === "radio";
142
- }
143
- function Nt(e) {
144
- return F(e) || Array.isArray(e);
145
- }
146
- function se(e) {
147
- return /^\[.+\]$/i.test(e);
148
- }
149
- function jt(e) {
150
- return Pe(e) && e.multiple;
151
- }
152
- function Pe(e) {
153
- return e.tagName === "SELECT";
154
- }
155
- function Ct(e) {
156
- return e ? !!(typeof Event < "u" && T(Event) && e instanceof Event || e && e.srcElement) : !1;
157
- }
158
- function S(e, t) {
159
- if (e === t)
160
- return !0;
161
- if (e && t && typeof e == "object" && typeof t == "object") {
162
- if (e.constructor !== t.constructor)
163
- return !1;
164
- var r, n, o;
165
- if (Array.isArray(e)) {
166
- if (r = e.length, r != t.length)
167
- return !1;
168
- for (n = r; n-- !== 0; )
169
- if (!S(e[n], t[n]))
170
- return !1;
171
- return !0;
172
- }
173
- if (e instanceof Map && t instanceof Map) {
174
- if (e.size !== t.size)
175
- return !1;
176
- for (n of e.entries())
177
- if (!t.has(n[0]))
178
- return !1;
179
- for (n of e.entries())
180
- if (!S(n[1], t.get(n[0])))
181
- return !1;
182
- return !0;
183
- }
184
- if (Ve(e) && Ve(t))
185
- return !(e.size !== t.size || e.name !== t.name || e.lastModified !== t.lastModified || e.type !== t.type);
186
- if (e instanceof Set && t instanceof Set) {
187
- if (e.size !== t.size)
188
- return !1;
189
- for (n of e.entries())
190
- if (!t.has(n[0]))
191
- return !1;
192
- return !0;
193
- }
194
- if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
195
- if (r = e.length, r != t.length)
196
- return !1;
197
- for (n = r; n-- !== 0; )
198
- if (e[n] !== t[n])
199
- return !1;
200
- return !0;
201
- }
202
- if (e.constructor === RegExp)
203
- return e.source === t.source && e.flags === t.flags;
204
- if (e.valueOf !== Object.prototype.valueOf)
205
- return e.valueOf() === t.valueOf();
206
- if (e.toString !== Object.prototype.toString)
207
- return e.toString() === t.toString();
208
- for (o = Object.keys(e), r = o.length, n = r; n-- !== 0; ) {
209
- var l = o[n];
210
- if (!S(e[l], t[l]))
211
- return !1;
212
- }
213
- return !0;
214
- }
215
- return e !== e && t !== t;
216
- }
217
- function Ve(e) {
218
- return Et ? e instanceof File : !1;
219
- }
220
- function Oe(e, t, r) {
221
- typeof r.value == "object" && (r.value = I(r.value)), !r.enumerable || r.get || r.set || !r.configurable || !r.writable || t === "__proto__" ? Object.defineProperty(e, t, r) : e[t] = r.value;
222
- }
223
- function I(e) {
224
- if (typeof e != "object")
225
- return e;
226
- var t = 0, r, n, o, l = Object.prototype.toString.call(e);
227
- if (l === "[object Object]" ? o = Object.create(e.__proto__ || null) : l === "[object Array]" ? o = Array(e.length) : l === "[object Set]" ? (o = /* @__PURE__ */ new Set(), e.forEach(function(i) {
228
- o.add(I(i));
229
- })) : l === "[object Map]" ? (o = /* @__PURE__ */ new Map(), e.forEach(function(i, u) {
230
- o.set(I(u), I(i));
231
- })) : l === "[object Date]" ? o = /* @__PURE__ */ new Date(+e) : l === "[object RegExp]" ? o = new RegExp(e.source, e.flags) : l === "[object DataView]" ? o = new e.constructor(I(e.buffer)) : l === "[object ArrayBuffer]" ? o = e.slice(0) : l.slice(-6) === "Array]" && (o = new e.constructor(e)), o) {
232
- for (n = Object.getOwnPropertySymbols(e); t < n.length; t++)
233
- Oe(o, n[t], Object.getOwnPropertyDescriptor(e, n[t]));
234
- for (t = 0, n = Object.getOwnPropertyNames(e); t < n.length; t++)
235
- Object.hasOwnProperty.call(o, r = n[t]) && o[r] === e[r] || Oe(o, r, Object.getOwnPropertyDescriptor(e, r));
236
- }
237
- return o || e;
238
- }
239
- function Ie(e) {
240
- return se(e) ? e.replace(/\[|\]/gi, "") : e;
241
- }
242
- function z(e, t, r) {
243
- return e ? se(t) ? e[Ie(t)] : (t || "").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((o, l) => Nt(o) && l in o ? o[l] : r, e) : r;
244
- }
245
- function Pt(e, t, r) {
246
- if (se(t)) {
247
- e[Ie(t)] = r;
248
- return;
249
- }
250
- const n = t.split(/\.|\[(\d+)\]/).filter(Boolean);
251
- let o = e;
252
- for (let l = 0; l < n.length; l++) {
253
- if (l === n.length - 1) {
254
- o[n[l]] = r;
255
- return;
256
- }
257
- (!(n[l] in o) || Ot(o[n[l]])) && (o[n[l]] = Ne(n[l + 1]) ? [] : {}), o = o[n[l]];
258
- }
259
- }
260
- function Te(e) {
261
- return Object.keys(e);
262
- }
263
- function Fe(e, t = void 0) {
264
- const r = $();
265
- return (r == null ? void 0 : r.provides[e]) || et(e, t);
266
- }
267
- function Se(e, t, r) {
268
- if (Array.isArray(e)) {
269
- const n = [...e], o = n.findIndex((l) => S(l, t));
270
- return o >= 0 ? n.splice(o, 1) : n.push(t), n;
271
- }
272
- return S(e, t) ? r : t;
273
- }
274
- function It(e, t) {
275
- let r, n;
276
- return function(...o) {
277
- const l = this;
278
- return r || (r = !0, setTimeout(() => r = !1, t), n = e.apply(l, o)), n;
279
- };
280
- }
281
- function Tt(e, t) {
282
- return F(t) && t.number ? St(e) : e;
283
- }
284
- function we(e, t) {
285
- let r;
286
- return async function(...o) {
287
- const l = e(...o);
288
- r = l;
289
- const i = await l;
290
- return l !== r || (r = void 0, t(i, o)), i;
291
- };
292
- }
293
- function Ft(e) {
294
- return Array.isArray(e) ? e : e ? [e] : [];
295
- }
296
- function te(e) {
297
- if (De(e))
298
- return e._value;
299
- }
300
- function De(e) {
301
- return "_value" in e;
302
- }
303
- function Dt(e) {
304
- return e.type === "number" || e.type === "range" ? Number.isNaN(e.valueAsNumber) ? e.value : e.valueAsNumber : e.value;
305
- }
306
- function Me(e) {
307
- if (!Ct(e))
308
- return e;
309
- const t = e.target;
310
- if (Ce(t.type) && De(t))
311
- return te(t);
312
- if (t.type === "file" && t.files) {
313
- const r = Array.from(t.files);
314
- return t.multiple ? r : r[0];
315
- }
316
- if (jt(t))
317
- return Array.from(t.options).filter((r) => r.selected && !r.disabled).map(te);
318
- if (Pe(t)) {
319
- const r = Array.from(t.options).find((n) => n.selected);
320
- return r ? te(r) : t.value;
321
- }
322
- return Dt(t);
323
- }
324
- function Ue(e) {
325
- const t = {};
326
- return Object.defineProperty(t, "_$$isNormalized", {
327
- value: !0,
328
- writable: !1,
329
- enumerable: !1,
330
- configurable: !1
331
- }), e ? F(e) && e._$$isNormalized ? e : F(e) ? Object.keys(e).reduce((r, n) => {
332
- const o = Mt(e[n]);
333
- return e[n] !== !1 && (r[n] = Ae(o)), r;
334
- }, t) : typeof e != "string" ? t : e.split("|").reduce((r, n) => {
335
- const o = Ut(n);
336
- return o.name && (r[o.name] = Ae(o.params)), r;
337
- }, t) : t;
338
- }
339
- function Mt(e) {
340
- return e === !0 ? [] : Array.isArray(e) || F(e) ? e : [e];
341
- }
342
- function Ae(e) {
343
- const t = (r) => typeof r == "string" && r[0] === "@" ? Rt(r.slice(1)) : r;
344
- return Array.isArray(e) ? e.map(t) : e instanceof RegExp ? [e] : Object.keys(e).reduce((r, n) => (r[n] = t(e[n]), r), {});
345
- }
346
- const Ut = (e) => {
347
- let t = [];
348
- const r = e.split(":")[0];
349
- return e.includes(":") && (t = e.split(":").slice(1).join(":").split(",")), { name: r, params: t };
350
- };
351
- function Rt(e) {
352
- const t = (r) => z(r, e) || r[e];
353
- return t.__locatorRef = e, t;
354
- }
355
- function Lt(e) {
356
- return Array.isArray(e) ? e.filter(oe) : Te(e).filter((t) => oe(e[t])).map((t) => e[t]);
357
- }
358
- const Bt = {
359
- generateMessage: ({ field: e }) => `${e} is not valid.`,
360
- bails: !0,
361
- validateOnBlur: !0,
362
- validateOnChange: !0,
363
- validateOnInput: !1,
364
- validateOnModelUpdate: !0
365
- };
366
- let $t = Object.assign({}, Bt);
367
- const zt = () => $t;
368
- async function Gt(e, t, r = {}) {
369
- const n = r == null ? void 0 : r.bails, o = {
370
- name: (r == null ? void 0 : r.name) || "{field}",
371
- rules: t,
372
- label: r == null ? void 0 : r.label,
373
- bails: n ?? !0,
374
- formData: (r == null ? void 0 : r.values) || {}
375
- }, i = (await Qt(o, e)).errors;
376
- return {
377
- errors: i,
378
- valid: !i.length
379
- };
380
- }
381
- async function Qt(e, t) {
382
- if (q(e.rules) || ie(e.rules))
383
- return Wt(t, e.rules);
384
- if (T(e.rules) || Array.isArray(e.rules)) {
385
- const i = {
386
- field: e.label || e.name,
387
- name: e.name,
388
- label: e.label,
389
- form: e.formData,
390
- value: t
391
- }, u = Array.isArray(e.rules) ? e.rules : [e.rules], c = u.length, f = [];
392
- for (let m = 0; m < c; m++) {
393
- const p = u[m], y = await p(t, i);
394
- if (!(typeof y != "string" && !Array.isArray(y) && y)) {
395
- if (Array.isArray(y))
396
- f.push(...y);
397
- else {
398
- const V = typeof y == "string" ? y : Re(i);
399
- f.push(V);
400
- }
401
- if (e.bails)
402
- return {
403
- errors: f
404
- };
405
- }
406
- }
407
- return {
408
- errors: f
409
- };
410
- }
411
- const r = Object.assign(Object.assign({}, e), { rules: Ue(e.rules) }), n = [], o = Object.keys(r.rules), l = o.length;
412
- for (let i = 0; i < l; i++) {
413
- const u = o[i], c = await Jt(r, t, {
414
- name: u,
415
- params: r.rules[u]
416
- });
417
- if (c.error && (n.push(c.error), e.bails))
418
- return {
419
- errors: n
420
- };
421
- }
422
- return {
423
- errors: n
424
- };
425
- }
426
- function Kt(e) {
427
- return !!e && e.name === "ValidationError";
428
- }
429
- function Ht(e) {
430
- return {
431
- __type: "VVTypedSchema",
432
- async parse(r) {
433
- var n;
434
- try {
435
- return {
436
- output: await e.validate(r, { abortEarly: !1 }),
437
- errors: []
438
- };
439
- } catch (o) {
440
- if (!Kt(o))
441
- throw o;
442
- if (!(!((n = o.inner) === null || n === void 0) && n.length) && o.errors.length)
443
- return { errors: [{ path: o.path, errors: o.errors }] };
444
- const l = o.inner.reduce((i, u) => {
445
- const c = u.path || "";
446
- return i[c] || (i[c] = { errors: [], path: c }), i[c].errors.push(...u.errors), i;
447
- }, {});
448
- return { errors: Object.values(l) };
449
- }
450
- }
451
- };
452
- }
453
- async function Wt(e, t) {
454
- const n = await (q(t) ? t : Ht(t)).parse(e), o = [];
455
- for (const l of n.errors)
456
- l.errors.length && o.push(...l.errors);
457
- return {
458
- errors: o
459
- };
460
- }
461
- async function Jt(e, t, r) {
462
- const n = kt(r.name);
463
- if (!n)
464
- throw new Error(`No such validator '${r.name}' exists.`);
465
- const o = qt(r.params, e.formData), l = {
466
- field: e.label || e.name,
467
- name: e.name,
468
- label: e.label,
469
- value: t,
470
- form: e.formData,
471
- rule: Object.assign(Object.assign({}, r), { params: o })
472
- }, i = await n(t, o, l);
473
- return typeof i == "string" ? {
474
- error: i
475
- } : {
476
- error: i ? void 0 : Re(l)
477
- };
478
- }
479
- function Re(e) {
480
- const t = zt().generateMessage;
481
- return t ? t(e) : "Field is invalid";
482
- }
483
- function qt(e, t) {
484
- const r = (n) => oe(n) ? n(t) : n;
485
- return Array.isArray(e) ? e.map(r) : Object.keys(e).reduce((n, o) => (n[o] = r(e[o]), n), {});
486
- }
487
- let ke = 0;
488
- function Yt(e, t) {
489
- const { value: r, initialValue: n, setInitialValue: o } = Xt(e, t.modelValue, t.form);
490
- if (!t.form) {
491
- let y = function(h) {
492
- var V;
493
- "value" in h && (r.value = h.value), "errors" in h && f(h.errors), "touched" in h && (p.touched = (V = h.touched) !== null && V !== void 0 ? V : p.touched), "initialValue" in h && o(h.initialValue);
494
- };
495
- const { errors: c, setErrors: f } = tr(), m = ke >= Number.MAX_SAFE_INTEGER ? 0 : ++ke, p = er(r, n, c);
496
- return {
497
- id: m,
498
- path: e,
499
- value: r,
500
- initialValue: n,
501
- meta: p,
502
- flags: { pendingUnmount: { [m]: !1 } },
503
- errors: c,
504
- setState: y
505
- };
506
- }
507
- const l = t.form.createPathState(e, {
508
- bails: t.bails,
509
- label: t.label,
510
- type: t.type,
511
- validate: t.validate
512
- }), i = E(() => l.errors);
513
- function u(c) {
514
- var f, m, p;
515
- "value" in c && (r.value = c.value), "errors" in c && ((f = t.form) === null || f === void 0 || f.setFieldError(s(e), c.errors)), "touched" in c && ((m = t.form) === null || m === void 0 || m.setFieldTouched(s(e), (p = c.touched) !== null && p !== void 0 ? p : !1)), "initialValue" in c && o(c.initialValue);
516
- }
517
- return {
518
- id: Array.isArray(l.id) ? l.id[l.id.length - 1] : l.id,
519
- path: e,
520
- value: r,
521
- errors: i,
522
- meta: l,
523
- initialValue: n,
524
- flags: l.__flags,
525
- setState: u
526
- };
527
- }
528
- function Xt(e, t, r) {
529
- const n = re(s(t));
530
- function o() {
531
- return r ? z(r.initialValues.value, s(e), s(n)) : s(n);
532
- }
533
- function l(f) {
534
- if (!r) {
535
- n.value = f;
536
- return;
537
- }
538
- r.stageInitialValue(s(e), f, !0);
539
- }
540
- const i = E(o);
541
- if (!r)
542
- return {
543
- value: re(o()),
544
- initialValue: i,
545
- setInitialValue: l
546
- };
547
- const u = Zt(t, r, i, e);
548
- return r.stageInitialValue(s(e), u, !0), {
549
- value: E({
550
- get() {
551
- return z(r.values, s(e));
552
- },
553
- set(f) {
554
- r.setFieldValue(s(e), f, !1);
555
- }
556
- }),
557
- initialValue: i,
558
- setInitialValue: l
559
- };
560
- }
561
- function Zt(e, t, r, n) {
562
- return ue(e) ? s(e) : e !== void 0 ? e : z(t.values, s(n), s(r));
563
- }
564
- function er(e, t, r) {
565
- const n = tt({
566
- touched: !1,
567
- pending: !1,
568
- valid: !0,
569
- validated: !!s(r).length,
570
- initialValue: E(() => s(t)),
571
- dirty: E(() => !S(s(e), s(t)))
572
- });
573
- return P(r, (o) => {
574
- n.valid = !o.length;
575
- }, {
576
- immediate: !0,
577
- flush: "sync"
578
- }), n;
579
- }
580
- function tr() {
581
- const e = re([]);
582
- return {
583
- errors: e,
584
- setErrors: (t) => {
585
- e.value = Ft(t);
586
- }
587
- };
588
- }
589
- function rr(e) {
590
- process.env.NODE_ENV !== "production" && Vt({
591
- id: "vee-validate-devtools-plugin",
592
- label: "VeeValidate Plugin",
593
- packageName: "vee-validate",
594
- homepage: "https://vee-validate.logaretm.com/v4",
595
- app: e,
596
- logo: "https://vee-validate.logaretm.com/v4/logo.png"
597
- }, or);
598
- }
599
- const Le = {}, K = {};
600
- let N;
601
- const le = It(() => {
602
- setTimeout(async () => {
603
- await nt(), N == null || N.sendInspectorState(B), N == null || N.sendInspectorTree(B);
604
- }, 100);
605
- }, 100);
606
- function nr(e) {
607
- const t = $();
608
- if (!N) {
609
- const r = t == null ? void 0 : t.appContext.app;
610
- if (!r)
611
- return;
612
- rr(r);
613
- }
614
- K[e.id] = Object.assign({}, e), K[e.id]._vm = t, rt(() => {
615
- delete K[e.id], le();
616
- }), le();
617
- }
618
- const B = "vee-validate-inspector", O = {
619
- error: 12405579,
620
- success: 448379,
621
- unknown: 5522283,
622
- white: 16777215,
623
- black: 0,
624
- blue: 218007,
625
- purple: 12157168,
626
- orange: 16099682,
627
- gray: 12304330
628
- };
629
- let g = null;
630
- function or(e) {
631
- N = e, e.addInspector({
632
- id: B,
633
- icon: "rule",
634
- label: "vee-validate",
635
- noSelectionText: "Select a vee-validate node to inspect",
636
- actions: [
637
- {
638
- icon: "done_outline",
639
- tooltip: "Validate selected item",
640
- action: async () => {
641
- if (!g) {
642
- console.error("There is not a valid selected vee-validate node or component");
643
- return;
644
- }
645
- if (g.type === "field") {
646
- await g.field.validate();
647
- return;
648
- }
649
- if (g.type === "form") {
650
- await g.form.validate();
651
- return;
652
- }
653
- g.type === "pathState" && await g.form.validateField(g.state.path);
654
- }
655
- },
656
- {
657
- icon: "delete_sweep",
658
- tooltip: "Clear validation state of the selected item",
659
- action: () => {
660
- if (!g) {
661
- console.error("There is not a valid selected vee-validate node or component");
662
- return;
663
- }
664
- if (g.type === "field") {
665
- g.field.resetField();
666
- return;
667
- }
668
- g.type === "form" && g.form.resetForm(), g.type === "pathState" && g.form.resetField(g.state.path);
669
- }
670
- }
671
- ]
672
- }), e.on.getInspectorTree((t) => {
673
- if (t.inspectorId !== B)
674
- return;
675
- const r = Object.values(Le), n = Object.values(K);
676
- t.rootNodes = [
677
- ...r.map(ir),
678
- ...n.map((o) => ar(o))
679
- ];
680
- }), e.on.getInspectorState((t, r) => {
681
- if (t.inspectorId !== B || r.currentTab !== `custom-inspector:${B}`)
682
- return;
683
- const { form: n, field: o, state: l, type: i } = ur(t.nodeId);
684
- if (n && i === "form") {
685
- t.state = sr(n), g = { type: "form", form: n };
686
- return;
687
- }
688
- if (l && i === "pathState" && n) {
689
- t.state = xe(l), g = { type: "pathState", state: l, form: n };
690
- return;
691
- }
692
- if (o && i === "field") {
693
- t.state = xe({
694
- errors: o.errors.value,
695
- dirty: o.meta.dirty,
696
- valid: o.meta.valid,
697
- touched: o.meta.touched,
698
- value: o.value.value,
699
- initialValue: o.meta.initialValue
700
- }), g = { field: o, type: "field" };
701
- return;
702
- }
703
- g = null;
704
- });
705
- }
706
- function ir(e) {
707
- const { textColor: t, bgColor: r } = $e(e.meta.value.valid), n = {};
708
- Object.values(e.getAllPathStates()).forEach((i) => {
709
- Pt(n, s(i.path), lr(i, e));
710
- });
711
- function o(i, u = []) {
712
- const c = [...u].pop();
713
- return "id" in i ? Object.assign(Object.assign({}, i), { label: c || i.label }) : F(i) ? {
714
- id: `${u.join(".")}`,
715
- label: c || "",
716
- children: Object.keys(i).map((f) => o(i[f], [...u, f]))
717
- } : Array.isArray(i) ? {
718
- id: `${u.join(".")}`,
719
- label: `${c}[]`,
720
- children: i.map((f, m) => o(f, [...u, String(m)]))
721
- } : { id: "", label: "", children: [] };
722
- }
723
- const { children: l } = o(n);
724
- return {
725
- id: ce(e),
726
- label: "Form",
727
- children: l,
728
- tags: [
729
- {
730
- label: "Form",
731
- textColor: t,
732
- backgroundColor: r
733
- },
734
- {
735
- label: `${e.getAllPathStates().length} fields`,
736
- textColor: O.white,
737
- backgroundColor: O.unknown
738
- }
739
- ]
740
- };
741
- }
742
- function lr(e, t) {
743
- return {
744
- id: ce(t, e),
745
- label: s(e.path),
746
- tags: Be(e.multiple, e.fieldsCount, e.type, e.valid, t)
747
- };
748
- }
749
- function ar(e, t) {
750
- return {
751
- id: ce(t, e),
752
- label: s(e.name),
753
- tags: Be(!1, 1, e.type, e.meta.valid, t)
754
- };
755
- }
756
- function Be(e, t, r, n, o) {
757
- const { textColor: l, bgColor: i } = $e(n);
758
- return [
759
- e ? void 0 : {
760
- label: "Field",
761
- textColor: l,
762
- backgroundColor: i
763
- },
764
- o ? void 0 : {
765
- label: "Standalone",
766
- textColor: O.black,
767
- backgroundColor: O.gray
768
- },
769
- r === "checkbox" ? {
770
- label: "Checkbox",
771
- textColor: O.white,
772
- backgroundColor: O.blue
773
- } : void 0,
774
- r === "radio" ? {
775
- label: "Radio",
776
- textColor: O.white,
777
- backgroundColor: O.purple
778
- } : void 0,
779
- e ? {
780
- label: "Multiple",
781
- textColor: O.black,
782
- backgroundColor: O.orange
783
- } : void 0
784
- ].filter(Boolean);
785
- }
786
- function ce(e, t) {
787
- const r = t ? "path" in t ? "pathState" : "field" : "form", n = t ? "path" in t ? t == null ? void 0 : t.path : s(t == null ? void 0 : t.name) : "", o = { f: e == null ? void 0 : e.formId, ff: n, type: r };
788
- return btoa(encodeURIComponent(JSON.stringify(o)));
789
- }
790
- function ur(e) {
791
- try {
792
- const t = JSON.parse(decodeURIComponent(atob(e))), r = Le[t.f];
793
- if (!r && t.ff) {
794
- const o = K[t.ff];
795
- return o ? {
796
- type: t.type,
797
- field: o
798
- } : {};
799
- }
800
- if (!r)
801
- return {};
802
- const n = r.getPathState(t.ff);
803
- return {
804
- type: t.type,
805
- form: r,
806
- state: n
807
- };
808
- } catch {
809
- }
810
- return {};
811
- }
812
- function xe(e) {
813
- return {
814
- "Field state": [
815
- { key: "errors", value: e.errors },
816
- {
817
- key: "initialValue",
818
- value: e.initialValue
819
- },
820
- {
821
- key: "currentValue",
822
- value: e.value
823
- },
824
- {
825
- key: "touched",
826
- value: e.touched
827
- },
828
- {
829
- key: "dirty",
830
- value: e.dirty
831
- },
832
- {
833
- key: "valid",
834
- value: e.valid
835
- }
836
- ]
837
- };
838
- }
839
- function sr(e) {
840
- const { errorBag: t, meta: r, values: n, isSubmitting: o, isValidating: l, submitCount: i } = e;
841
- return {
842
- "Form state": [
843
- {
844
- key: "submitCount",
845
- value: i.value
846
- },
847
- {
848
- key: "isSubmitting",
849
- value: o.value
850
- },
851
- {
852
- key: "isValidating",
853
- value: l.value
854
- },
855
- {
856
- key: "touched",
857
- value: r.value.touched
858
- },
859
- {
860
- key: "dirty",
861
- value: r.value.dirty
862
- },
863
- {
864
- key: "valid",
865
- value: r.value.valid
866
- },
867
- {
868
- key: "initialValues",
869
- value: r.value.initialValues
870
- },
871
- {
872
- key: "currentValues",
873
- value: n
874
- },
875
- {
876
- key: "errors",
877
- value: Te(t.value).reduce((u, c) => {
878
- var f;
879
- const m = (f = t.value[c]) === null || f === void 0 ? void 0 : f[0];
880
- return m && (u[c] = m), u;
881
- }, {})
882
- }
883
- ]
884
- };
885
- }
886
- function $e(e) {
887
- return {
888
- bgColor: e ? O.success : O.error,
889
- textColor: e ? O.black : O.white
890
- };
891
- }
892
- function cr(e, t, r) {
893
- return Ce(r == null ? void 0 : r.type) ? fr(e, t, r) : ze(e, t, r);
894
- }
895
- function ze(e, t, r) {
896
- const { initialValue: n, validateOnMount: o, bails: l, type: i, checkedValue: u, label: c, validateOnValueUpdate: f, uncheckedValue: m, controlled: p, keepValueOnUnmount: y, syncVModel: h, form: V } = dr(r), D = p ? Fe(je) : void 0, d = V || D, x = E(() => wt(J(e))), k = E(() => {
897
- if (s(d == null ? void 0 : d.schema))
898
- return;
899
- const v = s(t);
900
- return ie(v) || q(v) || T(v) || Array.isArray(v) ? v : Ue(v);
901
- }), { id: Y, value: G, initialValue: Ge, meta: w, setState: H, errors: X, flags: Z } = Yt(x, {
902
- modelValue: n,
903
- form: d,
904
- bails: l,
905
- label: c,
906
- type: i,
907
- validate: k.value ? fe : void 0
908
- }), Qe = E(() => X.value[0]);
909
- h && vr({ value: G, prop: h, handleChange: ve });
910
- const Ke = (a, v = !1) => {
911
- w.touched = !0, v && M();
912
- };
913
- async function de(a) {
914
- var v, _;
915
- return d != null && d.validateSchema ? (v = (await d.validateSchema(a)).results[s(x)]) !== null && v !== void 0 ? v : { valid: !0, errors: [] } : k.value ? Gt(G.value, k.value, {
916
- name: s(x),
917
- label: s(c),
918
- values: (_ = d == null ? void 0 : d.values) !== null && _ !== void 0 ? _ : {},
919
- bails: l
920
- }) : { valid: !0, errors: [] };
921
- }
922
- const M = we(async () => (w.pending = !0, w.validated = !0, de("validated-only")), (a) => {
923
- if (!Z.pendingUnmount[A.id])
924
- return H({ errors: a.errors }), w.pending = !1, w.valid = a.valid, a;
925
- }), U = we(async () => de("silent"), (a) => (w.valid = a.valid, a));
926
- function fe(a) {
927
- return (a == null ? void 0 : a.mode) === "silent" ? U() : M();
928
- }
929
- function ve(a, v = !0) {
930
- const _ = Me(a);
931
- ee(_, v);
932
- }
933
- qe(() => {
934
- if (o)
935
- return M();
936
- (!d || !d.validateSchema) && U();
937
- });
938
- function He(a) {
939
- w.touched = a;
940
- }
941
- function pe(a) {
942
- var v;
943
- const _ = a && "value" in a ? a.value : Ge.value;
944
- H({
945
- value: I(_),
946
- initialValue: I(_),
947
- touched: (v = a == null ? void 0 : a.touched) !== null && v !== void 0 ? v : !1,
948
- errors: (a == null ? void 0 : a.errors) || []
949
- }), w.pending = !1, w.validated = !1, U();
950
- }
951
- const he = $();
952
- function ee(a, v = !0) {
953
- G.value = he && h ? Tt(a, he.props.modelModifiers) : a, (v ? M : U)();
954
- }
955
- function We(a) {
956
- H({ errors: Array.isArray(a) ? a : [a] });
957
- }
958
- const be = E({
959
- get() {
960
- return G.value;
961
- },
962
- set(a) {
963
- ee(a, f);
964
- }
965
- });
966
- process.env.NODE_ENV !== "production" && P(be, (a, v) => {
967
- F(a) && a === v && S(a, v) && Ye("Detected a possible deep change on field `value` ref, for nested changes please either set the entire ref value or use `setValue` or `handleChange`.");
968
- }, { deep: !0 });
969
- const A = {
970
- id: Y,
971
- name: x,
972
- label: c,
973
- value: be,
974
- meta: w,
975
- errors: X,
976
- errorMessage: Qe,
977
- type: i,
978
- checkedValue: u,
979
- uncheckedValue: m,
980
- bails: l,
981
- keepValueOnUnmount: y,
982
- resetField: pe,
983
- handleReset: () => pe(),
984
- validate: fe,
985
- handleChange: ve,
986
- handleBlur: Ke,
987
- setState: H,
988
- setTouched: He,
989
- setErrors: We,
990
- setValue: ee
991
- };
992
- if (Xe(xt, A), ue(t) && typeof s(t) != "function" && P(t, (a, v) => {
993
- S(a, v) || (w.validated ? M() : U());
994
- }, {
995
- deep: !0
996
- }), process.env.NODE_ENV !== "production" && (A._vm = $(), P(() => Object.assign(Object.assign({ errors: X.value }, w), { value: G.value }), le, {
997
- deep: !0
998
- }), d || nr(A)), !d)
999
- return A;
1000
- const Je = E(() => {
1001
- const a = k.value;
1002
- return !a || T(a) || ie(a) || q(a) || Array.isArray(a) ? {} : Object.keys(a).reduce((v, _) => {
1003
- const b = Lt(a[_]).map((Q) => Q.__locatorRef).reduce((Q, R) => {
1004
- const j = z(d.values, R) || d.values[R];
1005
- return j !== void 0 && (Q[R] = j), Q;
1006
- }, {});
1007
- return Object.assign(v, b), v;
1008
- }, {});
1009
- });
1010
- return P(Je, (a, v) => {
1011
- if (!Object.keys(a).length)
1012
- return;
1013
- !S(a, v) && (w.validated ? M() : U());
1014
- }), Ze(() => {
1015
- var a;
1016
- const v = (a = s(A.keepValueOnUnmount)) !== null && a !== void 0 ? a : s(d.keepValuesOnUnmount), _ = J(x);
1017
- if (v || !d || Z.pendingUnmount[A.id]) {
1018
- d == null || d.removePathState(_, Y);
1019
- return;
1020
- }
1021
- Z.pendingUnmount[A.id] = !0;
1022
- const b = d.getPathState(_);
1023
- if (Array.isArray(b == null ? void 0 : b.id) && (b != null && b.multiple) ? b != null && b.id.includes(A.id) : (b == null ? void 0 : b.id) === A.id) {
1024
- if (b != null && b.multiple && Array.isArray(b.value)) {
1025
- const R = b.value.findIndex((j) => S(j, s(A.checkedValue)));
1026
- if (R > -1) {
1027
- const j = [...b.value];
1028
- j.splice(R, 1), d.setFieldValue(_, j);
1029
- }
1030
- Array.isArray(b.id) && b.id.splice(b.id.indexOf(A.id), 1);
1031
- } else
1032
- d.unsetPathValue(J(x));
1033
- d.removePathState(_, Y);
1034
- }
1035
- }), A;
1036
- }
1037
- function dr(e) {
1038
- const t = () => ({
1039
- initialValue: void 0,
1040
- validateOnMount: !1,
1041
- bails: !0,
1042
- label: void 0,
1043
- validateOnValueUpdate: !0,
1044
- keepValueOnUnmount: void 0,
1045
- syncVModel: !1,
1046
- controlled: !0
1047
- }), r = !!(e != null && e.syncVModel), n = typeof (e == null ? void 0 : e.syncVModel) == "string" ? e.syncVModel : (e == null ? void 0 : e.modelPropName) || "modelValue", o = r && !("initialValue" in (e || {})) ? ae($(), n) : e == null ? void 0 : e.initialValue;
1048
- if (!e)
1049
- return Object.assign(Object.assign({}, t()), { initialValue: o });
1050
- const l = "valueProp" in e ? e.valueProp : e.checkedValue, i = "standalone" in e ? !e.standalone : e.controlled, u = (e == null ? void 0 : e.modelPropName) || (e == null ? void 0 : e.syncVModel) || !1;
1051
- return Object.assign(Object.assign(Object.assign({}, t()), e || {}), {
1052
- initialValue: o,
1053
- controlled: i ?? !0,
1054
- checkedValue: l,
1055
- syncVModel: u
1056
- });
1057
- }
1058
- function fr(e, t, r) {
1059
- const n = r != null && r.standalone ? void 0 : Fe(je), o = r == null ? void 0 : r.checkedValue, l = r == null ? void 0 : r.uncheckedValue;
1060
- function i(u) {
1061
- const c = u.handleChange, f = E(() => {
1062
- const p = s(u.value), y = s(o);
1063
- return Array.isArray(p) ? p.findIndex((h) => S(h, y)) >= 0 : S(y, p);
1064
- });
1065
- function m(p, y = !0) {
1066
- var h, V;
1067
- if (f.value === ((h = p == null ? void 0 : p.target) === null || h === void 0 ? void 0 : h.checked)) {
1068
- y && u.validate();
1069
- return;
1070
- }
1071
- const D = J(e), d = n == null ? void 0 : n.getPathState(D), x = Me(p);
1072
- let k = (V = s(o)) !== null && V !== void 0 ? V : x;
1073
- n && (d != null && d.multiple) && d.type === "checkbox" ? k = Se(z(n.values, D) || [], k, void 0) : (r == null ? void 0 : r.type) === "checkbox" && (k = Se(s(u.value), k, s(l))), c(k, y);
1074
- }
1075
- return Object.assign(Object.assign({}, u), {
1076
- checked: f,
1077
- checkedValue: o,
1078
- uncheckedValue: l,
1079
- handleChange: m
1080
- });
1081
- }
1082
- return i(ze(e, t, r));
1083
- }
1084
- function vr({ prop: e, value: t, handleChange: r }) {
1085
- const n = $();
1086
- if (!n || !e) {
1087
- process.env.NODE_ENV !== "production" && console.warn("Failed to setup model events because `useField` was not called in setup.");
1088
- return;
1089
- }
1090
- const o = typeof e == "string" ? e : "modelValue", l = `update:${o}`;
1091
- o in n.props && (P(t, (i) => {
1092
- S(i, ae(n, o)) || n.emit(l, i);
1093
- }), P(() => ae(n, o), (i) => {
1094
- if (i === _e && t.value === void 0)
1095
- return;
1096
- const u = i === _e ? void 0 : i;
1097
- S(u, t.value) || r(u);
1098
- }));
1099
- }
1100
- function ae(e, t) {
1101
- if (e)
1102
- return e.props[t];
1103
- }
1104
- const pr = { class: "w-72" }, hr = { class: "relative h-10 w-full min-w-[200px]" }, br = /* @__PURE__ */ C("div", { class: "absolute top-2/4 right-3 grid h-5 w-5 -translate-y-2/4 place-items-center text-neutral-400" }, null, -1), mr = ["id", "type", "disabled"], gr = ["for"], yr = { class: "my-3" }, _r = ["name", "id"], Vr = { key: 0 }, wr = /* @__PURE__ */ ot({
1105
- __name: "EpInput",
1106
- props: {
1107
- name: {},
1108
- id: { default: "0" },
1109
- label: { default: "label" },
1110
- modelValue: { default: "" },
1111
- type: { default: "text" },
1112
- placeholder: { default: "" },
1113
- iconPath: { default: "" },
1114
- iconSize: { default: "32" },
1115
- disabled: { type: Boolean, default: !1 },
1116
- readonly: { type: Boolean, default: !1 }
1117
- },
1118
- emits: ["update:modelValue"],
1119
- setup(e, { emit: t }) {
1120
- const r = e, {
1121
- id: n,
1122
- // name,
1123
- label: o,
1124
- type: l,
1125
- modelValue: i,
1126
- placeholder: u,
1127
- iconPath: c,
1128
- disabled: f,
1129
- readonly: m
1130
- } = it(r), p = lt(r, "name");
1131
- function y(d) {
1132
- return d ? d.length < 8 ? "this field must contain at least 8 characters" : !0 : "this field is required";
1133
- }
1134
- const { value: h, errorMessage: V, meta: D } = cr(p, y);
1135
- return (d, x) => (me(), ge(at, null, [
1136
- ye(W(s(D)) + " ", 1),
1137
- C("div", pr, [
1138
- C("div", hr, [
1139
- br,
1140
- C("input", {
1141
- id: s(n),
1142
- type: s(l),
1143
- class: "peer h-full w-full rounded-[7px] border border-blue-200 border-t-transparent bg-transparent px-3 py-2.5 !pr-9 font-sans text-sm font-normal text-neutral-700 outline outline-0 transition-all placeholder-shown:border placeholder-shown:border-neutral-200 placeholder-shown:border-t-neutral-200 focus:border-2 focus:border-blue-500 focus:border-t-transparent focus:outline-0 disabled:border-0 disabled:bg-neutral-100 disabled:cursor-not-allowed",
1144
- placeholder: " ",
1145
- disabled: s(f)
1146
- }, null, 8, mr),
1147
- C("label", {
1148
- for: s(n),
1149
- class: "before:content[' '] after:content[' '] pointer-events-none absolute left-0 -top-1.5 flex h-full w-full select-none text-[11px] font-normal leading-tight text-neutral-400 transition-all before:pointer-events-none before:mt-[6.5px] before:mr-1 before:box-border before:block before:h-1.5 before:w-2.5 before:rounded-tl-md before:border-t before:border-l before:border-blue-200 before:transition-all after:pointer-events-none after:mt-[6.5px] after:ml-1 after:box-border after:block after:h-1.5 after:w-2.5 after:flex-grow after:rounded-tr-md after:border-t after:border-r after:border-blue-200 after:transition-all peer-placeholder-shown:text-sm peer-placeholder-shown:leading-[3.75] peer-placeholder-shown:text-neutral-700 peer-placeholder-shown:before:border-transparent peer-placeholder-shown:after:border-transparent peer-focus:text-[11px] peer-focus:leading-tight peer-focus:text-blue-500 peer-focus:before:border-t-2 peer-focus:before:border-l-2 peer-focus:before:border-blue-500 peer-focus:after:border-t-2 peer-focus:after:border-r-2 peer-focus:after:border-blue-500 peer-disabled:text-transparent peer-disabled:before:border-transparent peer-disabled:after:border-transparent peer-disabled:peer-placeholder-shown:text-neutral-500"
1150
- }, W(s(o)), 9, gr),
1151
- ut(ft, { iconPath: s(vt) }, null, 8, ["iconPath"])
1152
- ])
1153
- ]),
1154
- C("div", yr, [
1155
- ye(W(p.value) + " ", 1),
1156
- st(C("input", {
1157
- type: "text",
1158
- "onUpdate:modelValue": x[0] || (x[0] = (k) => ue(h) ? h.value = k : null),
1159
- name: p.value,
1160
- id: p.value
1161
- }, null, 8, _r), [
1162
- [ct, s(h)]
1163
- ]),
1164
- s(V) ? (me(), ge("div", Vr, W(s(V)), 1)) : dt("", !0)
1165
- ])
1166
- ], 64));
1167
- }
1168
- });
1169
- export {
1170
- wr as default
1171
- };