@wssto2/vue-core 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.3 — 2026-10-21
4
+
5
+ A group sheet focuses its first error.
6
+
7
+ ### Changed
8
+ - **form:** `GroupSheet` calls `focusFirstError` on its body once it has opened and after a refused Save, so a sheet opened with errors already set (`form.errors.add(field, message)` before `present()`) lands on the first flagged field in page order instead of the first control. No new API and no option: with no errors nothing changes. An application that focused the field itself after `present()` can drop that code.
9
+
3
10
  ## 0.15.2 — 2026-10-20
4
11
 
5
12
  A hand-built `Idempotency-Key` header is now a lint error.
@@ -13,7 +13,7 @@ import { b as W } from "./routeResource-DlTsGTg_.js";
13
13
  import { _ as X } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
14
14
  import { _ as Y } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
15
  import { u as Z } from "./useLoad-M7V-AVwR.js";
16
- import { P as tt, f as et, j as at } from "./index-D5DuvKP1.js";
16
+ import { P as tt, f as et, j as at } from "./index-DM_nWOYf.js";
17
17
  import { _ as st } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
18
18
  const ot = {
19
19
  class: "flex min-w-0 flex-col gap-group-gap",
@@ -5,7 +5,7 @@ import { u as b } from "./platform-ORzRR3Tw.js";
5
5
  import { b as V } from "./routeResource-DlTsGTg_.js";
6
6
  import { _ as R } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
7
7
  import { u as E } from "./useLoad-M7V-AVwR.js";
8
- import { P as N, f as B, k as P, j as S } from "./index-D5DuvKP1.js";
8
+ import { P as N, f as B, k as P, j as S } from "./index-DM_nWOYf.js";
9
9
  import { _ as U } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
10
10
  import { _ as I } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
11
11
  const W = {
@@ -15,7 +15,7 @@ import { b as M } from "./routeResource-DlTsGTg_.js";
15
15
  import { u as O } from "./serverMessages-Ce8-MK4e.js";
16
16
  import { _ as U, a as $ } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
17
17
  import { u as j } from "./keepAlive-ClGnsIzT.js";
18
- import { P as z, e as H } from "./index-D5DuvKP1.js";
18
+ import { P as z, e as H } from "./index-DM_nWOYf.js";
19
19
  const J = {
20
20
  class: "flex min-w-0 max-w-200 flex-col gap-group-gap",
21
21
  "data-person-general": ""
@@ -5,10 +5,10 @@ import { u as F } from "./platform-ORzRR3Tw.js";
5
5
  import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
6
6
  import { u as te } from "./useLoad-M7V-AVwR.js";
7
7
  import { i as S } from "./preferences-hYhrw8Uy.js";
8
- import { h as xe, q as $e, j as ke, f as qe } from "./index-D5DuvKP1.js";
8
+ import { h as xe, q as $e, j as ke, f as qe } from "./index-DM_nWOYf.js";
9
9
  import { a as K, u as ne, p as Ce } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
10
10
  import { _ as de } from "./FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js";
11
- import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-Qqo3ywsS.js";
11
+ import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-B-Hs4gNO.js";
12
12
  import { t as C } from "./toast-CqSDTWRX.js";
13
13
  import { u as T } from "./serverMessages-Ce8-MK4e.js";
14
14
  import { g as Z } from "./options-B48UiYsG.js";
@@ -9,7 +9,7 @@ import { _ as j } from "./useCommand-DAMgQ5NE.js";
9
9
  import { u as F } from "./useRecordDialog-QPKFH1Ww.js";
10
10
  import { t as H } from "./toast-CqSDTWRX.js";
11
11
  import { u as S } from "./platform-ORzRR3Tw.js";
12
- import { l as J, m as Q } from "./index-D5DuvKP1.js";
12
+ import { l as J, m as Q } from "./index-DM_nWOYf.js";
13
13
  import { r as W } from "./http-D6qOS6xs.js";
14
14
  import { i as X } from "./preferences-hYhrw8Uy.js";
15
15
  import { s as l } from "./routes-Beyr5NQo.js";
@@ -15,8 +15,8 @@ import { u as ae } from "./platform-ORzRR3Tw.js";
15
15
  import { u as me, a as ve } from "./routeResource-DlTsGTg_.js";
16
16
  import { a as fe } from "./ResourcePage.vue_vue_type_script_setup_true_lang-uLrX13ab.js";
17
17
  import { _ as O } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
18
- import { m as ce, R as _e, l as pe, n as ye } from "./index-D5DuvKP1.js";
19
- import { u as W, a as X, _ as ke } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CGvJW3bi.js";
18
+ import { m as ce, R as _e, l as pe, n as ye } from "./index-DM_nWOYf.js";
19
+ import { u as W, a as X, _ as ke } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js";
20
20
  import { _ as J } from "./Button.vue_vue_type_script_setup_true_lang-JrqhO99l.js";
21
21
  import { _ as be } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
22
22
  import { _ as ge } from "./Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js";
@@ -13,8 +13,8 @@ import { u as X } from "./platform-ORzRR3Tw.js";
13
13
  import { _ as Y } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
14
14
  import { _ as Z } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
15
  import { u as ee } from "./useLoad-M7V-AVwR.js";
16
- import { l as te, m as $, n as A } from "./index-D5DuvKP1.js";
17
- import { u as ae, _ as oe } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CGvJW3bi.js";
16
+ import { l as te, m as $, n as A } from "./index-DM_nWOYf.js";
17
+ import { u as ae, _ as oe } from "./ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C7WKxJ9i.js";
18
18
  const se = {
19
19
  class: "flex min-w-0 flex-col gap-group-gap",
20
20
  "data-test": "service-segment"
@@ -9,7 +9,7 @@ import { u as D } from "./platform-ORzRR3Tw.js";
9
9
  import { b as L } from "./routeResource-DlTsGTg_.js";
10
10
  import { _ as O } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
11
11
  import { _ as T } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
12
- import { P as V, e as I, g as j, h as z } from "./index-D5DuvKP1.js";
12
+ import { P as V, e as I, g as j, h as z } from "./index-DM_nWOYf.js";
13
13
  import { i as F } from "./usePreferences-BfMXVbSO.js";
14
14
  const G = {
15
15
  class: "flex min-w-0 flex-col gap-group-gap",
@@ -12,7 +12,7 @@ import { u as z, h as F } from "./platform-ORzRR3Tw.js";
12
12
  import { b as L } from "./routeResource-DlTsGTg_.js";
13
13
  import { _ as O } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
14
14
  import { i as T } from "./usePreferences-BfMXVbSO.js";
15
- import { f as j, P as G, e as H, _ as J } from "./index-D5DuvKP1.js";
15
+ import { f as j, P as G, e as H, _ as J } from "./index-DM_nWOYf.js";
16
16
  import { _ as K, a as M } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
17
17
  const Q = {
18
18
  key: 0,
@@ -6,7 +6,7 @@ import { _ as N } from "./Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js"
6
6
  import { _ as S } from "./FormView.vue_vue_type_script_setup_true_lang-Bq_Qa4py.js";
7
7
  import { _ as a } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
8
8
  import { r as $ } from "./guards-6fJxfUtk.js";
9
- import { u as C, a as E } from "./index-D5DuvKP1.js";
9
+ import { u as C, a as E } from "./index-DM_nWOYf.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) {
@@ -5,7 +5,7 @@ import { u as b } from "./platform-ORzRR3Tw.js";
5
5
  import { b as k } from "./routeResource-DlTsGTg_.js";
6
6
  import { _ as I } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CX8mpXRE.js";
7
7
  import { u as R } from "./useLoad-M7V-AVwR.js";
8
- import { P as C, i as E, j as B } from "./index-D5DuvKP1.js";
8
+ import { P as C, i as E, j as B } from "./index-DM_nWOYf.js";
9
9
  import { _ as P } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
10
10
  import { _ as h } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
11
11
  const U = {
@@ -14,7 +14,7 @@ import { A as J } from "./access-DmAceEo5.js";
14
14
  import { _ as Q } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
15
  import { u as W } from "./useLoad-M7V-AVwR.js";
16
16
  import { i as X } from "./usePreferences-BfMXVbSO.js";
17
- import { P as Y, p as Z, c as ee, d as se, b as ae, M as te, o as oe, s as re } from "./index-D5DuvKP1.js";
17
+ import { P as Y, p as Z, c as ee, d as se, b as ae, M as te, o as oe, s as re } from "./index-DM_nWOYf.js";
18
18
  import { a as ne } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
19
19
  import { _ as A } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
20
20
  import { u as ie, _ as ce } from "./useCommand-DAMgQ5NE.js";
@@ -6,7 +6,7 @@ import { _ as V } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js
6
6
  import { u as L } from "./format-Cp1h0vsC.js";
7
7
  import { u as z } from "./platform-ORzRR3Tw.js";
8
8
  import { _ as A } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
9
- import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-D5DuvKP1.js";
9
+ import { b as D, U as I, c as f, d as M, M as q, s as F } from "./index-DM_nWOYf.js";
10
10
  const G = ["datetime"], Z = /* @__PURE__ */ C({
11
11
  __name: "UsersList",
12
12
  setup(K) {
@@ -3,7 +3,9 @@ import type { GroupSheetState } from "./useGroupSheet";
3
3
  * The sheet of one record group (decision D22): a grouped `Modal` with one Save and the lifecycle of `useGroupSheet`. The
4
4
  * group's values are its baseline on open and are put back on Cancel; a dismiss with edits asks first; a save says what it is
5
5
  * doing, then that it is done, before the sheet closes. The fields go in the default slot, bound to the record's form as on its
6
- * page. A save that needs another group's data says which at the top; a failure says why.
6
+ * page. A save that needs another group's data says which at the top; a failure says why. Focus goes to the first field with an
7
+ * error (`focusFirstError`): when the sheet opens with errors already set (`form.errors.add(field, message)` before `present()`), and
8
+ * after a refused save.
7
9
  *
8
10
  * <GroupSheet :sheet="contact" :title="t('contact')" :editable="canEdit" :group-label="(group) => t('group.' + group)">
9
11
  * <RecordGroupScope only="contact" :editable="canEdit"><ContactSections :form="form" /></RecordGroupScope>
@@ -32,7 +32,7 @@ import { _ as Vt } from "../NumberField.vue_vue_type_script_setup_true_lang-U-_k
32
32
  import { _ as Dt } from "../Sheet.vue_vue_type_script_setup_true_lang-BG8HUNfs.js";
33
33
  import { b as Rt, a as Ke } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
34
34
  import { _ as fn, u as mn } from "../SelectField.vue_vue_type_script_setup_true_lang-CLkoPbGm.js";
35
- import { _ as pn, b as bn, a as gn, u as yn } from "../useGroupSheet-Qqo3ywsS.js";
35
+ import { _ as pn, b as bn, a as gn, u as yn } from "../useGroupSheet-B-Hs4gNO.js";
36
36
  import { _ as Pe } from "../PhotoViewer.vue_vue_type_script_setup_true_lang-DmMg1T_V.js";
37
37
  import { _ as kn } from "../SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js";
38
38
  import { _ as wn } from "../SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js";
@@ -1,5 +1,5 @@
1
1
  import { i as a } from "../preferences-hYhrw8Uy.js";
2
- import { k as o, r as n, t as i, P as r, j as u, h as c, _ as d, q as S, i as g, U as A, v as f, w as l, x as p, y as m, z as I, A as R, o as x, B as y, C as P, n as U, s as v, e as D, g as E, b, f as w, D as F, E as B, c as C } from "../index-D5DuvKP1.js";
2
+ import { k as o, r as n, t as i, P as r, j as u, h as c, _ as d, q as S, i as g, U as A, v as f, w as l, x as p, y as m, z as I, A as R, o as x, B as y, C as P, n as U, s as v, e as D, g as E, b, f as w, D as F, E as B, c as C } from "../index-DM_nWOYf.js";
3
3
  import { a as T, _ } from "../ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
4
4
  import { i as k, l as N, r as O, s as j, a as q, u as z } from "../usePreferences-BfMXVbSO.js";
5
5
  import { s as K } from "../routes-Beyr5NQo.js";
@@ -246,7 +246,7 @@ const ft = ["aria-labelledby"], gt = ["id"], _t = { class: "mt-1 text-subheadlin
246
246
  ]));
247
247
  }
248
248
  }), wt = X({
249
- login: { name: "login", path: "/login", component: () => import("./SignInPage-C9--4P11.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
249
+ login: { name: "login", path: "/login", component: () => import("./SignInPage-c886Fvd7.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
250
250
  });
251
251
  function Xn(e = {}) {
252
252
  return ne({
@@ -381,7 +381,7 @@ function Hn(e) {
381
381
  };
382
382
  }
383
383
  const ke = X({
384
- index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-7Xk2hsNL.js"), meta: { titleKey: "core.profile.title" } }
384
+ index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-Di77M2cX.js"), meta: { titleKey: "core.profile.title" } }
385
385
  }), At = /* @__PURE__ */ $({
386
386
  __name: "ProfileMenuItem",
387
387
  setup(e) {
@@ -412,19 +412,19 @@ function jt(e, n) {
412
412
  return [...e.flatMap((s) => [s, ...o(s)]), ...n.filter((s) => s.after === void 0).map((s) => ce(s))];
413
413
  }
414
414
  const le = "iam.user:view", ts = "iam.user:manage", Kt = "iam.user.activity:view", Se = X({
415
- index: { name: "users.index", path: "/users", component: () => import("./UsersList-C6u3YCCp.js"), meta: { access: le, titleKey: "core.users.title" } },
415
+ index: { name: "users.index", path: "/users", component: () => import("./UsersList-M5tBxrox.js"), meta: { access: le, titleKey: "core.users.title" } },
416
416
  record: {
417
417
  name: "users.record",
418
418
  path: "/users/:id",
419
- component: () => import("./UserRecord-L3ahHNjb.js"),
419
+ component: () => import("./UserRecord-DrbpVHh9.js"),
420
420
  meta: { access: le, titleKey: "core.users.title", remountOnParam: "id" },
421
421
  children: [
422
- { name: "users.record.general", path: "general", component: () => import("./General-Bu_ZIVbk.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
423
- { name: "users.record.signin", path: "signin", component: () => import("./SignIn-m6PANavm.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
424
- { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-Bv5GU5Oi.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
425
- { name: "users.record.signins", path: "signins", component: () => import("./SignIns-BhLnkY08.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
426
- { name: "users.record.changes", path: "changes", component: () => import("./Changes-Dsar4rXS.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
427
- { name: "users.record.activity", path: "activity", component: () => import("./Activity-RAk3h7Aa.js"), meta: { access: Kt, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
422
+ { name: "users.record.general", path: "general", component: () => import("./General-oUI2MiwO.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
423
+ { name: "users.record.signin", path: "signin", component: () => import("./SignIn-HnujOMRY.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
424
+ { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-BHwMrF7c.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
425
+ { name: "users.record.signins", path: "signins", component: () => import("./SignIns-BsTlN2Zc.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
426
+ { name: "users.record.changes", path: "changes", component: () => import("./Changes-DYpysvfX.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
427
+ { name: "users.record.activity", path: "activity", component: () => import("./Activity-DM9t5d3D.js"), meta: { access: Kt, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
428
428
  ]
429
429
  }
430
430
  });
@@ -1153,11 +1153,11 @@ const Jt = ["title"], Qt = { class: "font-mono" }, cs = /* @__PURE__ */ $({
1153
1153
  }, 8, ["permission"])) : k("", !0);
1154
1154
  }
1155
1155
  }), [cn, ms] = N("vue-core.serviceaccounts"), ue = "iam.serviceaccount:view", ps = "iam.serviceaccount:manage", fs = "iam.serviceaccount:revoke", de = X({
1156
- index: { name: "serviceaccounts.index", path: "/iam/service-accounts", component: () => import("./ServiceAccountsList-D-YqPi_h.js"), meta: { access: ue, titleKey: "core.serviceaccounts.title_plural" } },
1156
+ index: { name: "serviceaccounts.index", path: "/iam/service-accounts", component: () => import("./ServiceAccountsList-BVRjoswH.js"), meta: { access: ue, titleKey: "core.serviceaccounts.title_plural" } },
1157
1157
  record: {
1158
1158
  name: "serviceaccounts.record",
1159
1159
  path: "/iam/service-accounts/:id",
1160
- component: () => import("./ServiceAccountRecord-Caj7mo3A.js"),
1160
+ component: () => import("./ServiceAccountRecord-CTU10RWy.js"),
1161
1161
  meta: { access: ue, titleKey: "core.serviceaccounts.title_plural", remountOnParam: "id" }
1162
1162
  }
1163
1163
  });
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.15.2";
2
+ export declare const version = "0.15.3";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.15.2";
1
+ const o = "0.15.3";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,18 +1,19 @@
1
- import { defineComponent as L, useModel as X, useId as Y, useTemplateRef as O, ref as h, computed as w, watch as N, nextTick as z, onMounted as H, openBlock as b, createElementBlock as _, normalizeClass as T, createElementVNode as $, unref as x, Fragment as I, renderList as Z, createTextVNode as ee, toDisplayString as j, createCommentVNode as C, mergeModels as A, onBeforeUnmount as te, createBlock as F, withCtx as E, createVNode as ae, renderSlot as J, provide as K, toRef as se, shallowRef as le, toValue as P } from "vue";
1
+ import { defineComponent as L, useModel as X, useId as Y, useTemplateRef as O, ref as y, computed as w, watch as N, nextTick as $, onMounted as H, openBlock as b, createElementBlock as _, normalizeClass as T, createElementVNode as D, unref as k, Fragment as I, renderList as Z, createTextVNode as ee, toDisplayString as j, createCommentVNode as C, mergeModels as P, onBeforeUnmount as te, createBlock as V, withCtx as z, createVNode as ae, renderSlot as J, provide as A, toRef as se, shallowRef as le, toValue as K } from "vue";
2
2
  import { useI18n as Q } from "vue-i18n";
3
3
  import { _ as oe } from "./Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js";
4
4
  import { _ as q } from "./Banner.vue_vue_type_script_setup_true_lang-sv0phngk.js";
5
5
  import { D as ne } from "./shortcut-oixX55SZ.js";
6
6
  import { _ as re, r as ie, s as U, c as B, f as ue } from "./FormGroup.vue_vue_type_script_setup_true_lang-dsO1m9Mm.js";
7
- import { d as ce } from "./options-B48UiYsG.js";
8
- import { t as de } from "./toast-CqSDTWRX.js";
9
- import { a as fe } from "./leaveGuard-Cc8yeLxM.js";
10
- const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "aria-describedby"], me = {
7
+ import { f as ce } from "./useCommand-DAMgQ5NE.js";
8
+ import { d as de } from "./options-B48UiYsG.js";
9
+ import { t as fe } from "./toast-CqSDTWRX.js";
10
+ import { a as ve } from "./leaveGuard-Cc8yeLxM.js";
11
+ const me = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "aria-describedby"], pe = {
11
12
  key: 1,
12
13
  class: "h-5 w-px animate-caret-blink bg-content-strong"
13
- }, De = /* @__PURE__ */ L({
14
+ }, Ee = /* @__PURE__ */ L({
14
15
  __name: "OtpInput",
15
- props: /* @__PURE__ */ A({
16
+ props: /* @__PURE__ */ P({
16
17
  length: { default: 6 },
17
18
  disabled: { type: Boolean, default: !1 },
18
19
  invalid: { type: Boolean, default: !1 },
@@ -24,44 +25,44 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
24
25
  modelValue: { default: "" },
25
26
  modelModifiers: {}
26
27
  }),
27
- emits: /* @__PURE__ */ A(["complete"], ["update:modelValue"]),
28
+ emits: /* @__PURE__ */ P(["complete"], ["update:modelValue"]),
28
29
  setup(l, { expose: a, emit: t }) {
29
- const o = l, i = X(l, "modelValue"), d = t, { t: m } = Q(), f = Y(), r = O("input"), v = h(!1), g = h(0), c = h(!1), y = (s) => s.replace(/\D/g, "").slice(0, o.length), u = w(() => y(i.value)), k = w(() => Math.min(g.value, o.length - 1)), D = w(() => o.label ?? m("core.form.otp.label", { length: o.length }));
30
+ const o = l, u = X(l, "modelValue"), c = t, { t: d } = Q(), v = Y(), r = O("input"), f = y(!1), g = y(0), m = y(!1), h = (s) => s.replace(/\D/g, "").slice(0, o.length), i = w(() => h(u.value)), x = w(() => Math.min(g.value, o.length - 1)), G = w(() => o.label ?? d("core.form.otp.label", { length: o.length }));
30
31
  function p() {
31
- g.value = r.value?.selectionStart ?? u.value.length;
32
+ g.value = r.value?.selectionStart ?? i.value.length;
32
33
  }
33
34
  function S(s) {
34
- const e = y(s);
35
+ const e = h(s);
35
36
  r.value && r.value.value !== e && (r.value.value = e);
36
- const n = e !== u.value;
37
- i.value = e, z(p), n && e.length === o.length && d("complete", e);
37
+ const n = e !== i.value;
38
+ u.value = e, $(p), n && e.length === o.length && c("complete", e);
38
39
  }
39
- function G(s) {
40
+ function E(s) {
40
41
  const e = s.clipboardData?.getData("text") ?? "";
41
- e && (s.preventDefault(), S(e), z(() => {
42
- const n = u.value.length;
42
+ e && (s.preventDefault(), S(e), $(() => {
43
+ const n = i.value.length;
43
44
  r.value?.setSelectionRange(n, n), p();
44
45
  }));
45
46
  }
46
47
  return N(
47
48
  () => o.invalid,
48
49
  (s) => {
49
- s && (c.value = !1, requestAnimationFrame(() => c.value = !0));
50
+ s && (m.value = !1, requestAnimationFrame(() => m.value = !0));
50
51
  }
51
- ), N(u, (s) => {
52
- r.value && r.value.value !== s && (r.value.value = s, z(p));
52
+ ), N(i, (s) => {
53
+ r.value && r.value.value !== s && (r.value.value = s, $(p));
53
54
  }), H(() => {
54
55
  o.autofocus && r.value?.focus();
55
56
  }), a({ focus: () => r.value?.focus() }), (s, e) => (b(), _("div", {
56
- class: T(["relative inline-flex gap-2 sm:gap-3", { "motion-safe:animate-shake": c.value }]),
57
+ class: T(["relative inline-flex gap-2 sm:gap-3", { "motion-safe:animate-shake": m.value }]),
57
58
  "data-test": "otp-input",
58
- onAnimationend: e[3] || (e[3] = (n) => c.value = !1)
59
+ onAnimationend: e[3] || (e[3] = (n) => m.value = !1)
59
60
  }, [
60
- $("input", {
61
- id: x(f),
61
+ D("input", {
62
+ id: k(v),
62
63
  ref_key: "input",
63
64
  ref: r,
64
- value: u.value,
65
+ value: i.value,
65
66
  name: o.name,
66
67
  type: "text",
67
68
  inputmode: "numeric",
@@ -69,34 +70,34 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
69
70
  pattern: "\\d*",
70
71
  spellcheck: "false",
71
72
  disabled: o.disabled,
72
- "aria-label": D.value,
73
+ "aria-label": G.value,
73
74
  "aria-invalid": o.invalid || void 0,
74
75
  "aria-describedby": o.describedBy,
75
76
  "data-test": "otp-input-field",
76
77
  class: "absolute inset-0 z-10 h-full w-full cursor-text border-0 bg-transparent p-0 text-base text-transparent caret-transparent outline-none selection:bg-transparent disabled:cursor-not-allowed",
77
78
  onInput: e[0] || (e[0] = (n) => S(n.target.value)),
78
- onPaste: G,
79
+ onPaste: E,
79
80
  onFocus: e[1] || (e[1] = (n) => {
80
- v.value = !0, p();
81
+ f.value = !0, p();
81
82
  }),
82
- onBlur: e[2] || (e[2] = (n) => v.value = !1),
83
+ onBlur: e[2] || (e[2] = (n) => f.value = !1),
83
84
  onKeyup: p,
84
85
  onClick: p,
85
86
  onSelect: p
86
- }, null, 40, ve),
87
+ }, null, 40, me),
87
88
  (b(!0), _(I, null, Z(o.length, (n) => (b(), _("div", {
88
89
  key: n,
89
90
  "aria-hidden": "true",
90
91
  "data-test": "otp-input-cell",
91
- class: T(["flex size-11 items-center justify-center rounded-control bg-fill text-lg font-medium tabular-nums text-content-strong transition-[box-shadow] sm:size-13 sm:text-xl", [o.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : v.value && k.value === n - 1 ? "bg-surface-cell ring-[1.5px] ring-inset ring-border-focus outline-3 outline-border-focus/20" : "", o.disabled ? "opacity-45" : ""]])
92
+ class: T(["flex size-11 items-center justify-center rounded-control bg-fill text-lg font-medium tabular-nums text-content-strong transition-[box-shadow] sm:size-13 sm:text-xl", [o.invalid ? "bg-status-danger-surface ring-[1.5px] ring-inset ring-border-destructive" : f.value && x.value === n - 1 ? "bg-surface-cell ring-[1.5px] ring-inset ring-border-focus outline-3 outline-border-focus/20" : "", o.disabled ? "opacity-45" : ""]])
92
93
  }, [
93
- u.value[n - 1] ? (b(), _(I, { key: 0 }, [
94
- ee(j(u.value[n - 1]), 1)
95
- ], 64)) : v.value && k.value === n - 1 ? (b(), _("span", me)) : C("", !0)
94
+ i.value[n - 1] ? (b(), _(I, { key: 0 }, [
95
+ ee(j(i.value[n - 1]), 1)
96
+ ], 64)) : f.value && x.value === n - 1 ? (b(), _("span", pe)) : C("", !0)
96
97
  ], 2))), 128))
97
98
  ], 34));
98
99
  }
99
- }), pe = { class: "text-footnote" }, be = { class: "text-footnote" }, Ge = /* @__PURE__ */ L({
100
+ }), be = { class: "text-footnote" }, ge = { class: "text-footnote" }, Fe = /* @__PURE__ */ L({
100
101
  __name: "GroupSheet",
101
102
  props: {
102
103
  sheet: {},
@@ -109,72 +110,78 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
109
110
  },
110
111
  emits: ["saved"],
111
112
  setup(l, { emit: a }) {
112
- const t = l, o = a, { t: i } = Q(), d = O("modal"), m = O("body"), f = h(!1);
113
+ const t = l, o = a, { t: u } = Q(), c = O("modal"), d = O("body"), v = y(!1);
113
114
  let r = null;
114
- N(() => t.sheet.open.value, (c) => {
115
- c ? (f.value = !1, d.value?.present()) : d.value?.dismiss();
115
+ N(() => t.sheet.open.value, (h) => {
116
+ h ? (v.value = !1, c.value?.present()) : c.value?.dismiss();
116
117
  }), H(() => {
117
- t.sheet.open.value && d.value?.present();
118
+ t.sheet.open.value && c.value?.present();
118
119
  }), te(() => {
119
120
  r && clearTimeout(r);
120
121
  });
121
- async function v() {
122
- await t.sheet.save() && (f.value = !0, o("saved"), r = setTimeout(() => t.sheet.dismiss(), ne));
122
+ const f = () => $().then(() => d.value ? ce(d.value) : !1);
123
+ async function g() {
124
+ if (!await t.sheet.save()) {
125
+ f();
126
+ return;
127
+ }
128
+ v.value = !0, o("saved"), r = setTimeout(() => t.sheet.dismiss(), ne);
123
129
  }
124
- const g = w(() => t.sheet.saving.value ? "processing" : f.value ? "done" : "idle");
125
- return (c, y) => (b(), F(oe, {
130
+ const m = w(() => t.sheet.saving.value ? "processing" : v.value ? "done" : "idle");
131
+ return (h, i) => (b(), V(oe, {
126
132
  ref_key: "modal",
127
- ref: d,
133
+ ref: c,
128
134
  size: t.size,
129
135
  grouped: "",
130
136
  title: t.title,
131
137
  subtitle: t.subtitle,
132
138
  "before-dismiss": t.sheet.beforeDismiss,
133
- "primary-label": t.editable ? x(i)("core.actions.save") : void 0,
134
- status: g.value,
135
- "processing-label": x(i)("core.actions.saving"),
136
- "done-label": x(i)("core.actions.saved"),
137
- onPrimary: v,
138
- onDismissed: y[0] || (y[0] = (u) => t.sheet.closed())
139
+ "primary-label": t.editable ? k(u)("core.actions.save") : void 0,
140
+ status: m.value,
141
+ "processing-label": k(u)("core.actions.saving"),
142
+ "done-label": k(u)("core.actions.saved"),
143
+ onPrimary: g,
144
+ onPresented: f,
145
+ onDismissed: i[0] || (i[0] = (x) => t.sheet.closed())
139
146
  }, {
140
- default: E(() => [
141
- $("div", {
147
+ default: z(() => [
148
+ D("div", {
142
149
  ref_key: "body",
143
- ref: m,
150
+ ref: d,
144
151
  class: "flex min-w-0 flex-col gap-group-gap"
145
152
  }, [
146
- t.sheet.notice.value ? (b(), F(q, {
153
+ t.sheet.notice.value ? (b(), V(q, {
147
154
  key: 0,
148
155
  tone: "warning",
149
156
  "data-test": "group-sheet-notice"
150
157
  }, {
151
- default: E(() => [
152
- $("p", pe, j(t.sheet.notice.value), 1)
158
+ default: z(() => [
159
+ D("p", be, j(t.sheet.notice.value), 1)
153
160
  ]),
154
161
  _: 1
155
162
  })) : C("", !0),
156
- t.sheet.foreignGroups.value.length ? (b(), F(q, {
163
+ t.sheet.foreignGroups.value.length ? (b(), V(q, {
157
164
  key: 1,
158
165
  tone: "warning",
159
166
  "data-test": "group-sheet-foreign"
160
167
  }, {
161
- default: E(() => [
162
- $("p", be, j(x(i)("core.form.group.foreign", { groups: t.sheet.foreignGroups.value.map(t.groupLabel).join(", ") })), 1)
168
+ default: z(() => [
169
+ D("p", ge, j(k(u)("core.form.group.foreign", { groups: t.sheet.foreignGroups.value.map(t.groupLabel).join(", ") })), 1)
163
170
  ]),
164
171
  _: 1
165
172
  })) : C("", !0),
166
173
  ae(re, {
167
174
  form: t.sheet.form,
168
175
  label: t.fieldLabel,
169
- scope: m.value
176
+ scope: d.value
170
177
  }, null, 8, ["form", "label", "scope"]),
171
- J(c.$slots, "default")
178
+ J(h.$slots, "default")
172
179
  ], 512)
173
180
  ]),
174
181
  _: 3
175
182
  }, 8, ["size", "title", "subtitle", "before-dismiss", "primary-label", "status", "processing-label", "done-label"]));
176
183
  }
177
- }), ge = ["data-group"], Ve = /* @__PURE__ */ L({
184
+ }), he = ["data-group"], Ve = /* @__PURE__ */ L({
178
185
  __name: "RecordGroupScope",
179
186
  props: {
180
187
  only: {},
@@ -182,43 +189,43 @@ const ve = ["id", "value", "name", "disabled", "aria-label", "aria-invalid", "ar
182
189
  },
183
190
  setup(l) {
184
191
  const a = l;
185
- return K(ie, { only: se(a, "only") }), K(ce, w(() => a.editable)), (t, o) => (b(), _("div", {
192
+ return A(ie, { only: se(a, "only") }), A(de, w(() => a.editable)), (t, o) => (b(), _("div", {
186
193
  class: "flex min-w-0 flex-col gap-group-gap",
187
194
  "data-test": "record-group-scope",
188
195
  "data-group": a.only
189
196
  }, [
190
197
  J(t.$slots, "default")
191
- ], 8, ge));
198
+ ], 8, he));
192
199
  }
193
200
  });
194
201
  function ze(l) {
195
202
  const { form: a } = l;
196
203
  if (l.rebase && !a.rebase) throw new Error("useGroupSheet: `rebase` needs a record form (useResourceForm), which can take the freshly read record as its base.");
197
- const t = () => typeof l.fields == "function" ? l.fields() : l.fields, o = () => P(l.restore) ?? t(), i = h(!1), d = h(!1), m = h([]), f = h(null), r = le({});
198
- let v = {};
199
- const g = (s) => Object.fromEntries(s.map((e) => [e, B(a.values[e])])), c = w(() => i.value && !U(g(o()), r.value)), { confirmDiscard: y } = fe(() => c.value);
200
- function u() {
201
- v = g(o()), r.value = B(v);
204
+ const t = () => typeof l.fields == "function" ? l.fields() : l.fields, o = () => K(l.restore) ?? t(), u = y(!1), c = y(!1), d = y([]), v = y(null), r = le({});
205
+ let f = {};
206
+ const g = (s) => Object.fromEntries(s.map((e) => [e, B(a.values[e])])), m = w(() => u.value && !U(g(o()), r.value)), { confirmDiscard: h } = ve(() => m.value);
207
+ function i() {
208
+ f = g(o()), r.value = B(f);
202
209
  }
203
- function k() {
204
- u(), m.value = [], f.value = null, a.dismissFailure(), i.value = !0;
210
+ function x() {
211
+ i(), d.value = [], v.value = null, a.dismissFailure(), u.value = !0;
205
212
  }
206
- function D() {
207
- if (i.value) {
208
- c.value && Object.assign(a.values, B(v));
213
+ function G() {
214
+ if (u.value) {
215
+ m.value && Object.assign(a.values, B(f));
209
216
  for (const s of t()) a.errors.clear(s);
210
- a.dismissFailure(), i.value = !1;
217
+ a.dismissFailure(), u.value = !1;
211
218
  }
212
219
  }
213
220
  function p(s) {
214
- const e = new Set(t()), n = P(l.group), M = /* @__PURE__ */ new Set();
221
+ const e = new Set(t()), n = K(l.group), M = /* @__PURE__ */ new Set();
215
222
  for (const W of Object.keys(s.all())) {
216
223
  const R = ue(W);
217
224
  if (e.has(R)) continue;
218
- const V = l.groupOf?.(R) ?? l.fallbackGroup;
219
- V && V !== n && M.add(V);
225
+ const F = l.groupOf?.(R) ?? l.fallbackGroup;
226
+ F && F !== n && M.add(F);
220
227
  }
221
- m.value = [...M];
228
+ d.value = [...M];
222
229
  }
223
230
  async function S(s) {
224
231
  const e = B(g(t().filter((n) => !U(a.values[n], r.value[n]))));
@@ -227,11 +234,11 @@ function ze(l) {
227
234
  } catch {
228
235
  return;
229
236
  }
230
- a.rebase?.() && (u(), Object.assign(a.values, e), f.value = s.message());
237
+ a.rebase?.() && (i(), Object.assign(a.values, e), v.value = s.message());
231
238
  }
232
- async function G() {
233
- if (d.value) return !1;
234
- d.value = !0, m.value = [], f.value = null;
239
+ async function E() {
240
+ if (c.value) return !1;
241
+ c.value = !0, d.value = [], v.value = null;
235
242
  try {
236
243
  const s = l.onSaved ? () => l.onSaved?.() : void 0;
237
244
  let e;
@@ -240,38 +247,38 @@ function ze(l) {
240
247
  else throw new Error("useGroupSheet: the form has no full-record save(), so give the sheet its own `save` for a dedicated endpoint.");
241
248
  switch (e.status) {
242
249
  case "saved":
243
- return u(), !0;
250
+ return i(), !0;
244
251
  case "saved-refresh-failed":
245
- return u(), de.warning(a.failure.value?.message ?? ""), !0;
252
+ return i(), fe.warning(a.failure.value?.message ?? ""), !0;
246
253
  case "aborted":
247
254
  return !1;
248
255
  case "failed":
249
256
  return e.failure.kind === "conflict" && l.rebase ? await S(l.rebase) : p(a.errors), !1;
250
257
  }
251
258
  } finally {
252
- d.value = !1;
259
+ c.value = !1;
253
260
  }
254
261
  }
255
262
  return {
256
- open: i,
257
- saving: d,
258
- dirty: c,
259
- foreignGroups: m,
260
- notice: f,
263
+ open: u,
264
+ saving: c,
265
+ dirty: m,
266
+ foreignGroups: d,
267
+ notice: v,
261
268
  failure: a.failure,
262
269
  form: a,
263
- present: k,
270
+ present: x,
264
271
  dismiss: () => {
265
- i.value = !1;
272
+ u.value = !1;
266
273
  },
267
- save: G,
268
- beforeDismiss: y,
269
- closed: D
274
+ save: E,
275
+ beforeDismiss: h,
276
+ closed: G
270
277
  };
271
278
  }
272
279
  export {
273
- Ge as _,
280
+ Fe as _,
274
281
  Ve as a,
275
- De as b,
282
+ Ee as b,
276
283
  ze as u
277
284
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wssto2/vue-core",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "goCore": "v1.19.0",
5
5
  "description": "Shared Vue 3 library for go-core applications: app shell, list / record / form pages and their controls.",
6
6
  "keywords": [