@wssto2/vue-core 0.4.28 → 0.5.1

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 (145) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js} +1 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
  4. package/dist/{Activity-BWkVX1Nx.js → Activity-dpY2kIs2.js} +7 -7
  5. package/dist/{Changes-MG77TDwz.js → Changes-CL8F1w8q.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js} +4 -4
  7. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
  8. package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-BZLyL5lR.js} +7 -7
  9. package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
  10. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
  11. package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
  12. package/dist/{General-UTBVEXbN.js → General-mrVzi-5R.js} +10 -10
  13. package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
  14. package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-B2DItwvf.js} +3 -3
  15. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
  16. package/dist/ProfilePage-EiTIYzZ5.js +764 -0
  17. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js +325 -0
  18. package/dist/RolePage-jMHAt9y8.js +314 -0
  19. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-B9GaVQBx.js} +6 -6
  20. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js} +1 -1
  21. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
  22. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
  23. package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
  24. package/dist/{Sessions-DWj2OGo0.js → Sessions-CHLokZ9e.js} +5 -5
  25. package/dist/SettingsPage-CudoKdXm.js +632 -0
  26. package/dist/{SignIn-COThB9XN.js → SignIn-ypRvdmjg.js} +7 -7
  27. package/dist/{SignInPage-CdzgSvRm.js → SignInPage-CbPeKlAo.js} +4 -4
  28. package/dist/SignIns-BApzbGq-.js +121 -0
  29. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
  30. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
  31. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
  33. package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BCTaBajE.js} +13 -13
  34. package/dist/{UsersList-Chq8yM5C.js → UsersList-CqSK3cQL.js} +9 -9
  35. package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
  36. package/dist/access/RoleEditor.vue.d.ts +2 -0
  37. package/dist/access/constraints.d.ts +28 -0
  38. package/dist/access/context.d.ts +5 -0
  39. package/dist/access/feature.d.ts +17 -0
  40. package/dist/access/index.d.ts +3 -1
  41. package/dist/access/index.js +11 -9
  42. package/dist/access/refusals.d.ts +20 -2
  43. package/dist/app/index.js +118 -116
  44. package/dist/app/keepAlive.d.ts +4 -8
  45. package/dist/client/index.js +19 -11
  46. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  47. package/dist/collection/index.js +3 -3
  48. package/dist/content/index.js +66 -37
  49. package/dist/{contributions-BVBZP5Jb.js → contributions-fx5q5n1u.js} +1 -1
  50. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  51. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  52. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  53. package/dist/form/index.js +1235 -1412
  54. package/dist/{guards-BJZjc3FZ.js → guards-D4mXf_2X.js} +1 -1
  55. package/dist/{http-BFfkA7gN.js → http-CdQowFlW.js} +1 -1
  56. package/dist/i18n/index.d.ts +2 -2
  57. package/dist/i18n/index.js +30 -30
  58. package/dist/identity/index.d.ts +3 -1
  59. package/dist/identity/index.js +7 -6
  60. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  61. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  62. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  63. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  64. package/dist/identity/profile/profileSections.d.ts +37 -0
  65. package/dist/identity/session.d.ts +10 -7
  66. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  67. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  68. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  69. package/dist/identity/users/context.d.ts +3 -0
  70. package/dist/identity/users/feature.d.ts +3 -0
  71. package/dist/index-BTRv8mcf.js +630 -0
  72. package/dist/index-VPzJJN6Z.js +745 -0
  73. package/dist/index-auJqVMWC.js +478 -0
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/keepAlive-z3IRFkQq.js +46 -0
  77. package/dist/modules/notification/entities.d.ts +19 -0
  78. package/dist/modules/notification/routes.d.ts +25 -1
  79. package/dist/modules/notification/schemas.d.ts +24 -0
  80. package/dist/{navigation-DpcDF0rX.js → navigation-Bc5EQ_Si.js} +1 -1
  81. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-Bv6vnWlW.js} +22 -22
  82. package/dist/notifications/context.d.ts +24 -1
  83. package/dist/notifications/feature.d.ts +10 -1
  84. package/dist/notifications/index.d.ts +1 -1
  85. package/dist/notifications/index.js +1 -1
  86. package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
  87. package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
  88. package/dist/notifications/push/browser.d.ts +40 -0
  89. package/dist/notifications/push/devices.d.ts +15 -0
  90. package/dist/notifications/push/thisDevice.d.ts +28 -0
  91. package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
  92. package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
  93. package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
  94. package/dist/notifications/settings/settings.d.ts +4 -3
  95. package/dist/notifications/settings/state.d.ts +4 -2
  96. package/dist/options-g8RwEhBk.js +366 -0
  97. package/dist/overlay/index.js +37 -59
  98. package/dist/page/index.js +1 -1
  99. package/dist/phone/index.js +10 -11
  100. package/dist/platform/index.js +3 -3
  101. package/dist/platform/platform.d.ts +7 -2
  102. package/dist/platform/session.d.ts +17 -0
  103. package/dist/platform-Dx6STiwY.js +283 -0
  104. package/dist/push-worker/index.d.ts +91 -0
  105. package/dist/push-worker/index.js +54 -0
  106. package/dist/resource/index.js +1 -1
  107. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  108. package/dist/router/index.js +3 -3
  109. package/dist/{sections-CeZl-Jxg.js → sections-B0HxIOC2.js} +1 -1
  110. package/dist/shell/index.js +3 -3
  111. package/dist/signInEvents-DWShrJox.js +30 -0
  112. package/dist/state/index.js +1 -1
  113. package/dist/{status-dGvfh1TP.js → status-BUFELJz2.js} +2 -2
  114. package/dist/styles.css +1 -1
  115. package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
  116. package/dist/testing/index.js +1 -1
  117. package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
  118. package/dist/useGroupSheet-ATvc0IiM.js +278 -0
  119. package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
  120. package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
  121. package/package.json +6 -2
  122. package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
  123. package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
  124. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
  125. package/dist/ProfilePage-C8VhiKIh.js +0 -654
  126. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
  127. package/dist/RolePage-ODFu68Ce.js +0 -315
  128. package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
  129. package/dist/SettingsPage-C3fPSmi7.js +0 -255
  130. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
  131. package/dist/SignIns-cztICmqt.js +0 -66
  132. package/dist/control-B4SdblL6.js +0 -350
  133. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  134. package/dist/index-BhtJR4c_.js +0 -459
  135. package/dist/index-C3E6DcO0.js +0 -706
  136. package/dist/index-sTBBHqNG.js +0 -504
  137. package/dist/keepAlive-CDvMQlcJ.js +0 -49
  138. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  139. package/dist/options-Ba_0uLWN.js +0 -18
  140. package/dist/platform-PZpUkkMS.js +0 -268
  141. package/dist/route-goWMxDUN.js +0 -13
  142. package/dist/transport-BnP7WC0Y.js +0 -4
  143. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  144. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  145. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -0,0 +1,121 @@
1
+ import { defineComponent as y, computed as k, openBlock as _, createElementBlock as b, createVNode as r, unref as t, withCtx as l, createElementVNode as u, toDisplayString as d, createTextVNode as $, ref as v, watch as w, createBlock as I, createCommentVNode as S } from "vue";
2
+ import { useI18n as h } from "vue-i18n";
3
+ import { P as V, i as N } from "./index-auJqVMWC.js";
4
+ import { u as B } from "./platform-Dx6STiwY.js";
5
+ import { b as E } from "./routeResource-CcYA75T2.js";
6
+ import { _ as R } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
7
+ import { u as C } from "./useLoad-W4tfxmm5.js";
8
+ import { _ as P } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
9
+ import { _ as L } from "./SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js";
10
+ import { _ as T } from "./DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js";
11
+ import { _ as U } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
12
+ import { d as q, s as D, a as G } from "./signInEvents-DWShrJox.js";
13
+ import { _ as K } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js";
14
+ const O = {
15
+ class: "overflow-hidden rounded-group bg-surface-cell shadow-group",
16
+ "data-signin-table": ""
17
+ }, W = ["title"], j = { class: "font-mono text-footnote" }, z = {
18
+ class: "px-4 py-8 text-center text-body text-content-muted",
19
+ "data-signin-empty": ""
20
+ }, A = /* @__PURE__ */ y({
21
+ __name: "SignInTable",
22
+ props: {
23
+ rows: {},
24
+ loading: { type: Boolean }
25
+ },
26
+ setup(f) {
27
+ const m = f, { t: o } = h(), p = k(() => [
28
+ { key: "created_at", label: o("core.account.signins.columns.time"), kind: "timestamp", width: 170, mobile: "meta" },
29
+ { key: "event", label: o("core.account.signins.columns.event"), mobile: "primary" },
30
+ { key: "device", label: o("core.account.signins.columns.device"), hideBelow: "md", width: 320, mobile: "hidden" },
31
+ { key: "ip", label: o("core.account.signins.columns.ip"), hideBelow: "md", width: 140, mobile: "hidden" }
32
+ ]), c = (n) => o(G(n.event, n.actor?.name || null), { name: n.actor?.name ?? "" });
33
+ return (n, i) => (_(), b("div", O, [
34
+ r(t(T), {
35
+ rows: m.rows,
36
+ columns: p.value,
37
+ "row-key": (e) => e.id,
38
+ loading: m.loading
39
+ }, {
40
+ "cell-event": l(({ item: e }) => [
41
+ r(t(U), {
42
+ tone: t(D)(e.event).tone,
43
+ "data-event": e.event
44
+ }, {
45
+ default: l(() => [
46
+ $(d(c(e)), 1)
47
+ ]),
48
+ _: 2
49
+ }, 1032, ["tone", "data-event"])
50
+ ]),
51
+ "cell-device": l(({ item: e }) => [
52
+ u("span", {
53
+ class: "block truncate",
54
+ title: e.device
55
+ }, d(t(q)(e.device) || "—"), 9, W)
56
+ ]),
57
+ "cell-ip": l(({ item: e }) => [
58
+ u("span", j, d(e.ip || "—"), 1)
59
+ ]),
60
+ empty: l(() => [
61
+ u("p", z, d(t(o)("core.account.signins.empty")), 1)
62
+ ]),
63
+ _: 1
64
+ }, 8, ["rows", "columns", "row-key", "loading"])
65
+ ]));
66
+ }
67
+ }), F = {
68
+ class: "flex min-w-0 flex-col gap-group-gap",
69
+ "data-person-signins": ""
70
+ }, H = { class: "px-row-inset text-footnote text-content-muted" }, le = /* @__PURE__ */ y({
71
+ __name: "SignIns",
72
+ setup(f) {
73
+ const m = ["all", "failed"], { t: o } = h(), { http: p } = B(), c = E(V), n = v("all"), i = v(1), e = C(
74
+ async ({ signal: g }) => {
75
+ const s = c.id.value;
76
+ return s === null ? null : (await p.request(N.usersSignins, { id: s, view: n.value, page: i.value, per_page: 20 }, { signal: g })).data;
77
+ },
78
+ { watch: () => c.id.value }
79
+ );
80
+ return w(n, () => {
81
+ i.value = 1, e.reload();
82
+ }), w(i, () => void e.reload()), (g, s) => (_(), b("div", F, [
83
+ r(L, {
84
+ title: t(o)("core.users.sections.signins"),
85
+ description: t(o)("core.users.intro.signins", { name: t(c).data.value?.name ?? "" })
86
+ }, null, 8, ["title", "description"]),
87
+ r(K, {
88
+ modelValue: n.value,
89
+ "onUpdate:modelValue": s[0] || (s[0] = (a) => n.value = a),
90
+ views: m,
91
+ counts: t(e).data.value?.meta?.views,
92
+ "label-of": (a) => t(o)(`core.account.signins.views.${a}`),
93
+ label: t(o)("core.users.sections.signins")
94
+ }, null, 8, ["modelValue", "counts", "label-of", "label"]),
95
+ r(t(R), {
96
+ state: t(e).state.value,
97
+ "skeleton-rows": 5,
98
+ "is-empty": () => !1,
99
+ onRetry: s[2] || (s[2] = (a) => t(e).reload())
100
+ }, {
101
+ default: l(({ value: a }) => [
102
+ r(A, {
103
+ rows: a?.data ?? []
104
+ }, null, 8, ["rows"]),
105
+ a ? (_(), I(P, {
106
+ key: 0,
107
+ page: i.value,
108
+ "onUpdate:page": s[1] || (s[1] = (x) => i.value = x),
109
+ "last-page": a.last_page,
110
+ total: a.total
111
+ }, null, 8, ["page", "last-page", "total"])) : S("", !0),
112
+ u("p", H, d(t(o)("core.account.signins.footer_user")), 1)
113
+ ]),
114
+ _: 1
115
+ }, 8, ["state"])
116
+ ]));
117
+ }
118
+ });
119
+ export {
120
+ le as default
121
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as v, useModel as w, computed as y, openBlock as g, createBlock as k, mergeProps as _, unref as t, createSlots as $, withCtx as l, createElementVNode as s, renderSlot as i, normalizeClass as d, normalizeStyle as B, toDisplayString as S, mergeModels as z, mergeDefaults as C } from "vue";
2
2
  import { useI18n as M } from "vue-i18n";
3
- import { u as V, _ as D, f as T, b as E } from "./control-B4SdblL6.js";
3
+ import { u as V, _ as D, f as T, b as E } from "./options-g8RwEhBk.js";
4
4
  const F = { class: "flex items-center gap-2" }, I = ["id", "aria-checked", "aria-label", "aria-describedby", "aria-invalid", "disabled"], P = { class: "sr-only" }, Z = /* @__PURE__ */ v({
5
5
  __name: "SwitchField",
6
6
  props: /* @__PURE__ */ z(/* @__PURE__ */ C({
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as K, useTemplateRef as N, computed as v, watch as te, nextTick as oe, openBlock as n, createElementBlock as l, withModifiers as se, normalizeStyle as ne, unref as i, createElementVNode as m, toDisplayString as r, createCommentVNode as p, Fragment as R, renderList as ae, normalizeClass as B, createBlock as P, renderSlot as b, createTextVNode as E, useModel as ie, ref as le, mergeProps as re, createSlots as ce, withCtx as w, withDirectives as de, vModelDynamic as ue, mergeModels as H, mergeDefaults as pe } from "vue";
2
2
  import { useI18n as G } from "vue-i18n";
3
3
  import { b as me } from "./controlSurface-t7OEFESJ.js";
4
- import { a as fe, c as he, _ as ve, f as ge, b as ye } from "./control-B4SdblL6.js";
4
+ import { a as fe, c as he, _ as ve, f as ge, b as ye } from "./options-g8RwEhBk.js";
5
5
  import { _ as xe } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
6
  import { u as be, N as ke } from "./anchored-DpuUwf-9.js";
7
- import { l as U, m as _e, u as we, c as $e } from "./suggestions-DHJFKB26.js";
7
+ import { l as U, m as _e, u as we, c as $e } from "./suggestions-CfFTHi8y.js";
8
8
  const Me = ["id", "aria-busy"], qe = { class: "min-h-0 flex-1 overflow-y-auto p-1.5" }, Be = {
9
9
  key: 0,
10
10
  class: "px-2.5 pb-1 pt-1.5 text-caption font-semibold uppercase text-content-disabled",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as V, useModel as L, useTemplateRef as M, computed as i, openBlock as p, createBlock as D, mergeProps as F, unref as f, createSlots as S, withCtx as n, createElementVNode as v, normalizeClass as b, withDirectives as z, vModelText as E, createElementBlock as P, toDisplayString as R, createCommentVNode as N, renderSlot as d, mergeModels as y, mergeDefaults as _ } from "vue";
2
2
  import { u as j } from "./mediaQuery-CygcXmFW.js";
3
- import { a as G, u as H, c as U, _ as A, f as I, b as J } from "./control-B4SdblL6.js";
3
+ import { a as G, u as H, c as U, _ as A, f as I, b as J } from "./options-g8RwEhBk.js";
4
4
  const K = ["id", "name", "rows", "placeholder", "maxlength", "autocomplete", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], O = {
5
5
  key: 0,
6
6
  class: "mt-1 self-end text-footnote tabular-nums text-content-muted"
@@ -5,7 +5,7 @@ import { u as oe } from "./format-D8X4zsx6.js";
5
5
  import { _ as le } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
6
  import { u as ae } from "./mediaQuery-CygcXmFW.js";
7
7
  import { _ as re } from "./Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
8
- import { c as se, _ as ie, f as ne, b as ue } from "./control-B4SdblL6.js";
8
+ import { c as se, _ as ie, f as ne, b as ue } from "./options-g8RwEhBk.js";
9
9
  import { d as me, r as de, t as I, p as ce, u as pe, a as fe, i as Q, _ as ve, b as be, c as ye } from "./useTypedEntry-C7k7Dyl-.js";
10
10
  function ke(s) {
11
11
  const { t: i } = R(), y = m(() => [i("core.form.time.words.now").toLowerCase(), "now"]);
@@ -1,25 +1,25 @@
1
1
  import { defineComponent as R, openBlock as q, createBlock as P, unref as e, withCtx as u, createVNode as t, mergeProps as L, provide as N, computed as g, useTemplateRef as $, createElementVNode as x, toDisplayString as C, createTextVNode as j } from "vue";
2
2
  import { useI18n as A } from "vue-i18n";
3
- import { a as F } from "./neighbors-RVQ4O3Qv.js";
3
+ import { a as F } from "./neighbors-Bv6vnWlW.js";
4
4
  import { _ as H } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
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-BhtJR4c_.js";
5
+ import { u as J } from "./describeError-BqGAUZgX.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-auJqVMWC.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
- import { _ as ae } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js";
10
- import { u as E } from "./platform-PZpUkkMS.js";
11
- import { a as te } from "./routeResource-DlTsGTg_.js";
9
+ import { _ as ae } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js";
10
+ import { u as E } from "./platform-Dx6STiwY.js";
11
+ import { a as te } from "./routeResource-CcYA75T2.js";
12
12
  import { a as oe } from "./ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js";
13
13
  import { A as re } from "./access-DmAceEo5.js";
14
14
  import { _ as ne } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
15
- import { u as ie } from "./useLoad-M7V-AVwR.js";
15
+ import { u as ie } from "./useLoad-W4tfxmm5.js";
16
16
  import { _ as V } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
17
- import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
18
- import { e as B } from "./control-B4SdblL6.js";
19
- import { u as z, _ as K } from "./useCommand-Cj-APj-P.js";
20
- import { u as U } from "./fieldMessages-6HVzSDqG.js";
21
- import { u as ce, s as le } from "./status-dGvfh1TP.js";
22
- import { _ as M } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
17
+ import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
18
+ import { g as B } from "./options-g8RwEhBk.js";
19
+ import { u as z, _ as K } from "./useCommand-CtqheKUv.js";
20
+ import { u as U } from "./fieldMessages-DTXpWnBd.js";
21
+ import { u as ce, s as le } from "./status-BUFELJz2.js";
22
+ import { _ as M } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
23
23
  const ue = /* @__PURE__ */ R({
24
24
  __name: "DeactivateDialog",
25
25
  props: {
@@ -1,21 +1,21 @@
1
1
  import { defineComponent as U, openBlock as p, createBlock as C, unref as e, withCtx as c, createVNode as r, mergeProps as i, useTemplateRef as V, computed as q, createTextVNode as z, toDisplayString as $, createCommentVNode as A, createElementBlock as S, normalizeClass as N } from "vue";
2
2
  import { useI18n as B } from "vue-i18n";
3
3
  import { useRouter as M } from "vue-router";
4
- import { u as P, _ as D } from "./CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js";
4
+ import { u as P, _ as D } from "./CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js";
5
5
  import { _ as I } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
6
6
  import { u as F } from "./format-D8X4zsx6.js";
7
- import { u as L } from "./platform-PZpUkkMS.js";
7
+ import { u as L } from "./platform-Dx6STiwY.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-BhtJR4c_.js";
10
- import { U as j, u as H, s as J } from "./status-dGvfh1TP.js";
9
+ import { i as K, f as E, M as W } from "./index-auJqVMWC.js";
10
+ import { U as j, u as H, s as J } from "./status-BUFELJz2.js";
11
11
  import { u as O } from "./environment-Dva-SG8D.js";
12
12
  import { u as Q } from "./languages-BShG9LpE.js";
13
- import { _ as X } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
14
- import { _ as Y } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
15
- import { _ as d } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
16
- import { u as Z, _ as ee } from "./useCommand-Cj-APj-P.js";
13
+ import { _ as X } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
14
+ import { _ as Y } from "./SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js";
15
+ import { _ as d } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
16
+ import { u as Z, _ as ee } from "./useCommand-CtqheKUv.js";
17
17
  import { t as se } from "./toast-CqSDTWRX.js";
18
- import { u as te } from "./fieldMessages-6HVzSDqG.js";
18
+ import { u as te } from "./fieldMessages-DTXpWnBd.js";
19
19
  const oe = /* @__PURE__ */ U({
20
20
  __name: "NewUserDialog",
21
21
  emits: ["created"],
@@ -1,6 +1,6 @@
1
1
  import type { Role, RoleSummary } from "../modules/access/entities";
2
2
  /**
3
- * *Compare with a predefined role*: what a custom role holds that the other does not, what it lacks, and where the whose
3
+ * *Compare with another role* (any the actor may view, the standard ones too): what a custom role holds that the other does not, what it lacks, and where the whose
4
4
  * differs. The way to see how far a copy has drifted before replacing it.
5
5
  */
6
6
  type __VLS_Props = {
@@ -15,6 +15,8 @@ interface Draft {
15
15
  name: string;
16
16
  description: string;
17
17
  grants: Grants;
18
+ /** The choice of each of the application's constraints on the role, "" for none. */
19
+ constraints: Record<string, string>;
18
20
  }
19
21
  declare function save(): Promise<void>;
20
22
  declare const _default: import("vue").DefineComponent<__VLS_Props, {
@@ -0,0 +1,28 @@
1
+ import type { Constraint } from "../modules/access/entities";
2
+ /** One option of a role constraint. */
3
+ export interface RoleConstraintOption {
4
+ /** What is stored in the role's `attrs` for it. */
5
+ readonly value: string;
6
+ /** i18n key of its label. */
7
+ readonly labelKey: string;
8
+ }
9
+ /**
10
+ * A constraint the application puts on a role (go-core's `attrs`: attribute key -> values), edited as one choice among `options`
11
+ * (the vehicle kinds a role may work with: new only, used only) or none, which leaves the key out of `attrs` ("allows all").
12
+ */
13
+ export interface RoleConstraint {
14
+ /** The attribute key the permissions declare (`authz.Attributes("vehicle_kind")`). */
15
+ readonly attribute: string;
16
+ /** i18n key of the field's label. */
17
+ readonly labelKey: string;
18
+ readonly options: readonly RoleConstraintOption[];
19
+ /** i18n key of the choice for no constraint; by default `core.access.constraints.any` ("All"). */
20
+ readonly anyLabelKey?: string;
21
+ }
22
+ /** The chosen option of each constraint, "" for none; a stored value list that is not exactly one value reads as none. */
23
+ export declare function constraintChoices(constraints: readonly RoleConstraint[], attrs: readonly Constraint[]): Record<string, string>;
24
+ /**
25
+ * The `attrs` to save: what the role holds for attributes this editor does not manage stays as it is, and so does a managed one
26
+ * the person left alone (a stored list the choice cannot show is not lost by saving something else); a changed choice replaces it.
27
+ */
28
+ export declare function constraintAttrs(constraints: readonly RoleConstraint[], stored: readonly Constraint[], loaded: Record<string, string>, chosen: Record<string, string>): Constraint[];
@@ -1,12 +1,17 @@
1
1
  import type { RouteLocationRaw } from "vue-router";
2
2
  import type { ScopeOptions, SubjectRef } from "../modules/access/entities";
3
3
  import type { PermissionCatalogue } from "./catalogue";
4
+ import type { RoleConstraint } from "./constraints";
4
5
  /** What the access screens need from the feature that installed them. */
5
6
  export interface AccessContext {
6
7
  readonly catalogue: PermissionCatalogue;
7
8
  /** Where a holder's name leads (their record), or null for a name that is not a link. */
8
9
  readonly subjectRoute: (subject: SubjectRef) => RouteLocationRaw | null;
9
10
  /** The places `subject` may be given roles at; by default what the server says (`GET /v1/iam/users/:id/scopes`). */
11
+ /** The application's constraints on a role, edited next to its name and kept in its `attrs`. */
12
+ readonly constraints: readonly RoleConstraint[];
13
+ /** The i18n key of the sentence for each of the application's own role-problem codes (`authz.invalid`). */
14
+ readonly problems: Readonly<Record<string, string>>;
10
15
  readonly scopes: ((subject: SubjectRef, signal: AbortSignal) => Promise<ScopeOptions>) | null;
11
16
  }
12
17
  export declare const accessContextKey: import("vue").InjectionKey<AccessContext>, useAccessContext: () => AccessContext;
@@ -3,6 +3,7 @@ import { type Feature } from "../app";
3
3
  import type { ScopeOptions, SubjectRef } from "../modules/access/entities";
4
4
  import type { Destination } from "../router";
5
5
  import type { PermissionCatalogue } from "./catalogue";
6
+ import type { RoleConstraint } from "./constraints";
6
7
  export interface AccessFeatureOptions {
7
8
  /**
8
9
  * The application's permissions: the `permissions` object go-core's `authzts` writes (`frontend/generated/permissions.ts`).
@@ -13,6 +14,22 @@ export interface AccessFeatureOptions {
13
14
  subjectRoute?: (subject: SubjectRef) => RouteLocationRaw | null;
14
15
  /** The places a person may be given roles at. Default: what the server says (`GET /v1/iam/users/:id/scopes`). */
15
16
  scopes?: (subject: SubjectRef, signal: AbortSignal) => Promise<ScopeOptions>;
17
+ /**
18
+ * Constraints the application puts on a role, kept in the role's `attrs` (go-core: attribute key -> values). Each is a field in the role
19
+ * editor and on the role page, one choice among its options or none (no key in `attrs`: allows all). The attribute keys are the ones
20
+ * the permissions declare, or the server refuses the role (`unknown_attribute`). Attributes not listed here are kept as the role has them.
21
+ *
22
+ * accessFeature({ catalogue, roleConstraints: [{ attribute: "vehicle_kind", labelKey: "roles.vehicle_kind", options: [{ value: "new", labelKey: "roles.kind.new" }, { value: "used", labelKey: "roles.kind.used" }] }] })
23
+ */
24
+ roleConstraints?: readonly RoleConstraint[];
25
+ /**
26
+ * The sentence for each problem code the application's own role check reports (`access.WithRoleCheck`), as an i18n key; a text may use
27
+ * `{permission}` (the permission's label, when the problem has one) and `{detail}`. Built-in codes have library texts (`core.access.problems.<code>`);
28
+ * a key here rewords one. A refused role (`authz.invalid`) shows one sentence per problem.
29
+ *
30
+ * accessFeature({ catalogue, problems: { vehicle_kind_conflict: "roles.problems.vehicle_kind_conflict" } })
31
+ */
32
+ problems?: Readonly<Record<string, string>>;
16
33
  /** The backend's navigation destination that opens the roles list. Without it the application links to `accessPages.roles` itself. */
17
34
  destination?: Destination;
18
35
  }
@@ -7,7 +7,9 @@ export { accessPages, personRolesSection } from "./routes";
7
7
  export { accessPermissions } from "./context";
8
8
  export { dependantsClosure, permissionTree, requiredClosure } from "./catalogue";
9
9
  export type { Grants, PermissionCatalogue, PermissionEntry, PermissionGroup, PermissionMeta, PermissionScreen } from "./catalogue";
10
+ export type { RoleConstraint, RoleConstraintOption } from "./constraints";
10
11
  export { useAccessLabels } from "./labels";
11
- export { useRefusalMessage } from "./refusals";
12
+ export { roleProblems, useDescribeRefusal, useRefusalMessage } from "./refusals";
13
+ export type { RoleProblem } from "./refusals";
12
14
  export { default as PersonAccess } from "./PersonAccess.vue";
13
15
  export { default as BindingRow } from "./BindingRow.vue";
@@ -1,15 +1,17 @@
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-C3E6DcO0.js";
1
+ import { _ as a, j as c, k as r, c as o, b as u, l as i, m as n, p as l, n as t, q as m, t as p, u as R, i as b, f as d } from "../index-VPzJJN6Z.js";
2
2
  export {
3
3
  a as BindingRow,
4
4
  c as PersonAccess,
5
- o as accessFeature,
6
- r as accessPages,
7
- n as accessPermissions,
5
+ r as accessFeature,
6
+ o as accessPages,
7
+ u as accessPermissions,
8
8
  i as accessRoutes,
9
- u as dependantsClosure,
9
+ n as dependantsClosure,
10
10
  l as permissionTree,
11
- p as personRolesSection,
12
- t as requiredClosure,
13
- d as useAccessLabels,
14
- m as useRefusalMessage
11
+ t as personRolesSection,
12
+ m as requiredClosure,
13
+ p as roleProblems,
14
+ R as useAccessLabels,
15
+ b as useDescribeRefusal,
16
+ d as useRefusalMessage
15
17
  };
@@ -1,6 +1,24 @@
1
+ import { type DescribeError } from "../i18n";
2
+ /** One thing wrong with a role or a binding, as go-core's `authz.invalid` carries it (`params.problems`): `{code, permission?, detail?}`. */
3
+ export interface RoleProblem {
4
+ readonly code: string;
5
+ readonly permission?: string;
6
+ readonly detail?: string;
7
+ }
8
+ /** The problems of an `authz.invalid` refusal, in the server's order (by code, then permission); empty for any other error. */
9
+ export declare function roleProblems(error: unknown): readonly RoleProblem[];
10
+ /**
11
+ * The sentence for a failed request on the access screens: `describeError`, except that a role the server refused as invalid
12
+ * (`authz.invalid`) says every problem, one sentence each. A problem's text is the application's (`accessFeature({ problems: { <code>: "<i18n key>" } })`,
13
+ * for its own codes or to reword a built-in one), then the library's `core.access.problems.<code>`, then a general sentence with the code.
14
+ * `{permission}` in a text is the permission's label (its id outside the access screens), `{detail}` the server's detail.
15
+ * Call it in `setup`.
16
+ */
17
+ export declare function useDescribeRefusal(): DescribeError;
1
18
  /**
2
19
  * For a form's `failureMessage`: a refusal of go-core's delegation rules (`authz.escalation`, `self_assignment`, `last_admin`,
3
- * `role_in_use`, ...) says which rule it was, in the app's language (`core.errors.authz.*`, overridable with `errors.authz.*`);
4
- * any other failure keeps the form's own sentence for its kind. Call it in `setup`.
20
+ * `role_in_use`, ...) says which rule it was, in the app's language (`core.errors.authz.*`, overridable with `errors.authz.*`),
21
+ * and a role refused as invalid says its problems (see `useDescribeRefusal`); any other failure keeps the form's own sentence for
22
+ * its kind. Call it in `setup`.
5
23
  */
6
24
  export declare function useRefusalMessage(): (kind: unknown, error: unknown) => string | undefined;