@formatica/vue 0.2.1 → 0.2.3
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/README.md +280 -24
- package/dist/components/BaseField.d.ts +2 -2
- package/dist/components/BaseField.d.ts.map +1 -1
- package/dist/components/FormBuilder.d.ts +3 -3
- package/dist/components/FormBuilder.d.ts.map +1 -1
- package/dist/components/FormField.d.ts.map +1 -1
- package/dist/components/inputs/SelectInput.d.ts.map +1 -1
- package/dist/components/inputs/TagsInput.d.ts.map +1 -1
- package/dist/core/schemaParser.d.ts +1 -1
- package/dist/core/schemaParser.d.ts.map +1 -1
- package/dist/core/useForm.d.ts +1 -1
- package/dist/core/useForm.d.ts.map +1 -1
- package/dist/core/useFormI18n.d.ts +1 -1
- package/dist/core/useFormI18n.d.ts.map +1 -1
- package/dist/core/useTheme.d.ts +1 -1
- package/dist/core/useTheme.d.ts.map +1 -1
- package/dist/core/useValidation.d.ts +1 -1
- package/dist/core/useValidation.d.ts.map +1 -1
- package/dist/formatica.es.js +1287 -1258
- package/dist/formatica.es.js.map +1 -1
- package/dist/formatica.umd.cjs +1 -1
- package/dist/formatica.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/style.css +60 -47
- package/dist/types/schema.d.ts +1 -0
- package/dist/types/schema.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/formatica.es.js
CHANGED
|
@@ -1,52 +1,42 @@
|
|
|
1
|
-
import { titleCase as Ie, evaluateCondition as
|
|
1
|
+
import { titleCase as Ie, evaluateCondition as ie, getRule as Le, extractFields as U, sanitizeHtml as Ae, isFieldNode as Ce } from "@formatica/core";
|
|
2
2
|
export * from "@formatica/core";
|
|
3
|
-
import {
|
|
4
|
-
import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as
|
|
5
|
-
const Be = Symbol("FormaticaComponents"),
|
|
6
|
-
function Fe(e,
|
|
7
|
-
|
|
3
|
+
import { inject as Y, provide as ue, ref as M, reactive as ee, computed as x, watch as W, isRef as Ne, defineComponent as j, openBlock as d, createElementBlock as f, normalizeClass as T, Fragment as z, renderList as G, createElementVNode as h, normalizeStyle as O, createCommentVNode as I, toDisplayString as A, withKeys as he, withModifiers as J, createTextVNode as Q, onMounted as de, withDirectives as ce, vModelText as ye, nextTick as te, onBeforeUnmount as Ve, unref as q, createVNode as Z, Transition as ae, withCtx as _, renderSlot as De, TransitionGroup as Me, createBlock as H, resolveDynamicComponent as Se, mergeProps as Ee, vShow as Re, resolveComponent as je } from "vue";
|
|
4
|
+
import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as Oe, AsYouType as ze } from "libphonenumber-js";
|
|
5
|
+
const Be = Symbol("FormaticaComponents"), le = /* @__PURE__ */ new Map();
|
|
6
|
+
function Fe(e, i) {
|
|
7
|
+
le.set(e, i);
|
|
8
8
|
}
|
|
9
9
|
function Bl(e) {
|
|
10
|
-
|
|
10
|
+
le.delete(e);
|
|
11
11
|
}
|
|
12
12
|
function Ke(e) {
|
|
13
|
-
return
|
|
13
|
+
return le.get(e);
|
|
14
14
|
}
|
|
15
15
|
function Pe(e) {
|
|
16
|
-
return
|
|
16
|
+
return le.has(e);
|
|
17
17
|
}
|
|
18
18
|
function Fl() {
|
|
19
|
-
return Array.from(
|
|
20
|
-
}
|
|
21
|
-
const Te = Symbol("Formatica");
|
|
22
|
-
function Tl(e = {}) {
|
|
23
|
-
return {
|
|
24
|
-
install(u) {
|
|
25
|
-
if (u.provide(Te, te(e)), e.components)
|
|
26
|
-
for (const [t, a] of Object.entries(e.components))
|
|
27
|
-
Fe(t, a);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
19
|
+
return Array.from(le.keys());
|
|
30
20
|
}
|
|
31
21
|
function Ue() {
|
|
32
22
|
const e = /* @__PURE__ */ new Map();
|
|
33
|
-
function
|
|
34
|
-
e.has(
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
|
|
23
|
+
function i(t, u) {
|
|
24
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set());
|
|
25
|
+
const n = e.get(t);
|
|
26
|
+
return n ? (n.add(u), () => {
|
|
27
|
+
n.delete(u);
|
|
38
28
|
}) : () => {
|
|
39
29
|
};
|
|
40
30
|
}
|
|
41
|
-
function t
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
for (const
|
|
45
|
-
|
|
31
|
+
function a(t, u) {
|
|
32
|
+
const n = e.get(t);
|
|
33
|
+
if (n)
|
|
34
|
+
for (const c of n)
|
|
35
|
+
c(u);
|
|
46
36
|
}
|
|
47
|
-
return { on:
|
|
37
|
+
return { on: i, emit: a };
|
|
48
38
|
}
|
|
49
|
-
const
|
|
39
|
+
const pe = Symbol("FormaticaI18n"), He = {
|
|
50
40
|
required: "This field is required",
|
|
51
41
|
email: "Please enter a valid email address",
|
|
52
42
|
url: "Please enter a valid URL",
|
|
@@ -65,176 +55,179 @@ const ye = Symbol("FormaticaI18n"), He = {
|
|
|
65
55
|
};
|
|
66
56
|
function Ge(e) {
|
|
67
57
|
const {
|
|
68
|
-
locale:
|
|
69
|
-
fallbackLocale:
|
|
70
|
-
fieldTranslations:
|
|
71
|
-
formTranslations:
|
|
58
|
+
locale: i,
|
|
59
|
+
fallbackLocale: a = "en",
|
|
60
|
+
fieldTranslations: t = {},
|
|
61
|
+
formTranslations: u = {}
|
|
72
62
|
} = e;
|
|
73
|
-
function
|
|
74
|
-
const k =
|
|
63
|
+
function n(r, s) {
|
|
64
|
+
const k = t[r];
|
|
75
65
|
if (k) {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
if (typeof
|
|
66
|
+
const S = k[i.value];
|
|
67
|
+
if (S) {
|
|
68
|
+
const y = S[s];
|
|
69
|
+
if (typeof y == "string") return y;
|
|
80
70
|
}
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
if (typeof
|
|
71
|
+
const F = k[a];
|
|
72
|
+
if (F) {
|
|
73
|
+
const y = F[s];
|
|
74
|
+
if (typeof y == "string") return y;
|
|
85
75
|
}
|
|
86
76
|
}
|
|
87
|
-
return
|
|
77
|
+
return s === "label" ? Ie(r) : "";
|
|
88
78
|
}
|
|
89
|
-
function
|
|
90
|
-
var
|
|
91
|
-
const k =
|
|
79
|
+
function c(r, s) {
|
|
80
|
+
var S, F;
|
|
81
|
+
const k = t[r];
|
|
92
82
|
if (k) {
|
|
93
|
-
const
|
|
94
|
-
if ((
|
|
95
|
-
const
|
|
96
|
-
if ((
|
|
83
|
+
const y = k[i.value];
|
|
84
|
+
if ((S = y == null ? void 0 : y.options) != null && S[s]) return y.options[s];
|
|
85
|
+
const v = k[a];
|
|
86
|
+
if ((F = v == null ? void 0 : v.options) != null && F[s]) return v.options[s];
|
|
97
87
|
}
|
|
98
|
-
return
|
|
88
|
+
return s;
|
|
99
89
|
}
|
|
100
|
-
function l(r,
|
|
101
|
-
var
|
|
102
|
-
const k = (
|
|
90
|
+
function l(r, s) {
|
|
91
|
+
var y, v;
|
|
92
|
+
const k = (y = u[i.value]) == null ? void 0 : y.messages;
|
|
103
93
|
if (k != null && k[r])
|
|
104
|
-
return
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
-
const
|
|
109
|
-
return
|
|
94
|
+
return me(k[r], s ?? {});
|
|
95
|
+
const S = (v = u[a]) == null ? void 0 : v.messages;
|
|
96
|
+
if (S != null && S[r])
|
|
97
|
+
return me(S[r], s ?? {});
|
|
98
|
+
const F = He[r];
|
|
99
|
+
return F ? me(F, s ?? {}) : `Validation failed: ${r}`;
|
|
110
100
|
}
|
|
111
|
-
const
|
|
112
|
-
locale:
|
|
113
|
-
fallbackLocale:
|
|
114
|
-
t:
|
|
115
|
-
tOption:
|
|
101
|
+
const o = {
|
|
102
|
+
locale: i,
|
|
103
|
+
fallbackLocale: a,
|
|
104
|
+
t: n,
|
|
105
|
+
tOption: c,
|
|
116
106
|
tValidation: l
|
|
117
107
|
};
|
|
118
|
-
return
|
|
108
|
+
return ue(pe, o), o;
|
|
119
109
|
}
|
|
120
110
|
function Ze() {
|
|
121
|
-
return
|
|
111
|
+
return Y(pe);
|
|
122
112
|
}
|
|
123
|
-
function
|
|
124
|
-
return e.replace(/\{(\w+)\}/g, (
|
|
113
|
+
function me(e, i) {
|
|
114
|
+
return e.replace(/\{(\w+)\}/g, (a, t) => i[t] !== void 0 ? String(i[t]) : `{${t}}`);
|
|
125
115
|
}
|
|
126
116
|
function we(e) {
|
|
127
|
-
return e.split("|").map((
|
|
128
|
-
const [
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
|
|
117
|
+
return e.split("|").map((i) => {
|
|
118
|
+
const [a, ...t] = i.split(":"), u = a ?? "", n = {};
|
|
119
|
+
if (t.length > 0) {
|
|
120
|
+
const l = t.join(":").split(",");
|
|
121
|
+
u === "between" && l.length === 2 ? (n.min = l[0], n.max = l[1]) : l.length === 1 ? n[u] = l[0] : n.values = l;
|
|
132
122
|
}
|
|
133
|
-
return { name:
|
|
123
|
+
return { name: u, params: n };
|
|
134
124
|
});
|
|
135
125
|
}
|
|
136
126
|
function qe(e) {
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
139
|
-
const
|
|
140
|
-
return e.required &&
|
|
127
|
+
const i = e.rules;
|
|
128
|
+
if (!i) {
|
|
129
|
+
const t = [];
|
|
130
|
+
return e.required && t.push({ name: "required" }), t;
|
|
141
131
|
}
|
|
142
|
-
if (typeof
|
|
143
|
-
return we(
|
|
144
|
-
if (Array.isArray(
|
|
145
|
-
return
|
|
146
|
-
const
|
|
147
|
-
for (const [
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
typeof
|
|
132
|
+
if (typeof i == "string")
|
|
133
|
+
return we(i);
|
|
134
|
+
if (Array.isArray(i))
|
|
135
|
+
return i.flatMap((t) => typeof t == "string" ? we(t) : []);
|
|
136
|
+
const a = [];
|
|
137
|
+
for (const [t, u] of Object.entries(i)) {
|
|
138
|
+
if (u === !1) continue;
|
|
139
|
+
const n = {};
|
|
140
|
+
typeof u == "object" && u !== null && !Array.isArray(u) ? Object.assign(n, u) : u !== !0 && (n[t] = u), a.push({ name: t, params: n });
|
|
151
141
|
}
|
|
152
|
-
return
|
|
142
|
+
return a;
|
|
153
143
|
}
|
|
154
|
-
function Ye(e,
|
|
155
|
-
let
|
|
156
|
-
return (...
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
},
|
|
144
|
+
function Ye(e, i) {
|
|
145
|
+
let a = null, t = null;
|
|
146
|
+
return (...u) => new Promise((n) => {
|
|
147
|
+
a !== null && (clearTimeout(a), t && t([])), t = n, a = setTimeout(async () => {
|
|
148
|
+
a = null;
|
|
149
|
+
const c = await e(...u);
|
|
150
|
+
n(c), t = null;
|
|
151
|
+
}, i);
|
|
162
152
|
});
|
|
163
153
|
}
|
|
164
154
|
function Je(e) {
|
|
165
|
-
const { fields:
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Ye(async (...
|
|
155
|
+
const { fields: i, values: a, settings: t } = e, u = M({}), n = /* @__PURE__ */ new Map();
|
|
156
|
+
function c(S, F) {
|
|
157
|
+
const y = `${S}:${F}`;
|
|
158
|
+
n.has(y) || n.set(
|
|
159
|
+
y,
|
|
160
|
+
Ye(async (...g) => l(
|
|
161
|
+
g[0],
|
|
162
|
+
g[1]
|
|
163
|
+
), F)
|
|
171
164
|
);
|
|
172
|
-
const
|
|
173
|
-
if (!
|
|
174
|
-
return
|
|
165
|
+
const v = n.get(y);
|
|
166
|
+
if (!v) throw new Error(`Debounced validator not found for ${y}`);
|
|
167
|
+
return v;
|
|
175
168
|
}
|
|
176
|
-
async function l(
|
|
177
|
-
var
|
|
178
|
-
const
|
|
179
|
-
if (!
|
|
180
|
-
const
|
|
181
|
-
for (const
|
|
182
|
-
if ((
|
|
183
|
-
const
|
|
184
|
-
if (("field" in
|
|
185
|
-
|
|
186
|
-
|
|
169
|
+
async function l(S, F) {
|
|
170
|
+
var N;
|
|
171
|
+
const y = i.value.find((B) => B.name === S);
|
|
172
|
+
if (!y) return [];
|
|
173
|
+
const v = qe(y), g = a.value[S], p = [];
|
|
174
|
+
for (const B of v) {
|
|
175
|
+
if ((N = B.params) != null && N.when) {
|
|
176
|
+
const V = B.params.when;
|
|
177
|
+
if (("field" in V || "and" in V || "or" in V) && !ie(
|
|
178
|
+
V,
|
|
179
|
+
a.value
|
|
187
180
|
))
|
|
188
181
|
continue;
|
|
189
182
|
}
|
|
190
|
-
if (
|
|
191
|
-
let
|
|
192
|
-
if (
|
|
193
|
-
|
|
183
|
+
if (B.optional && We(g)) continue;
|
|
184
|
+
let C;
|
|
185
|
+
if (B.validator)
|
|
186
|
+
C = await B.validator(g, B.params ?? {}, F);
|
|
194
187
|
else {
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
197
|
-
|
|
188
|
+
const V = Le(B.name);
|
|
189
|
+
if (!V) continue;
|
|
190
|
+
C = await V(g, B.params ?? {}, F);
|
|
198
191
|
}
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
192
|
+
if (C !== !0) {
|
|
193
|
+
const V = B.message ? _e(B.message, B.params ?? {}) : typeof C == "string" ? C : `Validation failed for rule: ${B.name}`;
|
|
194
|
+
if (p.push(V), B.bail) break;
|
|
202
195
|
}
|
|
203
196
|
}
|
|
204
|
-
return
|
|
197
|
+
return u.value[S] = p, p;
|
|
205
198
|
}
|
|
206
|
-
async function
|
|
207
|
-
const
|
|
208
|
-
return
|
|
199
|
+
async function o(S, F) {
|
|
200
|
+
const y = t == null ? void 0 : t.debounce;
|
|
201
|
+
return y && y > 0 ? c(S, y)(S, F) : l(S, F);
|
|
209
202
|
}
|
|
210
|
-
async function r(
|
|
211
|
-
const
|
|
212
|
-
const
|
|
213
|
-
|
|
203
|
+
async function r(S) {
|
|
204
|
+
const F = {}, y = i.value.map(async (v) => {
|
|
205
|
+
const g = await l(v.name, S);
|
|
206
|
+
g.length > 0 && (F[v.name] = g);
|
|
214
207
|
});
|
|
215
|
-
return await Promise.all(
|
|
208
|
+
return await Promise.all(y), u.value = { ...F }, F;
|
|
216
209
|
}
|
|
217
|
-
function
|
|
218
|
-
delete
|
|
210
|
+
function s(S) {
|
|
211
|
+
delete u.value[S];
|
|
219
212
|
}
|
|
220
213
|
function k() {
|
|
221
|
-
|
|
214
|
+
u.value = {};
|
|
222
215
|
}
|
|
223
216
|
return {
|
|
224
|
-
errors:
|
|
225
|
-
validateField:
|
|
217
|
+
errors: u,
|
|
218
|
+
validateField: o,
|
|
226
219
|
validateAll: r,
|
|
227
|
-
clearFieldErrors:
|
|
220
|
+
clearFieldErrors: s,
|
|
228
221
|
clearAllErrors: k
|
|
229
222
|
};
|
|
230
223
|
}
|
|
231
224
|
function We(e) {
|
|
232
225
|
return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
233
226
|
}
|
|
234
|
-
function _e(e,
|
|
235
|
-
return e.replace(/\{(\w+)\}/g, (
|
|
227
|
+
function _e(e, i) {
|
|
228
|
+
return e.replace(/\{(\w+)\}/g, (a, t) => i[t] !== void 0 ? String(i[t]) : `{${t}}`);
|
|
236
229
|
}
|
|
237
|
-
const
|
|
230
|
+
const fe = Symbol("FormaticaContext");
|
|
238
231
|
function Qe(e) {
|
|
239
232
|
switch (e.type) {
|
|
240
233
|
case "tags":
|
|
@@ -254,200 +247,200 @@ function Qe(e) {
|
|
|
254
247
|
return "";
|
|
255
248
|
}
|
|
256
249
|
}
|
|
257
|
-
function
|
|
258
|
-
const
|
|
259
|
-
for (const
|
|
260
|
-
|
|
261
|
-
return
|
|
250
|
+
function be(e) {
|
|
251
|
+
const i = {};
|
|
252
|
+
for (const a of e)
|
|
253
|
+
i[a.name] = a.defaultValue ?? Qe(a);
|
|
254
|
+
return i;
|
|
262
255
|
}
|
|
263
256
|
function Xe(e) {
|
|
264
|
-
const
|
|
265
|
-
for (const
|
|
266
|
-
|
|
267
|
-
return
|
|
257
|
+
const i = {};
|
|
258
|
+
for (const a of e)
|
|
259
|
+
a.translations && (i[a.name] = a.translations);
|
|
260
|
+
return i;
|
|
268
261
|
}
|
|
269
|
-
function et(e,
|
|
270
|
-
const
|
|
271
|
-
let
|
|
272
|
-
const
|
|
273
|
-
function
|
|
274
|
-
return { values: { ...
|
|
262
|
+
function et(e, i) {
|
|
263
|
+
const a = M((i == null ? void 0 : i.locale) ?? "en"), t = (i == null ? void 0 : i.fallbackLocale) ?? "en";
|
|
264
|
+
let u = e;
|
|
265
|
+
const n = M(U(e.fields)), c = ee(be(U(e.fields))), l = ee({}), o = ee({}), r = ee({}), s = M(!1), k = M(0), S = x(() => Object.values(l).every(($) => $.length === 0)), F = x(() => Object.values(r).some(Boolean)), y = Ue();
|
|
266
|
+
function v() {
|
|
267
|
+
return { values: { ...c }, getFieldValue: ($) => c[$] };
|
|
275
268
|
}
|
|
276
|
-
const
|
|
277
|
-
fields:
|
|
278
|
-
values:
|
|
269
|
+
const g = x(() => ({ ...c })), p = Je({
|
|
270
|
+
fields: n,
|
|
271
|
+
values: g,
|
|
279
272
|
settings: e.settings
|
|
280
273
|
});
|
|
281
274
|
Ge({
|
|
282
|
-
locale:
|
|
283
|
-
fallbackLocale:
|
|
284
|
-
fieldTranslations: Xe(
|
|
275
|
+
locale: a,
|
|
276
|
+
fallbackLocale: t,
|
|
277
|
+
fieldTranslations: Xe(U(e.fields)),
|
|
285
278
|
formTranslations: e.translations
|
|
286
279
|
});
|
|
287
|
-
let
|
|
288
|
-
|
|
289
|
-
() => ({ ...
|
|
290
|
-
(
|
|
291
|
-
var
|
|
292
|
-
if (
|
|
293
|
-
for (const
|
|
294
|
-
|
|
295
|
-
field:
|
|
296
|
-
value:
|
|
297
|
-
previousValue:
|
|
298
|
-
}), (
|
|
299
|
-
|
|
280
|
+
let N = be(U(e.fields));
|
|
281
|
+
W(
|
|
282
|
+
() => ({ ...c }),
|
|
283
|
+
($, L) => {
|
|
284
|
+
var E;
|
|
285
|
+
if (L) {
|
|
286
|
+
for (const R of Object.keys($))
|
|
287
|
+
$[R] !== L[R] && (r[R] = !0, y.emit("field:change", {
|
|
288
|
+
field: R,
|
|
289
|
+
value: $[R],
|
|
290
|
+
previousValue: L[R]
|
|
291
|
+
}), (E = e.settings) != null && E.validateOnChange && b(R));
|
|
292
|
+
y.emit("change", { values: $ });
|
|
300
293
|
}
|
|
301
294
|
},
|
|
302
295
|
{ deep: !0 }
|
|
303
296
|
);
|
|
304
|
-
const
|
|
305
|
-
function
|
|
306
|
-
const
|
|
297
|
+
const B = /* @__PURE__ */ new Map();
|
|
298
|
+
function C($) {
|
|
299
|
+
const L = $.name;
|
|
307
300
|
return {
|
|
308
|
-
name:
|
|
301
|
+
name: L,
|
|
309
302
|
value: x({
|
|
310
|
-
get: () =>
|
|
311
|
-
set: (
|
|
312
|
-
|
|
303
|
+
get: () => c[L],
|
|
304
|
+
set: (E) => {
|
|
305
|
+
c[L] = E;
|
|
313
306
|
}
|
|
314
307
|
}),
|
|
315
|
-
errors: x(() => l[
|
|
308
|
+
errors: x(() => l[L] ?? []),
|
|
316
309
|
touched: x({
|
|
317
|
-
get: () =>
|
|
318
|
-
set: (
|
|
319
|
-
|
|
310
|
+
get: () => o[L] ?? !1,
|
|
311
|
+
set: (E) => {
|
|
312
|
+
o[L] = E;
|
|
320
313
|
}
|
|
321
314
|
}),
|
|
322
315
|
dirty: x({
|
|
323
|
-
get: () => r[
|
|
324
|
-
set: (
|
|
325
|
-
r[
|
|
316
|
+
get: () => r[L] ?? !1,
|
|
317
|
+
set: (E) => {
|
|
318
|
+
r[L] = E;
|
|
326
319
|
}
|
|
327
320
|
}),
|
|
328
321
|
disabled: x(
|
|
329
|
-
() => typeof
|
|
322
|
+
() => typeof $.disabled == "function" ? $.disabled(v()) : $.disabled ?? !1
|
|
330
323
|
),
|
|
331
|
-
visible: x(() =>
|
|
332
|
-
schema:
|
|
333
|
-
validate: () =>
|
|
324
|
+
visible: x(() => $.condition ? ie($.condition, c) : typeof $.visible == "function" ? $.visible(v()) : $.visible ?? !0),
|
|
325
|
+
schema: $,
|
|
326
|
+
validate: () => b(L),
|
|
334
327
|
reset: () => {
|
|
335
|
-
|
|
328
|
+
c[L] = N[L] ?? null, delete l[L], o[L] = !1, r[L] = !1;
|
|
336
329
|
},
|
|
337
330
|
clear: () => {
|
|
338
|
-
|
|
331
|
+
c[L] = null, delete l[L];
|
|
339
332
|
}
|
|
340
333
|
};
|
|
341
334
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
344
|
-
for (const
|
|
345
|
-
|
|
335
|
+
function V() {
|
|
336
|
+
B.clear();
|
|
337
|
+
for (const $ of U(u.fields))
|
|
338
|
+
B.set($.name, C($));
|
|
346
339
|
}
|
|
347
|
-
|
|
348
|
-
async function
|
|
349
|
-
const
|
|
350
|
-
return l[
|
|
351
|
-
field:
|
|
352
|
-
valid:
|
|
353
|
-
errors:
|
|
354
|
-
}),
|
|
340
|
+
V();
|
|
341
|
+
async function b($) {
|
|
342
|
+
const L = await p.validateField($, v());
|
|
343
|
+
return l[$] = L, y.emit("validate:field", {
|
|
344
|
+
field: $,
|
|
345
|
+
valid: L.length === 0,
|
|
346
|
+
errors: L
|
|
347
|
+
}), L;
|
|
355
348
|
}
|
|
356
|
-
async function
|
|
357
|
-
const
|
|
358
|
-
for (const
|
|
359
|
-
|
|
360
|
-
for (const [
|
|
361
|
-
l[
|
|
362
|
-
const
|
|
363
|
-
return
|
|
349
|
+
async function m() {
|
|
350
|
+
const $ = await p.validateAll(v());
|
|
351
|
+
for (const E of Object.keys(l))
|
|
352
|
+
E in $ || delete l[E];
|
|
353
|
+
for (const [E, R] of Object.entries($))
|
|
354
|
+
l[E] = R;
|
|
355
|
+
const L = Object.values($).every((E) => E.length === 0);
|
|
356
|
+
return y.emit("validate", { valid: L, errors: { ...$ } }), L;
|
|
364
357
|
}
|
|
365
|
-
async function
|
|
366
|
-
|
|
358
|
+
async function w($) {
|
|
359
|
+
s.value = !0, k.value += 1;
|
|
367
360
|
try {
|
|
368
|
-
for (const
|
|
369
|
-
if (!await
|
|
370
|
-
|
|
371
|
-
values: { ...
|
|
361
|
+
for (const E of U(u.fields)) o[E.name] = !0;
|
|
362
|
+
if (!await m()) {
|
|
363
|
+
y.emit("submit:error", {
|
|
364
|
+
values: { ...c },
|
|
372
365
|
error: new Error("Validation failed")
|
|
373
366
|
});
|
|
374
367
|
return;
|
|
375
368
|
}
|
|
376
|
-
|
|
377
|
-
} catch (
|
|
378
|
-
throw
|
|
369
|
+
y.emit("submit", { values: { ...c } }), $ && await $({ ...c }, v()), y.emit("submit:success", { values: { ...c }, result: void 0 });
|
|
370
|
+
} catch (L) {
|
|
371
|
+
throw y.emit("submit:error", { values: { ...c }, error: L }), L;
|
|
379
372
|
} finally {
|
|
380
|
-
|
|
373
|
+
s.value = !1;
|
|
381
374
|
}
|
|
382
375
|
}
|
|
383
|
-
function
|
|
384
|
-
for (const
|
|
385
|
-
|
|
386
|
-
|
|
376
|
+
function D() {
|
|
377
|
+
for (const $ of U(u.fields))
|
|
378
|
+
c[$.name] = N[$.name] ?? null, delete l[$.name], o[$.name] = !1, r[$.name] = !1;
|
|
379
|
+
p.clearAllErrors(), y.emit("reset", void 0);
|
|
387
380
|
}
|
|
388
|
-
function
|
|
389
|
-
for (const
|
|
390
|
-
|
|
391
|
-
|
|
381
|
+
function P() {
|
|
382
|
+
for (const $ of U(u.fields))
|
|
383
|
+
c[$.name] = null, delete l[$.name];
|
|
384
|
+
p.clearAllErrors();
|
|
392
385
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
for (const
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
for (const
|
|
401
|
-
|
|
402
|
-
|
|
386
|
+
function re($) {
|
|
387
|
+
u = $;
|
|
388
|
+
const L = U($.fields);
|
|
389
|
+
n.value = L, N = be(L);
|
|
390
|
+
for (const R of L)
|
|
391
|
+
R.name in c || (c[R.name] = R.defaultValue ?? null);
|
|
392
|
+
const E = new Set(L.map((R) => R.name));
|
|
393
|
+
for (const R of Object.keys(c))
|
|
394
|
+
E.has(R) || (delete c[R], delete l[R], delete o[R], delete r[R]);
|
|
395
|
+
V();
|
|
403
396
|
}
|
|
404
|
-
const
|
|
405
|
-
values:
|
|
397
|
+
const se = {
|
|
398
|
+
values: c,
|
|
406
399
|
errors: l,
|
|
407
|
-
touched:
|
|
400
|
+
touched: o,
|
|
408
401
|
dirty: r,
|
|
409
|
-
isValid:
|
|
410
|
-
isDirty:
|
|
411
|
-
isSubmitting:
|
|
402
|
+
isValid: S,
|
|
403
|
+
isDirty: F,
|
|
404
|
+
isSubmitting: s,
|
|
412
405
|
submitCount: k,
|
|
413
|
-
validate:
|
|
414
|
-
validateField:
|
|
415
|
-
submit:
|
|
416
|
-
reset:
|
|
417
|
-
clear:
|
|
418
|
-
setError: (
|
|
419
|
-
l[
|
|
406
|
+
validate: m,
|
|
407
|
+
validateField: b,
|
|
408
|
+
submit: w,
|
|
409
|
+
reset: D,
|
|
410
|
+
clear: P,
|
|
411
|
+
setError: ($, L) => {
|
|
412
|
+
l[$] = L;
|
|
420
413
|
},
|
|
421
|
-
clearError: (
|
|
422
|
-
delete l[
|
|
414
|
+
clearError: ($) => {
|
|
415
|
+
delete l[$], p.clearFieldErrors($);
|
|
423
416
|
},
|
|
424
417
|
clearErrors: () => {
|
|
425
|
-
for (const
|
|
426
|
-
|
|
418
|
+
for (const $ of Object.keys(l)) delete l[$];
|
|
419
|
+
p.clearAllErrors();
|
|
427
420
|
},
|
|
428
|
-
getField: (
|
|
429
|
-
setFieldValue: (
|
|
430
|
-
|
|
421
|
+
getField: ($) => B.get($),
|
|
422
|
+
setFieldValue: ($, L) => {
|
|
423
|
+
c[$] = L;
|
|
431
424
|
},
|
|
432
|
-
setFieldDisabled: (
|
|
433
|
-
const
|
|
434
|
-
|
|
425
|
+
setFieldDisabled: ($, L) => {
|
|
426
|
+
const E = U(u.fields).find((R) => R.name === $);
|
|
427
|
+
E && (E.disabled = L);
|
|
435
428
|
},
|
|
436
|
-
setFieldVisible: (
|
|
437
|
-
const
|
|
438
|
-
|
|
429
|
+
setFieldVisible: ($, L) => {
|
|
430
|
+
const E = U(u.fields).find((R) => R.name === $);
|
|
431
|
+
E && (E.visible = L);
|
|
439
432
|
},
|
|
440
|
-
on:
|
|
441
|
-
locale:
|
|
442
|
-
setLocale: (
|
|
443
|
-
|
|
433
|
+
on: y.on,
|
|
434
|
+
locale: a,
|
|
435
|
+
setLocale: ($) => {
|
|
436
|
+
a.value = $;
|
|
444
437
|
},
|
|
445
|
-
schema:
|
|
446
|
-
updateSchema:
|
|
438
|
+
schema: u,
|
|
439
|
+
updateSchema: re
|
|
447
440
|
};
|
|
448
|
-
return
|
|
441
|
+
return ue(fe, se), se;
|
|
449
442
|
}
|
|
450
|
-
const
|
|
443
|
+
const ge = Symbol("FormaticaTheme"), ve = {
|
|
451
444
|
name: "default",
|
|
452
445
|
colors: {
|
|
453
446
|
primary: "#3b82f6",
|
|
@@ -500,51 +493,51 @@ const pe = Symbol("FormaticaTheme"), be = {
|
|
|
500
493
|
}
|
|
501
494
|
};
|
|
502
495
|
function tt(e) {
|
|
503
|
-
const
|
|
504
|
-
const
|
|
496
|
+
const i = Ne(e) ? x(() => e.value ?? ve) : M(e ?? ve), a = x(() => {
|
|
497
|
+
const n = i.value.components ?? {};
|
|
505
498
|
return {
|
|
506
|
-
form:
|
|
507
|
-
field:
|
|
508
|
-
label:
|
|
509
|
-
input:
|
|
510
|
-
error:
|
|
511
|
-
helpText:
|
|
512
|
-
group:
|
|
513
|
-
row:
|
|
514
|
-
steps:
|
|
515
|
-
tabs:
|
|
516
|
-
button:
|
|
499
|
+
form: n.form ?? "fc-form",
|
|
500
|
+
field: n.field ?? "fc-field",
|
|
501
|
+
label: n.label ?? "fc-label",
|
|
502
|
+
input: n.input ?? "fc-input",
|
|
503
|
+
error: n.error ?? "fc-error",
|
|
504
|
+
helpText: n.helpText ?? "fc-help-text",
|
|
505
|
+
group: n.group ?? "fc-group",
|
|
506
|
+
row: n.row ?? "fc-row",
|
|
507
|
+
steps: n.steps ?? "fc-steps",
|
|
508
|
+
tabs: n.tabs ?? "fc-tabs",
|
|
509
|
+
button: n.button ?? "fc-button"
|
|
517
510
|
};
|
|
518
|
-
}),
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
for (const [l,
|
|
522
|
-
|
|
523
|
-
if (
|
|
524
|
-
for (const [l,
|
|
525
|
-
|
|
526
|
-
if (
|
|
527
|
-
for (const [l,
|
|
528
|
-
|
|
529
|
-
if (
|
|
530
|
-
for (const [l,
|
|
531
|
-
|
|
532
|
-
if (
|
|
533
|
-
for (const [l,
|
|
534
|
-
|
|
535
|
-
if (
|
|
536
|
-
for (const [l,
|
|
537
|
-
|
|
538
|
-
return
|
|
539
|
-
}),
|
|
540
|
-
config:
|
|
541
|
-
classes:
|
|
542
|
-
cssVars:
|
|
511
|
+
}), t = x(() => {
|
|
512
|
+
const n = i.value, c = {};
|
|
513
|
+
if (n.colors)
|
|
514
|
+
for (const [l, o] of Object.entries(n.colors))
|
|
515
|
+
o && (c[`--fc-color-${X(l)}`] = o);
|
|
516
|
+
if (n.typography)
|
|
517
|
+
for (const [l, o] of Object.entries(n.typography))
|
|
518
|
+
o && (c[`--fc-${X(l)}`] = o);
|
|
519
|
+
if (n.spacing)
|
|
520
|
+
for (const [l, o] of Object.entries(n.spacing))
|
|
521
|
+
o && (c[`--fc-${X(l)}`] = o);
|
|
522
|
+
if (n.borders)
|
|
523
|
+
for (const [l, o] of Object.entries(n.borders))
|
|
524
|
+
o && (c[`--fc-border-${X(l)}`] = o);
|
|
525
|
+
if (n.shadows)
|
|
526
|
+
for (const [l, o] of Object.entries(n.shadows))
|
|
527
|
+
o && (c[`--fc-shadow-${X(l)}`] = o);
|
|
528
|
+
if (n.transitions)
|
|
529
|
+
for (const [l, o] of Object.entries(n.transitions))
|
|
530
|
+
o && (c[`--fc-transition-${X(l)}`] = o);
|
|
531
|
+
return n.cssVars && Object.assign(c, n.cssVars), c;
|
|
532
|
+
}), u = {
|
|
533
|
+
config: i.value,
|
|
534
|
+
classes: a,
|
|
535
|
+
cssVars: t
|
|
543
536
|
};
|
|
544
|
-
return
|
|
537
|
+
return ue(ge, u), u;
|
|
545
538
|
}
|
|
546
539
|
function K() {
|
|
547
|
-
const e =
|
|
540
|
+
const e = Y(ge);
|
|
548
541
|
return e || at();
|
|
549
542
|
}
|
|
550
543
|
function at() {
|
|
@@ -560,12 +553,22 @@ function at() {
|
|
|
560
553
|
steps: "fc-steps",
|
|
561
554
|
tabs: "fc-tabs",
|
|
562
555
|
button: "fc-button"
|
|
563
|
-
})),
|
|
564
|
-
return { config:
|
|
556
|
+
})), i = x(() => ({}));
|
|
557
|
+
return { config: ve, classes: e, cssVars: i };
|
|
565
558
|
}
|
|
566
559
|
function X(e) {
|
|
567
560
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
568
561
|
}
|
|
562
|
+
const Te = Symbol("Formatica");
|
|
563
|
+
function Tl(e = {}) {
|
|
564
|
+
return {
|
|
565
|
+
install(i) {
|
|
566
|
+
if (i.provide(Te, ee(e)), e.components)
|
|
567
|
+
for (const [a, t] of Object.entries(e.components))
|
|
568
|
+
Fe(a, t);
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
569
572
|
const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disabled", "onClick", "onKeydown"], ot = {
|
|
570
573
|
key: 0,
|
|
571
574
|
class: "h-3 w-3",
|
|
@@ -585,69 +588,69 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
585
588
|
maxSelect: {}
|
|
586
589
|
},
|
|
587
590
|
emits: ["update:modelValue", "blur"],
|
|
588
|
-
setup(e, { emit:
|
|
589
|
-
const
|
|
591
|
+
setup(e, { emit: i }) {
|
|
592
|
+
const a = e, t = i;
|
|
590
593
|
K();
|
|
591
|
-
function
|
|
592
|
-
return
|
|
593
|
-
}
|
|
594
|
-
function o
|
|
595
|
-
return !!(
|
|
596
|
-
}
|
|
597
|
-
function
|
|
598
|
-
if (o
|
|
599
|
-
const r = [...
|
|
600
|
-
if (
|
|
601
|
-
if (
|
|
602
|
-
r.splice(
|
|
594
|
+
function u(o) {
|
|
595
|
+
return a.modelValue.includes(o);
|
|
596
|
+
}
|
|
597
|
+
function n(o) {
|
|
598
|
+
return !!(a.disabled || o.disabled || a.maxSelect && !u(o.value) && a.modelValue.length >= a.maxSelect);
|
|
599
|
+
}
|
|
600
|
+
function c(o) {
|
|
601
|
+
if (n(o)) return;
|
|
602
|
+
const r = [...a.modelValue], s = r.indexOf(o.value);
|
|
603
|
+
if (s >= 0) {
|
|
604
|
+
if (a.minSelect && r.length <= a.minSelect) return;
|
|
605
|
+
r.splice(s, 1);
|
|
603
606
|
} else
|
|
604
|
-
r.push(
|
|
605
|
-
|
|
607
|
+
r.push(o.value);
|
|
608
|
+
t("update:modelValue", r);
|
|
606
609
|
}
|
|
607
|
-
function l(
|
|
608
|
-
(
|
|
610
|
+
function l(o, r) {
|
|
611
|
+
(o.key === " " || o.key === "Enter") && (o.preventDefault(), c(r));
|
|
609
612
|
}
|
|
610
|
-
return (
|
|
613
|
+
return (o, r) => (d(), f("div", {
|
|
611
614
|
role: "group",
|
|
612
|
-
class:
|
|
615
|
+
class: T(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
|
|
613
616
|
}, [
|
|
614
|
-
(
|
|
615
|
-
key: String(
|
|
616
|
-
class:
|
|
617
|
+
(d(!0), f(z, null, G(e.options, (s) => (d(), f("label", {
|
|
618
|
+
key: String(s.value),
|
|
619
|
+
class: T([
|
|
617
620
|
"inline-flex items-center gap-2 select-none",
|
|
618
|
-
|
|
621
|
+
n(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
619
622
|
])
|
|
620
623
|
}, [
|
|
621
|
-
|
|
624
|
+
h("input", {
|
|
622
625
|
type: "checkbox",
|
|
623
|
-
checked: s
|
|
624
|
-
disabled:
|
|
626
|
+
checked: u(s.value),
|
|
627
|
+
disabled: n(s),
|
|
625
628
|
class: "sr-only",
|
|
626
|
-
onChange: (k) =>
|
|
627
|
-
onBlur: r[0] || (r[0] = (k) =>
|
|
629
|
+
onChange: (k) => c(s),
|
|
630
|
+
onBlur: r[0] || (r[0] = (k) => t("blur", k))
|
|
628
631
|
}, null, 40, lt),
|
|
629
|
-
|
|
632
|
+
h("div", {
|
|
630
633
|
role: "checkbox",
|
|
631
|
-
"aria-checked": s
|
|
632
|
-
"aria-disabled":
|
|
634
|
+
"aria-checked": u(s.value),
|
|
635
|
+
"aria-disabled": n(s) || void 0,
|
|
633
636
|
tabindex: "0",
|
|
634
|
-
class:
|
|
637
|
+
class: T([
|
|
635
638
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
|
|
636
|
-
s
|
|
639
|
+
u(s.value) ? "text-white" : "border-gray-300 bg-white"
|
|
637
640
|
]),
|
|
638
|
-
style:
|
|
639
|
-
onClick: (k) =>
|
|
640
|
-
onKeydown: (k) => l(k,
|
|
641
|
+
style: O(u(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
642
|
+
onClick: (k) => c(s),
|
|
643
|
+
onKeydown: (k) => l(k, s)
|
|
641
644
|
}, [
|
|
642
|
-
s
|
|
643
|
-
|
|
645
|
+
u(s.value) ? (d(), f("svg", ot, [...r[1] || (r[1] = [
|
|
646
|
+
h("path", {
|
|
644
647
|
d: "M2 6l3 3 5-5",
|
|
645
648
|
"stroke-linecap": "round",
|
|
646
649
|
"stroke-linejoin": "round"
|
|
647
650
|
}, null, -1)
|
|
648
|
-
])])) :
|
|
651
|
+
])])) : I("", !0)
|
|
649
652
|
], 46, nt),
|
|
650
|
-
|
|
653
|
+
h("span", rt, A(s.label), 1)
|
|
651
654
|
], 2))), 128))
|
|
652
655
|
], 2));
|
|
653
656
|
}
|
|
@@ -670,52 +673,52 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
670
673
|
disabled: { type: Boolean, default: !1 }
|
|
671
674
|
},
|
|
672
675
|
emits: ["update:modelValue", "blur"],
|
|
673
|
-
setup(e, { emit:
|
|
674
|
-
const
|
|
676
|
+
setup(e, { emit: i }) {
|
|
677
|
+
const a = e, t = i;
|
|
675
678
|
K();
|
|
676
|
-
const
|
|
679
|
+
const u = x(() => [
|
|
677
680
|
"inline-flex items-center gap-2 select-none",
|
|
678
|
-
|
|
681
|
+
a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
679
682
|
]);
|
|
680
|
-
function
|
|
681
|
-
|
|
683
|
+
function n() {
|
|
684
|
+
a.disabled || t("update:modelValue", !a.modelValue);
|
|
682
685
|
}
|
|
683
|
-
function
|
|
684
|
-
(l.key === " " || l.key === "Enter") && (l.preventDefault(),
|
|
686
|
+
function c(l) {
|
|
687
|
+
(l.key === " " || l.key === "Enter") && (l.preventDefault(), n());
|
|
685
688
|
}
|
|
686
|
-
return (l,
|
|
687
|
-
class:
|
|
689
|
+
return (l, o) => (d(), f("label", {
|
|
690
|
+
class: T(u.value)
|
|
688
691
|
}, [
|
|
689
|
-
|
|
692
|
+
h("input", {
|
|
690
693
|
type: "checkbox",
|
|
691
694
|
checked: e.modelValue,
|
|
692
695
|
disabled: e.disabled,
|
|
693
696
|
class: "sr-only",
|
|
694
|
-
onChange:
|
|
695
|
-
onBlur:
|
|
697
|
+
onChange: n,
|
|
698
|
+
onBlur: o[0] || (o[0] = (r) => t("blur", r))
|
|
696
699
|
}, null, 40, it),
|
|
697
|
-
|
|
700
|
+
h("div", {
|
|
698
701
|
role: "checkbox",
|
|
699
702
|
"aria-checked": e.modelValue,
|
|
700
703
|
"aria-disabled": e.disabled || void 0,
|
|
701
704
|
tabindex: "0",
|
|
702
|
-
class:
|
|
705
|
+
class: T([
|
|
703
706
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
|
|
704
707
|
e.modelValue ? "text-white" : "border-gray-300 bg-white"
|
|
705
708
|
]),
|
|
706
|
-
style:
|
|
707
|
-
onClick:
|
|
708
|
-
onKeydown:
|
|
709
|
+
style: O(e.modelValue ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
710
|
+
onClick: n,
|
|
711
|
+
onKeydown: c
|
|
709
712
|
}, [
|
|
710
|
-
e.modelValue ? (
|
|
711
|
-
|
|
713
|
+
e.modelValue ? (d(), f("svg", dt, [...o[1] || (o[1] = [
|
|
714
|
+
h("path", {
|
|
712
715
|
d: "M2 6l3 3 5-5",
|
|
713
716
|
"stroke-linecap": "round",
|
|
714
717
|
"stroke-linejoin": "round"
|
|
715
718
|
}, null, -1)
|
|
716
|
-
])])) :
|
|
719
|
+
])])) : I("", !0)
|
|
717
720
|
], 46, ut),
|
|
718
|
-
e.checkboxLabel ? (
|
|
721
|
+
e.checkboxLabel ? (d(), f("span", ct, A(e.checkboxLabel), 1)) : I("", !0)
|
|
719
722
|
], 2));
|
|
720
723
|
}
|
|
721
724
|
}), mt = ["value", "min", "max", "placeholder", "disabled", "aria-disabled"], bt = /* @__PURE__ */ j({
|
|
@@ -729,40 +732,40 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
729
732
|
disabled: { type: Boolean, default: !1 }
|
|
730
733
|
},
|
|
731
734
|
emits: ["update:modelValue", "blur", "focus"],
|
|
732
|
-
setup(e, { emit:
|
|
733
|
-
const
|
|
735
|
+
setup(e, { emit: i }) {
|
|
736
|
+
const a = e, t = i, u = K(), n = x(
|
|
734
737
|
() => [
|
|
735
738
|
"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
|
|
736
739
|
"focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input",
|
|
737
740
|
"transition-colors duration-200",
|
|
738
|
-
|
|
739
|
-
|
|
741
|
+
a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
|
|
742
|
+
u.classes.value.input
|
|
740
743
|
].filter(Boolean).join(" ")
|
|
741
744
|
);
|
|
742
|
-
function
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
+
function c(l) {
|
|
746
|
+
const o = l.target;
|
|
747
|
+
t("update:modelValue", o.value);
|
|
745
748
|
}
|
|
746
|
-
return (l,
|
|
749
|
+
return (l, o) => (d(), f("input", {
|
|
747
750
|
type: "date",
|
|
748
751
|
value: e.modelValue,
|
|
749
752
|
min: e.minDate,
|
|
750
753
|
max: e.maxDate,
|
|
751
754
|
placeholder: e.placeholder,
|
|
752
755
|
disabled: e.disabled,
|
|
753
|
-
class:
|
|
756
|
+
class: T(n.value),
|
|
754
757
|
"aria-disabled": e.disabled || void 0,
|
|
755
|
-
onInput:
|
|
756
|
-
onBlur:
|
|
757
|
-
onFocus:
|
|
758
|
+
onInput: c,
|
|
759
|
+
onBlur: o[0] || (o[0] = (r) => t("blur", r)),
|
|
760
|
+
onFocus: o[1] || (o[1] = (r) => t("focus", r))
|
|
758
761
|
}, null, 42, mt));
|
|
759
762
|
}
|
|
760
|
-
}),
|
|
761
|
-
const
|
|
762
|
-
for (const [
|
|
763
|
-
t
|
|
764
|
-
return
|
|
765
|
-
}, vt = /* @__PURE__ */
|
|
763
|
+
}), ne = (e, i) => {
|
|
764
|
+
const a = e.__vccOpts || e;
|
|
765
|
+
for (const [t, u] of i)
|
|
766
|
+
a[t] = u;
|
|
767
|
+
return a;
|
|
768
|
+
}, vt = /* @__PURE__ */ ne(bt, [["__scopeId", "data-v-7d4bc9b7"]]), yt = ["aria-disabled", "onKeydown"], pt = {
|
|
766
769
|
key: 0,
|
|
767
770
|
class: "mt-1 text-xs text-gray-400"
|
|
768
771
|
}, gt = ["accept", "multiple"], ht = {
|
|
@@ -779,76 +782,76 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
779
782
|
disabled: { type: Boolean, default: !1 }
|
|
780
783
|
},
|
|
781
784
|
emits: ["update:modelValue", "blur"],
|
|
782
|
-
setup(e, { emit:
|
|
783
|
-
const
|
|
785
|
+
setup(e, { emit: i }) {
|
|
786
|
+
const a = e, t = i;
|
|
784
787
|
K();
|
|
785
|
-
const
|
|
786
|
-
function l(
|
|
787
|
-
return
|
|
788
|
-
}
|
|
789
|
-
function
|
|
790
|
-
let
|
|
791
|
-
if (
|
|
792
|
-
const
|
|
793
|
-
|
|
788
|
+
const u = M(null), n = M(!1), c = x(() => a.modelValue ? Array.isArray(a.modelValue) ? a.modelValue : [a.modelValue] : []);
|
|
789
|
+
function l(g) {
|
|
790
|
+
return g < 1024 ? `${g} B` : g < 1024 * 1024 ? `${(g / 1024).toFixed(1)} KB` : `${(g / (1024 * 1024)).toFixed(1)} MB`;
|
|
791
|
+
}
|
|
792
|
+
function o(g) {
|
|
793
|
+
let p = g;
|
|
794
|
+
if (a.maxSize) {
|
|
795
|
+
const N = a.maxSize;
|
|
796
|
+
p = p.filter((B) => B.size <= N);
|
|
794
797
|
}
|
|
795
|
-
if (
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
+
if (a.multiple && a.maxFiles) {
|
|
799
|
+
const N = a.maxFiles - c.value.length;
|
|
800
|
+
p = p.slice(0, Math.max(0, N));
|
|
798
801
|
}
|
|
799
|
-
return
|
|
802
|
+
return p;
|
|
800
803
|
}
|
|
801
|
-
function r(
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
+
function r(g) {
|
|
805
|
+
const p = o(g);
|
|
806
|
+
p.length !== 0 && (a.multiple ? t("update:modelValue", [...c.value, ...p]) : t("update:modelValue", p[0] ?? null));
|
|
804
807
|
}
|
|
805
|
-
function
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
+
function s(g) {
|
|
809
|
+
const p = g.target;
|
|
810
|
+
p.files && (r(Array.from(p.files)), p.value = "");
|
|
808
811
|
}
|
|
809
|
-
function k(
|
|
810
|
-
if (
|
|
811
|
-
const
|
|
812
|
-
|
|
812
|
+
function k(g) {
|
|
813
|
+
if (a.disabled) return;
|
|
814
|
+
const p = c.value.filter((N, B) => B !== g);
|
|
815
|
+
a.multiple ? t("update:modelValue", p.length ? p : []) : t("update:modelValue", null);
|
|
813
816
|
}
|
|
814
|
-
function g
|
|
815
|
-
|
|
817
|
+
function S(g) {
|
|
818
|
+
g.preventDefault(), a.disabled || (n.value = !0);
|
|
816
819
|
}
|
|
817
|
-
function
|
|
818
|
-
|
|
820
|
+
function F() {
|
|
821
|
+
n.value = !1;
|
|
819
822
|
}
|
|
820
|
-
function
|
|
821
|
-
var
|
|
822
|
-
|
|
823
|
+
function y(g) {
|
|
824
|
+
var p;
|
|
825
|
+
g.preventDefault(), n.value = !1, !(a.disabled || !((p = g.dataTransfer) != null && p.files)) && r(Array.from(g.dataTransfer.files));
|
|
823
826
|
}
|
|
824
|
-
function
|
|
825
|
-
var
|
|
826
|
-
|
|
827
|
+
function v() {
|
|
828
|
+
var g;
|
|
829
|
+
a.disabled || (g = u.value) == null || g.click();
|
|
827
830
|
}
|
|
828
|
-
return (
|
|
829
|
-
class:
|
|
831
|
+
return (g, p) => (d(), f("div", {
|
|
832
|
+
class: T(e.disabled ? "opacity-50 cursor-not-allowed" : "")
|
|
830
833
|
}, [
|
|
831
|
-
|
|
834
|
+
h("div", {
|
|
832
835
|
role: "button",
|
|
833
836
|
tabindex: "0",
|
|
834
837
|
"aria-disabled": e.disabled || void 0,
|
|
835
|
-
class:
|
|
838
|
+
class: T([
|
|
836
839
|
"flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",
|
|
837
|
-
|
|
840
|
+
n.value ? "" : "border-gray-300 bg-gray-50",
|
|
838
841
|
e.disabled ? "pointer-events-none" : "cursor-pointer hover:border-gray-400"
|
|
839
842
|
]),
|
|
840
|
-
style:
|
|
841
|
-
onClick:
|
|
843
|
+
style: O(n.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)" } : {}),
|
|
844
|
+
onClick: v,
|
|
842
845
|
onKeydown: [
|
|
843
|
-
he(
|
|
844
|
-
he(
|
|
846
|
+
he(v, ["enter"]),
|
|
847
|
+
he(J(v, ["prevent"]), ["space"])
|
|
845
848
|
],
|
|
846
|
-
onDragover:
|
|
847
|
-
onDragleave:
|
|
848
|
-
onDrop:
|
|
849
|
-
onBlur:
|
|
849
|
+
onDragover: S,
|
|
850
|
+
onDragleave: F,
|
|
851
|
+
onDrop: y,
|
|
852
|
+
onBlur: p[0] || (p[0] = (N) => t("blur", N))
|
|
850
853
|
}, [
|
|
851
|
-
|
|
854
|
+
p[1] || (p[1] = h("svg", {
|
|
852
855
|
class: "mb-2 h-8 w-8 text-gray-400",
|
|
853
856
|
fill: "none",
|
|
854
857
|
viewBox: "0 0 24 24",
|
|
@@ -856,37 +859,37 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
856
859
|
"stroke-width": "1.5",
|
|
857
860
|
"aria-hidden": "true"
|
|
858
861
|
}, [
|
|
859
|
-
|
|
862
|
+
h("path", {
|
|
860
863
|
"stroke-linecap": "round",
|
|
861
864
|
"stroke-linejoin": "round",
|
|
862
865
|
d: "M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"
|
|
863
866
|
})
|
|
864
867
|
], -1)),
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
+
p[2] || (p[2] = h("p", { class: "text-sm text-gray-600" }, [
|
|
869
|
+
Q(" Drop files here or "),
|
|
870
|
+
h("span", {
|
|
868
871
|
class: "font-medium",
|
|
869
872
|
style: { color: "var(--fc-color-primary, #3b82f6)" }
|
|
870
873
|
}, "browse")
|
|
871
874
|
], -1)),
|
|
872
|
-
e.accept ? (
|
|
875
|
+
e.accept ? (d(), f("p", pt, "Accepted: " + A(e.accept), 1)) : I("", !0)
|
|
873
876
|
], 46, yt),
|
|
874
|
-
|
|
877
|
+
h("input", {
|
|
875
878
|
ref_key: "fileInputRef",
|
|
876
|
-
ref:
|
|
879
|
+
ref: u,
|
|
877
880
|
type: "file",
|
|
878
881
|
accept: e.accept,
|
|
879
882
|
multiple: e.multiple,
|
|
880
883
|
class: "hidden",
|
|
881
|
-
onChange:
|
|
884
|
+
onChange: s
|
|
882
885
|
}, null, 40, gt),
|
|
883
|
-
|
|
884
|
-
(
|
|
885
|
-
key: `${
|
|
886
|
+
c.value.length > 0 ? (d(), f("ul", ht, [
|
|
887
|
+
(d(!0), f(z, null, G(c.value, (N, B) => (d(), f("li", {
|
|
888
|
+
key: `${N.name}-${B}`,
|
|
886
889
|
class: "flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"
|
|
887
890
|
}, [
|
|
888
|
-
|
|
889
|
-
|
|
891
|
+
h("div", xt, [
|
|
892
|
+
p[3] || (p[3] = h("svg", {
|
|
890
893
|
class: "h-4 w-4 shrink-0 text-gray-400",
|
|
891
894
|
fill: "none",
|
|
892
895
|
viewBox: "0 0 24 24",
|
|
@@ -894,24 +897,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
894
897
|
"stroke-width": "2",
|
|
895
898
|
"aria-hidden": "true"
|
|
896
899
|
}, [
|
|
897
|
-
|
|
900
|
+
h("path", {
|
|
898
901
|
"stroke-linecap": "round",
|
|
899
902
|
"stroke-linejoin": "round",
|
|
900
903
|
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
901
904
|
})
|
|
902
905
|
], -1)),
|
|
903
|
-
|
|
904
|
-
|
|
906
|
+
h("span", kt, A(N.name), 1),
|
|
907
|
+
h("span", wt, "(" + A(l(N.size)) + ")", 1)
|
|
905
908
|
]),
|
|
906
|
-
e.disabled ?
|
|
909
|
+
e.disabled ? I("", !0) : (d(), f("button", {
|
|
907
910
|
key: 0,
|
|
908
911
|
type: "button",
|
|
909
912
|
class: "ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200",
|
|
910
913
|
"aria-label": "Remove file",
|
|
911
|
-
onClick:
|
|
914
|
+
onClick: J((C) => k(B), ["stop"])
|
|
912
915
|
}, " × ", 8, $t))
|
|
913
916
|
]))), 128))
|
|
914
|
-
])) :
|
|
917
|
+
])) : I("", !0)
|
|
915
918
|
], 2));
|
|
916
919
|
}
|
|
917
920
|
}), Vt = {
|
|
@@ -937,31 +940,31 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
937
940
|
readonly: { type: Boolean, default: !1 }
|
|
938
941
|
},
|
|
939
942
|
emits: ["update:modelValue", "blur", "focus"],
|
|
940
|
-
setup(e, { emit:
|
|
941
|
-
const
|
|
943
|
+
setup(e, { emit: i }) {
|
|
944
|
+
const a = e, t = i, u = K(), n = x(() => !!a.prefix || !!a.suffix), c = x(
|
|
942
945
|
() => [
|
|
943
946
|
"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
|
|
944
947
|
"placeholder:text-gray-400",
|
|
945
948
|
"focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input",
|
|
946
949
|
"transition-colors duration-200",
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
950
|
+
a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
|
|
951
|
+
a.prefix ? "rounded-l-none" : "",
|
|
952
|
+
a.suffix ? "rounded-r-none" : "",
|
|
953
|
+
u.classes.value.input
|
|
951
954
|
].filter(Boolean).join(" ")
|
|
952
955
|
);
|
|
953
|
-
function l(
|
|
954
|
-
const
|
|
955
|
-
if (
|
|
956
|
-
|
|
956
|
+
function l(o) {
|
|
957
|
+
const s = o.target.value;
|
|
958
|
+
if (s === "") {
|
|
959
|
+
t("update:modelValue", null);
|
|
957
960
|
return;
|
|
958
961
|
}
|
|
959
|
-
let k = parseFloat(
|
|
960
|
-
Number.isNaN(k) || (
|
|
962
|
+
let k = parseFloat(s);
|
|
963
|
+
Number.isNaN(k) || (a.precision !== void 0 && (k = parseFloat(k.toFixed(a.precision))), t("update:modelValue", k));
|
|
961
964
|
}
|
|
962
|
-
return (
|
|
963
|
-
e.prefix ? (
|
|
964
|
-
|
|
965
|
+
return (o, r) => n.value ? (d(), f("div", Vt, [
|
|
966
|
+
e.prefix ? (d(), f("span", St, A(e.prefix), 1)) : I("", !0),
|
|
967
|
+
h("input", {
|
|
965
968
|
type: "number",
|
|
966
969
|
value: e.modelValue ?? "",
|
|
967
970
|
min: e.min,
|
|
@@ -969,15 +972,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
969
972
|
step: e.step,
|
|
970
973
|
disabled: e.disabled,
|
|
971
974
|
readonly: e.readonly,
|
|
972
|
-
class:
|
|
975
|
+
class: T(c.value),
|
|
973
976
|
"aria-disabled": e.disabled || void 0,
|
|
974
977
|
"aria-readonly": e.readonly || void 0,
|
|
975
978
|
onInput: l,
|
|
976
|
-
onBlur: r[0] || (r[0] = (
|
|
977
|
-
onFocus: r[1] || (r[1] = (
|
|
979
|
+
onBlur: r[0] || (r[0] = (s) => t("blur", s)),
|
|
980
|
+
onFocus: r[1] || (r[1] = (s) => t("focus", s))
|
|
978
981
|
}, null, 42, Bt),
|
|
979
|
-
e.suffix ? (
|
|
980
|
-
])) : (
|
|
982
|
+
e.suffix ? (d(), f("span", Ft, A(e.suffix), 1)) : I("", !0)
|
|
983
|
+
])) : (d(), f("input", {
|
|
981
984
|
key: 1,
|
|
982
985
|
type: "number",
|
|
983
986
|
value: e.modelValue ?? "",
|
|
@@ -986,18 +989,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
986
989
|
step: e.step,
|
|
987
990
|
disabled: e.disabled,
|
|
988
991
|
readonly: e.readonly,
|
|
989
|
-
class:
|
|
992
|
+
class: T(c.value),
|
|
990
993
|
"aria-disabled": e.disabled || void 0,
|
|
991
994
|
"aria-readonly": e.readonly || void 0,
|
|
992
995
|
onInput: l,
|
|
993
|
-
onBlur: r[2] || (r[2] = (
|
|
994
|
-
onFocus: r[3] || (r[3] = (
|
|
996
|
+
onBlur: r[2] || (r[2] = (s) => t("blur", s)),
|
|
997
|
+
onFocus: r[3] || (r[3] = (s) => t("focus", s))
|
|
995
998
|
}, null, 42, Tt));
|
|
996
999
|
}
|
|
997
|
-
}), Lt = /* @__PURE__ */
|
|
1000
|
+
}), Lt = /* @__PURE__ */ ne(It, [["__scopeId", "data-v-4e51299b"]]), At = { class: "relative" }, Nt = ["disabled"], Dt = { class: "text-lg leading-none" }, Mt = { class: "text-xs text-gray-500 dark:text-gray-400 font-medium" }, Et = ["value", "placeholder", "disabled"], Rt = {
|
|
998
1001
|
key: 1,
|
|
999
1002
|
class: "absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"
|
|
1000
|
-
}, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" },
|
|
1003
|
+
}, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" }, Ot = { class: "max-h-48 overflow-y-auto" }, zt = ["onMousedown"], Kt = { class: "text-lg leading-none" }, Pt = { class: "flex-1 truncate text-xs" }, Ut = { class: "text-[11px] text-gray-400 dark:text-gray-500 font-mono" }, Ht = {
|
|
1001
1004
|
key: 0,
|
|
1002
1005
|
class: "px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"
|
|
1003
1006
|
}, Gt = /* @__PURE__ */ j({
|
|
@@ -1011,8 +1014,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1011
1014
|
disabled: { type: Boolean, default: !1 }
|
|
1012
1015
|
},
|
|
1013
1016
|
emits: ["update:modelValue", "blur"],
|
|
1014
|
-
setup(e, { emit:
|
|
1015
|
-
const
|
|
1017
|
+
setup(e, { emit: i }) {
|
|
1018
|
+
const a = e, t = i, u = {
|
|
1016
1019
|
AF: "Afghanistan",
|
|
1017
1020
|
AL: "Albania",
|
|
1018
1021
|
DZ: "Algeria",
|
|
@@ -1132,148 +1135,148 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1132
1135
|
VN: "Vietnam",
|
|
1133
1136
|
ZW: "Zimbabwe"
|
|
1134
1137
|
};
|
|
1135
|
-
function
|
|
1136
|
-
return
|
|
1137
|
-
}
|
|
1138
|
-
const
|
|
1139
|
-
var
|
|
1140
|
-
return ((
|
|
1141
|
-
(
|
|
1142
|
-
) : xe()).map((
|
|
1143
|
-
code:
|
|
1144
|
-
name:
|
|
1145
|
-
dialCode: `+${ke(
|
|
1146
|
-
flag:
|
|
1147
|
-
})).sort((
|
|
1148
|
-
}), l =
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
1151
|
-
(
|
|
1152
|
-
) :
|
|
1153
|
-
}),
|
|
1154
|
-
() =>
|
|
1138
|
+
function n(C) {
|
|
1139
|
+
return C.toUpperCase().split("").map((V) => String.fromCodePoint(127462 + V.charCodeAt(0) - 65)).join("");
|
|
1140
|
+
}
|
|
1141
|
+
const c = x(() => {
|
|
1142
|
+
var V;
|
|
1143
|
+
return ((V = a.countries) != null && V.length ? a.countries.filter(
|
|
1144
|
+
(b) => xe().includes(b)
|
|
1145
|
+
) : xe()).map((b) => ({
|
|
1146
|
+
code: b,
|
|
1147
|
+
name: u[b] ?? b,
|
|
1148
|
+
dialCode: `+${ke(b)}`,
|
|
1149
|
+
flag: n(b)
|
|
1150
|
+
})).sort((b, m) => b.name.localeCompare(m.name));
|
|
1151
|
+
}), l = M(a.defaultCountry), o = M(""), r = M(!1), s = M(""), k = M(null), S = x(() => {
|
|
1152
|
+
const C = s.value.toLowerCase();
|
|
1153
|
+
return C ? c.value.filter(
|
|
1154
|
+
(V) => V.name.toLowerCase().includes(C) || V.code.toLowerCase().includes(C) || V.dialCode.includes(C)
|
|
1155
|
+
) : c.value;
|
|
1156
|
+
}), F = x(
|
|
1157
|
+
() => c.value.find((C) => C.code === l.value) ?? c.value[0]
|
|
1155
1158
|
);
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
}),
|
|
1159
|
-
() =>
|
|
1160
|
-
(
|
|
1161
|
-
|
|
1159
|
+
de(() => {
|
|
1160
|
+
a.modelValue && y(a.modelValue);
|
|
1161
|
+
}), W(
|
|
1162
|
+
() => a.modelValue,
|
|
1163
|
+
(C) => {
|
|
1164
|
+
C && y(C);
|
|
1162
1165
|
}
|
|
1163
1166
|
);
|
|
1164
|
-
function
|
|
1167
|
+
function y(C) {
|
|
1165
1168
|
try {
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
l.value =
|
|
1169
|
+
const V = Oe(C);
|
|
1170
|
+
if (V != null && V.country) {
|
|
1171
|
+
l.value = V.country, o.value = V.nationalNumber;
|
|
1169
1172
|
return;
|
|
1170
1173
|
}
|
|
1171
1174
|
} catch {
|
|
1172
1175
|
}
|
|
1173
|
-
|
|
1176
|
+
o.value = C.replace(/^\+\d+\s*/, "");
|
|
1174
1177
|
}
|
|
1175
|
-
function
|
|
1176
|
-
if (!
|
|
1177
|
-
|
|
1178
|
+
function v() {
|
|
1179
|
+
if (!o.value.trim()) {
|
|
1180
|
+
t("update:modelValue", "");
|
|
1178
1181
|
return;
|
|
1179
1182
|
}
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
}
|
|
1185
|
-
function
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
}
|
|
1189
|
-
function
|
|
1190
|
-
l.value =
|
|
1191
|
-
}
|
|
1192
|
-
function
|
|
1193
|
-
|
|
1194
|
-
var
|
|
1195
|
-
return (
|
|
1183
|
+
const C = new ze(l.value);
|
|
1184
|
+
C.input(`+${ke(l.value)}${o.value}`);
|
|
1185
|
+
const V = C.getNumber();
|
|
1186
|
+
t("update:modelValue", (V == null ? void 0 : V.format("E.164")) ?? o.value);
|
|
1187
|
+
}
|
|
1188
|
+
function g(C) {
|
|
1189
|
+
const V = C.target;
|
|
1190
|
+
o.value = V.value, v();
|
|
1191
|
+
}
|
|
1192
|
+
function p(C) {
|
|
1193
|
+
l.value = C, r.value = !1, s.value = "", v();
|
|
1194
|
+
}
|
|
1195
|
+
function N() {
|
|
1196
|
+
a.disabled || (r.value = !0, s.value = "", te(() => {
|
|
1197
|
+
var C;
|
|
1198
|
+
return (C = k.value) == null ? void 0 : C.focus();
|
|
1196
1199
|
}));
|
|
1197
1200
|
}
|
|
1198
|
-
function
|
|
1199
|
-
r.value = !1,
|
|
1201
|
+
function B() {
|
|
1202
|
+
r.value = !1, s.value = "";
|
|
1200
1203
|
}
|
|
1201
|
-
return (
|
|
1202
|
-
var
|
|
1203
|
-
return
|
|
1204
|
-
|
|
1205
|
-
class:
|
|
1204
|
+
return (C, V) => {
|
|
1205
|
+
var b, m;
|
|
1206
|
+
return d(), f("div", At, [
|
|
1207
|
+
h("div", {
|
|
1208
|
+
class: T([
|
|
1206
1209
|
"flex items-stretch rounded-lg border transition-colors",
|
|
1207
1210
|
e.disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700" : "border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"
|
|
1208
1211
|
])
|
|
1209
1212
|
}, [
|
|
1210
|
-
e.showDialCode ? (
|
|
1213
|
+
e.showDialCode ? (d(), f("button", {
|
|
1211
1214
|
key: 0,
|
|
1212
1215
|
type: "button",
|
|
1213
1216
|
disabled: e.disabled,
|
|
1214
1217
|
class: "flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",
|
|
1215
|
-
onMousedown:
|
|
1218
|
+
onMousedown: V[0] || (V[0] = J((w) => r.value ? B() : N(), ["prevent"]))
|
|
1216
1219
|
}, [
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
(
|
|
1220
|
-
class:
|
|
1220
|
+
h("span", Dt, A((b = F.value) == null ? void 0 : b.flag), 1),
|
|
1221
|
+
h("span", Mt, A((m = F.value) == null ? void 0 : m.dialCode), 1),
|
|
1222
|
+
(d(), f("svg", {
|
|
1223
|
+
class: T(["h-3 w-3 text-gray-400 transition-transform", r.value ? "rotate-180" : ""]),
|
|
1221
1224
|
viewBox: "0 0 24 24",
|
|
1222
1225
|
fill: "none",
|
|
1223
1226
|
stroke: "currentColor",
|
|
1224
1227
|
"stroke-width": "2",
|
|
1225
1228
|
"stroke-linecap": "round",
|
|
1226
1229
|
"stroke-linejoin": "round"
|
|
1227
|
-
}, [...
|
|
1228
|
-
|
|
1230
|
+
}, [...V[3] || (V[3] = [
|
|
1231
|
+
h("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
1229
1232
|
])], 2))
|
|
1230
|
-
], 40, Nt)) :
|
|
1231
|
-
|
|
1233
|
+
], 40, Nt)) : I("", !0),
|
|
1234
|
+
h("input", {
|
|
1232
1235
|
type: "tel",
|
|
1233
|
-
value:
|
|
1236
|
+
value: o.value,
|
|
1234
1237
|
placeholder: e.placeholder || "Phone number",
|
|
1235
1238
|
disabled: e.disabled,
|
|
1236
1239
|
autocomplete: "tel-national",
|
|
1237
|
-
class:
|
|
1238
|
-
onInput:
|
|
1239
|
-
onBlur:
|
|
1240
|
+
class: T(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0", e.showDialCode ? "rounded-r-lg" : "rounded-lg"]),
|
|
1241
|
+
onInput: g,
|
|
1242
|
+
onBlur: V[1] || (V[1] = (w) => t("blur", w))
|
|
1240
1243
|
}, null, 42, Et)
|
|
1241
1244
|
], 2),
|
|
1242
|
-
r.value ? (
|
|
1245
|
+
r.value ? (d(), f("div", {
|
|
1243
1246
|
key: 0,
|
|
1244
1247
|
class: "fixed inset-0 z-40",
|
|
1245
|
-
onMousedown:
|
|
1246
|
-
}, null, 32)) :
|
|
1247
|
-
r.value ? (
|
|
1248
|
-
|
|
1249
|
-
|
|
1248
|
+
onMousedown: B
|
|
1249
|
+
}, null, 32)) : I("", !0),
|
|
1250
|
+
r.value ? (d(), f("div", Rt, [
|
|
1251
|
+
h("div", jt, [
|
|
1252
|
+
ce(h("input", {
|
|
1250
1253
|
ref_key: "searchInputRef",
|
|
1251
1254
|
ref: k,
|
|
1252
|
-
"onUpdate:modelValue":
|
|
1255
|
+
"onUpdate:modelValue": V[2] || (V[2] = (w) => s.value = w),
|
|
1253
1256
|
type: "text",
|
|
1254
1257
|
placeholder: "Search country...",
|
|
1255
1258
|
class: "w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"
|
|
1256
1259
|
}, null, 512), [
|
|
1257
|
-
[
|
|
1260
|
+
[ye, s.value]
|
|
1258
1261
|
])
|
|
1259
1262
|
]),
|
|
1260
|
-
|
|
1261
|
-
(
|
|
1262
|
-
key:
|
|
1263
|
+
h("div", Ot, [
|
|
1264
|
+
(d(!0), f(z, null, G(S.value, (w) => (d(), f("button", {
|
|
1265
|
+
key: w.code,
|
|
1263
1266
|
type: "button",
|
|
1264
|
-
class:
|
|
1267
|
+
class: T([
|
|
1265
1268
|
"flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
1266
|
-
|
|
1269
|
+
w.code === l.value ? "bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300"
|
|
1267
1270
|
]),
|
|
1268
|
-
onMousedown:
|
|
1271
|
+
onMousedown: J((D) => p(w.code), ["prevent"])
|
|
1269
1272
|
}, [
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
], 42,
|
|
1274
|
-
|
|
1273
|
+
h("span", Kt, A(w.flag), 1),
|
|
1274
|
+
h("span", Pt, A(w.name), 1),
|
|
1275
|
+
h("span", Ut, A(w.dialCode), 1)
|
|
1276
|
+
], 42, zt))), 128)),
|
|
1277
|
+
S.value.length === 0 ? (d(), f("p", Ht, " No countries found ")) : I("", !0)
|
|
1275
1278
|
])
|
|
1276
|
-
])) :
|
|
1279
|
+
])) : I("", !0)
|
|
1277
1280
|
]);
|
|
1278
1281
|
};
|
|
1279
1282
|
}
|
|
@@ -1290,56 +1293,56 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1290
1293
|
disabled: { type: Boolean, default: !1 }
|
|
1291
1294
|
},
|
|
1292
1295
|
emits: ["update:modelValue", "blur"],
|
|
1293
|
-
setup(e, { emit:
|
|
1294
|
-
const
|
|
1296
|
+
setup(e, { emit: i }) {
|
|
1297
|
+
const a = e, t = i;
|
|
1295
1298
|
K();
|
|
1296
|
-
function
|
|
1297
|
-
return
|
|
1299
|
+
function u(o) {
|
|
1300
|
+
return a.modelValue === o;
|
|
1298
1301
|
}
|
|
1299
|
-
function o
|
|
1300
|
-
return
|
|
1302
|
+
function n(o) {
|
|
1303
|
+
return a.disabled || !!o.disabled;
|
|
1301
1304
|
}
|
|
1302
|
-
function
|
|
1303
|
-
o
|
|
1305
|
+
function c(o) {
|
|
1306
|
+
n(o) || t("update:modelValue", o.value);
|
|
1304
1307
|
}
|
|
1305
|
-
function l(
|
|
1306
|
-
(
|
|
1308
|
+
function l(o, r) {
|
|
1309
|
+
(o.key === " " || o.key === "Enter") && (o.preventDefault(), c(r));
|
|
1307
1310
|
}
|
|
1308
|
-
return (
|
|
1311
|
+
return (o, r) => (d(), f("div", {
|
|
1309
1312
|
role: "radiogroup",
|
|
1310
|
-
class:
|
|
1313
|
+
class: T(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
|
|
1311
1314
|
}, [
|
|
1312
|
-
(
|
|
1313
|
-
key: String(
|
|
1314
|
-
class:
|
|
1315
|
+
(d(!0), f(z, null, G(e.options, (s) => (d(), f("label", {
|
|
1316
|
+
key: String(s.value),
|
|
1317
|
+
class: T([
|
|
1315
1318
|
"inline-flex items-center gap-2 select-none",
|
|
1316
|
-
|
|
1319
|
+
n(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
1317
1320
|
])
|
|
1318
1321
|
}, [
|
|
1319
|
-
|
|
1322
|
+
h("input", {
|
|
1320
1323
|
type: "radio",
|
|
1321
|
-
checked: s
|
|
1322
|
-
disabled:
|
|
1324
|
+
checked: u(s.value),
|
|
1325
|
+
disabled: n(s),
|
|
1323
1326
|
class: "sr-only",
|
|
1324
|
-
onChange: (k) =>
|
|
1325
|
-
onBlur: r[0] || (r[0] = (k) =>
|
|
1327
|
+
onChange: (k) => c(s),
|
|
1328
|
+
onBlur: r[0] || (r[0] = (k) => t("blur", k))
|
|
1326
1329
|
}, null, 40, Zt),
|
|
1327
|
-
|
|
1330
|
+
h("div", {
|
|
1328
1331
|
role: "radio",
|
|
1329
|
-
"aria-checked": s
|
|
1330
|
-
"aria-disabled":
|
|
1332
|
+
"aria-checked": u(s.value),
|
|
1333
|
+
"aria-disabled": n(s) || void 0,
|
|
1331
1334
|
tabindex: "0",
|
|
1332
|
-
class:
|
|
1335
|
+
class: T([
|
|
1333
1336
|
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",
|
|
1334
|
-
s
|
|
1337
|
+
u(s.value) ? "" : "border-gray-300"
|
|
1335
1338
|
]),
|
|
1336
|
-
style:
|
|
1337
|
-
onClick: (k) =>
|
|
1338
|
-
onKeydown: (k) => l(k,
|
|
1339
|
+
style: O(u(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1340
|
+
onClick: (k) => c(s),
|
|
1341
|
+
onKeydown: (k) => l(k, s)
|
|
1339
1342
|
}, [
|
|
1340
|
-
s
|
|
1343
|
+
u(s.value) ? (d(), f("div", Yt)) : I("", !0)
|
|
1341
1344
|
], 46, qt),
|
|
1342
|
-
|
|
1345
|
+
h("span", Jt, A(s.label), 1)
|
|
1343
1346
|
], 2))), 128))
|
|
1344
1347
|
], 2));
|
|
1345
1348
|
}
|
|
@@ -1373,174 +1376,177 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1373
1376
|
disabled: { type: Boolean, default: !1 }
|
|
1374
1377
|
},
|
|
1375
1378
|
emits: ["update:modelValue", "blur"],
|
|
1376
|
-
setup(e, { emit:
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
return (
|
|
1381
|
-
}),
|
|
1382
|
-
if (!
|
|
1383
|
-
const
|
|
1384
|
-
return
|
|
1379
|
+
setup(e, { emit: i }) {
|
|
1380
|
+
const a = e, t = i, u = K(), n = M(!1), c = M(""), l = M(-1), o = M(null), r = M(null), s = x(() => a.modelValue === null || a.modelValue === void 0 ? [] : Array.isArray(a.modelValue) ? a.modelValue : [a.modelValue]), k = x(() => {
|
|
1381
|
+
if (s.value.length === 0 || a.multiple) return "";
|
|
1382
|
+
const m = a.options.find((w) => w.value === s.value[0]);
|
|
1383
|
+
return (m == null ? void 0 : m.label) ?? String(s.value[0]);
|
|
1384
|
+
}), S = x(() => {
|
|
1385
|
+
if (!c.value) return a.options;
|
|
1386
|
+
const m = c.value.toLowerCase();
|
|
1387
|
+
return a.options.filter((w) => w.label.toLowerCase().includes(m));
|
|
1385
1388
|
});
|
|
1386
|
-
function
|
|
1387
|
-
return
|
|
1389
|
+
function F(m) {
|
|
1390
|
+
return s.value.includes(m);
|
|
1388
1391
|
}
|
|
1389
|
-
function
|
|
1390
|
-
|
|
1392
|
+
function y() {
|
|
1393
|
+
a.disabled || (n.value ? g() : v());
|
|
1391
1394
|
}
|
|
1392
|
-
function
|
|
1393
|
-
|
|
1394
|
-
var
|
|
1395
|
-
return (
|
|
1395
|
+
function v() {
|
|
1396
|
+
n.value = !0, l.value = -1, c.value = "", te(() => {
|
|
1397
|
+
var m;
|
|
1398
|
+
return (m = r.value) == null ? void 0 : m.focus();
|
|
1396
1399
|
});
|
|
1397
1400
|
}
|
|
1398
|
-
function
|
|
1399
|
-
|
|
1401
|
+
function g() {
|
|
1402
|
+
n.value = !1, c.value = "";
|
|
1400
1403
|
}
|
|
1401
|
-
function
|
|
1402
|
-
if (!
|
|
1403
|
-
if (
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1404
|
+
function p(m) {
|
|
1405
|
+
if (!m.disabled)
|
|
1406
|
+
if (a.multiple) {
|
|
1407
|
+
const w = [...s.value], D = w.indexOf(m.value);
|
|
1408
|
+
D >= 0 ? w.splice(D, 1) : w.push(m.value), t("update:modelValue", w);
|
|
1406
1409
|
} else
|
|
1407
|
-
|
|
1410
|
+
t("update:modelValue", m.value), g();
|
|
1408
1411
|
}
|
|
1409
|
-
function
|
|
1410
|
-
if (
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1412
|
+
function N(m) {
|
|
1413
|
+
if (a.disabled) return;
|
|
1414
|
+
const w = s.value.filter((D) => D !== m);
|
|
1415
|
+
t("update:modelValue", w.length ? w : a.multiple ? [] : null);
|
|
1413
1416
|
}
|
|
1414
|
-
function
|
|
1415
|
-
|
|
1417
|
+
function B(m) {
|
|
1418
|
+
m.stopPropagation(), t("update:modelValue", a.multiple ? [] : null);
|
|
1416
1419
|
}
|
|
1417
|
-
function
|
|
1418
|
-
if (!
|
|
1419
|
-
(
|
|
1420
|
+
function C(m) {
|
|
1421
|
+
if (!n.value) {
|
|
1422
|
+
(m.key === "Enter" || m.key === " " || m.key === "ArrowDown") && (m.preventDefault(), v());
|
|
1420
1423
|
return;
|
|
1421
1424
|
}
|
|
1422
|
-
switch (
|
|
1425
|
+
switch (m.key) {
|
|
1423
1426
|
case "ArrowDown":
|
|
1424
|
-
|
|
1427
|
+
m.preventDefault(), l.value = Math.min(
|
|
1425
1428
|
l.value + 1,
|
|
1426
|
-
|
|
1429
|
+
S.value.length - 1
|
|
1427
1430
|
);
|
|
1428
1431
|
break;
|
|
1429
1432
|
case "ArrowUp":
|
|
1430
|
-
|
|
1433
|
+
m.preventDefault(), l.value = Math.max(l.value - 1, 0);
|
|
1431
1434
|
break;
|
|
1432
1435
|
case "Enter":
|
|
1433
|
-
|
|
1436
|
+
if (m.preventDefault(), l.value >= 0) {
|
|
1437
|
+
const w = S.value[l.value];
|
|
1438
|
+
w && p(w);
|
|
1439
|
+
}
|
|
1434
1440
|
break;
|
|
1435
1441
|
case "Escape":
|
|
1436
|
-
|
|
1442
|
+
m.preventDefault(), g();
|
|
1437
1443
|
break;
|
|
1438
1444
|
}
|
|
1439
1445
|
}
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1446
|
+
function V(m) {
|
|
1447
|
+
o.value && !o.value.contains(m.target) && g();
|
|
1442
1448
|
}
|
|
1443
|
-
function
|
|
1444
|
-
const
|
|
1445
|
-
return (
|
|
1449
|
+
function b(m) {
|
|
1450
|
+
const w = a.options.find((D) => D.value === m);
|
|
1451
|
+
return (w == null ? void 0 : w.label) ?? String(m);
|
|
1446
1452
|
}
|
|
1447
|
-
return
|
|
1448
|
-
|
|
1449
|
-
}), (
|
|
1453
|
+
return de(() => document.addEventListener("mousedown", V)), Ve(() => document.removeEventListener("mousedown", V)), W(n, (m) => {
|
|
1454
|
+
m || t("blur", new FocusEvent("blur"));
|
|
1455
|
+
}), (m, w) => (d(), f("div", {
|
|
1450
1456
|
ref_key: "containerRef",
|
|
1451
|
-
ref:
|
|
1452
|
-
class:
|
|
1457
|
+
ref: o,
|
|
1458
|
+
class: T([
|
|
1453
1459
|
"relative w-full",
|
|
1454
|
-
|
|
1460
|
+
q(u).classes.value.input,
|
|
1455
1461
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1456
1462
|
])
|
|
1457
1463
|
}, [
|
|
1458
|
-
|
|
1464
|
+
h("div", {
|
|
1459
1465
|
role: "combobox",
|
|
1460
|
-
"aria-expanded":
|
|
1466
|
+
"aria-expanded": n.value,
|
|
1461
1467
|
"aria-haspopup": "listbox",
|
|
1462
1468
|
tabindex: "0",
|
|
1463
|
-
class:
|
|
1469
|
+
class: T([
|
|
1464
1470
|
"flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm",
|
|
1465
1471
|
"transition-colors duration-200",
|
|
1466
|
-
|
|
1472
|
+
n.value ? "ring-2 ring-blue-500/20" : "",
|
|
1467
1473
|
e.disabled ? "pointer-events-none bg-gray-100" : ""
|
|
1468
1474
|
]),
|
|
1469
|
-
style:
|
|
1470
|
-
onClick:
|
|
1471
|
-
onKeydown:
|
|
1475
|
+
style: O(n.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1476
|
+
onClick: y,
|
|
1477
|
+
onKeydown: C
|
|
1472
1478
|
}, [
|
|
1473
|
-
|
|
1474
|
-
e.multiple ? (
|
|
1475
|
-
key: String(
|
|
1479
|
+
h("div", Qt, [
|
|
1480
|
+
e.multiple ? (d(!0), f(z, { key: 0 }, G(s.value, (D) => (d(), f("span", {
|
|
1481
|
+
key: String(D),
|
|
1476
1482
|
class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
|
|
1477
1483
|
style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
|
|
1478
1484
|
}, [
|
|
1479
|
-
|
|
1480
|
-
|
|
1485
|
+
Q(A(b(D)) + " ", 1),
|
|
1486
|
+
h("button", {
|
|
1481
1487
|
type: "button",
|
|
1482
1488
|
class: "ml-0.5",
|
|
1483
1489
|
style: { color: "var(--fc-color-primary, #3b82f6)" },
|
|
1484
1490
|
"aria-label": "Remove",
|
|
1485
|
-
onClick:
|
|
1491
|
+
onClick: J((P) => N(D), ["stop"])
|
|
1486
1492
|
}, " × ", 8, Xt)
|
|
1487
|
-
]))), 128)) : k.value ? (
|
|
1493
|
+
]))), 128)) : k.value ? (d(), f("span", ea, A(k.value), 1)) : (d(), f("span", ta, A(e.placeholder), 1))
|
|
1488
1494
|
]),
|
|
1489
|
-
e.clearable &&
|
|
1495
|
+
e.clearable && s.value.length > 0 && !e.disabled ? (d(), f("button", {
|
|
1490
1496
|
key: 0,
|
|
1491
1497
|
type: "button",
|
|
1492
1498
|
class: "ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200",
|
|
1493
1499
|
"aria-label": "Clear selection",
|
|
1494
|
-
onClick:
|
|
1495
|
-
}, " × ")) :
|
|
1496
|
-
(
|
|
1497
|
-
class:
|
|
1500
|
+
onClick: B
|
|
1501
|
+
}, " × ")) : I("", !0),
|
|
1502
|
+
(d(), f("svg", {
|
|
1503
|
+
class: T(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", n.value ? "rotate-180" : ""]),
|
|
1498
1504
|
viewBox: "0 0 20 20",
|
|
1499
1505
|
fill: "currentColor",
|
|
1500
1506
|
"aria-hidden": "true"
|
|
1501
|
-
}, [...
|
|
1502
|
-
|
|
1507
|
+
}, [...w[1] || (w[1] = [
|
|
1508
|
+
h("path", {
|
|
1503
1509
|
"fill-rule": "evenodd",
|
|
1504
1510
|
d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
|
|
1505
1511
|
"clip-rule": "evenodd"
|
|
1506
1512
|
}, null, -1)
|
|
1507
1513
|
])], 2))
|
|
1508
1514
|
], 46, _t),
|
|
1509
|
-
|
|
1510
|
-
e.searchable ? (
|
|
1511
|
-
|
|
1515
|
+
n.value ? (d(), f("div", aa, [
|
|
1516
|
+
e.searchable ? (d(), f("div", la, [
|
|
1517
|
+
ce(h("input", {
|
|
1512
1518
|
ref_key: "searchInputRef",
|
|
1513
1519
|
ref: r,
|
|
1514
|
-
"onUpdate:modelValue":
|
|
1520
|
+
"onUpdate:modelValue": w[0] || (w[0] = (D) => c.value = D),
|
|
1515
1521
|
type: "text",
|
|
1516
1522
|
class: "w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",
|
|
1517
1523
|
placeholder: "Search...",
|
|
1518
|
-
onKeydown:
|
|
1524
|
+
onKeydown: C
|
|
1519
1525
|
}, null, 544), [
|
|
1520
|
-
[
|
|
1526
|
+
[ye, c.value]
|
|
1521
1527
|
])
|
|
1522
|
-
])) :
|
|
1523
|
-
|
|
1524
|
-
(
|
|
1525
|
-
key: String(
|
|
1528
|
+
])) : I("", !0),
|
|
1529
|
+
h("ul", na, [
|
|
1530
|
+
(d(!0), f(z, null, G(S.value, (D, P) => (d(), f("li", {
|
|
1531
|
+
key: String(D.value),
|
|
1526
1532
|
role: "option",
|
|
1527
|
-
"aria-selected":
|
|
1528
|
-
class:
|
|
1533
|
+
"aria-selected": F(D.value),
|
|
1534
|
+
class: T([
|
|
1529
1535
|
"cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
|
|
1530
|
-
|
|
1531
|
-
l.value ===
|
|
1532
|
-
|
|
1536
|
+
F(D.value) ? "" : "text-gray-900",
|
|
1537
|
+
l.value === P ? "bg-gray-100" : "",
|
|
1538
|
+
D.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-50"
|
|
1533
1539
|
]),
|
|
1534
|
-
style:
|
|
1535
|
-
onClick: (
|
|
1536
|
-
onMouseenter: (
|
|
1537
|
-
},
|
|
1538
|
-
|
|
1540
|
+
style: O(F(D.value) ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1541
|
+
onClick: (re) => p(D),
|
|
1542
|
+
onMouseenter: (re) => l.value = P
|
|
1543
|
+
}, A(D.label), 47, oa))), 128)),
|
|
1544
|
+
S.value.length === 0 ? (d(), f("li", ra, " No options found ")) : I("", !0)
|
|
1539
1545
|
])
|
|
1540
|
-
])) :
|
|
1546
|
+
])) : I("", !0)
|
|
1541
1547
|
], 2));
|
|
1542
1548
|
}
|
|
1543
|
-
}), ia = /* @__PURE__ */
|
|
1549
|
+
}), ia = /* @__PURE__ */ ne(sa, [["__scopeId", "data-v-816d5094"]]), ua = ["value", "min", "max", "step", "disabled", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-disabled"], da = { class: "mt-1 flex justify-between text-xs text-gray-400" }, ca = /* @__PURE__ */ j({
|
|
1544
1550
|
__name: "SliderInput",
|
|
1545
1551
|
props: {
|
|
1546
1552
|
modelValue: {},
|
|
@@ -1551,29 +1557,29 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1551
1557
|
disabled: { type: Boolean, default: !1 }
|
|
1552
1558
|
},
|
|
1553
1559
|
emits: ["update:modelValue", "blur"],
|
|
1554
|
-
setup(e, { emit:
|
|
1555
|
-
const
|
|
1560
|
+
setup(e, { emit: i }) {
|
|
1561
|
+
const a = e, t = i;
|
|
1556
1562
|
K();
|
|
1557
|
-
const
|
|
1558
|
-
const l =
|
|
1559
|
-
return l === 0 ? 0 : (
|
|
1563
|
+
const u = M(!1), n = x(() => {
|
|
1564
|
+
const l = a.max - a.min;
|
|
1565
|
+
return l === 0 ? 0 : (a.modelValue - a.min) / l * 100;
|
|
1560
1566
|
});
|
|
1561
|
-
function
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1567
|
+
function c(l) {
|
|
1568
|
+
const o = l.target;
|
|
1569
|
+
t("update:modelValue", parseFloat(o.value));
|
|
1564
1570
|
}
|
|
1565
|
-
return (l,
|
|
1566
|
-
class:
|
|
1571
|
+
return (l, o) => (d(), f("div", {
|
|
1572
|
+
class: T([
|
|
1567
1573
|
"relative w-full py-2",
|
|
1568
1574
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1569
1575
|
])
|
|
1570
1576
|
}, [
|
|
1571
|
-
e.showTooltip &&
|
|
1577
|
+
e.showTooltip && u.value ? (d(), f("div", {
|
|
1572
1578
|
key: 0,
|
|
1573
1579
|
class: "absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",
|
|
1574
|
-
style:
|
|
1575
|
-
},
|
|
1576
|
-
|
|
1580
|
+
style: O({ left: `calc(${n.value}% - 16px)` })
|
|
1581
|
+
}, A(e.modelValue), 5)) : I("", !0),
|
|
1582
|
+
h("input", {
|
|
1577
1583
|
type: "range",
|
|
1578
1584
|
value: e.modelValue,
|
|
1579
1585
|
min: e.min,
|
|
@@ -1586,19 +1592,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1586
1592
|
"aria-disabled": e.disabled || void 0,
|
|
1587
1593
|
class: "h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",
|
|
1588
1594
|
style: { accentColor: "var(--fc-color-primary, #3b82f6)" },
|
|
1589
|
-
onInput:
|
|
1590
|
-
onMousedown:
|
|
1591
|
-
onMouseup:
|
|
1592
|
-
onTouchstart:
|
|
1593
|
-
onTouchend:
|
|
1594
|
-
onFocus:
|
|
1595
|
-
onBlur:
|
|
1596
|
-
|
|
1595
|
+
onInput: c,
|
|
1596
|
+
onMousedown: o[0] || (o[0] = (r) => u.value = !0),
|
|
1597
|
+
onMouseup: o[1] || (o[1] = (r) => u.value = !1),
|
|
1598
|
+
onTouchstart: o[2] || (o[2] = (r) => u.value = !0),
|
|
1599
|
+
onTouchend: o[3] || (o[3] = (r) => u.value = !1),
|
|
1600
|
+
onFocus: o[4] || (o[4] = (r) => u.value = !0),
|
|
1601
|
+
onBlur: o[5] || (o[5] = (r) => {
|
|
1602
|
+
u.value = !1, t("blur", r);
|
|
1597
1603
|
})
|
|
1598
1604
|
}, null, 40, ua),
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1605
|
+
h("div", da, [
|
|
1606
|
+
h("span", null, A(e.min), 1),
|
|
1607
|
+
h("span", null, A(e.max), 1)
|
|
1602
1608
|
])
|
|
1603
1609
|
], 2));
|
|
1604
1610
|
}
|
|
@@ -1617,55 +1623,55 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1617
1623
|
disabled: { type: Boolean, default: !1 }
|
|
1618
1624
|
},
|
|
1619
1625
|
emits: ["update:modelValue", "blur"],
|
|
1620
|
-
setup(e, { emit:
|
|
1621
|
-
const
|
|
1626
|
+
setup(e, { emit: i }) {
|
|
1627
|
+
const a = e, t = i;
|
|
1622
1628
|
K();
|
|
1623
|
-
const
|
|
1629
|
+
const u = x(() => [
|
|
1624
1630
|
"inline-flex items-center gap-2 select-none",
|
|
1625
|
-
|
|
1631
|
+
a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
1626
1632
|
]);
|
|
1627
|
-
function
|
|
1628
|
-
|
|
1633
|
+
function n() {
|
|
1634
|
+
a.disabled || t("update:modelValue", !a.modelValue);
|
|
1629
1635
|
}
|
|
1630
|
-
function
|
|
1631
|
-
(l.key === " " || l.key === "Enter") && (l.preventDefault(),
|
|
1636
|
+
function c(l) {
|
|
1637
|
+
(l.key === " " || l.key === "Enter") && (l.preventDefault(), n());
|
|
1632
1638
|
}
|
|
1633
|
-
return (l,
|
|
1634
|
-
class:
|
|
1639
|
+
return (l, o) => (d(), f("label", {
|
|
1640
|
+
class: T(u.value)
|
|
1635
1641
|
}, [
|
|
1636
|
-
e.inactiveLabel ? (
|
|
1637
|
-
|
|
1642
|
+
e.inactiveLabel ? (d(), f("span", fa, A(e.inactiveLabel), 1)) : I("", !0),
|
|
1643
|
+
h("input", {
|
|
1638
1644
|
type: "checkbox",
|
|
1639
1645
|
checked: e.modelValue,
|
|
1640
1646
|
disabled: e.disabled,
|
|
1641
1647
|
class: "sr-only",
|
|
1642
|
-
onChange:
|
|
1643
|
-
onBlur:
|
|
1648
|
+
onChange: n,
|
|
1649
|
+
onBlur: o[0] || (o[0] = (r) => t("blur", r))
|
|
1644
1650
|
}, null, 40, ma),
|
|
1645
|
-
|
|
1651
|
+
h("button", {
|
|
1646
1652
|
type: "button",
|
|
1647
1653
|
role: "switch",
|
|
1648
1654
|
"aria-checked": e.modelValue,
|
|
1649
1655
|
"aria-disabled": e.disabled || void 0,
|
|
1650
1656
|
tabindex: "0",
|
|
1651
|
-
class:
|
|
1657
|
+
class: T([
|
|
1652
1658
|
"relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
|
|
1653
1659
|
e.modelValue ? "" : "bg-gray-300",
|
|
1654
1660
|
e.disabled ? "pointer-events-none" : "focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
1655
1661
|
]),
|
|
1656
|
-
style:
|
|
1657
|
-
onClick:
|
|
1658
|
-
onKeydown:
|
|
1662
|
+
style: O(e.modelValue ? { backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1663
|
+
onClick: n,
|
|
1664
|
+
onKeydown: c
|
|
1659
1665
|
}, [
|
|
1660
|
-
|
|
1661
|
-
class:
|
|
1666
|
+
h("span", {
|
|
1667
|
+
class: T([
|
|
1662
1668
|
"pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
|
|
1663
1669
|
e.modelValue ? "translate-x-5" : "translate-x-0"
|
|
1664
1670
|
]),
|
|
1665
1671
|
"aria-hidden": "true"
|
|
1666
1672
|
}, null, 2)
|
|
1667
1673
|
], 46, ba),
|
|
1668
|
-
e.activeLabel ? (
|
|
1674
|
+
e.activeLabel ? (d(), f("span", va, A(e.activeLabel), 1)) : I("", !0)
|
|
1669
1675
|
], 2));
|
|
1670
1676
|
}
|
|
1671
1677
|
}), pa = ["onClick"], ga = ["placeholder", "disabled"], ha = {
|
|
@@ -1682,119 +1688,121 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1682
1688
|
disabled: { type: Boolean, default: !1 }
|
|
1683
1689
|
},
|
|
1684
1690
|
emits: ["update:modelValue", "blur"],
|
|
1685
|
-
setup(e, { emit:
|
|
1686
|
-
const
|
|
1687
|
-
if (!
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1690
|
-
(
|
|
1691
|
+
setup(e, { emit: i }) {
|
|
1692
|
+
const a = e, t = x(() => Array.isArray(a.modelValue) ? a.modelValue : []), u = i, n = K(), c = M(""), l = M(!1), o = M(!1), r = M(-1), s = M(null), k = M(null), S = x(() => !a.maxTags || t.value.length < a.maxTags), F = x(() => {
|
|
1693
|
+
if (!c.value || a.suggestions.length === 0) return [];
|
|
1694
|
+
const B = c.value.toLowerCase();
|
|
1695
|
+
return a.suggestions.filter(
|
|
1696
|
+
(C) => C.toLowerCase().includes(B) && !t.value.includes(C)
|
|
1691
1697
|
);
|
|
1692
1698
|
});
|
|
1693
|
-
function
|
|
1694
|
-
const
|
|
1695
|
-
!
|
|
1696
|
-
}
|
|
1697
|
-
function
|
|
1698
|
-
if (
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1701
|
-
}
|
|
1702
|
-
function
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1699
|
+
function y(B) {
|
|
1700
|
+
const C = B.trim();
|
|
1701
|
+
!C || !S.value || t.value.includes(C) || (u("update:modelValue", [...t.value, C]), c.value = "", o.value = !1, r.value = -1);
|
|
1702
|
+
}
|
|
1703
|
+
function v(B) {
|
|
1704
|
+
if (a.disabled) return;
|
|
1705
|
+
const C = t.value.filter((V, b) => b !== B);
|
|
1706
|
+
u("update:modelValue", C);
|
|
1707
|
+
}
|
|
1708
|
+
function g(B) {
|
|
1709
|
+
if (B.key === "Enter" || B.key === ",") {
|
|
1710
|
+
B.preventDefault();
|
|
1711
|
+
const C = r.value >= 0 ? F.value[r.value] : void 0;
|
|
1712
|
+
y(C || c.value);
|
|
1705
1713
|
return;
|
|
1706
1714
|
}
|
|
1707
|
-
if (
|
|
1708
|
-
|
|
1715
|
+
if (B.key === "Backspace" && c.value === "" && t.value.length > 0) {
|
|
1716
|
+
v(t.value.length - 1);
|
|
1709
1717
|
return;
|
|
1710
1718
|
}
|
|
1711
|
-
if (
|
|
1712
|
-
|
|
1719
|
+
if (B.key === "ArrowDown" && o.value) {
|
|
1720
|
+
B.preventDefault(), r.value = Math.min(
|
|
1713
1721
|
r.value + 1,
|
|
1714
|
-
|
|
1722
|
+
F.value.length - 1
|
|
1715
1723
|
);
|
|
1716
1724
|
return;
|
|
1717
1725
|
}
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1726
|
+
if (B.key === "ArrowUp" && o.value) {
|
|
1727
|
+
B.preventDefault(), r.value = Math.max(r.value - 1, 0);
|
|
1720
1728
|
return;
|
|
1721
1729
|
}
|
|
1722
|
-
|
|
1730
|
+
B.key === "Escape" && (o.value = !1, r.value = -1);
|
|
1723
1731
|
}
|
|
1724
|
-
function
|
|
1725
|
-
|
|
1732
|
+
function p() {
|
|
1733
|
+
o.value = c.value.length > 0 && F.value.length > 0, r.value = -1;
|
|
1726
1734
|
}
|
|
1727
|
-
function
|
|
1728
|
-
|
|
1735
|
+
function N(B) {
|
|
1736
|
+
s.value && !s.value.contains(B.target) && (o.value = !1);
|
|
1729
1737
|
}
|
|
1730
|
-
return
|
|
1731
|
-
|
|
1732
|
-
}), (
|
|
1738
|
+
return de(() => document.addEventListener("mousedown", N)), Ve(() => document.removeEventListener("mousedown", N)), W(c, () => {
|
|
1739
|
+
te(p);
|
|
1740
|
+
}), (B, C) => (d(), f("div", {
|
|
1733
1741
|
ref_key: "containerRef",
|
|
1734
|
-
ref:
|
|
1735
|
-
class:
|
|
1742
|
+
ref: s,
|
|
1743
|
+
class: T([
|
|
1736
1744
|
"relative w-full",
|
|
1737
1745
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1738
1746
|
])
|
|
1739
1747
|
}, [
|
|
1740
|
-
|
|
1741
|
-
class:
|
|
1748
|
+
h("div", {
|
|
1749
|
+
class: T([
|
|
1742
1750
|
"flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",
|
|
1743
1751
|
l.value ? "ring-2 ring-blue-500/20" : "border-gray-300",
|
|
1744
|
-
|
|
1752
|
+
q(n).classes.value.input
|
|
1745
1753
|
]),
|
|
1746
|
-
style:
|
|
1747
|
-
onClick:
|
|
1748
|
-
var
|
|
1749
|
-
return (
|
|
1754
|
+
style: O(l.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1755
|
+
onClick: C[3] || (C[3] = (V) => {
|
|
1756
|
+
var b;
|
|
1757
|
+
return (b = k.value) == null ? void 0 : b.focus();
|
|
1750
1758
|
})
|
|
1751
1759
|
}, [
|
|
1752
|
-
(
|
|
1753
|
-
key:
|
|
1760
|
+
(d(!0), f(z, null, G(t.value, (V, b) => (d(), f("span", {
|
|
1761
|
+
key: V,
|
|
1754
1762
|
class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
|
|
1755
1763
|
style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
|
|
1756
1764
|
}, [
|
|
1757
|
-
|
|
1758
|
-
e.disabled ?
|
|
1765
|
+
Q(A(V) + " ", 1),
|
|
1766
|
+
e.disabled ? I("", !0) : (d(), f("button", {
|
|
1759
1767
|
key: 0,
|
|
1760
1768
|
type: "button",
|
|
1761
1769
|
class: "ml-0.5 transition-colors duration-200",
|
|
1762
1770
|
style: { color: "var(--fc-color-primary, #3b82f6)" },
|
|
1763
1771
|
"aria-label": "Remove tag",
|
|
1764
|
-
onClick:
|
|
1772
|
+
onClick: J((m) => v(b), ["stop"])
|
|
1765
1773
|
}, " × ", 8, pa))
|
|
1766
1774
|
]))), 128)),
|
|
1767
|
-
|
|
1775
|
+
ce(h("input", {
|
|
1768
1776
|
ref_key: "inputRef",
|
|
1769
1777
|
ref: k,
|
|
1770
|
-
"onUpdate:modelValue":
|
|
1778
|
+
"onUpdate:modelValue": C[0] || (C[0] = (V) => c.value = V),
|
|
1771
1779
|
type: "text",
|
|
1772
|
-
placeholder:
|
|
1780
|
+
placeholder: t.value.length === 0 ? e.placeholder : "",
|
|
1773
1781
|
disabled: e.disabled,
|
|
1774
1782
|
class: "min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",
|
|
1775
|
-
onKeydown:
|
|
1776
|
-
onFocus:
|
|
1777
|
-
onBlur:
|
|
1778
|
-
l.value = !1,
|
|
1783
|
+
onKeydown: g,
|
|
1784
|
+
onFocus: C[1] || (C[1] = (V) => l.value = !0),
|
|
1785
|
+
onBlur: C[2] || (C[2] = (V) => {
|
|
1786
|
+
l.value = !1, u("blur", V);
|
|
1779
1787
|
})
|
|
1780
1788
|
}, null, 40, ga), [
|
|
1781
|
-
[
|
|
1789
|
+
[ye, c.value]
|
|
1782
1790
|
])
|
|
1783
1791
|
], 6),
|
|
1784
|
-
|
|
1785
|
-
(
|
|
1786
|
-
key:
|
|
1792
|
+
o.value && F.value.length > 0 ? (d(), f("ul", ha, [
|
|
1793
|
+
(d(!0), f(z, null, G(F.value, (V, b) => (d(), f("li", {
|
|
1794
|
+
key: V,
|
|
1787
1795
|
role: "option",
|
|
1788
|
-
"aria-selected": r.value ===
|
|
1789
|
-
class:
|
|
1796
|
+
"aria-selected": r.value === b,
|
|
1797
|
+
class: T([
|
|
1790
1798
|
"cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
|
|
1791
|
-
r.value !==
|
|
1799
|
+
r.value !== b ? "text-gray-900 hover:bg-gray-50" : ""
|
|
1792
1800
|
]),
|
|
1793
|
-
style:
|
|
1794
|
-
onMousedown:
|
|
1795
|
-
onMouseenter: (
|
|
1796
|
-
},
|
|
1797
|
-
])) :
|
|
1801
|
+
style: O(r.value === b ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
1802
|
+
onMousedown: J((m) => y(V), ["prevent"]),
|
|
1803
|
+
onMouseenter: (m) => r.value = b
|
|
1804
|
+
}, A(V), 47, xa))), 128))
|
|
1805
|
+
])) : I("", !0)
|
|
1798
1806
|
], 2));
|
|
1799
1807
|
}
|
|
1800
1808
|
}), wa = ["value", "rows", "maxlength", "placeholder", "disabled", "readonly", "aria-disabled", "aria-readonly"], $a = /* @__PURE__ */ j({
|
|
@@ -1809,52 +1817,52 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1809
1817
|
readonly: { type: Boolean, default: !1 }
|
|
1810
1818
|
},
|
|
1811
1819
|
emits: ["update:modelValue", "blur", "focus"],
|
|
1812
|
-
setup(e, { emit:
|
|
1813
|
-
const
|
|
1820
|
+
setup(e, { emit: i }) {
|
|
1821
|
+
const a = e, t = i, u = K(), n = M(null), c = x(
|
|
1814
1822
|
() => [
|
|
1815
1823
|
"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
|
|
1816
1824
|
"placeholder:text-gray-400 resize-y",
|
|
1817
1825
|
"focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input",
|
|
1818
1826
|
"transition-colors duration-200",
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1827
|
+
a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
|
|
1828
|
+
a.autoResize ? "resize-none overflow-hidden" : "",
|
|
1829
|
+
u.classes.value.input
|
|
1822
1830
|
].filter(Boolean).join(" ")
|
|
1823
1831
|
);
|
|
1824
1832
|
function l() {
|
|
1825
|
-
if (!
|
|
1826
|
-
const r =
|
|
1833
|
+
if (!a.autoResize || !n.value) return;
|
|
1834
|
+
const r = n.value;
|
|
1827
1835
|
r.style.height = "auto", r.style.height = `${r.scrollHeight}px`;
|
|
1828
1836
|
}
|
|
1829
|
-
function
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1837
|
+
function o(r) {
|
|
1838
|
+
const s = r.target;
|
|
1839
|
+
t("update:modelValue", s.value), a.autoResize && te(l);
|
|
1832
1840
|
}
|
|
1833
|
-
return
|
|
1834
|
-
() =>
|
|
1841
|
+
return W(
|
|
1842
|
+
() => a.modelValue,
|
|
1835
1843
|
() => {
|
|
1836
|
-
|
|
1844
|
+
a.autoResize && te(l);
|
|
1837
1845
|
}
|
|
1838
|
-
),
|
|
1839
|
-
|
|
1840
|
-
}), (r,
|
|
1846
|
+
), de(() => {
|
|
1847
|
+
a.autoResize && l();
|
|
1848
|
+
}), (r, s) => (d(), f("textarea", {
|
|
1841
1849
|
ref_key: "textareaRef",
|
|
1842
|
-
ref:
|
|
1850
|
+
ref: n,
|
|
1843
1851
|
value: e.modelValue,
|
|
1844
1852
|
rows: e.rows,
|
|
1845
1853
|
maxlength: e.maxLength,
|
|
1846
1854
|
placeholder: e.placeholder,
|
|
1847
1855
|
disabled: e.disabled,
|
|
1848
1856
|
readonly: e.readonly,
|
|
1849
|
-
class:
|
|
1857
|
+
class: T(c.value),
|
|
1850
1858
|
"aria-disabled": e.disabled || void 0,
|
|
1851
1859
|
"aria-readonly": e.readonly || void 0,
|
|
1852
|
-
onInput:
|
|
1853
|
-
onBlur:
|
|
1854
|
-
onFocus:
|
|
1860
|
+
onInput: o,
|
|
1861
|
+
onBlur: s[0] || (s[0] = (k) => t("blur", k)),
|
|
1862
|
+
onFocus: s[1] || (s[1] = (k) => t("focus", k))
|
|
1855
1863
|
}, null, 42, wa));
|
|
1856
1864
|
}
|
|
1857
|
-
}), Ca = /* @__PURE__ */
|
|
1865
|
+
}), Ca = /* @__PURE__ */ ne($a, [["__scopeId", "data-v-67f80d90"]]), Va = {
|
|
1858
1866
|
key: 0,
|
|
1859
1867
|
class: "flex items-stretch"
|
|
1860
1868
|
}, Sa = {
|
|
@@ -1877,41 +1885,41 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1877
1885
|
mask: {}
|
|
1878
1886
|
},
|
|
1879
1887
|
emits: ["update:modelValue", "blur", "focus"],
|
|
1880
|
-
setup(e, { emit:
|
|
1881
|
-
const
|
|
1888
|
+
setup(e, { emit: i }) {
|
|
1889
|
+
const a = e, t = i, u = K(), n = x(() => !!a.prefix || !!a.suffix), c = x(
|
|
1882
1890
|
() => [
|
|
1883
1891
|
"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
|
|
1884
1892
|
"placeholder:text-gray-400",
|
|
1885
1893
|
"focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input",
|
|
1886
1894
|
"transition-colors duration-200",
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1895
|
+
a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
|
|
1896
|
+
a.prefix ? "rounded-l-none" : "",
|
|
1897
|
+
a.suffix ? "rounded-r-none" : "",
|
|
1898
|
+
u.classes.value.input
|
|
1891
1899
|
].filter(Boolean).join(" ")
|
|
1892
1900
|
);
|
|
1893
|
-
function l(
|
|
1894
|
-
const r =
|
|
1895
|
-
|
|
1901
|
+
function l(o) {
|
|
1902
|
+
const r = o.target;
|
|
1903
|
+
t("update:modelValue", r.value);
|
|
1896
1904
|
}
|
|
1897
|
-
return (
|
|
1898
|
-
e.prefix ? (
|
|
1899
|
-
|
|
1905
|
+
return (o, r) => n.value ? (d(), f("div", Va, [
|
|
1906
|
+
e.prefix ? (d(), f("span", Sa, A(e.prefix), 1)) : I("", !0),
|
|
1907
|
+
h("input", {
|
|
1900
1908
|
type: e.inputType,
|
|
1901
1909
|
value: e.modelValue,
|
|
1902
1910
|
placeholder: e.placeholder,
|
|
1903
1911
|
maxlength: e.maxLength,
|
|
1904
1912
|
disabled: e.disabled,
|
|
1905
1913
|
readonly: e.readonly,
|
|
1906
|
-
class:
|
|
1914
|
+
class: T(c.value),
|
|
1907
1915
|
"aria-disabled": e.disabled || void 0,
|
|
1908
1916
|
"aria-readonly": e.readonly || void 0,
|
|
1909
1917
|
onInput: l,
|
|
1910
|
-
onBlur: r[0] || (r[0] = (
|
|
1911
|
-
onFocus: r[1] || (r[1] = (
|
|
1918
|
+
onBlur: r[0] || (r[0] = (s) => t("blur", s)),
|
|
1919
|
+
onFocus: r[1] || (r[1] = (s) => t("focus", s))
|
|
1912
1920
|
}, null, 42, Ba),
|
|
1913
|
-
e.suffix ? (
|
|
1914
|
-
])) : (
|
|
1921
|
+
e.suffix ? (d(), f("span", Fa, A(e.suffix), 1)) : I("", !0)
|
|
1922
|
+
])) : (d(), f("input", {
|
|
1915
1923
|
key: 1,
|
|
1916
1924
|
type: e.inputType,
|
|
1917
1925
|
value: e.modelValue,
|
|
@@ -1919,15 +1927,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1919
1927
|
maxlength: e.maxLength,
|
|
1920
1928
|
disabled: e.disabled,
|
|
1921
1929
|
readonly: e.readonly,
|
|
1922
|
-
class:
|
|
1930
|
+
class: T(c.value),
|
|
1923
1931
|
"aria-disabled": e.disabled || void 0,
|
|
1924
1932
|
"aria-readonly": e.readonly || void 0,
|
|
1925
1933
|
onInput: l,
|
|
1926
|
-
onBlur: r[2] || (r[2] = (
|
|
1927
|
-
onFocus: r[3] || (r[3] = (
|
|
1934
|
+
onBlur: r[2] || (r[2] = (s) => t("blur", s)),
|
|
1935
|
+
onFocus: r[3] || (r[3] = (s) => t("focus", s))
|
|
1928
1936
|
}, null, 42, Ta));
|
|
1929
1937
|
}
|
|
1930
|
-
}), La = /* @__PURE__ */
|
|
1938
|
+
}), La = /* @__PURE__ */ ne(Ia, [["__scopeId", "data-v-a42b4343"]]), Aa = {
|
|
1931
1939
|
key: 0,
|
|
1932
1940
|
class: "mb-1.5 flex items-center gap-1"
|
|
1933
1941
|
}, Na = ["for"], Da = {
|
|
@@ -1938,7 +1946,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1938
1946
|
key: 0,
|
|
1939
1947
|
role: "tooltip",
|
|
1940
1948
|
class: "absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"
|
|
1941
|
-
}, Ra = ["id"], ja = ["id"],
|
|
1949
|
+
}, Ra = ["id"], ja = ["id"], Oa = /* @__PURE__ */ j({
|
|
1942
1950
|
__name: "BaseField",
|
|
1943
1951
|
props: {
|
|
1944
1952
|
fieldSchema: {},
|
|
@@ -1947,59 +1955,59 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
1947
1955
|
touched: { type: Boolean, default: !1 }
|
|
1948
1956
|
},
|
|
1949
1957
|
setup(e) {
|
|
1950
|
-
const
|
|
1951
|
-
if (
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
1958
|
+
const i = e, a = Y(pe), t = Y(ge), u = M(!1), n = x(() => {
|
|
1959
|
+
if (a) {
|
|
1960
|
+
const S = a.t(i.fieldName, "label");
|
|
1961
|
+
if (S) return S;
|
|
1954
1962
|
}
|
|
1955
|
-
return
|
|
1956
|
-
}),
|
|
1957
|
-
if (
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
1963
|
+
return i.fieldSchema.label ?? i.fieldName;
|
|
1964
|
+
}), c = x(() => {
|
|
1965
|
+
if (a) {
|
|
1966
|
+
const S = a.t(i.fieldName, "helpText");
|
|
1967
|
+
if (S) return S;
|
|
1960
1968
|
}
|
|
1961
|
-
return
|
|
1969
|
+
return i.fieldSchema.helpText ?? "";
|
|
1962
1970
|
}), l = x(() => {
|
|
1963
|
-
if (
|
|
1964
|
-
const
|
|
1965
|
-
if (
|
|
1971
|
+
if (a) {
|
|
1972
|
+
const S = a.t(i.fieldName, "tooltip");
|
|
1973
|
+
if (S) return S;
|
|
1966
1974
|
}
|
|
1967
|
-
return
|
|
1968
|
-
}),
|
|
1969
|
-
(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
]),
|
|
1974
|
-
return (
|
|
1975
|
-
var
|
|
1976
|
-
return
|
|
1977
|
-
class:
|
|
1978
|
-
style:
|
|
1975
|
+
return i.fieldSchema.tooltip ?? "";
|
|
1976
|
+
}), o = x(() => i.touched && i.errors.length > 0), r = x(() => [
|
|
1977
|
+
(t == null ? void 0 : t.classes.value.field) ?? "fc-field",
|
|
1978
|
+
i.fieldSchema.className ?? "",
|
|
1979
|
+
i.fieldSchema.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1980
|
+
i.fieldSchema.readOnly ? "fc-readonly" : ""
|
|
1981
|
+
]), s = x(() => `fc-field-${i.fieldName}`), k = x(() => `fc-error-${i.fieldName}`);
|
|
1982
|
+
return (S, F) => {
|
|
1983
|
+
var y, v;
|
|
1984
|
+
return d(), f("div", {
|
|
1985
|
+
class: T([r.value, "relative mb-4"]),
|
|
1986
|
+
style: O(e.fieldSchema.style)
|
|
1979
1987
|
}, [
|
|
1980
|
-
e.fieldSchema.type !== "hidden" ? (
|
|
1981
|
-
|
|
1982
|
-
for:
|
|
1983
|
-
class:
|
|
1988
|
+
e.fieldSchema.type !== "hidden" ? (d(), f("div", Aa, [
|
|
1989
|
+
h("label", {
|
|
1990
|
+
for: s.value,
|
|
1991
|
+
class: T([((y = q(t)) == null ? void 0 : y.classes.value.label) ?? "fc-label", "block text-sm font-medium text-gray-700"])
|
|
1984
1992
|
}, [
|
|
1985
|
-
|
|
1986
|
-
e.fieldSchema.required ? (
|
|
1993
|
+
Q(A(n.value) + " ", 1),
|
|
1994
|
+
e.fieldSchema.required ? (d(), f("span", Da, "*")) : I("", !0)
|
|
1987
1995
|
], 10, Na),
|
|
1988
|
-
l.value ? (
|
|
1996
|
+
l.value ? (d(), f("span", {
|
|
1989
1997
|
key: 0,
|
|
1990
1998
|
class: "relative inline-flex",
|
|
1991
|
-
onMouseenter:
|
|
1992
|
-
onMouseleave:
|
|
1993
|
-
onFocusin:
|
|
1994
|
-
onFocusout:
|
|
1999
|
+
onMouseenter: F[0] || (F[0] = (g) => u.value = !0),
|
|
2000
|
+
onMouseleave: F[1] || (F[1] = (g) => u.value = !1),
|
|
2001
|
+
onFocusin: F[2] || (F[2] = (g) => u.value = !0),
|
|
2002
|
+
onFocusout: F[3] || (F[3] = (g) => u.value = !1)
|
|
1995
2003
|
}, [
|
|
1996
|
-
|
|
2004
|
+
h("button", {
|
|
1997
2005
|
type: "button",
|
|
1998
2006
|
class: "inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",
|
|
1999
2007
|
"aria-label": `Info: ${l.value}`,
|
|
2000
2008
|
tabindex: "0"
|
|
2001
2009
|
}, " i ", 8, Ma),
|
|
2002
|
-
Z(
|
|
2010
|
+
Z(ae, {
|
|
2003
2011
|
"enter-active-class": "motion-safe:transition motion-safe:duration-200 motion-safe:ease-out",
|
|
2004
2012
|
"enter-from-class": "opacity-0 scale-95",
|
|
2005
2013
|
"enter-to-class": "opacity-100 scale-100",
|
|
@@ -2007,18 +2015,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2007
2015
|
"leave-from-class": "opacity-100 scale-100",
|
|
2008
2016
|
"leave-to-class": "opacity-0 scale-95"
|
|
2009
2017
|
}, {
|
|
2010
|
-
default:
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
])) :
|
|
2018
|
+
default: _(() => [
|
|
2019
|
+
u.value ? (d(), f("div", Ea, [
|
|
2020
|
+
Q(A(l.value) + " ", 1),
|
|
2021
|
+
F[4] || (F[4] = h("div", { class: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900" }, null, -1))
|
|
2022
|
+
])) : I("", !0)
|
|
2015
2023
|
]),
|
|
2016
2024
|
_: 1
|
|
2017
2025
|
})
|
|
2018
|
-
], 32)) :
|
|
2019
|
-
])) :
|
|
2020
|
-
|
|
2021
|
-
De(
|
|
2026
|
+
], 32)) : I("", !0)
|
|
2027
|
+
])) : I("", !0),
|
|
2028
|
+
h("div", { id: s.value }, [
|
|
2029
|
+
De(S.$slots, "default")
|
|
2022
2030
|
], 8, Ra),
|
|
2023
2031
|
Z(Me, {
|
|
2024
2032
|
tag: "div",
|
|
@@ -2030,27 +2038,27 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2030
2038
|
"leave-to-class": "opacity-0 -translate-y-1 max-h-0",
|
|
2031
2039
|
class: ""
|
|
2032
2040
|
}, {
|
|
2033
|
-
default:
|
|
2034
|
-
(
|
|
2035
|
-
var
|
|
2036
|
-
return
|
|
2037
|
-
key:
|
|
2038
|
-
id:
|
|
2039
|
-
class:
|
|
2041
|
+
default: _(() => [
|
|
2042
|
+
(d(!0), f(z, null, G(o.value ? e.errors : [], (g, p) => {
|
|
2043
|
+
var N;
|
|
2044
|
+
return d(), f("p", {
|
|
2045
|
+
key: g + p,
|
|
2046
|
+
id: p === 0 ? k.value : void 0,
|
|
2047
|
+
class: T([((N = q(t)) == null ? void 0 : N.classes.value.error) ?? "fc-error", "mt-1 text-xs text-red-500"]),
|
|
2040
2048
|
role: "alert"
|
|
2041
|
-
},
|
|
2049
|
+
}, A(g), 11, ja);
|
|
2042
2050
|
}), 128))
|
|
2043
2051
|
]),
|
|
2044
2052
|
_: 1
|
|
2045
2053
|
}),
|
|
2046
|
-
|
|
2054
|
+
c.value && !o.value ? (d(), f("p", {
|
|
2047
2055
|
key: 1,
|
|
2048
|
-
class:
|
|
2049
|
-
},
|
|
2056
|
+
class: T([((v = q(t)) == null ? void 0 : v.classes.value.helpText) ?? "fc-help-text", "mt-1 text-xs text-gray-400"])
|
|
2057
|
+
}, A(c.value), 3)) : I("", !0)
|
|
2050
2058
|
], 6);
|
|
2051
2059
|
};
|
|
2052
2060
|
}
|
|
2053
|
-
}),
|
|
2061
|
+
}), za = {
|
|
2054
2062
|
key: 1,
|
|
2055
2063
|
class: "rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"
|
|
2056
2064
|
}, $e = /* @__PURE__ */ j({
|
|
@@ -2059,68 +2067,68 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2059
2067
|
name: {}
|
|
2060
2068
|
},
|
|
2061
2069
|
setup(e) {
|
|
2062
|
-
const
|
|
2063
|
-
if (!
|
|
2070
|
+
const i = e, a = Y(fe);
|
|
2071
|
+
if (!a)
|
|
2064
2072
|
throw new Error(
|
|
2065
2073
|
"FormField must be used inside a FormBuilder (FormContextKey not provided)"
|
|
2066
2074
|
);
|
|
2067
|
-
const a =
|
|
2075
|
+
const t = a, u = Y(
|
|
2068
2076
|
Be,
|
|
2069
2077
|
null
|
|
2070
|
-
),
|
|
2071
|
-
() =>
|
|
2072
|
-
),
|
|
2073
|
-
var
|
|
2074
|
-
const
|
|
2075
|
-
if (!
|
|
2076
|
-
const
|
|
2077
|
-
return
|
|
2078
|
-
}),
|
|
2079
|
-
const
|
|
2080
|
-
return
|
|
2081
|
-
values: { ...t.values },
|
|
2082
|
-
getFieldValue: (C) => t.values[C]
|
|
2083
|
-
}) : m.visible ?? !0 : !1;
|
|
2084
|
-
}), i = x(() => {
|
|
2085
|
-
const m = s.value;
|
|
2086
|
-
return m ? typeof m.disabled == "function" ? m.disabled({
|
|
2078
|
+
), n = x(
|
|
2079
|
+
() => U(t.schema.fields).find((v) => v.name === i.name)
|
|
2080
|
+
), c = x(() => {
|
|
2081
|
+
var p;
|
|
2082
|
+
const v = n.value;
|
|
2083
|
+
if (!v) return;
|
|
2084
|
+
const g = (p = u == null ? void 0 : u.value) == null ? void 0 : p[v.type];
|
|
2085
|
+
return g || Ke(v.type);
|
|
2086
|
+
}), l = x(() => t.values[i.name]), o = x(() => t.errors[i.name] ?? []), r = x(() => t.touched[i.name] ?? !1), s = x(() => {
|
|
2087
|
+
const v = n.value;
|
|
2088
|
+
return v ? v.condition ? ie(v.condition, t.values) : typeof v.visible == "function" ? v.visible({
|
|
2087
2089
|
values: { ...t.values },
|
|
2088
|
-
getFieldValue: (
|
|
2089
|
-
}) :
|
|
2090
|
+
getFieldValue: (g) => t.values[g]
|
|
2091
|
+
}) : v.visible ?? !0 : !1;
|
|
2090
2092
|
}), k = x(() => {
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2093
|
+
const v = n.value;
|
|
2094
|
+
return v ? typeof v.disabled == "function" ? v.disabled({
|
|
2095
|
+
values: { ...t.values },
|
|
2096
|
+
getFieldValue: (g) => t.values[g]
|
|
2097
|
+
}) : v.disabled ?? !1 : !1;
|
|
2098
|
+
}), S = x(() => {
|
|
2099
|
+
const v = n.value;
|
|
2100
|
+
if (!v) return {};
|
|
2093
2101
|
const {
|
|
2094
|
-
name:
|
|
2095
|
-
label:
|
|
2096
|
-
helpText:
|
|
2097
|
-
tooltip:
|
|
2098
|
-
condition:
|
|
2099
|
-
translations:
|
|
2100
|
-
meta:
|
|
2101
|
-
rules:
|
|
2102
|
-
visible:
|
|
2103
|
-
className:
|
|
2104
|
-
style:
|
|
2105
|
-
defaultValue:
|
|
2106
|
-
...
|
|
2107
|
-
} =
|
|
2102
|
+
name: g,
|
|
2103
|
+
label: p,
|
|
2104
|
+
helpText: N,
|
|
2105
|
+
tooltip: B,
|
|
2106
|
+
condition: C,
|
|
2107
|
+
translations: V,
|
|
2108
|
+
meta: b,
|
|
2109
|
+
rules: m,
|
|
2110
|
+
visible: w,
|
|
2111
|
+
className: D,
|
|
2112
|
+
style: P,
|
|
2113
|
+
defaultValue: re,
|
|
2114
|
+
...se
|
|
2115
|
+
} = v;
|
|
2108
2116
|
return {
|
|
2109
|
-
...
|
|
2110
|
-
modelValue:
|
|
2111
|
-
disabled:
|
|
2112
|
-
readonly:
|
|
2113
|
-
placeholder:
|
|
2117
|
+
...se,
|
|
2118
|
+
modelValue: l.value,
|
|
2119
|
+
disabled: k.value,
|
|
2120
|
+
readonly: v.readOnly ?? !1,
|
|
2121
|
+
placeholder: v.placeholder ?? ""
|
|
2114
2122
|
};
|
|
2115
2123
|
});
|
|
2116
|
-
function
|
|
2117
|
-
t.setFieldValue(
|
|
2124
|
+
function F(v) {
|
|
2125
|
+
t.setFieldValue(i.name, v);
|
|
2118
2126
|
}
|
|
2119
|
-
function
|
|
2120
|
-
var
|
|
2121
|
-
t.touched[
|
|
2127
|
+
function y() {
|
|
2128
|
+
var v;
|
|
2129
|
+
t.touched[i.name] = !0, ((v = t.schema.settings) == null ? void 0 : v.validateOnBlur) !== !1 && t.validateField(i.name);
|
|
2122
2130
|
}
|
|
2123
|
-
return (
|
|
2131
|
+
return (v, g) => (d(), H(ae, {
|
|
2124
2132
|
"enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
|
|
2125
2133
|
"enter-from-class": "opacity-0 max-h-0",
|
|
2126
2134
|
"enter-to-class": "opacity-100 max-h-96",
|
|
@@ -2128,24 +2136,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2128
2136
|
"leave-from-class": "opacity-100 max-h-96",
|
|
2129
2137
|
"leave-to-class": "opacity-0 max-h-0"
|
|
2130
2138
|
}, {
|
|
2131
|
-
default:
|
|
2132
|
-
|
|
2139
|
+
default: _(() => [
|
|
2140
|
+
s.value && n.value ? (d(), H(Oa, {
|
|
2133
2141
|
key: 0,
|
|
2134
|
-
"field-schema":
|
|
2142
|
+
"field-schema": n.value,
|
|
2135
2143
|
"field-name": e.name,
|
|
2136
|
-
errors:
|
|
2137
|
-
touched:
|
|
2144
|
+
errors: o.value,
|
|
2145
|
+
touched: r.value
|
|
2138
2146
|
}, {
|
|
2139
|
-
default:
|
|
2140
|
-
|
|
2141
|
-
"aria-invalid":
|
|
2142
|
-
"aria-describedby":
|
|
2143
|
-
"onUpdate:modelValue":
|
|
2144
|
-
onBlur:
|
|
2145
|
-
}), null, 16, ["aria-invalid", "aria-describedby"])) : (
|
|
2147
|
+
default: _(() => [
|
|
2148
|
+
c.value ? (d(), H(Se(c.value), Ee({ key: 0 }, S.value, {
|
|
2149
|
+
"aria-invalid": r.value && o.value.length > 0 ? !0 : void 0,
|
|
2150
|
+
"aria-describedby": r.value && o.value.length > 0 ? `fc-error-${e.name}` : void 0,
|
|
2151
|
+
"onUpdate:modelValue": F,
|
|
2152
|
+
onBlur: y
|
|
2153
|
+
}), null, 16, ["aria-invalid", "aria-describedby"])) : (d(), f("div", za, ' No component registered for field type "' + A(n.value.type) + '" ', 1))
|
|
2146
2154
|
]),
|
|
2147
2155
|
_: 1
|
|
2148
|
-
}, 8, ["field-schema", "field-name", "errors", "touched"])) :
|
|
2156
|
+
}, 8, ["field-schema", "field-name", "errors", "touched"])) : I("", !0)
|
|
2149
2157
|
]),
|
|
2150
2158
|
_: 1
|
|
2151
2159
|
}));
|
|
@@ -2160,19 +2168,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2160
2168
|
className: {}
|
|
2161
2169
|
},
|
|
2162
2170
|
setup(e) {
|
|
2163
|
-
return (
|
|
2164
|
-
class:
|
|
2171
|
+
return (i, a) => (d(), f("div", {
|
|
2172
|
+
class: T([e.className ?? "", "relative my-4"]),
|
|
2165
2173
|
role: "separator"
|
|
2166
2174
|
}, [
|
|
2167
|
-
|
|
2175
|
+
a[0] || (a[0] = h("div", {
|
|
2168
2176
|
class: "absolute inset-0 flex items-center",
|
|
2169
2177
|
"aria-hidden": "true"
|
|
2170
2178
|
}, [
|
|
2171
|
-
|
|
2179
|
+
h("div", { class: "w-full border-t border-gray-200" })
|
|
2172
2180
|
], -1)),
|
|
2173
|
-
e.label ? (
|
|
2174
|
-
|
|
2175
|
-
])) :
|
|
2181
|
+
e.label ? (d(), f("div", Ka, [
|
|
2182
|
+
h("span", Pa, A(e.label), 1)
|
|
2183
|
+
])) : I("", !0)
|
|
2176
2184
|
], 2));
|
|
2177
2185
|
}
|
|
2178
2186
|
}), Ha = ["aria-labelledby"], Ga = {
|
|
@@ -2192,53 +2200,53 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2192
2200
|
className: {}
|
|
2193
2201
|
},
|
|
2194
2202
|
setup(e) {
|
|
2195
|
-
const
|
|
2196
|
-
function
|
|
2197
|
-
|
|
2203
|
+
const i = e, a = M(i.collapsed);
|
|
2204
|
+
function t() {
|
|
2205
|
+
i.collapsible && (a.value = !a.value);
|
|
2198
2206
|
}
|
|
2199
|
-
const
|
|
2200
|
-
() =>
|
|
2207
|
+
const u = x(
|
|
2208
|
+
() => i.title ? `fc-group-${i.title.toLowerCase().replace(/\s+/g, "-")}` : void 0
|
|
2201
2209
|
);
|
|
2202
|
-
return (
|
|
2203
|
-
class:
|
|
2204
|
-
"aria-labelledby":
|
|
2210
|
+
return (n, c) => (d(), f("fieldset", {
|
|
2211
|
+
class: T([[e.className ?? ""], "rounded-lg border border-gray-200 bg-white"]),
|
|
2212
|
+
"aria-labelledby": u.value
|
|
2205
2213
|
}, [
|
|
2206
|
-
e.title || e.description ? (
|
|
2207
|
-
(
|
|
2214
|
+
e.title || e.description ? (d(), f("div", Ga, [
|
|
2215
|
+
(d(), H(Se(e.collapsible ? "button" : "div"), {
|
|
2208
2216
|
type: e.collapsible ? "button" : void 0,
|
|
2209
|
-
class:
|
|
2210
|
-
"aria-expanded": e.collapsible ? !
|
|
2211
|
-
"aria-controls": e.collapsible ? `fc-group-body-${
|
|
2212
|
-
onClick:
|
|
2217
|
+
class: T(["flex w-full items-center justify-between text-left", e.collapsible ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded" : ""]),
|
|
2218
|
+
"aria-expanded": e.collapsible ? !a.value : void 0,
|
|
2219
|
+
"aria-controls": e.collapsible ? `fc-group-body-${u.value}` : void 0,
|
|
2220
|
+
onClick: t
|
|
2213
2221
|
}, {
|
|
2214
|
-
default:
|
|
2215
|
-
|
|
2216
|
-
e.title ? (
|
|
2222
|
+
default: _(() => [
|
|
2223
|
+
h("div", null, [
|
|
2224
|
+
e.title ? (d(), f("legend", {
|
|
2217
2225
|
key: 0,
|
|
2218
|
-
id:
|
|
2226
|
+
id: u.value,
|
|
2219
2227
|
class: "text-sm font-semibold text-gray-800"
|
|
2220
|
-
},
|
|
2221
|
-
e.description ? (
|
|
2228
|
+
}, A(e.title), 9, Za)) : I("", !0),
|
|
2229
|
+
e.description ? (d(), f("p", qa, A(e.description), 1)) : I("", !0)
|
|
2222
2230
|
]),
|
|
2223
|
-
e.collapsible ? (
|
|
2231
|
+
e.collapsible ? (d(), f("svg", {
|
|
2224
2232
|
key: 0,
|
|
2225
|
-
class:
|
|
2233
|
+
class: T(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200", a.value ? "" : "rotate-180"]),
|
|
2226
2234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2227
2235
|
viewBox: "0 0 20 20",
|
|
2228
2236
|
fill: "currentColor",
|
|
2229
2237
|
"aria-hidden": "true"
|
|
2230
|
-
}, [...
|
|
2231
|
-
|
|
2238
|
+
}, [...c[0] || (c[0] = [
|
|
2239
|
+
h("path", {
|
|
2232
2240
|
"fill-rule": "evenodd",
|
|
2233
2241
|
d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
|
|
2234
2242
|
"clip-rule": "evenodd"
|
|
2235
2243
|
}, null, -1)
|
|
2236
|
-
])], 2)) :
|
|
2244
|
+
])], 2)) : I("", !0)
|
|
2237
2245
|
]),
|
|
2238
2246
|
_: 1
|
|
2239
2247
|
}, 8, ["type", "class", "aria-expanded", "aria-controls"]))
|
|
2240
|
-
])) :
|
|
2241
|
-
Z(
|
|
2248
|
+
])) : I("", !0),
|
|
2249
|
+
Z(ae, {
|
|
2242
2250
|
"enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
|
|
2243
2251
|
"enter-from-class": "max-h-0 opacity-0 overflow-hidden",
|
|
2244
2252
|
"enter-to-class": "max-h-[2000px] opacity-100 overflow-hidden",
|
|
@@ -2246,14 +2254,14 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2246
2254
|
"leave-from-class": "max-h-[2000px] opacity-100 overflow-hidden",
|
|
2247
2255
|
"leave-to-class": "max-h-0 opacity-0 overflow-hidden"
|
|
2248
2256
|
}, {
|
|
2249
|
-
default:
|
|
2250
|
-
|
|
2251
|
-
id: e.collapsible ? `fc-group-body-${
|
|
2257
|
+
default: _(() => [
|
|
2258
|
+
ce(h("div", {
|
|
2259
|
+
id: e.collapsible ? `fc-group-body-${u.value}` : void 0,
|
|
2252
2260
|
class: "p-4"
|
|
2253
2261
|
}, [
|
|
2254
|
-
Z(
|
|
2262
|
+
Z(oe, { nodes: e.children }, null, 8, ["nodes"])
|
|
2255
2263
|
], 8, Ya), [
|
|
2256
|
-
[Re, !
|
|
2264
|
+
[Re, !a.value]
|
|
2257
2265
|
])
|
|
2258
2266
|
]),
|
|
2259
2267
|
_: 1
|
|
@@ -2267,10 +2275,10 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2267
2275
|
className: {}
|
|
2268
2276
|
},
|
|
2269
2277
|
setup(e) {
|
|
2270
|
-
const
|
|
2271
|
-
return (
|
|
2272
|
-
class:
|
|
2273
|
-
innerHTML:
|
|
2278
|
+
const i = e, a = x(() => Ae(i.content));
|
|
2279
|
+
return (t, u) => (d(), f("div", {
|
|
2280
|
+
class: T([e.className ?? "", "fc-html prose prose-sm max-w-none text-gray-700"]),
|
|
2281
|
+
innerHTML: a.value
|
|
2274
2282
|
}, null, 10, Wa));
|
|
2275
2283
|
}
|
|
2276
2284
|
}), Qa = /* @__PURE__ */ j({
|
|
@@ -2282,18 +2290,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2282
2290
|
className: {}
|
|
2283
2291
|
},
|
|
2284
2292
|
setup(e) {
|
|
2285
|
-
const
|
|
2293
|
+
const i = e, a = x(() => ({
|
|
2286
2294
|
start: "items-start",
|
|
2287
2295
|
center: "items-center",
|
|
2288
2296
|
end: "items-end",
|
|
2289
2297
|
stretch: "items-stretch"
|
|
2290
|
-
})[
|
|
2291
|
-
return (
|
|
2292
|
-
class:
|
|
2293
|
-
style:
|
|
2298
|
+
})[i.align] ?? "items-stretch"), t = x(() => i.gap ? typeof i.gap == "number" ? `${i.gap}px` : i.gap : "");
|
|
2299
|
+
return (u, n) => (d(), f("div", {
|
|
2300
|
+
class: T(["grid grid-cols-12", [a.value, e.className ?? ""]]),
|
|
2301
|
+
style: O(t.value ? { gap: t.value } : { gap: "1rem" }),
|
|
2294
2302
|
role: "group"
|
|
2295
2303
|
}, [
|
|
2296
|
-
Z(
|
|
2304
|
+
Z(oe, { nodes: e.children }, null, 8, ["nodes"])
|
|
2297
2305
|
], 6));
|
|
2298
2306
|
}
|
|
2299
2307
|
}), Xa = {
|
|
@@ -2323,84 +2331,84 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2323
2331
|
className: {}
|
|
2324
2332
|
},
|
|
2325
2333
|
setup(e) {
|
|
2326
|
-
const
|
|
2327
|
-
function r(
|
|
2328
|
-
const
|
|
2329
|
-
function
|
|
2330
|
-
for (const
|
|
2331
|
-
if (Ce(
|
|
2332
|
-
|
|
2333
|
-
else if (
|
|
2334
|
-
|
|
2335
|
-
else if (
|
|
2336
|
-
for (const
|
|
2337
|
-
else if (
|
|
2338
|
-
for (const
|
|
2334
|
+
const i = e, a = Y(fe), t = M(0), u = M(/* @__PURE__ */ new Set()), n = x(() => i.steps), c = x(() => n.value.length), l = x(() => t.value === 0), o = x(() => t.value === c.value - 1);
|
|
2335
|
+
function r(y) {
|
|
2336
|
+
const v = [];
|
|
2337
|
+
function g(p) {
|
|
2338
|
+
for (const N of p)
|
|
2339
|
+
if (Ce(N))
|
|
2340
|
+
v.push(N.name);
|
|
2341
|
+
else if (N.type === "row" || N.type === "group")
|
|
2342
|
+
g(N.children);
|
|
2343
|
+
else if (N.type === "steps")
|
|
2344
|
+
for (const B of N.steps) g(B.children);
|
|
2345
|
+
else if (N.type === "tabs")
|
|
2346
|
+
for (const B of N.tabs) g(B.children);
|
|
2339
2347
|
}
|
|
2340
|
-
return
|
|
2341
|
-
}
|
|
2342
|
-
async function
|
|
2343
|
-
if (!
|
|
2344
|
-
const
|
|
2345
|
-
if (!
|
|
2346
|
-
const
|
|
2347
|
-
let
|
|
2348
|
-
for (const
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2348
|
+
return g(y.children), v;
|
|
2349
|
+
}
|
|
2350
|
+
async function s() {
|
|
2351
|
+
if (!a || !i.linear) return !0;
|
|
2352
|
+
const y = n.value[t.value];
|
|
2353
|
+
if (!y) return !0;
|
|
2354
|
+
const v = r(y);
|
|
2355
|
+
let g = !0;
|
|
2356
|
+
for (const p of v) {
|
|
2357
|
+
const N = await a.validateField(p);
|
|
2358
|
+
a.touched[p] = !0, N.length > 0 && (g = !1);
|
|
2351
2359
|
}
|
|
2352
|
-
return
|
|
2360
|
+
return g;
|
|
2353
2361
|
}
|
|
2354
2362
|
async function k() {
|
|
2355
|
-
|
|
2363
|
+
o.value || i.linear && !await s() || (u.value.add(t.value), t.value++);
|
|
2356
2364
|
}
|
|
2357
|
-
function
|
|
2358
|
-
l.value ||
|
|
2365
|
+
function S() {
|
|
2366
|
+
l.value || t.value--;
|
|
2359
2367
|
}
|
|
2360
|
-
function
|
|
2361
|
-
|
|
2368
|
+
function F(y) {
|
|
2369
|
+
i.linear && y > t.value || (t.value = y);
|
|
2362
2370
|
}
|
|
2363
|
-
return (
|
|
2364
|
-
class:
|
|
2371
|
+
return (y, v) => (d(), f("div", {
|
|
2372
|
+
class: T([e.className ?? "", "space-y-6"])
|
|
2365
2373
|
}, [
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
(
|
|
2369
|
-
key:
|
|
2374
|
+
h("nav", Xa, [
|
|
2375
|
+
h("ol", el, [
|
|
2376
|
+
(d(!0), f(z, null, G(n.value, (g, p) => (d(), f("li", {
|
|
2377
|
+
key: p,
|
|
2370
2378
|
class: "flex items-center"
|
|
2371
2379
|
}, [
|
|
2372
|
-
|
|
2380
|
+
h("button", {
|
|
2373
2381
|
type: "button",
|
|
2374
|
-
disabled: e.linear &&
|
|
2375
|
-
"aria-current":
|
|
2376
|
-
"aria-label": `Step ${
|
|
2377
|
-
class:
|
|
2378
|
-
|
|
2379
|
-
e.linear &&
|
|
2382
|
+
disabled: e.linear && p > t.value,
|
|
2383
|
+
"aria-current": p === t.value ? "step" : void 0,
|
|
2384
|
+
"aria-label": `Step ${p + 1}: ${g.title}`,
|
|
2385
|
+
class: T(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40", [
|
|
2386
|
+
u.value.has(p) && p !== t.value ? "border-green-500 bg-green-500 text-white" : p !== t.value ? "border-gray-300 bg-white text-gray-500" : "text-white",
|
|
2387
|
+
e.linear && p > t.value ? "cursor-not-allowed" : "cursor-pointer hover:shadow-md"
|
|
2380
2388
|
]]),
|
|
2381
|
-
style:
|
|
2382
|
-
onClick: (
|
|
2389
|
+
style: O(p === t.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
2390
|
+
onClick: (N) => F(p)
|
|
2383
2391
|
}, [
|
|
2384
|
-
|
|
2385
|
-
|
|
2392
|
+
u.value.has(p) && p !== t.value ? (d(), f("svg", al, [...v[0] || (v[0] = [
|
|
2393
|
+
h("path", {
|
|
2386
2394
|
"fill-rule": "evenodd",
|
|
2387
2395
|
d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
|
|
2388
2396
|
"clip-rule": "evenodd"
|
|
2389
2397
|
}, null, -1)
|
|
2390
|
-
])])) : (
|
|
2398
|
+
])])) : (d(), f("span", ll, A(p + 1), 1))
|
|
2391
2399
|
], 14, tl),
|
|
2392
|
-
|
|
2400
|
+
p < n.value.length - 1 ? (d(), f("div", {
|
|
2393
2401
|
key: 0,
|
|
2394
|
-
class:
|
|
2395
|
-
}, null, 2)) :
|
|
2402
|
+
class: T(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12", u.value.has(p) ? "bg-green-500" : "bg-gray-200"])
|
|
2403
|
+
}, null, 2)) : I("", !0)
|
|
2396
2404
|
]))), 128))
|
|
2397
2405
|
])
|
|
2398
2406
|
]),
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
])) :
|
|
2403
|
-
Z(
|
|
2407
|
+
n.value[t.value] ? (d(), f("div", nl, [
|
|
2408
|
+
h("h3", ol, A(n.value[t.value].title), 1),
|
|
2409
|
+
n.value[t.value].description ? (d(), f("p", rl, A(n.value[t.value].description), 1)) : I("", !0)
|
|
2410
|
+
])) : I("", !0),
|
|
2411
|
+
Z(ae, {
|
|
2404
2412
|
mode: "out-in",
|
|
2405
2413
|
"enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
|
|
2406
2414
|
"enter-from-class": "opacity-0 translate-x-2",
|
|
@@ -2409,24 +2417,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2409
2417
|
"leave-from-class": "opacity-100 translate-x-0",
|
|
2410
2418
|
"leave-to-class": "opacity-0 -translate-x-2"
|
|
2411
2419
|
}, {
|
|
2412
|
-
default:
|
|
2413
|
-
|
|
2414
|
-
Z(
|
|
2415
|
-
nodes:
|
|
2420
|
+
default: _(() => [
|
|
2421
|
+
n.value[t.value] ? (d(), f("div", { key: t.value }, [
|
|
2422
|
+
Z(oe, {
|
|
2423
|
+
nodes: n.value[t.value].children
|
|
2416
2424
|
}, null, 8, ["nodes"])
|
|
2417
|
-
])) :
|
|
2425
|
+
])) : I("", !0)
|
|
2418
2426
|
]),
|
|
2419
2427
|
_: 1
|
|
2420
2428
|
}),
|
|
2421
|
-
|
|
2422
|
-
|
|
2429
|
+
h("div", sl, [
|
|
2430
|
+
h("button", {
|
|
2423
2431
|
type: "button",
|
|
2424
2432
|
disabled: l.value,
|
|
2425
2433
|
class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",
|
|
2426
|
-
onClick:
|
|
2434
|
+
onClick: S
|
|
2427
2435
|
}, " Previous ", 8, il),
|
|
2428
|
-
|
|
2429
|
-
|
|
2436
|
+
h("span", ul, A(t.value + 1) + " / " + A(c.value), 1),
|
|
2437
|
+
o.value ? (d(), f("div", dl)) : (d(), f("button", {
|
|
2430
2438
|
key: 0,
|
|
2431
2439
|
type: "button",
|
|
2432
2440
|
class: "rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",
|
|
@@ -2451,57 +2459,57 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2451
2459
|
className: {}
|
|
2452
2460
|
},
|
|
2453
2461
|
setup(e) {
|
|
2454
|
-
const
|
|
2455
|
-
function
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2458
|
-
}
|
|
2459
|
-
function
|
|
2460
|
-
var
|
|
2461
|
-
const r =
|
|
2462
|
-
let
|
|
2462
|
+
const i = e, a = M(0), t = x(() => i.tabs);
|
|
2463
|
+
function u(l) {
|
|
2464
|
+
const o = t.value[l];
|
|
2465
|
+
o != null && o.disabled || (a.value = l);
|
|
2466
|
+
}
|
|
2467
|
+
function n(l, o) {
|
|
2468
|
+
var S;
|
|
2469
|
+
const r = t.value.length;
|
|
2470
|
+
let s = o;
|
|
2463
2471
|
if (l.key === "ArrowRight" || l.key === "ArrowDown")
|
|
2464
|
-
l.preventDefault(),
|
|
2472
|
+
l.preventDefault(), s = (o + 1) % r;
|
|
2465
2473
|
else if (l.key === "ArrowLeft" || l.key === "ArrowUp")
|
|
2466
|
-
l.preventDefault(),
|
|
2474
|
+
l.preventDefault(), s = (o - 1 + r) % r;
|
|
2467
2475
|
else if (l.key === "Home")
|
|
2468
|
-
l.preventDefault(),
|
|
2476
|
+
l.preventDefault(), s = 0;
|
|
2469
2477
|
else if (l.key === "End")
|
|
2470
|
-
l.preventDefault(),
|
|
2478
|
+
l.preventDefault(), s = r - 1;
|
|
2471
2479
|
else
|
|
2472
2480
|
return;
|
|
2473
|
-
for (; (
|
|
2474
|
-
l.key === "ArrowLeft" || l.key === "ArrowUp" ?
|
|
2475
|
-
s
|
|
2476
|
-
const k = document.getElementById(`fc-tab-${
|
|
2481
|
+
for (; (S = t.value[s]) != null && S.disabled && s !== o; )
|
|
2482
|
+
l.key === "ArrowLeft" || l.key === "ArrowUp" ? s = (s - 1 + r) % r : s = (s + 1) % r;
|
|
2483
|
+
u(s);
|
|
2484
|
+
const k = document.getElementById(`fc-tab-${s}`);
|
|
2477
2485
|
k == null || k.focus();
|
|
2478
2486
|
}
|
|
2479
|
-
const
|
|
2480
|
-
return (l,
|
|
2481
|
-
class:
|
|
2487
|
+
const c = x(() => `fc-tabpanel-${a.value}`);
|
|
2488
|
+
return (l, o) => (d(), f("div", {
|
|
2489
|
+
class: T(e.className ?? "")
|
|
2482
2490
|
}, [
|
|
2483
|
-
|
|
2484
|
-
(
|
|
2485
|
-
key:
|
|
2486
|
-
id: `fc-tab-${
|
|
2491
|
+
h("div", fl, [
|
|
2492
|
+
(d(!0), f(z, null, G(t.value, (r, s) => (d(), f("button", {
|
|
2493
|
+
key: s,
|
|
2494
|
+
id: `fc-tab-${s}`,
|
|
2487
2495
|
type: "button",
|
|
2488
2496
|
role: "tab",
|
|
2489
|
-
"aria-selected":
|
|
2490
|
-
"aria-controls":
|
|
2497
|
+
"aria-selected": s === a.value,
|
|
2498
|
+
"aria-controls": c.value,
|
|
2491
2499
|
"aria-disabled": r.disabled || void 0,
|
|
2492
|
-
tabindex:
|
|
2493
|
-
class:
|
|
2494
|
-
|
|
2500
|
+
tabindex: s === a.value ? 0 : -1,
|
|
2501
|
+
class: T(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40", [
|
|
2502
|
+
s !== a.value ? r.disabled ? "cursor-not-allowed text-gray-300" : "text-gray-500 hover:text-gray-700" : ""
|
|
2495
2503
|
]]),
|
|
2496
|
-
style:
|
|
2497
|
-
onClick: (k) => s
|
|
2498
|
-
onKeydown: (k) =>
|
|
2504
|
+
style: O(s === a.value ? { color: "var(--fc-color-primary, #3b82f6)" } : {}),
|
|
2505
|
+
onClick: (k) => u(s),
|
|
2506
|
+
onKeydown: (k) => n(k, s)
|
|
2499
2507
|
}, [
|
|
2500
|
-
|
|
2501
|
-
|
|
2508
|
+
Q(A(r.title) + " ", 1),
|
|
2509
|
+
s === a.value ? (d(), f("span", bl)) : I("", !0)
|
|
2502
2510
|
], 46, ml))), 128))
|
|
2503
2511
|
]),
|
|
2504
|
-
Z(
|
|
2512
|
+
Z(ae, {
|
|
2505
2513
|
mode: "out-in",
|
|
2506
2514
|
"enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
|
|
2507
2515
|
"enter-from-class": "opacity-0 translate-y-1",
|
|
@@ -2510,65 +2518,65 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2510
2518
|
"leave-from-class": "opacity-100 translate-y-0",
|
|
2511
2519
|
"leave-to-class": "opacity-0 -translate-y-1"
|
|
2512
2520
|
}, {
|
|
2513
|
-
default:
|
|
2514
|
-
|
|
2515
|
-
key:
|
|
2516
|
-
id:
|
|
2521
|
+
default: _(() => [
|
|
2522
|
+
t.value[a.value] ? (d(), f("div", {
|
|
2523
|
+
key: a.value,
|
|
2524
|
+
id: c.value,
|
|
2517
2525
|
role: "tabpanel",
|
|
2518
|
-
"aria-labelledby": `fc-tab-${
|
|
2526
|
+
"aria-labelledby": `fc-tab-${a.value}`,
|
|
2519
2527
|
tabindex: "0",
|
|
2520
2528
|
class: "pt-4"
|
|
2521
2529
|
}, [
|
|
2522
|
-
Z(
|
|
2523
|
-
nodes:
|
|
2530
|
+
Z(oe, {
|
|
2531
|
+
nodes: t.value[a.value].children
|
|
2524
2532
|
}, null, 8, ["nodes"])
|
|
2525
|
-
], 8, vl)) :
|
|
2533
|
+
], 8, vl)) : I("", !0)
|
|
2526
2534
|
]),
|
|
2527
2535
|
_: 1
|
|
2528
2536
|
})
|
|
2529
2537
|
], 2));
|
|
2530
2538
|
}
|
|
2531
|
-
}),
|
|
2539
|
+
}), oe = /* @__PURE__ */ j({
|
|
2532
2540
|
__name: "LayoutRenderer",
|
|
2533
2541
|
props: {
|
|
2534
2542
|
nodes: {}
|
|
2535
2543
|
},
|
|
2536
2544
|
setup(e) {
|
|
2537
|
-
const
|
|
2538
|
-
function
|
|
2539
|
-
return
|
|
2545
|
+
const i = Y(fe);
|
|
2546
|
+
function a(u) {
|
|
2547
|
+
return i ? ie(u.condition, i.values) : !0;
|
|
2540
2548
|
}
|
|
2541
|
-
function
|
|
2542
|
-
return
|
|
2549
|
+
function t(u) {
|
|
2550
|
+
return u === "full" ? { gridColumn: "1 / -1" } : u === "auto" ? { gridColumn: "auto" } : typeof u == "number" ? { gridColumn: `span ${u} / span ${u}` } : { gridColumn: "span 12 / span 12" };
|
|
2543
2551
|
}
|
|
2544
|
-
return (
|
|
2545
|
-
const
|
|
2546
|
-
return
|
|
2552
|
+
return (u, n) => {
|
|
2553
|
+
const c = je("LayoutRenderer", !0);
|
|
2554
|
+
return d(!0), f(z, null, G(e.nodes, (l, o) => {
|
|
2547
2555
|
var r;
|
|
2548
|
-
return
|
|
2549
|
-
|
|
2556
|
+
return d(), f(z, { key: o }, [
|
|
2557
|
+
q(Ce)(l) ? (d(), f("div", {
|
|
2550
2558
|
key: 0,
|
|
2551
|
-
class:
|
|
2552
|
-
style:
|
|
2559
|
+
class: T(l.className ?? ""),
|
|
2560
|
+
style: O(t(l.span))
|
|
2553
2561
|
}, [
|
|
2554
2562
|
Z($e, {
|
|
2555
2563
|
name: l.name
|
|
2556
2564
|
}, null, 8, ["name"])
|
|
2557
|
-
], 6)) : l.type === "field" ? (
|
|
2565
|
+
], 6)) : l.type === "field" ? (d(), f("div", {
|
|
2558
2566
|
key: 1,
|
|
2559
|
-
class:
|
|
2560
|
-
style:
|
|
2567
|
+
class: T(l.className ?? ""),
|
|
2568
|
+
style: O(t(l.span))
|
|
2561
2569
|
}, [
|
|
2562
2570
|
Z($e, {
|
|
2563
2571
|
name: l.name
|
|
2564
2572
|
}, null, 8, ["name"])
|
|
2565
|
-
], 6)) : l.type === "row" ? (
|
|
2573
|
+
], 6)) : l.type === "row" ? (d(), H(Qa, {
|
|
2566
2574
|
key: 2,
|
|
2567
2575
|
children: l.children,
|
|
2568
2576
|
gap: l.gap,
|
|
2569
2577
|
align: l.align,
|
|
2570
2578
|
"class-name": l.className
|
|
2571
|
-
}, null, 8, ["children", "gap", "align", "class-name"])) : l.type === "group" ? (
|
|
2579
|
+
}, null, 8, ["children", "gap", "align", "class-name"])) : l.type === "group" ? (d(), H(Ja, {
|
|
2572
2580
|
key: 3,
|
|
2573
2581
|
title: l.title,
|
|
2574
2582
|
description: l.description,
|
|
@@ -2576,32 +2584,32 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2576
2584
|
collapsed: l.collapsed,
|
|
2577
2585
|
children: l.children,
|
|
2578
2586
|
"class-name": l.className
|
|
2579
|
-
}, null, 8, ["title", "description", "collapsible", "collapsed", "children", "class-name"])) : l.type === "steps" ? (
|
|
2587
|
+
}, null, 8, ["title", "description", "collapsible", "collapsed", "children", "class-name"])) : l.type === "steps" ? (d(), H(cl, {
|
|
2580
2588
|
key: 4,
|
|
2581
2589
|
steps: l.steps,
|
|
2582
2590
|
linear: l.linear,
|
|
2583
2591
|
"class-name": l.className
|
|
2584
|
-
}, null, 8, ["steps", "linear", "class-name"])) : l.type === "tabs" ? (
|
|
2592
|
+
}, null, 8, ["steps", "linear", "class-name"])) : l.type === "tabs" ? (d(), H(yl, {
|
|
2585
2593
|
key: 5,
|
|
2586
2594
|
tabs: l.tabs,
|
|
2587
2595
|
"class-name": l.className
|
|
2588
|
-
}, null, 8, ["tabs", "class-name"])) : l.type === "divider" ? (
|
|
2596
|
+
}, null, 8, ["tabs", "class-name"])) : l.type === "divider" ? (d(), H(Ua, {
|
|
2589
2597
|
key: 6,
|
|
2590
2598
|
label: l.label,
|
|
2591
2599
|
"class-name": l.className
|
|
2592
|
-
}, null, 8, ["label", "class-name"])) : l.type === "html" ? (
|
|
2600
|
+
}, null, 8, ["label", "class-name"])) : l.type === "html" ? (d(), H(_a, {
|
|
2593
2601
|
key: 7,
|
|
2594
2602
|
content: l.content,
|
|
2595
2603
|
"class-name": l.className
|
|
2596
|
-
}, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (
|
|
2597
|
-
|
|
2604
|
+
}, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (d(), f(z, { key: 8 }, [
|
|
2605
|
+
a(l) ? (d(), H(c, {
|
|
2598
2606
|
key: 0,
|
|
2599
2607
|
nodes: l.children
|
|
2600
|
-
}, null, 8, ["nodes"])) : (r = l.elseChildren) != null && r.length ? (
|
|
2608
|
+
}, null, 8, ["nodes"])) : (r = l.elseChildren) != null && r.length ? (d(), H(c, {
|
|
2601
2609
|
key: 1,
|
|
2602
2610
|
nodes: l.elseChildren
|
|
2603
|
-
}, null, 8, ["nodes"])) :
|
|
2604
|
-
], 64)) :
|
|
2611
|
+
}, null, 8, ["nodes"])) : I("", !0)
|
|
2612
|
+
], 64)) : I("", !0)
|
|
2605
2613
|
], 64);
|
|
2606
2614
|
}), 128);
|
|
2607
2615
|
};
|
|
@@ -2631,10 +2639,10 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2631
2639
|
components: {}
|
|
2632
2640
|
},
|
|
2633
2641
|
emits: ["submit", "error", "update:modelValue"],
|
|
2634
|
-
setup(e, { expose:
|
|
2635
|
-
const
|
|
2636
|
-
() =>
|
|
2637
|
-
), r = x(() =>
|
|
2642
|
+
setup(e, { expose: i, emit: a }) {
|
|
2643
|
+
const t = e, u = a, n = Y(Te, void 0), c = x(() => t.theme ?? (n == null ? void 0 : n.theme)), l = x(() => t.locale ?? (n == null ? void 0 : n.locale) ?? "en"), o = x(
|
|
2644
|
+
() => t.fallbackLocale ?? (n == null ? void 0 : n.fallbackLocale) ?? "en"
|
|
2645
|
+
), r = x(() => t.components ?? (n == null ? void 0 : n.components) ?? {}), s = [
|
|
2638
2646
|
["text", La],
|
|
2639
2647
|
["number", Lt],
|
|
2640
2648
|
["textarea", Ca],
|
|
@@ -2649,106 +2657,127 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2649
2657
|
["tags", ka],
|
|
2650
2658
|
["phone", Gt]
|
|
2651
2659
|
];
|
|
2652
|
-
for (const [b,
|
|
2653
|
-
Pe(b) || Fe(b,
|
|
2654
|
-
|
|
2655
|
-
const k = K()
|
|
2660
|
+
for (const [b, m] of s)
|
|
2661
|
+
Pe(b) || Fe(b, m);
|
|
2662
|
+
ue(Be, r), tt(c);
|
|
2663
|
+
const k = K();
|
|
2664
|
+
function S(b) {
|
|
2665
|
+
return b.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2666
|
+
}
|
|
2667
|
+
const F = x(() => {
|
|
2668
|
+
const b = c.value;
|
|
2669
|
+
if (!b) return {};
|
|
2670
|
+
const m = {};
|
|
2671
|
+
if (b.colors)
|
|
2672
|
+
for (const [w, D] of Object.entries(b.colors))
|
|
2673
|
+
D && (m[`--fc-color-${S(w)}`] = D);
|
|
2674
|
+
if (b.borders)
|
|
2675
|
+
for (const [w, D] of Object.entries(b.borders))
|
|
2676
|
+
D && (m[`--fc-border-${S(w)}`] = D);
|
|
2677
|
+
if (b.spacing)
|
|
2678
|
+
for (const [w, D] of Object.entries(b.spacing))
|
|
2679
|
+
D && (m[`--fc-${S(w)}`] = D);
|
|
2680
|
+
if (b.typography)
|
|
2681
|
+
for (const [w, D] of Object.entries(b.typography))
|
|
2682
|
+
D && (m[`--fc-${S(w)}`] = D);
|
|
2683
|
+
return b.cssVars && Object.assign(m, b.cssVars), m;
|
|
2684
|
+
}), y = et(t.schema, {
|
|
2656
2685
|
locale: l.value,
|
|
2657
|
-
fallbackLocale:
|
|
2686
|
+
fallbackLocale: o.value
|
|
2658
2687
|
});
|
|
2659
|
-
if (
|
|
2660
|
-
for (const [b,
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
() =>
|
|
2688
|
+
if (t.modelValue)
|
|
2689
|
+
for (const [b, m] of Object.entries(t.modelValue))
|
|
2690
|
+
y.setFieldValue(b, m);
|
|
2691
|
+
W(
|
|
2692
|
+
() => t.modelValue,
|
|
2664
2693
|
(b) => {
|
|
2665
2694
|
if (b)
|
|
2666
|
-
for (const [
|
|
2667
|
-
|
|
2695
|
+
for (const [m, w] of Object.entries(b))
|
|
2696
|
+
y.values[m] !== w && y.setFieldValue(m, w);
|
|
2668
2697
|
},
|
|
2669
2698
|
{ deep: !0 }
|
|
2670
|
-
),
|
|
2671
|
-
() => ({ ...
|
|
2699
|
+
), W(
|
|
2700
|
+
() => ({ ...y.values }),
|
|
2672
2701
|
(b) => {
|
|
2673
|
-
|
|
2702
|
+
u("update:modelValue", b);
|
|
2674
2703
|
},
|
|
2675
2704
|
{ deep: !0 }
|
|
2676
|
-
),
|
|
2677
|
-
b &&
|
|
2705
|
+
), W(l, (b) => {
|
|
2706
|
+
b && y.setLocale(b);
|
|
2678
2707
|
}), Ze();
|
|
2679
|
-
const
|
|
2680
|
-
var
|
|
2681
|
-
const b =
|
|
2708
|
+
const v = x(() => {
|
|
2709
|
+
var D, P;
|
|
2710
|
+
const b = t.schema.translations;
|
|
2682
2711
|
if (!b) return "";
|
|
2683
|
-
const
|
|
2684
|
-
if ((
|
|
2685
|
-
const
|
|
2686
|
-
return ((
|
|
2687
|
-
}),
|
|
2688
|
-
var
|
|
2689
|
-
const b =
|
|
2712
|
+
const m = b[l.value];
|
|
2713
|
+
if ((D = m == null ? void 0 : m.messages) != null && D.title) return m.messages.title;
|
|
2714
|
+
const w = b[o.value];
|
|
2715
|
+
return ((P = w == null ? void 0 : w.messages) == null ? void 0 : P.title) ?? "";
|
|
2716
|
+
}), g = x(() => {
|
|
2717
|
+
var D, P;
|
|
2718
|
+
const b = t.schema.translations;
|
|
2690
2719
|
if (!b) return "";
|
|
2691
|
-
const
|
|
2692
|
-
if ((
|
|
2693
|
-
const
|
|
2694
|
-
return ((
|
|
2695
|
-
}),
|
|
2696
|
-
const b =
|
|
2720
|
+
const m = b[l.value];
|
|
2721
|
+
if ((D = m == null ? void 0 : m.messages) != null && D.description) return m.messages.description;
|
|
2722
|
+
const w = b[o.value];
|
|
2723
|
+
return ((P = w == null ? void 0 : w.messages) == null ? void 0 : P.description) ?? "";
|
|
2724
|
+
}), p = x(() => {
|
|
2725
|
+
const b = t.schema.translations;
|
|
2697
2726
|
if (!b) return "Submit";
|
|
2698
|
-
const
|
|
2699
|
-
if (
|
|
2700
|
-
const
|
|
2701
|
-
return (
|
|
2702
|
-
}),
|
|
2703
|
-
const b =
|
|
2727
|
+
const m = b[l.value];
|
|
2728
|
+
if (m != null && m.submit) return m.submit;
|
|
2729
|
+
const w = b[o.value];
|
|
2730
|
+
return (w == null ? void 0 : w.submit) ?? "Submit";
|
|
2731
|
+
}), N = x(() => {
|
|
2732
|
+
const b = t.schema.translations;
|
|
2704
2733
|
if (!b) return "Reset";
|
|
2705
|
-
const
|
|
2706
|
-
if (
|
|
2707
|
-
const
|
|
2708
|
-
return (
|
|
2709
|
-
}),
|
|
2710
|
-
var b,
|
|
2711
|
-
return (
|
|
2734
|
+
const m = b[l.value];
|
|
2735
|
+
if (m != null && m.reset) return m.reset;
|
|
2736
|
+
const w = b[o.value];
|
|
2737
|
+
return (w == null ? void 0 : w.reset) ?? "Reset";
|
|
2738
|
+
}), B = x(() => {
|
|
2739
|
+
var b, m;
|
|
2740
|
+
return (m = (b = t.layout) == null ? void 0 : b.nodes) != null && m.length ? t.layout.nodes : t.schema.fields;
|
|
2712
2741
|
});
|
|
2713
|
-
async function
|
|
2742
|
+
async function C() {
|
|
2714
2743
|
try {
|
|
2715
|
-
await
|
|
2716
|
-
|
|
2744
|
+
await y.submit(async (b) => {
|
|
2745
|
+
u("submit", b);
|
|
2717
2746
|
});
|
|
2718
2747
|
} catch (b) {
|
|
2719
|
-
|
|
2748
|
+
u("error", b);
|
|
2720
2749
|
}
|
|
2721
2750
|
}
|
|
2722
2751
|
function V() {
|
|
2723
|
-
|
|
2752
|
+
y.reset();
|
|
2724
2753
|
}
|
|
2725
|
-
return
|
|
2726
|
-
class:
|
|
2727
|
-
style:
|
|
2754
|
+
return i({ form: y }), (b, m) => (d(), f("form", {
|
|
2755
|
+
class: T([q(k).classes.value.form, "fc-form-builder"]),
|
|
2756
|
+
style: O(F.value),
|
|
2728
2757
|
novalidate: "",
|
|
2729
|
-
onSubmit:
|
|
2730
|
-
onReset:
|
|
2758
|
+
onSubmit: J(C, ["prevent"]),
|
|
2759
|
+
onReset: J(V, ["prevent"])
|
|
2731
2760
|
}, [
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
])) :
|
|
2736
|
-
Z(
|
|
2737
|
-
|
|
2738
|
-
|
|
2761
|
+
v.value || g.value ? (d(), f("div", pl, [
|
|
2762
|
+
v.value ? (d(), f("h2", gl, A(v.value), 1)) : I("", !0),
|
|
2763
|
+
g.value ? (d(), f("p", hl, A(g.value), 1)) : I("", !0)
|
|
2764
|
+
])) : I("", !0),
|
|
2765
|
+
Z(oe, { nodes: B.value }, null, 8, ["nodes"]),
|
|
2766
|
+
h("div", xl, [
|
|
2767
|
+
h("button", {
|
|
2739
2768
|
type: "submit",
|
|
2740
|
-
disabled:
|
|
2741
|
-
class:
|
|
2769
|
+
disabled: q(y).isSubmitting.value,
|
|
2770
|
+
class: T([q(k).classes.value.button, "fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),
|
|
2742
2771
|
style: { "background-color": "var(--fc-color-primary, #3b82f6)" }
|
|
2743
2772
|
}, [
|
|
2744
|
-
|
|
2745
|
-
|
|
2773
|
+
q(y).isSubmitting.value ? (d(), f("span", wl)) : I("", !0),
|
|
2774
|
+
Q(" " + A(p.value), 1)
|
|
2746
2775
|
], 10, kl),
|
|
2747
|
-
|
|
2776
|
+
h("button", {
|
|
2748
2777
|
type: "reset",
|
|
2749
|
-
disabled:
|
|
2778
|
+
disabled: q(y).isSubmitting.value,
|
|
2750
2779
|
class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"
|
|
2751
|
-
},
|
|
2780
|
+
}, A(N.value), 9, $l)
|
|
2752
2781
|
])
|
|
2753
2782
|
], 38));
|
|
2754
2783
|
}
|
|
@@ -2756,8 +2785,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
|
|
|
2756
2785
|
export {
|
|
2757
2786
|
Il as FormBuilder,
|
|
2758
2787
|
Be as FormComponentsKey,
|
|
2759
|
-
|
|
2760
|
-
|
|
2788
|
+
fe as FormContextKey,
|
|
2789
|
+
pe as FormI18nKey,
|
|
2761
2790
|
Te as FormaticaKey,
|
|
2762
2791
|
Tl as createFormatica,
|
|
2763
2792
|
Ke as getFieldComponent,
|