@feedmepos/mf-hrm-portal 2.0.19-dev.1 → 2.0.20-dev.1

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 (65) hide show
  1. package/dist/AuditLogList-Bsj-qg8n.js +1037 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-Cy2ayCko.js +824 -0
  4. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  6. package/dist/{Main-CsUo2UeJ.js → Main-BGc6kNaR.js} +758 -761
  7. package/dist/{Main-D_dew1Zy.js → Main-CSMAtoMj.js} +181 -175
  8. package/dist/Main-D7bV8EuC.js +86 -0
  9. package/dist/PermissionSetList-CuHhDqWl.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js +3443 -0
  11. package/dist/RoleList-e0WUqt4Y.js +545 -0
  12. package/dist/TeamMemberList-CpPa1KyV.js +1097 -0
  13. package/dist/{TimesheetList-Bu47lfyS.js → TimesheetList-tFjvFHqH.js} +132 -126
  14. package/dist/{app-rZIFa5rc.js → app-CL7rUfL3.js} +552 -504
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-BGndyuOo.js → dayjs.min-ChdFPuFV.js} +1 -1
  17. package/dist/employee-kKV7UnHU.js +204 -0
  18. package/dist/{iteration-BOjSUDXb.js → iteration-BbD0nOgO.js} +9253 -9209
  19. package/dist/{lodash-C3mSRK8f.js → lodash-CDf3aG6G.js} +1 -1
  20. package/dist/{rule-CPun0Q97.js → rule-BJ-y3Sp8.js} +263 -265
  21. package/dist/src/api/audit-log/index.d.ts +9 -0
  22. package/dist/src/api/index.d.ts +0 -1
  23. package/dist/src/api/restaurant/index.d.ts +5 -0
  24. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  25. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  26. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  27. package/dist/src/composables/useBasePermission.d.ts +1 -0
  28. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  29. package/dist/src/stores/restaurant.d.ts +181 -0
  30. package/dist/src/stores/role.d.ts +7 -7
  31. package/dist/src/stores/team.d.ts +6 -6
  32. package/dist/src/types/restaurant.d.ts +11 -0
  33. package/dist/src/types/team.d.ts +1 -1
  34. package/dist/src/views/hr/locales/index.d.ts +16 -0
  35. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
  36. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  37. package/dist/src/views/team/locales/index.d.ts +32 -0
  38. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  39. package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +3 -3
  40. package/dist/style.css +1 -1
  41. package/dist/{timesheet-BKF3Ow4F.js → timesheet-BmV02Rkz.js} +2 -2
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/useAppStore-D8QAGZ02.js +171 -0
  44. package/dist/useDebounce-CWb5QR9G.js +28 -0
  45. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  46. package/dist/{useLoading-EAY7xVQ0.js → useLoading-KpcQw0p4.js} +1 -1
  47. package/dist/{useReportPermissions-C0Bay1Db.js → useReportPermissions-CmGJAz_N.js} +3 -3
  48. package/package.json +1 -1
  49. package/dist/AuditLogList-ayMV64G1.js +0 -980
  50. package/dist/EmployeeList-D_ZkY6oL.js +0 -736
  51. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  52. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  53. package/dist/Main-Dc9eZBpa.js +0 -85
  54. package/dist/PermissionSetList-CkRVYnaB.js +0 -341
  55. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DF26-RE9.js +0 -3480
  56. package/dist/RoleList-D6BdbJhj.js +0 -530
  57. package/dist/TeamMemberList-Cf82_HoM.js +0 -1114
  58. package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang--Ukpicpg.js +0 -34
  59. package/dist/employee-C9_9zcbo.js +0 -204
  60. package/dist/src/api/account/index.d.ts +0 -4
  61. package/dist/src/composables/useSupportedCountries.d.ts +0 -5
  62. package/dist/useAppStore-DBeAz_oF.js +0 -171
  63. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  64. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  65. package/dist/useSearch-B6WK1LBB.js +0 -15
@@ -1,27 +1,26 @@
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
- import { useCoreStore as Q, useI18n as X, RestaurantSelector as oe } from "@feedmepos/mf-common";
3
- import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
4
- import { u as Y } from "./useAppStore-DBeAz_oF.js";
5
- import { defineStore as Ue } from "pinia";
6
- import { g as z, a as he, b as O } from "./iteration-BOjSUDXb.js";
7
- import { useSnackbar as ie, components as E, useDialog as xe, useBreakpoints as be, FmButtonVariant as q } from "@feedmepos/ui-library";
8
- import { S as ne } from "./SelectFilter-DUj7GBtT.js";
9
- import { _ as we } from "./app-rZIFa5rc.js";
10
- import { H as ke } from "./HorizontalSplitter-o860F4xM.js";
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-EAY7xVQ0.js";
14
- import { _ as Ie, a as le } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
15
- const H = {
1
+ import { ref as S, defineComponent as Q, computed as V, watch as ce, resolveComponent as h, createElementBlock as K, openBlock as I, Fragment as J, renderSlot as ge, createVNode as n, unref as s, withCtx as x, createElementVNode as l, toDisplayString as k, createBlock as E, isRef as re, renderList as fe, createCommentVNode as ve, withModifiers as oe, createTextVNode as ne, normalizeClass as _e, h as _ } from "vue";
2
+ import { useI18n as X, useCoreStore as ye } from "@feedmepos/mf-common";
3
+ import { _ as Ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
4
+ import { u as Y } from "./useAppStore-D8QAGZ02.js";
5
+ import { g as z, a as he, b as q, u as Z } from "./iteration-BbD0nOgO.js";
6
+ import { defineStore as xe } from "pinia";
7
+ import { useSnackbar as ie, components as M, useDialog as be, useBreakpoints as we, FmButtonVariant as H } from "@feedmepos/ui-library";
8
+ import { S as D } from "./SelectFilter-DUj7GBtT.js";
9
+ import { _ as ke } from "./app-CL7rUfL3.js";
10
+ import { _ as le, u as Ve, H as Fe } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
11
+ import { _ as Ie } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
+ import { u as ue } from "./useLoading-KpcQw0p4.js";
13
+ import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
+ const W = {
16
15
  async getGrantUsers() {
17
- return z(await O("grant").get(""));
16
+ return z(await q("grant").get(""));
18
17
  },
19
18
  async createGrantUser(p) {
20
- return z(await O("grant").post("", p));
19
+ return z(await q("grant").post("", p));
21
20
  },
22
21
  async revokeGrantUser(p, y) {
23
22
  return z(
24
- await O("grant").patch(`/revoke/${p}`, null, {
23
+ await q("grant").patch(`/revoke/${p}`, null, {
25
24
  params: { restaurantId: y }
26
25
  })
27
26
  );
@@ -35,31 +34,31 @@ const H = {
35
34
  })
36
35
  );
37
36
  }
38
- }, Se = Ue("grantUser", () => {
37
+ }, Ce = xe("grantUser", () => {
39
38
  const p = S([]), y = S(!1);
40
39
  async function a() {
41
40
  y.value = !0;
42
41
  try {
43
- p.value = (await H.getGrantUsers()).sort(
44
- (d, m) => d.createdAt < m.createdAt ? 1 : -1
42
+ p.value = (await W.getGrantUsers()).sort(
43
+ (u, m) => u.createdAt < m.createdAt ? 1 : -1
45
44
  );
46
- } catch (d) {
47
- throw console.error("Error reading grant users:", d), d;
45
+ } catch (u) {
46
+ throw console.error("Error reading grant users:", u), u;
48
47
  } finally {
49
48
  y.value = !1;
50
49
  }
51
50
  }
52
- async function U(d) {
51
+ async function U(u) {
53
52
  try {
54
- const m = await H.createGrantUser(d);
53
+ const m = await W.createGrantUser(u);
55
54
  return p.value = [m, ...p.value], m;
56
55
  } catch (m) {
57
56
  throw console.error("Error creating grant user:", m), m;
58
57
  }
59
58
  }
60
- async function b(d, m) {
59
+ async function b(u, m) {
61
60
  try {
62
- const r = await H.revokeGrantUser(d, m), c = p.value.findIndex((i) => i._id === d);
61
+ const r = await W.revokeGrantUser(u, m), c = p.value.findIndex((i) => i._id === u);
63
62
  c !== -1 && (p.value[c] = r);
64
63
  } catch (r) {
65
64
  throw console.error("Error revoking grant user:", r), r;
@@ -72,10 +71,10 @@ const H = {
72
71
  createGrantUser: U,
73
72
  revokeGrantUser: b
74
73
  };
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({
74
+ }), ee = Ce, Be = { class: "fm-typo-en-title-md-600" }, $e = { class: "space-y-40" }, Ge = { class: "flex gap-8 items-center justify-start" }, Re = /* @__PURE__ */ Q({
76
75
  __name: "GrantUserForm",
77
76
  setup(p, { expose: y }) {
78
- const a = Z(), U = Y(), b = Q(), d = ie(), m = ue(d), { t: r } = X(), c = S(!1), i = S({
77
+ const a = ee(), U = Y(), b = Z(), u = ie(), m = ue(u), { t: r } = X(), c = S(!1), i = S({
79
78
  name: "",
80
79
  restaurantId: "",
81
80
  roleId: ""
@@ -85,13 +84,13 @@ const H = {
85
84
  restaurantId: "",
86
85
  roleId: ""
87
86
  }, c.value = !0;
88
- }, C = F(() => r("grantUser.form.title")), V = F(() => r("common.create")), G = F(() => b.restaurants.value.map((u) => ({
89
- label: `${u.profile.code ? u.profile.code + " - " : ""}${u.profile.name}`,
90
- value: u._id
91
- }))), R = F(() => i.value.restaurantId ? U.roles.value.filter((u) => u.restaurants.some((g) => g.id === i.value.restaurantId)).map((u) => ({
92
- label: u.name,
93
- value: u._id,
94
- disabled: !u.isUsable
87
+ }, C = V(() => r("grantUser.form.title")), F = V(() => r("common.create")), G = V(() => b.restaurants.value.map((d) => ({
88
+ label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
89
+ value: d._id
90
+ }))), R = V(() => i.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === i.value.restaurantId)).map((d) => ({
91
+ label: d.name,
92
+ value: d._id,
93
+ disabled: !d.isUsable
95
94
  })) : []);
96
95
  ce(
97
96
  () => i.value.restaurantId,
@@ -99,12 +98,12 @@ const H = {
99
98
  i.value.roleId = "";
100
99
  }
101
100
  );
102
- async function M() {
101
+ async function P() {
103
102
  await m.minor(async () => {
104
- const u = await a.createGrantUser(i.value);
105
- d.open({
103
+ const d = await a.createGrantUser(i.value);
104
+ u.open({
106
105
  message: r("grantUser.create.successMessage", {
107
- passcode: u.passcode
106
+ passcode: d.passcode
108
107
  }),
109
108
  type: "success"
110
109
  });
@@ -113,28 +112,28 @@ const H = {
113
112
  return y({
114
113
  show: c,
115
114
  trigger: w
116
- }), (u, g) => {
117
- const P = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
118
- return I(), D(W, null, [
119
- ge(u.$slots, "default", { trigger: w }),
115
+ }), (d, g) => {
116
+ const T = h("FmTextField"), $ = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
117
+ return I(), K(J, null, [
118
+ ge(d.$slots, "default", { trigger: w }),
120
119
  n(N, {
121
120
  id: "grant-user-form",
122
121
  modelValue: c.value,
123
122
  "onUpdate:modelValue": g[4] || (g[4] = (f) => c.value = f),
124
- "is-container": s(E).FmForm,
123
+ "is-container": s(M).FmForm,
125
124
  "is-container-props": {
126
- onValidationSuccess: M,
125
+ onValidationSuccess: P,
127
126
  blameFormChildOnValidationFailed: !0
128
127
  },
129
128
  "max-width": 560
130
129
  }, {
131
130
  "side-sheet-header": x(() => [
132
- l("p", Ce, k(C.value), 1)
131
+ l("p", Be, k(C.value), 1)
133
132
  ]),
134
133
  "side-sheet-footer": x(() => [
135
- l("div", $e, [
134
+ l("div", Ge, [
136
135
  n(L, {
137
- label: V.value,
136
+ label: F.value,
138
137
  size: "lg",
139
138
  type: "submit",
140
139
  variant: "primary"
@@ -148,12 +147,12 @@ const H = {
148
147
  ])
149
148
  ]),
150
149
  default: x(() => [
151
- l("div", Be, [
152
- n(Ie, {
150
+ l("div", $e, [
151
+ n(Se, {
153
152
  title: s(r)("grantUser.form.section")
154
153
  }, {
155
154
  default: x(() => [
156
- n(P, {
155
+ n(T, {
157
156
  modelValue: i.value.name,
158
157
  "onUpdate:modelValue": g[0] || (g[0] = (f) => i.value.name = f),
159
158
  label: s(r)("grantUser.form.name"),
@@ -198,73 +197,73 @@ const H = {
198
197
  ], 64);
199
198
  };
200
199
  }
201
- }), Re = {
200
+ }), Le = {
202
201
  class: "space-y-8"
203
- }, Le = {
204
- class: "xs:hidden flex w-full items-start justify-between"
205
202
  }, Ne = {
206
- class: "flex items-start gap-8"
203
+ class: "xs:hidden flex w-full items-start justify-between"
207
204
  }, Ae = {
208
- class: "space-y-4 hidden xs:block"
205
+ class: "flex items-start gap-8"
209
206
  }, ze = {
210
- class: "px-16"
207
+ class: "space-y-4 hidden xs:block"
211
208
  }, De = {
212
- class: "px-16 flex items-start gap-8"
209
+ class: "px-16"
213
210
  }, Ke = {
214
- class: "pb-64 hidden xs:block"
211
+ class: "px-16 flex items-start gap-8"
215
212
  }, Ee = {
216
- class: "space-y-4"
213
+ class: "pb-64 hidden xs:block"
217
214
  }, Me = {
218
- class: "flex items-center gap-8"
215
+ class: "space-y-4"
219
216
  }, Pe = {
220
- class: "fm-typo-en-body-lg-600"
217
+ class: "flex items-center gap-8"
221
218
  }, Te = {
219
+ class: "fm-typo-en-body-lg-600"
220
+ }, Oe = {
222
221
  class: "font-mono text-lg font-bold mr-4"
223
222
  }, je = {
224
223
  class: "text-fm-color-typo-secondary"
225
- }, Oe = {
226
- class: "text-xs"
227
224
  }, qe = {
228
- class: "mt-4 space-y-2"
229
- }, He = {
230
225
  class: "text-xs"
226
+ }, He = {
227
+ class: "mt-4 space-y-2"
231
228
  }, We = {
232
229
  class: "text-xs"
233
230
  }, Je = {
231
+ class: "text-xs"
232
+ }, Qe = {
234
233
  key: 0,
235
234
  class: "flex flex-col gap-4"
236
- }, Qe = /* @__PURE__ */ J({
235
+ }, Xe = /* @__PURE__ */ Q({
237
236
  __name: "GrantUserList",
238
237
  setup(p, {
239
238
  expose: y
240
239
  }) {
241
240
  const {
242
241
  t: a
243
- } = X(), U = S(), b = Z(), {
244
- restaurants: d
245
- } = Q(), {
242
+ } = X(), U = S(), b = ee(), {
243
+ restaurants: u
244
+ } = Z(), {
246
245
  roles: m
247
- } = Y(), r = F(() => b.grantUsers), {
246
+ } = Y(), r = V(() => b.grantUsers), {
248
247
  searchKey: c,
249
248
  filter: i
250
- } = Fe(""), w = F(() => {
251
- var t;
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]);
249
+ } = Ve(), w = V(() => {
250
+ var e;
251
+ return (e = r.value) == null ? void 0 : e.filter((t) => {
252
+ const v = !U.value || U.value.includes(t.restaurantId), O = !B.value || B.value.includes(t.status), A = C.value[t.restaurantId] || "", j = F.value[t.roleId] || "";
253
+ return v && O && i([t.passcode, t.name, A, j, t.grantByName]);
255
254
  });
256
- }), C = F(() => {
257
- const t = {};
258
- return d.value.forEach((e) => {
259
- t[e._id] = e.profile.name;
260
- }), t;
261
- }), V = F(() => {
262
- const t = {};
263
- return m.value.forEach((e) => {
264
- t[e._id] = e.name;
265
- }), t;
266
- }), G = (t) => {
267
- switch (t) {
255
+ }), C = V(() => {
256
+ const e = {};
257
+ return u.value.forEach((t) => {
258
+ e[t._id] = t.profile.name;
259
+ }), e;
260
+ }), F = V(() => {
261
+ const e = {};
262
+ return m.value.forEach((t) => {
263
+ e[t._id] = t.name;
264
+ }), e;
265
+ }), G = (e) => {
266
+ switch (e) {
268
267
  case "active":
269
268
  return "bg-fm-color-system-success-100 text-fm-color-typo-success";
270
269
  case "used":
@@ -274,49 +273,49 @@ const H = {
274
273
  default:
275
274
  return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
276
275
  }
277
- }, R = (t) => a(`grantUser.status.${t}`), M = [{
276
+ }, R = (e) => a(`grantUser.status.${e}`), P = [{
278
277
  accessorKey: "passcode",
279
278
  size: 120,
280
279
  maxSize: 120,
281
280
  minSize: 120,
282
281
  header: () => a("grantUser.columns.passcode"),
283
- cell(t) {
284
- const e = t.row.original.passcode;
282
+ cell(e) {
283
+ const t = e.row.original.passcode;
285
284
  return _("div", {
286
285
  class: "flex items-center gap-8"
287
- }, [_(E.FmButton, {
288
- variant: q.Tertiary,
286
+ }, [_(M.FmButton, {
287
+ variant: H.Tertiary,
289
288
  textColor: "neutral-gray-400",
290
289
  icon: "content_copy",
291
290
  onClick: (v) => {
292
- v.stopPropagation(), te(e);
291
+ v.stopPropagation(), se(t);
293
292
  }
294
293
  }), _("span", {
295
294
  class: "font-mono text-lg font-bold"
296
- }, e)]);
295
+ }, t)]);
297
296
  }
298
297
  }, {
299
298
  accessorKey: "name",
300
299
  header: () => a("grantUser.columns.name")
301
300
  }, {
302
301
  accessorKey: "restaurantName",
303
- accessorFn: (t) => C.value[t.restaurantId],
302
+ accessorFn: (e) => C.value[e.restaurantId],
304
303
  header: () => a("grantUser.columns.restaurant"),
305
304
  meta: {
306
305
  width: "250px"
307
306
  },
308
- cell(t) {
309
- const e = t.row.original.restaurantId, v = C.value[e] || "-";
307
+ cell(e) {
308
+ const t = e.row.original.restaurantId, v = C.value[t] || "-";
310
309
  return _("div", [_("div", v), _("div", {
311
310
  class: "text-fm-color-typo-secondary text-sm"
312
- }, `${e}`)]);
311
+ }, `${t}`)]);
313
312
  }
314
313
  }, {
315
314
  accessorKey: "roleName",
316
- accessorFn: (t) => V.value[t.roleId],
315
+ accessorFn: (e) => F.value[e.roleId],
317
316
  header: () => a("grantUser.columns.role"),
318
- cell(t) {
319
- const e = t.row.original.roleId, v = V.value[e] || "-";
317
+ cell(e) {
318
+ const t = e.row.original.roleId, v = F.value[t] || "-";
320
319
  return _("div", v);
321
320
  }
322
321
  }, {
@@ -325,28 +324,28 @@ const H = {
325
324
  meta: {
326
325
  maxWidth: "120px"
327
326
  },
328
- cell(t) {
329
- const e = t.row.original.status;
330
- return _(E.FmChip, {
331
- label: R(e),
332
- class: G(e)
327
+ cell(e) {
328
+ const t = e.row.original.status;
329
+ return _(M.FmChip, {
330
+ label: R(t),
331
+ class: G(t)
333
332
  });
334
333
  }
335
334
  }, {
336
335
  accessorKey: "grantByName",
337
336
  header: () => a("grantUser.columns.grantedBy"),
338
- cell(t) {
339
- const e = t.row.original.grantById, v = t.row.original.grantByName;
337
+ cell(e) {
338
+ const t = e.row.original.grantById, v = e.row.original.grantByName;
340
339
  return _("div", [_("div", v), _("div", {
341
340
  class: "text-fm-color-typo-secondary text-sm"
342
- }, `${e}`)]);
341
+ }, `${t}`)]);
343
342
  }
344
343
  }, {
345
344
  accessorKey: "createdAt",
346
345
  header: () => a("grantUser.columns.createdAt"),
347
- cell(t) {
348
- const e = t.row.original.createdAt;
349
- return _("div", new Date(e).toLocaleString());
346
+ cell(e) {
347
+ const t = e.row.original.createdAt;
348
+ return _("div", new Date(t).toLocaleString());
350
349
  }
351
350
  }, {
352
351
  id: "action",
@@ -355,25 +354,25 @@ const H = {
355
354
  cellClass: "p-16",
356
355
  headerContentClass: "-mx-16"
357
356
  },
358
- cell: (t) => {
359
- const e = t.row.original;
360
- return e.status !== "active" ? null : _("div", {
357
+ cell: (e) => {
358
+ const t = e.row.original;
359
+ return t.status !== "active" ? null : _("div", {
361
360
  class: "w-full flex justify-end items-center gap-4"
362
- }, [_(E.FmButton, {
361
+ }, [_(M.FmButton, {
363
362
  label: a("grantUser.actions.revoke"),
364
- variant: q.Secondary,
363
+ variant: H.Secondary,
365
364
  onClick: (v) => {
366
- v.stopPropagation(), N(e);
365
+ v.stopPropagation(), N(t);
367
366
  }
368
367
  })]);
369
368
  }
370
- }], u = ie(), g = xe(), P = ue(u), $ = S(), {
369
+ }], d = ie(), g = be(), T = ue(d), $ = S(), {
371
370
  breakpoints: L
372
- } = be(), N = (t) => {
371
+ } = we(), N = (e) => {
373
372
  g.open({
374
373
  title: a("grantUser.revoke.title"),
375
374
  message: a("grantUser.revoke.message", {
376
- name: t.name
375
+ name: e.name
377
376
  }),
378
377
  minWidth: L.value.lg ? 588 : 0,
379
378
  primaryActions: {
@@ -386,20 +385,20 @@ const H = {
386
385
  close: !0
387
386
  }
388
387
  }).onPrimary(async () => {
389
- P.minor(async () => {
390
- await b.revokeGrantUser(t._id, t.restaurantId);
388
+ T.minor(async () => {
389
+ await b.revokeGrantUser(e._id, e.restaurantId);
391
390
  }, {
392
391
  successMessage: a("grantUser.revoke.successMessage", {
393
- name: t.name
392
+ name: e.name
394
393
  })
395
394
  }), g.close();
396
395
  });
397
396
  };
398
397
  function f() {
399
- var t;
400
- (t = $.value) == null || t.trigger();
398
+ var e;
399
+ (e = $.value) == null || e.trigger();
401
400
  }
402
- const ee = F(() => [{
401
+ const te = V(() => [{
403
402
  label: a("grantUser.status.active"),
404
403
  value: "active"
405
404
  }, {
@@ -408,16 +407,19 @@ const H = {
408
407
  }, {
409
408
  label: a("grantUser.status.revoked"),
410
409
  value: "revoked"
411
- }]), B = S();
412
- async function te(t) {
410
+ }]), ae = V(() => u.value.map((e) => ({
411
+ label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
412
+ value: e._id
413
+ }))), B = S();
414
+ async function se(e) {
413
415
  try {
414
- await navigator.clipboard.writeText(t), u.open({
416
+ await navigator.clipboard.writeText(e), d.open({
415
417
  message: a("grantUser.passcode.copied"),
416
418
  type: "success"
417
419
  });
418
- } catch (e) {
419
- u.open({
420
- message: String(e),
420
+ } catch (t) {
421
+ d.open({
422
+ message: String(t),
421
423
  type: "error"
422
424
  });
423
425
  }
@@ -425,127 +427,131 @@ const H = {
425
427
  return y({
426
428
  create: f,
427
429
  filteredGrantUsers: w
428
- }), (t, e) => {
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, [n(Ge, {
430
+ }), (e, t) => {
431
+ const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
432
+ return I(), K(J, null, [n(Re, {
431
433
  ref_key: "grantUserFormRef",
432
434
  ref: $,
433
435
  class: "gap-8"
434
- }, null, 512), l("div", Re, [l("div", Le, [l("div", Ne, [n(s(oe), {
436
+ }, null, 512), l("div", Le, [l("div", Ne, [l("div", Ae, [n(D, {
435
437
  modelValue: U.value,
436
- "onUpdate:modelValue": e[0] || (e[0] = (o) => U.value = o),
437
- "managable-only": !1,
438
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
438
439
  multiple: "",
440
+ items: ae.value,
439
441
  variant: "dark",
442
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
443
+ placeholder: s(a)("grantUser.columns.restaurant"),
440
444
  class: "!w-auto"
441
- }, null, 8, ["modelValue"]), n(ne, {
445
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
442
446
  modelValue: B.value,
443
- "onUpdate:modelValue": e[1] || (e[1] = (o) => B.value = o),
447
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => B.value = o),
444
448
  multiple: "",
445
449
  variant: "dark",
446
- items: ee.value,
450
+ items: te.value,
447
451
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
448
452
  placeholder: s(a)("grantUser.filter.status_placeholder")
449
453
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
450
454
  modelValue: s(c),
451
- "onUpdate:modelValue": e[2] || (e[2] = (o) => ae(c) ? c.value = o : null),
455
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => re(c) ? c.value = o : null),
452
456
  autofocus: "",
453
457
  class: "pl-4 w-[320px]",
454
458
  placeholder: s(a)("grantUser.search.placeholder")
455
- }, null, 8, ["modelValue", "placeholder"])]), l("div", Ae, [l("div", ze, [n(v, {
459
+ }, null, 8, ["modelValue", "placeholder"])]), l("div", ze, [l("div", De, [n(v, {
456
460
  modelValue: s(c),
457
- "onUpdate:modelValue": e[3] || (e[3] = (o) => ae(c) ? c.value = o : null),
461
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => re(c) ? c.value = o : null),
458
462
  autofocus: "",
459
463
  placeholder: s(a)("grantUser.search.placeholder")
460
- }, null, 8, ["modelValue", "placeholder"])]), n(ke), l("div", De, [n(s(oe), {
464
+ }, null, 8, ["modelValue", "placeholder"])]), n(Fe), l("div", Ke, [n(D, {
461
465
  modelValue: U.value,
462
- "onUpdate:modelValue": e[4] || (e[4] = (o) => U.value = o),
463
- "managable-only": !1,
466
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
464
467
  multiple: "",
468
+ items: ae.value,
465
469
  variant: "dark",
470
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
471
+ placeholder: s(a)("grantUser.columns.restaurant"),
466
472
  class: "!w-auto"
467
- }, null, 8, ["modelValue"]), n(ne, {
473
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
468
474
  modelValue: B.value,
469
- "onUpdate:modelValue": e[5] || (e[5] = (o) => B.value = o),
475
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => B.value = o),
470
476
  multiple: "",
471
- items: ee.value,
477
+ items: te.value,
472
478
  variant: "dark",
473
479
  "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
474
480
  placeholder: s(a)("grantUser.filter.status_placeholder")
475
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), K(we, {
481
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r.value.length > 0 || s(b).isLoading ? (I(), E(ke, {
476
482
  key: 0,
477
483
  class: "overflow-auto"
478
484
  }, {
479
- default: x(() => [n(T, {
485
+ default: x(() => [n(O, {
480
486
  class: "xs:hidden",
481
- "column-defs": M,
487
+ "column-defs": P,
482
488
  "row-data": w.value,
483
489
  "page-size": w.value.length,
484
490
  loading: s(b).isLoading,
485
491
  virtual: w.value.length > 0,
486
492
  "pin-header-row": "",
487
493
  "hide-footer": ""
488
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ke, [n(me, {
494
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), l("div", Ee, [n(me, {
489
495
  separator: ""
490
496
  }, {
491
- default: x(() => [(I(!0), D(W, null, fe(w.value, (o) => (I(), K(de, {
497
+ default: x(() => [(I(!0), K(J, null, fe(w.value, (o) => (I(), E(de, {
492
498
  key: o._id,
493
499
  class: "py-12 px-16 items-center justify-between"
494
500
  }, {
495
- default: x(() => [l("div", Ee, [l("div", Me, [n(A, {
501
+ default: x(() => [l("div", Me, [l("div", Pe, [n(A, {
496
502
  variant: "tertiary",
497
503
  "text-color": "neutral-gray-400",
498
504
  icon: "content_copy",
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, {
505
+ onClick: oe((pe) => se(o.passcode), ["stop"])
506
+ }, null, 8, ["onClick"]), l("p", Te, [l("span", Oe, k(o.passcode), 1), ne(" - " + k(o.name), 1)])]), l("div", je, [l("div", null, [ne(k(C.value[o.restaurantId] || "-") + " ", 1), l("div", qe, k(o.restaurantId), 1), l("div", null, k(F.value[o.roleId] || "-"), 1)]), l("div", He, [l("div", We, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(o.grantByName), 1), l("div", Je, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(o.createdAt).toLocaleString()), 1), n(j, {
501
507
  label: R(o.status),
502
508
  class: _e(G(o.status))
503
- }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), D("div", Je, [n(A, {
509
+ }, null, 8, ["label", "class"])])])]), o.status === "active" ? (I(), K("div", Qe, [n(A, {
504
510
  label: s(a)("grantUser.actions.revoke"),
505
- variant: s(q).Secondary,
506
- onClick: se((pe) => N(o), ["stop"])
511
+ variant: s(H).Secondary,
512
+ onClick: oe((pe) => N(o), ["stop"])
507
513
  }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
508
514
  _: 2
509
515
  }, 1024))), 128))]),
510
516
  _: 1
511
517
  })])]),
512
518
  _: 1
513
- })) : (I(), K(s(Ve), {
519
+ })) : (I(), E(s(Ie), {
514
520
  key: 1,
515
521
  title: s(a)("grantUser.noData.title"),
516
522
  subtitle: s(a)("grantUser.noData.subtitle")
517
523
  }, null, 8, ["title", "subtitle"]))])], 64);
518
524
  };
519
525
  }
520
- }), dt = /* @__PURE__ */ J({
526
+ }), dt = /* @__PURE__ */ Q({
521
527
  __name: "Main",
522
528
  setup(p) {
523
- const { readGrantUsers: y } = Z(), { readRestaurants: a, currentBusiness: U } = Q(), { readRoles: b } = Y(), { t: d } = X(), m = S();
529
+ const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: b } = Z(), { t: u } = X(), m = S();
524
530
  return ce(
525
- U,
531
+ a,
526
532
  async () => {
527
533
  var r;
528
- (r = U.value) != null && r._id && await Promise.all([a(), b(), y()]);
534
+ (r = a.value) != null && r._id && await Promise.all([b(), U(), y()]);
529
535
  },
530
536
  { immediate: !0 }
531
537
  ), (r, c) => {
532
538
  const i = h("FmSpacer"), w = h("FmButton");
533
- return I(), K(ye, {
534
- heading: s(d)("grantUser.title")
539
+ return I(), E(Ue, {
540
+ heading: s(u)("grantUser.title")
535
541
  }, {
536
542
  "append-heading": x(() => [
537
543
  n(i),
538
544
  n(w, {
539
545
  "prepend-icon": "add",
540
- label: s(d)("grantUser.actions.create"),
546
+ label: s(u)("grantUser.actions.create"),
541
547
  onClick: c[0] || (c[0] = (C) => {
542
- var V;
543
- return (V = m.value) == null ? void 0 : V.create();
548
+ var F;
549
+ return (F = m.value) == null ? void 0 : F.create();
544
550
  })
545
551
  }, null, 8, ["label"])
546
552
  ]),
547
553
  default: x(() => [
548
- n(Qe, {
554
+ n(Xe, {
549
555
  ref_key: "grantUserListRef",
550
556
  ref: m
551
557
  }, null, 512)