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

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 (47) hide show
  1. package/dist/{AuditLogList-iyCwZoot.js → AuditLogList-DQOiwup5.js} +324 -350
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-oERrzrAd.js +828 -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-C-_jj0hE.js → Main-2uJvk5L7.js} +15 -14
  7. package/dist/{Main-Br1NK5Nk.js → Main-5nIpv-Sp.js} +9 -9
  8. package/dist/{Main-CVLdj0vm.js → Main-C8ja5xs6.js} +8 -8
  9. package/dist/PermissionSetList-CtpaWlVM.js +323 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B-hvBqE0.js +3439 -0
  11. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  12. package/dist/RoleList-CDBP2W5v.js +544 -0
  13. package/dist/TeamMemberList-DSzNjP4y.js +996 -0
  14. package/dist/{TimesheetList-Cvco7hQ7.js → TimesheetList-D1ByiuwP.js} +6 -6
  15. package/dist/{app-Deq-BbQg.js → app-hS6MBhCw.js} +211 -163
  16. package/dist/app.js +1 -1
  17. package/dist/{dayjs.min-BC7eDcw3.js → dayjs.min-DFcH-XYr.js} +1 -1
  18. package/dist/{employee-CSb8K1_S.js → employee-fBtBUEwZ.js} +3 -3
  19. package/dist/{iteration-CzlBzD5p.js → iteration-D23fqAQH.js} +2 -2
  20. package/dist/{lodash-BxgA1s7j.js → lodash-Cqc7y4P5.js} +1 -1
  21. package/dist/{rule-BYb8TfeP.js → rule-BBJzenE1.js} +2 -2
  22. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  23. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  24. package/dist/src/composables/useBasePermission.d.ts +1 -0
  25. package/dist/src/views/hr/locales/index.d.ts +16 -0
  26. package/dist/src/views/team/components/BasePermission.vue.d.ts +2 -6
  27. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  28. package/dist/src/views/team/locales/index.d.ts +32 -0
  29. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -3
  30. package/dist/style.css +1 -1
  31. package/dist/team-Dq3VcGNH.js +33 -0
  32. package/dist/{timesheet-BlHG7Fw5.js → timesheet-OfLQjuvO.js} +2 -2
  33. package/dist/tsconfig.app.tsbuildinfo +1 -1
  34. package/dist/{useAppStore-tV67t5M2.js → useAppStore-Du6PRBq0.js} +1 -1
  35. package/dist/{useLoading-DWaMwG8t.js → useLoading-DkTCR5A7.js} +1 -1
  36. package/dist/{useReportPermissions-DJvfurhn.js → useReportPermissions-DhhjBwPs.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/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
+ };
@@ -4,18 +4,19 @@ 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-BBJzenE1.js";
8
+ import "./iteration-D23fqAQH.js";
9
+ import "./useAppStore-Du6PRBq0.js";
10
+ import { R as v } from "./app-hS6MBhCw.js";
11
11
  /* empty css */
12
- /* empty css */
13
- const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
12
+ /* empty css */
13
+ import "./team-Dq3VcGNH.js";
14
+ const w = { class: "space-y-24" }, P = /* @__PURE__ */ V({
14
15
  __name: "Main",
15
16
  setup(x) {
16
17
  const { t: a } = N(), f = k(), R = F(), _ = u(), b = u(), t = u("member");
17
18
  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]);
19
+ const r = B(() => n.value.find((e) => e.value === t.value) || n.value[0]);
19
20
  A(t, (e) => {
20
21
  e === "member" ? f.replace({ name: v.TEAM_MEMBER }) : e === "role" && f.replace({ name: v.TEAM_ROLE });
21
22
  });
@@ -39,20 +40,20 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
39
40
  }
40
41
  }
41
42
  ]);
42
- return (e, r) => {
43
+ return (e, l) => {
43
44
  const L = i("FmSpacer"), E = i("FmTabs"), M = i("RouterView");
44
45
  return c(), s(h, {
45
- heading: l.value.label
46
+ heading: r.value.label
46
47
  }, {
47
48
  "append-heading": p(() => {
48
49
  var o;
49
50
  return [
50
51
  d(L),
51
- (o = l.value) != null && o.createButtonLabel ? (c(), s(g, {
52
+ (o = r.value) != null && o.createButtonLabel ? (c(), s(g, {
52
53
  key: 0,
53
54
  icon: "add",
54
- label: l.value.createButtonLabel,
55
- onClick: r[0] || (r[0] = (m) => l.value.createButtonAction())
55
+ label: r.value.createButtonLabel,
56
+ onClick: l[0] || (l[0] = (m) => r.value.createButtonAction())
56
57
  }, null, 8, ["label"])) : S("", !0)
57
58
  ];
58
59
  }),
@@ -60,7 +61,7 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
60
61
  C("div", w, [
61
62
  d(E, {
62
63
  modelValue: t.value,
63
- "onUpdate:modelValue": r[1] || (r[1] = (o) => t.value = o),
64
+ "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
64
65
  items: n.value
65
66
  }, null, 8, ["modelValue", "items"]),
66
67
  d(M, null, {
@@ -81,5 +82,5 @@ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
81
82
  }
82
83
  });
83
84
  export {
84
- K as default
85
+ P as default
85
86
  };
@@ -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-Du6PRBq0.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-fBtBUEwZ.js";
10
+ import "./lodash-Cqc7y4P5.js";
11
+ import "./iteration-D23fqAQH.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-hS6MBhCw.js";
14
+ import "./rule-BBJzenE1.js";
15
+ import "./useReportPermissions-DhhjBwPs.js";
16
+ import "./dayjs.min-DFcH-XYr.js";
17
+ import "./timesheet-OfLQjuvO.js";
18
18
  var In = {};
19
19
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
20
20
  var Zt = {};
@@ -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-Du6PRBq0.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-D23fqAQH.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-hS6MBhCw.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-DkTCR5A7.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] || "";
@@ -0,0 +1,323 @@
1
+ import { defineComponent as X, ref as b, computed as S, resolveComponent as g, createBlock as W, openBlock as L, withCtx as I, createVNode as c, unref as u, createElementVNode as A, toDisplayString as ee, nextTick as se, onMounted as te, createElementBlock as oe, Fragment as ne, h as v } from "vue";
2
+ import { useI18n as G, useCoreStore as ie } from "@feedmepos/mf-common";
3
+ import { useSnackbar as H, useDialog as ae, useBreakpoints as le, components as q } from "@feedmepos/ui-library";
4
+ import { _ as re } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { _ as me } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
6
+ import { u as Q, c as Y, d as Z, p as K, i as ce, b as ue, m as N, k as de, l as pe, s as fe, n as ve, q as Se } from "./rule-BBJzenE1.js";
7
+ import { A as be } from "./iteration-D23fqAQH.js";
8
+ import { u as ge } from "./useLoading-DkTCR5A7.js";
9
+ import { p as J } from "./app-hS6MBhCw.js";
10
+ import { _ as Pe } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B-hvBqE0.js";
11
+ const _e = { class: "fm-typo-en-title-md-600" }, he = { class: "flex items-center justify-start gap-8" }, ye = /* @__PURE__ */ X({
12
+ __name: "PermissionSetForm",
13
+ props: {
14
+ modelValue: {
15
+ type: Object,
16
+ default: () => ({})
17
+ }
18
+ },
19
+ setup(M, { expose: D }) {
20
+ const t = M, { t: i } = G(), d = b(!1), $ = S(() => {
21
+ var e;
22
+ return (e = t.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
23
+ }), V = b(), U = H(), x = ge(U), P = Q(), r = b({ ...t.modelValue }), a = b([]), p = b([]), k = [(e) => !!e || "Permission set name is required"], z = S(() => {
24
+ var e;
25
+ return (e = t.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
26
+ }), E = S(
27
+ () => P.permissionSets.value.filter((e) => {
28
+ var s;
29
+ return e.id !== ((s = t.modelValue) == null ? void 0 : s.id);
30
+ }).map((e) => ({ label: e.name, value: e.id }))
31
+ ), h = S(
32
+ () => Y(a.value, P.permissionSets.value)
33
+ ), { customReportPermissions: B, isLoaded: O } = Z(), n = new Set(
34
+ K.filter((e) => e.subject.startsWith(ce)).map((e) => e.subject)
35
+ ), o = S(() => {
36
+ const e = new Set(n);
37
+ for (const s of B.value) e.add(s.subject);
38
+ return e;
39
+ }), l = S(() => {
40
+ const e = /* @__PURE__ */ new Set();
41
+ for (const s of K)
42
+ s.category === J.reports && e.add(s.subject);
43
+ for (const s of B.value)
44
+ s.category === J.reports && e.add(s.subject);
45
+ return e;
46
+ });
47
+ async function y() {
48
+ var s, m;
49
+ await se(), d.value = !d.value, r.value = { ...t.modelValue }, a.value = ((s = t.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
50
+ const e = ((m = t.modelValue) == null ? void 0 : m.permissions) ?? [];
51
+ p.value = ue(
52
+ N(h.value),
53
+ e
54
+ );
55
+ }
56
+ function C() {
57
+ const e = N(h.value), s = O.value ? o.value : n, m = de(p.value, s), w = pe(m, l.value), F = fe(w);
58
+ return ve(e, F);
59
+ }
60
+ function _() {
61
+ p.value = N(h.value);
62
+ }
63
+ async function T() {
64
+ var m, w;
65
+ const e = await ((m = V.value) == null ? void 0 : m.validateInputsWithoutSubmit()), s = (w = ie().currentBusiness.value) == null ? void 0 : w.id;
66
+ !(e != null && e.length) && s && x.minor(async () => {
67
+ var R;
68
+ const F = C();
69
+ if ((R = t.modelValue) != null && R.id) {
70
+ const j = {
71
+ name: r.value.name,
72
+ permissions: F,
73
+ permissionSetIds: a.value,
74
+ businessId: r.value.businessId
75
+ };
76
+ await P.updatePermissionSet(t.modelValue.id, j);
77
+ } else {
78
+ const j = {
79
+ name: r.value.name,
80
+ businessId: s,
81
+ permissions: F,
82
+ permissionSetIds: a.value
83
+ };
84
+ await P.createPermissionSet(j);
85
+ }
86
+ d.value = !1;
87
+ });
88
+ }
89
+ return D({
90
+ trigger: y
91
+ }), (e, s) => {
92
+ const m = g("FmTextField"), w = g("FmSelect"), F = g("FmForm"), R = g("FmButton"), j = g("FmSideSheet");
93
+ return L(), W(j, {
94
+ modelValue: d.value,
95
+ "onUpdate:modelValue": s[4] || (s[4] = (f) => d.value = f),
96
+ "max-width": 960,
97
+ "dismiss-away": ""
98
+ }, {
99
+ "side-sheet-header": I(() => [
100
+ A("p", _e, ee($.value), 1)
101
+ ]),
102
+ "side-sheet-footer": I(() => [
103
+ A("div", he, [
104
+ c(R, {
105
+ label: z.value,
106
+ size: "md",
107
+ variant: "primary",
108
+ type: "submit",
109
+ onClick: T
110
+ }, null, 8, ["label"]),
111
+ c(R, {
112
+ label: u(i)("common.cancel"),
113
+ size: "md",
114
+ variant: "secondary",
115
+ onClick: s[3] || (s[3] = (f) => d.value = !1)
116
+ }, null, 8, ["label"])
117
+ ])
118
+ ]),
119
+ default: I(() => [
120
+ c(F, {
121
+ ref_key: "formRef",
122
+ ref: V
123
+ }, {
124
+ default: I(() => [
125
+ c(m, {
126
+ modelValue: r.value.name,
127
+ "onUpdate:modelValue": s[0] || (s[0] = (f) => r.value.name = f),
128
+ label: u(i)("permissionSet.form.name"),
129
+ placeholder: u(i)("permissionSet.form.namePlaceholder"),
130
+ rules: k
131
+ }, null, 8, ["modelValue", "label", "placeholder"]),
132
+ c(w, {
133
+ modelValue: a.value,
134
+ "onUpdate:modelValue": [
135
+ s[1] || (s[1] = (f) => a.value = f),
136
+ _
137
+ ],
138
+ multiselect: "",
139
+ searchable: "",
140
+ "search-debounce": 300,
141
+ items: E.value,
142
+ label: u(i)("permissionSet.form.includedSets"),
143
+ placeholder: u(i)("permissionSet.form.includedSetsPlaceholder"),
144
+ class: "mt-16"
145
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
146
+ c(Pe, {
147
+ modelValue: p.value,
148
+ "onUpdate:modelValue": s[2] || (s[2] = (f) => p.value = f),
149
+ "inherit-permissions": h.value,
150
+ class: "mt-24"
151
+ }, null, 8, ["modelValue", "inherit-permissions"])
152
+ ]),
153
+ _: 1
154
+ }, 512)
155
+ ]),
156
+ _: 1
157
+ }, 8, ["modelValue"]);
158
+ };
159
+ }
160
+ }), we = { class: "space-y-8" }, Fe = { class: "flex justify-end xs:px-16" }, Te = /* @__PURE__ */ X({
161
+ __name: "PermissionSetList",
162
+ setup(M, { expose: D }) {
163
+ const { t } = G(), { customReportPermissions: i, fetchCustomReportPermissions: d } = Z(), $ = H(), V = ae(), { breakpoints: U } = le(), x = b(""), P = S(() => {
164
+ var n;
165
+ return (n = p.value) == null ? void 0 : n.filter((o) => {
166
+ const l = x.value.toLowerCase();
167
+ return o.name.toLowerCase().includes(l);
168
+ });
169
+ }), r = b(), a = Q(), p = S(
170
+ () => a.permissionSets.value
171
+ ), k = b();
172
+ async function z() {
173
+ await a.readPermissionSets();
174
+ }
175
+ function E(n) {
176
+ var o;
177
+ k.value = n, (o = r.value) == null || o.trigger();
178
+ }
179
+ const h = [
180
+ {
181
+ accessorKey: "name",
182
+ header: () => t("permissionSet.table.columns.name")
183
+ },
184
+ {
185
+ accessorKey: "permission",
186
+ header: () => t("permissionSet.table.columns.permissions"),
187
+ enableSorting: !1,
188
+ cell(n) {
189
+ const o = n.row.original, l = Y(
190
+ [o.id],
191
+ a.permissionSets.value
192
+ ), y = N(l), C = y.length, _ = Se(y, i.value);
193
+ return v("div", { class: "flex items-center gap-8" }, [
194
+ v("span", t("team.labels.allowedCount", { count: C })),
195
+ v(
196
+ q.FmTooltip,
197
+ { variant: "plain", placement: "top" },
198
+ {
199
+ default: () => v(q.FmIcon, {
200
+ name: "info",
201
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
202
+ }),
203
+ content: () => v("div", [
204
+ t("team.labels.permission"),
205
+ ..._.map(
206
+ (T, e) => v("div", { key: `${T}-${e}` }, `- ${T}`)
207
+ )
208
+ ])
209
+ }
210
+ )
211
+ ]);
212
+ }
213
+ },
214
+ {
215
+ id: "action",
216
+ size: 52,
217
+ meta: {
218
+ cellClass: "pl-16",
219
+ headerContentClass: "-mx-16"
220
+ },
221
+ cell(n) {
222
+ const o = n.row.original;
223
+ return v(
224
+ "div",
225
+ { class: "flex w-full items-center justify-end", onClick: (l) => l.stopPropagation() },
226
+ [
227
+ v(me, {
228
+ items: [
229
+ { label: t("common.update"), onClick: () => E(o) },
230
+ {
231
+ label: t("common.remove"),
232
+ onClick: () => O(o),
233
+ itemClass: "text-fm-color-typo-error"
234
+ }
235
+ ]
236
+ })
237
+ ]
238
+ );
239
+ },
240
+ enableSorting: !1
241
+ }
242
+ ];
243
+ function B() {
244
+ var n;
245
+ k.value = void 0, (n = r.value) == null || n.trigger();
246
+ }
247
+ async function O(n) {
248
+ V.open({
249
+ title: t("permissionSet.form.delete.title"),
250
+ message: t("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
251
+ minWidth: U.value.lg ? 588 : 0,
252
+ primaryActions: {
253
+ text: t("common.remove"),
254
+ close: !1,
255
+ variant: "destructive"
256
+ },
257
+ secondaryActions: { text: t("common.cancel"), close: !0 }
258
+ }).onPrimary(async () => {
259
+ try {
260
+ await a.deletePermissionSet(n.id), $.open({
261
+ message: t("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
262
+ type: "success"
263
+ });
264
+ } catch (o) {
265
+ const l = o instanceof be && o.status === 409 ? o.message.includes("referenced by") ? t("permissionSet.form.delete.setReferencedConflictError", {
266
+ permissionSetName: n.name
267
+ }) : t("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : o instanceof Error ? o.message : `${o}`;
268
+ $.open({ message: l, type: "error" });
269
+ }
270
+ V.close();
271
+ });
272
+ }
273
+ return te(() => {
274
+ z(), d();
275
+ }), D({
276
+ create: B
277
+ }), (n, o) => {
278
+ const l = g("FmSearch"), y = g("FmTable"), C = g("FullWrapper");
279
+ return L(), oe(ne, null, [
280
+ c(ye, {
281
+ ref_key: "permissionSetFormRef",
282
+ ref: r,
283
+ "model-value": k.value
284
+ }, null, 8, ["model-value"]),
285
+ A("div", we, [
286
+ A("div", Fe, [
287
+ c(l, {
288
+ modelValue: x.value,
289
+ "onUpdate:modelValue": o[0] || (o[0] = (_) => x.value = _),
290
+ class: "w-[320px] xs:w-full",
291
+ autofocus: "",
292
+ placeholder: u(t)("permissionSet.search.placeholder")
293
+ }, null, 8, ["modelValue", "placeholder"])
294
+ ]),
295
+ p.value.length > 0 ? (L(), W(C, {
296
+ key: 0,
297
+ class: "overflow-auto"
298
+ }, {
299
+ default: I(() => [
300
+ c(y, {
301
+ "column-defs": h,
302
+ "row-data": P.value,
303
+ "page-size": P.value.length,
304
+ "pin-header-row": "",
305
+ "hide-footer": "",
306
+ "shrink-at": !1,
307
+ onRowClick: o[1] || (o[1] = (_) => E(_.original))
308
+ }, null, 8, ["row-data", "page-size"])
309
+ ]),
310
+ _: 1
311
+ })) : (L(), W(u(re), {
312
+ key: 1,
313
+ title: u(t)("permissionSet.noData.title"),
314
+ subtitle: u(t)("permissionSet.noData.subtitle")
315
+ }, null, 8, ["title", "subtitle"]))
316
+ ])
317
+ ], 64);
318
+ };
319
+ }
320
+ });
321
+ export {
322
+ Te as default
323
+ };