@wssto2/vue-core 0.21.0 → 0.22.0
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/CHANGELOG.md +13 -0
- package/dist/{Activity-CZzAt3SH.js → Activity-COtW_n6d.js} +1 -1
- package/dist/{Changes-B0bhSNU3.js → Changes-DGjV18aQ.js} +1 -1
- package/dist/{General-BGT9H69S.js → General-xayJ3Y-j.js} +1 -1
- package/dist/{NewRolePage-B0Y5MrTu.js → NewRolePage-B2qo3_Ht.js} +2 -2
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-CJMV9BDQ.js → PersonAccess.vue_vue_type_script_setup_true_lang-DrD0Y-Zm.js} +1 -1
- package/dist/{ProfilePage-CMy2Dkr2.js → ProfilePage-KK6lV4Yd.js} +1 -1
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CMo8PrO7.js → RoleEditor.vue_vue_type_script_setup_true_lang-DbyVIoj9.js} +2 -2
- package/dist/{RolePage-DGFISfM1.js → RolePage-QLKrhjd_.js} +2 -2
- package/dist/{RolesPage-Bq9EVB_3.js → RolesPage-UHWfuxiU.js} +1 -1
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-DtVXUOdP.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-qKkn3XrU.js} +1 -1
- package/dist/{ServiceAccountRecord-Dc7Gn52W.js → ServiceAccountRecord-04tOH3XA.js} +3 -3
- package/dist/{ServiceAccountsList-DBUFeka-.js → ServiceAccountsList-CDtwLH3o.js} +2 -2
- package/dist/{Sessions-BMmqYZrJ.js → Sessions-BClXu0cg.js} +1 -1
- package/dist/{SignIn-uFn1ZWG8.js → SignIn-BVQtcHZv.js} +1 -1
- package/dist/{SignInPage-DouCg9aD.js → SignInPage-2ocu1_7y.js} +1 -1
- package/dist/{SignIns-CqN5UNmh.js → SignIns-CdUgFZ1e.js} +1 -1
- package/dist/{UserRecord-CH5oNRLg.js → UserRecord-Ces8OW7J.js} +1 -1
- package/dist/{UsersList-BmxWpt9h.js → UsersList-Ad4zHRYa.js} +1 -1
- package/dist/access/index.js +4 -4
- package/dist/form/dynamic/schema.d.ts +4 -0
- package/dist/form/index.js +277 -275
- package/dist/identity/index.js +1 -1
- package/dist/{index-C_ZVaTkR.js → index-DlD5ZlZq.js} +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -2
- package/src/styles/base.css +6 -0
package/dist/form/index.js
CHANGED
|
@@ -74,7 +74,7 @@ const Qe = (o, t) => {
|
|
|
74
74
|
return o.number(e, { minimumFractionDigits: a, maximumFractionDigits: a });
|
|
75
75
|
};
|
|
76
76
|
function wr({ i18n: o, format: t }) {
|
|
77
|
-
const { t: e, te: a } = o.global, r = (i) => `validation_errors.${i}`,
|
|
77
|
+
const { t: e, te: a } = o.global, r = (i) => `validation_errors.${i}`, s = (i) => `core.validation_errors.${i}`, p = (i, m) => ({ message: e(a(r(i)) ? r(i) : s(i), m) });
|
|
78
78
|
return (i) => {
|
|
79
79
|
switch (i.code) {
|
|
80
80
|
case "invalid_type":
|
|
@@ -89,7 +89,7 @@ function wr({ i18n: o, format: t }) {
|
|
|
89
89
|
const m = i.params?.code;
|
|
90
90
|
if (typeof m != "string") return;
|
|
91
91
|
if (m === "required") return p("required");
|
|
92
|
-
const b = a(r(m)) ? r(m) : a(
|
|
92
|
+
const b = a(r(m)) ? r(m) : a(s(m)) ? s(m) : null;
|
|
93
93
|
return b === null ? void 0 : { message: e(b) };
|
|
94
94
|
}
|
|
95
95
|
default:
|
|
@@ -123,7 +123,7 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
123
123
|
}, { ...ue, modelValue: null, columns: 2 }),
|
|
124
124
|
emits: ["update:modelValue"],
|
|
125
125
|
setup(o, { emit: t }) {
|
|
126
|
-
const e = o, a = t, { editable: r } = Be(e),
|
|
126
|
+
const e = o, a = t, { editable: r } = Be(e), s = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" }, p = M(() => s[e.columns]);
|
|
127
127
|
return (i, m) => (c(), T(fe, N(u(re)(e), {
|
|
128
128
|
value: e.options.find((b) => b.value === e.modelValue)?.label ?? null,
|
|
129
129
|
"row-layout": "stacked"
|
|
@@ -215,7 +215,7 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
215
215
|
}),
|
|
216
216
|
emits: ["update:modelValue"],
|
|
217
217
|
setup(o) {
|
|
218
|
-
const t = o, e = ye(o, "modelValue"), a = !!pt(), r = it(),
|
|
218
|
+
const t = o, e = ye(o, "modelValue"), a = !!pt(), r = it(), s = () => {
|
|
219
219
|
t.disabled || (e.value = !e.value);
|
|
220
220
|
};
|
|
221
221
|
return (p, i) => (c(), k("div", {
|
|
@@ -231,10 +231,10 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
231
231
|
tabindex: t.disabled ? -1 : 0,
|
|
232
232
|
"data-test": "checkbox",
|
|
233
233
|
class: G(["flex items-center transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", [t.variant === "row" ? "gap-3 pl-row-inset focus-visible:-outline-offset-2" : "gap-2.5 rounded-control px-2 py-1.5 focus-visible:outline-offset-1", a && t.variant === "row" ? "group-first/check:rounded-t-group group-last/check:rounded-b-group" : "", t.disabled ? "cursor-not-allowed" : t.variant === "row" ? "cursor-pointer hover:bg-fill/60 active:bg-fill" : "cursor-pointer hover:bg-fill"]]),
|
|
234
|
-
onClick:
|
|
234
|
+
onClick: s,
|
|
235
235
|
onKeydown: [
|
|
236
|
-
Se(be(
|
|
237
|
-
Se(be(
|
|
236
|
+
Se(be(s, ["prevent"]), ["space"]),
|
|
237
|
+
Se(be(s, ["prevent"]), ["enter"])
|
|
238
238
|
]
|
|
239
239
|
}, [
|
|
240
240
|
V("span", {
|
|
@@ -303,8 +303,8 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
303
303
|
}),
|
|
304
304
|
emits: ["update:modelValue"],
|
|
305
305
|
setup(o) {
|
|
306
|
-
const t = o, e = ye(o, "modelValue"), a = (r) => e.value = e.value.includes(r) ? e.value.filter((
|
|
307
|
-
return (r,
|
|
306
|
+
const t = o, e = ye(o, "modelValue"), a = (r) => e.value = e.value.includes(r) ? e.value.filter((s) => s !== r) : [...e.value, r];
|
|
307
|
+
return (r, s) => (c(), T(fe, N(u(re)(t), {
|
|
308
308
|
value: t.options.filter((p) => e.value.includes(p.value)).map((p) => p.label).join(", ") || null,
|
|
309
309
|
"row-layout": "stacked"
|
|
310
310
|
}), se({
|
|
@@ -394,7 +394,7 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
394
394
|
}),
|
|
395
395
|
emits: /* @__PURE__ */ me(["picked", "focus", "blur"], ["update:modelValue"]),
|
|
396
396
|
setup(o, { expose: t, emit: e }) {
|
|
397
|
-
const a = o, r = ye(o, "modelValue"),
|
|
397
|
+
const a = o, r = ye(o, "modelValue"), s = e, { t: p } = J(), i = !!pt(), m = ft("text", () => a.error ? "error" : a.disabled ? "locked" : "rest"), b = M(() => a.rowLayout === "stacked"), g = M(() => i && !b.value ? Et(a.width) : "w-full"), h = oe("input"), l = oe("anchor"), f = He(null), d = He(""), w = Nt({
|
|
398
398
|
source: () => a.search ?? a.options,
|
|
399
399
|
minLength: () => a.minLength,
|
|
400
400
|
debounce: () => a.debounce,
|
|
@@ -412,13 +412,13 @@ const ka = ["id", "aria-label", "aria-describedby", "aria-invalid"], _a = ["name
|
|
|
412
412
|
d.value = D.target.value, w.ask(d.value), d.value === "" && (r.value = null, f.value = null);
|
|
413
413
|
}
|
|
414
414
|
function I(D) {
|
|
415
|
-
|
|
415
|
+
s("focus", D), a.disabled || w.show("");
|
|
416
416
|
}
|
|
417
417
|
function R(D) {
|
|
418
|
-
w.close(), w.remember(D), f.value = D, r.value = D.value, d.value = D.label,
|
|
418
|
+
w.close(), w.remember(D), f.value = D, r.value = D.value, d.value = D.label, s("picked", D);
|
|
419
419
|
}
|
|
420
420
|
function L(D) {
|
|
421
|
-
w.close(), d.value = $.value?.label ?? "",
|
|
421
|
+
w.close(), d.value = $.value?.label ?? "", s("blur", D);
|
|
422
422
|
}
|
|
423
423
|
const W = M(() => Ut(y.value, _.value.length, S.value, !0));
|
|
424
424
|
return t({ focus: () => h.value?.focus() }), (D, Q) => (c(), T(fe, N(u(re)(a), {
|
|
@@ -582,9 +582,9 @@ const Na = {
|
|
|
582
582
|
}),
|
|
583
583
|
emits: /* @__PURE__ */ me(["focus", "blur"], ["update:modelValue"]),
|
|
584
584
|
setup(o, { expose: t, emit: e }) {
|
|
585
|
-
const a = o, r = ye(o, "modelValue"),
|
|
586
|
-
function B(
|
|
587
|
-
const { date: v, time: U } = ea(
|
|
585
|
+
const a = o, r = ye(o, "modelValue"), s = e, { t: p } = J(), i = aa(), m = Ue(), b = oe("input"), g = oe("popover"), h = oe("calendar"), l = oe("sheet"), f = M(() => ({ min: a.min?.slice(0, 10), max: a.max?.slice(0, 10), disabled: a.disabledDates })), d = M(() => a.min && a.min.length === 10 ? `${a.min}T00:00` : a.min), w = M(() => a.max && a.max.length === 10 ? `${a.max}T23:59` : a.max), _ = (n, v) => !Jt(v, { disabled: a.disabledDates }) && (!d.value || n >= d.value) && (!w.value || n <= w.value), y = Xt(() => f.value), S = oa(() => a.minuteStep), F = M(() => Ce(r.value));
|
|
586
|
+
function B(n) {
|
|
587
|
+
const { date: v, time: U } = ea(n), H = v === null ? F.value.day ?? qe() : y.parse(v);
|
|
588
588
|
if (!H) return { error: y.invalidMessage() };
|
|
589
589
|
let ee = F.value.time ?? De(a.minuteStep);
|
|
590
590
|
if (U !== null) {
|
|
@@ -595,32 +595,32 @@ const Na = {
|
|
|
595
595
|
const ne = $e(H, ee);
|
|
596
596
|
return _(ne, H) ? { value: ne } : { error: y.unavailableMessage() };
|
|
597
597
|
}
|
|
598
|
-
const $ = Ye({ model: r, display: (
|
|
598
|
+
const $ = Ye({ model: r, display: (n) => `${i.date(Ce(n).day)} ${Ce(n).time ?? ""}`.trim(), parse: B }), O = M({
|
|
599
599
|
get: () => F.value.time,
|
|
600
|
-
set: (
|
|
601
|
-
|
|
600
|
+
set: (n) => {
|
|
601
|
+
n && Pt(n) && (r.value = $e(F.value.day ?? qe(), n));
|
|
602
602
|
}
|
|
603
|
-
}), I = Ye({ model: O, display: (
|
|
604
|
-
const
|
|
605
|
-
return
|
|
603
|
+
}), I = Ye({ model: O, display: (n) => n, parse: S.parse }), R = Qt(() => a.quickPicks ?? (m.value ? void 0 : []), () => m.value, () => f.value), L = M(() => a.error || $.message.value || I.message.value), W = M(() => r.value ? i.dateTime(r.value) : null), D = ft("date", () => L.value ? "error" : a.disabled ? "locked" : "rest"), Q = M(() => {
|
|
604
|
+
const n = $.typed.value;
|
|
605
|
+
return n ? Ce(n).day ?? null : null;
|
|
606
606
|
}), te = M(() => Q.value ?? (Gt(F.value.day) ? F.value.day : null)), ge = M(() => $.typed.value ? Ce($.typed.value).time : F.value.time);
|
|
607
|
-
function pe(
|
|
608
|
-
|
|
607
|
+
function pe(n) {
|
|
608
|
+
n && $.set($e(n, F.value.time ?? De(a.minuteStep)));
|
|
609
609
|
}
|
|
610
|
-
function ve(
|
|
611
|
-
|
|
610
|
+
function ve(n) {
|
|
611
|
+
n && $.set($e(F.value.day ?? qe(), n));
|
|
612
612
|
}
|
|
613
|
-
function xe(
|
|
614
|
-
$.set($e(qe(), De(a.minuteStep))),
|
|
613
|
+
function xe(n) {
|
|
614
|
+
$.set($e(qe(), De(a.minuteStep))), n();
|
|
615
615
|
}
|
|
616
616
|
const he = it();
|
|
617
|
-
async function C(
|
|
618
|
-
a.disabled || (g.value?.present(),
|
|
617
|
+
async function C(n) {
|
|
618
|
+
a.disabled || (g.value?.present(), n && (await Ve(), await Ve(), h.value?.focus()));
|
|
619
619
|
}
|
|
620
|
-
function A(
|
|
621
|
-
|
|
620
|
+
function A(n) {
|
|
621
|
+
n.key === "Enter" ? ($.commit(), g.value?.dismiss()) : n.key === "ArrowDown" && (n.preventDefault(), C(!0));
|
|
622
622
|
}
|
|
623
|
-
return t({ focus: () => b.value?.focus() }), (
|
|
623
|
+
return t({ focus: () => b.value?.focus() }), (n, v) => (c(), T(fe, N({ ...u(re)(a), error: L.value }, {
|
|
624
624
|
value: W.value,
|
|
625
625
|
"value-style": "numeric"
|
|
626
626
|
}), se({
|
|
@@ -689,9 +689,9 @@ const Na = {
|
|
|
689
689
|
"aria-describedby": H,
|
|
690
690
|
class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
691
691
|
onInput: v[1] || (v[1] = (ke) => u($).input(ke.target.value)),
|
|
692
|
-
onFocus: v[2] || (v[2] = (ke) =>
|
|
692
|
+
onFocus: v[2] || (v[2] = (ke) => s("focus", ke)),
|
|
693
693
|
onBlur: v[3] || (v[3] = (ke) => {
|
|
694
|
-
u($).commit(),
|
|
694
|
+
u($).commit(), s("blur", ke);
|
|
695
695
|
}),
|
|
696
696
|
onKeydown: A,
|
|
697
697
|
onClick: v[4] || (v[4] = (ke) => C(!1))
|
|
@@ -768,24 +768,24 @@ const Na = {
|
|
|
768
768
|
]),
|
|
769
769
|
_: 2
|
|
770
770
|
}, [
|
|
771
|
-
|
|
771
|
+
n.$slots.trailing ? {
|
|
772
772
|
name: "trailing",
|
|
773
773
|
fn: x(() => [
|
|
774
|
-
j(
|
|
774
|
+
j(n.$slots, "trailing")
|
|
775
775
|
]),
|
|
776
776
|
key: "0"
|
|
777
777
|
} : void 0,
|
|
778
|
-
|
|
778
|
+
n.$slots.labelTrailing ? {
|
|
779
779
|
name: "labelTrailing",
|
|
780
780
|
fn: x(() => [
|
|
781
|
-
j(
|
|
781
|
+
j(n.$slots, "labelTrailing")
|
|
782
782
|
]),
|
|
783
783
|
key: "1"
|
|
784
784
|
} : void 0,
|
|
785
|
-
|
|
785
|
+
n.$slots.readonly ? {
|
|
786
786
|
name: "readonly",
|
|
787
787
|
fn: x(() => [
|
|
788
|
-
j(
|
|
788
|
+
j(n.$slots, "readonly")
|
|
789
789
|
]),
|
|
790
790
|
key: "2"
|
|
791
791
|
} : void 0
|
|
@@ -795,10 +795,10 @@ const Na = {
|
|
|
795
795
|
function wt(o, t = {}) {
|
|
796
796
|
const e = t.accept ?? [];
|
|
797
797
|
if (e.length > 0) {
|
|
798
|
-
const a = o.name.lastIndexOf("."), r = a === -1 ? "" : o.name.slice(a).toLowerCase(),
|
|
798
|
+
const a = o.name.lastIndexOf("."), r = a === -1 ? "" : o.name.slice(a).toLowerCase(), s = o.type.toLowerCase();
|
|
799
799
|
if (!e.some((i) => {
|
|
800
800
|
const m = i.trim().toLowerCase();
|
|
801
|
-
return m.startsWith(".") ? m === r : m.endsWith("/*") ?
|
|
801
|
+
return m.startsWith(".") ? m === r : m.endsWith("/*") ? s.startsWith(m.slice(0, -1)) : m === s;
|
|
802
802
|
})) return "invalid_type";
|
|
803
803
|
}
|
|
804
804
|
return (t.maxSize ?? 0) > 0 && o.size > (t.maxSize ?? 0) ? "too_large" : null;
|
|
@@ -832,7 +832,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
832
832
|
}),
|
|
833
833
|
emits: ["update:modelValue"],
|
|
834
834
|
setup(o, { expose: t }) {
|
|
835
|
-
const e = o, a = ye(o, "modelValue"), { t: r } = J(),
|
|
835
|
+
const e = o, a = ye(o, "modelValue"), { t: r } = J(), s = oe("chooser"), p = P(!1), i = P(null), m = M(() => {
|
|
836
836
|
if (e.hint) return e.hint;
|
|
837
837
|
const h = [];
|
|
838
838
|
return e.accept.length && h.push(r("core.form.file.allowed", { formats: e.accept.map((l) => l.replace(/^\./, "").toUpperCase()).join(", ") })), e.maxSize > 0 && h.push(r("core.form.file.max_size", { size: Le(e.maxSize) })), h.join(" · ") || void 0;
|
|
@@ -846,7 +846,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
846
846
|
a.value = null, i.value = null;
|
|
847
847
|
}
|
|
848
848
|
return ae(a, (h) => {
|
|
849
|
-
!h &&
|
|
849
|
+
!h && s.value && (s.value.value = "");
|
|
850
850
|
}), t({ clear: g }), (h, l) => (c(), T(fe, N({ ...u(re)(e), hint: m.value, error: i.value ?? e.error }, {
|
|
851
851
|
value: a.value?.name ?? null,
|
|
852
852
|
"row-layout": "stacked"
|
|
@@ -856,7 +856,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
856
856
|
V("input", {
|
|
857
857
|
id: f,
|
|
858
858
|
ref_key: "chooser",
|
|
859
|
-
ref:
|
|
859
|
+
ref: s,
|
|
860
860
|
type: "file",
|
|
861
861
|
class: "sr-only",
|
|
862
862
|
tabindex: "-1",
|
|
@@ -891,10 +891,10 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
891
891
|
"data-test": "file-dropzone",
|
|
892
892
|
"aria-disabled": e.disabled || void 0,
|
|
893
893
|
class: G(["cursor-pointer rounded-group border-2 border-dashed p-6 text-center text-body transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus", p.value ? "border-border-focus bg-tint-soft" : "border-border-control hover:bg-fill"]),
|
|
894
|
-
onClick: l[1] || (l[1] = (_) => !e.disabled &&
|
|
894
|
+
onClick: l[1] || (l[1] = (_) => !e.disabled && s.value?.click()),
|
|
895
895
|
onKeydown: [
|
|
896
|
-
l[2] || (l[2] = Se(be((_) => !e.disabled &&
|
|
897
|
-
l[3] || (l[3] = Se(be((_) => !e.disabled &&
|
|
896
|
+
l[2] || (l[2] = Se(be((_) => !e.disabled && s.value?.click(), ["prevent"]), ["enter"])),
|
|
897
|
+
l[3] || (l[3] = Se(be((_) => !e.disabled && s.value?.click(), ["prevent"]), ["space"]))
|
|
898
898
|
],
|
|
899
899
|
onDragover: l[4] || (l[4] = be((_) => p.value = !0, ["prevent"])),
|
|
900
900
|
onDragleave: l[5] || (l[5] = be((_) => p.value = !1, ["prevent"])),
|
|
@@ -907,7 +907,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
907
907
|
], 42, no)) : (c(), T(X, {
|
|
908
908
|
key: 2,
|
|
909
909
|
disabled: e.disabled,
|
|
910
|
-
onClick: l[7] || (l[7] = (_) =>
|
|
910
|
+
onClick: l[7] || (l[7] = (_) => s.value?.click())
|
|
911
911
|
}, {
|
|
912
912
|
default: x(() => [
|
|
913
913
|
Y(q(u(r)("core.form.file.choose")), 1)
|
|
@@ -951,7 +951,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
951
951
|
emits: ["click"],
|
|
952
952
|
setup(o, { emit: t }) {
|
|
953
953
|
const e = o, a = t;
|
|
954
|
-
return (r,
|
|
954
|
+
return (r, s) => (c(), T(St, null, {
|
|
955
955
|
default: x(() => [
|
|
956
956
|
E(zt, { layout: "stacked" }, {
|
|
957
957
|
default: x(() => [
|
|
@@ -959,7 +959,7 @@ const Qa = { class: "w-full" }, eo = ["id", "accept", "disabled", "aria-describe
|
|
|
959
959
|
type: "button",
|
|
960
960
|
disabled: e.disabled,
|
|
961
961
|
class: G(["w-full py-1 text-center text-body focus-visible:outline-2 focus-visible:outline-border-focus disabled:text-content-disabled", e.tone === "critical" ? "text-content-destructive" : "text-content-link"]),
|
|
962
|
-
onClick:
|
|
962
|
+
onClick: s[0] || (s[0] = (p) => a("click"))
|
|
963
963
|
}, q(e.label), 11, uo)
|
|
964
964
|
]),
|
|
965
965
|
_: 1
|
|
@@ -1010,10 +1010,10 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1010
1010
|
}, { ...ue, modelValue: void 0, decimals: 2, blankZero: !1, negative: !1, width: "sm" }),
|
|
1011
1011
|
emits: ["update:modelValue", "focus", "blur"],
|
|
1012
1012
|
setup(o, { expose: t, emit: e }) {
|
|
1013
|
-
const a = o, r = e,
|
|
1014
|
-
return t({ focus: () =>
|
|
1013
|
+
const a = o, r = e, s = oe("field");
|
|
1014
|
+
return t({ focus: () => s.value?.focus() }), (p, i) => (c(), T(bt, N({
|
|
1015
1015
|
ref_key: "field",
|
|
1016
|
-
ref:
|
|
1016
|
+
ref: s,
|
|
1017
1017
|
"model-value": a.modelValue,
|
|
1018
1018
|
"onUpdate:modelValue": i[0] || (i[0] = (m) => r("update:modelValue", m))
|
|
1019
1019
|
}, u(re)(a), {
|
|
@@ -1072,7 +1072,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1072
1072
|
}),
|
|
1073
1073
|
emits: ["update:month", "update:year"],
|
|
1074
1074
|
setup(o) {
|
|
1075
|
-
const t = o, e = ye(o, "month"), a = ye(o, "year"), { t: r } = J(),
|
|
1075
|
+
const t = o, e = ye(o, "month"), a = ye(o, "year"), { t: r } = J(), s = M(() => e.value !== null && e.value >= 1 && e.value <= 12), p = (g, h) => r(`core.form.months.${h}.${g}`), i = M(() => s.value && a.value !== null ? r("core.form.months.with_year", { month: p(e.value, "long"), year: a.value }) : a.value !== null ? String(a.value) : s.value ? p(e.value, "long") : "");
|
|
1076
1076
|
function m(g, h) {
|
|
1077
1077
|
e.value = g.month, a.value = g.year, h();
|
|
1078
1078
|
}
|
|
@@ -1119,7 +1119,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1119
1119
|
"max-year": t.maxYear,
|
|
1120
1120
|
onPick: (_) => m(_, w)
|
|
1121
1121
|
}, null, 8, ["month", "year", "min-year", "max-year", "onPick"]),
|
|
1122
|
-
|
|
1122
|
+
s.value || a.value !== null ? (c(), k("button", {
|
|
1123
1123
|
key: 0,
|
|
1124
1124
|
type: "button",
|
|
1125
1125
|
class: "cursor-pointer self-start rounded-control px-1 text-footnote text-content-link",
|
|
@@ -1178,7 +1178,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1178
1178
|
}),
|
|
1179
1179
|
emits: ["update:modelValue"],
|
|
1180
1180
|
setup(o) {
|
|
1181
|
-
const t = o, e = ye(o, "modelValue"), { t: a } = J(), r = Ue(),
|
|
1181
|
+
const t = o, e = ye(o, "modelValue"), { t: a } = J(), r = Ue(), s = oe("sheet"), p = P(!1), i = sa(() => t.options, (l) => {
|
|
1182
1182
|
const f = e.value.filter((d) => l.some((w) => w.value === d));
|
|
1183
1183
|
f.length !== e.value.length && (e.value = f);
|
|
1184
1184
|
}), m = M(() => e.value.flatMap((l) => {
|
|
@@ -1225,7 +1225,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1225
1225
|
"aria-describedby": w,
|
|
1226
1226
|
"aria-busy": u(i).loading.value || void 0,
|
|
1227
1227
|
class: G(tt),
|
|
1228
|
-
onClick: f[0] || (f[0] = (y) =>
|
|
1228
|
+
onClick: f[0] || (f[0] = (y) => s.value?.present())
|
|
1229
1229
|
}, [
|
|
1230
1230
|
u(i).loading.value ? (c(), T(u(le), {
|
|
1231
1231
|
key: 0,
|
|
@@ -1292,7 +1292,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1292
1292
|
u(r) ? (c(), T(na, {
|
|
1293
1293
|
key: 0,
|
|
1294
1294
|
ref_key: "sheet",
|
|
1295
|
-
ref:
|
|
1295
|
+
ref: s,
|
|
1296
1296
|
title: t.label ?? b.value,
|
|
1297
1297
|
grouped: "",
|
|
1298
1298
|
onPresented: f[5] || (f[5] = (y) => p.value = !0),
|
|
@@ -1312,7 +1312,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1312
1312
|
}, 8, ["disabled"]),
|
|
1313
1313
|
E(X, {
|
|
1314
1314
|
prominence: "primary",
|
|
1315
|
-
onClick: f[4] || (f[4] = (y) =>
|
|
1315
|
+
onClick: f[4] || (f[4] = (y) => s.value?.dismiss())
|
|
1316
1316
|
}, {
|
|
1317
1317
|
default: x(() => [
|
|
1318
1318
|
Y(q(u(a)("core.form.select.done")), 1)
|
|
@@ -1389,7 +1389,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1389
1389
|
}),
|
|
1390
1390
|
emits: ["update:modelValue"],
|
|
1391
1391
|
setup(o) {
|
|
1392
|
-
const t = o, e = ye(o, "modelValue"), { t: a } = J(), r = oe("chooser"),
|
|
1392
|
+
const t = o, e = ye(o, "modelValue"), { t: a } = J(), r = oe("chooser"), s = P(null), p = P(null);
|
|
1393
1393
|
function i() {
|
|
1394
1394
|
p.value && URL.revokeObjectURL(p.value), p.value = null;
|
|
1395
1395
|
}
|
|
@@ -1404,9 +1404,9 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1404
1404
|
function h(l) {
|
|
1405
1405
|
if (!l) return;
|
|
1406
1406
|
const f = wt(l, { accept: t.accept, maxSize: t.maxSize });
|
|
1407
|
-
f ?
|
|
1407
|
+
f ? s.value = f === "invalid_type" ? a("core.form.file.invalid_type") : a("core.form.file.too_large", { size: Le(t.maxSize) }) : (s.value = null, e.value = l);
|
|
1408
1408
|
}
|
|
1409
|
-
return (l, f) => (c(), T(fe, N({ ...u(re)(t), error:
|
|
1409
|
+
return (l, f) => (c(), T(fe, N({ ...u(re)(t), error: s.value ?? t.error }, {
|
|
1410
1410
|
value: m.value ? u(a)("core.form.file.choose") : null,
|
|
1411
1411
|
"row-layout": "stacked"
|
|
1412
1412
|
}), se({
|
|
@@ -1477,7 +1477,7 @@ const Mr = /* @__PURE__ */ K({
|
|
|
1477
1477
|
tone: "critical",
|
|
1478
1478
|
disabled: t.disabled,
|
|
1479
1479
|
onClick: f[4] || (f[4] = (y) => {
|
|
1480
|
-
e.value = null,
|
|
1480
|
+
e.value = null, s.value = null;
|
|
1481
1481
|
})
|
|
1482
1482
|
}, {
|
|
1483
1483
|
default: x(() => [
|
|
@@ -1540,7 +1540,7 @@ function Lo(o) {
|
|
|
1540
1540
|
), Lt() && Tt(() => {
|
|
1541
1541
|
r?.disconnect(), e && cancelAnimationFrame(e);
|
|
1542
1542
|
});
|
|
1543
|
-
const
|
|
1543
|
+
const s = M(() => (t.value, Object.fromEntries(
|
|
1544
1544
|
o.sections.value.map((i) => [
|
|
1545
1545
|
i.id,
|
|
1546
1546
|
{
|
|
@@ -1548,8 +1548,8 @@ function Lo(o) {
|
|
|
1548
1548
|
required: { total: i.element.querySelectorAll("[data-field-required]").length, filled: i.element.querySelectorAll("[data-field-required][data-field-filled]").length }
|
|
1549
1549
|
}
|
|
1550
1550
|
])
|
|
1551
|
-
))), p = M(() => Object.values(
|
|
1552
|
-
return { states:
|
|
1551
|
+
))), p = M(() => Object.values(s.value).reduce((i, m) => ({ filled: i.filled + m.required.filled, total: i.total + m.required.total }), { filled: 0, total: 0 }));
|
|
1552
|
+
return { states: s, totals: p };
|
|
1553
1553
|
}
|
|
1554
1554
|
const To = {
|
|
1555
1555
|
class: "grid min-w-0 grid-cols-1 items-start gap-8 lg:grid-cols-[12.5rem_minmax(0,1fr)]",
|
|
@@ -1570,7 +1570,7 @@ const To = {
|
|
|
1570
1570
|
},
|
|
1571
1571
|
emits: ["save", "cancel"],
|
|
1572
1572
|
setup(o, { emit: t }) {
|
|
1573
|
-
const e = o, a = t, { t: r } = J(),
|
|
1573
|
+
const e = o, a = t, { t: r } = J(), s = Ue(), p = fa(), { states: i, totals: m } = Lo(p), b = oe("content"), g = M(
|
|
1574
1574
|
() => e.form ? {
|
|
1575
1575
|
form: e.form,
|
|
1576
1576
|
label: () => e.saveLabel ?? r("core.actions.save"),
|
|
@@ -1605,7 +1605,7 @@ const To = {
|
|
|
1605
1605
|
options: g.value
|
|
1606
1606
|
}, null, 8, ["options"])) : z("", !0),
|
|
1607
1607
|
V("div", To, [
|
|
1608
|
-
u(
|
|
1608
|
+
u(s) ? z("", !0) : (c(), k("aside", Mo, [
|
|
1609
1609
|
E(ca, {
|
|
1610
1610
|
standalone: "",
|
|
1611
1611
|
states: u(i),
|
|
@@ -1628,7 +1628,7 @@ const To = {
|
|
|
1628
1628
|
j(l.$slots, "default")
|
|
1629
1629
|
], 512)
|
|
1630
1630
|
]),
|
|
1631
|
-
u(
|
|
1631
|
+
u(s) ? (c(), T(ma, {
|
|
1632
1632
|
key: 1,
|
|
1633
1633
|
states: u(i)
|
|
1634
1634
|
}, null, 8, ["states"])) : z("", !0)
|
|
@@ -1682,12 +1682,12 @@ const To = {
|
|
|
1682
1682
|
emits: ["update:modelValue"],
|
|
1683
1683
|
setup(o) {
|
|
1684
1684
|
const t = o, e = ye(o, "modelValue");
|
|
1685
|
-
function a(
|
|
1686
|
-
const p =
|
|
1685
|
+
function a(s) {
|
|
1686
|
+
const p = s.target.value.replace(/\D/g, "");
|
|
1687
1687
|
e.value = p === "" ? null : Math.min(t.max, Math.max(t.min, Number(p)));
|
|
1688
1688
|
}
|
|
1689
|
-
const r = (
|
|
1690
|
-
return (
|
|
1689
|
+
const r = (s) => s.target.value = e.value === null ? "" : String(e.value);
|
|
1690
|
+
return (s, p) => (c(), k("input", {
|
|
1691
1691
|
value: e.value ?? "",
|
|
1692
1692
|
type: "text",
|
|
1693
1693
|
inputmode: "numeric",
|
|
@@ -1723,7 +1723,7 @@ function Ro(o, t) {
|
|
|
1723
1723
|
try {
|
|
1724
1724
|
const e = Ge(o);
|
|
1725
1725
|
if (!e) return !1;
|
|
1726
|
-
const a = (r,
|
|
1726
|
+
const a = (r, s) => typeof Blob < "u" && s instanceof Blob ? null : s;
|
|
1727
1727
|
return e.setItem(Pe + o.key, JSON.stringify({ version: o.version ?? 1, ...t }, a)), !0;
|
|
1728
1728
|
} catch {
|
|
1729
1729
|
return !1;
|
|
@@ -1745,7 +1745,7 @@ function jo(o, t) {
|
|
|
1745
1745
|
function Er(o, t) {
|
|
1746
1746
|
const { t: e } = J(), a = M(() => Mt(t.steps));
|
|
1747
1747
|
if (a.value.length === 0) throw new Error("useStepForm: a flow needs at least one step.");
|
|
1748
|
-
const r = P(a.value[0].name),
|
|
1748
|
+
const r = P(a.value[0].name), s = Ke(/* @__PURE__ */ new Set()), p = Ke(/* @__PURE__ */ new Set([a.value[0].name])), i = P(null), m = P(!1), b = P(0), g = P(!1), h = P(!1);
|
|
1749
1749
|
let l = !1, f = 0;
|
|
1750
1750
|
const d = M(() => Math.max(0, a.value.findIndex((v) => v.name === r.value))), w = (v) => v.fields?.filter((U) => o.errors.has(U)).length ?? 0, _ = M(
|
|
1751
1751
|
() => a.value.map((v, U) => {
|
|
@@ -1754,7 +1754,7 @@ function Er(o, t) {
|
|
|
1754
1754
|
name: v.name,
|
|
1755
1755
|
label: v.label,
|
|
1756
1756
|
position: U + 1,
|
|
1757
|
-
state: ee ? "current" :
|
|
1757
|
+
state: ee ? "current" : s.has(v.name) && H === 0 ? "done" : "todo",
|
|
1758
1758
|
errors: H,
|
|
1759
1759
|
reachable: !ee && (p.has(v.name) || U < d.value)
|
|
1760
1760
|
};
|
|
@@ -1769,9 +1769,9 @@ function Er(o, t) {
|
|
|
1769
1769
|
() => {
|
|
1770
1770
|
const v = a.value, U = v.findIndex((ee) => ee.name === r.value), H = U === -1 ? Math.min(f, v.length - 1) : U;
|
|
1771
1771
|
r.value = v[H].name, f = H, v.forEach((ee, ne) => {
|
|
1772
|
-
ne > H && (
|
|
1772
|
+
ne > H && (s.delete(ee.name), p.delete(ee.name));
|
|
1773
1773
|
}), p.add(r.value);
|
|
1774
|
-
for (const ee of [
|
|
1774
|
+
for (const ee of [s, p]) for (const ne of [...ee]) v.some((ce) => ce.name === ne) || ee.delete(ne);
|
|
1775
1775
|
}
|
|
1776
1776
|
);
|
|
1777
1777
|
function I(v) {
|
|
@@ -1805,7 +1805,7 @@ function Er(o, t) {
|
|
|
1805
1805
|
async function W() {
|
|
1806
1806
|
if ($.value) return !1;
|
|
1807
1807
|
const v = a.value[d.value];
|
|
1808
|
-
return await R(v) ? (
|
|
1808
|
+
return await R(v) ? (s.add(v.name), d.value < S.value - 1 ? (O(d.value + 1), !0) : L()) : !1;
|
|
1809
1809
|
}
|
|
1810
1810
|
async function D(v) {
|
|
1811
1811
|
if ($.value) return !1;
|
|
@@ -1825,7 +1825,7 @@ function Er(o, t) {
|
|
|
1825
1825
|
at(Q), h.value = !1;
|
|
1826
1826
|
return;
|
|
1827
1827
|
}
|
|
1828
|
-
h.value = Ro(Q, { values: Ft(o.values), step: r.value, passed: [...
|
|
1828
|
+
h.value = Ro(Q, { values: Ft(o.values), step: r.value, passed: [...s] });
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
function pe() {
|
|
@@ -1837,12 +1837,12 @@ function Er(o, t) {
|
|
|
1837
1837
|
jo(o.values, v.values);
|
|
1838
1838
|
const U = a.value.map((H) => H.name);
|
|
1839
1839
|
U.includes(v.step) && (r.value = v.step);
|
|
1840
|
-
for (const H of v.passed) U.includes(H) &&
|
|
1841
|
-
for (const H of [...
|
|
1840
|
+
for (const H of v.passed) U.includes(H) && s.add(H);
|
|
1841
|
+
for (const H of [...s, r.value]) p.add(H);
|
|
1842
1842
|
f = d.value, g.value = o.dirty.value, h.value = g.value;
|
|
1843
1843
|
}
|
|
1844
1844
|
ae(
|
|
1845
|
-
[() => o.values, r, () => [...
|
|
1845
|
+
[() => o.values, r, () => [...s].join("\0")],
|
|
1846
1846
|
() => {
|
|
1847
1847
|
l || (clearTimeout(te), te = setTimeout(ge, 400));
|
|
1848
1848
|
},
|
|
@@ -1858,7 +1858,7 @@ function Er(o, t) {
|
|
|
1858
1858
|
return v && pe(), v;
|
|
1859
1859
|
}
|
|
1860
1860
|
function he() {
|
|
1861
|
-
o.reset(),
|
|
1861
|
+
o.reset(), s.clear(), p.clear(), i.value = null, r.value = a.value[0].name, p.add(r.value), f = 0, g.value = !1, pe(), l = !1;
|
|
1862
1862
|
}
|
|
1863
1863
|
const C = M(() => {
|
|
1864
1864
|
const v = [e("core.steps.position", { current: d.value + 1, total: S.value }), y.value.label];
|
|
@@ -1866,7 +1866,7 @@ function Er(o, t) {
|
|
|
1866
1866
|
}), A = M(() => {
|
|
1867
1867
|
const v = a.value[d.value];
|
|
1868
1868
|
return v.nextLabel ? v.nextLabel : B.value ? t.submitLabel ?? e("core.actions.save") : e("core.steps.next_named", { step: a.value[d.value + 1].label });
|
|
1869
|
-
}),
|
|
1869
|
+
}), n = M(() => F.value ? null : a.value[d.value - 1].label);
|
|
1870
1870
|
return {
|
|
1871
1871
|
steps: _,
|
|
1872
1872
|
current: y,
|
|
@@ -1878,7 +1878,7 @@ function Er(o, t) {
|
|
|
1878
1878
|
direction: i,
|
|
1879
1879
|
subtitle: C,
|
|
1880
1880
|
nextLabel: A,
|
|
1881
|
-
backLabel:
|
|
1881
|
+
backLabel: n,
|
|
1882
1882
|
restored: g,
|
|
1883
1883
|
refusals: b,
|
|
1884
1884
|
errors: o.errors,
|
|
@@ -1909,7 +1909,7 @@ const Eo = {
|
|
|
1909
1909
|
icon: "arrowLeftSLine",
|
|
1910
1910
|
disabled: t.flow.busy.value,
|
|
1911
1911
|
"data-test": "step-back",
|
|
1912
|
-
onClick: r[0] || (r[0] = (
|
|
1912
|
+
onClick: r[0] || (r[0] = (s) => t.flow.back())
|
|
1913
1913
|
}, {
|
|
1914
1914
|
default: x(() => [
|
|
1915
1915
|
Y(q(t.flow.backLabel.value), 1)
|
|
@@ -1920,7 +1920,7 @@ const Eo = {
|
|
|
1920
1920
|
E(X, {
|
|
1921
1921
|
prominence: "plain",
|
|
1922
1922
|
"data-test": "step-cancel",
|
|
1923
|
-
onClick: r[1] || (r[1] = (
|
|
1923
|
+
onClick: r[1] || (r[1] = (s) => a.$emit("cancel"))
|
|
1924
1924
|
}, {
|
|
1925
1925
|
default: x(() => [
|
|
1926
1926
|
Y(q(u(e)("core.actions.cancel")), 1)
|
|
@@ -1931,7 +1931,7 @@ const Eo = {
|
|
|
1931
1931
|
prominence: "primary",
|
|
1932
1932
|
processing: t.flow.busy.value,
|
|
1933
1933
|
"data-test": "step-next",
|
|
1934
|
-
onClick: r[2] || (r[2] = (
|
|
1934
|
+
onClick: r[2] || (r[2] = (s) => t.flow.next())
|
|
1935
1935
|
}, {
|
|
1936
1936
|
default: x(() => [
|
|
1937
1937
|
Y(q(t.flow.nextLabel.value), 1)
|
|
@@ -1963,53 +1963,53 @@ const Eo = {
|
|
|
1963
1963
|
class: "grid min-w-0 gap-2",
|
|
1964
1964
|
style: Me({ gridTemplateColumns: `repeat(${t.flow.count.value}, minmax(0, 1fr))` })
|
|
1965
1965
|
}, [
|
|
1966
|
-
(c(!0), k(Z, null, de(t.flow.steps.value, (
|
|
1967
|
-
key:
|
|
1966
|
+
(c(!0), k(Z, null, de(t.flow.steps.value, (s) => (c(), k("li", {
|
|
1967
|
+
key: s.name,
|
|
1968
1968
|
class: "flex min-w-0",
|
|
1969
|
-
"aria-current":
|
|
1969
|
+
"aria-current": s.state === "current" ? "step" : void 0
|
|
1970
1970
|
}, [
|
|
1971
|
-
(c(), T(Dt(
|
|
1972
|
-
type:
|
|
1973
|
-
disabled:
|
|
1974
|
-
"data-test": `step-${
|
|
1975
|
-
"data-state":
|
|
1976
|
-
class: G(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left",
|
|
1977
|
-
onClick: (p) =>
|
|
1971
|
+
(c(), T(Dt(s.reachable ? "button" : "div"), {
|
|
1972
|
+
type: s.reachable ? "button" : void 0,
|
|
1973
|
+
disabled: s.reachable ? t.flow.busy.value : void 0,
|
|
1974
|
+
"data-test": `step-${s.name}`,
|
|
1975
|
+
"data-state": s.errors > 0 ? "error" : s.state,
|
|
1976
|
+
class: G(["group flex min-w-0 flex-1 flex-col gap-1.5 text-left", s.reachable ? "cursor-pointer rounded-control focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-default" : ""]),
|
|
1977
|
+
onClick: (p) => s.reachable ? t.flow.goTo(s.name) : void 0
|
|
1978
1978
|
}, {
|
|
1979
1979
|
default: x(() => [
|
|
1980
1980
|
V("span", {
|
|
1981
|
-
class: G(["h-1 rounded-full transition-colors duration-motion-normal",
|
|
1981
|
+
class: G(["h-1 rounded-full transition-colors duration-motion-normal", s.errors > 0 ? "bg-status-danger-solid" : s.state === "current" ? "bg-tint" : s.state === "done" ? "bg-control-on" : "bg-fill-strong"]),
|
|
1982
1982
|
"aria-hidden": "true"
|
|
1983
1983
|
}, null, 2),
|
|
1984
1984
|
V("span", {
|
|
1985
|
-
class: G(["flex min-w-0 items-center gap-1.5 text-footnote",
|
|
1985
|
+
class: G(["flex min-w-0 items-center gap-1.5 text-footnote", s.state === "current" ? "font-bold text-content-strong" : s.state === "done" ? "font-medium text-content-link" : "font-medium text-content-muted"])
|
|
1986
1986
|
}, [
|
|
1987
|
-
|
|
1987
|
+
s.state === "done" ? (c(), T(u(le), {
|
|
1988
1988
|
key: 0,
|
|
1989
1989
|
name: "checkCustom",
|
|
1990
1990
|
size: 12,
|
|
1991
1991
|
class: "shrink-0"
|
|
1992
1992
|
})) : z("", !0),
|
|
1993
1993
|
V("span", {
|
|
1994
|
-
class: G(["truncate",
|
|
1995
|
-
}, q(
|
|
1996
|
-
|
|
1994
|
+
class: G(["truncate", s.reachable ? "group-hover:text-content-link" : ""])
|
|
1995
|
+
}, q(s.position) + ". " + q(s.label), 3),
|
|
1996
|
+
s.errors > 0 ? (c(), k("span", {
|
|
1997
1997
|
key: 1,
|
|
1998
1998
|
"data-test": "step-errors",
|
|
1999
|
-
"aria-label": u(e)("core.form.sections.errors", { count:
|
|
1999
|
+
"aria-label": u(e)("core.form.sections.errors", { count: s.errors }),
|
|
2000
2000
|
class: "min-w-4.5 shrink-0 rounded-full bg-status-danger-solid px-1.5 text-center text-caption font-semibold text-white"
|
|
2001
|
-
}, q(
|
|
2002
|
-
|
|
2001
|
+
}, q(s.errors), 9, Ao)) : z("", !0),
|
|
2002
|
+
s.state === "done" ? (c(), k("span", Io, q(u(e)("core.steps.done")), 1)) : z("", !0)
|
|
2003
2003
|
], 2)
|
|
2004
2004
|
]),
|
|
2005
2005
|
_: 2
|
|
2006
2006
|
}, 1032, ["type", "disabled", "data-test", "data-state", "class", "onClick"]))
|
|
2007
2007
|
], 8, Uo))), 128))
|
|
2008
2008
|
], 12, No)) : (c(), k("div", Po, [
|
|
2009
|
-
(c(!0), k(Z, null, de(t.flow.steps.value, (
|
|
2010
|
-
key:
|
|
2011
|
-
class: G(["h-1.5 rounded-full transition-all duration-motion-fast", [
|
|
2012
|
-
"data-state":
|
|
2009
|
+
(c(!0), k(Z, null, de(t.flow.steps.value, (s) => (c(), k("span", {
|
|
2010
|
+
key: s.name,
|
|
2011
|
+
class: G(["h-1.5 rounded-full transition-all duration-motion-fast", [s.state === "current" ? "w-4.5" : "w-1.5", s.errors > 0 ? "bg-status-danger-solid" : s.state === "todo" && s.position > t.flow.index.value ? "bg-fill-strong" : "bg-tint"]]),
|
|
2012
|
+
"data-state": s.errors > 0 ? "error" : s.state
|
|
2013
2013
|
}, null, 10, Go))), 128))
|
|
2014
2014
|
]));
|
|
2015
2015
|
}
|
|
@@ -2030,7 +2030,7 @@ const Eo = {
|
|
|
2030
2030
|
emits: ["cancel"],
|
|
2031
2031
|
setup(o) {
|
|
2032
2032
|
const t = o, { t: e } = J(), a = oe("body"), r = oe("root");
|
|
2033
|
-
function
|
|
2033
|
+
function s(p) {
|
|
2034
2034
|
for (let i = p.parentElement; i; i = i.parentElement) {
|
|
2035
2035
|
const m = getComputedStyle(i).overflowY;
|
|
2036
2036
|
if ((m === "auto" || m === "scroll") && i.scrollHeight > i.clientHeight) return p.getBoundingClientRect().top < i.getBoundingClientRect().top;
|
|
@@ -2038,7 +2038,7 @@ const Eo = {
|
|
|
2038
2038
|
return p.getBoundingClientRect().top < 0;
|
|
2039
2039
|
}
|
|
2040
2040
|
return ae(() => t.flow.current.value.name, async () => {
|
|
2041
|
-
await Ve(), r.value &&
|
|
2041
|
+
await Ve(), r.value && s(r.value) && r.value.scrollIntoView?.({ block: "start" }), a.value?.focus({ preventScroll: !0 });
|
|
2042
2042
|
}), ae(() => t.flow.refusals.value, async () => {
|
|
2043
2043
|
await Ve(), a.value && await ze(a.value);
|
|
2044
2044
|
}), (p, i) => (c(), k("div", {
|
|
@@ -2096,7 +2096,7 @@ const Eo = {
|
|
|
2096
2096
|
}, null, 8, ["flow"])) : z("", !0)
|
|
2097
2097
|
], 8, Ko));
|
|
2098
2098
|
}
|
|
2099
|
-
}), ot = Symbol("vue-core.dynamicForm.locale"), Jo = { class: "flex w-full flex-col gap-3" }, Zo = { class: "mb-2 flex items-center justify-between" }, Xo = { class: "text-sm font-medium text-muted" }, Qo = {
|
|
2099
|
+
}), ot = Symbol("vue-core.dynamicForm.locale"), Jo = { class: "flex w-full flex-col gap-3" }, Zo = { class: "mb-2 flex items-center justify-between" }, Xo = { class: "text-sm font-medium text-content-muted" }, Qo = {
|
|
2100
2100
|
key: 0,
|
|
2101
2101
|
class: "flex gap-1"
|
|
2102
2102
|
}, el = { key: 0 }, tl = /* @__PURE__ */ K({
|
|
@@ -2123,7 +2123,7 @@ const Eo = {
|
|
|
2123
2123
|
}, { ...ue, modelValue: () => [], locales: void 0, defaultLocale: void 0, errors: () => ({}), resources: void 0, addLabel: void 0, localeMode: "perField" }),
|
|
2124
2124
|
emits: ["update:modelValue"],
|
|
2125
2125
|
setup(o, { emit: t }) {
|
|
2126
|
-
const e = o, a = t, { t: r } = J(), { editable:
|
|
2126
|
+
const e = o, a = t, { t: r } = J(), { editable: s } = Be(e);
|
|
2127
2127
|
let p = 0;
|
|
2128
2128
|
const i = P([]);
|
|
2129
2129
|
ae(() => e.modelValue.length, (d) => {
|
|
@@ -2160,7 +2160,7 @@ const Eo = {
|
|
|
2160
2160
|
}, [
|
|
2161
2161
|
V("div", Zo, [
|
|
2162
2162
|
V("span", Xo, q(u(r)("core.form.dynamic.repeat.row", { n: y + 1 })), 1),
|
|
2163
|
-
u(
|
|
2163
|
+
u(s) && !e.disabled ? (c(), k("div", Qo, [
|
|
2164
2164
|
E(X, N({
|
|
2165
2165
|
size: "xs",
|
|
2166
2166
|
prominence: "plain",
|
|
@@ -2197,12 +2197,12 @@ const Eo = {
|
|
|
2197
2197
|
"default-locale": e.defaultLocale,
|
|
2198
2198
|
errors: f(y),
|
|
2199
2199
|
resources: e.resources,
|
|
2200
|
-
readonly: !u(
|
|
2200
|
+
readonly: !u(s) || e.disabled,
|
|
2201
2201
|
"locale-mode": e.localeMode,
|
|
2202
2202
|
"onUpdate:modelValue": (S) => l(y, S)
|
|
2203
2203
|
}, null, 8, ["schema", "model-value", "locales", "default-locale", "errors", "resources", "readonly", "locale-mode", "onUpdate:modelValue"])
|
|
2204
2204
|
]))), 128)),
|
|
2205
|
-
u(
|
|
2205
|
+
u(s) && !e.disabled ? (c(), k("div", el, [
|
|
2206
2206
|
E(X, {
|
|
2207
2207
|
icon: "addLine",
|
|
2208
2208
|
"data-add": "",
|
|
@@ -2222,13 +2222,13 @@ const Eo = {
|
|
|
2222
2222
|
}), al = { class: "flex flex-col gap-3 p-4" }, ol = ["placeholder", "aria-label"], ll = {
|
|
2223
2223
|
key: 0,
|
|
2224
2224
|
role: "alert",
|
|
2225
|
-
class: "text-sm text-
|
|
2225
|
+
class: "text-sm text-status-danger-content"
|
|
2226
2226
|
}, rl = {
|
|
2227
2227
|
key: 1,
|
|
2228
|
-
class: "text-sm text-muted"
|
|
2228
|
+
class: "text-sm text-content-muted"
|
|
2229
2229
|
}, nl = {
|
|
2230
2230
|
key: 2,
|
|
2231
|
-
class: "text-sm text-muted"
|
|
2231
|
+
class: "text-sm text-content-muted"
|
|
2232
2232
|
}, sl = {
|
|
2233
2233
|
key: 3,
|
|
2234
2234
|
class: "grid grid-cols-3 gap-2 sm:grid-cols-4"
|
|
@@ -2243,14 +2243,14 @@ const Eo = {
|
|
|
2243
2243
|
},
|
|
2244
2244
|
emits: ["select"],
|
|
2245
2245
|
setup(o, { emit: t }) {
|
|
2246
|
-
const e = o, a = t, { t: r } = J(),
|
|
2246
|
+
const e = o, a = t, { t: r } = J(), s = P(""), p = P(1), i = P(1), m = P([]), b = P("loading");
|
|
2247
2247
|
let g = null, h;
|
|
2248
2248
|
async function l() {
|
|
2249
2249
|
g?.abort();
|
|
2250
2250
|
const w = g = new AbortController();
|
|
2251
2251
|
b.value = "loading";
|
|
2252
2252
|
try {
|
|
2253
|
-
const _ = await e.source.list({ search:
|
|
2253
|
+
const _ = await e.source.list({ search: s.value.trim(), page: p.value, pageSize: 24, ...e.accept !== void 0 ? { accept: e.accept } : {} }, { signal: w.signal });
|
|
2254
2254
|
if (w.signal.aborted) return;
|
|
2255
2255
|
m.value = _.rows, i.value = Math.max(1, _.lastPage), b.value = "loaded";
|
|
2256
2256
|
} catch {
|
|
@@ -2269,14 +2269,14 @@ const Eo = {
|
|
|
2269
2269
|
clearTimeout(h), g?.abort();
|
|
2270
2270
|
}), (w, _) => (c(), k("div", al, [
|
|
2271
2271
|
dt(V("input", {
|
|
2272
|
-
"onUpdate:modelValue": _[0] || (_[0] = (y) =>
|
|
2272
|
+
"onUpdate:modelValue": _[0] || (_[0] = (y) => s.value = y),
|
|
2273
2273
|
type: "search",
|
|
2274
2274
|
class: "w-full rounded-md border border-border bg-surface px-3 py-2 text-sm",
|
|
2275
2275
|
placeholder: u(r)("core.form.dynamic.resource.search"),
|
|
2276
2276
|
"aria-label": u(r)("core.form.dynamic.resource.search"),
|
|
2277
2277
|
onInput: f
|
|
2278
2278
|
}, null, 40, ol), [
|
|
2279
|
-
[ct,
|
|
2279
|
+
[ct, s.value]
|
|
2280
2280
|
]),
|
|
2281
2281
|
b.value === "failed" ? (c(), k("p", ll, q(u(r)("core.form.dynamic.resource.failed")), 1)) : b.value === "loading" && m.value.length === 0 ? (c(), k("p", rl, q(u(r)("core.form.dynamic.resource.loading")), 1)) : m.value.length === 0 ? (c(), k("p", nl, q(u(r)("core.form.dynamic.resource.empty")), 1)) : (c(), k("ul", sl, [
|
|
2282
2282
|
(c(!0), k(Z, null, de(m.value, (y) => (c(), k("li", {
|
|
@@ -2284,7 +2284,7 @@ const Eo = {
|
|
|
2284
2284
|
}, [
|
|
2285
2285
|
V("button", {
|
|
2286
2286
|
type: "button",
|
|
2287
|
-
class: "flex w-full flex-col gap-1 rounded-md border border-border p-1 text-left hover:border-
|
|
2287
|
+
class: "flex w-full flex-col gap-1 rounded-md border border-border p-1 text-left hover:border-border-selected focus-visible:outline-2",
|
|
2288
2288
|
onClick: (S) => a("select", y)
|
|
2289
2289
|
}, [
|
|
2290
2290
|
V("img", {
|
|
@@ -2326,7 +2326,7 @@ const Eo = {
|
|
|
2326
2326
|
class: "mt-1 flex justify-between"
|
|
2327
2327
|
}, vl = {
|
|
2328
2328
|
key: 0,
|
|
2329
|
-
class: "text-sm text-muted"
|
|
2329
|
+
class: "text-sm text-content-muted"
|
|
2330
2330
|
}, bl = /* @__PURE__ */ K({
|
|
2331
2331
|
__name: "ResourceField",
|
|
2332
2332
|
props: /* @__PURE__ */ ie({
|
|
@@ -2347,7 +2347,7 @@ const Eo = {
|
|
|
2347
2347
|
}, { ...ue, multiple: !1, accept: void 0, modelValue: void 0 }),
|
|
2348
2348
|
emits: ["update:modelValue"],
|
|
2349
2349
|
setup(o, { emit: t }) {
|
|
2350
|
-
const e = o, a = t, { t: r } = J(), { editable:
|
|
2350
|
+
const e = o, a = t, { t: r } = J(), { editable: s } = Be(e), p = gt(), i = M(() => Array.isArray(e.modelValue) ? [...e.modelValue] : e.modelValue === null || e.modelValue === void 0 || e.modelValue === "" ? [] : [e.modelValue]);
|
|
2351
2351
|
function m(h) {
|
|
2352
2352
|
a("update:modelValue", e.multiple ? h : h[0] ?? null);
|
|
2353
2353
|
}
|
|
@@ -2377,7 +2377,7 @@ const Eo = {
|
|
|
2377
2377
|
alt: "",
|
|
2378
2378
|
class: "aspect-square w-full rounded-md border border-border object-cover"
|
|
2379
2379
|
}, null, 8, fl),
|
|
2380
|
-
u(
|
|
2380
|
+
u(s) && !e.disabled ? (c(), k("div", pl, [
|
|
2381
2381
|
E(X, {
|
|
2382
2382
|
size: "xs",
|
|
2383
2383
|
prominence: "plain",
|
|
@@ -2398,8 +2398,8 @@ const Eo = {
|
|
|
2398
2398
|
}), null, 16, ["onClick"])
|
|
2399
2399
|
])) : z("", !0)
|
|
2400
2400
|
]))), 128)),
|
|
2401
|
-
i.value.length === 0 && !u(
|
|
2402
|
-
u(
|
|
2401
|
+
i.value.length === 0 && !u(s) ? (c(), k("p", vl, q(u(r)("core.form.dynamic.resource.none")), 1)) : z("", !0),
|
|
2402
|
+
u(s) && !e.disabled && (e.multiple || i.value.length === 0) ? (c(), T(X, {
|
|
2403
2403
|
key: 1,
|
|
2404
2404
|
icon: "addLine",
|
|
2405
2405
|
onClick: l[0] || (l[0] = (d) => b())
|
|
@@ -2427,7 +2427,7 @@ const Eo = {
|
|
|
2427
2427
|
}), yl = { class: "w-full rounded-md border border-border bg-surface" }, gl = ["aria-label"], hl = ["data-tool", "aria-label", "title", "aria-pressed", "disabled", "onClick"], kl = ["aria-label", "placeholder"], _l = {
|
|
2428
2428
|
key: 2,
|
|
2429
2429
|
role: "alert",
|
|
2430
|
-
class: "p-3 text-sm text-
|
|
2430
|
+
class: "p-3 text-sm text-status-danger-content"
|
|
2431
2431
|
}, xl = ["id"], lt = /* @__PURE__ */ K({
|
|
2432
2432
|
__name: "RichTextField",
|
|
2433
2433
|
props: /* @__PURE__ */ ie({
|
|
@@ -2448,7 +2448,7 @@ const Eo = {
|
|
|
2448
2448
|
}, { ...ue, modelValue: "", images: void 0, video: !1, placeholder: void 0 }),
|
|
2449
2449
|
emits: ["update:modelValue"],
|
|
2450
2450
|
setup(o, { emit: t }) {
|
|
2451
|
-
const e = o, a = t, { t: r } = J(), { editable:
|
|
2451
|
+
const e = o, a = t, { t: r } = J(), { editable: s } = Be(e), p = oe("host"), i = P(!1), m = P(!1), b = gt(), g = P(null), h = P("");
|
|
2452
2452
|
let l = null, f = "", d = null;
|
|
2453
2453
|
const w = P({}), _ = () => l ? l.getText().trim() === "" && !l.root.querySelector("img, iframe") ? "" : l.getSemanticHTML() : "";
|
|
2454
2454
|
function y(R) {
|
|
@@ -2458,7 +2458,7 @@ const Eo = {
|
|
|
2458
2458
|
try {
|
|
2459
2459
|
const { default: R } = await import("quill");
|
|
2460
2460
|
if (!p.value) return;
|
|
2461
|
-
l = new R(p.value, { modules: { toolbar: !1 }, placeholder: e.placeholder, readOnly: !
|
|
2461
|
+
l = new R(p.value, { modules: { toolbar: !1 }, placeholder: e.placeholder, readOnly: !s.value || e.disabled });
|
|
2462
2462
|
} catch {
|
|
2463
2463
|
i.value = !0;
|
|
2464
2464
|
return;
|
|
@@ -2470,7 +2470,7 @@ const Eo = {
|
|
|
2470
2470
|
}), m.value = !0;
|
|
2471
2471
|
}), Fe(() => l?.disable()), ae(() => e.modelValue, (R) => {
|
|
2472
2472
|
R !== f && y(R);
|
|
2473
|
-
}), ae(() => !
|
|
2473
|
+
}), ae(() => !s.value || e.disabled, (R) => l?.enable(!R));
|
|
2474
2474
|
const S = (R, L) => {
|
|
2475
2475
|
if (!l) return;
|
|
2476
2476
|
l.focus();
|
|
@@ -2510,7 +2510,7 @@ const Eo = {
|
|
|
2510
2510
|
}), {
|
|
2511
2511
|
default: x(({ id: W }) => [
|
|
2512
2512
|
V("div", yl, [
|
|
2513
|
-
u(
|
|
2513
|
+
u(s) && !e.disabled ? (c(), k("div", {
|
|
2514
2514
|
key: 0,
|
|
2515
2515
|
class: "flex flex-wrap gap-1 border-b border-border p-1",
|
|
2516
2516
|
role: "toolbar",
|
|
@@ -2524,7 +2524,7 @@ const Eo = {
|
|
|
2524
2524
|
title: D.label,
|
|
2525
2525
|
"aria-pressed": D.on,
|
|
2526
2526
|
disabled: !m.value,
|
|
2527
|
-
class: "min-w-8 rounded px-2 py-1 text-sm font-medium hover:bg-
|
|
2527
|
+
class: "min-w-8 rounded px-2 py-1 text-sm font-medium hover:bg-fill aria-pressed:bg-fill",
|
|
2528
2528
|
onMousedown: L[0] || (L[0] = be(() => {
|
|
2529
2529
|
}, ["prevent"])),
|
|
2530
2530
|
onClick: D.run
|
|
@@ -2559,7 +2559,7 @@ const Eo = {
|
|
|
2559
2559
|
id: W,
|
|
2560
2560
|
ref_key: "host",
|
|
2561
2561
|
ref: p,
|
|
2562
|
-
class: G(["min-h-32 px-3 py-2 text-sm [&_.ql-clipboard]:absolute [&_.ql-clipboard]:-left-[100000px] [&_.ql-editor]:min-h-28 [&_.ql-editor]:outline-none [&_.ql-editor_h2]:text-lg [&_.ql-editor_h2]:font-semibold [&_.ql-editor_img]:max-w-full [&_.ql-editor_ol]:pl-6 [&_.ql-editor_li[data-list=bullet]]:list-disc [&_.ql-editor_li[data-list=ordered]]:list-decimal [&_.ql-editor_a]:text-
|
|
2562
|
+
class: G(["min-h-32 px-3 py-2 text-sm [&_.ql-clipboard]:absolute [&_.ql-clipboard]:-left-[100000px] [&_.ql-editor]:min-h-28 [&_.ql-editor]:outline-none [&_.ql-editor_h2]:text-lg [&_.ql-editor_h2]:font-semibold [&_.ql-editor_img]:max-w-full [&_.ql-editor_ol]:pl-6 [&_.ql-editor_li[data-list=bullet]]:list-disc [&_.ql-editor_li[data-list=ordered]]:list-decimal [&_.ql-editor_a]:text-content-link [&_.ql-editor_a]:underline [&_.ql-ui]:hidden [&_.ql-editor.ql-blank::before]:text-content-muted [&_.ql-editor.ql-blank::before]:content-[attr(data-placeholder)]", { hidden: i.value }])
|
|
2563
2563
|
}, null, 10, xl)
|
|
2564
2564
|
]),
|
|
2565
2565
|
e.images ? (c(), T(ht, {
|
|
@@ -2587,7 +2587,7 @@ function Te(o, t) {
|
|
|
2587
2587
|
if (o === t) return !0;
|
|
2588
2588
|
if (typeof o != "object" || typeof t != "object" || o === null || t === null || Array.isArray(o) !== Array.isArray(t)) return !1;
|
|
2589
2589
|
const e = o, a = t, r = Object.keys(e);
|
|
2590
|
-
return r.length === Object.keys(a).length && r.every((
|
|
2590
|
+
return r.length === Object.keys(a).length && r.every((s) => s in a && Te(e[s], a[s]));
|
|
2591
2591
|
}
|
|
2592
2592
|
function wl(o, t) {
|
|
2593
2593
|
const e = t[o.field];
|
|
@@ -2615,22 +2615,22 @@ const $l = {
|
|
|
2615
2615
|
},
|
|
2616
2616
|
emits: ["update:modelValue"],
|
|
2617
2617
|
setup(o, { emit: t }) {
|
|
2618
|
-
const e = o, a = t, { t: r, availableLocales:
|
|
2618
|
+
const e = o, a = t, { t: r, availableLocales: s } = J(), p = Ee(ya, null), i = M(() => e.locales ?? p?.locales ?? s), m = M(() => e.defaultLocale ?? i.value[0] ?? ""), b = M(() => e.errors instanceof qt ? e.errors.all() : e.errors);
|
|
2619
2619
|
function g(C) {
|
|
2620
2620
|
const A = b.value[C]?.[0];
|
|
2621
2621
|
if (A !== void 0) return A;
|
|
2622
|
-
const
|
|
2623
|
-
return
|
|
2622
|
+
const n = Object.keys(b.value).find((v) => v.startsWith(`${C}.`));
|
|
2623
|
+
return n === void 0 ? void 0 : b.value[n]?.[0];
|
|
2624
2624
|
}
|
|
2625
|
-
const h = (C) => Object.fromEntries(Object.entries(b.value).filter(([A]) => A.startsWith(`${C}.`)).map(([A,
|
|
2625
|
+
const h = (C) => Object.fromEntries(Object.entries(b.value).filter(([A]) => A.startsWith(`${C}.`)).map(([A, n]) => [A.slice(C.length + 1), n])), l = M(() => e.schema.fields.filter((C) => Ct(C.visible_when, e.modelValue)));
|
|
2626
2626
|
function f(C, A) {
|
|
2627
2627
|
a("update:modelValue", { ...e.modelValue, [C]: A });
|
|
2628
2628
|
}
|
|
2629
2629
|
const d = (C) => !!C.translatable && (C.kind === "text" || C.kind === "textarea" || C.kind === "rich_text"), w = (C) => d(C) && (e.localeMode === "form" || C.kind === "rich_text"), _ = Ee(ot, null), y = M(() => e.localeMode === "form" && _ !== null), S = P(null), F = M(() => y.value && _ ? _.value : S.value !== null && i.value.includes(S.value) ? S.value : m.value), B = M(() => !y.value && l.value.some(w));
|
|
2630
2630
|
ut(ot, F);
|
|
2631
2631
|
const $ = (C) => typeof e.modelValue[C.key] == "object" && e.modelValue[C.key] !== null ? e.modelValue[C.key] : {}, O = (C) => b.value[`${C.key}.${F.value}`]?.[0] ?? b.value[C.key]?.[0], I = (C) => l.value.some((A) => d(A) && b.value[`${A.key}.${C}`] !== void 0);
|
|
2632
|
-
function R(C, A,
|
|
2633
|
-
f(C.key, { ...$(C), [A]:
|
|
2632
|
+
function R(C, A, n) {
|
|
2633
|
+
f(C.key, { ...$(C), [A]: n });
|
|
2634
2634
|
}
|
|
2635
2635
|
const L = (C, A = C.key) => ({
|
|
2636
2636
|
label: C.label,
|
|
@@ -2640,8 +2640,8 @@ const $l = {
|
|
|
2640
2640
|
editable: !e.readonly,
|
|
2641
2641
|
name: C.key,
|
|
2642
2642
|
"data-field-key": A
|
|
2643
|
-
}), W = (C, A) => C.validation?.some((
|
|
2644
|
-
const A = C.validation?.find((
|
|
2643
|
+
}), W = (C, A) => C.validation?.some((n) => n.rule === A) === !0, D = (C) => {
|
|
2644
|
+
const A = C.validation?.find((n) => n.rule === "max")?.args?.[0];
|
|
2645
2645
|
return typeof A == "number" ? A : void 0;
|
|
2646
2646
|
}, Q = (C) => Array.isArray(e.modelValue[C.key]) ? e.modelValue[C.key] : [], te = (C) => typeof e.modelValue[C.key] == "number" ? e.modelValue[C.key] : null, ge = (C) => typeof e.modelValue[C.key] == "string" && e.modelValue[C.key] !== "" ? e.modelValue[C.key] : null, pe = (C) => {
|
|
2647
2647
|
const A = e.modelValue[C.key];
|
|
@@ -2654,165 +2654,167 @@ const $l = {
|
|
|
2654
2654
|
"aria-label": u(r)("core.form.dynamic.language"),
|
|
2655
2655
|
class: "flex gap-1"
|
|
2656
2656
|
}, [
|
|
2657
|
-
(c(!0), k(Z, null, de(i.value, (
|
|
2658
|
-
id: `dynamic-locale-${
|
|
2659
|
-
key:
|
|
2657
|
+
(c(!0), k(Z, null, de(i.value, (n) => (c(), k("button", {
|
|
2658
|
+
id: `dynamic-locale-${n}`,
|
|
2659
|
+
key: n,
|
|
2660
2660
|
type: "button",
|
|
2661
2661
|
role: "tab",
|
|
2662
|
-
"aria-selected":
|
|
2663
|
-
"data-locale":
|
|
2664
|
-
"data-error": I(
|
|
2665
|
-
class: "rounded-md px-3 py-1 text-sm font-medium uppercase aria-selected:bg-
|
|
2666
|
-
onClick: (v) => S.value =
|
|
2667
|
-
}, q(
|
|
2662
|
+
"aria-selected": n === F.value,
|
|
2663
|
+
"data-locale": n,
|
|
2664
|
+
"data-error": I(n) || void 0,
|
|
2665
|
+
class: "rounded-md px-3 py-1 text-sm font-medium uppercase aria-selected:bg-fill data-[error]:text-status-danger-content",
|
|
2666
|
+
onClick: (v) => S.value = n
|
|
2667
|
+
}, q(n), 9, Cl))), 128))
|
|
2668
2668
|
], 8, Vl)) : z("", !0),
|
|
2669
|
-
(c(!0), k(Z, null, de(l.value, (
|
|
2670
|
-
key:
|
|
2669
|
+
(c(!0), k(Z, null, de(l.value, (n) => (c(), k(Z, {
|
|
2670
|
+
key: n.key
|
|
2671
2671
|
}, [
|
|
2672
|
-
d(
|
|
2673
|
-
w(
|
|
2674
|
-
|
|
2672
|
+
d(n) ? (c(), k(Z, { key: 0 }, [
|
|
2673
|
+
w(n) ? (c(), k(Z, { key: 0 }, [
|
|
2674
|
+
n.kind === "rich_text" ? (c(), T(lt, N({
|
|
2675
2675
|
key: 0,
|
|
2676
2676
|
ref_for: !0
|
|
2677
|
-
}, L(
|
|
2678
|
-
error: O(
|
|
2679
|
-
"model-value": $(
|
|
2677
|
+
}, L(n), {
|
|
2678
|
+
error: O(n),
|
|
2679
|
+
"model-value": $(n)[F.value] ?? "",
|
|
2680
2680
|
images: e.resources,
|
|
2681
|
-
video:
|
|
2682
|
-
"onUpdate:modelValue": (v) => R(
|
|
2683
|
-
}), null, 16, ["error", "model-value", "images", "video", "onUpdate:modelValue"])) :
|
|
2681
|
+
video: n.props?.video,
|
|
2682
|
+
"onUpdate:modelValue": (v) => R(n, F.value, v)
|
|
2683
|
+
}), null, 16, ["error", "model-value", "images", "video", "onUpdate:modelValue"])) : n.kind === "textarea" ? (c(), T(Xe, N({
|
|
2684
2684
|
key: 1,
|
|
2685
2685
|
ref_for: !0
|
|
2686
|
-
}, L(
|
|
2687
|
-
error: O(
|
|
2688
|
-
"model-value": $(
|
|
2689
|
-
rows:
|
|
2690
|
-
placeholder:
|
|
2691
|
-
"max-length": D(
|
|
2692
|
-
"onUpdate:modelValue": (v) => R(
|
|
2686
|
+
}, L(n), {
|
|
2687
|
+
error: O(n),
|
|
2688
|
+
"model-value": $(n)[F.value] ?? "",
|
|
2689
|
+
rows: n.props?.rows,
|
|
2690
|
+
placeholder: n.props?.placeholder,
|
|
2691
|
+
"max-length": D(n),
|
|
2692
|
+
"onUpdate:modelValue": (v) => R(n, F.value, v)
|
|
2693
2693
|
}), null, 16, ["error", "model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : (c(), T(We, N({
|
|
2694
2694
|
key: 2,
|
|
2695
2695
|
ref_for: !0
|
|
2696
|
-
}, L(
|
|
2697
|
-
error: O(
|
|
2698
|
-
"model-value": $(
|
|
2699
|
-
placeholder:
|
|
2700
|
-
"max-length": D(
|
|
2701
|
-
"onUpdate:modelValue": (v) => R(
|
|
2696
|
+
}, L(n), {
|
|
2697
|
+
error: O(n),
|
|
2698
|
+
"model-value": $(n)[F.value] ?? "",
|
|
2699
|
+
placeholder: n.props?.placeholder,
|
|
2700
|
+
"max-length": D(n),
|
|
2701
|
+
"onUpdate:modelValue": (v) => R(n, F.value, v)
|
|
2702
2702
|
}), null, 16, ["error", "model-value", "placeholder", "max-length", "onUpdate:modelValue"]))
|
|
2703
2703
|
], 64)) : (c(), T(la, N({
|
|
2704
2704
|
key: 1,
|
|
2705
2705
|
ref_for: !0
|
|
2706
|
-
}, L(
|
|
2707
|
-
"model-value": $(
|
|
2706
|
+
}, L(n), {
|
|
2707
|
+
"model-value": $(n),
|
|
2708
2708
|
locales: i.value,
|
|
2709
2709
|
"default-locale": m.value,
|
|
2710
|
-
"required-locales":
|
|
2711
|
-
multiline:
|
|
2712
|
-
rows:
|
|
2713
|
-
placeholder:
|
|
2714
|
-
"max-length": D(
|
|
2715
|
-
"onUpdate:modelValue": (v) => f(
|
|
2710
|
+
"required-locales": n.required ? [m.value] : [],
|
|
2711
|
+
multiline: n.kind === "textarea",
|
|
2712
|
+
rows: n.props?.rows,
|
|
2713
|
+
placeholder: n.props?.placeholder,
|
|
2714
|
+
"max-length": D(n),
|
|
2715
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2716
2716
|
}), null, 16, ["model-value", "locales", "default-locale", "required-locales", "multiline", "rows", "placeholder", "max-length", "onUpdate:modelValue"]))
|
|
2717
|
-
], 64)) :
|
|
2717
|
+
], 64)) : n.kind === "text" ? (c(), T(We, N({
|
|
2718
2718
|
key: 1,
|
|
2719
2719
|
ref_for: !0
|
|
2720
|
-
}, L(
|
|
2721
|
-
type: W(
|
|
2722
|
-
"model-value": he(
|
|
2723
|
-
placeholder:
|
|
2724
|
-
"max-length": D(
|
|
2725
|
-
"onUpdate:modelValue": (v) => f(
|
|
2726
|
-
}), null, 16, ["type", "model-value", "placeholder", "max-length", "onUpdate:modelValue"])) :
|
|
2720
|
+
}, L(n), {
|
|
2721
|
+
type: W(n, "email") ? "email" : W(n, "url") ? "url" : "text",
|
|
2722
|
+
"model-value": he(n),
|
|
2723
|
+
placeholder: n.props?.placeholder,
|
|
2724
|
+
"max-length": D(n),
|
|
2725
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2726
|
+
}), null, 16, ["type", "model-value", "placeholder", "max-length", "onUpdate:modelValue"])) : n.kind === "textarea" ? (c(), T(Xe, N({
|
|
2727
2727
|
key: 2,
|
|
2728
2728
|
ref_for: !0
|
|
2729
|
-
}, L(
|
|
2730
|
-
"model-value": he(
|
|
2731
|
-
rows:
|
|
2732
|
-
placeholder:
|
|
2733
|
-
"max-length": D(
|
|
2734
|
-
"onUpdate:modelValue": (v) => f(
|
|
2735
|
-
}), null, 16, ["model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) :
|
|
2729
|
+
}, L(n), {
|
|
2730
|
+
"model-value": he(n),
|
|
2731
|
+
rows: n.props?.rows,
|
|
2732
|
+
placeholder: n.props?.placeholder,
|
|
2733
|
+
"max-length": D(n),
|
|
2734
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2735
|
+
}), null, 16, ["model-value", "rows", "placeholder", "max-length", "onUpdate:modelValue"])) : n.kind === "rich_text" ? (c(), T(lt, N({
|
|
2736
2736
|
key: 3,
|
|
2737
2737
|
ref_for: !0
|
|
2738
|
-
}, L(
|
|
2739
|
-
"model-value": he(
|
|
2738
|
+
}, L(n), {
|
|
2739
|
+
"model-value": he(n),
|
|
2740
2740
|
images: e.resources,
|
|
2741
|
-
video:
|
|
2742
|
-
"onUpdate:modelValue": (v) => f(
|
|
2743
|
-
}), null, 16, ["model-value", "images", "video", "onUpdate:modelValue"])) :
|
|
2741
|
+
video: n.props?.video,
|
|
2742
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2743
|
+
}), null, 16, ["model-value", "images", "video", "onUpdate:modelValue"])) : n.kind === "number" ? (c(), T(bt, N({
|
|
2744
2744
|
key: 4,
|
|
2745
2745
|
ref_for: !0
|
|
2746
|
-
}, L(
|
|
2747
|
-
"model-value": te(
|
|
2748
|
-
placeholder:
|
|
2749
|
-
|
|
2750
|
-
|
|
2746
|
+
}, L(n), {
|
|
2747
|
+
"model-value": te(n),
|
|
2748
|
+
placeholder: n.props?.placeholder,
|
|
2749
|
+
grouping: n.props?.grouping,
|
|
2750
|
+
decimals: n.props?.decimals,
|
|
2751
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2752
|
+
}), null, 16, ["model-value", "placeholder", "grouping", "decimals", "onUpdate:modelValue"])) : n.kind === "boolean" ? (c(), T(ua, N({
|
|
2751
2753
|
key: 5,
|
|
2752
2754
|
ref_for: !0
|
|
2753
|
-
}, L(
|
|
2754
|
-
"model-value": e.modelValue[
|
|
2755
|
-
"onUpdate:modelValue": (v) => f(
|
|
2756
|
-
}), null, 16, ["model-value", "onUpdate:modelValue"])) :
|
|
2755
|
+
}, L(n), {
|
|
2756
|
+
"model-value": e.modelValue[n.key] === !0,
|
|
2757
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2758
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : n.kind === "select" ? (c(), T(yt, N({
|
|
2757
2759
|
key: 6,
|
|
2758
2760
|
ref_for: !0
|
|
2759
|
-
}, L(
|
|
2760
|
-
options:
|
|
2761
|
-
"model-value": pe(
|
|
2762
|
-
clearable: !
|
|
2763
|
-
placeholder:
|
|
2764
|
-
"onUpdate:modelValue": (v) => f(
|
|
2765
|
-
}), null, 16, ["options", "model-value", "clearable", "placeholder", "onUpdate:modelValue"])) :
|
|
2761
|
+
}, L(n), {
|
|
2762
|
+
options: n.options ?? [],
|
|
2763
|
+
"model-value": pe(n),
|
|
2764
|
+
clearable: !n.required,
|
|
2765
|
+
placeholder: n.props?.placeholder,
|
|
2766
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2767
|
+
}), null, 16, ["options", "model-value", "clearable", "placeholder", "onUpdate:modelValue"])) : n.kind === "multi_select" ? (c(), T($t, N({
|
|
2766
2768
|
key: 7,
|
|
2767
2769
|
ref_for: !0
|
|
2768
|
-
}, L(
|
|
2769
|
-
options:
|
|
2770
|
-
"model-value": ve(
|
|
2771
|
-
placeholder:
|
|
2772
|
-
"onUpdate:modelValue": (v) => f(
|
|
2773
|
-
}), null, 16, ["options", "model-value", "placeholder", "onUpdate:modelValue"])) :
|
|
2770
|
+
}, L(n), {
|
|
2771
|
+
options: n.options ?? [],
|
|
2772
|
+
"model-value": ve(n),
|
|
2773
|
+
placeholder: n.props?.placeholder,
|
|
2774
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2775
|
+
}), null, 16, ["options", "model-value", "placeholder", "onUpdate:modelValue"])) : n.kind === "date" ? (c(), T(ta, N({
|
|
2774
2776
|
key: 8,
|
|
2775
2777
|
ref_for: !0
|
|
2776
|
-
}, L(
|
|
2777
|
-
"model-value": ge(
|
|
2778
|
-
"onUpdate:modelValue": (v) => f(
|
|
2779
|
-
}), null, 16, ["model-value", "onUpdate:modelValue"])) :
|
|
2778
|
+
}, L(n), {
|
|
2779
|
+
"model-value": ge(n),
|
|
2780
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2781
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : n.kind === "datetime" ? (c(), T(Xa, N({
|
|
2780
2782
|
key: 9,
|
|
2781
2783
|
ref_for: !0
|
|
2782
|
-
}, L(
|
|
2783
|
-
"model-value": ge(
|
|
2784
|
-
"onUpdate:modelValue": (v) => f(
|
|
2785
|
-
}), null, 16, ["model-value", "onUpdate:modelValue"])) :
|
|
2784
|
+
}, L(n), {
|
|
2785
|
+
"model-value": ge(n),
|
|
2786
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2787
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : n.kind === "image" || n.kind === "document" || n.kind === "gallery" ? (c(), k(Z, { key: 10 }, [
|
|
2786
2788
|
e.resources ? (c(), T(bl, N({
|
|
2787
2789
|
key: 0,
|
|
2788
2790
|
ref_for: !0
|
|
2789
|
-
}, L(
|
|
2791
|
+
}, L(n), {
|
|
2790
2792
|
source: e.resources,
|
|
2791
|
-
multiple:
|
|
2792
|
-
accept:
|
|
2793
|
-
"model-value":
|
|
2794
|
-
"onUpdate:modelValue": (v) => f(
|
|
2793
|
+
multiple: n.kind === "gallery",
|
|
2794
|
+
accept: n.props?.accept ?? (n.kind === "image" ? "image/*" : void 0),
|
|
2795
|
+
"model-value": n.kind === "gallery" ? Q(n) : e.modelValue[n.key],
|
|
2796
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2795
2797
|
}), null, 16, ["source", "multiple", "accept", "model-value", "onUpdate:modelValue"])) : z("", !0)
|
|
2796
|
-
], 64)) :
|
|
2798
|
+
], 64)) : n.kind === "collection" ? (c(), T(tl, N({
|
|
2797
2799
|
key: 11,
|
|
2798
2800
|
ref_for: !0
|
|
2799
|
-
}, L(
|
|
2800
|
-
fields:
|
|
2801
|
-
"model-value": xe(
|
|
2801
|
+
}, L(n), {
|
|
2802
|
+
fields: n.children ?? [],
|
|
2803
|
+
"model-value": xe(n),
|
|
2802
2804
|
locales: i.value,
|
|
2803
2805
|
"default-locale": m.value,
|
|
2804
|
-
errors: h(
|
|
2806
|
+
errors: h(n.key),
|
|
2805
2807
|
resources: e.resources,
|
|
2806
|
-
"add-label":
|
|
2808
|
+
"add-label": n.props?.addLabel,
|
|
2807
2809
|
"locale-mode": e.localeMode,
|
|
2808
|
-
"onUpdate:modelValue": (v) => f(
|
|
2810
|
+
"onUpdate:modelValue": (v) => f(n.key, v)
|
|
2809
2811
|
}), null, 16, ["fields", "model-value", "locales", "default-locale", "errors", "resources", "add-label", "locale-mode", "onUpdate:modelValue"])) : z("", !0)
|
|
2810
2812
|
], 64))), 128))
|
|
2811
2813
|
]));
|
|
2812
2814
|
}
|
|
2813
2815
|
});
|
|
2814
2816
|
async function Fl() {
|
|
2815
|
-
const [o, t, e, a, r,
|
|
2817
|
+
const [o, t, e, a, r, s] = await Promise.all([
|
|
2816
2818
|
import("@codemirror/state"),
|
|
2817
2819
|
import("@codemirror/view"),
|
|
2818
2820
|
import("@codemirror/commands"),
|
|
@@ -2820,7 +2822,7 @@ async function Fl() {
|
|
|
2820
2822
|
import("@codemirror/lint"),
|
|
2821
2823
|
import("@lezer/highlight")
|
|
2822
2824
|
]);
|
|
2823
|
-
return { state: o, view: t, commands: e, language: a, lint: r, highlight:
|
|
2825
|
+
return { state: o, view: t, commands: e, language: a, lint: r, highlight: s };
|
|
2824
2826
|
}
|
|
2825
2827
|
async function rt(o) {
|
|
2826
2828
|
switch (o) {
|
|
@@ -2852,7 +2854,7 @@ const Bl = {
|
|
|
2852
2854
|
},
|
|
2853
2855
|
emits: ["update:modelValue", "save", "cursor", "failed"],
|
|
2854
2856
|
setup(o, { expose: t, emit: e }) {
|
|
2855
|
-
const a = o, r = e, { t:
|
|
2857
|
+
const a = o, r = e, { t: s } = J(), p = oe("host"), i = P(!1);
|
|
2856
2858
|
let m = null, b = null, g = !1, h = null;
|
|
2857
2859
|
const l = { language: void 0, locked: void 0, numbers: void 0 };
|
|
2858
2860
|
function f() {
|
|
@@ -2952,7 +2954,7 @@ const Bl = {
|
|
|
2952
2954
|
ref: p,
|
|
2953
2955
|
class: G(["h-full", { hidden: i.value }])
|
|
2954
2956
|
}, null, 2),
|
|
2955
|
-
i.value ? (c(), k("p", Bl, q(u(
|
|
2957
|
+
i.value ? (c(), k("p", Bl, q(u(s)("core.form.code.failed")), 1)) : z("", !0)
|
|
2956
2958
|
], 6));
|
|
2957
2959
|
}
|
|
2958
2960
|
}), Ll = { class: "w-full" }, Tl = ["aria-expanded", "aria-controls"], Ml = ["id", "aria-describedby"], Dl = {
|
|
@@ -2980,7 +2982,7 @@ const Bl = {
|
|
|
2980
2982
|
}, { ...ue, modelValue: "", language: "html", readonly: !1, lineNumbers: !0, height: "24rem", markers: () => [] }),
|
|
2981
2983
|
emits: ["update:modelValue", "save"],
|
|
2982
2984
|
setup(o, { expose: t, emit: e }) {
|
|
2983
|
-
const a = o, r = e, { t:
|
|
2985
|
+
const a = o, r = e, { t: s } = J(), { editable: p } = Be(a), i = oe("editor"), m = P(!1), b = M(() => a.readonly || !p.value || a.disabled);
|
|
2984
2986
|
return t({ focus: () => i.value?.focus() }), (g, h) => (c(), T(fe, N({ ...u(re)(a), editable: !0, required: a.required && u(p) }, {
|
|
2985
2987
|
"row-layout": "stacked",
|
|
2986
2988
|
value: null
|
|
@@ -2994,7 +2996,7 @@ const Bl = {
|
|
|
2994
2996
|
"aria-expanded": m.value,
|
|
2995
2997
|
"aria-controls": `${l}-preview`,
|
|
2996
2998
|
onClick: h[0] || (h[0] = (d) => m.value = !m.value)
|
|
2997
|
-
}, q(m.value ? u(
|
|
2999
|
+
}, q(m.value ? u(s)("core.form.code.hide_preview") : u(s)("core.form.code.show_preview")), 9, Tl)) : z("", !0),
|
|
2998
3000
|
V("div", {
|
|
2999
3001
|
class: G(["grid w-full gap-3", { "lg:grid-cols-2": g.$slots.preview }])
|
|
3000
3002
|
}, [
|
|
@@ -3020,12 +3022,12 @@ const Bl = {
|
|
|
3020
3022
|
onSave: h[2] || (h[2] = (d) => r("save"))
|
|
3021
3023
|
}, null, 8, ["model-value", "language", "readonly", "line-numbers", "markers", "label"])
|
|
3022
3024
|
], 12, Ml),
|
|
3023
|
-
b.value ? z("", !0) : (c(), k("p", Dl, q(u(
|
|
3025
|
+
b.value ? z("", !0) : (c(), k("p", Dl, q(u(s)("core.form.code.tab_hint")), 1))
|
|
3024
3026
|
]),
|
|
3025
3027
|
g.$slots.preview ? (c(), k("div", {
|
|
3026
3028
|
key: 0,
|
|
3027
3029
|
id: `${l}-preview`,
|
|
3028
|
-
"aria-label": u(
|
|
3030
|
+
"aria-label": u(s)("core.form.code.preview"),
|
|
3029
3031
|
role: "region",
|
|
3030
3032
|
class: G(["min-h-48 overflow-hidden rounded-md border border-border-control", m.value ? "block" : "hidden lg:block"]),
|
|
3031
3033
|
style: Me({ height: a.height })
|
|
@@ -3065,8 +3067,8 @@ const Bl = {
|
|
|
3065
3067
|
},
|
|
3066
3068
|
emits: ["select"],
|
|
3067
3069
|
setup(o, { emit: t }) {
|
|
3068
|
-
const e = o, a = t, { t: r } = J(),
|
|
3069
|
-
() => ["error", "warning"].map((m) => ({ severity: m, items: e.markers.filter((b) => b.severity === m).sort(
|
|
3070
|
+
const e = o, a = t, { t: r } = J(), s = (m, b) => m.line - b.line || (m.column ?? 0) - (b.column ?? 0), p = M(
|
|
3071
|
+
() => ["error", "warning"].map((m) => ({ severity: m, items: e.markers.filter((b) => b.severity === m).sort(s) })).filter((m) => m.items.length > 0)
|
|
3070
3072
|
), i = (m) => m.column ? r("core.form.markers.line_column", { line: m.line, column: m.column }) : r("core.form.markers.line", { line: m.line });
|
|
3071
3073
|
return (m, b) => (c(), k("div", {
|
|
3072
3074
|
"data-marker-list": "",
|
|
@@ -3116,15 +3118,15 @@ const Bl = {
|
|
|
3116
3118
|
return t;
|
|
3117
3119
|
}, nt = (o) => typeof o == "string" || typeof o == "number";
|
|
3118
3120
|
function Ar(o, t) {
|
|
3119
|
-
const e = t.zod, { messages: a = {} } = t, r = e.any().refine(() => !1, { params: { code: "required" }, ...a.required !== void 0 ? { error: a.required } : {} }),
|
|
3121
|
+
const e = t.zod, { messages: a = {} } = t, r = e.any().refine(() => !1, { params: { code: "required" }, ...a.required !== void 0 ? { error: a.required } : {} }), s = (f) => f !== void 0 ? { error: f } : {};
|
|
3120
3122
|
function p(f) {
|
|
3121
3123
|
const d = f.validation ?? [], w = (B) => d.find(($) => $.rule === B), _ = w("min"), y = w("max"), S = () => {
|
|
3122
|
-
let B = e.string(
|
|
3124
|
+
let B = e.string(s(a.type));
|
|
3123
3125
|
_ && (B = B.min(we(_))), y && (B = B.max(we(y)));
|
|
3124
3126
|
const $ = [B];
|
|
3125
|
-
w("email") && $.push(e.email(
|
|
3127
|
+
w("email") && $.push(e.email(s(a.email))), w("url") && $.push(e.url(s(a.url)));
|
|
3126
3128
|
const O = w("regex")?.args?.[0];
|
|
3127
|
-
if (typeof O == "string") $.push(e.string().regex(new RegExp(O),
|
|
3129
|
+
if (typeof O == "string") $.push(e.string().regex(new RegExp(O), s(a.regex)));
|
|
3128
3130
|
else if (w("regex")) throw new Error(`buildValidator: the "regex" rule of "${f.key}" needs a pattern string.`);
|
|
3129
3131
|
return $;
|
|
3130
3132
|
}, F = (B) => {
|
|
@@ -3141,26 +3143,26 @@ function Ar(o, t) {
|
|
|
3141
3143
|
for (const R of S()) for (const L of R.safeParse(I).error?.issues ?? []) $.addIssue({ ...L, path: [O, ...L.path] });
|
|
3142
3144
|
})] : S();
|
|
3143
3145
|
case "number": {
|
|
3144
|
-
let B = e.number(
|
|
3146
|
+
let B = e.number(s(a.type));
|
|
3145
3147
|
return _ && (B = B.min(we(_))), y && (B = B.max(we(y))), [B];
|
|
3146
3148
|
}
|
|
3147
3149
|
case "boolean":
|
|
3148
|
-
return [e.boolean(
|
|
3150
|
+
return [e.boolean(s(a.type))];
|
|
3149
3151
|
case "select": {
|
|
3150
3152
|
const B = (f.options ?? []).map(($) => $.value);
|
|
3151
|
-
return [e.union([e.string(), e.number()],
|
|
3153
|
+
return [e.union([e.string(), e.number()], s(a.type)).refine(($) => B.includes($), { params: { code: "invalid_choice" } })];
|
|
3152
3154
|
}
|
|
3153
3155
|
case "multi_select": {
|
|
3154
3156
|
const B = (f.options ?? []).map(($) => $.value);
|
|
3155
3157
|
return [F(e.union([e.string(), e.number()])), e.array(e.unknown()).refine(($) => $.every((O) => B.includes(O)), { params: { code: "invalid_choice" } })];
|
|
3156
3158
|
}
|
|
3157
3159
|
case "date":
|
|
3158
|
-
return [e.string(
|
|
3160
|
+
return [e.string(s(a.type)).refine((B) => Ea(B) !== null, { params: { code: "date" } })];
|
|
3159
3161
|
case "datetime":
|
|
3160
|
-
return [e.string(
|
|
3162
|
+
return [e.string(s(a.type)).refine((B) => xt(B) !== null, { params: { code: "datetime" } })];
|
|
3161
3163
|
case "image":
|
|
3162
3164
|
case "document":
|
|
3163
|
-
return [e.custom(nt,
|
|
3165
|
+
return [e.custom(nt, s(a.type))];
|
|
3164
3166
|
case "gallery":
|
|
3165
3167
|
return [F(e.custom(nt))];
|
|
3166
3168
|
case "collection":
|
|
@@ -3227,12 +3229,12 @@ const Ir = /* @__PURE__ */ K({
|
|
|
3227
3229
|
}),
|
|
3228
3230
|
emits: ["update:modelValue"],
|
|
3229
3231
|
setup(o) {
|
|
3230
|
-
const t = o, e = ye(o, "modelValue"), { t: a } = J(), { http: r } = ga(),
|
|
3232
|
+
const t = o, e = ye(o, "modelValue"), { t: a } = J(), { http: r } = ga(), s = M(() => t.value === "id"), p = ia({
|
|
3231
3233
|
// Below level 1 nothing is asked until the branch is known.
|
|
3232
3234
|
for: () => t.level > 1 && (t.parent === null || t.parent === void 0) ? null : { level: t.level, parent: t.parent ?? null, value: t.value, lang: t.lang },
|
|
3233
3235
|
load: async (l, { signal: f }) => {
|
|
3234
3236
|
const { data: d } = await r.request(ra.options, { level: l.level, ...l.parent === null ? {} : { parent: l.parent }, ...l.value === "id" ? {} : { value: l.value }, ...l.lang ? { lang: l.lang } : {} }, { signal: f });
|
|
3235
|
-
return d.map((w) => ({ value:
|
|
3237
|
+
return d.map((w) => ({ value: s.value ? Number(w.value) : w.value, label: w.label }));
|
|
3236
3238
|
}
|
|
3237
3239
|
}), i = M(() => Array.isArray(e.value) ? e.value : e.value === null || e.value === void 0 ? [] : [e.value]), m = M(() => t.selected === null ? [] : Array.isArray(t.selected) ? t.selected : [t.selected]), b = {
|
|
3238
3240
|
get status() {
|