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