@wssto2/vue-core 0.4.21 → 0.4.24

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/dist/{Activity-DX-RK9xj.js → Activity-CI-l_OFl.js} +1 -1
  3. package/dist/{Changes-_nARQ9IC.js → Changes-BdR0R20V.js} +1 -1
  4. package/dist/{DeadLetters-O6QReswO.js → DeadLetters-CRTeoZS1.js} +1 -1
  5. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js +295 -0
  6. package/dist/{FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js → FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js} +1 -1
  7. package/dist/{General-CkZoXu29.js → General-hdmVP72B.js} +3 -3
  8. package/dist/{NewRolePage-OosTaMfZ.js → NewRolePage-BPeKasOp.js} +2 -2
  9. package/dist/{ProfilePage-Dn8fQ3ff.js → ProfilePage-Dq9lcO5O.js} +3 -3
  10. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-2IOio1Sa.js → RoleEditor.vue_vue_type_script_setup_true_lang-B6g2760V.js} +3 -3
  11. package/dist/{RolePage-33RUvHYD.js → RolePage-BYH-0fVI.js} +3 -3
  12. package/dist/{RolesPage-BGPoUCMP.js → RolesPage-BRm5xDw7.js} +1 -1
  13. package/dist/{Sessions-BbAdbjmG.js → Sessions-B1eKG_I2.js} +1 -1
  14. package/dist/{SettingsPage-D47NSOYW.js → SettingsPage-0P38Ty4w.js} +3 -3
  15. package/dist/{SignIn-DDCRzlUq.js → SignIn-Dp8Ji0_r.js} +1 -1
  16. package/dist/{SignInPage-D9jryXA7.js → SignInPage-CiStJboK.js} +2 -2
  17. package/dist/{SignIns-C_5sRrB4.js → SignIns-Bo7R2Coi.js} +1 -1
  18. package/dist/{UserRecord-CUhbz62x.js → UserRecord-DGq_PPy1.js} +3 -3
  19. package/dist/{UsersList-BE8fnICz.js → UsersList-BulNu4aE.js} +3 -3
  20. package/dist/access/index.js +1 -1
  21. package/dist/form/CommandDialog.vue.d.ts +6 -0
  22. package/dist/form/MonthYearField.vue.d.ts +3 -1
  23. package/dist/form/index.js +13 -11
  24. package/dist/form/useCommand.d.ts +4 -1
  25. package/dist/form/useForm.d.ts +6 -2
  26. package/dist/form/useRecordDialog.d.ts +2 -2
  27. package/dist/identity/index.js +1 -1
  28. package/dist/{index-DiEoRV9D.js → index-BmowiT1y.js} +12 -12
  29. package/dist/{index-C3HWRCEe.js → index-Yy28omu6.js} +4 -4
  30. package/dist/{index-D-0JNiFF.js → index-tnSTp0cM.js} +2 -2
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/notifications/index.js +1 -1
  34. package/dist/{status-UWWFHi9t.js → status-Bh3-Cg7o.js} +1 -1
  35. package/dist/{useCommand-VIZE7xG-.js → useCommand-Cj-APj-P.js} +54 -50
  36. package/dist/{useResourceForm-CP2lCwmD.js → useResourceForm-tGYTfKhH.js} +1 -1
  37. package/package.json +3 -2
  38. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js +0 -285
@@ -0,0 +1,295 @@
1
+ var K = Object.defineProperty;
2
+ var ee = (n, e, r) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
3
+ var M = (n, e, r) => ee(n, typeof e != "symbol" ? e + "" : e, r);
4
+ import { shallowRef as S, computed as A, toRaw as te, reactive as re, ref as G, watch as se, nextTick as ne, toValue as ae, defineComponent as le, unref as w, openBlock as y, createBlock as ie, withCtx as ue, createElementBlock as k, toDisplayString as _, createCommentVNode as E, Fragment as U, createElementVNode as H, normalizeClass as oe, renderList as ce, createTextVNode as q } from "vue";
5
+ import { useI18n as J } from "vue-i18n";
6
+ import { i as fe, a as F } from "./error-CD7x0Jrz.js";
7
+ import { d as de, u as me, a as ve } from "./describeError-B-NMa--w.js";
8
+ import { _ as he } from "./Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js";
9
+ class ge {
10
+ constructor() {
11
+ M(this, "messages", S({}));
12
+ /** How many fields have a message. */
13
+ M(this, "count", A(() => 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(([, r]) => r.length > 0).map(([r, a]) => [r, [...a]]));
18
+ }
19
+ add(e, r) {
20
+ this.messages.value = { ...this.messages.value, [e]: [...this.messages.value[e] ?? [], r] };
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 r = Object.fromEntries(Object.entries(this.messages.value).filter(([a]) => a !== e && !a.startsWith(`${e}.`)));
29
+ Object.keys(r).length !== this.count.value && (this.messages.value = r);
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((r) => r.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 d(n) {
43
+ const e = te(n);
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(d) : Object.fromEntries(Object.entries(e).map(([r, a]) => [r, d(a)]));
45
+ }
46
+ function T(n, e) {
47
+ const r = n, a = e;
48
+ if (Object.is(r, a)) return !0;
49
+ if (r === null || a === null || typeof r != "object" || typeof a != "object") return !1;
50
+ if (r instanceof Date || a instanceof Date) return r instanceof Date && a instanceof Date && r.getTime() === a.getTime();
51
+ if (Array.isArray(r) || Array.isArray(a))
52
+ return Array.isArray(r) && Array.isArray(a) && r.length === a.length && r.every((l, c) => T(l, a[c]));
53
+ if (typeof Blob < "u" && (r instanceof Blob || a instanceof Blob)) return !1;
54
+ const f = (l) => Object.keys(l).filter((c) => l[c] !== void 0), g = f(r);
55
+ return g.length === f(a).length && g.every((l) => T(r[l], a[l]));
56
+ }
57
+ function L(n) {
58
+ const e = {};
59
+ for (const r of n) {
60
+ const a = r.path.map(String).join(".");
61
+ (e[a] ?? (e[a] = [])).push(r.message);
62
+ }
63
+ return e;
64
+ }
65
+ const be = (n) => n.split(".")[0] ?? n, Y = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
66
+ function Fe(n) {
67
+ const { t: e } = J(), r = n.describeFieldError ?? de(), a = me(), f = ve(), l = re(d(typeof n.defaults == "function" ? n.defaults() : n.defaults)), c = S(d(l)), o = new ge(), j = G(!1), b = S(null), Q = A(() => !T(l, c.value));
68
+ let D = null, C = Y();
69
+ function x(t) {
70
+ const s = l;
71
+ for (const i of Object.keys(s)) i in t || delete s[i];
72
+ Object.assign(s, d(t));
73
+ }
74
+ function z() {
75
+ o.clear(), b.value = null;
76
+ }
77
+ function X(t, s) {
78
+ const i = e(`core.form.failure.${t}`);
79
+ if (t === "refresh") return i;
80
+ const u = f?.(s);
81
+ if (u !== void 0) return u;
82
+ if (!F(s) || t === "invalid" && Object.keys(s.fields).length > 0) return i;
83
+ const p = t === "invalid" || t === "failed" && s.status !== null && s.status < 500;
84
+ return s.code ? a(s, { fallback: i }) : p && s.message ? a(s) : i;
85
+ }
86
+ function B(t, s) {
87
+ const i = F(s) ? s.requestId : null, u = n.failureMessage?.(t, s) ?? X(t, s);
88
+ return b.value = { kind: t, message: u, requestId: i, error: s };
89
+ }
90
+ function V(t, s = !1) {
91
+ const { serverField: i } = n, u = r, p = s && i ? Object.entries(t).map(([m, v]) => [i(m), v]) : Object.entries(t);
92
+ o.set(Object.fromEntries(u ? p.map(([m, v]) => [m, v.map(($) => u($, m))]) : p));
93
+ }
94
+ function N() {
95
+ if (o.clear(), !n.validator)
96
+ return b.value = null, d(l);
97
+ const t = n.validator.safeParse(d(l));
98
+ return t.success ? (b.value = null, t.data) : (V(L(t.error.issues)), null);
99
+ }
100
+ function P(t) {
101
+ if (o.clear(), !n.validator) return !0;
102
+ const s = n.validator.safeParse(d(l));
103
+ if (s.success) return !0;
104
+ const i = Object.fromEntries(Object.entries(L(s.error.issues)).filter(([u]) => t.includes(be(u))));
105
+ return V(i), Object.keys(i).length === 0;
106
+ }
107
+ function Z(t) {
108
+ if (!F(t)) return "failed";
109
+ switch (t.kind) {
110
+ case "validation":
111
+ return "invalid";
112
+ case "conflict":
113
+ return "conflict";
114
+ case "forbidden":
115
+ return "forbidden";
116
+ case "unauthorized":
117
+ return "unauthorized";
118
+ case "network":
119
+ return "offline";
120
+ default:
121
+ return "failed";
122
+ }
123
+ }
124
+ async function R(t, s, i, u) {
125
+ if (D) return D;
126
+ const m = (async () => {
127
+ b.value = null;
128
+ const v = t();
129
+ if (v === null) return { status: "failed", failure: B("invalid", null) };
130
+ const $ = d(l);
131
+ let O;
132
+ j.value = !0;
133
+ try {
134
+ O = await s(v, { idempotencyKey: C });
135
+ } catch (h) {
136
+ if (j.value = !1, fe(h)) return { status: "aborted" };
137
+ const W = Z(h);
138
+ return W === "invalid" && F(h) && V(h.fields, !0), { status: "failed", failure: B(W, h) };
139
+ }
140
+ const I = u?.hydrateFrom?.(O) ?? null;
141
+ I ? (x(I), c.value = d(I), o.clear()) : i(O, $);
142
+ try {
143
+ await u?.refresh?.(O);
144
+ } catch (h) {
145
+ return B("refresh", h), { status: "saved-refresh-failed", value: O, error: h };
146
+ } finally {
147
+ j.value = !1;
148
+ }
149
+ return { status: "saved", value: O };
150
+ })().finally(() => {
151
+ D = null, C = Y();
152
+ });
153
+ return D = m, m;
154
+ }
155
+ return {
156
+ values: l,
157
+ errors: o,
158
+ dirty: Q,
159
+ submitting: j,
160
+ failure: b,
161
+ bind(t) {
162
+ return {
163
+ get modelValue() {
164
+ return l[t];
165
+ },
166
+ "onUpdate:modelValue"(s) {
167
+ l[t] = s, o.clear(t);
168
+ },
169
+ get error() {
170
+ return o.first(t);
171
+ },
172
+ "data-field-key": t
173
+ };
174
+ },
175
+ bindMonthYear(t, s) {
176
+ const i = l;
177
+ return {
178
+ get month() {
179
+ return i[t] ?? null;
180
+ },
181
+ get year() {
182
+ return i[s] ?? null;
183
+ },
184
+ "onUpdate:month"(u) {
185
+ i[t] = u, o.clear(t);
186
+ },
187
+ "onUpdate:year"(u) {
188
+ i[s] = u, o.clear(s);
189
+ },
190
+ get error() {
191
+ return o.first(t) ?? o.first(s);
192
+ },
193
+ "data-field-key": `${t} ${s}`
194
+ };
195
+ },
196
+ hydrate(t) {
197
+ x(t), c.value = d(t), z();
198
+ },
199
+ reset() {
200
+ x(c.value), z();
201
+ },
202
+ markClean() {
203
+ c.value = d(l);
204
+ },
205
+ validate: N,
206
+ check: P,
207
+ submit: (t, s) => R(N, t, (i, u) => c.value = u, s),
208
+ submitFields: (t, s, i) => R(
209
+ () => P(t) ? Object.fromEntries(t.map((u) => [u, d(l[u])])) : null,
210
+ s,
211
+ (u, p) => {
212
+ const m = d(c.value);
213
+ for (const v of t) m[v] = d(p[v]);
214
+ c.value = m;
215
+ },
216
+ i
217
+ ),
218
+ dismissFailure() {
219
+ b.value = null;
220
+ }
221
+ };
222
+ }
223
+ function pe(n) {
224
+ const e = G([]);
225
+ return se(
226
+ () => n.form.errors.all(),
227
+ async (r) => {
228
+ await ne();
229
+ const a = ae(n.root) ?? document, f = new Set([...a.querySelectorAll("[data-field-key]")].flatMap((l) => (l.getAttribute("data-field-key") ?? "").split(/\s+/))), g = (l) => l.split(".").some((c, o, j) => f.has(j.slice(0, o + 1).join(".")));
230
+ e.value = Object.entries(r).flatMap(([l, c]) => c[0] && !g(l) ? [{ field: l, message: c[0] }] : []);
231
+ },
232
+ { immediate: !0 }
233
+ ), A(() => e.value);
234
+ }
235
+ const ye = {
236
+ key: 0,
237
+ class: "text-footnote font-medium"
238
+ }, je = {
239
+ class: "mt-1 list-inside list-disc text-footnote",
240
+ "data-test": "form-errors-hidden"
241
+ }, Oe = {
242
+ key: 2,
243
+ class: "mt-1 text-caption text-content-muted"
244
+ }, xe = /* @__PURE__ */ le({
245
+ __name: "FormErrors",
246
+ props: {
247
+ form: {},
248
+ label: { type: Function, default: (n) => n },
249
+ scope: { default: null }
250
+ },
251
+ setup(n) {
252
+ const e = n, { t: r } = J(), a = pe({
253
+ get form() {
254
+ return e.form;
255
+ },
256
+ root: () => e.scope
257
+ }), f = A(() => e.form.failure.value), g = A(() => f.value?.kind === "conflict" || f.value?.kind === "refresh" ? "warning" : "critical");
258
+ return (l, c) => f.value || w(a).length ? (y(), ie(he, {
259
+ key: 0,
260
+ tone: f.value ? g.value : "warning",
261
+ "data-test": "form-errors"
262
+ }, {
263
+ default: ue(() => [
264
+ f.value ? (y(), k("p", ye, _(f.value.message), 1)) : E("", !0),
265
+ w(a).length ? (y(), k(U, { key: 1 }, [
266
+ H("p", {
267
+ class: oe(["text-footnote", f.value ? "mt-1" : "font-medium"])
268
+ }, _(w(r)("core.form.errors.hidden_title")), 3),
269
+ H("ul", je, [
270
+ (y(!0), k(U, null, ce(w(a), (o) => (y(), k("li", {
271
+ key: o.field
272
+ }, [
273
+ q(_(o.field ? e.label(o.field) : ""), 1),
274
+ o.field ? (y(), k(U, { key: 0 }, [
275
+ q(": ")
276
+ ], 64)) : E("", !0),
277
+ q(_(o.message), 1)
278
+ ]))), 128))
279
+ ])
280
+ ], 64)) : E("", !0),
281
+ f.value?.requestId ? (y(), k("p", Oe, _(w(r)("core.form.errors.request", { id: f.value.requestId })), 1)) : E("", !0)
282
+ ]),
283
+ _: 1
284
+ }, 8, ["tone"])) : E("", !0);
285
+ }
286
+ });
287
+ export {
288
+ ge as E,
289
+ xe as _,
290
+ pe as a,
291
+ d as c,
292
+ be as f,
293
+ T as s,
294
+ Fe as u
295
+ };
@@ -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
2
  import { d as v } from "./control-B4SdblL6.js";
3
- import { _ as k } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
3
+ import { _ as k } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
4
4
  const x = /* @__PURE__ */ n({
5
5
  __name: "FormView",
6
6
  props: {
@@ -2,13 +2,13 @@ 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-D8X4zsx6.js";
5
- import { u as T } from "./useResourceForm-CP2lCwmD.js";
5
+ import { u as T } from "./useResourceForm-tGYTfKhH.js";
6
6
  import { _ as h } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
7
- import { _ as F } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
7
+ import { _ as F } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
8
8
  import { _ as L } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
9
9
  import { _ as f } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
10
10
  import { u as A } from "./useSaveChrome-7huA3FzR.js";
11
- import { P as D, b as G, i as I } from "./index-DiEoRV9D.js";
11
+ import { P as D, b as G, i as I } from "./index-BmowiT1y.js";
12
12
  import { t as M } from "./toast-CqSDTWRX.js";
13
13
  import { u as O } from "./platform-q3cjODLx.js";
14
14
  import { b as U } from "./routeResource-DlTsGTg_.js";
@@ -4,8 +4,8 @@ import { useRoute as k, useRouter as R } from "vue-router";
4
4
  import { a as $ } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-CxU9aNRQ.js";
5
5
  import { _ as b } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
6
6
  import { u as g } from "./useLoad-M7V-AVwR.js";
7
- import { a as x, c as u } from "./index-C3HWRCEe.js";
8
- import { _ as P } from "./RoleEditor.vue_vue_type_script_setup_true_lang-2IOio1Sa.js";
7
+ import { a as x, c as u } from "./index-Yy28omu6.js";
8
+ import { _ as P } from "./RoleEditor.vue_vue_type_script_setup_true_lang-B6g2760V.js";
9
9
  const V = /* @__PURE__ */ _({
10
10
  __name: "NewRolePage",
11
11
  setup(h) {
@@ -4,9 +4,9 @@ import { a as ge } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang
4
4
  import { u as L } from "./platform-q3cjODLx.js";
5
5
  import { _ as Q } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
6
6
  import { u as Y } from "./useLoad-M7V-AVwR.js";
7
- import { i as k, d as G } from "./index-DiEoRV9D.js";
8
- import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
9
- import { _ as ee } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
7
+ import { i as k, d as G } from "./index-BmowiT1y.js";
8
+ import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
9
+ import { _ as ee } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
10
10
  import { _ as U } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
11
11
  import { _ as H } from "./Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js";
12
12
  import { t as C } from "./toast-CqSDTWRX.js";
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as I, computed as h, ref as M, openBlock as l, createElementBlock as v, createElementVNode as w, unref as t, Fragment as B, renderList as N, normalizeClass as K, toDisplayString as d, createVNode as V, withCtx as p, createTextVNode as y, createCommentVNode as $, createBlock as _, createSlots as X, watch as Y, mergeProps as F } from "vue";
2
2
  import { useI18n as Q } from "vue-i18n";
3
- import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
3
+ import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
4
4
  import { _ as W } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
5
- import { _ as ee } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
5
+ import { _ as ee } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
6
6
  import { _ as te } from "./TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js";
7
7
  import { _ as se } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
8
8
  import { u as ae } from "./useSaveChrome-7huA3FzR.js";
9
9
  import { t as oe } from "./toast-CqSDTWRX.js";
10
10
  import { _ as S } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
11
11
  import { _ as E } from "./Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js";
12
- import { d as G, u as J, p as ne, o as R, r as D, g as H, s as le, e as re, a as ie, f as ce, b as ue, h as de } from "./index-C3HWRCEe.js";
12
+ import { d as G, u as J, p as ne, o as R, r as D, g as H, s as le, e as re, a as ie, f as ce, b as ue, h as de } from "./index-Yy28omu6.js";
13
13
  import { _ as me } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
14
14
  import { _ as fe } from "./Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
15
15
  import { _ as pe } from "./SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js";
@@ -13,11 +13,11 @@ import { a as ae, u as le } from "./routeResource-DlTsGTg_.js";
13
13
  import { a as se } from "./ResourcePage.vue_vue_type_script_setup_true_lang-BFaaFQSm.js";
14
14
  import { _ as re } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
15
15
  import { _ as H } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
16
- import { u as O, a as U, f as ce, d as ne, b as M, c as T } from "./index-C3HWRCEe.js";
16
+ import { u as O, a as U, f as ce, d as ne, b as M, c as T } from "./index-Yy28omu6.js";
17
17
  import { _ as J } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
18
- import { u as ie, _ as ue } from "./useCommand-VIZE7xG-.js";
18
+ import { u as ie, _ as ue } from "./useCommand-Cj-APj-P.js";
19
19
  import { _ as me } from "./Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
20
- import { _ as pe } from "./RoleEditor.vue_vue_type_script_setup_true_lang-2IOio1Sa.js";
20
+ import { _ as pe } from "./RoleEditor.vue_vue_type_script_setup_true_lang-B6g2760V.js";
21
21
  const de = { "data-test": "role-replace" }, fe = /* @__PURE__ */ I({
22
22
  __name: "ReplaceRoleDialog",
23
23
  props: {
@@ -11,7 +11,7 @@ import { u as K } from "./platform-q3cjODLx.js";
11
11
  import { _ as T } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
12
12
  import { _ as q } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
13
13
  import { u as z } from "./useLoad-M7V-AVwR.js";
14
- import { u as G, a as H, b as J, c as x } from "./index-C3HWRCEe.js";
14
+ import { u as G, a as H, b as J, c as x } from "./index-Yy28omu6.js";
15
15
  const M = {
16
16
  class: "flex min-w-0 flex-col gap-group-gap",
17
17
  "data-test": "roles-index"
@@ -2,7 +2,7 @@ import { defineComponent as x, useTemplateRef as v, computed as w, ref as $, ope
2
2
  import { useI18n as N } from "vue-i18n";
3
3
  import { _ as q } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
4
4
  import { u as A } from "./describeError-B-NMa--w.js";
5
- import { P as D, b as L, e as O, i as g, d as T } from "./index-DiEoRV9D.js";
5
+ import { P as D, b as L, e as O, i as g, d as T } from "./index-BmowiT1y.js";
6
6
  import { _ as k } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
7
7
  import { t as b } from "./toast-CqSDTWRX.js";
8
8
  import { u as V } from "./platform-q3cjODLx.js";
@@ -10,12 +10,12 @@ import { _ as R } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5
10
10
  import { e as G } from "./control-B4SdblL6.js";
11
11
  import { _ as Z } from "./SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js";
12
12
  import { _ as J } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
13
- import { u as K } from "./FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
14
- import { _ as W } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
13
+ import { u as K } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
14
+ import { _ as W } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
15
15
  import { _ as E } from "./TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js";
16
16
  import { a as k, n as X } from "./useTypedEntry-C7k7Dyl-.js";
17
17
  import { _ as Y } from "./PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js";
18
- import { n as q } from "./index-D-0JNiFF.js";
18
+ import { n as q } from "./index-tnSTp0cM.js";
19
19
  import { u as ee } from "./platform-q3cjODLx.js";
20
20
  import { u as te } from "./useLoad-M7V-AVwR.js";
21
21
  function ne() {
@@ -6,7 +6,7 @@ import { u as D } from "./format-D8X4zsx6.js";
6
6
  import { _ as p } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
7
7
  import { e as b } from "./control-B4SdblL6.js";
8
8
  import { u as U } from "./describeError-B-NMa--w.js";
9
- import { c as q, P as z, b as F, _ as L, i as O, d as T } from "./index-DiEoRV9D.js";
9
+ import { c as q, P as z, b as F, _ as L, i as O, d as T } from "./index-BmowiT1y.js";
10
10
  import { t as h } from "./toast-CqSDTWRX.js";
11
11
  import { u as j, h as G } from "./platform-q3cjODLx.js";
12
12
  import { b as H } from "./routeResource-DlTsGTg_.js";
@@ -3,10 +3,10 @@ import { useI18n as x } from "vue-i18n";
3
3
  import { useRoute as y, useRouter as h } from "vue-router";
4
4
  import { _ as I } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
5
5
  import { _ as N } from "./Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js";
6
- import { _ as S } from "./FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
6
+ import { _ as S } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
7
7
  import { _ as a } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
8
8
  import { r as $ } from "./guards-Dve61KjR.js";
9
- import { u as C, a as E } from "./index-DiEoRV9D.js";
9
+ import { u as C, a as E } from "./index-BmowiT1y.js";
10
10
  const V = { class: "flex flex-1 flex-col items-center justify-center gap-8" }, k = { class: "text-xl font-semibold text-content-strong" }, H = /* @__PURE__ */ d({
11
11
  __name: "SignInPage",
12
12
  setup(q) {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, ref as m, watch as p, openBlock as c, createElementBlock as v, createVNode as i, unref as e, withCtx as w, createBlock as x, createCommentVNode as y, createElementVNode as V, toDisplayString as $ } from "vue";
2
2
  import { useI18n as N } from "vue-i18n";
3
- import { P as S, i as b } from "./index-DiEoRV9D.js";
3
+ import { P as S, i as b } from "./index-BmowiT1y.js";
4
4
  import { u as k } from "./platform-q3cjODLx.js";
5
5
  import { b as I } from "./routeResource-DlTsGTg_.js";
6
6
  import { _ as R } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
@@ -3,7 +3,7 @@ import { useI18n as A } from "vue-i18n";
3
3
  import { a as F } from "./neighbors-DVN_cADL.js";
4
4
  import { _ as H } from "./Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js";
5
5
  import { u as J } from "./describeError-B-NMa--w.js";
6
- import { i as w, P as Q, p as W, f as X, M as Y, g as Z, d as ee } from "./index-DiEoRV9D.js";
6
+ import { i as w, P as Q, p as W, f as X, M as Y, g as Z, d as ee } from "./index-BmowiT1y.js";
7
7
  import { _ as se } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
8
8
  import { t as k } from "./toast-CqSDTWRX.js";
9
9
  import { _ as ae } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-BltrQnrQ.js";
@@ -16,9 +16,9 @@ import { u as ie } from "./useLoad-M7V-AVwR.js";
16
16
  import { _ as V } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
17
17
  import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
18
18
  import { e as B } from "./control-B4SdblL6.js";
19
- import { u as z, _ as K } from "./useCommand-VIZE7xG-.js";
19
+ import { u as z, _ as K } from "./useCommand-Cj-APj-P.js";
20
20
  import { u as U } from "./fieldMessages-6HVzSDqG.js";
21
- import { u as ce, s as le } from "./status-UWWFHi9t.js";
21
+ import { u as ce, s as le } from "./status-Bh3-Cg7o.js";
22
22
  import { _ as M } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
23
23
  const ue = /* @__PURE__ */ R({
24
24
  __name: "DeactivateDialog",
@@ -6,14 +6,14 @@ import { _ as I } from "./Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js
6
6
  import { u as F } from "./format-D8X4zsx6.js";
7
7
  import { u as L } from "./platform-q3cjODLx.js";
8
8
  import { _ as G } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
9
- import { i as K, f as E, M as W } from "./index-DiEoRV9D.js";
10
- import { U as j, u as H, s as J } from "./status-UWWFHi9t.js";
9
+ import { i as K, f as E, M as W } from "./index-BmowiT1y.js";
10
+ import { U as j, u as H, s as J } from "./status-Bh3-Cg7o.js";
11
11
  import { u as O } from "./environment-Dva-SG8D.js";
12
12
  import { u as Q } from "./languages-BShG9LpE.js";
13
13
  import { _ as X } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
14
14
  import { _ as Y } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
15
15
  import { _ as d } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
16
- import { u as Z, _ as ee } from "./useCommand-VIZE7xG-.js";
16
+ import { u as Z, _ as ee } from "./useCommand-Cj-APj-P.js";
17
17
  import { t as se } from "./toast-CqSDTWRX.js";
18
18
  import { u as te } from "./fieldMessages-6HVzSDqG.js";
19
19
  const oe = /* @__PURE__ */ U({
@@ -1,4 +1,4 @@
1
- import { _ as a, i as c, j as o, c as r, b as n, k as i, l as u, p as l, m as p, n as t, u as d, f as m } from "../index-C3HWRCEe.js";
1
+ import { _ as a, i as c, j as o, c as r, b as n, k as i, l as u, p as l, m as p, n as t, u as d, f as m } from "../index-Yy28omu6.js";
2
2
  export {
3
3
  a as BindingRow,
4
4
  c as PersonAccess,
@@ -13,6 +13,9 @@ import type { Form } from "./useForm";
13
13
  * instead of closing, opens the dialog again with fresh inputs (the command's defaults), so the next record can be entered
14
14
  * (the add-a-record recipe, `docs/recipes/forms.md`).
15
15
  *
16
+ * `:editable="false"` is the same dialog for someone who may only look: the fields read (like `FormGroup :editable="false"`), there is no
17
+ * primary action (nor `#actions`), the dismiss button says "Close", and closing never asks. Give the same body to both; do not write a second dialog.
18
+ *
16
19
  * A command with `ask` puts its question here, in an `AlertDialog` over the filled form, once the inputs check out: Cancel
17
20
  * returns to the form untouched and nothing is sent; the action runs the command, and a refusal then lands on the form like any other.
18
21
  */
@@ -24,6 +27,8 @@ type __VLS_Props = {
24
27
  subtitle?: string;
25
28
  /** What the primary action says: exactly what it does ("Assign"). */
26
29
  confirmLabel: string;
30
+ /** `false`: the record is shown, not edited: fields read, no primary action, "Close" instead of Cancel, no discard question. */
31
+ editable?: boolean;
27
32
  /** Disables the primary action while true (a proposal still loading). The inputs, Cancel and the leave guard work as before, and `run()` does nothing. */
28
33
  confirmDisabled?: boolean;
29
34
  /** What it says once done; by default "Saved". */
@@ -54,6 +59,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
54
59
  message: string;
55
60
  size: "sm" | "md" | "lg";
56
61
  subtitle: string;
62
+ editable: boolean;
57
63
  fieldLabel: (field: string) => string;
58
64
  doneLabel: string;
59
65
  confirmDisabled: boolean;
@@ -10,7 +10,8 @@ import { type FieldProps, type FieldSlots } from "./field";
10
10
  */
11
11
  type __VLS_Props = FieldProps & {
12
12
  minYear?: number;
13
- maxYear?: number;
13
+ maxYear?: number; /** Shown while both are empty; by default the library's "Choose…". */
14
+ placeholder?: string;
14
15
  };
15
16
  type __VLS_Slots = FieldSlots;
16
17
  type __VLS_PublicProps = __VLS_Props & {
@@ -25,6 +26,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
25
26
  "onUpdate:year"?: ((value: number | null) => any) | undefined;
26
27
  }>, {
27
28
  disabled: boolean;
29
+ placeholder: string;
28
30
  name: string;
29
31
  label: string;
30
32
  error: string;
@@ -1,12 +1,12 @@
1
- import { _ as Me, s as He, c as Se, f as et } from "../FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
2
- import { E as Ko, u as Ao, a as Ho } from "../FormErrors.vue_vue_type_script_setup_true_lang-DWcVKZM3.js";
3
- import { f as De, u as st } from "../useCommand-VIZE7xG-.js";
4
- import { _ as Yo, a as Wo } from "../useCommand-VIZE7xG-.js";
1
+ import { _ as Me, s as He, c as Se, f as et } from "../FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
2
+ import { E as Ko, u as Ao, a as Ho } from "../FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
3
+ import { f as De, u as st } from "../useCommand-Cj-APj-P.js";
4
+ import { _ as Yo, a as Wo } from "../useCommand-Cj-APj-P.js";
5
5
  import { ref as N, computed as k, defineComponent as P, openBlock as u, createBlock as O, mergeProps as Q, unref as s, createSlots as ee, withCtx as v, createElementVNode as b, normalizeClass as j, createElementBlock as y, Fragment as ue, renderList as we, createVNode as M, createCommentVNode as T, toDisplayString as _, renderSlot as C, mergeDefaults as ce, useModel as ie, useId as je, withKeys as Ce, withModifiers as be, createTextVNode as Y, mergeModels as se, useTemplateRef as H, shallowRef as Le, watch as de, normalizeProps as Ve, guardReactiveProps as qe, nextTick as he, provide as Re, inject as tt, onBeforeUnmount as Ee, onMounted as rt, toRef as it, toValue as Oe, getCurrentScope as ut, onScopeDispose as dt, shallowReactive as Ue, normalizeStyle as ct, resolveDynamicComponent as ft } from "vue";
6
6
  import { a as Ie } from "../leaveGuard-Cc8yeLxM.js";
7
7
  import { M as Zo, c as Xo, i as Qo, l as en, u as tn } from "../leaveGuard-Cc8yeLxM.js";
8
8
  import { _ as ln } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js";
9
- import { u as nn } from "../useResourceForm-CP2lCwmD.js";
9
+ import { u as nn } from "../useResourceForm-tGYTfKhH.js";
10
10
  import { _ as te } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
11
11
  import { u as at, _ as ye, f as fe, b as ve, a as lt, c as Ge, e as vt, h as mt, i as pt, d as bt } from "../control-B4SdblL6.js";
12
12
  import { useI18n as oe } from "vue-i18n";
@@ -27,7 +27,7 @@ import { _ as mn } from "../TimeField.vue_vue_type_script_setup_true_lang-DBxKAW
27
27
  import { _ as ge } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
28
28
  import { _ as qt, r as Rt } from "../FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
29
29
  import { a as bn, c as gn, p as yn, u as hn } from "../FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
30
- import { _ as wn } from "../FormView.vue_vue_type_script_setup_true_lang-Dbfg_jGh.js";
30
+ import { _ as wn } from "../FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
31
31
  import { i as Ot } from "../intlLocale-CeRU44qJ.js";
32
32
  import { a as Mt } from "../environment-Dva-SG8D.js";
33
33
  import { _ as jt } from "../NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js";
@@ -1223,8 +1223,9 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
1223
1223
  presentation: {},
1224
1224
  name: {},
1225
1225
  minYear: {},
1226
- maxYear: {}
1227
- }, { ...ve, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1226
+ maxYear: {},
1227
+ placeholder: {}
1228
+ }, { ...ve, placeholder: void 0, minYear: 1970, maxYear: () => (/* @__PURE__ */ new Date()).getFullYear() + 1 }), {
1228
1229
  month: { default: null },
1229
1230
  monthModifiers: {},
1230
1231
  year: { default: null },
@@ -1254,6 +1255,7 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
1254
1255
  expanded: z,
1255
1256
  disabled: t.disabled,
1256
1257
  invalid: g,
1258
+ placeholder: t.placeholder ?? s(o)("core.form.select.choose"),
1257
1259
  onClick: S
1258
1260
  }), {
1259
1261
  default: v(() => [
@@ -1267,7 +1269,7 @@ const Ea = ["id", "aria-labelledby"], Ia = ["id", "value", "lang", "name", "rows
1267
1269
  ], 64)) : T("", !0)
1268
1270
  ]),
1269
1271
  _: 1
1270
- }, 16, ["expanded", "disabled", "invalid", "onClick"])
1272
+ }, 16, ["expanded", "disabled", "invalid", "placeholder", "onClick"])
1271
1273
  ]),
1272
1274
  default: v(({ dismiss: S }) => [
1273
1275
  b("div", el, [
@@ -2015,8 +2017,8 @@ function jo(l) {
2015
2017
  command: a,
2016
2018
  form: a.form,
2017
2019
  editing: t,
2018
- create() {
2019
- t.value = null, a.present();
2020
+ create(o) {
2021
+ t.value = null, a.present(o);
2020
2022
  },
2021
2023
  edit(o) {
2022
2024
  t.value = o, a.present(l.toValues?.(o));
@@ -1,10 +1,13 @@
1
1
  import { type Ref } from "vue";
2
+ import type { IconName } from "../icon";
2
3
  import { type Form, type FormOptions, type SubmitContext, type SubmitResult } from "./useForm";
3
4
  /** The question a command asks before it runs: it names the consequence ("Archive the vehicle?"), and `confirmLabel` says exactly what yes does. */
4
5
  export interface CommandQuestion {
5
6
  readonly title: string;
6
7
  readonly message?: string;
7
8
  readonly confirmLabel?: string;
9
+ /** The alert's icon, as on `AlertDialog` (an app-registered or core icon name); by default the tone's. */
10
+ readonly icon?: IconName;
8
11
  readonly tone?: "neutral" | "warning" | "critical";
9
12
  }
10
13
  export interface CommandOptions<Values extends object, Output = Values, Done = unknown> extends FormOptions<Values, Output> {
@@ -49,7 +52,7 @@ export interface Command<Values extends object, Output = Values, Done = unknown>
49
52
  * <CommandDialog :command="assign" :title="t('assign')" :confirm-label="t('assign')"><SelectField v-bind="assign.form.bind('assignee')" … /></CommandDialog>
50
53
  * <Button @click="assign.present()">Assign</Button>
51
54
  *
52
- * `ask: (input) => ({ title, message, confirmLabel, tone }) | null` puts a question before the call (a delivery that archives the vehicle).
55
+ * `ask: (input) => ({ title, message, confirmLabel, icon, tone }) | null` puts a question before the call (a delivery that archives the vehicle).
53
56
  * A command with nothing to enter is an `AlertDialog` with `:action="command.confirm"`.
54
57
  */
55
58
  export declare function useCommand<Values extends object, Output = Values, Done = unknown>(options: CommandOptions<Values, Output, Done>): Command<Values, Output, Done>;