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