@feedmepos/mf-hrm-portal 2.0.25 → 2.1.0-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 (63) hide show
  1. package/dist/AuditLogList-AGlAsWwd.js +1608 -0
  2. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-BYHKFwRm.js +383 -0
  3. package/dist/EmployeeList-KvjoGI87.js +884 -0
  4. package/dist/{Main-C6YMg19H.js → Main-BLh16xRg.js} +187 -184
  5. package/dist/{Main-DQg87aB2.js → Main-D3TSdtSE.js} +7 -7
  6. package/dist/{Main-CyqPnLTe.js → Main-Dn1TfDRj.js} +1033 -1029
  7. package/dist/PermissionSetList-Ds69m9UU.js +392 -0
  8. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bk6ub3Dv.js +4030 -0
  9. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-DWeS7VXx.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BHxCP_uW.js} +1 -1
  10. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +42 -0
  11. package/dist/RoleList-v8McRCnz.js +684 -0
  12. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +16 -0
  13. package/dist/{index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js → TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js} +54 -20
  14. package/dist/TeamMemberList-BYQnNIhT.js +1169 -0
  15. package/dist/{TimesheetList-DzeE73Ns.js → TimesheetList-C1OWa6kf.js} +139 -133
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-CTQs7MIl.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CLu9gzzi.js} +2 -2
  17. package/dist/{app-Df4eEEIU.js → app-CJouCBgi.js} +5248 -2273
  18. package/dist/app.js +1 -1
  19. package/dist/{dayjs.min-DmGoh5hw.js → dayjs.min-DUugkgDM.js} +1 -1
  20. package/dist/{employee-zWTRoOkw.js → employee-D5rEVmge.js} +3 -3
  21. package/dist/{iteration-DTV3udF0.js → iteration-QRRNYlps.js} +3 -3
  22. package/dist/{lodash-LInzVEDS.js → lodash-BlZhpHhM.js} +1 -1
  23. package/dist/rule-Dy7eMChN.js +1053 -0
  24. package/dist/src/api/audit-log/index.d.ts +6 -0
  25. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  26. package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +7 -1
  27. package/dist/src/components/table/EmptyDataTemplate/index.vue.d.ts +4 -1
  28. package/dist/src/components/table/TableEmptyState.vue.d.ts +31 -0
  29. package/dist/src/composables/useBasePermission.d.ts +1 -0
  30. package/dist/src/composables/useConditionDraft.d.ts +40 -0
  31. package/dist/src/composables/useCoverConditionOverride.d.ts +61 -0
  32. package/dist/src/helpers/business-timezone.d.ts +22 -0
  33. package/dist/src/helpers/permission-set.d.ts +4 -2
  34. package/dist/src/helpers/rule.d.ts +2 -1
  35. package/dist/src/stores/permission-set.d.ts +12 -3
  36. package/dist/src/types/audit-log.d.ts +1 -1
  37. package/dist/src/views/audit-log/event-line.d.ts +13 -0
  38. package/dist/src/views/audit-log/locales/index.d.ts +296 -0
  39. package/dist/src/views/audit-log/snapshot-diff.d.ts +11 -0
  40. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +1 -0
  41. package/dist/src/views/team/components/BasePermission.vue.d.ts +13 -0
  42. package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +22 -0
  43. package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +23 -0
  44. package/dist/src/views/team/condition-builders/component-map.d.ts +4 -0
  45. package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +23 -0
  46. package/dist/src/views/team/locales/index.d.ts +68 -0
  47. package/dist/style.css +1 -1
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/{useAppStore-BlQSL2ZO.js → useAppStore-CtMoad7V.js} +1 -1
  50. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  51. package/dist/{useLoading-NkUvAr71.js → useLoading-CNqlchYO.js} +1 -1
  52. package/dist/{useReportPermissions-R-eg1L2r.js → useReportPermissions-C5wGC9bf.js} +3 -3
  53. package/package.json +2 -2
  54. package/dist/AuditLogList-BWwgm5wH.js +0 -1145
  55. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  56. package/dist/EmployeeList-aRGYYmxf.js +0 -851
  57. package/dist/PermissionSetList-BfKgFFUh.js +0 -356
  58. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CNEAlTnY.js +0 -3457
  59. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +0 -38
  60. package/dist/RoleList-CtcVwAPE.js +0 -566
  61. package/dist/TeamMemberList-DU1jYeql.js +0 -1130
  62. package/dist/rule-O-E9JWJz.js +0 -995
  63. package/dist/useDebounce-CWb5QR9G.js +0 -28
@@ -1,26 +1,26 @@
1
- import { ref as I, defineComponent as Q, computed as F, watch as ie, resolveComponent as h, createElementBlock as E, openBlock as S, Fragment as J, renderSlot as ge, createVNode as n, unref as r, withCtx as x, createElementVNode as c, toDisplayString as w, createBlock as K, isRef as oe, renderList as fe, createCommentVNode as ve, withModifiers as ne, createTextVNode as le, normalizeClass as _e, h as _ } from "vue";
2
- import { useI18n as X, useCoreStore as ye } from "@feedmepos/mf-common";
3
- import { useSnackbar as Y, components as M, useDialog as Ue, useBreakpoints as he, FmButtonVariant as q } from "@feedmepos/ui-library";
1
+ import { ref as S, defineComponent as J, computed as F, watch as ce, resolveComponent as h, createElementBlock as E, openBlock as $, Fragment as W, renderSlot as ge, createVNode as r, unref as s, withCtx as x, createElementVNode as c, toDisplayString as k, isRef as re, renderList as fe, createBlock as ie, createCommentVNode as ve, withModifiers as oe, createTextVNode as ne, normalizeClass as _e, h as _ } from "vue";
2
+ import { useI18n as Q, useCoreStore as ye } from "@feedmepos/mf-common";
3
+ import { useSnackbar as X, components as K, useDialog as Ue, useBreakpoints as he, FmButtonVariant as j } from "@feedmepos/ui-library";
4
4
  import { _ as xe } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
5
- import { u as Z } from "./useAppStore-BlQSL2ZO.js";
6
- import { g as z, a as be, b as H, u as ee } from "./iteration-DTV3udF0.js";
7
- import { defineStore as ke } from "pinia";
5
+ import { u as Y } from "./useAppStore-CtMoad7V.js";
6
+ import { g as z, a as be, b as q, u as Z } from "./iteration-QRRNYlps.js";
7
+ import { defineStore as we } from "pinia";
8
8
  import { S as D } from "./SelectFilter-ATOm0hdn.js";
9
- import { _ as we } from "./app-Df4eEEIU.js";
10
- import { _ as ce, u as Fe, H as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
11
- import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
12
- import { u as ue } from "./useLoading-NkUvAr71.js";
9
+ import { _ as ke } from "./app-CJouCBgi.js";
10
+ import { _ as le, u as Fe, H as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
11
+ import { _ as Se } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js";
12
+ import { u as ue } from "./useLoading-CNqlchYO.js";
13
13
  import { _ as Ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
- const W = {
14
+ const H = {
15
15
  async getGrantUsers() {
16
- return z(await H("grant").get(""));
16
+ return z(await q("grant").get(""));
17
17
  },
18
18
  async createGrantUser(m) {
19
- return z(await H("grant").post("", m));
19
+ return z(await q("grant").post("", m));
20
20
  },
21
21
  async revokeGrantUser(m, y) {
22
22
  return z(
23
- await H("grant").patch(`/revoke/${m}`, null, {
23
+ await q("grant").patch(`/revoke/${m}`, null, {
24
24
  params: { restaurantId: y }
25
25
  })
26
26
  );
@@ -34,12 +34,12 @@ const W = {
34
34
  })
35
35
  );
36
36
  }
37
- }, Ce = ke("grantUser", () => {
38
- const m = I([]), y = I(!1);
37
+ }, Ce = we("grantUser", () => {
38
+ const m = S([]), y = S(!1);
39
39
  async function a() {
40
40
  y.value = !0;
41
41
  try {
42
- m.value = (await W.getGrantUsers()).sort(
42
+ m.value = (await H.getGrantUsers()).sort(
43
43
  (u, p) => u.createdAt < p.createdAt ? 1 : -1
44
44
  );
45
45
  } catch (u) {
@@ -50,15 +50,15 @@ const W = {
50
50
  }
51
51
  async function U(u) {
52
52
  try {
53
- const p = await W.createGrantUser(u);
53
+ const p = await H.createGrantUser(u);
54
54
  return m.value = [p, ...m.value], p;
55
55
  } catch (p) {
56
56
  throw console.error("Error creating grant user:", p), p;
57
57
  }
58
58
  }
59
- async function b(u, p) {
59
+ async function w(u, p) {
60
60
  try {
61
- const l = await W.revokeGrantUser(u, p), i = m.value.findIndex((s) => s._id === u);
61
+ const l = await H.revokeGrantUser(u, p), i = m.value.findIndex((o) => o._id === u);
62
62
  i !== -1 && (m.value[i] = l);
63
63
  } catch (l) {
64
64
  throw console.error("Error revoking grant user:", l), l;
@@ -69,38 +69,38 @@ const W = {
69
69
  isLoading: y,
70
70
  readGrantUsers: a,
71
71
  createGrantUser: U,
72
- revokeGrantUser: b
72
+ revokeGrantUser: w
73
73
  };
74
- }), te = 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({
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__ */ J({
75
75
  __name: "GrantUserForm",
76
76
  setup(m, { expose: y }) {
77
- const a = te(), U = Z(), b = ee(), u = Y(), p = ue(u), { t: l } = X(), i = I(!1), s = I({
77
+ const a = ee(), U = Y(), w = Z(), u = X(), p = ue(u), { t: l } = Q(), i = S(!1), o = S({
78
78
  name: "",
79
79
  restaurantId: "",
80
80
  roleId: ""
81
- }), k = () => {
82
- s.value = {
81
+ }), b = () => {
82
+ o.value = {
83
83
  name: "",
84
84
  restaurantId: "",
85
85
  roleId: ""
86
86
  }, i.value = !0;
87
- }, V = F(() => l("grantUser.form.title")), C = F(() => l("common.create")), B = F(() => b.restaurants.value.map((d) => ({
87
+ }, V = F(() => l("grantUser.form.title")), I = F(() => l("common.create")), C = F(() => w.restaurants.value.map((d) => ({
88
88
  label: `${d.profile.code ? d.profile.code + " - " : ""}${d.profile.name}`,
89
89
  value: d._id
90
- }))), R = F(() => s.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === s.value.restaurantId)).map((d) => ({
90
+ }))), R = F(() => o.value.restaurantId ? U.roles.value.filter((d) => d.restaurants.some((g) => g.id === o.value.restaurantId)).map((d) => ({
91
91
  label: d.name,
92
92
  value: d._id,
93
93
  disabled: !d.isUsable
94
94
  })) : []);
95
- ie(
96
- () => s.value.restaurantId,
95
+ ce(
96
+ () => o.value.restaurantId,
97
97
  () => {
98
- s.value.roleId = "";
98
+ o.value.roleId = "";
99
99
  }
100
100
  );
101
- async function P() {
101
+ async function M() {
102
102
  await p.minor(async () => {
103
- const d = await a.createGrantUser(s.value);
103
+ const d = await a.createGrantUser(o.value);
104
104
  u.open({
105
105
  message: l("grantUser.create.successMessage", {
106
106
  passcode: d.passcode
@@ -111,35 +111,35 @@ const W = {
111
111
  }
112
112
  return y({
113
113
  show: i,
114
- trigger: k
114
+ trigger: b
115
115
  }), (d, g) => {
116
- const T = h("FmTextField"), G = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
117
- return S(), E(J, null, [
118
- ge(d.$slots, "default", { trigger: k }),
119
- n(N, {
116
+ const P = h("FmTextField"), G = h("FmSelect"), L = h("fm-button"), N = h("fm-side-sheet");
117
+ return $(), E(W, null, [
118
+ ge(d.$slots, "default", { trigger: b }),
119
+ r(N, {
120
120
  id: "grant-user-form",
121
121
  modelValue: i.value,
122
122
  "onUpdate:modelValue": g[4] || (g[4] = (f) => i.value = f),
123
- "is-container": r(M).FmForm,
123
+ "is-container": s(K).FmForm,
124
124
  "is-container-props": {
125
- onValidationSuccess: P,
125
+ onValidationSuccess: M,
126
126
  blameFormChildOnValidationFailed: !0
127
127
  },
128
128
  "max-width": 560
129
129
  }, {
130
130
  "side-sheet-header": x(() => [
131
- c("p", Be, w(V.value), 1)
131
+ c("p", Be, k(V.value), 1)
132
132
  ]),
133
133
  "side-sheet-footer": x(() => [
134
134
  c("div", Ge, [
135
- n(L, {
136
- label: C.value,
135
+ r(L, {
136
+ label: I.value,
137
137
  size: "lg",
138
138
  type: "submit",
139
139
  variant: "primary"
140
140
  }, null, 8, ["label"]),
141
- n(L, {
142
- label: r(l)("common.cancel"),
141
+ r(L, {
142
+ label: s(l)("common.cancel"),
143
143
  size: "lg",
144
144
  variant: "tertiary",
145
145
  onClick: g[3] || (g[3] = () => i.value = !1)
@@ -148,41 +148,41 @@ const W = {
148
148
  ]),
149
149
  default: x(() => [
150
150
  c("div", $e, [
151
- n(Ie, {
152
- title: r(l)("grantUser.form.section")
151
+ r(Ie, {
152
+ title: s(l)("grantUser.form.section")
153
153
  }, {
154
154
  default: x(() => [
155
- n(T, {
156
- modelValue: s.value.name,
157
- "onUpdate:modelValue": g[0] || (g[0] = (f) => s.value.name = f),
158
- label: r(l)("grantUser.form.name"),
159
- rules: [(f) => !!f || r(l)("grantUser.form.nameRequired")]
155
+ r(P, {
156
+ modelValue: o.value.name,
157
+ "onUpdate:modelValue": g[0] || (g[0] = (f) => o.value.name = f),
158
+ label: s(l)("grantUser.form.name"),
159
+ rules: [(f) => !!f || s(l)("grantUser.form.nameRequired")]
160
160
  }, null, 8, ["modelValue", "label", "rules"]),
161
- n(ce, {
162
- label: r(l)("grantUser.form.restaurant")
161
+ r(le, {
162
+ label: s(l)("grantUser.form.restaurant")
163
163
  }, {
164
164
  default: x(() => [
165
- n(G, {
166
- modelValue: s.value.restaurantId,
167
- "onUpdate:modelValue": g[1] || (g[1] = (f) => s.value.restaurantId = f),
168
- items: B.value,
169
- placeholder: r(l)("grantUser.form.selectRestaurant"),
170
- rules: [(f) => !!f || r(l)("grantUser.form.restaurantRequired")]
165
+ r(G, {
166
+ modelValue: o.value.restaurantId,
167
+ "onUpdate:modelValue": g[1] || (g[1] = (f) => o.value.restaurantId = f),
168
+ items: C.value,
169
+ placeholder: s(l)("grantUser.form.selectRestaurant"),
170
+ rules: [(f) => !!f || s(l)("grantUser.form.restaurantRequired")]
171
171
  }, null, 8, ["modelValue", "items", "placeholder", "rules"])
172
172
  ]),
173
173
  _: 1
174
174
  }, 8, ["label"]),
175
- n(ce, {
176
- label: r(l)("grantUser.form.role")
175
+ r(le, {
176
+ label: s(l)("grantUser.form.role")
177
177
  }, {
178
178
  default: x(() => [
179
- n(G, {
180
- modelValue: s.value.roleId,
181
- "onUpdate:modelValue": g[2] || (g[2] = (f) => s.value.roleId = f),
179
+ r(G, {
180
+ modelValue: o.value.roleId,
181
+ "onUpdate:modelValue": g[2] || (g[2] = (f) => o.value.roleId = f),
182
182
  items: R.value,
183
- placeholder: r(l)("grantUser.form.selectRole"),
184
- disabled: !s.value.restaurantId,
185
- rules: [(f) => !!f || r(l)("grantUser.form.roleRequired")]
183
+ placeholder: s(l)("grantUser.form.selectRole"),
184
+ disabled: !o.value.restaurantId,
185
+ rules: [(f) => !!f || s(l)("grantUser.form.roleRequired")]
186
186
  }, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
187
187
  ]),
188
188
  _: 1
@@ -210,59 +210,61 @@ const W = {
210
210
  }, Ee = {
211
211
  class: "px-16 flex items-start gap-8"
212
212
  }, Ke = {
213
- class: "pb-64 hidden xs:block"
213
+ class: "flex h-full flex-col overflow-auto"
214
214
  }, Me = {
215
- class: "space-y-4"
215
+ class: "pb-64 hidden xs:block"
216
216
  }, Pe = {
217
- class: "flex items-center gap-8"
217
+ class: "space-y-4"
218
218
  }, Te = {
219
- class: "fm-typo-en-body-lg-600"
219
+ class: "flex items-center gap-8"
220
220
  }, Oe = {
221
- class: "font-mono text-lg font-bold mr-4"
221
+ class: "fm-typo-en-body-lg-600"
222
222
  }, je = {
223
- class: "text-fm-color-typo-secondary"
223
+ class: "font-mono text-lg font-bold mr-4"
224
224
  }, qe = {
225
- class: "text-xs"
225
+ class: "text-fm-color-typo-secondary"
226
226
  }, He = {
227
- class: "mt-4 space-y-2"
228
- }, We = {
229
227
  class: "text-xs"
228
+ }, We = {
229
+ class: "mt-4 space-y-2"
230
230
  }, Je = {
231
231
  class: "text-xs"
232
232
  }, Qe = {
233
+ class: "text-xs"
234
+ }, Xe = {
233
235
  key: 0,
234
236
  class: "flex flex-col gap-4"
235
- }, Xe = /* @__PURE__ */ Q({
237
+ }, Ye = /* @__PURE__ */ J({
236
238
  __name: "GrantUserList",
237
239
  setup(m, {
238
240
  expose: y
239
241
  }) {
240
242
  const {
241
243
  t: a
242
- } = X(), U = I(), b = te(), {
244
+ } = Q(), U = S(), w = ee(), {
243
245
  restaurants: u
244
- } = ee(), {
246
+ } = Z(), {
245
247
  roles: p
246
- } = Z(), l = F(() => b.grantUsers), {
248
+ } = Y(), l = F(() => w.grantUsers), {
247
249
  searchKey: i,
248
- filter: s
249
- } = Fe(), k = F(() => {
250
+ filter: o
251
+ } = Fe(), b = F(() => {
250
252
  var e;
251
253
  return (e = l.value) == null ? void 0 : e.filter((t) => {
252
- const v = !U.value || U.value.includes(t.restaurantId), O = !$.value || $.value.includes(t.status), A = V.value[t.restaurantId] || "", j = C.value[t.roleId] || "";
253
- return v && O && s([t.passcode, t.name, A, j, t.grantByName]);
254
+ const v = !U.value || U.value.includes(t.restaurantId), T = !B.value || B.value.includes(t.status), A = V.value[t.restaurantId] || "", O = I.value[t.roleId] || "";
255
+ return v && T && o([t.passcode, t.name, A, O, t.grantByName]);
254
256
  });
255
257
  }), V = F(() => {
256
258
  const e = {};
257
259
  return u.value.forEach((t) => {
258
260
  e[t._id] = t.profile.name;
259
261
  }), e;
260
- }), C = F(() => {
262
+ }), I = F(() => {
261
263
  const e = {};
262
264
  return p.value.forEach((t) => {
263
265
  e[t._id] = t.name;
264
266
  }), e;
265
- }), B = (e) => {
267
+ }), C = (e) => {
266
268
  switch (e) {
267
269
  case "active":
268
270
  return "bg-fm-color-system-success-100 text-fm-color-typo-success";
@@ -273,7 +275,7 @@ const W = {
273
275
  default:
274
276
  return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
275
277
  }
276
- }, R = (e) => a(`grantUser.status.${e}`), P = [{
278
+ }, R = (e) => a(`grantUser.status.${e}`), M = [{
277
279
  accessorKey: "passcode",
278
280
  size: 120,
279
281
  maxSize: 120,
@@ -283,8 +285,8 @@ const W = {
283
285
  const t = e.row.original.passcode;
284
286
  return _("div", {
285
287
  class: "flex items-center gap-8"
286
- }, [_(M.FmButton, {
287
- variant: q.Tertiary,
288
+ }, [_(K.FmButton, {
289
+ variant: j.Tertiary,
288
290
  textColor: "neutral-gray-400",
289
291
  icon: "content_copy",
290
292
  onClick: (v) => {
@@ -312,10 +314,10 @@ const W = {
312
314
  }
313
315
  }, {
314
316
  accessorKey: "roleName",
315
- accessorFn: (e) => C.value[e.roleId],
317
+ accessorFn: (e) => I.value[e.roleId],
316
318
  header: () => a("grantUser.columns.role"),
317
319
  cell(e) {
318
- const t = e.row.original.roleId, v = C.value[t] || "-";
320
+ const t = e.row.original.roleId, v = I.value[t] || "-";
319
321
  return _("div", v);
320
322
  }
321
323
  }, {
@@ -326,9 +328,9 @@ const W = {
326
328
  },
327
329
  cell(e) {
328
330
  const t = e.row.original.status;
329
- return _(M.FmChip, {
331
+ return _(K.FmChip, {
330
332
  label: R(t),
331
- class: B(t)
333
+ class: C(t)
332
334
  });
333
335
  }
334
336
  }, {
@@ -358,15 +360,15 @@ const W = {
358
360
  const t = e.row.original;
359
361
  return t.status !== "active" ? null : _("div", {
360
362
  class: "w-full flex justify-end items-center gap-4"
361
- }, [_(M.FmButton, {
363
+ }, [_(K.FmButton, {
362
364
  label: a("grantUser.actions.revoke"),
363
- variant: q.Secondary,
365
+ variant: j.Secondary,
364
366
  onClick: (v) => {
365
367
  v.stopPropagation(), N(t);
366
368
  }
367
369
  })]);
368
370
  }
369
- }], d = Y(), g = Ue(), T = ue(d), G = I(), {
371
+ }], d = X(), g = Ue(), P = ue(d), G = S(), {
370
372
  breakpoints: L
371
373
  } = he(), N = (e) => {
372
374
  g.open({
@@ -385,8 +387,8 @@ const W = {
385
387
  close: !0
386
388
  }
387
389
  }).onPrimary(async () => {
388
- T.minor(async () => {
389
- await b.revokeGrantUser(e._id, e.restaurantId);
390
+ P.minor(async () => {
391
+ await w.revokeGrantUser(e._id, e.restaurantId);
390
392
  }, {
391
393
  successMessage: a("grantUser.revoke.successMessage", {
392
394
  name: e.name
@@ -398,7 +400,7 @@ const W = {
398
400
  var e;
399
401
  (e = G.value) == null || e.trigger();
400
402
  }
401
- const ae = F(() => [{
403
+ const te = F(() => [{
402
404
  label: a("grantUser.status.active"),
403
405
  value: "active"
404
406
  }, {
@@ -407,10 +409,10 @@ const W = {
407
409
  }, {
408
410
  label: a("grantUser.status.revoked"),
409
411
  value: "revoked"
410
- }]), re = F(() => u.value.map((e) => ({
412
+ }]), ae = F(() => u.value.map((e) => ({
411
413
  label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
412
414
  value: e._id
413
- }))), $ = I();
415
+ }))), B = S();
414
416
  async function se(e) {
415
417
  try {
416
418
  await navigator.clipboard.writeText(e), d.open({
@@ -426,140 +428,141 @@ const W = {
426
428
  }
427
429
  return y({
428
430
  create: f,
429
- filteredGrantUsers: k
431
+ filteredGrantUsers: b
430
432
  }), (e, t) => {
431
- const v = h("FmSearch"), O = h("FmTable"), A = h("FmButton"), j = h("FmChip"), de = h("FmListItem"), me = h("FmList");
432
- return S(), E(J, null, [n(Re, {
433
+ const v = h("FmSearch"), T = h("FmTable"), A = h("FmButton"), O = h("FmChip"), de = h("FmListItem"), me = h("FmList");
434
+ return $(), E(W, null, [r(Re, {
433
435
  ref_key: "grantUserFormRef",
434
436
  ref: G,
435
437
  class: "gap-8"
436
- }, null, 512), c("div", Le, [c("div", Ne, [c("div", Ae, [n(D, {
438
+ }, null, 512), c("div", Le, [c("div", Ne, [c("div", Ae, [r(D, {
437
439
  modelValue: U.value,
438
- "onUpdate:modelValue": t[0] || (t[0] = (o) => U.value = o),
440
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => U.value = n),
439
441
  multiple: "",
440
- items: re.value,
442
+ items: ae.value,
441
443
  variant: "dark",
442
- "selected-prefix": r(a)("grantUser.columns.restaurant"),
443
- placeholder: r(a)("grantUser.columns.restaurant"),
444
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
445
+ placeholder: s(a)("grantUser.columns.restaurant"),
444
446
  class: "!w-auto"
445
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
446
- modelValue: $.value,
447
- "onUpdate:modelValue": t[1] || (t[1] = (o) => $.value = o),
447
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), r(D, {
448
+ modelValue: B.value,
449
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => B.value = n),
448
450
  multiple: "",
449
451
  variant: "dark",
450
- items: ae.value,
451
- "selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
452
- placeholder: r(a)("grantUser.filter.status_placeholder")
453
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), n(v, {
454
- modelValue: r(i),
455
- "onUpdate:modelValue": t[2] || (t[2] = (o) => oe(i) ? i.value = o : null),
452
+ items: te.value,
453
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
454
+ placeholder: s(a)("grantUser.filter.status_placeholder")
455
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), r(v, {
456
+ modelValue: s(i),
457
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => re(i) ? i.value = n : null),
456
458
  autofocus: "",
457
459
  class: "pl-4 w-[320px]",
458
- placeholder: r(a)("grantUser.search.placeholder")
459
- }, null, 8, ["modelValue", "placeholder"])]), c("div", ze, [c("div", De, [n(v, {
460
- modelValue: r(i),
461
- "onUpdate:modelValue": t[3] || (t[3] = (o) => oe(i) ? i.value = o : null),
460
+ placeholder: s(a)("grantUser.search.placeholder")
461
+ }, null, 8, ["modelValue", "placeholder"])]), c("div", ze, [c("div", De, [r(v, {
462
+ modelValue: s(i),
463
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => re(i) ? i.value = n : null),
462
464
  autofocus: "",
463
- placeholder: r(a)("grantUser.search.placeholder")
464
- }, null, 8, ["modelValue", "placeholder"])]), n(Ve), c("div", Ee, [n(D, {
465
+ placeholder: s(a)("grantUser.search.placeholder")
466
+ }, null, 8, ["modelValue", "placeholder"])]), r(Ve), c("div", Ee, [r(D, {
465
467
  modelValue: U.value,
466
- "onUpdate:modelValue": t[4] || (t[4] = (o) => U.value = o),
468
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => U.value = n),
467
469
  multiple: "",
468
- items: re.value,
470
+ items: ae.value,
469
471
  variant: "dark",
470
- "selected-prefix": r(a)("grantUser.columns.restaurant"),
471
- placeholder: r(a)("grantUser.columns.restaurant"),
472
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
473
+ placeholder: s(a)("grantUser.columns.restaurant"),
472
474
  class: "!w-auto"
473
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(D, {
474
- modelValue: $.value,
475
- "onUpdate:modelValue": t[5] || (t[5] = (o) => $.value = o),
475
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), r(D, {
476
+ modelValue: B.value,
477
+ "onUpdate:modelValue": t[5] || (t[5] = (n) => B.value = n),
476
478
  multiple: "",
477
- items: ae.value,
479
+ items: te.value,
478
480
  variant: "dark",
479
- "selected-prefix": r(a)("grantUser.filter.selected_status_prefix"),
480
- placeholder: r(a)("grantUser.filter.status_placeholder")
481
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), l.value.length > 0 || r(b).isLoading ? (S(), K(we, {
482
- key: 0,
483
- class: "overflow-auto"
484
- }, {
485
- default: x(() => [n(O, {
486
- class: "xs:hidden",
487
- "column-defs": P,
488
- "row-data": k.value,
489
- "page-size": k.value.length,
490
- loading: r(b).isLoading,
491
- virtual: k.value.length > 0,
492
- "pin-header-row": "",
493
- "hide-footer": ""
494
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div", Ke, [n(me, {
481
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
482
+ placeholder: s(a)("grantUser.filter.status_placeholder")
483
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), r(ke, null, {
484
+ default: x(() => [c("div", Ke, [r(Se, {
485
+ "is-loading": s(w).isLoading,
486
+ "is-empty": b.value.length === 0,
487
+ title: s(a)("grantUser.noData.title"),
488
+ subtitle: s(a)("grantUser.noData.subtitle")
489
+ }, {
490
+ default: x(() => [r(T, {
491
+ class: "xs:hidden",
492
+ "column-defs": M,
493
+ "row-data": b.value,
494
+ "page-size": b.value.length,
495
+ loading: s(w).isLoading,
496
+ virtual: b.value.length > 0,
497
+ "pin-header-row": "",
498
+ "hide-footer": ""
499
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"])]),
500
+ _: 1
501
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"]), c("div", Me, [r(me, {
495
502
  separator: ""
496
503
  }, {
497
- default: x(() => [(S(!0), E(J, null, fe(k.value, (o) => (S(), K(de, {
498
- key: o._id,
504
+ default: x(() => [($(!0), E(W, null, fe(b.value, (n) => ($(), ie(de, {
505
+ key: n._id,
499
506
  class: "py-12 px-16 items-center justify-between"
500
507
  }, {
501
- default: x(() => [c("div", Me, [c("div", Pe, [n(A, {
508
+ default: x(() => [c("div", Pe, [c("div", Te, [r(A, {
502
509
  variant: "tertiary",
503
510
  "text-color": "neutral-gray-400",
504
511
  icon: "content_copy",
505
- onClick: ne((pe) => se(o.passcode), ["stop"])
506
- }, null, 8, ["onClick"]), c("p", Te, [c("span", Oe, w(o.passcode), 1), le(" - " + w(o.name), 1)])]), c("div", je, [c("div", null, [le(w(V.value[o.restaurantId] || "-") + " ", 1), c("div", qe, w(o.restaurantId), 1), c("div", null, w(C.value[o.roleId] || "-"), 1)]), c("div", He, [c("div", We, w(r(a)("grantUser.columns.grantedBy")) + ": " + w(o.grantByName), 1), c("div", Je, w(r(a)("grantUser.columns.createdAt")) + ": " + w(new Date(o.createdAt).toLocaleString()), 1), n(j, {
507
- label: R(o.status),
508
- class: _e(B(o.status))
509
- }, null, 8, ["label", "class"])])])]), o.status === "active" ? (S(), E("div", Qe, [n(A, {
510
- label: r(a)("grantUser.actions.revoke"),
511
- variant: r(q).Secondary,
512
- onClick: ne((pe) => N(o), ["stop"])
512
+ onClick: oe((pe) => se(n.passcode), ["stop"])
513
+ }, null, 8, ["onClick"]), c("p", Oe, [c("span", je, k(n.passcode), 1), ne(" - " + k(n.name), 1)])]), c("div", qe, [c("div", null, [ne(k(V.value[n.restaurantId] || "-") + " ", 1), c("div", He, k(n.restaurantId), 1), c("div", null, k(I.value[n.roleId] || "-"), 1)]), c("div", We, [c("div", Je, k(s(a)("grantUser.columns.grantedBy")) + ": " + k(n.grantByName), 1), c("div", Qe, k(s(a)("grantUser.columns.createdAt")) + ": " + k(new Date(n.createdAt).toLocaleString()), 1), r(O, {
514
+ label: R(n.status),
515
+ class: _e(C(n.status))
516
+ }, null, 8, ["label", "class"])])])]), n.status === "active" ? ($(), E("div", Xe, [r(A, {
517
+ label: s(a)("grantUser.actions.revoke"),
518
+ variant: s(j).Secondary,
519
+ onClick: oe((pe) => N(n), ["stop"])
513
520
  }, null, 8, ["label", "variant", "onClick"])])) : ve("", !0)]),
514
521
  _: 2
515
522
  }, 1024))), 128))]),
516
523
  _: 1
517
- })])]),
524
+ })])])]),
518
525
  _: 1
519
- })) : (S(), K(r(Se), {
520
- key: 1,
521
- title: r(a)("grantUser.noData.title"),
522
- subtitle: r(a)("grantUser.noData.subtitle")
523
- }, null, 8, ["title", "subtitle"]))])], 64);
526
+ })])], 64);
524
527
  };
525
528
  }
526
- }), dt = /* @__PURE__ */ Q({
529
+ }), mt = /* @__PURE__ */ J({
527
530
  __name: "Main",
528
531
  setup(m) {
529
- const { readGrantUsers: y } = te(), { currentBusiness: a } = ye(), { readRoles: U } = Z(), { readRestaurants: b } = ee(), { t: u } = X(), p = Y(), l = I();
530
- return ie(
532
+ const { readGrantUsers: y } = ee(), { currentBusiness: a } = ye(), { readRoles: U } = Y(), { readRestaurants: w } = Z(), { t: u } = Q(), p = X(), l = S();
533
+ return ce(
531
534
  a,
532
535
  async () => {
533
536
  var i;
534
537
  if ((i = a.value) != null && i._id)
535
538
  try {
536
- await Promise.all([b(), U(), y()]);
537
- } catch (s) {
538
- console.error("Failed to load grant dependencies:", s), p.open({
539
- message: s instanceof Error ? s.message : String(s),
539
+ await Promise.all([w(), U(), y()]);
540
+ } catch (o) {
541
+ console.error("Failed to load grant dependencies:", o), p.open({
542
+ message: o instanceof Error ? o.message : String(o),
540
543
  type: "error"
541
544
  });
542
545
  }
543
546
  },
544
547
  { immediate: !0 }
545
- ), (i, s) => {
546
- const k = h("FmSpacer"), V = h("FmButton");
547
- return S(), K(xe, {
548
- heading: r(u)("grantUser.title")
548
+ ), (i, o) => {
549
+ const b = h("FmSpacer"), V = h("FmButton");
550
+ return $(), ie(xe, {
551
+ heading: s(u)("grantUser.title")
549
552
  }, {
550
553
  "append-heading": x(() => [
551
- n(k),
552
- n(V, {
554
+ r(b),
555
+ r(V, {
553
556
  "prepend-icon": "add",
554
- label: r(u)("grantUser.actions.create"),
555
- onClick: s[0] || (s[0] = (C) => {
556
- var B;
557
- return (B = l.value) == null ? void 0 : B.create();
557
+ label: s(u)("grantUser.actions.create"),
558
+ onClick: o[0] || (o[0] = (I) => {
559
+ var C;
560
+ return (C = l.value) == null ? void 0 : C.create();
558
561
  })
559
562
  }, null, 8, ["label"])
560
563
  ]),
561
564
  default: x(() => [
562
- n(Xe, {
565
+ r(Ye, {
563
566
  ref_key: "grantUserListRef",
564
567
  ref: l
565
568
  }, null, 512)
@@ -570,5 +573,5 @@ const W = {
570
573
  }
571
574
  });
572
575
  export {
573
- dt as default
576
+ mt as default
574
577
  };