@feedmepos/mf-hrm-portal 2.0.2-dev → 2.0.3-dev

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 (31) hide show
  1. package/dist/{AuditLogList-DIhc0l6X.js → AuditLogList-wzVOem7J.js} +12 -12
  2. package/dist/{EmployeeList-BeEKR289.js → EmployeeList-D5IfP20e.js} +5 -5
  3. package/dist/{Main-VBmK1-KC.js → Main-hADhiwrp.js} +5 -5
  4. package/dist/{Main-C0GZCILF.js → Main-mvm27j-a.js} +8 -8
  5. package/dist/PermissionSetList-DgaTwV_y.js +327 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BzA__vQJ.js +3287 -0
  7. package/dist/{RoleList-CV0gVc3E.js → RoleList-C0gK0AMO.js} +6 -6
  8. package/dist/TeamMemberList-BVAbjvKZ.js +979 -0
  9. package/dist/{TimesheetList-BwEfqBTT.js → TimesheetList-C3jduNcK.js} +6 -6
  10. package/dist/{app-aTcgEcFN.js → app-CXscIHdd.js} +897 -803
  11. package/dist/app.js +1 -1
  12. package/dist/composables/useCustomReportPermissions.d.ts +7 -0
  13. package/dist/{dayjs.min-B9nj2sbB.js → dayjs.min-Bc0i83P9.js} +1 -1
  14. package/dist/{employee-Cb9Bw-C0.js → employee-Se3Yks-o.js} +3 -3
  15. package/dist/helpers/permission-set.d.ts +9 -0
  16. package/dist/helpers/rule.d.ts +4 -1
  17. package/dist/{index-BFELrt2A.js → index-D35d9iES.js} +1 -1
  18. package/dist/{index-CUpeDutG.js → index-DOp84DcN.js} +1539 -1491
  19. package/dist/{lodash-ByTVC-hr.js → lodash-DuiYjdnV.js} +1 -1
  20. package/dist/{team-DRrXMlSc.js → team-CT4SDg-h.js} +1 -1
  21. package/dist/{timesheet-B3eCp8WW.js → timesheet-D0SI4Zli.js} +2 -2
  22. package/dist/tsconfig.app.tsbuildinfo +1 -1
  23. package/dist/{useAppStore-Yt4HqLKz.js → useAppStore-TCd8aSgi.js} +1 -1
  24. package/dist/{useLoading-BVU_m_hz.js → useLoading-CwO9YfJb.js} +1 -1
  25. package/dist/useReportPermissions-CmtxmL3h.js +59 -0
  26. package/dist/views/team/components/BasePermission.vue.d.ts +17 -0
  27. package/package.json +2 -2
  28. package/dist/PermissionSetList-C0lRNtWq.js +0 -323
  29. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DOBslfDb.js +0 -3092
  30. package/dist/TeamMemberList-BXMfJK16.js +0 -973
  31. package/dist/useReportPermissions-Bchec8_9.js +0 -65
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as se, ref as _, computed as k, watch as R, resolveComponent as D, createElementBlock as m, openBlock as r, Fragment as A, createVNode as d, unref as s, withCtx as F, createElementVNode as e, createBlock as $, createCommentVNode as g, toDisplayString as a, renderList as ie, createTextVNode as Y } from "vue";
2
- import { d as ne } from "./dayjs.min-B9nj2sbB.js";
2
+ import { d as ne } from "./dayjs.min-Bc0i83P9.js";
3
3
  import { useI18n as de, useCoreStore as ce } from "@feedmepos/mf-common";
4
- import { _ as re, G as ue } from "./app-aTcgEcFN.js";
4
+ import { _ as re, L as ue } from "./app-CXscIHdd.js";
5
5
  import { _ as me } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
6
  import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { components as G } from "@feedmepos/ui-library";
8
- import { g as pe, b as _e, p as J } from "./index-CUpeDutG.js";
9
- import { u as ve } from "./team-DRrXMlSc.js";
7
+ import { components as J } from "@feedmepos/ui-library";
8
+ import { g as pe, b as _e, p as G } from "./index-DOp84DcN.js";
9
+ import { u as ve } from "./team-CT4SDg-h.js";
10
10
  import { S as U } from "./SelectFilter-NbXrJ4iH.js";
11
11
  const ge = "/audit-logs", he = {
12
12
  async read(n) {
@@ -95,9 +95,9 @@ const ge = "/audit-logs", he = {
95
95
  key: 1
96
96
  }, Ye = {
97
97
  class: "text-xs text-fm-color-typo-secondary"
98
- }, Ge = {
99
- class: "font-semibold"
100
98
  }, Je = {
99
+ class: "font-semibold"
100
+ }, Ge = {
101
101
  class: "text-xs text-fm-color-typo-secondary"
102
102
  }, Ze = {
103
103
  class: "break-all font-mono text-xs font-semibold"
@@ -174,7 +174,7 @@ const ge = "/audit-logs", he = {
174
174
  }), T = _(), j = _(), P = _(), V = _(), Z = k(() => p.members.map((i) => ({
175
175
  label: i.name,
176
176
  value: i.doc.userId
177
- }))), H = k(() => J.map((i) => ({
177
+ }))), H = k(() => G.map((i) => ({
178
178
  label: i.label,
179
179
  value: i.subject
180
180
  }))), Q = k(() => [{
@@ -210,7 +210,7 @@ const ge = "/audit-logs", he = {
210
210
  }), B = k(() => I.value);
211
211
  function M(i) {
212
212
  var o;
213
- return ((o = J.find((u) => u.subject === i)) == null ? void 0 : o.label) ?? ue[i];
213
+ return ((o = G.find((u) => u.subject === i)) == null ? void 0 : o.label) ?? ue[i];
214
214
  }
215
215
  const z = {
216
216
  allowed: "success",
@@ -232,7 +232,7 @@ const ge = "/audit-logs", he = {
232
232
  const o = i.row.original, u = p.userIdToName[o.userId], h = p.userIdToPhone[o.userId], b = p.userIdToEmail[o.userId];
233
233
  return d("div", {
234
234
  class: "flex items-center gap-8"
235
- }, [d(G.FmAvatar, {
235
+ }, [d(J.FmAvatar, {
236
236
  initials: u || o.userId,
237
237
  size: "sm",
238
238
  class: "shrink-0"
@@ -285,7 +285,7 @@ const ge = "/audit-logs", he = {
285
285
  enableSorting: !1,
286
286
  cell(i) {
287
287
  const o = i.row.original;
288
- return d(G.FmChip, {
288
+ return d(J.FmChip, {
289
289
  variant: z[o.outcome] ?? "neutral",
290
290
  label: o.outcome,
291
291
  compact: !0
@@ -454,7 +454,7 @@ const ge = "/audit-logs", he = {
454
454
  compact: ""
455
455
  }, null, 8, ["variant", "label"])]), o[7] || (o[7] = e("hr", {
456
456
  class: "border-fm-color-border-default"
457
- }, null, -1)), e("div", Oe, [e("div", null, [e("p", Ne, a(s(t)("auditLog.detail.timestamp")), 1), e("p", Ae, a(new Date(l.value.timestamp).toLocaleString()), 1)]), s(p).userIdToName[l.value.userId] ? (r(), m("div", Fe, [e("p", Ue, a(s(t)("auditLog.detail.user")), 1), e("p", Be, a(s(p).userIdToName[l.value.userId]), 1)])) : g("", !0), e("div", null, [e("p", Ee, a(s(t)("auditLog.detail.email")), 1), e("p", Re, a(s(p).userIdToEmail[l.value.userId] || l.value.userId), 1)]), e("div", null, [e("p", qe, a(s(t)("auditLog.detail.action")), 1), e("p", Me, a(l.value.action), 1)]), e("div", null, [e("p", ze, a(s(t)("auditLog.detail.subject")), 1), e("p", Ke, a(M(l.value.subject) || l.value.subject), 1)]), l.value.field ? (r(), m("div", $e, [e("p", Ye, a(s(t)("auditLog.detail.field")), 1), e("p", Ge, a(l.value.field), 1)])) : g("", !0), e("div", null, [e("p", Je, a(s(t)("auditLog.detail.business")), 1), e("p", Ze, a(l.value.businessId || "-"), 1)]), e("div", null, [e("p", He, a(s(t)("auditLog.detail.restaurant")), 1), e("p", Qe, a(l.value.restaurantId || "-"), 1)])])]), e("div", We, [e("div", Xe, [e("p", et, a(s(t)("auditLog.detail.metadata")), 1)]), o[8] || (o[8] = e("hr", {
457
+ }, null, -1)), e("div", Oe, [e("div", null, [e("p", Ne, a(s(t)("auditLog.detail.timestamp")), 1), e("p", Ae, a(new Date(l.value.timestamp).toLocaleString()), 1)]), s(p).userIdToName[l.value.userId] ? (r(), m("div", Fe, [e("p", Ue, a(s(t)("auditLog.detail.user")), 1), e("p", Be, a(s(p).userIdToName[l.value.userId]), 1)])) : g("", !0), e("div", null, [e("p", Ee, a(s(t)("auditLog.detail.email")), 1), e("p", Re, a(s(p).userIdToEmail[l.value.userId] || l.value.userId), 1)]), e("div", null, [e("p", qe, a(s(t)("auditLog.detail.action")), 1), e("p", Me, a(l.value.action), 1)]), e("div", null, [e("p", ze, a(s(t)("auditLog.detail.subject")), 1), e("p", Ke, a(M(l.value.subject) || l.value.subject), 1)]), l.value.field ? (r(), m("div", $e, [e("p", Ye, a(s(t)("auditLog.detail.field")), 1), e("p", Je, a(l.value.field), 1)])) : g("", !0), e("div", null, [e("p", Ge, a(s(t)("auditLog.detail.business")), 1), e("p", Ze, a(l.value.businessId || "-"), 1)]), e("div", null, [e("p", He, a(s(t)("auditLog.detail.restaurant")), 1), e("p", Qe, a(l.value.restaurantId || "-"), 1)])])]), e("div", We, [e("div", Xe, [e("p", et, a(s(t)("auditLog.detail.metadata")), 1)]), o[8] || (o[8] = e("hr", {
458
458
  class: "border-fm-color-border-default"
459
459
  }, null, -1)), e("div", tt, [l.value.metadata.reason ? (r(), m("div", ot, [e("p", lt, a(s(t)("auditLog.detail.reason")), 1), e("p", at, a(l.value.metadata.reason), 1)])) : g("", !0), e("div", null, [e("p", st, a(s(t)("auditLog.detail.resolvedFrom")), 1), e("p", it, a(l.value.metadata.resolvedFrom), 1)]), l.value.metadata.permissionSetId ? (r(), m("div", nt, [e("p", dt, a(s(t)("auditLog.detail.permissionSet")), 1), l.value.metadata.resolvedFrom === "systemPermissionSet" ? (r(), m(A, {
460
460
  key: 0
@@ -2,14 +2,14 @@ import { createElementBlock as $, openBlock as g, createElementVNode as m, toRaw
2
2
  import { useCoreStore as Fe, useI18n as we, RestaurantSelector as ce } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as xe, components as Ue, useDialog as Ne, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
4
4
  import { _ as Pe, S as pe } from "./SelectFilter-NbXrJ4iH.js";
5
- import { _ as Te } from "./app-aTcgEcFN.js";
5
+ import { _ as Te } from "./app-CXscIHdd.js";
6
6
  import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
7
  import { u as ke } from "./useSearch-B6WK1LBB.js";
8
- import { u as Se, E as Ae } from "./employee-Cb9Bw-C0.js";
9
- import { l as je } from "./lodash-ByTVC-hr.js";
8
+ import { u as Se, E as Ae } from "./employee-Se3Yks-o.js";
9
+ import { l as je } from "./lodash-DuiYjdnV.js";
10
10
  import { u as Ke, _ as ve, a as fe, b as Ge } from "./useRestaurantMap-D5BNPLKh.js";
11
- import { u as qe } from "./useLoading-BVU_m_hz.js";
12
- import { u as ue } from "./useAppStore-Yt4HqLKz.js";
11
+ import { u as qe } from "./useLoading-CwO9YfJb.js";
12
+ import { u as ue } from "./useAppStore-TCd8aSgi.js";
13
13
  const He = {};
14
14
  function Je(S, O) {
15
15
  return g(), $("div", null, [...O[0] || (O[0] = [
@@ -4,13 +4,13 @@ import { useI18n as N } from "@feedmepos/mf-common";
4
4
  import { _ as g } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as h } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
6
  import "@feedmepos/ui-library";
7
- import "./index-CUpeDutG.js";
8
- import { R as v } from "./app-aTcgEcFN.js";
9
- import "./useAppStore-Yt4HqLKz.js";
10
- import "./index-BFELrt2A.js";
7
+ import "./index-DOp84DcN.js";
8
+ import { R as v } from "./app-CXscIHdd.js";
9
+ import "./useAppStore-TCd8aSgi.js";
10
+ import "./index-D35d9iES.js";
11
11
  /* empty css */
12
12
  /* empty css */
13
- import "./team-DRrXMlSc.js";
13
+ import "./team-CT4SDg-h.js";
14
14
  const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
15
15
  __name: "Main",
16
16
  setup(x) {
@@ -3,16 +3,16 @@ import { useRouter as of, useRoute as cf } from "vue-router";
3
3
  import { useCoreStore as hf, useI18n as uf } from "@feedmepos/mf-common";
4
4
  import { _ as vf } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as pf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { u as df } from "./useAppStore-Yt4HqLKz.js";
6
+ import { u as df } from "./useAppStore-TCd8aSgi.js";
7
7
  import "@feedmepos/ui-library";
8
8
  /* empty css */
9
- import { u as mf } from "./employee-Cb9Bw-C0.js";
10
- import "./lodash-ByTVC-hr.js";
11
- import "./index-CUpeDutG.js";
12
- import { R as vt } from "./app-aTcgEcFN.js";
13
- import "./useReportPermissions-Bchec8_9.js";
14
- import "./dayjs.min-B9nj2sbB.js";
15
- import "./timesheet-B3eCp8WW.js";
9
+ import { u as mf } from "./employee-Se3Yks-o.js";
10
+ import "./lodash-DuiYjdnV.js";
11
+ import "./index-DOp84DcN.js";
12
+ import { R as vt } from "./app-CXscIHdd.js";
13
+ import "./useReportPermissions-CmtxmL3h.js";
14
+ import "./dayjs.min-Bc0i83P9.js";
15
+ import "./timesheet-D0SI4Zli.js";
16
16
  var In = {};
17
17
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
18
18
  var jt = {};
@@ -0,0 +1,327 @@
1
+ import { defineComponent as q, computed as _, resolveComponent as c, createElementBlock as $, openBlock as P, createElementVNode as y, createVNode as r, toDisplayString as E, unref as u, withCtx as g, createTextVNode as Z, Fragment as G, renderList as ee, ref as b, createBlock as H, nextTick as se, onMounted as te, h as O } from "vue";
2
+ import { useI18n as M, useCoreStore as oe } from "@feedmepos/mf-common";
3
+ import { useSnackbar as J, useDialog as ne, useBreakpoints as ie, components as le, FmButtonColorThemeVariant as ae, FmButtonVariant as re } from "@feedmepos/ui-library";
4
+ import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { q as K, A as ue, u as Q, m as X, p as ce, n as de, o as N, w as pe, x as fe, y as ve, B as Se } from "./index-DOp84DcN.js";
6
+ import { u as _e } from "./useLoading-CwO9YfJb.js";
7
+ import { a as be } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BzA__vQJ.js";
8
+ const he = { class: "flex flex-row items-center gap-8" }, ge = /* @__PURE__ */ q({
9
+ __name: "PermissionWithTooltip",
10
+ props: {
11
+ modelValue: {
12
+ type: Array,
13
+ required: !0
14
+ }
15
+ },
16
+ setup(j) {
17
+ const { customReportPermissions: w } = K(), s = j, i = _(() => ue(s.modelValue, w.value)), { t: a } = M();
18
+ return (k, C) => {
19
+ const h = c("FmIcon"), F = c("FmTooltip");
20
+ return P(), $("div", he, [
21
+ y("span", null, E(u(a)("team.labels.allowed", { count: i.value.length })), 1),
22
+ r(F, {
23
+ variant: "plain",
24
+ placement: "top"
25
+ }, {
26
+ content: g(() => [
27
+ y("div", null, [
28
+ Z(E(u(a)("team.labels.permission")) + " ", 1),
29
+ (P(!0), $(G, null, ee(i.value, (m, l) => (P(), $("div", {
30
+ key: `${m}-${l}`
31
+ }, " - " + E(m), 1))), 128))
32
+ ])
33
+ ]),
34
+ default: g(() => [
35
+ r(h, {
36
+ name: "info",
37
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
38
+ })
39
+ ]),
40
+ _: 1
41
+ })
42
+ ]);
43
+ };
44
+ }
45
+ }), Pe = { class: "fm-typo-en-title-md-600" }, ye = { class: "flex items-center justify-start gap-8" }, Fe = /* @__PURE__ */ q({
46
+ __name: "PermissionSetForm",
47
+ props: {
48
+ modelValue: {
49
+ type: Object,
50
+ default: () => ({})
51
+ }
52
+ },
53
+ setup(j, { expose: w }) {
54
+ const s = j, { t: i } = M(), a = b(!1), k = _(() => {
55
+ var e;
56
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
57
+ }), C = b(), h = J(), F = _e(h), m = Q(), l = b({ ...s.modelValue }), d = b([]), p = b([]), A = [(e) => !!e || "Permission set name is required"], D = _(() => {
58
+ var e;
59
+ return (e = s.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
60
+ }), U = _(
61
+ () => m.permissionSets.value.filter((e) => {
62
+ var o;
63
+ return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
64
+ }).map((e) => ({ label: e.name, value: e.id }))
65
+ ), V = _(
66
+ () => X(d.value, m.permissionSets.value)
67
+ ), { customReportPermissions: W, isLoaded: n } = K(), t = new Set(ce.map((e) => e.subject)), f = _(() => {
68
+ const e = new Set(t);
69
+ for (const o of W.value) e.add(o.subject);
70
+ return e;
71
+ });
72
+ async function I() {
73
+ var o, v;
74
+ await se(), a.value = !a.value, l.value = { ...s.modelValue }, d.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
75
+ const e = ((v = s.modelValue) == null ? void 0 : v.permissions) ?? [];
76
+ p.value = de(
77
+ N(V.value),
78
+ e
79
+ );
80
+ }
81
+ function z() {
82
+ const e = N(V.value), o = n.value ? f.value : t, v = pe(p.value, o), x = fe(v);
83
+ return ve(e, x);
84
+ }
85
+ function B() {
86
+ p.value = N(V.value);
87
+ }
88
+ async function Y() {
89
+ var v, x;
90
+ const e = await ((v = C.value) == null ? void 0 : v.validateInputsWithoutSubmit()), o = (x = oe().currentBusiness.value) == null ? void 0 : x.id;
91
+ !(e != null && e.length) && o && F.minor(async () => {
92
+ var T;
93
+ const L = z();
94
+ if ((T = s.modelValue) != null && T.id) {
95
+ const R = {
96
+ name: l.value.name,
97
+ permissions: L,
98
+ permissionSetIds: d.value,
99
+ businessId: l.value.businessId
100
+ };
101
+ await m.updatePermissionSet(s.modelValue.id, R);
102
+ } else {
103
+ const R = {
104
+ name: l.value.name,
105
+ businessId: o,
106
+ permissions: L,
107
+ permissionSetIds: d.value
108
+ };
109
+ await m.createPermissionSet(R);
110
+ }
111
+ a.value = !1;
112
+ });
113
+ }
114
+ return w({
115
+ trigger: I
116
+ }), (e, o) => {
117
+ const v = c("FmTextField"), x = c("FmSelect"), L = c("FmForm"), T = c("FmButton"), R = c("FmSideSheet");
118
+ return P(), H(R, {
119
+ modelValue: a.value,
120
+ "onUpdate:modelValue": o[4] || (o[4] = (S) => a.value = S),
121
+ "max-width": 560,
122
+ "dismiss-away": ""
123
+ }, {
124
+ "side-sheet-header": g(() => [
125
+ y("p", Pe, E(k.value), 1)
126
+ ]),
127
+ "side-sheet-footer": g(() => [
128
+ y("div", ye, [
129
+ r(T, {
130
+ label: D.value,
131
+ size: "md",
132
+ variant: "primary",
133
+ type: "submit",
134
+ onClick: Y
135
+ }, null, 8, ["label"]),
136
+ r(T, {
137
+ label: u(i)("common.cancel"),
138
+ size: "md",
139
+ variant: "secondary",
140
+ onClick: o[3] || (o[3] = (S) => a.value = !1)
141
+ }, null, 8, ["label"])
142
+ ])
143
+ ]),
144
+ default: g(() => [
145
+ r(L, {
146
+ ref_key: "formRef",
147
+ ref: C
148
+ }, {
149
+ default: g(() => [
150
+ r(v, {
151
+ modelValue: l.value.name,
152
+ "onUpdate:modelValue": o[0] || (o[0] = (S) => l.value.name = S),
153
+ label: u(i)("permissionSet.form.name"),
154
+ placeholder: u(i)("permissionSet.form.namePlaceholder"),
155
+ rules: A
156
+ }, null, 8, ["modelValue", "label", "placeholder"]),
157
+ r(x, {
158
+ modelValue: d.value,
159
+ "onUpdate:modelValue": [
160
+ o[1] || (o[1] = (S) => d.value = S),
161
+ B
162
+ ],
163
+ multiselect: "",
164
+ searchable: "",
165
+ "search-debounce": 300,
166
+ items: U.value,
167
+ label: u(i)("permissionSet.form.includedSets"),
168
+ placeholder: u(i)("permissionSet.form.includedSetsPlaceholder"),
169
+ class: "mt-16"
170
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
171
+ r(be, {
172
+ modelValue: p.value,
173
+ "onUpdate:modelValue": o[2] || (o[2] = (S) => p.value = S),
174
+ "inherit-permissions": V.value,
175
+ class: "mt-24"
176
+ }, null, 8, ["modelValue", "inherit-permissions"])
177
+ ]),
178
+ _: 1
179
+ }, 512)
180
+ ]),
181
+ _: 1
182
+ }, 8, ["modelValue"]);
183
+ };
184
+ }
185
+ }), Ve = { class: "space-y-8" }, xe = { class: "flex justify-end xs:px-16" }, we = {
186
+ key: 0,
187
+ class: "overflow-auto"
188
+ }, ke = { class: "pb-64" }, Le = /* @__PURE__ */ q({
189
+ __name: "PermissionSetList",
190
+ setup(j, { expose: w }) {
191
+ const { t: s } = M(), { fetchCustomReportPermissions: i } = K(), a = J(), k = ne(), { breakpoints: C } = ie(), h = b(""), F = _(() => {
192
+ var n;
193
+ return (n = d.value) == null ? void 0 : n.filter((t) => {
194
+ const f = h.value.toLowerCase();
195
+ return t.name.toLowerCase().includes(f);
196
+ });
197
+ }), m = b(), l = Q(), d = _(
198
+ () => l.permissionSets.value
199
+ ), p = b();
200
+ async function A() {
201
+ await l.readPermissionSets();
202
+ }
203
+ function D(n) {
204
+ var t;
205
+ p.value = n, (t = m.value) == null || t.trigger();
206
+ }
207
+ const U = [
208
+ {
209
+ accessorKey: "name",
210
+ header: () => s("permissionSet.table.columns.name")
211
+ },
212
+ {
213
+ accessorKey: "permission",
214
+ header: () => s("permissionSet.table.columns.permissions"),
215
+ enableSorting: !1,
216
+ cell(n) {
217
+ const t = n.row.original, f = X(
218
+ [t.id],
219
+ l.permissionSets.value
220
+ ), I = N(f);
221
+ return O(ge, { modelValue: I });
222
+ }
223
+ },
224
+ {
225
+ id: "action",
226
+ meta: {
227
+ cellClass: "pl-16",
228
+ headerContentClass: "-mx-16"
229
+ },
230
+ cell(n) {
231
+ return O("div", { class: "w-full flex justify-end items-center" }, [
232
+ O(le.FmButton, {
233
+ prependIcon: "delete",
234
+ variant: re.Tertiary,
235
+ textColor: ae.NeutralGray400,
236
+ class: "flex flex-end",
237
+ onClick: (t) => {
238
+ t.stopPropagation(), W(n.row.original);
239
+ }
240
+ })
241
+ ]);
242
+ },
243
+ enableSorting: !1
244
+ }
245
+ ];
246
+ function V() {
247
+ var n;
248
+ p.value = void 0, (n = m.value) == null || n.trigger();
249
+ }
250
+ async function W(n) {
251
+ k.open({
252
+ title: s("permissionSet.form.delete.title"),
253
+ message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
254
+ minWidth: C.value.lg ? 588 : 0,
255
+ primaryActions: {
256
+ text: s("common.remove"),
257
+ close: !1,
258
+ variant: "destructive"
259
+ },
260
+ secondaryActions: { text: s("common.cancel"), close: !0 }
261
+ }).onPrimary(async () => {
262
+ try {
263
+ await l.deletePermissionSet(n.id), a.open({
264
+ message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
265
+ type: "success"
266
+ });
267
+ } catch (t) {
268
+ const f = t instanceof Se && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
269
+ permissionSetName: n.name
270
+ }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
271
+ a.open({ message: f, type: "error" });
272
+ }
273
+ k.close();
274
+ });
275
+ }
276
+ return te(() => {
277
+ A(), i();
278
+ }), w({
279
+ create: V
280
+ }), (n, t) => {
281
+ const f = c("FmSearch"), I = c("FmTable"), z = c("FullWrapper");
282
+ return P(), $(G, null, [
283
+ r(Fe, {
284
+ ref_key: "permissionSetFormRef",
285
+ ref: m,
286
+ "model-value": p.value
287
+ }, null, 8, ["model-value"]),
288
+ y("div", Ve, [
289
+ y("div", xe, [
290
+ r(f, {
291
+ modelValue: h.value,
292
+ "onUpdate:modelValue": t[0] || (t[0] = (B) => h.value = B),
293
+ class: "w-[320px] xs:w-full",
294
+ autofocus: "",
295
+ placeholder: u(s)("permissionSet.search.placeholder")
296
+ }, null, 8, ["modelValue", "placeholder"])
297
+ ]),
298
+ d.value.length > 0 ? (P(), $("div", we, [
299
+ y("div", ke, [
300
+ r(z, null, {
301
+ default: g(() => [
302
+ r(I, {
303
+ "column-defs": U,
304
+ "row-data": F.value,
305
+ "page-size": F.value.length,
306
+ "pin-header-row": "",
307
+ "hide-footer": "",
308
+ "shrink-at": !1,
309
+ onRowClick: t[1] || (t[1] = (B) => D(B.original))
310
+ }, null, 8, ["row-data", "page-size"])
311
+ ]),
312
+ _: 1
313
+ })
314
+ ])
315
+ ])) : (P(), H(u(me), {
316
+ key: 1,
317
+ title: u(s)("permissionSet.noData.title"),
318
+ subtitle: u(s)("permissionSet.noData.subtitle")
319
+ }, null, 8, ["title", "subtitle"]))
320
+ ])
321
+ ], 64);
322
+ };
323
+ }
324
+ });
325
+ export {
326
+ Le as default
327
+ };