@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.17

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 (54) hide show
  1. package/dist/AuditLogList-DwCmJovS.js +980 -0
  2. package/dist/EmployeeList-8166DlII.js +736 -0
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/{Main-w0XUUaBp.js → Main-C4LaqZaa.js} +14 -16
  6. package/dist/{Main-pTgqNncY.js → Main-C7Q3OELU.js} +128 -128
  7. package/dist/{Main-CQ3KwxDY.js → Main-CCTDT_TG.js} +1371 -1368
  8. package/dist/PermissionSetList-trnHwNFR.js +341 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bc5nE9NF.js +3480 -0
  10. package/dist/RoleList-DJtbEUSC.js +530 -0
  11. package/dist/TeamMemberList-C6qx-yJi.js +1108 -0
  12. package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-DhKfguOb.js} +6 -6
  13. package/dist/{app-COJbSNM4.js → app--3WguZOC.js} +711 -759
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-RrLy0N6G.js} +1 -1
  16. package/dist/{employee-xiV0LfnL.js → employee-DSAStcBv.js} +3 -3
  17. package/dist/{iteration-JOKbtlLf.js → iteration-BQA73VxD.js} +2 -2
  18. package/dist/{lodash-D5xlVzib.js → lodash-B1ouSWpG.js} +1 -1
  19. package/dist/{rule-3sXHiW0y.js → rule-BL-miuus.js} +181 -179
  20. package/dist/src/api/audit-log/index.d.ts +0 -9
  21. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  22. package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
  23. package/dist/src/composables/useBasePermission.d.ts +0 -1
  24. package/dist/src/stores/team.d.ts +6 -6
  25. package/dist/src/types/team.d.ts +1 -1
  26. package/dist/src/views/hr/locales/index.d.ts +0 -16
  27. package/dist/src/views/team/components/BasePermission.vue.d.ts +7 -3
  28. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  29. package/dist/src/views/team/locales/index.d.ts +0 -32
  30. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
  31. package/dist/style.css +1 -1
  32. package/dist/{timesheet-DkD3AysG.js → timesheet-BbtAYZ1B.js} +2 -2
  33. package/dist/tsconfig.app.tsbuildinfo +1 -1
  34. package/dist/{useAppStore-CvmsaYSG.js → useAppStore-BHWapSDk.js} +1 -1
  35. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  36. package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
  37. package/dist/{useLoading-4TNmhm5N.js → useLoading-D7PklYeR.js} +1 -1
  38. package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-CNcISy8f.js} +3 -3
  39. package/dist/useSearch-B6WK1LBB.js +15 -0
  40. package/package.json +1 -1
  41. package/dist/AuditLogList-Dl3Nmf00.js +0 -1011
  42. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  43. package/dist/EmployeeList-DBd_rVW2.js +0 -831
  44. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
  45. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  46. package/dist/PermissionSetList-B8qNOWH6.js +0 -347
  47. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js +0 -3443
  48. package/dist/RoleList-DMFJsUZv.js +0 -545
  49. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  50. package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
  51. package/dist/src/components/Skeleton.vue.d.ts +0 -7
  52. package/dist/team-CyNektSD.js +0 -33
  53. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
  54. package/dist/useSearch-BAPEUu1R.js +0 -15
@@ -0,0 +1,71 @@
1
+ import { defineComponent as i, createElementBlock as s, openBlock as o, createElementVNode as l, renderSlot as n, createCommentVNode as c, toDisplayString as a, normalizeClass as d, createVNode as m, withCtx as f } from "vue";
2
+ const p = { class: "space-y-8" }, y = { class: "flex items-center justify-between" }, h = { class: "space-y-8" }, u = { class: "fm-typo-en-body-lg-600" }, _ = {
3
+ key: 0,
4
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
5
+ }, w = /* @__PURE__ */ i({
6
+ __name: "FormItem",
7
+ props: {
8
+ label: {},
9
+ description: {}
10
+ },
11
+ setup(e) {
12
+ return (t, r) => (o(), s("div", p, [
13
+ l("div", y, [
14
+ l("div", h, [
15
+ l("p", u, a(e.label), 1),
16
+ e.description ? (o(), s("p", _, a(e.description), 1)) : c("", !0)
17
+ ]),
18
+ n(t.$slots, "append")
19
+ ]),
20
+ n(t.$slots, "default")
21
+ ]));
22
+ }
23
+ }), b = /* @__PURE__ */ i({
24
+ __name: "FormColumn",
25
+ props: {
26
+ shrinkable: { type: Boolean }
27
+ },
28
+ setup(e) {
29
+ return (t, r) => (o(), s("div", {
30
+ class: d(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
31
+ }, [
32
+ n(t.$slots, "default")
33
+ ], 2));
34
+ }
35
+ }), k = {
36
+ key: 0,
37
+ class: "flex flex-row justify-between items-center"
38
+ }, $ = { class: "space-y-4" }, x = { class: "fm-typo-en-title-sm-600" }, v = {
39
+ key: 0,
40
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
41
+ }, B = /* @__PURE__ */ i({
42
+ __name: "FormSection",
43
+ props: {
44
+ title: {},
45
+ subTitle: {},
46
+ shrinkable: { type: Boolean }
47
+ },
48
+ setup(e) {
49
+ return (t, r) => (o(), s("div", {
50
+ class: d(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
51
+ }, [
52
+ e.title ? (o(), s("div", k, [
53
+ l("div", $, [
54
+ l("p", x, a(e.title), 1),
55
+ e.subTitle ? (o(), s("p", v, a(e.subTitle), 1)) : c("", !0)
56
+ ]),
57
+ n(t.$slots, "append-title")
58
+ ])) : c("", !0),
59
+ m(b, { shrinkable: e.shrinkable }, {
60
+ default: f(() => [
61
+ n(t.$slots, "default")
62
+ ]),
63
+ _: 3
64
+ }, 8, ["shrinkable"])
65
+ ], 2));
66
+ }
67
+ });
68
+ export {
69
+ B as _,
70
+ w as a
71
+ };
@@ -0,0 +1,12 @@
1
+ import { createElementBlock as e, openBlock as o, createElementVNode as t } from "vue";
2
+ import { _ as l } from "./SelectFilter-DUj7GBtT.js";
3
+ const n = {};
4
+ function c(s, r) {
5
+ return o(), e("div", null, [...r[0] || (r[0] = [
6
+ t("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
7
+ ])]);
8
+ }
9
+ const i = /* @__PURE__ */ l(n, [["render", c]]);
10
+ export {
11
+ i as H
12
+ };
@@ -4,20 +4,18 @@ 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-3sXHiW0y.js";
8
- import "./lodash-D5xlVzib.js";
9
- import "./iteration-JOKbtlLf.js";
10
- import "./useAppStore-CvmsaYSG.js";
11
- import { R as v } from "./app-COJbSNM4.js";
7
+ import "./rule-BL-miuus.js";
8
+ import "./iteration-BQA73VxD.js";
9
+ import { R as v } from "./app--3WguZOC.js";
10
+ import "./useAppStore-BHWapSDk.js";
12
11
  /* empty css */
13
- /* empty css */
14
- import "./team-CyNektSD.js";
15
- const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
12
+ /* empty css */
13
+ const w = { class: "space-y-24" }, K = /* @__PURE__ */ V({
16
14
  __name: "Main",
17
15
  setup(x) {
18
16
  const { t: a } = N(), f = k(), R = F(), _ = u(), b = u(), t = u("member");
19
17
  R.name === v.TEAM_ROLE ? t.value = "role" : t.value = "member";
20
- const r = B(() => n.value.find((e) => e.value === t.value) || n.value[0]);
18
+ const l = B(() => n.value.find((e) => e.value === t.value) || n.value[0]);
21
19
  A(t, (e) => {
22
20
  e === "member" ? f.replace({ name: v.TEAM_MEMBER }) : e === "role" && f.replace({ name: v.TEAM_ROLE });
23
21
  });
@@ -41,20 +39,20 @@ const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
41
39
  }
42
40
  }
43
41
  ]);
44
- return (e, l) => {
42
+ return (e, r) => {
45
43
  const L = i("FmSpacer"), E = i("FmTabs"), M = i("RouterView");
46
44
  return c(), s(h, {
47
- heading: r.value.label
45
+ heading: l.value.label
48
46
  }, {
49
47
  "append-heading": p(() => {
50
48
  var o;
51
49
  return [
52
50
  d(L),
53
- (o = r.value) != null && o.createButtonLabel ? (c(), s(g, {
51
+ (o = l.value) != null && o.createButtonLabel ? (c(), s(g, {
54
52
  key: 0,
55
53
  icon: "add",
56
- label: r.value.createButtonLabel,
57
- onClick: l[0] || (l[0] = (m) => r.value.createButtonAction())
54
+ label: l.value.createButtonLabel,
55
+ onClick: r[0] || (r[0] = (m) => l.value.createButtonAction())
58
56
  }, null, 8, ["label"])) : S("", !0)
59
57
  ];
60
58
  }),
@@ -62,7 +60,7 @@ const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
62
60
  C("div", w, [
63
61
  d(E, {
64
62
  modelValue: t.value,
65
- "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
63
+ "onUpdate:modelValue": r[1] || (r[1] = (o) => t.value = o),
66
64
  items: n.value
67
65
  }, null, 8, ["modelValue", "items"]),
68
66
  d(M, null, {
@@ -83,5 +81,5 @@ const w = { class: "space-y-24" }, Q = /* @__PURE__ */ V({
83
81
  }
84
82
  });
85
83
  export {
86
- Q as default
84
+ K as default
87
85
  };
@@ -1,17 +1,17 @@
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 o, unref as s, withCtx as b, createElementVNode as l, toDisplayString as w, 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";
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-CvmsaYSG.js";
4
+ import { u as Y } from "./useAppStore-BHWapSDk.js";
5
5
  import { defineStore as Ue } from "pinia";
6
- import { g as z, a as he, b as O } from "./iteration-JOKbtlLf.js";
6
+ import { g as z, a as he, b as O } from "./iteration-BQA73VxD.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-COJbSNM4.js";
10
- import { _ as le, H as ke } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
9
+ import { _ as we } from "./app--3WguZOC.js";
10
+ import { H as ke } from "./HorizontalSplitter-o860F4xM.js";
11
11
  import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
- import { u as Fe } from "./useSearch-BAPEUu1R.js";
13
- import { u as ue } from "./useLoading-4TNmhm5N.js";
14
- import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
12
+ import { u as Fe } from "./useSearch-B6WK1LBB.js";
13
+ import { u as ue } from "./useLoading-D7PklYeR.js";
14
+ import { _ as Ie, a as le } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
15
15
  const H = {
16
16
  async getGrantUsers() {
17
17
  return z(await O("grant").get(""));
@@ -57,12 +57,12 @@ const H = {
57
57
  throw console.error("Error creating grant user:", m), m;
58
58
  }
59
59
  }
60
- async function x(d, m) {
60
+ async function b(d, m) {
61
61
  try {
62
- const n = await H.revokeGrantUser(d, m), i = p.value.findIndex((c) => c._id === d);
63
- i !== -1 && (p.value[i] = n);
64
- } catch (n) {
65
- throw console.error("Error revoking grant user:", n), n;
62
+ const r = await H.revokeGrantUser(d, m), c = p.value.findIndex((i) => i._id === d);
63
+ c !== -1 && (p.value[c] = r);
64
+ } catch (r) {
65
+ throw console.error("Error revoking grant user:", r), r;
66
66
  }
67
67
  }
68
68
  return {
@@ -70,57 +70,57 @@ const H = {
70
70
  isLoading: y,
71
71
  readGrantUsers: a,
72
72
  createGrantUser: U,
73
- revokeGrantUser: x
73
+ revokeGrantUser: b
74
74
  };
75
75
  }), Z = Se, Ce = { class: "fm-typo-en-title-md-600" }, Be = { class: "space-y-40" }, $e = { class: "flex gap-8 items-center justify-start" }, Ge = /* @__PURE__ */ J({
76
76
  __name: "GrantUserForm",
77
77
  setup(p, { expose: y }) {
78
- const a = Z(), U = Y(), x = Q(), d = ie(), m = ue(d), { t: n } = X(), i = S(!1), c = S({
78
+ const a = Z(), U = Y(), b = Q(), d = ie(), m = ue(d), { t: r } = X(), c = S(!1), i = S({
79
79
  name: "",
80
80
  restaurantId: "",
81
81
  roleId: ""
82
- }), k = () => {
83
- c.value = {
82
+ }), w = () => {
83
+ i.value = {
84
84
  name: "",
85
85
  restaurantId: "",
86
86
  roleId: ""
87
- }, i.value = !0;
88
- }, V = F(() => n("grantUser.form.title")), C = F(() => n("common.create")), G = F(() => x.restaurants.value.map((u) => ({
87
+ }, c.value = !0;
88
+ }, C = F(() => r("grantUser.form.title")), V = F(() => r("common.create")), G = F(() => b.restaurants.value.map((u) => ({
89
89
  label: `${u.profile.code ? u.profile.code + " - " : ""}${u.profile.name}`,
90
90
  value: u._id
91
- }))), R = F(() => c.value.restaurantId ? U.roles.value.filter((u) => u.restaurants.some((g) => g.id === c.value.restaurantId)).map((u) => ({
91
+ }))), R = F(() => i.value.restaurantId ? U.roles.value.filter((u) => u.restaurants.some((g) => g.id === i.value.restaurantId)).map((u) => ({
92
92
  label: u.name,
93
93
  value: u._id,
94
94
  disabled: !u.isUsable
95
95
  })) : []);
96
96
  ce(
97
- () => c.value.restaurantId,
97
+ () => i.value.restaurantId,
98
98
  () => {
99
- c.value.roleId = "";
99
+ i.value.roleId = "";
100
100
  }
101
101
  );
102
102
  async function M() {
103
103
  await m.minor(async () => {
104
- const u = await a.createGrantUser(c.value);
104
+ const u = await a.createGrantUser(i.value);
105
105
  d.open({
106
- message: n("grantUser.create.successMessage", {
106
+ message: r("grantUser.create.successMessage", {
107
107
  passcode: u.passcode
108
108
  }),
109
109
  type: "success"
110
110
  });
111
- }), i.value = !1;
111
+ }), c.value = !1;
112
112
  }
113
113
  return y({
114
- show: i,
115
- trigger: k
114
+ show: c,
115
+ trigger: w
116
116
  }), (u, g) => {
117
117
  const P = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
118
118
  return I(), D(W, null, [
119
- ge(u.$slots, "default", { trigger: k }),
120
- o(N, {
119
+ ge(u.$slots, "default", { trigger: w }),
120
+ n(N, {
121
121
  id: "grant-user-form",
122
- modelValue: i.value,
123
- "onUpdate:modelValue": g[4] || (g[4] = (f) => i.value = f),
122
+ modelValue: c.value,
123
+ "onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
124
124
  "is-container": s(E).FmForm,
125
125
  "is-container-props": {
126
126
  onValidationSuccess: M,
@@ -128,62 +128,62 @@ const H = {
128
128
  },
129
129
  "max-width": 560
130
130
  }, {
131
- "side-sheet-header": b(() => [
132
- l("p", Ce, w(V.value), 1)
131
+ "side-sheet-header": x(() => [
132
+ l("p", Ce, k(C.value), 1)
133
133
  ]),
134
- "side-sheet-footer": b(() => [
134
+ "side-sheet-footer": x(() => [
135
135
  l("div", $e, [
136
- o(L, {
137
- label: C.value,
136
+ n(L, {
137
+ label: V.value,
138
138
  size: "lg",
139
139
  type: "submit",
140
140
  variant: "primary"
141
141
  }, null, 8, ["label"]),
142
- o(L, {
143
- label: s(n)("common.cancel"),
142
+ n(L, {
143
+ label: s(r)("common.cancel"),
144
144
  size: "lg",
145
145
  variant: "tertiary",
146
- onClick: g[3] || (g[3] = () => i.value = !1)
146
+ onClick: g[3] || (g[3] = () => c.value = !1)
147
147
  }, null, 8, ["label"])
148
148
  ])
149
149
  ]),
150
- default: b(() => [
150
+ default: x(() => [
151
151
  l("div", Be, [
152
- o(Ie, {
153
- title: s(n)("grantUser.form.section")
152
+ n(Ie, {
153
+ title: s(r)("grantUser.form.section")
154
154
  }, {
155
- default: b(() => [
156
- o(P, {
157
- modelValue: c.value.name,
158
- "onUpdate:modelValue": g[0] || (g[0] = (f) => c.value.name = f),
159
- label: s(n)("grantUser.form.name"),
160
- rules: [(f) => !!f || s(n)("grantUser.form.nameRequired")]
155
+ default: x(() => [
156
+ n(P, {
157
+ modelValue: i.value.name,
158
+ "onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
159
+ label: s(r)("grantUser.form.name"),
160
+ rules: [(f) => !!f || s(r)("grantUser.form.nameRequired")]
161
161
  }, null, 8, ["modelValue", "label", "rules"]),
162
- o(le, {
163
- label: s(n)("grantUser.form.restaurant")
162
+ n(le, {
163
+ label: s(r)("grantUser.form.restaurant")
164
164
  }, {
165
- default: b(() => [
166
- o($, {
167
- modelValue: c.value.restaurantId,
168
- "onUpdate:modelValue": g[1] || (g[1] = (f) => c.value.restaurantId = f),
165
+ default: x(() => [
166
+ n($, {
167
+ modelValue: i.value.restaurantId,
168
+ "onUpdate:modelValue": g[1] || (g[1] = (f) => i.value.restaurantId = f),
169
169
  items: G.value,
170
- placeholder: s(n)("grantUser.form.selectRestaurant"),
171
- rules: [(f) => !!f || s(n)("grantUser.form.restaurantRequired")]
170
+ placeholder: s(r)("grantUser.form.selectRestaurant"),
171
+ rules: [(f) => !!f || s(r)("grantUser.form.restaurantRequired")]
172
172
  }, null, 8, ["modelValue", "items", "placeholder", "rules"])
173
173
  ]),
174
174
  _: 1
175
175
  }, 8, ["label"]),
176
- o(le, {
177
- label: s(n)("grantUser.form.role")
176
+ n(le, {
177
+ label: s(r)("grantUser.form.role")
178
178
  }, {
179
- default: b(() => [
180
- o($, {
181
- modelValue: c.value.roleId,
182
- "onUpdate:modelValue": g[2] || (g[2] = (f) => c.value.roleId = f),
179
+ default: x(() => [
180
+ n($, {
181
+ modelValue: i.value.roleId,
182
+ "onUpdate:modelValue": g[2] || (g[2] = (f) => i.value.roleId = f),
183
183
  items: R.value,
184
- placeholder: s(n)("grantUser.form.selectRole"),
185
- disabled: !c.value.restaurantId,
186
- rules: [(f) => !!f || s(n)("grantUser.form.roleRequired")]
184
+ placeholder: s(r)("grantUser.form.selectRole"),
185
+ disabled: !i.value.restaurantId,
186
+ rules: [(f) => !!f || s(r)("grantUser.form.roleRequired")]
187
187
  }, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
188
188
  ]),
189
189
  _: 1
@@ -240,25 +240,25 @@ const H = {
240
240
  }) {
241
241
  const {
242
242
  t: a
243
- } = X(), U = S(), x = Z(), {
243
+ } = X(), U = S(), b = Z(), {
244
244
  restaurants: d
245
245
  } = Q(), {
246
246
  roles: m
247
- } = Y(), n = F(() => x.grantUsers), {
248
- searchKey: i,
249
- filter: c
250
- } = Fe(), k = F(() => {
247
+ } = Y(), r = F(() => b.grantUsers), {
248
+ searchKey: c,
249
+ filter: i
250
+ } = Fe(""), w = F(() => {
251
251
  var t;
252
- return (t = n.value) == null ? void 0 : t.filter((e) => {
253
- const v = !U.value || U.value.includes(e.restaurantId), T = !B.value || B.value.includes(e.status), A = V.value[e.restaurantId] || "", j = C.value[e.roleId] || "";
254
- return v && T && c([e.passcode, e.name, A, j, e.grantByName]);
252
+ return (t = r.value) == null ? void 0 : t.filter((e) => {
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] || "";
254
+ return v && T && i([e.passcode, e.name, A, j, e.grantByName]);
255
255
  });
256
- }), V = F(() => {
256
+ }), C = F(() => {
257
257
  const t = {};
258
258
  return d.value.forEach((e) => {
259
259
  t[e._id] = e.profile.name;
260
260
  }), t;
261
- }), C = F(() => {
261
+ }), V = F(() => {
262
262
  const t = {};
263
263
  return m.value.forEach((e) => {
264
264
  t[e._id] = e.name;
@@ -300,23 +300,23 @@ const H = {
300
300
  header: () => a("grantUser.columns.name")
301
301
  }, {
302
302
  accessorKey: "restaurantName",
303
- accessorFn: (t) => V.value[t.restaurantId],
303
+ accessorFn: (t) => C.value[t.restaurantId],
304
304
  header: () => a("grantUser.columns.restaurant"),
305
305
  meta: {
306
306
  width: "250px"
307
307
  },
308
308
  cell(t) {
309
- const e = t.row.original.restaurantId, v = V.value[e] || "-";
309
+ const e = t.row.original.restaurantId, v = C.value[e] || "-";
310
310
  return _("div", [_("div", v), _("div", {
311
311
  class: "text-fm-color-typo-secondary text-sm"
312
312
  }, `${e}`)]);
313
313
  }
314
314
  }, {
315
315
  accessorKey: "roleName",
316
- accessorFn: (t) => C.value[t.roleId],
316
+ accessorFn: (t) => V.value[t.roleId],
317
317
  header: () => a("grantUser.columns.role"),
318
318
  cell(t) {
319
- const e = t.row.original.roleId, v = C.value[e] || "-";
319
+ const e = t.row.original.roleId, v = V.value[e] || "-";
320
320
  return _("div", v);
321
321
  }
322
322
  }, {
@@ -387,7 +387,7 @@ const H = {
387
387
  }
388
388
  }).onPrimary(async () => {
389
389
  P.minor(async () => {
390
- await x.revokeGrantUser(t._id, t.restaurantId);
390
+ await b.revokeGrantUser(t._id, t.restaurantId);
391
391
  }, {
392
392
  successMessage: a("grantUser.revoke.successMessage", {
393
393
  name: t.name
@@ -424,86 +424,86 @@ const H = {
424
424
  }
425
425
  return y({
426
426
  create: f,
427
- filteredGrantUsers: k
427
+ filteredGrantUsers: w
428
428
  }), (t, e) => {
429
429
  const v = h("FmSearch"), T = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
430
- return I(), D(W, null, [o(Ge, {
430
+ return I(), D(W, null, [n(Ge, {
431
431
  ref_key: "grantUserFormRef",
432
432
  ref: $,
433
433
  class: "gap-8"
434
- }, null, 512), l("div", Re, [l("div", Le, [l("div", Ne, [o(s(oe), {
434
+ }, null, 512), l("div", Re, [l("div", Le, [l("div", Ne, [n(s(oe), {
435
435
  modelValue: U.value,
436
- "onUpdate:modelValue": e[0] || (e[0] = (r) => U.value = r),
436
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => U.value = o),
437
437
  "managable-only": !1,
438
438
  multiple: "",
439
439
  variant: "dark",
440
440
  class: "!w-auto"
441
- }, null, 8, ["modelValue"]), o(ne, {
441
+ }, null, 8, ["modelValue"]), n(ne, {
442
442
  modelValue: B.value,
443
- "onUpdate:modelValue": e[1] || (e[1] = (r) => B.value = r),
443
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => B.value = o),
444
444
  multiple: "",
445
445
  variant: "dark",
446
446
  items: ee.value,
447
447
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
448
448
  placeholder: s(a)("grantUser.filter.status_placeholder")
449
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), o(v, {
450
- modelValue: s(i),
451
- "onUpdate:modelValue": e[2] || (e[2] = (r) => ae(i) ? i.value = r : null),
449
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
450
+ modelValue: s(c),
451
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => ae(c) ? c.value = o : null),
452
452
  autofocus: "",
453
453
  class: "pl-4 w-[320px]",
454
454
  placeholder: s(a)("grantUser.search.placeholder")
455
- }, null, 8, ["modelValue", "placeholder"])]), l("div", Ae, [l("div", ze, [o(v, {
456
- modelValue: s(i),
457
- "onUpdate:modelValue": e[3] || (e[3] = (r) => ae(i) ? i.value = r : null),
455
+ }, null, 8, ["modelValue", "placeholder"])]), l("div", Ae, [l("div", ze, [n(v, {
456
+ modelValue: s(c),
457
+ "onUpdate:modelValue": e[3] || (e[3] = (o) => ae(c) ? c.value = o : null),
458
458
  autofocus: "",
459
459
  placeholder: s(a)("grantUser.search.placeholder")
460
- }, null, 8, ["modelValue", "placeholder"])]), o(ke), l("div", De, [o(s(oe), {
460
+ }, null, 8, ["modelValue", "placeholder"])]), n(ke), l("div", De, [n(s(oe), {
461
461
  modelValue: U.value,
462
- "onUpdate:modelValue": e[4] || (e[4] = (r) => U.value = r),
462
+ "onUpdate:modelValue": e[4] || (e[4] = (o) => U.value = o),
463
463
  "managable-only": !1,
464
464
  multiple: "",
465
465
  variant: "dark",
466
466
  class: "!w-auto"
467
- }, null, 8, ["modelValue"]), o(ne, {
467
+ }, null, 8, ["modelValue"]), n(ne, {
468
468
  modelValue: B.value,
469
- "onUpdate:modelValue": e[5] || (e[5] = (r) => B.value = r),
469
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => B.value = o),
470
470
  multiple: "",
471
471
  items: ee.value,
472
472
  variant: "dark",
473
473
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
474
474
  placeholder: s(a)("grantUser.filter.status_placeholder")
475
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), n.value.length > 0 || s(x).isLoading ? (I(), K(we, {
475
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), K(we, {
476
476
  key: 0,
477
477
  class: "overflow-auto"
478
478
  }, {
479
- default: b(() => [o(T, {
479
+ default: x(() => [n(T, {
480
480
  class: "xs:hidden",
481
481
  "column-defs": M,
482
- "row-data": k.value,
483
- "page-size": k.value.length,
484
- loading: s(x).isLoading,
485
- virtual: k.value.length > 0,
482
+ "row-data": w.value,
483
+ "page-size": w.value.length,
484
+ loading: s(b).isLoading,
485
+ virtual: w.value.length > 0,
486
486
  "pin-header-row": "",
487
487
  "hide-footer": ""
488
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ke, [o(me, {
488
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ke, [n(me, {
489
489
  separator: ""
490
490
  }, {
491
- default: b(() => [(I(!0), D(W, null, fe(k.value, (r) => (I(), K(de, {
492
- key: r._id,
491
+ default: x(() => [(I(!0), D(W, null, fe(w.value, (o) => (I(), K(de, {
492
+ key: o._id,
493
493
  class: "py-12 px-16 items-center justify-between"
494
494
  }, {
495
- default: b(() => [l("div", Ee, [l("div", Me, [o(A, {
495
+ default: x(() => [l("div", Ee, [l("div", Me, [n(A, {
496
496
  variant: "tertiary",
497
497
  "text-color": "neutral-gray-400",
498
498
  icon: "content_copy",
499
- onClick: se((pe) => te(r.passcode), ["stop"])
500
- }, null, 8, ["onClick"]), l("p", Pe, [l("span", Te, w(r.passcode), 1), re(" - " + w(r.name), 1)])]), l("div", je, [l("div", null, [re(w(V.value[r.restaurantId] || "-") + " ", 1), l("div", Oe, w(r.restaurantId), 1), l("div", null, w(C.value[r.roleId] || "-"), 1)]), l("div", qe, [l("div", He, w(s(a)("grantUser.columns.grantedBy")) + ": " + w(r.grantByName), 1), l("div", We, w(s(a)("grantUser.columns.createdAt")) + ": " + w(new Date(r.createdAt).toLocaleString()), 1), o(j, {
501
- label: R(r.status),
502
- class: _e(G(r.status))
503
- }, null, 8, ["label", "class"])])])]), r.status === "active" ? (I(), D("div", Je, [o(A, {
499
+ onClick: se((pe) => te(o.passcode), ["stop"])
500
+ }, null, 8, ["onClick"]), l("p", Pe, [l("span", Te, k(o.passcode), 1), re(" - " + k(o.name), 1)])]), l("div", je, [l("div", null, [re(k(C.value[o.restaurantId] || "-") + " ", 1), l("div", Oe, k(o.restaurantId), 1), l("div", null, k(V.value[o.roleId] || "-"), 1)]), l("div", qe, [l("div", He, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(o.grantByName), 1), l("div", We, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(o.createdAt).toLocaleString()), 1), n(j, {
501
+ label: R(o.status),
502
+ class: _e(G(o.status))
503
+ }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), D("div", Je, [n(A, {
504
504
  label: s(a)("grantUser.actions.revoke"),
505
505
  variant: s(q).Secondary,
506
- onClick: se((pe) => N(r), ["stop"])
506
+ onClick: se((pe) => N(o), ["stop"])
507
507
  }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
508
508
  _: 2
509
509
  }, 1024))), 128))]),
@@ -520,34 +520,34 @@ const H = {
520
520
  }), dt = /* @__PURE__ */ J({
521
521
  __name: "Main",
522
522
  setup(p) {
523
- const { readGrantUsers: y } = Z(), { currentBusiness: a } = Q(), { readRoles: U } = Y(), { t: x } = X(), d = S();
523
+ const { readGrantUsers: y } = Z(), { readRestaurants: a, currentBusiness: U } = Q(), { readRoles: b } = Y(), { t: d } = X(), m = S();
524
524
  return ce(
525
- a,
525
+ U,
526
526
  async () => {
527
- var m;
528
- (m = a.value) != null && m._id && await Promise.all([U(), y()]);
527
+ var r;
528
+ (r = U.value) != null && r._id && await Promise.all([a(), b(), y()]);
529
529
  },
530
530
  { immediate: !0 }
531
- ), (m, n) => {
532
- const i = h("FmSpacer"), c = h("FmButton");
531
+ ), (r, c) => {
532
+ const i = h("FmSpacer"), w = h("FmButton");
533
533
  return I(), K(ye, {
534
- heading: s(x)("grantUser.title")
534
+ heading: s(d)("grantUser.title")
535
535
  }, {
536
- "append-heading": b(() => [
537
- o(i),
538
- o(c, {
536
+ "append-heading": x(() => [
537
+ n(i),
538
+ n(w, {
539
539
  "prepend-icon": "add",
540
- label: s(x)("grantUser.actions.create"),
541
- onClick: n[0] || (n[0] = (k) => {
540
+ label: s(d)("grantUser.actions.create"),
541
+ onClick: c[0] || (c[0] = (C) => {
542
542
  var V;
543
- return (V = d.value) == null ? void 0 : V.create();
543
+ return (V = m.value) == null ? void 0 : V.create();
544
544
  })
545
545
  }, null, 8, ["label"])
546
546
  ]),
547
- default: b(() => [
548
- o(Qe, {
547
+ default: x(() => [
548
+ n(Qe, {
549
549
  ref_key: "grantUserListRef",
550
- ref: d
550
+ ref: m
551
551
  }, null, 512)
552
552
  ]),
553
553
  _: 1