@feedmepos/mf-hrm-portal 2.0.16 → 2.0.17-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/{AuditLogList-iyCwZoot.js → AuditLogList-C6qAeY5g.js} +324 -350
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-COtXtTqG.js +827 -0
  4. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +34 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  6. package/dist/{Main-CVLdj0vm.js → Main--tejoyEP.js} +8 -8
  7. package/dist/{Main-C-_jj0hE.js → Main-BNXKItvX.js} +16 -14
  8. package/dist/{Main-Br1NK5Nk.js → Main-Dkr5lzbv.js} +9 -9
  9. package/dist/PermissionSetList-B_Sdvbu7.js +340 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js +3439 -0
  11. package/dist/RoleList-SZCgvYvC.js +543 -0
  12. package/dist/TeamMemberList-Dk5HeFfQ.js +1008 -0
  13. package/dist/{TimesheetList-Cvco7hQ7.js → TimesheetList-D-3k0Uad.js} +6 -6
  14. package/dist/{app-Deq-BbQg.js → app-BjXuSCis.js} +211 -163
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-BC7eDcw3.js → dayjs.min-z-vrgFCL.js} +1 -1
  17. package/dist/{employee-CSb8K1_S.js → employee-DAqAMupR.js} +3 -3
  18. package/dist/{iteration-CzlBzD5p.js → iteration-Cp1eSTJA.js} +2 -2
  19. package/dist/{lodash-BxgA1s7j.js → lodash-CXLZQQp8.js} +1 -1
  20. package/dist/{rule-BYb8TfeP.js → rule-vBxopbM_.js} +2 -2
  21. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  22. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  23. package/dist/src/composables/useBasePermission.d.ts +1 -0
  24. package/dist/src/views/hr/locales/index.d.ts +16 -0
  25. package/dist/src/views/team/components/BasePermission.vue.d.ts +2 -6
  26. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  27. package/dist/src/views/team/locales/index.d.ts +32 -0
  28. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  29. package/dist/style.css +1 -1
  30. package/dist/team-CnQ_rIx2.js +33 -0
  31. package/dist/{timesheet-BlHG7Fw5.js → timesheet-BlPhOifI.js} +2 -2
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/{useAppStore-tV67t5M2.js → useAppStore-BVnrWyPF.js} +1 -1
  34. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  35. package/dist/{useLoading-DWaMwG8t.js → useLoading-7ia-Bps7.js} +1 -1
  36. package/dist/{useReportPermissions-DJvfurhn.js → useReportPermissions-C8HMek35.js} +3 -3
  37. package/dist/useSearch-BAPEUu1R.js +15 -0
  38. package/package.json +1 -1
  39. package/dist/EmployeeList-CJvHFQnQ.js +0 -736
  40. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  41. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  42. package/dist/PermissionSetList-4lJbnJsE.js +0 -334
  43. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DJniPhu1.js +0 -3476
  44. package/dist/RoleList-C0NI4ooY.js +0 -528
  45. package/dist/TeamMemberList-CGjxliOv.js +0 -1108
  46. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  47. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  48. package/dist/useSearch-B6WK1LBB.js +0 -15
@@ -0,0 +1,34 @@
1
+ import { createElementBlock as s, openBlock as n, createElementVNode as o, defineComponent as l, renderSlot as r, createCommentVNode as i, toDisplayString as c } from "vue";
2
+ import { _ as a } from "./SelectFilter-DUj7GBtT.js";
3
+ const d = {};
4
+ function m(t, e) {
5
+ return n(), s("div", null, [...e[0] || (e[0] = [
6
+ o("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
7
+ ])]);
8
+ }
9
+ const x = /* @__PURE__ */ a(d, [["render", m]]), p = { class: "space-y-8" }, _ = { class: "flex items-center justify-between" }, f = { class: "space-y-8" }, u = { class: "fm-typo-en-body-lg-600" }, y = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
12
+ }, g = /* @__PURE__ */ l({
13
+ __name: "FormItem",
14
+ props: {
15
+ label: {},
16
+ description: {}
17
+ },
18
+ setup(t) {
19
+ return (e, b) => (n(), s("div", p, [
20
+ o("div", _, [
21
+ o("div", f, [
22
+ o("p", u, c(t.label), 1),
23
+ t.description ? (n(), s("p", y, c(t.description), 1)) : i("", !0)
24
+ ]),
25
+ r(e.$slots, "append")
26
+ ]),
27
+ r(e.$slots, "default")
28
+ ]));
29
+ }
30
+ });
31
+ export {
32
+ x as H,
33
+ g as _
34
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent as c, createElementBlock as s, openBlock as l, normalizeClass as r, renderSlot as n, createCommentVNode as o, createVNode as d, createElementVNode as a, toDisplayString as i, withCtx as f } from "vue";
2
+ const h = /* @__PURE__ */ c({
3
+ __name: "FormColumn",
4
+ props: {
5
+ shrinkable: { type: Boolean }
6
+ },
7
+ setup(e) {
8
+ return (t, m) => (l(), s("div", {
9
+ class: r(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
10
+ }, [
11
+ n(t.$slots, "default")
12
+ ], 2));
13
+ }
14
+ }), u = {
15
+ key: 0,
16
+ class: "flex flex-row justify-between items-center"
17
+ }, y = { class: "space-y-4" }, p = { class: "fm-typo-en-title-sm-600" }, b = {
18
+ key: 0,
19
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
20
+ }, x = /* @__PURE__ */ c({
21
+ __name: "FormSection",
22
+ props: {
23
+ title: {},
24
+ subTitle: {},
25
+ shrinkable: { type: Boolean }
26
+ },
27
+ setup(e) {
28
+ return (t, m) => (l(), s("div", {
29
+ class: r(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
30
+ }, [
31
+ e.title ? (l(), s("div", u, [
32
+ a("div", y, [
33
+ a("p", p, i(e.title), 1),
34
+ e.subTitle ? (l(), s("p", b, i(e.subTitle), 1)) : o("", !0)
35
+ ]),
36
+ n(t.$slots, "append-title")
37
+ ])) : o("", !0),
38
+ d(h, { shrinkable: e.shrinkable }, {
39
+ default: f(() => [
40
+ n(t.$slots, "default")
41
+ ]),
42
+ _: 3
43
+ }, 8, ["shrinkable"])
44
+ ], 2));
45
+ }
46
+ });
47
+ export {
48
+ x as _
49
+ };
@@ -1,17 +1,17 @@
1
1
  import { ref as S, defineComponent as J, computed as F, watch as ce, resolveComponent as h, createElementBlock as D, openBlock as I, Fragment as W, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as K, isRef as ae, renderList as fe, createCommentVNode as ve, withModifiers as se, createTextVNode as re, normalizeClass as _e, h as _ } from "vue";
2
2
  import { useCoreStore as Q, useI18n as X, RestaurantSelector as oe } from "@feedmepos/mf-common";
3
3
  import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
4
- import { u as Y } from "./useAppStore-tV67t5M2.js";
4
+ import { u as Y } from "./useAppStore-BVnrWyPF.js";
5
5
  import { defineStore as Ue } from "pinia";
6
- import { g as z, a as he, b as O } from "./iteration-CzlBzD5p.js";
6
+ import { g as z, a as he, b as O } from "./iteration-Cp1eSTJA.js";
7
7
  import { useSnackbar as ie, components as E, useDialog as xe, useBreakpoints as be, FmButtonVariant as q } from "@feedmepos/ui-library";
8
8
  import { S as ne } from "./SelectFilter-DUj7GBtT.js";
9
- import { _ as we } from "./app-Deq-BbQg.js";
10
- import { H as ke } from "./HorizontalSplitter-o860F4xM.js";
9
+ import { _ as we } from "./app-BjXuSCis.js";
10
+ import { _ as le, H as ke } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
11
11
  import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
- import { u as Fe } from "./useSearch-B6WK1LBB.js";
13
- import { u as ue } from "./useLoading-DWaMwG8t.js";
14
- import { _ as Ie, a as le } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
12
+ import { u as Fe } from "./useSearch-BAPEUu1R.js";
13
+ import { u as ue } from "./useLoading-7ia-Bps7.js";
14
+ import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
15
15
  const H = {
16
16
  async getGrantUsers() {
17
17
  return z(await O("grant").get(""));
@@ -247,7 +247,7 @@ const H = {
247
247
  } = Y(), r = F(() => b.grantUsers), {
248
248
  searchKey: c,
249
249
  filter: i
250
- } = Fe(""), w = F(() => {
250
+ } = Fe(), w = F(() => {
251
251
  var t;
252
252
  return (t = r.value) == null ? void 0 : t.filter((e) => {
253
253
  const v = !U.value || U.value.includes(e.restaurantId), T = !B.value || B.value.includes(e.status), A = C.value[e.restaurantId] || "", j = V.value[e.roleId] || "";
@@ -4,18 +4,20 @@ 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 "./rule-BYb8TfeP.js";
8
- import "./iteration-CzlBzD5p.js";
9
- import { R as v } from "./app-Deq-BbQg.js";
10
- import "./useAppStore-tV67t5M2.js";
7
+ import "./rule-vBxopbM_.js";
8
+ import "./lodash-CXLZQQp8.js";
9
+ import "./iteration-Cp1eSTJA.js";
10
+ import "./useAppStore-BVnrWyPF.js";
11
+ import { R as v } from "./app-BjXuSCis.js";
11
12
  /* empty css */
12
- /* empty css */
13
- const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
13
+ /* empty css */
14
+ import "./team-CnQ_rIx2.js";
15
+ const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
14
16
  __name: "Main",
15
17
  setup(x) {
16
18
  const { t: a } = N(), f = k(), R = F(), _ = u(), b = u(), t = u("member");
17
19
  R.name === v.TEAM_ROLE ? t.value = "role" : t.value = "member";
18
- const l = B(() => n.value.find((e) => e.value === t.value) || n.value[0]);
20
+ const r = B(() => n.value.find((e) => e.value === t.value) || n.value[0]);
19
21
  A(t, (e) => {
20
22
  e === "member" ? f.replace({ name: v.TEAM_MEMBER }) : e === "role" && f.replace({ name: v.TEAM_ROLE });
21
23
  });
@@ -39,20 +41,20 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
39
41
  }
40
42
  }
41
43
  ]);
42
- return (e, r) => {
44
+ return (e, l) => {
43
45
  const L = i("FmSpacer"), E = i("FmTabs"), M = i("RouterView");
44
46
  return c(), s(h, {
45
- heading: l.value.label
47
+ heading: r.value.label
46
48
  }, {
47
49
  "append-heading": p(() => {
48
50
  var o;
49
51
  return [
50
52
  d(L),
51
- (o = l.value) != null && o.createButtonLabel ? (c(), s(g, {
53
+ (o = r.value) != null && o.createButtonLabel ? (c(), s(g, {
52
54
  key: 0,
53
55
  icon: "add",
54
- label: l.value.createButtonLabel,
55
- onClick: r[0] || (r[0] = (m) => l.value.createButtonAction())
56
+ label: r.value.createButtonLabel,
57
+ onClick: l[0] || (l[0] = (m) => r.value.createButtonAction())
56
58
  }, null, 8, ["label"])) : S("", !0)
57
59
  ];
58
60
  }),
@@ -60,7 +62,7 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
60
62
  C("div", w, [
61
63
  d(E, {
62
64
  modelValue: t.value,
63
- "onUpdate:modelValue": r[1] || (r[1] = (o) => t.value = o),
65
+ "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
64
66
  items: n.value
65
67
  }, null, 8, ["modelValue", "items"]),
66
68
  d(M, null, {
@@ -81,5 +83,5 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
81
83
  }
82
84
  });
83
85
  export {
84
- K as default
86
+ Q as default
85
87
  };
@@ -3,18 +3,18 @@ import { useRouter as lf, useRoute as of } from "vue-router";
3
3
  import { useCoreStore as cf, useI18n as hf } from "@feedmepos/mf-common";
4
4
  import { _ as uf } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
5
  import { _ as vf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { u as pf } from "./useAppStore-tV67t5M2.js";
6
+ import { u as pf } from "./useAppStore-BVnrWyPF.js";
7
7
  import "@feedmepos/ui-library";
8
8
  /* empty css */
9
- import "./employee-CSb8K1_S.js";
10
- import "./lodash-BxgA1s7j.js";
11
- import "./iteration-CzlBzD5p.js";
9
+ import "./employee-DAqAMupR.js";
10
+ import "./lodash-CXLZQQp8.js";
11
+ import "./iteration-Cp1eSTJA.js";
12
12
  /* empty css */
13
- import { R as vt } from "./app-Deq-BbQg.js";
14
- import "./rule-BYb8TfeP.js";
15
- import "./useReportPermissions-DJvfurhn.js";
16
- import "./dayjs.min-BC7eDcw3.js";
17
- import "./timesheet-BlHG7Fw5.js";
13
+ import { R as vt } from "./app-BjXuSCis.js";
14
+ import "./rule-vBxopbM_.js";
15
+ import "./useReportPermissions-C8HMek35.js";
16
+ import "./dayjs.min-z-vrgFCL.js";
17
+ import "./timesheet-BlPhOifI.js";
18
18
  var In = {};
19
19
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
20
20
  var Zt = {};
@@ -0,0 +1,340 @@
1
+ import { defineComponent as H, ref as p, computed as P, resolveComponent as _, createBlock as M, openBlock as L, unref as m, withCtx as E, createVNode as f, createElementVNode as D, toDisplayString as te, nextTick as ne, onMounted as ie, createElementBlock as ae, Fragment as le, h as b } from "vue";
2
+ import { useI18n as Q, useCoreStore as re } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Y, useDialog as me, useBreakpoints as ce, components as J } from "@feedmepos/ui-library";
4
+ import { _ as ue } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { u as de, _ as pe } from "./useDiscardConfirm-DPhEV6v0.js";
6
+ import { u as Z, c as ee, d as se, p as X, i as fe, b as ve, m as A, k as Se, l as be, s as Pe, n as _e, q as ge } from "./rule-vBxopbM_.js";
7
+ import { l as W } from "./lodash-CXLZQQp8.js";
8
+ import { d as he, A as ye } from "./iteration-Cp1eSTJA.js";
9
+ import { u as we } from "./useLoading-7ia-Bps7.js";
10
+ import { p as G } from "./app-BjXuSCis.js";
11
+ import { _ as Fe } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js";
12
+ const Ve = { class: "fm-typo-en-title-md-600" }, ke = { class: "flex items-center justify-start gap-8" }, xe = /* @__PURE__ */ H({
13
+ __name: "PermissionSetForm",
14
+ props: {
15
+ modelValue: {
16
+ type: Object,
17
+ default: () => ({})
18
+ }
19
+ },
20
+ setup(K, { expose: N }) {
21
+ const o = K, { t: l } = Q(), v = p(!1), j = P(() => {
22
+ var e;
23
+ return (e = o.modelValue) != null && e.id ? l("permissionSet.form.update.title") : l("permissionSet.form.create.title");
24
+ }), V = p(), O = Y(), k = we(O), g = Z(), a = p({ ...o.modelValue }), i = p([]), c = p([]), x = [(e) => !!e || "Permission set name is required"], U = P(() => {
25
+ var e;
26
+ return (e = o.modelValue) != null && e.id ? l("permissionSet.form.update.confirmButtonLabel") : l("permissionSet.form.create.confirmButtonLabel");
27
+ }), $ = P(
28
+ () => g.permissionSets.value.filter((e) => {
29
+ var s;
30
+ return e.id !== ((s = o.modelValue) == null ? void 0 : s.id);
31
+ }).map((e) => ({ label: e.name, value: e.id }))
32
+ ), y = P(
33
+ () => ee(i.value, g.permissionSets.value)
34
+ ), { customReportPermissions: B, isLoaded: q } = se(), n = new Set(
35
+ X.filter((e) => e.subject.startsWith(fe)).map((e) => e.subject)
36
+ ), t = P(() => {
37
+ const e = new Set(n);
38
+ for (const s of B.value) e.add(s.subject);
39
+ return e;
40
+ }), r = P(() => {
41
+ const e = /* @__PURE__ */ new Set();
42
+ for (const s of X)
43
+ s.category === G.reports && e.add(s.subject);
44
+ for (const s of B.value)
45
+ s.category === G.reports && e.add(s.subject);
46
+ return e;
47
+ }), u = p({ name: "", permissionSetIds: [], userPermissions: [] });
48
+ async function C() {
49
+ var s, d;
50
+ await ne(), v.value = !v.value, a.value = { ...o.modelValue }, i.value = ((s = o.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
51
+ const e = ((d = o.modelValue) == null ? void 0 : d.permissions) ?? [];
52
+ c.value = ve(
53
+ A(y.value),
54
+ e
55
+ ), u.value = {
56
+ name: a.value.name ?? "",
57
+ permissionSetIds: [...i.value],
58
+ userPermissions: he(c.value)
59
+ };
60
+ }
61
+ const S = de(
62
+ () => !W.isEqual(a.value.name ?? "", u.value.name) || !W.isEqual(i.value, u.value.permissionSetIds) || !W.isEqual(c.value, u.value.userPermissions),
63
+ () => {
64
+ v.value = !1;
65
+ }
66
+ );
67
+ function T() {
68
+ const e = A(y.value), s = q.value ? t.value : n, d = Se(c.value, s), w = be(d, r.value), F = Pe(w);
69
+ return _e(e, F);
70
+ }
71
+ function z() {
72
+ c.value = A(y.value);
73
+ }
74
+ async function oe() {
75
+ var d, w;
76
+ const e = await ((d = V.value) == null ? void 0 : d.validateInputsWithoutSubmit()), s = (w = re().currentBusiness.value) == null ? void 0 : w.id;
77
+ !(e != null && e.length) && s && k.minor(async () => {
78
+ var R;
79
+ const F = T();
80
+ if ((R = o.modelValue) != null && R.id) {
81
+ const I = {
82
+ name: a.value.name,
83
+ permissions: F,
84
+ permissionSetIds: i.value,
85
+ businessId: a.value.businessId
86
+ };
87
+ await g.updatePermissionSet(o.modelValue.id, I);
88
+ } else {
89
+ const I = {
90
+ name: a.value.name,
91
+ businessId: s,
92
+ permissions: F,
93
+ permissionSetIds: i.value
94
+ };
95
+ await g.createPermissionSet(I);
96
+ }
97
+ v.value = !1;
98
+ });
99
+ }
100
+ return N({
101
+ trigger: C
102
+ }), (e, s) => {
103
+ const d = _("FmTextField"), w = _("FmSelect"), F = _("FmForm"), R = _("FmButton"), I = _("FmSideSheet");
104
+ return L(), M(I, {
105
+ modelValue: v.value,
106
+ "onUpdate:modelValue": s[3] || (s[3] = (h) => v.value = h),
107
+ "max-width": 960,
108
+ "onOn:clickedAway": m(S)
109
+ }, {
110
+ "side-sheet-header": E(() => [
111
+ D("p", Ve, te(j.value), 1)
112
+ ]),
113
+ "side-sheet-footer": E(() => [
114
+ D("div", ke, [
115
+ f(R, {
116
+ label: U.value,
117
+ size: "md",
118
+ variant: "primary",
119
+ type: "submit",
120
+ onClick: oe
121
+ }, null, 8, ["label"]),
122
+ f(R, {
123
+ label: m(l)("common.cancel"),
124
+ size: "md",
125
+ variant: "secondary",
126
+ onClick: m(S)
127
+ }, null, 8, ["label", "onClick"])
128
+ ])
129
+ ]),
130
+ default: E(() => [
131
+ f(F, {
132
+ ref_key: "formRef",
133
+ ref: V
134
+ }, {
135
+ default: E(() => [
136
+ f(d, {
137
+ modelValue: a.value.name,
138
+ "onUpdate:modelValue": s[0] || (s[0] = (h) => a.value.name = h),
139
+ label: m(l)("permissionSet.form.name"),
140
+ placeholder: m(l)("permissionSet.form.namePlaceholder"),
141
+ rules: x
142
+ }, null, 8, ["modelValue", "label", "placeholder"]),
143
+ f(w, {
144
+ modelValue: i.value,
145
+ "onUpdate:modelValue": [
146
+ s[1] || (s[1] = (h) => i.value = h),
147
+ z
148
+ ],
149
+ multiselect: "",
150
+ searchable: "",
151
+ "search-debounce": 300,
152
+ items: $.value,
153
+ label: m(l)("permissionSet.form.includedSets"),
154
+ placeholder: m(l)("permissionSet.form.includedSetsPlaceholder"),
155
+ class: "mt-16"
156
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
157
+ f(Fe, {
158
+ modelValue: c.value,
159
+ "onUpdate:modelValue": s[2] || (s[2] = (h) => c.value = h),
160
+ "inherit-permissions": y.value,
161
+ class: "mt-24"
162
+ }, null, 8, ["modelValue", "inherit-permissions"])
163
+ ]),
164
+ _: 1
165
+ }, 512)
166
+ ]),
167
+ _: 1
168
+ }, 8, ["modelValue", "onOn:clickedAway"]);
169
+ };
170
+ }
171
+ }), Ce = { class: "space-y-8" }, Re = { class: "flex justify-end xs:px-16" }, Ue = /* @__PURE__ */ H({
172
+ __name: "PermissionSetList",
173
+ setup(K, { expose: N }) {
174
+ const { t: o } = Q(), { customReportPermissions: l, fetchCustomReportPermissions: v } = se(), j = Y(), V = me(), { breakpoints: O } = ce(), k = p(""), g = P(() => {
175
+ var n;
176
+ return (n = c.value) == null ? void 0 : n.filter((t) => {
177
+ const r = k.value.toLowerCase();
178
+ return t.name.toLowerCase().includes(r);
179
+ });
180
+ }), a = p(), i = Z(), c = P(
181
+ () => i.permissionSets.value
182
+ ), x = p();
183
+ async function U() {
184
+ await i.readPermissionSets();
185
+ }
186
+ function $(n) {
187
+ var t;
188
+ x.value = n, (t = a.value) == null || t.trigger();
189
+ }
190
+ const y = [
191
+ {
192
+ accessorKey: "name",
193
+ header: () => o("permissionSet.table.columns.name")
194
+ },
195
+ {
196
+ accessorKey: "permission",
197
+ header: () => o("permissionSet.table.columns.permissions"),
198
+ enableSorting: !1,
199
+ cell(n) {
200
+ const t = n.row.original, r = ee(
201
+ [t.id],
202
+ i.permissionSets.value
203
+ ), u = A(r), C = u.length, S = ge(
204
+ u,
205
+ l.value
206
+ );
207
+ return b("div", { class: "flex items-center gap-8" }, [
208
+ b("span", o("team.labels.allowed", { count: C })),
209
+ b(
210
+ J.FmTooltip,
211
+ { variant: "plain", placement: "top" },
212
+ {
213
+ default: () => b(J.FmIcon, {
214
+ name: "info",
215
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
216
+ }),
217
+ content: () => b("div", [
218
+ o("team.labels.permission"),
219
+ ...S.map(
220
+ (T, z) => b("div", { key: `${T}-${z}` }, `- ${T}`)
221
+ )
222
+ ])
223
+ }
224
+ )
225
+ ]);
226
+ }
227
+ },
228
+ {
229
+ id: "action",
230
+ size: 52,
231
+ meta: {
232
+ cellClass: "pl-16",
233
+ headerContentClass: "-mx-16"
234
+ },
235
+ cell(n) {
236
+ const t = n.row.original;
237
+ return b(
238
+ "div",
239
+ {
240
+ class: "flex w-full items-center justify-end",
241
+ onClick: (r) => r.stopPropagation()
242
+ },
243
+ [
244
+ b(pe, {
245
+ items: [
246
+ { label: o("common.update"), onClick: () => $(t) },
247
+ {
248
+ label: o("common.remove"),
249
+ onClick: () => q(t),
250
+ itemClass: "text-fm-color-typo-error"
251
+ }
252
+ ]
253
+ })
254
+ ]
255
+ );
256
+ },
257
+ enableSorting: !1
258
+ }
259
+ ];
260
+ function B() {
261
+ var n;
262
+ x.value = void 0, (n = a.value) == null || n.trigger();
263
+ }
264
+ async function q(n) {
265
+ V.open({
266
+ title: o("permissionSet.form.delete.title"),
267
+ message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
268
+ minWidth: O.value.lg ? 588 : 0,
269
+ primaryActions: {
270
+ text: o("common.remove"),
271
+ close: !1,
272
+ variant: "destructive"
273
+ },
274
+ secondaryActions: { text: o("common.cancel"), close: !0 }
275
+ }).onPrimary(async () => {
276
+ try {
277
+ await i.deletePermissionSet(n.id), j.open({
278
+ message: o("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
279
+ type: "success"
280
+ });
281
+ } catch (t) {
282
+ const r = t instanceof ye && t.status === 409 ? t.message.includes("referenced by") ? o("permissionSet.form.delete.setReferencedConflictError", {
283
+ permissionSetName: n.name
284
+ }) : o("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
285
+ j.open({ message: r, type: "error" });
286
+ }
287
+ V.close();
288
+ });
289
+ }
290
+ return ie(() => {
291
+ U(), v();
292
+ }), N({
293
+ create: B
294
+ }), (n, t) => {
295
+ const r = _("FmSearch"), u = _("FmTable"), C = _("FullWrapper");
296
+ return L(), ae(le, null, [
297
+ f(xe, {
298
+ ref_key: "permissionSetFormRef",
299
+ ref: a,
300
+ "model-value": x.value
301
+ }, null, 8, ["model-value"]),
302
+ D("div", Ce, [
303
+ D("div", Re, [
304
+ f(r, {
305
+ modelValue: k.value,
306
+ "onUpdate:modelValue": t[0] || (t[0] = (S) => k.value = S),
307
+ class: "w-[320px] xs:w-full",
308
+ autofocus: "",
309
+ placeholder: m(o)("permissionSet.search.placeholder")
310
+ }, null, 8, ["modelValue", "placeholder"])
311
+ ]),
312
+ c.value.length > 0 ? (L(), M(C, {
313
+ key: 0,
314
+ class: "overflow-auto"
315
+ }, {
316
+ default: E(() => [
317
+ f(u, {
318
+ "column-defs": y,
319
+ "row-data": g.value,
320
+ "page-size": g.value.length,
321
+ "pin-header-row": "",
322
+ "hide-footer": "",
323
+ "shrink-at": !1,
324
+ onRowClick: t[1] || (t[1] = (S) => $(S.original))
325
+ }, null, 8, ["row-data", "page-size"])
326
+ ]),
327
+ _: 1
328
+ })) : (L(), M(m(ue), {
329
+ key: 1,
330
+ title: m(o)("permissionSet.noData.title"),
331
+ subtitle: m(o)("permissionSet.noData.subtitle")
332
+ }, null, 8, ["title", "subtitle"]))
333
+ ])
334
+ ], 64);
335
+ };
336
+ }
337
+ });
338
+ export {
339
+ Ue as default
340
+ };