@wssto2/vue-core 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js → ActionRow.vue_vue_type_script_setup_true_lang-DOjn7fqy.js} +1 -1
- package/dist/{Activity-BdSvn0GP.js → Activity-CVO3sJwy.js} +6 -6
- package/dist/{Changes-BQO--N9F.js → Changes-Bzvl3cEx.js} +5 -5
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DkpFEHUw.js → CollectionPage.vue_vue_type_script_setup_true_lang-CD5zZ29o.js} +2 -2
- package/dist/DateField.vue_vue_type_script_setup_true_lang-BufoFwVQ.js +278 -0
- package/dist/{DeadLetters-OmeiADEi.js → DeadLetters-DmwUtgf9.js} +4 -4
- package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js +285 -0
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js → FormGroup.vue_vue_type_script_setup_true_lang-BokxZ7LU.js} +1 -1
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js → FormView.vue_vue_type_script_setup_true_lang-Dz5TZt92.js} +2 -2
- package/dist/{General-CBwFLiKQ.js → General-CUEjJBD4.js} +10 -10
- package/dist/{NewRolePage-CblUW2gA.js → NewRolePage-Cyn-oV6r.js} +3 -3
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-a8kN3A7k.js +150 -0
- package/dist/{ProfilePage-BOoDDbmB.js → ProfilePage-I74SQBFO.js} +41 -41
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BCE5yrwy.js → RoleEditor.vue_vue_type_script_setup_true_lang-Ce6wjptT.js} +44 -44
- package/dist/{RolePage-xDsFL_eC.js → RolePage-DWQP3qQl.js} +8 -8
- package/dist/{RolesPage-C39wsF6X.js → RolesPage-BeEsHIQ2.js} +5 -5
- package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BMBkEmxr.js +81 -0
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-C1Flb1hA.js +465 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js → SessionList.vue_vue_type_script_setup_true_lang-DoUo68xE.js} +2 -2
- package/dist/{Sessions-m_i4aTfw.js → Sessions-D8IXcb5M.js} +4 -4
- package/dist/{SettingsPage-ktKvQQnE.js → SettingsPage-DRQP2nrH.js} +9 -9
- package/dist/{SignIn-CkoEixY4.js → SignIn-CAZkovhb.js} +6 -6
- package/dist/{SignInPage-DVcpFz3G.js → SignInPage-D-49oLY3.js} +3 -3
- package/dist/{SignIns-BnVAtncZ.js → SignIns-BtNfgMLc.js} +3 -3
- package/dist/SwitchField.vue_vue_type_script_setup_true_lang-0weBvsJf.js +87 -0
- package/dist/TextField.vue_vue_type_script_setup_true_lang-D3-R5XXG.js +292 -0
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-4wC3c0BM.js +91 -0
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-pAdLPYXA.js +187 -0
- package/dist/{UserRecord-Cg69_mbU.js → UserRecord-BSbNuRFi.js} +10 -10
- package/dist/{UsersList-BFmBDGs7.js → UsersList-DPHxcaDm.js} +8 -8
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +8 -2
- package/dist/app/index.js +93 -93
- package/dist/collection/index.js +1 -1
- package/dist/control-B_Nwtmag.js +334 -0
- package/dist/{describeError-CvGmajU0.js → describeError-B-NMa--w.js} +12 -7
- package/dist/fieldMessages-DV6sESpn.js +25 -0
- package/dist/form/CardSelectField.vue.d.ts +2 -2
- package/dist/form/ChoiceChips.vue.d.ts +2 -2
- package/dist/form/ComboField.vue.d.ts +2 -2
- package/dist/form/DateField.vue.d.ts +10 -2
- package/dist/form/DateTimeField.vue.d.ts +10 -2
- package/dist/form/Field.vue.d.ts +2 -1
- package/dist/form/FileField.vue.d.ts +10 -2
- package/dist/form/FormErrors.vue.d.ts +1 -1
- package/dist/form/FormRow.vue.d.ts +3 -0
- package/dist/form/I18nField.vue.d.ts +10 -2
- package/dist/form/MoneyField.vue.d.ts +10 -2
- package/dist/form/MonthYearField.vue.d.ts +10 -2
- package/dist/form/MultiSelectField.vue.d.ts +2 -2
- package/dist/form/NumberField.vue.d.ts +25 -2
- package/dist/form/PhotoField.vue.d.ts +10 -2
- package/dist/form/SegmentedField.vue.d.ts +2 -2
- package/dist/form/SelectField.vue.d.ts +7 -8
- package/dist/form/SwitchField.vue.d.ts +3 -2
- package/dist/form/TextField.vue.d.ts +10 -2
- package/dist/form/TextareaField.vue.d.ts +10 -2
- package/dist/form/TimeField.vue.d.ts +10 -2
- package/dist/form/field.d.ts +12 -0
- package/dist/form/index.d.ts +3 -1
- package/dist/form/index.js +1167 -956
- package/dist/form/useForm.d.ts +2 -2
- package/dist/form/useHiddenFieldErrors.d.ts +23 -0
- package/dist/form/useSaveChrome.d.ts +8 -3
- package/dist/i18n/describeError.d.ts +8 -0
- package/dist/i18n/index.d.ts +3 -2
- package/dist/i18n/index.js +32 -28
- package/dist/identity/fieldMessages.d.ts +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/{index-RNF5-9uf.js → index-Bq96L43f.js} +15 -15
- package/dist/{index-B416VXmR.js → index-CWeNiBX6.js} +2 -2
- package/dist/{index-KcCoCfr-.js → index-yKIOaisE.js} +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/phone/PhoneField.vue.d.ts +1 -0
- package/dist/phone/index.js +66 -65
- package/dist/resource/index.js +1 -1
- package/dist/{routeResource-BwEFXzIX.js → routeResource-DlTsGTg_.js} +1 -1
- package/dist/state/index.js +1 -1
- package/dist/{status-OZUHZpWl.js → status-DzmySsWw.js} +1 -1
- package/dist/{useCommand-BkONMn3X.js → useCommand-B-N6HJOz.js} +1 -1
- package/dist/{useLoad-DuEsLECT.js → useLoad-M7V-AVwR.js} +1 -1
- package/dist/{useResourceForm-D1hIpwW5.js → useResourceForm-CP2lCwmD.js} +1 -1
- package/dist/useSaveChrome-7huA3FzR.js +26 -0
- package/package.json +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js +0 -255
- package/dist/FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js +0 -276
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js +0 -113
- package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js +0 -58
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +0 -437
- package/dist/SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js +0 -64
- package/dist/TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js +0 -269
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js +0 -68
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js +0 -164
- package/dist/control-7EP4tjYy.js +0 -313
- package/dist/fieldMessages-D_dpSe19.js +0 -25
- package/dist/useSaveChrome-DuWm0Czf.js +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as r, openBlock as s, createBlock as d, unref as n, withCtx as f, createElementVNode as t, normalizeClass as m, toDisplayString as l, createElementBlock as u, createCommentVNode as p, createVNode as b } from "vue";
|
|
2
|
-
import { e as _ } from "./control-
|
|
2
|
+
import { e as _ } from "./control-B_Nwtmag.js";
|
|
3
3
|
import { _ as x } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
4
4
|
const k = ["disabled"], y = { class: "flex min-w-0 flex-1 flex-col" }, h = {
|
|
5
5
|
key: 0,
|
|
@@ -3,15 +3,15 @@ import { useI18n as q } from "vue-i18n";
|
|
|
3
3
|
import { _ as D } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
4
4
|
import { _ as I } from "./Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
|
|
5
5
|
import { u as O } from "./format-B8mJm946.js";
|
|
6
|
-
import { _ as U } from "./DateField.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { e as z } from "./control-
|
|
9
|
-
import { P as G, c as H, i as J } from "./index-
|
|
6
|
+
import { _ as U } from "./DateField.vue_vue_type_script_setup_true_lang-BufoFwVQ.js";
|
|
7
|
+
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-BokxZ7LU.js";
|
|
8
|
+
import { e as z } from "./control-B_Nwtmag.js";
|
|
9
|
+
import { P as G, c as H, i as J } from "./index-Bq96L43f.js";
|
|
10
10
|
import { u as K } from "./platform-q3cjODLx.js";
|
|
11
|
-
import { b as M } from "./routeResource-
|
|
11
|
+
import { b as M } from "./routeResource-DlTsGTg_.js";
|
|
12
12
|
import { _ as Q } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
13
13
|
import { _ as W } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
14
|
-
import { u as X } from "./useLoad-
|
|
14
|
+
import { u as X } from "./useLoad-M7V-AVwR.js";
|
|
15
15
|
import { _ as Y } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
|
|
16
16
|
import { _ as Z } from "./SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js";
|
|
17
17
|
const ee = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as k, computed as N, openBlock as n, createBlock as u, unref as a, withCtx as g, createElementBlock as p, Fragment as _, renderList as $, createElementVNode as i, toDisplayString as h, createCommentVNode as C, ref as x, watch as b, createVNode as y } from "vue";
|
|
2
2
|
import { useI18n as E } from "vue-i18n";
|
|
3
|
-
import { P as V, i as R } from "./index-
|
|
3
|
+
import { P as V, i as R } from "./index-Bq96L43f.js";
|
|
4
4
|
import { u as S } from "./platform-q3cjODLx.js";
|
|
5
|
-
import { b as B } from "./routeResource-
|
|
5
|
+
import { b as B } from "./routeResource-DlTsGTg_.js";
|
|
6
6
|
import { _ as F } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
7
|
-
import { u as L } from "./useLoad-
|
|
7
|
+
import { u as L } from "./useLoad-M7V-AVwR.js";
|
|
8
8
|
import { _ as P } from "./Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js";
|
|
9
9
|
import { _ as I } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
10
10
|
import { u as O } from "./format-B8mJm946.js";
|
|
11
|
-
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { e as U } from "./control-
|
|
11
|
+
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-BokxZ7LU.js";
|
|
12
|
+
import { e as U } from "./control-B_Nwtmag.js";
|
|
13
13
|
import { _ as q } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
|
|
14
14
|
import { _ as z } from "./SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js";
|
|
15
15
|
import { _ as A } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js";
|
|
@@ -14,8 +14,8 @@ import { u as bt, _ as gt } from "./rowLayout-D1cYQghV.js";
|
|
|
14
14
|
import { _ as Ye } from "./Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js";
|
|
15
15
|
import { _ as Ze } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
|
|
16
16
|
import { _ as we } from "./ToneDot.vue_vue_type_script_setup_true_lang-99rNn-L5.js";
|
|
17
|
-
import { _ as ht } from "./NumberField.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as yt } from "./SelectField.vue_vue_type_script_setup_true_lang-
|
|
17
|
+
import { _ as ht } from "./NumberField.vue_vue_type_script_setup_true_lang-a8kN3A7k.js";
|
|
18
|
+
import { _ as yt } from "./SelectField.vue_vue_type_script_setup_true_lang-C1Flb1hA.js";
|
|
19
19
|
import { a as _t } from "./mediaQuery-CygcXmFW.js";
|
|
20
20
|
import { _ as xt } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
|
|
21
21
|
import { t as ke } from "./toast-CqSDTWRX.js";
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { computed as f, defineComponent as Z, useModel as ee, useTemplateRef as N, openBlock as k, createBlock as I, mergeProps as V, unref as s, createSlots as te, withCtx as v, createElementBlock as T, Fragment as Q, createVNode as $, createTextVNode as re, toDisplayString as Y, createCommentVNode as B, createElementVNode as C, normalizeClass as oe, renderSlot as E, mergeModels as ae, mergeDefaults as ne, nextTick as H } from "vue";
|
|
2
|
+
import { useI18n as j } from "vue-i18n";
|
|
3
|
+
import { _ as le } from "./DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js";
|
|
4
|
+
import { u as K } from "./format-B8mJm946.js";
|
|
5
|
+
import { _ as se } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
6
|
+
import { u as ie } from "./mediaQuery-CygcXmFW.js";
|
|
7
|
+
import { _ as de } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
|
|
8
|
+
import { c as ue, _ as ce, f as me, b as fe } from "./control-B_Nwtmag.js";
|
|
9
|
+
import { e as O, f as M, m as G, g as J, h as pe, j as be, u as ve, k as ye, _ as ke, l as ge, c as he } from "./useTypedEntry-aTfPBAhw.js";
|
|
10
|
+
const xe = ["d", "m", "y"];
|
|
11
|
+
function _e(o) {
|
|
12
|
+
const r = o("2033-11-22"), e = { y: r.indexOf("2033") >= 0 ? r.indexOf("2033") : r.indexOf("33"), m: r.indexOf("11"), d: r.indexOf("22") };
|
|
13
|
+
return e.y < 0 || e.m < 0 || e.d < 0 ? xe : ["d", "m", "y"].sort((t, a) => e[t] - e[a]);
|
|
14
|
+
}
|
|
15
|
+
const we = (o) => o.trim().toLowerCase().replace(/\.+$/, "");
|
|
16
|
+
function $e(o, r) {
|
|
17
|
+
if (o.length === 4) return Number(o);
|
|
18
|
+
if (o.length > 2) return null;
|
|
19
|
+
const e = 2e3 + Number(o);
|
|
20
|
+
return e > Number(r.slice(0, 4)) + 30 ? e - 100 : e;
|
|
21
|
+
}
|
|
22
|
+
function g(o, r) {
|
|
23
|
+
const e = o.y === void 0 ? Number(r.slice(0, 4)) : $e(o.y, r), t = o.m === void 0 ? Number(r.slice(5, 7)) : Number(o.m);
|
|
24
|
+
return e === null || o.d === void 0 ? null : G(e, t, Number(o.d));
|
|
25
|
+
}
|
|
26
|
+
function De(o, r) {
|
|
27
|
+
const e = r.today ?? O(), t = we(o);
|
|
28
|
+
if (t === "") return null;
|
|
29
|
+
const { words: a } = r;
|
|
30
|
+
if (a.today.includes(t)) return e;
|
|
31
|
+
if (a.tomorrow.includes(t)) return M(e, 1);
|
|
32
|
+
if (a.yesterday.includes(t)) return M(e, -1);
|
|
33
|
+
const u = /^([+-])\s*(\d{1,4})$/.exec(t);
|
|
34
|
+
if (u) return M(e, Number(u[2]) * (u[1] === "-" ? -1 : 1));
|
|
35
|
+
const d = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(t);
|
|
36
|
+
if (d) return G(Number(d[1]), Number(d[2]), Number(d[3]));
|
|
37
|
+
if (!/^[\d\s./-]+$/.test(t)) return null;
|
|
38
|
+
const n = r.order, p = n.filter((y) => y !== "y");
|
|
39
|
+
if (/^\d+$/.test(t)) {
|
|
40
|
+
if (t.length <= 2) return g({ d: t }, e);
|
|
41
|
+
if (t.length === 4) return g(S(p, [t.slice(0, 2), t.slice(2)]), e);
|
|
42
|
+
if (t.length === 6 || t.length === 8) {
|
|
43
|
+
const y = n.map((c) => c === "y" ? t.length - 4 : 2);
|
|
44
|
+
let h = 0;
|
|
45
|
+
const b = n.map((c, x) => [c, t.slice(h, h += y[x])]);
|
|
46
|
+
return g(Object.fromEntries(b), e);
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const m = t.split(/[^\d]+/).filter(Boolean);
|
|
51
|
+
return m.length === 3 ? g(S(n, m), e) : m.length === 2 ? g(S(p, m), e) : m.length === 1 ? g({ d: m[0] }, e) : null;
|
|
52
|
+
}
|
|
53
|
+
function S(o, r) {
|
|
54
|
+
return Object.fromEntries(o.map((e, t) => [e, r[t]]));
|
|
55
|
+
}
|
|
56
|
+
function Ae(o) {
|
|
57
|
+
const r = o.trim().replace(/^(\d{4}-\d{2}-\d{2})T/, "$1 ").split(/\s+/).filter(Boolean), e = r[r.length - 1];
|
|
58
|
+
if (e === void 0) return { date: null, time: null };
|
|
59
|
+
if (!(e.includes(":") || r.length > 1 && /^\d{1,2}\.\d{2}$/.test(e))) return { date: r.join(" "), time: null };
|
|
60
|
+
const a = r.slice(0, -1).join(" ");
|
|
61
|
+
return { date: a === "" ? null : a, time: e };
|
|
62
|
+
}
|
|
63
|
+
function Ne(o, r, e) {
|
|
64
|
+
const t = o(e), a = /\D+/.exec(t)?.[0].trim() ?? ".", u = /\D+$/.test(t) ? a : "", d = { d: String(Number(e.slice(8))), m: String(Number(e.slice(5, 7))), y: "" };
|
|
65
|
+
return r.filter((n) => n !== "y").map((n) => d[n]).join(a) + u;
|
|
66
|
+
}
|
|
67
|
+
function Te(o) {
|
|
68
|
+
const { t: r } = j(), e = K(), t = (n) => e.date(n), a = f(() => _e(t)), u = f(() => ({
|
|
69
|
+
today: [r("core.form.date.words.today").toLowerCase(), "today"],
|
|
70
|
+
tomorrow: [r("core.form.date.words.tomorrow").toLowerCase(), "tomorrow"],
|
|
71
|
+
yesterday: [r("core.form.date.words.yesterday").toLowerCase(), "yesterday"]
|
|
72
|
+
}));
|
|
73
|
+
return {
|
|
74
|
+
placeholder: f(() => r("core.form.date.placeholder", { example: Ne(t, a.value, O()) })),
|
|
75
|
+
/** The day a text means, or null. */
|
|
76
|
+
parse: (n) => De(n, { order: a.value, words: u.value }),
|
|
77
|
+
available: (n) => !J(n, o()),
|
|
78
|
+
invalidMessage: () => r("core.form.date.invalid", { example: t(O()) }),
|
|
79
|
+
unavailableMessage: () => r("core.form.date.unavailable")
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function Ce(o, r, e) {
|
|
83
|
+
const { t } = j();
|
|
84
|
+
return f(() => {
|
|
85
|
+
const a = O();
|
|
86
|
+
return (o() ?? pe(r())).map((u) => {
|
|
87
|
+
const d = be(u, (n) => t(`core.form.date.${n.replace(/-/g, "_")}`), a);
|
|
88
|
+
return { ...d, disabled: J(d.value, e()) };
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const Oe = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], qe = ["aria-label", "onClick"], Pe = { class: "flex flex-col gap-2.5" }, Ve = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "border-t border-border-separator pt-2.5"
|
|
95
|
+
}, Be = { class: "text-footnote text-content-muted" }, Ie = /* @__PURE__ */ Z({
|
|
96
|
+
__name: "DateField",
|
|
97
|
+
props: /* @__PURE__ */ ae(/* @__PURE__ */ ne({
|
|
98
|
+
label: {},
|
|
99
|
+
labelHidden: { type: Boolean },
|
|
100
|
+
hint: {},
|
|
101
|
+
error: {},
|
|
102
|
+
required: { type: Boolean },
|
|
103
|
+
editable: { type: Boolean },
|
|
104
|
+
disabled: { type: Boolean },
|
|
105
|
+
lockedReason: {},
|
|
106
|
+
presentation: {},
|
|
107
|
+
name: {},
|
|
108
|
+
min: {},
|
|
109
|
+
max: {},
|
|
110
|
+
disabledDates: { type: [Array, Function] },
|
|
111
|
+
openOn: {},
|
|
112
|
+
quickPicks: {}
|
|
113
|
+
}, { ...fe, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, quickPicks: void 0 }), {
|
|
114
|
+
modelValue: { default: null },
|
|
115
|
+
modelModifiers: {}
|
|
116
|
+
}),
|
|
117
|
+
emits: ["update:modelValue"],
|
|
118
|
+
setup(o, { expose: r }) {
|
|
119
|
+
const e = o, t = ee(o, "modelValue"), { t: a } = j(), u = K(), d = ie(), n = N("input"), p = N("popover"), m = N("calendar"), y = N("sheet"), h = f(() => ({ min: e.min, max: e.max, disabled: e.disabledDates })), b = Te(() => h.value), c = ve({
|
|
120
|
+
model: t,
|
|
121
|
+
display: (l) => u.date(l),
|
|
122
|
+
parse: (l) => {
|
|
123
|
+
const i = b.parse(l);
|
|
124
|
+
return i ? b.available(i) ? { value: i } : { error: b.unavailableMessage() } : { error: b.invalidMessage() };
|
|
125
|
+
}
|
|
126
|
+
}), x = Ce(() => e.quickPicks, () => d.value, () => h.value), L = f(() => e.error || c.message.value), q = f(() => t.value ? u.date(t.value) : null), W = ue("date", () => L.value ? "error" : e.disabled ? "locked" : "rest"), z = f(() => c.typed.value ?? (ye(t.value) ? t.value : null));
|
|
127
|
+
async function P(l) {
|
|
128
|
+
e.disabled || (p.value?.present(), l && (await H(), await H(), m.value?.focus()));
|
|
129
|
+
}
|
|
130
|
+
function X(l) {
|
|
131
|
+
l.key === "Enter" ? (c.commit(), p.value?.dismiss()) : l.key === "ArrowDown" && (l.preventDefault(), P(!0));
|
|
132
|
+
}
|
|
133
|
+
function F(l, i) {
|
|
134
|
+
c.set(l), i();
|
|
135
|
+
}
|
|
136
|
+
return r({ focus: () => n.value?.focus() }), (l, i) => (k(), I(ce, V({ ...s(me)(e), error: L.value }, {
|
|
137
|
+
value: q.value,
|
|
138
|
+
"value-style": "numeric"
|
|
139
|
+
}), te({
|
|
140
|
+
default: v(({ id: U, describedby: R, invalid: A }) => [
|
|
141
|
+
s(d) ? (k(), T(Q, { key: 0 }, [
|
|
142
|
+
$(le, V({ id: U, "aria-describedby": R }, {
|
|
143
|
+
disabled: e.disabled,
|
|
144
|
+
invalid: A,
|
|
145
|
+
placeholder: s(a)("core.form.select.choose"),
|
|
146
|
+
onClick: i[0] || (i[0] = (_) => y.value?.present())
|
|
147
|
+
}), {
|
|
148
|
+
default: v(() => [
|
|
149
|
+
q.value ? (k(), T(Q, { key: 0 }, [
|
|
150
|
+
re(Y(q.value), 1)
|
|
151
|
+
], 64)) : B("", !0)
|
|
152
|
+
]),
|
|
153
|
+
_: 1
|
|
154
|
+
}, 16, ["disabled", "invalid", "placeholder"]),
|
|
155
|
+
$(ke, {
|
|
156
|
+
ref_key: "sheet",
|
|
157
|
+
ref: y,
|
|
158
|
+
title: e.label ?? s(a)("core.form.date.calendar"),
|
|
159
|
+
mode: "date",
|
|
160
|
+
"model-value": t.value,
|
|
161
|
+
min: e.min,
|
|
162
|
+
max: e.max,
|
|
163
|
+
"disabled-dates": e.disabledDates,
|
|
164
|
+
"open-on": e.openOn,
|
|
165
|
+
shortcuts: s(x),
|
|
166
|
+
clearable: !e.required,
|
|
167
|
+
"onUpdate:modelValue": s(c).set
|
|
168
|
+
}, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "clearable", "onUpdate:modelValue"])
|
|
169
|
+
], 64)) : (k(), I(de, {
|
|
170
|
+
key: 1,
|
|
171
|
+
ref_key: "popover",
|
|
172
|
+
ref: p,
|
|
173
|
+
label: e.label ?? s(a)("core.form.date.calendar"),
|
|
174
|
+
width: "lg",
|
|
175
|
+
placement: "bottom-start",
|
|
176
|
+
arrow: !1,
|
|
177
|
+
autofocus: !1
|
|
178
|
+
}, {
|
|
179
|
+
trigger: v(({ attrs: _, presented: w }) => [
|
|
180
|
+
C("div", {
|
|
181
|
+
class: oe(["inline-flex max-w-full items-center gap-2", s(W)])
|
|
182
|
+
}, [
|
|
183
|
+
C("input", V({
|
|
184
|
+
id: U,
|
|
185
|
+
ref_key: "input",
|
|
186
|
+
ref: n
|
|
187
|
+
}, _, {
|
|
188
|
+
type: "text",
|
|
189
|
+
role: "combobox",
|
|
190
|
+
autocomplete: "off",
|
|
191
|
+
size: "16",
|
|
192
|
+
name: e.name,
|
|
193
|
+
value: s(c).text.value,
|
|
194
|
+
placeholder: s(b).placeholder.value,
|
|
195
|
+
disabled: e.disabled,
|
|
196
|
+
required: e.required,
|
|
197
|
+
"aria-required": e.required || void 0,
|
|
198
|
+
"aria-invalid": A || void 0,
|
|
199
|
+
"aria-describedby": R,
|
|
200
|
+
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",
|
|
201
|
+
onInput: i[1] || (i[1] = (D) => s(c).input(D.target.value)),
|
|
202
|
+
onBlur: i[2] || (i[2] = (D) => s(c).commit()),
|
|
203
|
+
onKeydown: X,
|
|
204
|
+
onClick: i[3] || (i[3] = (D) => P(!1))
|
|
205
|
+
}), null, 16, Oe),
|
|
206
|
+
e.disabled ? B("", !0) : (k(), T("button", {
|
|
207
|
+
key: 0,
|
|
208
|
+
type: "button",
|
|
209
|
+
tabindex: "-1",
|
|
210
|
+
"aria-label": s(a)("core.form.date.open"),
|
|
211
|
+
class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
|
|
212
|
+
onClick: (D) => w ? p.value?.dismiss() : P(!0)
|
|
213
|
+
}, [
|
|
214
|
+
$(s(se), {
|
|
215
|
+
name: "calendarLine",
|
|
216
|
+
size: 18
|
|
217
|
+
})
|
|
218
|
+
], 8, qe))
|
|
219
|
+
], 2)
|
|
220
|
+
]),
|
|
221
|
+
default: v(({ dismiss: _ }) => [
|
|
222
|
+
C("div", Pe, [
|
|
223
|
+
$(ge, {
|
|
224
|
+
ref_key: "calendar",
|
|
225
|
+
ref: m,
|
|
226
|
+
"model-value": z.value,
|
|
227
|
+
min: e.min,
|
|
228
|
+
max: e.max,
|
|
229
|
+
"disabled-dates": e.disabledDates,
|
|
230
|
+
"open-on": e.openOn,
|
|
231
|
+
"month-picker": "",
|
|
232
|
+
"onUpdate:modelValue": (w) => F(w, _)
|
|
233
|
+
}, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on", "onUpdate:modelValue"]),
|
|
234
|
+
s(x).length > 0 ? (k(), T("div", Ve, [
|
|
235
|
+
$(he, {
|
|
236
|
+
items: s(x),
|
|
237
|
+
selected: z.value,
|
|
238
|
+
onPick: (w) => F(w, _)
|
|
239
|
+
}, null, 8, ["items", "selected", "onPick"])
|
|
240
|
+
])) : B("", !0),
|
|
241
|
+
C("p", Be, Y(s(a)("core.form.date.keys")), 1)
|
|
242
|
+
])
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1032, ["label"]))
|
|
246
|
+
]),
|
|
247
|
+
_: 2
|
|
248
|
+
}, [
|
|
249
|
+
l.$slots.trailing ? {
|
|
250
|
+
name: "trailing",
|
|
251
|
+
fn: v(() => [
|
|
252
|
+
E(l.$slots, "trailing")
|
|
253
|
+
]),
|
|
254
|
+
key: "0"
|
|
255
|
+
} : void 0,
|
|
256
|
+
l.$slots.labelTrailing ? {
|
|
257
|
+
name: "labelTrailing",
|
|
258
|
+
fn: v(() => [
|
|
259
|
+
E(l.$slots, "labelTrailing")
|
|
260
|
+
]),
|
|
261
|
+
key: "1"
|
|
262
|
+
} : void 0,
|
|
263
|
+
l.$slots.readonly ? {
|
|
264
|
+
name: "readonly",
|
|
265
|
+
fn: v(() => [
|
|
266
|
+
E(l.$slots, "readonly")
|
|
267
|
+
]),
|
|
268
|
+
key: "2"
|
|
269
|
+
} : void 0
|
|
270
|
+
]), 1040, ["value"]));
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
export {
|
|
274
|
+
Ie as _,
|
|
275
|
+
Ce as a,
|
|
276
|
+
Ae as s,
|
|
277
|
+
Te as u
|
|
278
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as B, useTemplateRef as C, computed as y, ref as v, openBlock as D, createBlock as z, unref as r, withCtx as m, createVNode as F, createElementVNode as b, normalizeClass as $, toDisplayString as h } from "vue";
|
|
2
2
|
import { useI18n as q } from "vue-i18n";
|
|
3
3
|
import { a as k } from "./error-CD7x0Jrz.js";
|
|
4
|
-
import { u as V, _ as N } from "./CollectionPage.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { u as P } from "./describeError-
|
|
4
|
+
import { u as V, _ as N } from "./CollectionPage.vue_vue_type_script_setup_true_lang-CD5zZ29o.js";
|
|
5
|
+
import { u as P } from "./describeError-B-NMa--w.js";
|
|
6
6
|
import { u as I } from "./format-B8mJm946.js";
|
|
7
|
-
import { e as a, R as O } from "./index-
|
|
7
|
+
import { e as a, R as O } from "./index-CWeNiBX6.js";
|
|
8
8
|
import { _ as W } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
|
|
9
9
|
import { t as i } from "./toast-CqSDTWRX.js";
|
|
10
|
-
import { u as Y } from "./useLoad-
|
|
10
|
+
import { u as Y } from "./useLoad-M7V-AVwR.js";
|
|
11
11
|
import { u as j } from "./platform-q3cjODLx.js";
|
|
12
12
|
import { a as G, r as H } from "./http-D_D9YbLH.js";
|
|
13
13
|
function J(u) {
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var X = (s, e, t) => e in s ? Q(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var $ = (s, e, t) => X(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { shallowRef as M, computed as w, toRaw as Z, reactive as K, ref as Y, watch as ee, nextTick as te, toValue as re, defineComponent as se, unref as k, openBlock as b, createBlock as ne, withCtx as ae, createElementBlock as y, toDisplayString as O, createCommentVNode as _, Fragment as I, createElementVNode as W, normalizeClass as ie, renderList as le, createTextVNode as U } from "vue";
|
|
5
|
+
import { useI18n as G } from "vue-i18n";
|
|
6
|
+
import { i as oe, a as q } from "./error-CD7x0Jrz.js";
|
|
7
|
+
import { d as ue } from "./describeError-B-NMa--w.js";
|
|
8
|
+
import { _ as ce } from "./Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js";
|
|
9
|
+
class fe {
|
|
10
|
+
constructor() {
|
|
11
|
+
$(this, "messages", M({}));
|
|
12
|
+
/** How many fields have a message. */
|
|
13
|
+
$(this, "count", w(() => Object.keys(this.messages.value).length));
|
|
14
|
+
}
|
|
15
|
+
/** Replaces everything. Empty lists are dropped. */
|
|
16
|
+
set(e) {
|
|
17
|
+
this.messages.value = Object.fromEntries(Object.entries(e).filter(([, t]) => t.length > 0).map(([t, n]) => [t, [...n]]));
|
|
18
|
+
}
|
|
19
|
+
add(e, t) {
|
|
20
|
+
this.messages.value = { ...this.messages.value, [e]: [...this.messages.value[e] ?? [], t] };
|
|
21
|
+
}
|
|
22
|
+
/** Clears one field (and its nested paths), or everything. */
|
|
23
|
+
clear(e) {
|
|
24
|
+
if (e === void 0) {
|
|
25
|
+
this.count.value > 0 && (this.messages.value = {});
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const t = Object.fromEntries(Object.entries(this.messages.value).filter(([n]) => n !== e && !n.startsWith(`${e}.`)));
|
|
29
|
+
Object.keys(t).length !== this.count.value && (this.messages.value = t);
|
|
30
|
+
}
|
|
31
|
+
/** Whether the field, or a value inside it (`items.0.quantity` for `items`), has a message. */
|
|
32
|
+
has(e) {
|
|
33
|
+
return this.first(e) !== void 0 || Object.keys(this.messages.value).some((t) => t.startsWith(`${e}.`));
|
|
34
|
+
}
|
|
35
|
+
first(e) {
|
|
36
|
+
return this.messages.value[e]?.[0];
|
|
37
|
+
}
|
|
38
|
+
all() {
|
|
39
|
+
return this.messages.value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function f(s) {
|
|
43
|
+
const e = Z(s);
|
|
44
|
+
return e === null || typeof e != "object" ? e : e instanceof Date ? new Date(e.getTime()) : typeof Blob < "u" && e instanceof Blob ? e : Array.isArray(e) ? e.map(f) : Object.fromEntries(Object.entries(e).map(([t, n]) => [t, f(n)]));
|
|
45
|
+
}
|
|
46
|
+
function S(s, e) {
|
|
47
|
+
const t = s, n = e;
|
|
48
|
+
if (Object.is(t, n)) return !0;
|
|
49
|
+
if (t === null || n === null || typeof t != "object" || typeof n != "object") return !1;
|
|
50
|
+
if (t instanceof Date || n instanceof Date) return t instanceof Date && n instanceof Date && t.getTime() === n.getTime();
|
|
51
|
+
if (Array.isArray(t) || Array.isArray(n))
|
|
52
|
+
return Array.isArray(t) && Array.isArray(n) && t.length === n.length && t.every((i, d) => S(i, n[d]));
|
|
53
|
+
if (typeof Blob < "u" && (t instanceof Blob || n instanceof Blob)) return !1;
|
|
54
|
+
const a = (i) => Object.keys(i).filter((d) => i[d] !== void 0), c = a(t);
|
|
55
|
+
return c.length === a(n).length && c.every((i) => S(t[i], n[i]));
|
|
56
|
+
}
|
|
57
|
+
function H(s) {
|
|
58
|
+
const e = {};
|
|
59
|
+
for (const t of s) {
|
|
60
|
+
const n = t.path.map(String).join(".");
|
|
61
|
+
(e[n] ?? (e[n] = [])).push(t.message);
|
|
62
|
+
}
|
|
63
|
+
return e;
|
|
64
|
+
}
|
|
65
|
+
const de = (s) => s.split(".")[0] ?? s, L = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
66
|
+
function _e(s) {
|
|
67
|
+
const { t: e } = G(), t = s.describeFieldError ?? ue(), a = K(f(typeof s.defaults == "function" ? s.defaults() : s.defaults)), c = M(f(a)), i = new fe(), d = Y(!1), m = M(null), A = w(() => !S(a, c.value));
|
|
68
|
+
let E = null, T = L();
|
|
69
|
+
function F(r) {
|
|
70
|
+
const l = a;
|
|
71
|
+
for (const o of Object.keys(l)) o in r || delete l[o];
|
|
72
|
+
Object.assign(l, f(r));
|
|
73
|
+
}
|
|
74
|
+
function C() {
|
|
75
|
+
i.clear(), m.value = null;
|
|
76
|
+
}
|
|
77
|
+
function D(r, l) {
|
|
78
|
+
const o = q(l) ? l.requestId : null, u = s.failureMessage?.(r, l) ?? e(`core.form.failure.${r}`);
|
|
79
|
+
return m.value = { kind: r, message: u, requestId: o, error: l };
|
|
80
|
+
}
|
|
81
|
+
function x(r, l = !1) {
|
|
82
|
+
const { serverField: o } = s, u = t, j = l && o ? Object.entries(r).map(([v, h]) => [o(v), h]) : Object.entries(r);
|
|
83
|
+
i.set(Object.fromEntries(u ? j.map(([v, h]) => [v, h.map((B) => u(B, v))]) : j));
|
|
84
|
+
}
|
|
85
|
+
function z() {
|
|
86
|
+
if (i.clear(), !s.validator) return f(a);
|
|
87
|
+
const r = s.validator.safeParse(f(a));
|
|
88
|
+
return r.success ? r.data : (x(H(r.error.issues)), null);
|
|
89
|
+
}
|
|
90
|
+
function N(r) {
|
|
91
|
+
if (i.clear(), !s.validator) return !0;
|
|
92
|
+
const l = s.validator.safeParse(f(a));
|
|
93
|
+
if (l.success) return !0;
|
|
94
|
+
const o = Object.fromEntries(Object.entries(H(l.error.issues)).filter(([u]) => r.includes(de(u))));
|
|
95
|
+
return x(o), Object.keys(o).length === 0;
|
|
96
|
+
}
|
|
97
|
+
function J(r) {
|
|
98
|
+
if (!q(r)) return "failed";
|
|
99
|
+
switch (r.kind) {
|
|
100
|
+
case "validation":
|
|
101
|
+
return "invalid";
|
|
102
|
+
case "conflict":
|
|
103
|
+
return "conflict";
|
|
104
|
+
case "forbidden":
|
|
105
|
+
return "forbidden";
|
|
106
|
+
case "unauthorized":
|
|
107
|
+
return "unauthorized";
|
|
108
|
+
case "network":
|
|
109
|
+
return "offline";
|
|
110
|
+
default:
|
|
111
|
+
return "failed";
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function P(r, l, o, u) {
|
|
115
|
+
if (E) return E;
|
|
116
|
+
const v = (async () => {
|
|
117
|
+
m.value = null;
|
|
118
|
+
const h = r();
|
|
119
|
+
if (h === null) return { status: "failed", failure: D("invalid", null) };
|
|
120
|
+
const B = f(a);
|
|
121
|
+
let p;
|
|
122
|
+
d.value = !0;
|
|
123
|
+
try {
|
|
124
|
+
p = await l(h, { idempotencyKey: T });
|
|
125
|
+
} catch (g) {
|
|
126
|
+
if (d.value = !1, oe(g)) return { status: "aborted" };
|
|
127
|
+
const R = J(g);
|
|
128
|
+
return R === "invalid" && q(g) && x(g.fields, !0), { status: "failed", failure: D(R, g) };
|
|
129
|
+
}
|
|
130
|
+
const V = u?.hydrateFrom?.(p) ?? null;
|
|
131
|
+
V ? (F(V), c.value = f(V), i.clear()) : o(p, B);
|
|
132
|
+
try {
|
|
133
|
+
await u?.refresh?.(p);
|
|
134
|
+
} catch (g) {
|
|
135
|
+
return D("refresh", g), { status: "saved-refresh-failed", value: p, error: g };
|
|
136
|
+
} finally {
|
|
137
|
+
d.value = !1;
|
|
138
|
+
}
|
|
139
|
+
return { status: "saved", value: p };
|
|
140
|
+
})().finally(() => {
|
|
141
|
+
E = null, T = L();
|
|
142
|
+
});
|
|
143
|
+
return E = v, v;
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
values: a,
|
|
147
|
+
errors: i,
|
|
148
|
+
dirty: A,
|
|
149
|
+
submitting: d,
|
|
150
|
+
failure: m,
|
|
151
|
+
bind(r) {
|
|
152
|
+
return {
|
|
153
|
+
get modelValue() {
|
|
154
|
+
return a[r];
|
|
155
|
+
},
|
|
156
|
+
"onUpdate:modelValue"(l) {
|
|
157
|
+
a[r] = l, i.clear(r);
|
|
158
|
+
},
|
|
159
|
+
get error() {
|
|
160
|
+
return i.first(r);
|
|
161
|
+
},
|
|
162
|
+
"data-field-key": r
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
bindMonthYear(r, l) {
|
|
166
|
+
const o = a;
|
|
167
|
+
return {
|
|
168
|
+
get month() {
|
|
169
|
+
return o[r] ?? null;
|
|
170
|
+
},
|
|
171
|
+
get year() {
|
|
172
|
+
return o[l] ?? null;
|
|
173
|
+
},
|
|
174
|
+
"onUpdate:month"(u) {
|
|
175
|
+
o[r] = u, i.clear(r);
|
|
176
|
+
},
|
|
177
|
+
"onUpdate:year"(u) {
|
|
178
|
+
o[l] = u, i.clear(l);
|
|
179
|
+
},
|
|
180
|
+
get error() {
|
|
181
|
+
return i.first(r) ?? i.first(l);
|
|
182
|
+
},
|
|
183
|
+
"data-field-key": `${r} ${l}`
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
hydrate(r) {
|
|
187
|
+
F(r), c.value = f(r), C();
|
|
188
|
+
},
|
|
189
|
+
reset() {
|
|
190
|
+
F(c.value), C();
|
|
191
|
+
},
|
|
192
|
+
markClean() {
|
|
193
|
+
c.value = f(a);
|
|
194
|
+
},
|
|
195
|
+
validate: z,
|
|
196
|
+
check: N,
|
|
197
|
+
submit: (r, l) => P(z, r, (o, u) => c.value = u, l),
|
|
198
|
+
submitFields: (r, l, o) => P(
|
|
199
|
+
() => N(r) ? Object.fromEntries(r.map((u) => [u, f(a[u])])) : null,
|
|
200
|
+
l,
|
|
201
|
+
(u, j) => {
|
|
202
|
+
const v = f(c.value);
|
|
203
|
+
for (const h of r) v[h] = f(j[h]);
|
|
204
|
+
c.value = v;
|
|
205
|
+
},
|
|
206
|
+
o
|
|
207
|
+
),
|
|
208
|
+
dismissFailure() {
|
|
209
|
+
m.value = null;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function me(s) {
|
|
214
|
+
const e = Y([]);
|
|
215
|
+
return ee(
|
|
216
|
+
() => s.form.errors.all(),
|
|
217
|
+
async (t) => {
|
|
218
|
+
await te();
|
|
219
|
+
const n = re(s.root) ?? document, a = new Set([...n.querySelectorAll("[data-field-key]")].flatMap((i) => (i.getAttribute("data-field-key") ?? "").split(/\s+/))), c = (i) => i.split(".").some((d, m, A) => a.has(A.slice(0, m + 1).join(".")));
|
|
220
|
+
e.value = Object.entries(t).flatMap(([i, d]) => d[0] && !c(i) ? [{ field: i, message: d[0] }] : []);
|
|
221
|
+
},
|
|
222
|
+
{ immediate: !0 }
|
|
223
|
+
), w(() => e.value);
|
|
224
|
+
}
|
|
225
|
+
const ve = {
|
|
226
|
+
key: 0,
|
|
227
|
+
class: "text-footnote font-medium"
|
|
228
|
+
}, he = {
|
|
229
|
+
class: "mt-1 list-inside list-disc text-footnote",
|
|
230
|
+
"data-test": "form-errors-hidden"
|
|
231
|
+
}, ge = {
|
|
232
|
+
key: 2,
|
|
233
|
+
class: "mt-1 text-caption text-content-muted"
|
|
234
|
+
}, we = /* @__PURE__ */ se({
|
|
235
|
+
__name: "FormErrors",
|
|
236
|
+
props: {
|
|
237
|
+
form: {},
|
|
238
|
+
label: { type: Function, default: (s) => s },
|
|
239
|
+
scope: { default: null }
|
|
240
|
+
},
|
|
241
|
+
setup(s) {
|
|
242
|
+
const e = s, { t } = G(), n = me({
|
|
243
|
+
get form() {
|
|
244
|
+
return e.form;
|
|
245
|
+
},
|
|
246
|
+
root: () => e.scope
|
|
247
|
+
}), a = w(() => e.form.failure.value), c = w(() => a.value?.kind === "conflict" || a.value?.kind === "refresh" ? "warning" : "critical");
|
|
248
|
+
return (i, d) => a.value || k(n).length ? (b(), ne(ce, {
|
|
249
|
+
key: 0,
|
|
250
|
+
tone: a.value ? c.value : "warning",
|
|
251
|
+
"data-test": "form-errors"
|
|
252
|
+
}, {
|
|
253
|
+
default: ae(() => [
|
|
254
|
+
a.value ? (b(), y("p", ve, O(a.value.message), 1)) : _("", !0),
|
|
255
|
+
k(n).length ? (b(), y(I, { key: 1 }, [
|
|
256
|
+
W("p", {
|
|
257
|
+
class: ie(["text-footnote", a.value ? "mt-1" : "font-medium"])
|
|
258
|
+
}, O(k(t)("core.form.errors.hidden_title")), 3),
|
|
259
|
+
W("ul", he, [
|
|
260
|
+
(b(!0), y(I, null, le(k(n), (m) => (b(), y("li", {
|
|
261
|
+
key: m.field
|
|
262
|
+
}, [
|
|
263
|
+
U(O(m.field ? e.label(m.field) : ""), 1),
|
|
264
|
+
m.field ? (b(), y(I, { key: 0 }, [
|
|
265
|
+
U(": ")
|
|
266
|
+
], 64)) : _("", !0),
|
|
267
|
+
U(O(m.message), 1)
|
|
268
|
+
]))), 128))
|
|
269
|
+
])
|
|
270
|
+
], 64)) : _("", !0),
|
|
271
|
+
a.value?.requestId ? (b(), y("p", ge, O(k(t)("core.form.errors.request", { id: a.value.requestId })), 1)) : _("", !0)
|
|
272
|
+
]),
|
|
273
|
+
_: 1
|
|
274
|
+
}, 8, ["tone"])) : _("", !0);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
export {
|
|
278
|
+
fe as E,
|
|
279
|
+
we as _,
|
|
280
|
+
me as a,
|
|
281
|
+
f as c,
|
|
282
|
+
de as f,
|
|
283
|
+
S as s,
|
|
284
|
+
_e as u
|
|
285
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as B, openBlock as d, createBlock as L, withCtx as N, createTextVNode as v, toDisplayString as m, unref as h, createCommentVNode as i, inject as C, provide as y, ref as R, useSlots as O, computed as n, shallowReactive as E, useTemplateRef as V, useId as A, createElementBlock as p, normalizeStyle as M, normalizeClass as G, createElementVNode as S, renderSlot as f } from "vue";
|
|
2
2
|
import { s as T, u as W } from "./sectionIndex-BS0ic5W7.js";
|
|
3
|
-
import { d as $, g as j } from "./control-
|
|
3
|
+
import { d as $, g as j } from "./control-B_Nwtmag.js";
|
|
4
4
|
import { useI18n as D } from "vue-i18n";
|
|
5
5
|
import { _ as q } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
6
6
|
const H = /* @__PURE__ */ B({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as n, provide as f, computed as s, useTemplateRef as u, openBlock as t, createElementBlock as p, withModifiers as c, createBlock as d, createCommentVNode as b, renderSlot as _ } from "vue";
|
|
2
|
-
import { d as v } from "./control-
|
|
3
|
-
import { _ as k } from "./FormErrors.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { d as v } from "./control-B_Nwtmag.js";
|
|
3
|
+
import { _ as k } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
|
|
4
4
|
const x = /* @__PURE__ */ n({
|
|
5
5
|
__name: "FormView",
|
|
6
6
|
props: {
|