@feedmepos/mf-hrm-portal 2.0.6-dev → 2.0.6-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 (50) hide show
  1. package/dist/{AuditLogList-BxigxQv3.js → AuditLogList-C23_MiyK.js} +31 -30
  2. package/dist/{EmployeeList-DyvqwZtw.js → EmployeeList-vXPEVqoh.js} +164 -169
  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-CQWe1-SW.js +599 -0
  6. package/dist/{Main-B8tSMq-U.js → Main-DC9H9bAs.js} +11 -10
  7. package/dist/{Main-CtH5MCty.js → Main-k56Iy_zg.js} +8 -7
  8. package/dist/PermissionSetList-B8tJCNpR.js +338 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BPJpVG8_.js +3356 -0
  10. package/dist/{RoleList-jykDD_zm.js → RoleList-C5WA3Kxu.js} +26 -24
  11. package/dist/TeamMemberList-Ic-iWBHd.js +989 -0
  12. package/dist/{TimesheetList-Bk1XF9xy.js → TimesheetList-DlGpcOUp.js} +11 -10
  13. package/dist/{app-BPlaahxK.js → app-D0xH_99A.js} +1310 -937
  14. package/dist/app.js +2 -2
  15. package/dist/{dayjs.min-LweNOSZ_.js → dayjs.min-C1rTVn8X.js} +1 -1
  16. package/dist/{employee-DPfiL6rd.js → employee-BK4sYiRy.js} +21 -20
  17. package/dist/index-C2ubYSVV.js +968 -0
  18. package/dist/{index-BAhsHYNv.js → index-DSAB4vz3.js} +1 -1
  19. package/dist/{index-CBxn7cxI.js → iteration-BSGKcAZm.js} +3416 -4256
  20. package/dist/{lodash-D1uG3PY3.js → lodash-CeTePH4O.js} +1 -1
  21. package/dist/src/api/grant-user/index.d.ts +8 -0
  22. package/dist/src/api/index.d.ts +3 -1
  23. package/dist/src/api/permission-assignment/index.d.ts +3 -0
  24. package/dist/src/api/report-query/index.d.ts +1 -0
  25. package/dist/src/composables/useCustomReportPermissions.d.ts +7 -0
  26. package/dist/src/helpers/permission-set.d.ts +32 -1
  27. package/dist/src/helpers/permission-set.test.d.ts +1 -0
  28. package/dist/src/helpers/rule.d.ts +4 -1
  29. package/dist/src/router/shared.d.ts +2 -1
  30. package/dist/src/stores/grant-user.d.ts +86 -0
  31. package/dist/src/types/grant-user.d.ts +27 -0
  32. package/dist/src/types/report-query.d.ts +1 -0
  33. package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
  34. package/dist/src/views/grant/Main.vue.d.ts +2 -0
  35. package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
  36. package/dist/src/views/grant/locales/index.d.ts +232 -0
  37. package/dist/src/views/team/components/BasePermission.vue.d.ts +17 -0
  38. package/dist/{team-B1osnB4U.js → team-B25hRkju.js} +1 -1
  39. package/dist/{timesheet-rte2utJf.js → timesheet-C8oy-bxz.js} +10 -9
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{useAppStore-CqrjwnF_.js → useAppStore-WGnUS7Wm.js} +1 -1
  42. package/dist/{useLoading-B5IjfVEP.js → useLoading-BCi2g_rf.js} +1 -1
  43. package/dist/useReportPermissions--LOfl1e-.js +60 -0
  44. package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
  45. package/package.json +2 -2
  46. package/dist/PermissionSetList-DCONmOgn.js +0 -323
  47. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-07Dsea27.js +0 -3092
  48. package/dist/TeamMemberList-DMrPgF1l.js +0 -973
  49. package/dist/useReportPermissions-C4Q29AQJ.js +0 -65
  50. package/dist/useRestaurantMap-D5BNPLKh.js +0 -107
@@ -1,35 +1,30 @@
1
- import { createElementBlock as $, openBlock as g, createElementVNode as m, toRaw as Me, defineComponent as _e, ref as _, computed as w, watch as be, resolveComponent as p, Fragment as G, renderSlot as Ie, createVNode as u, unref as o, withCtx as h, createBlock as D, createCommentVNode as Q, isRef as ne, renderList as Ve, toDisplayString as K, onMounted as $e, h as re, createTextVNode as Oe, withModifiers as Le } from "vue";
1
+ import { toRaw as Me, defineComponent as _e, ref as g, computed as w, watch as be, resolveComponent as p, createElementBlock as B, openBlock as _, Fragment as K, renderSlot as Ie, createVNode as u, unref as o, withCtx as h, createElementVNode as d, createBlock as N, createCommentVNode as W, isRef as ne, renderList as Ve, toDisplayString as j, onMounted as $e, h as re, createTextVNode as Oe, withModifiers as Le } from "vue";
2
2
  import { useCoreStore as Fe, useI18n as we, RestaurantSelector as ce } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as xe, components as Ue, useDialog as Ne, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
4
- import { _ as Pe, S as pe } from "./SelectFilter-DUj7GBtT.js";
5
- import { _ as Te } from "./app-BPlaahxK.js";
4
+ import { S as pe } from "./SelectFilter-DUj7GBtT.js";
5
+ import { _ as Pe } from "./app-D0xH_99A.js";
6
+ import { H as Te } from "./HorizontalSplitter-o860F4xM.js";
6
7
  import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
8
  import { u as ke } from "./useSearch-B6WK1LBB.js";
8
- import { u as Se, E as Ae } from "./employee-DPfiL6rd.js";
9
- import { l as je } from "./lodash-D1uG3PY3.js";
10
- import { u as Ke, _ as ve, a as fe, b as Ge } from "./useRestaurantMap-D5BNPLKh.js";
11
- import { u as qe } from "./useLoading-B5IjfVEP.js";
12
- import { u as ue } from "./useAppStore-CqrjwnF_.js";
13
- const He = {};
14
- function Je(S, O) {
15
- return g(), $("div", null, [...O[0] || (O[0] = [
16
- m("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
17
- ])]);
9
+ import { u as Se, E as Ae } from "./employee-BK4sYiRy.js";
10
+ import { l as je } from "./lodash-CeTePH4O.js";
11
+ import { _ as ve, a as fe } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
12
+ import { u as Ke, a as Ge } from "./useRestaurantMap-e9fQJiLC.js";
13
+ import { u as qe } from "./useLoading-BCi2g_rf.js";
14
+ import { u as ue } from "./useAppStore-WGnUS7Wm.js";
15
+ function ye(I) {
16
+ return JSON.parse(JSON.stringify(I));
18
17
  }
19
- const We = /* @__PURE__ */ Pe(He, [["render", Je]]);
20
- function ye(S) {
21
- return JSON.parse(JSON.stringify(S));
22
- }
23
- function he(S) {
18
+ function he(I) {
24
19
  if (typeof structuredClone > "u")
25
- return ye(S);
20
+ return ye(I);
26
21
  try {
27
- return structuredClone(Me(S));
22
+ return structuredClone(Me(I));
28
23
  } catch {
29
- return ye(S);
24
+ return ye(I);
30
25
  }
31
26
  }
32
- const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Ye = { class: "flex flex-row gap-16" }, Ze = { class: "space-y-16" }, el = { class: "flex gap-8 items-center justify-start" }, ge = 4, ll = /* @__PURE__ */ _e({
27
+ const He = { class: "fm-typo-en-title-md-600" }, Je = { class: "space-y-40" }, We = { class: "flex flex-row gap-16" }, Qe = { class: "space-y-16" }, Xe = { class: "flex gap-8 items-center justify-start" }, ge = 4, Ye = /* @__PURE__ */ _e({
33
28
  __name: "EmployeeForm",
34
29
  props: {
35
30
  roleErrorMessage: {
@@ -37,11 +32,11 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
37
32
  default: ""
38
33
  }
39
34
  },
40
- setup(S, { expose: O }) {
41
- const i = ue(), E = Fe(), c = Se(), q = xe(), H = qe(q), { t: d } = we(), v = _(!1), L = _(!0), R = (l) => {
42
- s.value = l ? he(l) : P(), x.value = he(s.value), a.value = [], b.value = s.value.restaurants.map((e) => e.restaurantId), s.value.passcode && (a.value = s.value.passcode.split(""), t.value = !0), L.value = !l, v.value = !0;
35
+ setup(I, { expose: Q }) {
36
+ const i = ue(), S = Fe(), c = Se(), G = xe(), q = qe(G), { t: m } = we(), v = g(!1), $ = g(!0), E = (l) => {
37
+ s.value = l ? he(l) : D(), x.value = he(s.value), a.value = [], b.value = s.value.restaurants.map((e) => e.restaurantId), s.value.passcode && (a.value = s.value.passcode.split(""), t.value = !0), $.value = !l, v.value = !0;
43
38
  };
44
- function P() {
39
+ function D() {
45
40
  return {
46
41
  code: "",
47
42
  isMasterUser: !1,
@@ -50,18 +45,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
50
45
  restaurants: []
51
46
  };
52
47
  }
53
- const T = w(() => L.value ? d("hr.employee.form.add") : d("hr.employee.form.update")), X = w(() => L.value ? d("common.create") : d("common.update")), x = _(P()), s = _(P()), { searchKey: C, filter: z } = ke(), Y = w(() => {
48
+ const P = w(() => $.value ? m("hr.employee.form.add") : m("hr.employee.form.update")), X = w(() => $.value ? m("common.create") : m("common.update")), x = g(D()), s = g(D()), { searchKey: R, filter: T } = ke(), Y = w(() => {
54
49
  const l = {};
55
50
  return i.roles.value.forEach((e) => {
56
51
  l[e._id] = e.name;
57
52
  }), l;
58
53
  });
59
- function J(l) {
60
- const e = A(l) ?? "";
54
+ function H(l) {
55
+ const e = z(l) ?? "";
61
56
  return Y.value[e] || "";
62
57
  }
63
- const M = w(() => E.restaurants.value.filter(({ _id: e, profile: n, managable: I }) => I ? z([n.code, n.name, J(e)]) : b.value.includes(e)).map(({ _id: e, profile: n, managable: I }) => {
64
- const B = i.roles.value.filter((V) => V.restaurants.some((F) => F.id == e)).map((V) => ({
58
+ const C = w(() => S.restaurants.value.filter(({ _id: e, profile: n, managable: M }) => M ? T([n.code, n.name, H(e)]) : b.value.includes(e)).map(({ _id: e, profile: n, managable: M }) => {
59
+ const L = i.roles.value.filter((V) => V.restaurants.some((F) => F.id == e)).map((V) => ({
65
60
  label: V.name,
66
61
  value: V._id,
67
62
  disabled: !V.isUsable
@@ -69,15 +64,15 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
69
64
  return {
70
65
  value: e,
71
66
  label: `${n.code ? n.code + "-" : ""}${n.name}`,
72
- roleOptions: B,
73
- disabled: !I
67
+ roleOptions: L,
68
+ disabled: !M
74
69
  };
75
70
  })), Z = w(() => {
76
71
  const l = {};
77
72
  return s.value.restaurants.forEach((e) => {
78
73
  l[e.restaurantId] = e.roleId;
79
74
  }), l;
80
- }), A = (l) => Z.value[l] ?? null, W = (l, e) => {
75
+ }), z = (l) => Z.value[l] ?? null, J = (l, e) => {
81
76
  s.value.restaurants = [
82
77
  ...s.value.restaurants.filter((n) => n.restaurantId !== l),
83
78
  {
@@ -85,37 +80,37 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
85
80
  roleId: e
86
81
  }
87
82
  ];
88
- }, b = _(s.value.restaurants.map((l) => l.restaurantId)), N = w(
83
+ }, b = g(s.value.restaurants.map((l) => l.restaurantId)), O = w(
89
84
  () => b.value.filter(
90
- (l) => M.value.some((e) => e.value === l && !e.disabled)
85
+ (l) => C.value.some((e) => e.value === l && !e.disabled)
91
86
  )
92
87
  ), k = w(() => {
93
- const l = M.value.filter((e) => !e.disabled).length;
94
- return l > 0 && l === N.value.length;
88
+ const l = C.value.filter((e) => !e.disabled).length;
89
+ return l > 0 && l === O.value.length;
95
90
  }), ee = () => {
96
- const l = b.value.filter((e) => !N.value.includes(e));
91
+ const l = b.value.filter((e) => !O.value.includes(e));
97
92
  if (k.value === !0)
98
- j(l);
93
+ A(l);
99
94
  else {
100
- const e = M.value.filter((n) => !n.disabled).map((n) => n.value);
101
- j([...e, ...l]);
95
+ const e = C.value.filter((n) => !n.disabled).map((n) => n.value);
96
+ A([...e, ...l]);
102
97
  }
103
- }, j = (l) => {
98
+ }, A = (l) => {
104
99
  b.value = l, s.value.restaurants = l.map((e) => {
105
- var B, V;
106
- const n = M.value.find((F) => F.value === e);
100
+ var L, V;
101
+ const n = C.value.find((F) => F.value === e);
107
102
  if (n != null && n.disabled)
108
103
  return s.value.restaurants.find((F) => F.restaurantId === e) ?? {
109
104
  restaurantId: e,
110
105
  roleId: ""
111
106
  };
112
- const I = ((B = n == null ? void 0 : n.roleOptions.find((F) => !F.disabled)) == null ? void 0 : B.value) || "";
107
+ const M = ((L = n == null ? void 0 : n.roleOptions.find((F) => !F.disabled)) == null ? void 0 : L.value) || "";
113
108
  return {
114
109
  restaurantId: e,
115
- roleId: ((V = s.value.restaurants.find((F) => F.restaurantId === e)) == null ? void 0 : V.roleId) || I
110
+ roleId: ((V = s.value.restaurants.find((F) => F.restaurantId === e)) == null ? void 0 : V.roleId) || M
116
111
  };
117
112
  });
118
- }, a = _([]), t = _(!1);
113
+ }, a = g([]), t = g(!1);
119
114
  function f() {
120
115
  t.value && (t.value = !1, a.value = []);
121
116
  }
@@ -163,19 +158,19 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
163
158
  }
164
159
  }
165
160
  async function te() {
166
- L.value ? await H.minor(
161
+ $.value ? await q.minor(
167
162
  async () => {
168
163
  await le();
169
164
  },
170
165
  {
171
- successMessage: d("hr.employee.create.successMessage")
166
+ successMessage: m("hr.employee.create.successMessage")
172
167
  }
173
- ) : await H.minor(
168
+ ) : await q.minor(
174
169
  async () => {
175
170
  await ae();
176
171
  },
177
172
  {
178
- successMessage: d("hr.employee.update.successMessage")
173
+ successMessage: m("hr.employee.update.successMessage")
179
174
  }
180
175
  ), v.value = !1;
181
176
  }
@@ -183,13 +178,13 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
183
178
  () => v.value,
184
179
  (l) => {
185
180
  }
186
- ), O({
181
+ ), Q({
187
182
  show: v,
188
- trigger: R
183
+ trigger: E
189
184
  }), (l, e) => {
190
- const n = p("FmSwitch"), I = p("FmTextField"), B = p("FmPinField"), V = p("FmFormGroup"), F = p("FmButton"), Ee = p("FmSearch"), ie = p("FmCheckbox"), Re = p("FmSelect"), de = p("fm-button"), Ce = p("fm-side-sheet");
191
- return g(), $(G, null, [
192
- Ie(l.$slots, "default", { trigger: R }),
185
+ const n = p("FmSwitch"), M = p("FmTextField"), L = p("FmPinField"), V = p("FmFormGroup"), F = p("FmButton"), Ee = p("FmSearch"), ie = p("FmCheckbox"), Re = p("FmSelect"), me = p("fm-button"), Ce = p("fm-side-sheet");
186
+ return _(), B(K, null, [
187
+ Ie(l.$slots, "default", { trigger: E }),
193
188
  u(Ce, {
194
189
  id: "unit-form",
195
190
  modelValue: v.value,
@@ -203,18 +198,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
203
198
  "onOn:clickedAway": o(y)
204
199
  }, {
205
200
  "side-sheet-header": h(() => [
206
- m("p", Qe, K(T.value), 1)
201
+ d("p", He, j(P.value), 1)
207
202
  ]),
208
203
  "side-sheet-footer": h(() => [
209
- m("div", el, [
210
- u(de, {
204
+ d("div", Xe, [
205
+ u(me, {
211
206
  label: X.value,
212
207
  size: "lg",
213
208
  type: "submit",
214
209
  variant: "primary"
215
210
  }, null, 8, ["label"]),
216
- u(de, {
217
- label: o(d)("common.cancel"),
211
+ u(me, {
212
+ label: o(m)("common.cancel"),
218
213
  size: "lg",
219
214
  variant: "tertiary",
220
215
  onClick: e[8] || (e[8] = () => v.value = !1)
@@ -222,55 +217,55 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
222
217
  ])
223
218
  ]),
224
219
  default: h(() => [
225
- m("div", Xe, [
220
+ d("div", Je, [
226
221
  u(ve, {
227
- title: o(d)("hr.employee.form.employeeSetting")
222
+ title: o(m)("hr.employee.form.employeeSetting")
228
223
  }, {
229
224
  default: h(() => [
230
225
  u(fe, {
231
- label: o(d)("hr.employee.form.masterUserConfig")
226
+ label: o(m)("hr.employee.form.masterUserConfig")
232
227
  }, {
233
228
  default: h(() => [
234
229
  u(n, {
235
230
  modelValue: s.value.isMasterUser,
236
231
  "onUpdate:modelValue": e[0] || (e[0] = (r) => s.value.isMasterUser = r),
237
232
  value: "masterUser",
238
- label: o(d)("hr.employee.form.masterUser"),
239
- sublabel: o(d)("hr.employee.form.masterUserSublabel"),
233
+ label: o(m)("hr.employee.form.masterUser"),
234
+ sublabel: o(m)("hr.employee.form.masterUserSublabel"),
240
235
  "label-placement": "right"
241
236
  }, null, 8, ["modelValue", "label", "sublabel"])
242
237
  ]),
243
238
  _: 1
244
239
  }, 8, ["label"]),
245
- m("div", Ye, [
246
- s.value.isMasterUser ? (g(), D(I, {
240
+ d("div", We, [
241
+ s.value.isMasterUser ? (_(), N(M, {
247
242
  key: 0,
248
243
  modelValue: s.value.code,
249
244
  "onUpdate:modelValue": e[1] || (e[1] = (r) => s.value.code = r),
250
- label: o(d)("hr.employee.form.code")
251
- }, null, 8, ["modelValue", "label"])) : Q("", !0),
252
- u(I, {
245
+ label: o(m)("hr.employee.form.code")
246
+ }, null, 8, ["modelValue", "label"])) : W("", !0),
247
+ u(M, {
253
248
  modelValue: s.value.name,
254
249
  "onUpdate:modelValue": e[2] || (e[2] = (r) => s.value.name = r),
255
250
  class: "w-full",
256
- label: o(d)("hr.employee.form.name"),
257
- rules: [(r) => !!r || o(d)("hr.employee.form.required")]
251
+ label: o(m)("hr.employee.form.name"),
252
+ rules: [(r) => !!r || o(m)("hr.employee.form.required")]
258
253
  }, null, 8, ["modelValue", "label", "rules"])
259
254
  ]),
260
255
  u(fe, {
261
- label: o(d)("hr.employee.form.passcode")
256
+ label: o(m)("hr.employee.form.passcode")
262
257
  }, {
263
258
  default: h(() => [
264
- m("div", Ze, [
259
+ d("div", Qe, [
265
260
  u(V, {
266
261
  modelValue: a.value,
267
262
  "onUpdate:modelValue": e[5] || (e[5] = (r) => a.value = r),
268
263
  rules: [
269
- (r) => (r == null ? void 0 : r.filter((oe) => !!oe).length) !== ge ? o(d)("hr.employee.form.passcodeRequired") : !0
264
+ (r) => (r == null ? void 0 : r.filter((oe) => !!oe).length) !== ge ? o(m)("hr.employee.form.passcodeRequired") : !0
270
265
  ]
271
266
  }, {
272
267
  default: h(() => [
273
- u(B, {
268
+ u(L, {
274
269
  modelValue: a.value,
275
270
  "onUpdate:modelValue": e[3] || (e[3] = (r) => a.value = r),
276
271
  length: ge,
@@ -285,7 +280,7 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
285
280
  variant: "secondary",
286
281
  "text-color": "primary",
287
282
  "border-color": "primary",
288
- label: o(d)("hr.employee.form.passcodeGenerate"),
283
+ label: o(m)("hr.employee.form.passcodeGenerate"),
289
284
  size: "md",
290
285
  onClick: U
291
286
  }, null, 8, ["label"])
@@ -297,47 +292,47 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
297
292
  _: 1
298
293
  }, 8, ["title"]),
299
294
  u(ve, {
300
- title: o(d)("hr.employee.form.role")
295
+ title: o(m)("hr.employee.form.role")
301
296
  }, {
302
297
  default: h(() => [
303
298
  u(Ee, {
304
- modelValue: o(C),
305
- "onUpdate:modelValue": e[6] || (e[6] = (r) => ne(C) ? C.value = r : null),
306
- placeholder: o(d)("hr.restaurant.search.placeholder")
299
+ modelValue: o(R),
300
+ "onUpdate:modelValue": e[6] || (e[6] = (r) => ne(R) ? R.value = r : null),
301
+ placeholder: o(m)("hr.restaurant.search.placeholder")
307
302
  }, null, 8, ["modelValue", "placeholder"]),
308
303
  u(V, {
309
304
  modelValue: b.value,
310
305
  "onUpdate:modelValue": e[7] || (e[7] = (r) => b.value = r),
311
- rules: [(r) => r.length > 0 || o(d)("hr.employee.form.atLeastOneRestaurant")]
306
+ rules: [(r) => r.length > 0 || o(m)("hr.employee.form.atLeastOneRestaurant")]
312
307
  }, {
313
308
  default: h(() => [
314
309
  u(ie, {
315
310
  "model-value": k.value,
316
- label: o(d)("hr.employee.form.all"),
311
+ label: o(m)("hr.employee.form.all"),
317
312
  value: "1",
318
- indeterminate: N.value.length > 0,
313
+ indeterminate: O.value.length > 0,
319
314
  "onUpdate:modelValue": ee
320
315
  }, null, 8, ["model-value", "label", "indeterminate"]),
321
- (g(!0), $(G, null, Ve(M.value, (r, oe) => {
322
- var me;
323
- return g(), $(G, { key: oe }, [
316
+ (_(!0), B(K, null, Ve(C.value, (r, oe) => {
317
+ var de;
318
+ return _(), B(K, { key: oe }, [
324
319
  u(ie, {
325
320
  "model-value": b.value,
326
321
  label: r.label,
327
322
  value: r.value,
328
323
  disabled: r.disabled,
329
- "onUpdate:modelValue": j
324
+ "onUpdate:modelValue": A
330
325
  }, null, 8, ["model-value", "label", "value", "disabled"]),
331
- b.value.includes(r.value) ? (g(), D(Re, {
326
+ b.value.includes(r.value) ? (_(), N(Re, {
332
327
  key: 0,
333
328
  class: "ml-32 mr-8",
334
329
  items: r.roleOptions,
335
- "model-value": A(r.value),
330
+ "model-value": z(r.value),
336
331
  multiselect: !1,
337
- placeholder: ((me = r.roleOptions.find((se) => !se.disabled) ?? r.roleOptions[0]) == null ? void 0 : me.label) ?? "",
332
+ placeholder: ((de = r.roleOptions.find((se) => !se.disabled) ?? r.roleOptions[0]) == null ? void 0 : de.label) ?? "",
338
333
  disabled: r.disabled,
339
- "onUpdate:modelValue": (se) => W(r.value, se)
340
- }, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) : Q("", !0)
334
+ "onUpdate:modelValue": (se) => J(r.value, se)
335
+ }, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) : W("", !0)
341
336
  ], 64);
342
337
  }), 128))
343
338
  ]),
@@ -353,51 +348,51 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
353
348
  ], 64);
354
349
  };
355
350
  }
356
- }), al = {
351
+ }), Ze = {
357
352
  class: "space-y-8"
358
- }, tl = {
353
+ }, el = {
359
354
  class: "xs:hidden flex w-full items-start justify-between"
360
- }, ol = {
355
+ }, ll = {
361
356
  class: "flex items-start gap-8"
362
- }, sl = {
357
+ }, al = {
363
358
  class: "flex"
364
- }, rl = {
359
+ }, tl = {
365
360
  class: "space-y-4 sm:hidden md:hidden lg:hidden"
366
- }, nl = {
361
+ }, ol = {
367
362
  class: "px-16"
368
- }, ul = {
363
+ }, sl = {
369
364
  class: "px-16 flex items-start gap-8"
370
- }, il = {
365
+ }, rl = {
371
366
  class: "pb-64 sm:hidden md:hidden lg:hidden"
372
- }, dl = {
367
+ }, nl = {
373
368
  class: "space-y-4"
374
- }, ml = {
369
+ }, ul = {
375
370
  class: "fm-typo-en-body-lg-600"
376
- }, cl = {
371
+ }, il = {
377
372
  key: 0,
378
373
  class: "mr-4"
379
- }, pl = {
374
+ }, ml = {
380
375
  class: "text-fm-color-typo-secondary"
381
- }, kl = /* @__PURE__ */ _e({
376
+ }, Ul = /* @__PURE__ */ _e({
382
377
  __name: "EmployeeList",
383
- setup(S, {
384
- expose: O
378
+ setup(I, {
379
+ expose: Q
385
380
  }) {
386
381
  const {
387
382
  t: i
388
- } = we(), E = _(), c = Se(), q = ue(), {
389
- sessionUser: H
390
- } = Fe(), d = w(() => c.employees.value), {
383
+ } = we(), S = g(), c = Se(), G = ue(), {
384
+ sessionUser: q
385
+ } = Fe(), m = w(() => c.employees.value), {
391
386
  searchKey: v,
392
- filter: L
393
- } = ke(""), R = w(() => {
387
+ filter: $
388
+ } = ke(""), E = w(() => {
394
389
  var a;
395
- return (a = d.value) == null ? void 0 : a.filter((t) => {
396
- const f = !E.value || t.restaurants.some((y) => E.value.includes(y.restaurantId)), U = !k.value || t.restaurants.some((y) => y.roleId && k.value.includes(y.roleId));
397
- return f && U && L([t.code, t.name, `${t.restaurants.map((y) => T(y)).join(" ")}`]);
390
+ return (a = m.value) == null ? void 0 : a.filter((t) => {
391
+ const f = !S.value || t.restaurants.some((y) => S.value.includes(y.restaurantId)), U = !k.value || t.restaurants.some((y) => y.roleId && k.value.includes(y.roleId));
392
+ return f && U && $([t.code, t.name, `${t.restaurants.map((y) => P(y)).join(" ")}`]);
398
393
  });
399
- }), P = Ge(), T = (a) => {
400
- const t = P.value[a.restaurantId], f = t == null ? void 0 : t.profile.code;
394
+ }), D = Ge(), P = (a) => {
395
+ const t = D.value[a.restaurantId], f = t == null ? void 0 : t.profile.code;
401
396
  let y = a.restaurantName || (t == null ? void 0 : t.profile.name) || "";
402
397
  return a.roleName && (y = `${f ? f + " - " : ""}${y} (${a.roleName})`), y;
403
398
  }, X = [{
@@ -415,7 +410,7 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
415
410
  enableSorting: !1,
416
411
  cell(a) {
417
412
  return a.row.original.restaurants.map((t, f) => {
418
- const U = T(t);
413
+ const U = P(t);
419
414
  return re("div", (f ? `
420
415
  ` : "") + U);
421
416
  });
@@ -438,11 +433,11 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
438
433
  variant: De.Tertiary,
439
434
  textColor: "neutral-gray-400",
440
435
  onClick: (t) => {
441
- t.stopPropagation(), A(a.row.original);
436
+ t.stopPropagation(), z(a.row.original);
442
437
  }
443
438
  })])
444
- }], x = xe(), s = Ne(), C = _(), z = _(), Y = w(() => c.restrictEmployeeIds.value);
445
- function J(a) {
439
+ }], x = xe(), s = Ne(), R = g(), T = g(), Y = w(() => c.restrictEmployeeIds.value);
440
+ function H(a) {
446
441
  const t = Y.value.includes(a._id);
447
442
  return t && x.open({
448
443
  message: i("hr.employee.cannotUpdateMasterUser", {
@@ -451,13 +446,13 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
451
446
  type: "error"
452
447
  }), t;
453
448
  }
454
- const M = (a) => {
449
+ const C = (a) => {
455
450
  var f;
456
- a && J(a) || (f = z.value) == null || f.trigger(a);
451
+ a && H(a) || (f = T.value) == null || f.trigger(a);
457
452
  }, {
458
453
  breakpoints: Z
459
- } = Be(), A = (a) => {
460
- J(a) || s.open({
454
+ } = Be(), z = (a) => {
455
+ H(a) || s.open({
461
456
  title: i("hr.employee.remove.title"),
462
457
  message: i("hr.employee.remove.message", {
463
458
  name: a.name
@@ -483,18 +478,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
483
478
  type: "error"
484
479
  })), s.close();
485
480
  });
486
- }, W = _("");
487
- be(() => C.value && C.value.restaurants, (a) => {
488
- a && a.length > 0 && (W.value = "");
481
+ }, J = g("");
482
+ be(() => R.value && R.value.restaurants, (a) => {
483
+ a && a.length > 0 && (J.value = "");
489
484
  });
490
485
  function b() {
491
486
  var a;
492
- (a = z.value) == null || a.trigger();
487
+ (a = T.value) == null || a.trigger();
493
488
  }
494
- const N = w(() => ue().roles.value.map((a) => ({
489
+ const O = w(() => ue().roles.value.map((a) => ({
495
490
  label: a.name,
496
491
  value: a._id
497
- }))), k = _();
492
+ }))), k = g();
498
493
  async function ee() {
499
494
  try {
500
495
  await c.syncUsersMeta(), await c.readEmployees(), x.open({
@@ -508,27 +503,27 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
508
503
  });
509
504
  }
510
505
  }
511
- async function j() {
512
- q.roles.value.length === 0 && await q.readRoles(), c.employees.value.length === 0 && await c.readEmployees();
506
+ async function A() {
507
+ G.roles.value.length === 0 && await G.readRoles(), c.employees.value.length === 0 && await c.readEmployees();
513
508
  }
514
509
  return $e(() => {
515
- j();
516
- }), O({
510
+ A();
511
+ }), Q({
517
512
  create: b,
518
- filteredEmployees: R
513
+ filteredEmployees: E
519
514
  }), (a, t) => {
520
515
  var l;
521
516
  const f = p("FmButton"), U = p("FmTooltip"), y = p("FmSearch"), le = p("FmTable"), ae = p("FmListItem"), te = p("FmList");
522
- return g(), $(G, null, [u(ll, {
517
+ return _(), B(K, null, [u(Ye, {
523
518
  ref_key: "employeeFormRef",
524
- ref: z,
525
- modelValue: C.value,
526
- "onUpdate:modelValue": t[0] || (t[0] = (e) => C.value = e),
527
- "role-error-message": W.value,
519
+ ref: T,
520
+ modelValue: R.value,
521
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => R.value = e),
522
+ "role-error-message": J.value,
528
523
  class: "gap-8"
529
- }, null, 8, ["modelValue", "role-error-message"]), m("div", al, [m("div", tl, [m("div", ol, [u(o(ce), {
530
- modelValue: E.value,
531
- "onUpdate:modelValue": t[1] || (t[1] = (e) => E.value = e),
524
+ }, null, 8, ["modelValue", "role-error-message"]), d("div", Ze, [d("div", el, [d("div", ll, [u(o(ce), {
525
+ modelValue: S.value,
526
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => S.value = e),
532
527
  "managable-only": !1,
533
528
  multiple: "",
534
529
  variant: "dark",
@@ -538,10 +533,10 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
538
533
  "onUpdate:modelValue": t[2] || (t[2] = (e) => k.value = e),
539
534
  multiple: "",
540
535
  variant: "dark",
541
- items: N.value,
536
+ items: O.value,
542
537
  "selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
543
538
  placeholder: o(i)("hr.employee.filter.role_placeholder")
544
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), m("div", sl, [(l = o(H)) != null && l.role.isAdmin ? (g(), D(U, {
539
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d("div", al, [(l = o(q)) != null && l.role.isAdmin ? (_(), N(U, {
545
540
  key: 0,
546
541
  content: o(i)("hr.employee.sync.tooltip")
547
542
  }, {
@@ -552,20 +547,20 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
552
547
  onClick: ee
553
548
  }, null, 8, ["label"])]),
554
549
  _: 1
555
- }, 8, ["content"])) : Q("", !0), u(y, {
550
+ }, 8, ["content"])) : W("", !0), u(y, {
556
551
  modelValue: o(v),
557
552
  "onUpdate:modelValue": t[3] || (t[3] = (e) => ne(v) ? v.value = e : null),
558
553
  autofocus: "",
559
554
  class: "pl-4 w-[320px]",
560
555
  placeholder: o(i)("hr.employee.search.placeholder")
561
- }, null, 8, ["modelValue", "placeholder"])])]), m("div", rl, [m("div", nl, [u(y, {
556
+ }, null, 8, ["modelValue", "placeholder"])])]), d("div", tl, [d("div", ol, [u(y, {
562
557
  modelValue: o(v),
563
558
  "onUpdate:modelValue": t[4] || (t[4] = (e) => ne(v) ? v.value = e : null),
564
559
  autofocus: "",
565
560
  placeholder: o(i)("hr.employee.search.placeholder")
566
- }, null, 8, ["modelValue", "placeholder"])]), u(We), m("div", ul, [u(o(ce), {
567
- modelValue: E.value,
568
- "onUpdate:modelValue": t[5] || (t[5] = (e) => E.value = e),
561
+ }, null, 8, ["modelValue", "placeholder"])]), u(Te), d("div", sl, [u(o(ce), {
562
+ modelValue: S.value,
563
+ "onUpdate:modelValue": t[5] || (t[5] = (e) => S.value = e),
569
564
  "managable-only": !1,
570
565
  multiple: "",
571
566
  variant: "dark",
@@ -574,46 +569,46 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
574
569
  modelValue: k.value,
575
570
  "onUpdate:modelValue": t[6] || (t[6] = (e) => k.value = e),
576
571
  multiple: "",
577
- items: N.value,
572
+ items: O.value,
578
573
  variant: "dark",
579
574
  "selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
580
575
  placeholder: o(i)("hr.employee.filter.role_placeholder")
581
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(c).employees.value.length > 0 || o(c).isLoading.value ? (g(), D(Te, {
576
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(c).employees.value.length > 0 || o(c).isLoading.value ? (_(), N(Pe, {
582
577
  key: 0,
583
578
  class: "overflow-auto"
584
579
  }, {
585
580
  default: h(() => [u(le, {
586
581
  class: "xs:hidden",
587
582
  "column-defs": X,
588
- "row-data": R.value,
589
- "page-size": R.value.length,
583
+ "row-data": E.value,
584
+ "page-size": E.value.length,
590
585
  loading: o(c).isLoading.value,
591
- virtual: R.value.length > 0,
586
+ virtual: E.value.length > 0,
592
587
  "pin-header-row": "",
593
588
  "hide-footer": "",
594
- onRowClick: t[7] || (t[7] = (e) => M(e.original))
595
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), m("div", il, [u(te, {
589
+ onRowClick: t[7] || (t[7] = (e) => C(e.original))
590
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"]), d("div", rl, [u(te, {
596
591
  separator: ""
597
592
  }, {
598
- default: h(() => [(g(!0), $(G, null, Ve(R.value, (e) => (g(), D(ae, {
593
+ default: h(() => [(_(!0), B(K, null, Ve(E.value, (e) => (_(), N(ae, {
599
594
  key: e._id,
600
595
  class: "py-12 px-16 items-center justify-between",
601
- onClick: (n) => M(e)
596
+ onClick: (n) => C(e)
602
597
  }, {
603
- default: h(() => [m("div", dl, [m("p", ml, [e.code ? (g(), $("span", cl, K(e.code) + ".", 1)) : Q("", !0), Oe(K(e.name), 1)]), m("div", pl, [m("p", null, K(o(i)("hr.employee.restaurants", {
604
- restaurants: e.restaurants.map((n) => T(n)).join(", ")
605
- })), 1), m("p", null, " Since: " + K(e.since), 1)])]), u(f, {
598
+ default: h(() => [d("div", nl, [d("p", ul, [e.code ? (_(), B("span", il, j(e.code) + ".", 1)) : W("", !0), Oe(j(e.name), 1)]), d("div", ml, [d("p", null, j(o(i)("hr.employee.restaurants", {
599
+ restaurants: e.restaurants.map((n) => P(n)).join(", ")
600
+ })), 1), d("p", null, " Since: " + j(e.since), 1)])]), u(f, {
606
601
  icon: "delete",
607
602
  variant: "tertiary",
608
603
  "text-color": "neutral-gray-400",
609
- onClick: Le((n) => A(e), ["stop"])
604
+ onClick: Le((n) => z(e), ["stop"])
610
605
  }, null, 8, ["onClick"])]),
611
606
  _: 2
612
607
  }, 1032, ["onClick"]))), 128))]),
613
608
  _: 1
614
609
  })])]),
615
610
  _: 1
616
- })) : (g(), D(o(ze), {
611
+ })) : (_(), N(o(ze), {
617
612
  key: 1,
618
613
  title: o(i)("hr.employee.noData.title"),
619
614
  subtitle: o(i)("hr.employee.noData.subtitle")
@@ -622,5 +617,5 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
622
617
  }
623
618
  });
624
619
  export {
625
- kl as default
620
+ Ul as default
626
621
  };