@wssto2/vue-core 0.4.14 → 0.4.15
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-CkvS5W6K.js} +1 -1
- package/dist/{Activity-BdSvn0GP.js → Activity-4q26REYj.js} +6 -6
- package/dist/{Changes-BQO--N9F.js → Changes-CKIuGF8O.js} +5 -5
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DkpFEHUw.js → CollectionPage.vue_vue_type_script_setup_true_lang-B17cUOzj.js} +2 -2
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js → DateField.vue_vue_type_script_setup_true_lang-DehwWm78.js} +17 -16
- package/dist/{DeadLetters-OmeiADEi.js → DeadLetters-DPGcQOz1.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-noYI9QMk.js} +1 -1
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js → FormView.vue_vue_type_script_setup_true_lang-BcIbTMHN.js} +2 -2
- package/dist/{General-CBwFLiKQ.js → General-CUA9b3ML.js} +10 -10
- package/dist/{NewRolePage-CblUW2gA.js → NewRolePage-DBfCvDWA.js} +3 -3
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-Dm6FfJ2T.js +126 -0
- package/dist/{ProfilePage-BOoDDbmB.js → ProfilePage-On-eAiJ-.js} +41 -41
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BCE5yrwy.js → RoleEditor.vue_vue_type_script_setup_true_lang-fvAf3rQm.js} +44 -44
- package/dist/{RolePage-xDsFL_eC.js → RolePage-B8oul55j.js} +8 -8
- package/dist/{RolesPage-C39wsF6X.js → RolesPage-DsXVivdj.js} +5 -5
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js → SegmentedField.vue_vue_type_script_setup_true_lang-B2d55hrh.js} +7 -6
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.js +443 -0
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js → SessionList.vue_vue_type_script_setup_true_lang-CirlMdHb.js} +2 -2
- package/dist/{Sessions-m_i4aTfw.js → Sessions-BTyXDEuY.js} +4 -4
- package/dist/{SettingsPage-ktKvQQnE.js → SettingsPage-DHTmMgif.js} +9 -9
- package/dist/{SignIn-CkoEixY4.js → SignIn-DU4DE2wj.js} +6 -6
- package/dist/{SignInPage-DVcpFz3G.js → SignInPage-BA22kyOp.js} +3 -3
- package/dist/{SignIns-BnVAtncZ.js → SignIns-C8QAZBaL.js} +3 -3
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js → SwitchField.vue_vue_type_script_setup_true_lang-B2Z2hy_h.js} +11 -10
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js → TextField.vue_vue_type_script_setup_true_lang-nqnGG7Zc.js} +27 -26
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js → TextareaField.vue_vue_type_script_setup_true_lang-BgIQyYtf.js} +9 -8
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js → TimeField.vue_vue_type_script_setup_true_lang-Dr0h-V_8.js} +25 -24
- package/dist/{UserRecord-Cg69_mbU.js → UserRecord-D1BNmYp9.js} +10 -10
- package/dist/{UsersList-BFmBDGs7.js → UsersList-ltx3G23-.js} +8 -8
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +7 -1
- package/dist/app/index.js +93 -93
- package/dist/collection/index.js +1 -1
- package/dist/control-CX9BG2UB.js +320 -0
- package/dist/{describeError-CvGmajU0.js → describeError-B-NMa--w.js} +12 -7
- package/dist/fieldMessages-DV6sESpn.js +25 -0
- package/dist/form/DateField.vue.d.ts +1 -0
- package/dist/form/DateTimeField.vue.d.ts +1 -0
- package/dist/form/Field.vue.d.ts +1 -0
- package/dist/form/FileField.vue.d.ts +1 -0
- 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 +1 -0
- package/dist/form/MoneyField.vue.d.ts +1 -0
- package/dist/form/MonthYearField.vue.d.ts +1 -0
- package/dist/form/NumberField.vue.d.ts +5 -0
- package/dist/form/PhotoField.vue.d.ts +1 -0
- package/dist/form/SelectField.vue.d.ts +5 -6
- package/dist/form/SwitchField.vue.d.ts +1 -0
- package/dist/form/TextField.vue.d.ts +1 -0
- package/dist/form/TextareaField.vue.d.ts +1 -0
- package/dist/form/TimeField.vue.d.ts +1 -0
- package/dist/form/field.d.ts +3 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +469 -456
- 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 +2 -2
- package/dist/i18n/index.js +3 -2
- package/dist/identity/fieldMessages.d.ts +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/{index-B416VXmR.js → index-BCw_Ki6z.js} +2 -2
- package/dist/{index-KcCoCfr-.js → index-Chh4z9xW.js} +10 -10
- package/dist/{index-RNF5-9uf.js → index-DwdVrW6q.js} +15 -15
- 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-cWCAMAmW.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/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/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +0 -437
- 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-CX9BG2UB.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-DehwWm78.js";
|
|
7
|
+
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-noYI9QMk.js";
|
|
8
|
+
import { e as z } from "./control-CX9BG2UB.js";
|
|
9
|
+
import { P as G, c as H, i as J } from "./index-DwdVrW6q.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-DwdVrW6q.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-noYI9QMk.js";
|
|
12
|
+
import { e as U } from "./control-CX9BG2UB.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-Dm6FfJ2T.js";
|
|
18
|
+
import { _ as yt } from "./SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.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";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { computed as f, defineComponent as X, useModel as Z, useTemplateRef as $, openBlock as y, createBlock as A, mergeProps as V, unref as l, withCtx as N, createElementBlock as C, Fragment as I, createVNode as w, createTextVNode as ee, toDisplayString as Q, createCommentVNode as
|
|
1
|
+
import { computed as f, defineComponent as X, useModel as Z, useTemplateRef as $, openBlock as y, createBlock as A, mergeProps as V, unref as l, withCtx as N, createElementBlock as C, Fragment as I, createVNode as w, createTextVNode as ee, toDisplayString as Q, createCommentVNode as B, createElementVNode as O, normalizeClass as te, mergeModels as re, mergeDefaults as oe, nextTick as Y } from "vue";
|
|
2
2
|
import { useI18n as j } from "vue-i18n";
|
|
3
3
|
import { _ as ae } from "./DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js";
|
|
4
|
-
import { u as
|
|
4
|
+
import { u as H } from "./format-B8mJm946.js";
|
|
5
5
|
import { _ as ne } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
6
6
|
import { u as le } from "./mediaQuery-CygcXmFW.js";
|
|
7
7
|
import { _ as se } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
|
|
8
|
-
import { c as ie, _ as de, f as ue, b as ce } from "./control-
|
|
9
|
-
import { e as T, f as
|
|
8
|
+
import { c as ie, _ as de, f as ue, b as ce } from "./control-CX9BG2UB.js";
|
|
9
|
+
import { e as T, f as E, m as K, g as G, h as me, j as fe, u as pe, k as be, _ as ve, l as ye, c as xe } from "./useTypedEntry-aTfPBAhw.js";
|
|
10
10
|
const ke = ["d", "m", "y"];
|
|
11
11
|
function he(o) {
|
|
12
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") };
|
|
@@ -21,19 +21,19 @@ function _e(o, r) {
|
|
|
21
21
|
}
|
|
22
22
|
function x(o, r) {
|
|
23
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 :
|
|
24
|
+
return e === null || o.d === void 0 ? null : K(e, t, Number(o.d));
|
|
25
25
|
}
|
|
26
26
|
function we(o, r) {
|
|
27
27
|
const e = r.today ?? T(), t = ge(o);
|
|
28
28
|
if (t === "") return null;
|
|
29
29
|
const { words: a } = r;
|
|
30
30
|
if (a.today.includes(t)) return e;
|
|
31
|
-
if (a.tomorrow.includes(t)) return
|
|
32
|
-
if (a.yesterday.includes(t)) return
|
|
31
|
+
if (a.tomorrow.includes(t)) return E(e, 1);
|
|
32
|
+
if (a.yesterday.includes(t)) return E(e, -1);
|
|
33
33
|
const d = /^([+-])\s*(\d{1,4})$/.exec(t);
|
|
34
|
-
if (d) return
|
|
34
|
+
if (d) return E(e, Number(d[2]) * (d[1] === "-" ? -1 : 1));
|
|
35
35
|
const i = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(t);
|
|
36
|
-
if (i) return
|
|
36
|
+
if (i) return K(Number(i[1]), Number(i[2]), Number(i[3]));
|
|
37
37
|
if (!/^[\d\s./-]+$/.test(t)) return null;
|
|
38
38
|
const n = r.order, p = n.filter((v) => v !== "y");
|
|
39
39
|
if (/^\d+$/.test(t)) {
|
|
@@ -65,7 +65,7 @@ function De(o, r, e) {
|
|
|
65
65
|
return r.filter((n) => n !== "y").map((n) => i[n]).join(a) + d;
|
|
66
66
|
}
|
|
67
67
|
function $e(o) {
|
|
68
|
-
const { t: r } = j(), e =
|
|
68
|
+
const { t: r } = j(), e = H(), t = (n) => e.date(n), a = f(() => he(t)), d = f(() => ({
|
|
69
69
|
today: [r("core.form.date.words.today").toLowerCase(), "today"],
|
|
70
70
|
tomorrow: [r("core.form.date.words.tomorrow").toLowerCase(), "tomorrow"],
|
|
71
71
|
yesterday: [r("core.form.date.words.yesterday").toLowerCase(), "yesterday"]
|
|
@@ -74,7 +74,7 @@ function $e(o) {
|
|
|
74
74
|
placeholder: f(() => r("core.form.date.placeholder", { example: De(t, a.value, T()) })),
|
|
75
75
|
/** The day a text means, or null. */
|
|
76
76
|
parse: (n) => we(n, { order: a.value, words: d.value }),
|
|
77
|
-
available: (n) => !
|
|
77
|
+
available: (n) => !G(n, o()),
|
|
78
78
|
invalidMessage: () => r("core.form.date.invalid", { example: t(T()) }),
|
|
79
79
|
unavailableMessage: () => r("core.form.date.unavailable")
|
|
80
80
|
};
|
|
@@ -85,7 +85,7 @@ function Ne(o, r, e) {
|
|
|
85
85
|
const a = T();
|
|
86
86
|
return (o() ?? me(r())).map((d) => {
|
|
87
87
|
const i = fe(d, (n) => t(`core.form.date.${n.replace(/-/g, "_")}`), a);
|
|
88
|
-
return { ...i, disabled:
|
|
88
|
+
return { ...i, disabled: G(i.value, e()) };
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
91
|
}
|
|
@@ -96,6 +96,7 @@ const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-
|
|
|
96
96
|
__name: "DateField",
|
|
97
97
|
props: /* @__PURE__ */ re(/* @__PURE__ */ oe({
|
|
98
98
|
label: {},
|
|
99
|
+
labelHidden: { type: Boolean },
|
|
99
100
|
hint: {},
|
|
100
101
|
error: {},
|
|
101
102
|
required: { type: Boolean },
|
|
@@ -115,7 +116,7 @@ const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-
|
|
|
115
116
|
}),
|
|
116
117
|
emits: ["update:modelValue"],
|
|
117
118
|
setup(o, { expose: r }) {
|
|
118
|
-
const e = o, t = Z(o, "modelValue"), { t: a } = j(), d =
|
|
119
|
+
const e = o, t = Z(o, "modelValue"), { t: a } = j(), d = H(), i = le(), n = $("input"), p = $("popover"), m = $("calendar"), v = $("sheet"), k = f(() => ({ min: e.min, max: e.max, disabled: e.disabledDates })), b = $e(() => k.value), u = pe({
|
|
119
120
|
model: t,
|
|
120
121
|
display: (c) => d.date(c),
|
|
121
122
|
parse: (c) => {
|
|
@@ -147,7 +148,7 @@ const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-
|
|
|
147
148
|
default: N(() => [
|
|
148
149
|
q.value ? (y(), C(I, { key: 0 }, [
|
|
149
150
|
ee(Q(q.value), 1)
|
|
150
|
-
], 64)) :
|
|
151
|
+
], 64)) : B("", !0)
|
|
151
152
|
]),
|
|
152
153
|
_: 1
|
|
153
154
|
}, 16, ["disabled", "invalid", "placeholder"]),
|
|
@@ -202,7 +203,7 @@ const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-
|
|
|
202
203
|
onKeydown: W,
|
|
203
204
|
onClick: s[3] || (s[3] = (D) => P(!1))
|
|
204
205
|
}), null, 16, Ce),
|
|
205
|
-
e.disabled ?
|
|
206
|
+
e.disabled ? B("", !0) : (y(), C("button", {
|
|
206
207
|
key: 0,
|
|
207
208
|
type: "button",
|
|
208
209
|
tabindex: "-1",
|
|
@@ -236,7 +237,7 @@ const Ce = ["id", "name", "value", "placeholder", "disabled", "required", "aria-
|
|
|
236
237
|
selected: z.value,
|
|
237
238
|
onPick: (_) => F(_, g)
|
|
238
239
|
}, null, 8, ["items", "selected", "onPick"])
|
|
239
|
-
])) :
|
|
240
|
+
])) : B("", !0),
|
|
240
241
|
O("p", Pe, Q(l(a)("core.form.date.keys")), 1)
|
|
241
242
|
])
|
|
242
243
|
]),
|
|
@@ -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-B17cUOzj.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-BCw_Ki6z.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-CX9BG2UB.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-CX9BG2UB.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: {
|
|
@@ -2,18 +2,18 @@ import { defineComponent as R, computed as N, openBlock as i, createElementBlock
|
|
|
2
2
|
import { useI18n as V } from "vue-i18n";
|
|
3
3
|
import { RouterLink as B } from "vue-router";
|
|
4
4
|
import { u as E } from "./format-B8mJm946.js";
|
|
5
|
-
import { u as T } from "./useResourceForm-
|
|
6
|
-
import { _ as h } from "./FormGroup.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as F } from "./FormView.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { _ as L } from "./SelectField.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { _ as f } from "./TextField.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as A } from "./useSaveChrome-
|
|
11
|
-
import { P as D, b as G, i as I } from "./index-
|
|
5
|
+
import { u as T } from "./useResourceForm-CP2lCwmD.js";
|
|
6
|
+
import { _ as h } from "./FormGroup.vue_vue_type_script_setup_true_lang-noYI9QMk.js";
|
|
7
|
+
import { _ as F } from "./FormView.vue_vue_type_script_setup_true_lang-BcIbTMHN.js";
|
|
8
|
+
import { _ as L } from "./SelectField.vue_vue_type_script_setup_true_lang-DedKLLQK.js";
|
|
9
|
+
import { _ as f } from "./TextField.vue_vue_type_script_setup_true_lang-nqnGG7Zc.js";
|
|
10
|
+
import { u as A } from "./useSaveChrome-7huA3FzR.js";
|
|
11
|
+
import { P as D, b as G, i as I } from "./index-DwdVrW6q.js";
|
|
12
12
|
import { t as M } from "./toast-CqSDTWRX.js";
|
|
13
13
|
import { u as O } from "./platform-q3cjODLx.js";
|
|
14
|
-
import { b as U } from "./routeResource-
|
|
15
|
-
import { u as j } from "./fieldMessages-
|
|
16
|
-
import { _ as $ } from "./ActionRow.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { b as U } from "./routeResource-DlTsGTg_.js";
|
|
15
|
+
import { u as j } from "./fieldMessages-DV6sESpn.js";
|
|
16
|
+
import { _ as $ } from "./ActionRow.vue_vue_type_script_setup_true_lang-CkvS5W6K.js";
|
|
17
17
|
import { _ as z } from "./SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js";
|
|
18
18
|
import { u as H } from "./languages-BShG9LpE.js";
|
|
19
19
|
const J = {
|
|
@@ -3,9 +3,9 @@ import { useI18n as v } from "vue-i18n";
|
|
|
3
3
|
import { useRoute as k, useRouter as R } from "vue-router";
|
|
4
4
|
import { a as $ } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-B7qSUiee.js";
|
|
5
5
|
import { _ as b } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
6
|
-
import { u as g } from "./useLoad-
|
|
7
|
-
import { a as x, c as u } from "./index-
|
|
8
|
-
import { _ as P } from "./RoleEditor.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { u as g } from "./useLoad-M7V-AVwR.js";
|
|
7
|
+
import { a as x, c as u } from "./index-Chh4z9xW.js";
|
|
8
|
+
import { _ as P } from "./RoleEditor.vue_vue_type_script_setup_true_lang-fvAf3rQm.js";
|
|
9
9
|
const V = /* @__PURE__ */ _({
|
|
10
10
|
__name: "NewRolePage",
|
|
11
11
|
setup(h) {
|