@wssto2/vue-core 0.4.27 → 0.5.0

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 (144) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.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-xtkZq4vG.js → Activity-CoGI2_GL.js} +7 -7
  5. package/dist/{Changes-BPB8h56i.js → Changes-Cwfe6wbX.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CVEYkb26.js → CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js} +5 -5
  7. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DcQQ-uQS.js → DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js} +1 -1
  8. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
  9. package/dist/{DeadLetters-DeYxkTMh.js → DeadLetters-DyA5Dqn0.js} +7 -7
  10. 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
  11. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
  12. package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
  13. package/dist/{General-BLbn4BCc.js → General-DTEfxWls.js} +10 -10
  14. package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
  15. package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-CRZoUajV.js} +3 -3
  16. 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
  17. package/dist/ProfilePage-DLY81mvN.js +764 -0
  18. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js +325 -0
  19. package/dist/RolePage-B9t586Q8.js +314 -0
  20. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-BRdG-OSL.js} +6 -6
  21. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js} +1 -1
  22. 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
  23. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
  24. package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
  25. package/dist/{Sessions-wEdUsK-U.js → Sessions-vGyUOnPG.js} +5 -5
  26. package/dist/SettingsPage-V8WeADZZ.js +632 -0
  27. package/dist/{SignIn-CK9rq8LQ.js → SignIn-C-3i8RG6.js} +7 -7
  28. package/dist/{SignInPage-BORsM1g4.js → SignInPage-D2NA3VKU.js} +4 -4
  29. package/dist/SignIns-eoYPB6kB.js +121 -0
  30. 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
  31. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
  32. 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
  33. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
  34. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-CutyQkJb.js +52 -0
  35. package/dist/{UserRecord-C1SzdpKu.js → UserRecord-BaQl2zzQ.js} +13 -13
  36. package/dist/{UsersList-B3hc683r.js → UsersList-BfXWgH5K.js} +9 -9
  37. package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
  38. package/dist/access/RoleEditor.vue.d.ts +2 -0
  39. package/dist/access/constraints.d.ts +28 -0
  40. package/dist/access/context.d.ts +5 -0
  41. package/dist/access/feature.d.ts +17 -0
  42. package/dist/access/index.d.ts +3 -1
  43. package/dist/access/index.js +11 -9
  44. package/dist/access/refusals.d.ts +20 -2
  45. package/dist/app/index.js +6 -6
  46. package/dist/client/index.js +19 -11
  47. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  48. package/dist/collection/index.js +5 -5
  49. package/dist/content/Timestamp.vue.d.ts +3 -2
  50. package/dist/content/index.js +66 -37
  51. package/dist/{contributions-BVBZP5Jb.js → contributions-DVQPcjJz.js} +1 -1
  52. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  53. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  54. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  55. package/dist/form/index.js +1235 -1412
  56. package/dist/{guards-BJZjc3FZ.js → guards-DRh4zmxO.js} +1 -1
  57. package/dist/{http-BFfkA7gN.js → http-D_pBg22D.js} +1 -1
  58. package/dist/i18n/index.d.ts +2 -2
  59. package/dist/i18n/index.js +30 -30
  60. package/dist/identity/index.d.ts +2 -0
  61. package/dist/identity/index.js +8 -6
  62. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  63. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  64. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  65. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  66. package/dist/identity/profile/profileSections.d.ts +37 -0
  67. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  68. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  69. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  70. package/dist/identity/users/context.d.ts +3 -0
  71. package/dist/identity/users/feature.d.ts +3 -0
  72. package/dist/index-WkbzC_ee.js +745 -0
  73. package/dist/index-g-qbUeTk.js +630 -0
  74. package/dist/index-kqk7Mclb.js +480 -0
  75. package/dist/index.d.ts +1 -1
  76. package/dist/index.js +1 -1
  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-DuQwti76.js} +1 -1
  81. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-IMRQ4rkm.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/MenuButton.vue.d.ts +3 -2
  98. package/dist/overlay/index.js +37 -59
  99. package/dist/page/index.js +1 -1
  100. package/dist/phone/index.js +10 -11
  101. package/dist/platform/index.js +3 -3
  102. package/dist/{platform-PZpUkkMS.js → platform-Dl1fbScN.js} +2 -2
  103. package/dist/push-worker/index.d.ts +91 -0
  104. package/dist/push-worker/index.js +54 -0
  105. package/dist/resource/index.js +1 -1
  106. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  107. package/dist/router/index.js +3 -3
  108. package/dist/{rowLayout-Dh749umr.js → rowLayout-BBFyLbOl.js} +1 -1
  109. package/dist/{sections-CeZl-Jxg.js → sections-D5rgQ4YB.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-D9iQJJiz.js → status-C2gHqkj6.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-CQYHj9Ns.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-BVrMihx0.js +0 -255
  130. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-AakWNvaM.js +0 -79
  131. package/dist/SignIns-C-8kVf7I.js +0 -66
  132. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-DRmzPDOP.js +0 -51
  133. package/dist/control-B4SdblL6.js +0 -350
  134. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  135. package/dist/index-C3E6DcO0.js +0 -706
  136. package/dist/index-LP6NNnow.js +0 -459
  137. package/dist/index-qUaGJ9j2.js +0 -504
  138. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  139. package/dist/options-Ba_0uLWN.js +0 -18
  140. package/dist/route-goWMxDUN.js +0 -13
  141. package/dist/transport-BnP7WC0Y.js +0 -4
  142. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  143. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  144. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -1,300 +0,0 @@
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
- import { useI18n as Q } from "vue-i18n";
3
- import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
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-BUrYkjmF.js";
6
- import { _ as te } from "./TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js";
7
- import { _ as se } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
8
- import { u as ae } from "./useSaveChrome-7huA3FzR.js";
9
- import { t as oe } from "./toast-CqSDTWRX.js";
10
- import { _ as S } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
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-C3E6DcO0.js";
13
- import { _ as me } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
14
- import { _ as fe } from "./Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js";
15
- import { _ as pe } from "./SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js";
16
- import { _ as _e } from "./SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js";
17
- import { u as ge } from "./platform-PZpUkkMS.js";
18
- const ve = {
19
- class: "flex min-w-0 flex-col gap-4 lg:grid lg:grid-cols-[15rem_minmax(0,1fr)] lg:items-start lg:gap-8",
20
- "data-test": "permission-tree"
21
- }, be = ["aria-label"], he = ["data-test", "aria-current", "onClick"], ye = { class: "min-w-0 flex-1 truncate" }, ke = ["data-test"], xe = ["data-test"], we = { class: "flex min-w-0 items-center justify-between gap-3 px-row-inset" }, $e = { class: "min-w-0 flex-1 text-title3 font-semibold text-content-strong" }, Oe = { class: "text-footnote tabular-nums text-content-muted" }, Le = {
22
- key: 0,
23
- class: "contents",
24
- "data-test": "tree-toggle-all"
25
- }, Ve = /* @__PURE__ */ I({
26
- __name: "PermissionTree",
27
- props: {
28
- grants: {},
29
- readonly: { type: Boolean }
30
- },
31
- setup(U) {
32
- const i = U, { t: g } = Q(), { catalogue: a } = G(), m = J(), r = h(() => ne(a)), b = M(r.value[0]?.key ?? ""), f = h(() => r.value.find((e) => e.key === b.value) ?? r.value[0]), j = (e) => Object.entries(a).filter(([, s]) => re(s) === e).map(([s]) => s), O = (e) => {
33
- const s = j(e);
34
- return { granted: s.filter((o) => o in i.grants).length, total: s.length };
35
- }, k = (e) => `${O(e).granted} / ${O(e).total}`, T = h(() => r.value.map((e) => ({ value: e.key, label: m.groupLabel(e.key), badge: k(e.key) }))), u = h(() => f.value !== void 0 && O(f.value.key).granted === O(f.value.key).total);
36
- function C() {
37
- if (f.value)
38
- for (const e of j(f.value.key))
39
- u.value ? D(a, i.grants, e) : H(a, i.grants, e);
40
- }
41
- const z = (e) => [...new Set(e.permissions.map((s) => s.ownable).filter((s) => s !== null))], x = h(() => ["own", "own_location", "all"].map((e) => ({ value: e, label: m.qualifierLabel(e) })));
42
- function A(e, s) {
43
- const o = R(a, i.grants, s) ?? "own", n = e.permissions.some((L) => L.ownable === s && L.unownedIsOwn);
44
- return [m.qualifierHint(o), o === "own" && n ? g("core.access.unowned") : ""].filter(Boolean).join(" · ");
45
- }
46
- function q(e) {
47
- const s = e.requires.map((o) => m.permissionLabel(o)).join(", ");
48
- return [m.permissionDescription(e.id), s ? g("core.access.requires", { names: s }) : ""].filter(Boolean).join(" ");
49
- }
50
- const P = (e, s) => le(a, i.grants, e, s), c = (e, s) => s ? H(a, i.grants, e) : D(a, i.grants, e);
51
- return (e, s) => (l(), v("div", ve, [
52
- w("nav", {
53
- class: "hidden flex-col gap-0.5 lg:sticky lg:top-4 lg:flex",
54
- "aria-label": t(g)("core.access.modules"),
55
- "data-test": "tree-modules"
56
- }, [
57
- (l(!0), v(B, null, N(r.value, (o) => (l(), v("button", {
58
- key: o.key,
59
- type: "button",
60
- "data-test": `tree-module-${o.key}`,
61
- "aria-current": b.value === o.key ? "true" : void 0,
62
- class: K(["flex h-9 items-center justify-between gap-3 rounded-control px-3 text-left text-body transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus", b.value === o.key ? "bg-tint-soft font-semibold text-content-strong" : "text-content"]),
63
- onClick: (n) => b.value = o.key
64
- }, [
65
- w("span", ye, d(t(m).groupLabel(o.key)), 1),
66
- w("span", {
67
- class: "text-footnote tabular-nums text-content-muted",
68
- "data-test": `tree-count-${o.key}`
69
- }, d(k(o.key)), 9, ke)
70
- ], 10, he))), 128))
71
- ], 8, be),
72
- V(t(fe), {
73
- modelValue: b.value,
74
- "onUpdate:modelValue": s[0] || (s[0] = (o) => b.value = o),
75
- tabs: T.value,
76
- presentation: "scope",
77
- class: "lg:hidden"
78
- }, null, 8, ["modelValue", "tabs"]),
79
- f.value ? (l(), v("div", {
80
- key: 0,
81
- class: "flex min-w-0 flex-col gap-6",
82
- "data-test": `tree-panel-${f.value.key}`
83
- }, [
84
- w("div", we, [
85
- w("h2", $e, d(t(m).groupLabel(f.value.key)), 1),
86
- w("span", Oe, d(k(f.value.key)), 1),
87
- i.readonly ? $("", !0) : (l(), v("span", Le, [
88
- V(t(me), {
89
- prominence: "secondary",
90
- size: "sm",
91
- onClick: C
92
- }, {
93
- default: p(() => [
94
- y(d(u.value ? t(g)("core.access.turn_off_all") : t(g)("core.access.turn_on_all")), 1)
95
- ]),
96
- _: 1
97
- })
98
- ]))
99
- ]),
100
- (l(!0), v(B, null, N(f.value.screens, (o) => (l(), _(t(W), {
101
- key: o.key,
102
- header: t(m).screenLabel(o.key)
103
- }, {
104
- default: p(() => [
105
- (l(!0), v(B, null, N(z(o), (n) => (l(), _(t(pe), {
106
- key: n,
107
- label: t(m).ownableLabel(n),
108
- hint: A(o, n),
109
- "model-value": t(R)(t(a), i.grants, n) ?? "own",
110
- options: x.value,
111
- disabled: i.readonly || t(R)(t(a), i.grants, n) === null,
112
- "onUpdate:modelValue": (L) => P(n, L)
113
- }, null, 8, ["label", "hint", "model-value", "options", "disabled", "onUpdate:modelValue"]))), 128)),
114
- (l(!0), v(B, null, N(o.permissions, (n) => (l(), _(t(_e), {
115
- key: n.id,
116
- label: t(m).permissionLabel(n.id),
117
- hint: q(n),
118
- "model-value": n.id in i.grants,
119
- disabled: i.readonly,
120
- "onUpdate:modelValue": (L) => c(n.id, !!L)
121
- }, X({ _: 2 }, [
122
- n.sensitive || n.system || n.organizationOnly ? {
123
- name: "before",
124
- fn: p(() => [
125
- n.sensitive ? (l(), _(t(S), {
126
- key: 0,
127
- tone: "warning"
128
- }, {
129
- default: p(() => [
130
- y(d(t(g)("core.access.sensitive")), 1)
131
- ]),
132
- _: 1
133
- })) : $("", !0),
134
- n.system ? (l(), _(t(S), {
135
- key: 1,
136
- tone: "neutral"
137
- }, {
138
- default: p(() => [
139
- y(d(t(g)("core.access.system")), 1)
140
- ]),
141
- _: 1
142
- })) : n.organizationOnly ? (l(), _(t(S), {
143
- key: 2,
144
- tone: "info"
145
- }, {
146
- default: p(() => [
147
- y(d(t(g)("core.access.organization_only")), 1)
148
- ]),
149
- _: 1
150
- })) : $("", !0)
151
- ]),
152
- key: "0"
153
- } : void 0
154
- ]), 1032, ["label", "hint", "model-value", "disabled", "onUpdate:modelValue"]))), 128))
155
- ]),
156
- _: 2
157
- }, 1032, ["header"]))), 128))
158
- ], 8, xe)) : $("", !0)
159
- ]));
160
- }
161
- }), je = {
162
- class: "flex min-w-0 flex-col gap-group-gap",
163
- "data-test": "role-editor"
164
- }, Ce = {
165
- key: 0,
166
- class: "flex flex-wrap gap-1.5 px-row-inset py-2",
167
- "data-test": "role-attrs"
168
- }, We = /* @__PURE__ */ I({
169
- __name: "RoleEditor",
170
- props: {
171
- role: {},
172
- source: {}
173
- },
174
- emits: ["saved"],
175
- setup(U, { expose: i, emit: g }) {
176
- const a = U, m = g, { t: r } = Q(), b = J(), { catalogue: f } = G(), j = ie(), { access: O } = ge(), k = (c, e) => {
177
- const s = c ?? e ?? null;
178
- return {
179
- name: c ? c.name : e ? r("core.access.copy_name", { name: b.roleName(e) }) : "",
180
- description: s?.description ?? "",
181
- grants: Object.fromEntries((s?.grants ?? []).map((o) => [o.permission, o.qualifier]))
182
- };
183
- }, u = Z({
184
- defaults: () => k(a.role, a.source),
185
- validator: {
186
- safeParse(c) {
187
- const e = c, s = [
188
- ...e.name.trim() === "" ? [{ path: ["name"], message: r("core.access.name_required") }] : [],
189
- ...e.name.length > 100 ? [{ path: ["name"], message: r("core.access.too_long") }] : [],
190
- ...e.description.length > 255 ? [{ path: ["description"], message: r("core.access.too_long") }] : []
191
- ];
192
- return s.length === 0 ? { success: !0, data: e } : { success: !1, error: { issues: s } };
193
- }
194
- },
195
- failureMessage: ce()
196
- }), C = M([]);
197
- function z() {
198
- u.hydrate(k(a.role, a.source)), C.value = de(f, u.values.grants);
199
- }
200
- z(), Y(() => [a.role, a.source], z);
201
- const x = h(() => a.role !== null && (a.role.predefined || a.role.computed) || !O.can(ue.manageRoles)), A = h(
202
- () => C.value.length === 0 || x.value ? "" : r("core.access.completed", { names: C.value.map((c) => b.permissionLabel(c)).join(", ") })
203
- );
204
- async function q() {
205
- if (x.value) return;
206
- const c = await u.submit(
207
- (e) => {
208
- const s = {
209
- name: e.name.trim(),
210
- description: e.description,
211
- grants: Object.entries(e.grants).map(([o, n]) => ({ permission: o, qualifier: n })),
212
- // Constraints are the application's own business: kept as the role has them.
213
- attrs: (a.role ?? a.source)?.attrs ?? []
214
- };
215
- return a.role ? j.update({ ref: a.role.ref, ...s }) : j.create(s);
216
- },
217
- { hydrateFrom: (e) => k(e, null) }
218
- );
219
- (c.status === "saved" || c.status === "saved-refresh-failed") && (oe.success(r("core.access.saved")), m("saved", c.value));
220
- }
221
- ae({ form: u, label: () => r("core.access.save"), allowed: () => !x.value, disabledWhileClean: () => a.role !== null, save: () => void q(), cancel: () => u.reset() });
222
- const P = h(() => (a.role ?? a.source)?.attrs ?? []);
223
- return i({ form: u, save: q }), (c, e) => (l(), _(t(ee), {
224
- form: t(u),
225
- onSubmit: q
226
- }, {
227
- default: p(() => [
228
- w("div", je, [
229
- a.role?.computed ? (l(), _(t(E), {
230
- key: 0,
231
- tone: "info",
232
- "data-test": "role-computed-note"
233
- }, {
234
- default: p(() => [
235
- y(d(t(r)("core.access.notes.computed")), 1)
236
- ]),
237
- _: 1
238
- })) : a.role?.predefined ? (l(), _(t(E), {
239
- key: 1,
240
- tone: "info",
241
- "data-test": "role-predefined-note"
242
- }, {
243
- default: p(() => [
244
- y(d(t(r)("core.access.notes.predefined")), 1)
245
- ]),
246
- _: 1
247
- })) : $("", !0),
248
- A.value ? (l(), _(t(E), {
249
- key: 2,
250
- tone: "warning",
251
- "data-test": "role-completed-note"
252
- }, {
253
- default: p(() => [
254
- y(d(A.value), 1)
255
- ]),
256
- _: 1
257
- })) : $("", !0),
258
- V(t(W), {
259
- header: t(r)("core.access.groups.role"),
260
- editable: !x.value,
261
- "label-width": "12rem"
262
- }, {
263
- default: p(() => [
264
- V(t(se), F(t(u).bind("name"), {
265
- label: t(r)("core.access.fields.name"),
266
- "max-length": 100,
267
- required: ""
268
- }), null, 16, ["label"]),
269
- V(t(te), F(t(u).bind("description"), {
270
- label: t(r)("core.access.fields.description"),
271
- rows: 2,
272
- "max-length": 255
273
- }), null, 16, ["label"]),
274
- P.value.length ? (l(), v("div", Ce, [
275
- (l(!0), v(B, null, N(P.value, (s) => (l(), _(t(S), {
276
- key: s.attribute,
277
- tone: "neutral"
278
- }, {
279
- default: p(() => [
280
- y(d(s.attribute) + ": " + d(s.values.join(", ")), 1)
281
- ]),
282
- _: 2
283
- }, 1024))), 128))
284
- ])) : $("", !0)
285
- ]),
286
- _: 1
287
- }, 8, ["header", "editable"]),
288
- V(Ve, {
289
- grants: t(u).values.grants,
290
- readonly: x.value
291
- }, null, 8, ["grants", "readonly"])
292
- ])
293
- ]),
294
- _: 1
295
- }, 8, ["form"]));
296
- }
297
- });
298
- export {
299
- We as _
300
- };
@@ -1,315 +0,0 @@
1
- import { defineComponent as I, computed as z, openBlock as l, createBlock as b, unref as e, withCtx as n, createElementVNode as S, createVNode as f, mergeProps as W, useTemplateRef as A, ref as j, createElementBlock as y, toDisplayString as L, Fragment as D, createCommentVNode as w, renderList as E, createTextVNode as G } from "vue";
2
- import { useI18n as K } from "vue-i18n";
3
- import { useRouter as X } from "vue-router";
4
- import { _ as Y } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
5
- import { _ as C } from "./FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js";
6
- import { e as F } from "./control-B4SdblL6.js";
7
- import { u as Z } from "./describeError-B-NMa--w.js";
8
- import { _ as ee } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
9
- import { t as q } from "./toast-CqSDTWRX.js";
10
- import { _ as oe } from "./RecordHeader.vue_vue_type_script_setup_true_lang-fmx0f8xi.js";
11
- import { u as te } from "./platform-PZpUkkMS.js";
12
- import { a as ae, u as le } from "./routeResource-DlTsGTg_.js";
13
- import { a as se } from "./ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js";
14
- import { _ as re } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
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-C3E6DcO0.js";
17
- import { _ as J } from "./SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js";
18
- import { u as ie, _ as ue } from "./useCommand-Cj-APj-P.js";
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-DRHmjA9w.js";
21
- const de = { "data-test": "role-replace" }, fe = /* @__PURE__ */ I({
22
- __name: "ReplaceRoleDialog",
23
- props: {
24
- role: {},
25
- others: {}
26
- },
27
- emits: ["replaced"],
28
- setup(B, { expose: r, emit: g }) {
29
- const s = B, i = g, { t: _ } = K(), k = O(), m = U(), p = ie({
30
- defaults: () => ({ with: null }),
31
- validator: {
32
- safeParse: (c) => c.with ? { success: !0, data: { with: c.with } } : { success: !1, error: { issues: [{ path: ["with"], message: _("core.access.replace.choose") }] } }
33
- },
34
- failureMessage: ce(),
35
- run: (c) => m.replace(s.role.ref, c.with),
36
- done: (c) => {
37
- q.success(_("core.access.replace.done", { count: c })), i("replaced", c);
38
- }
39
- }), h = z(() => s.others.map((c) => ({ value: c.ref, label: k.roleName(c) })));
40
- return r({ present: () => p.present() }), (c, N) => (l(), b(e(ue), {
41
- command: e(p),
42
- title: e(_)("core.access.replace.title"),
43
- subtitle: e(k).roleName(s.role),
44
- size: "md",
45
- "confirm-label": e(_)("core.access.replace.confirm"),
46
- message: e(_)("core.access.replace.moves", { count: s.role.holders })
47
- }, {
48
- default: n(() => [
49
- S("div", de, [
50
- f(e(C), {
51
- footer: e(_)("core.access.replace.footer")
52
- }, {
53
- default: n(() => [
54
- f(e(J), W(e(p).form.bind("with"), {
55
- label: e(_)("core.access.replace.with"),
56
- options: h.value
57
- }), null, 16, ["label", "options"])
58
- ]),
59
- _: 1
60
- }, 8, ["footer"])
61
- ])
62
- ]),
63
- _: 1
64
- }, 8, ["command", "title", "subtitle", "confirm-label", "message"]));
65
- }
66
- }), _e = {
67
- class: "flex flex-col gap-group-gap",
68
- "data-test": "role-compare"
69
- }, ve = {
70
- key: 0,
71
- class: "px-row-inset text-body text-content-muted",
72
- "data-test": "compare-loading"
73
- }, he = {
74
- key: 1,
75
- class: "px-row-inset text-body text-content-destructive",
76
- role: "alert",
77
- "data-test": "compare-failed"
78
- }, be = {
79
- key: 0,
80
- class: "px-row-inset text-body text-content-muted",
81
- "data-test": "compare-identical"
82
- }, ye = /* @__PURE__ */ I({
83
- __name: "RoleCompareDialog",
84
- props: {
85
- role: {},
86
- others: {}
87
- },
88
- setup(B, { expose: r }) {
89
- const g = B, { t: s } = K(), i = O(), _ = U(), k = A("modal"), m = j(null), o = j(null), p = j(!1), h = j(!1), c = z(() => g.others.map((d) => ({ value: d.ref, label: i.roleName(d) }))), N = z(() => o.value !== null && !o.value.only_in_role.length && !o.value.only_in_other.length && !o.value.different.length);
90
- async function V(d) {
91
- if (m.value = d, o.value = null, h.value = !1, p.value = !1, !!d) {
92
- p.value = !0;
93
- try {
94
- const x = await _.compare(g.role.ref, d);
95
- m.value === d && (o.value = x);
96
- } catch {
97
- m.value === d && (h.value = !0);
98
- } finally {
99
- m.value === d && (p.value = !1);
100
- }
101
- }
102
- }
103
- function P() {
104
- m.value = null, o.value = null, h.value = !1, k.value?.present();
105
- }
106
- return r({ present: P }), (d, x) => (l(), b(e(me), {
107
- ref_key: "modal",
108
- ref: k,
109
- title: e(s)("core.access.compare.title"),
110
- subtitle: e(i).roleName(g.role),
111
- size: "lg",
112
- grouped: "",
113
- "without-footer": ""
114
- }, {
115
- default: n(() => [
116
- S("div", _e, [
117
- f(e(C), {
118
- footer: e(s)("core.access.compare.footer")
119
- }, {
120
- default: n(() => [
121
- f(e(J), {
122
- "model-value": m.value,
123
- label: e(s)("core.access.compare.with"),
124
- options: c.value,
125
- "onUpdate:modelValue": x[0] || (x[0] = (u) => V(u))
126
- }, null, 8, ["model-value", "label", "options"])
127
- ]),
128
- _: 1
129
- }, 8, ["footer"]),
130
- p.value ? (l(), y("p", ve, L(e(s)("core.access.compare.loading")), 1)) : h.value ? (l(), y("p", he, L(e(s)("core.access.compare.failed")), 1)) : o.value ? (l(), y(D, { key: 2 }, [
131
- N.value ? (l(), y("p", be, L(e(s)("core.access.compare.identical")), 1)) : w("", !0),
132
- o.value.only_in_role.length ? (l(), b(e(C), {
133
- key: 1,
134
- header: e(s)("core.access.compare.only_in_role", { count: o.value.only_in_role.length })
135
- }, {
136
- default: n(() => [
137
- (l(!0), y(D, null, E(o.value.only_in_role, (u) => (l(), b(e(F), {
138
- key: u.permission,
139
- layout: "setting",
140
- label: e(i).permissionLabel(u.permission)
141
- }, null, 8, ["label"]))), 128))
142
- ]),
143
- _: 1
144
- }, 8, ["header"])) : w("", !0),
145
- o.value.only_in_other.length ? (l(), b(e(C), {
146
- key: 2,
147
- header: e(s)("core.access.compare.only_in_other", { count: o.value.only_in_other.length })
148
- }, {
149
- default: n(() => [
150
- (l(!0), y(D, null, E(o.value.only_in_other, (u) => (l(), b(e(F), {
151
- key: u.permission,
152
- layout: "setting",
153
- label: e(i).permissionLabel(u.permission)
154
- }, null, 8, ["label"]))), 128))
155
- ]),
156
- _: 1
157
- }, 8, ["header"])) : w("", !0),
158
- o.value.different.length ? (l(), b(e(C), {
159
- key: 3,
160
- header: e(s)("core.access.compare.different", { count: o.value.different.length })
161
- }, {
162
- default: n(() => [
163
- (l(!0), y(D, null, E(o.value.different, (u) => (l(), b(e(F), {
164
- key: u.permission,
165
- layout: "setting",
166
- label: e(i).permissionLabel(u.permission),
167
- value: e(s)("core.access.compare.whose", { role: e(i).qualifierLabel(u.role), other: e(i).qualifierLabel(u.other) })
168
- }, null, 8, ["label", "value"]))), 128))
169
- ]),
170
- _: 1
171
- }, 8, ["header"])) : w("", !0)
172
- ], 64)) : w("", !0)
173
- ])
174
- ]),
175
- _: 1
176
- }, 8, ["title", "subtitle"]));
177
- }
178
- }), ge = { "data-test": "role-holders" }, ke = { class: "flex min-w-0 flex-col gap-group-gap" }, Ie = /* @__PURE__ */ I({
179
- __name: "RolePage",
180
- setup(B) {
181
- const { t: r } = K(), g = X(), { access: s } = te(), i = O(), _ = Z(), { subjectRoute: k } = ne(), m = U(), o = ae({ param: "ref", parse: (t) => t === "" ? null : t, identify: (t) => t.ref, load: (t, { signal: a }) => m.role(t, { signal: a }) }), p = le({ for: o, load: (t, { signal: a }) => m.holders(t, { signal: a }) }), h = j([]), c = A("compareDialog"), N = A("replaceDialog"), V = A("deleteDialog"), P = (t) => !t.predefined && !t.computed;
182
- async function d(t) {
183
- if (h.value.length === 0)
184
- try {
185
- h.value = (await m.roles()).filter((a) => a.predefined);
186
- } catch (a) {
187
- q.error(_(a));
188
- return;
189
- }
190
- t();
191
- }
192
- const x = z(() => {
193
- const t = o.data.value;
194
- if (!t) return [];
195
- const a = [];
196
- return s.can(M.manageRoles) && a.push({ id: "copy", label: r("core.access.copy"), icon: "copy", placement: "secondary", onClick: () => void g.push({ ...T.newRole, query: { copy: t.ref } }) }), P(t) && s.can(M.manageRoles) && (a.push({ id: "compare", label: r("core.access.compare.action"), icon: "swapBoxLine", placement: "overflow", onClick: () => void d(() => c.value?.present()) }), a.push({ id: "replace", label: r("core.access.replace.action"), icon: "refreshLine", placement: "overflow", onClick: () => void d(() => N.value?.present()) })), P(t) && s.can(M.deleteRoles) && a.push({ id: "delete", label: r("core.access.delete.action"), icon: "deleteBin2Line", placement: "overflow", tone: "critical", onClick: () => V.value?.present(t) }), a;
197
- });
198
- async function u(t) {
199
- await m.remove(t.ref), q.success(r("core.access.deleted")), await g.replace(T.roles);
200
- }
201
- const Q = (t) => q.error(_(t, { fallback: r("core.access.delete.failed") }));
202
- return (t, a) => (l(), b(e(se), {
203
- resource: e(o),
204
- title: e(o).data.value ? e(i).roleName(e(o).data.value) : "",
205
- back: { label: e(r)("core.access.title"), to: e(T).roles },
206
- actions: x.value
207
- }, {
208
- header: n(({ record: v }) => [
209
- f(e(oe), {
210
- title: e(i).roleName(v),
211
- subtitle: v.description
212
- }, {
213
- leading: n(() => [
214
- f(e(Y), {
215
- tone: v.predefined ? "anchor" : "brand",
216
- icon: "shieldStarFill",
217
- size: "lg"
218
- }, null, 8, ["tone"])
219
- ]),
220
- meta: n(() => [
221
- f(e(H), {
222
- tone: v.predefined ? "neutral" : "info"
223
- }, {
224
- default: n(() => [
225
- G(L(e(i).roleKind(v)), 1)
226
- ]),
227
- _: 2
228
- }, 1032, ["tone"]),
229
- S("span", ge, L(e(r)("core.access.holders_count", { count: v.holders })), 1)
230
- ]),
231
- _: 2
232
- }, 1032, ["title", "subtitle"])
233
- ]),
234
- default: n(({ record: v }) => [
235
- S("div", ke, [
236
- f(pe, {
237
- role: v,
238
- onSaved: a[0] || (a[0] = ($) => {
239
- e(o).update($), e(p).reload();
240
- })
241
- }, null, 8, ["role"]),
242
- f(e(re), {
243
- state: e(p).state.value,
244
- "skeleton-rows": 3,
245
- "is-empty": () => !1,
246
- onRetry: a[1] || (a[1] = ($) => e(p).reload())
247
- }, {
248
- default: n(({ value: $ }) => [
249
- f(e(C), {
250
- header: e(r)("core.access.holders.title"),
251
- footer: $.length ? void 0 : e(r)("core.access.holders.empty")
252
- }, {
253
- default: n(() => [
254
- (l(!0), y(D, null, E($, (R) => (l(), b(e(F), {
255
- key: `${R.subject.kind}-${R.subject.id}`,
256
- layout: "setting",
257
- label: R.name,
258
- sub: e(i).scopeLabel(R.scope),
259
- to: e(k)(R.subject) ?? void 0
260
- }, {
261
- default: n(() => [
262
- R.subject.kind === "service" ? (l(), b(e(H), {
263
- key: 0,
264
- tone: "neutral"
265
- }, {
266
- default: n(() => [
267
- G(L(e(r)("core.access.holders.service")), 1)
268
- ]),
269
- _: 1
270
- })) : w("", !0)
271
- ]),
272
- _: 2
273
- }, 1032, ["label", "sub", "to"]))), 128))
274
- ]),
275
- _: 2
276
- }, 1032, ["header", "footer"])
277
- ]),
278
- _: 1
279
- }, 8, ["state"]),
280
- P(v) ? (l(), y(D, { key: 0 }, [
281
- f(ye, {
282
- ref_key: "compareDialog",
283
- ref: c,
284
- role: v,
285
- others: h.value
286
- }, null, 8, ["role", "others"]),
287
- f(fe, {
288
- ref_key: "replaceDialog",
289
- ref: N,
290
- role: v,
291
- others: h.value,
292
- onReplaced: a[2] || (a[2] = ($) => {
293
- e(o).reload(), e(p).reload();
294
- })
295
- }, null, 8, ["role", "others"]),
296
- f(e(ee), {
297
- ref_key: "deleteDialog",
298
- ref: V,
299
- tone: "critical",
300
- title: e(r)("core.access.delete.title"),
301
- message: e(r)("core.access.delete.body", { name: e(i).roleName(v) }),
302
- "confirm-label": e(r)("core.access.delete.action"),
303
- action: u,
304
- onFailed: Q
305
- }, null, 8, ["title", "message", "confirm-label"])
306
- ], 64)) : w("", !0)
307
- ])
308
- ]),
309
- _: 1
310
- }, 8, ["resource", "title", "back", "actions"]));
311
- }
312
- });
313
- export {
314
- Ie as default
315
- };