@feedmepos/mf-hrm-portal 2.0.18-dev → 2.0.18-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 (31) hide show
  1. package/dist/AuditLogList-D4E8pss5.js +1037 -0
  2. package/dist/{EmployeeList-DcMvF9U5.js → EmployeeList-BfJO89pN.js} +302 -314
  3. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
  4. package/dist/{Main-CvW6Vu8N.js → Main-BbOMNP31.js} +9 -9
  5. package/dist/{Main-D7k57uq5.js → Main-XmxzThcC.js} +7 -8
  6. package/dist/{Main-CleutFvF.js → Main-dqgR1UXY.js} +11 -12
  7. package/dist/{PermissionSetList-CM7kbWkO.js → PermissionSetList-DO0PRS6Z.js} +6 -6
  8. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DL4_xvBZ.js} +708 -708
  9. package/dist/{RoleList-DR3eVJ9f.js → RoleList-DB3NfUYF.js} +7 -7
  10. package/dist/TeamMemberList-4hEx6L5r.js +1090 -0
  11. package/dist/{TimesheetList-WqqoKPbg.js → TimesheetList-D29EFj1Q.js} +6 -6
  12. package/dist/{app-R5EioPr4.js → app-SadE2J6-.js} +4 -4
  13. package/dist/app.js +1 -1
  14. package/dist/{dayjs.min-CN15Ft3o.js → dayjs.min-DKCxxK08.js} +1 -1
  15. package/dist/{employee-DwQlWLkL.js → employee-3KJs872J.js} +3 -3
  16. package/dist/{iteration-UBGGRoxQ.js → iteration-QZxp7XeE.js} +1 -1
  17. package/dist/{lodash-CC6qHVUo.js → lodash-DrksHyHu.js} +1 -1
  18. package/dist/{rule-B519XbW6.js → rule-CSsgDC6F.js} +2 -2
  19. package/dist/{timesheet-BylrXRfd.js → timesheet-sBe_HCZh.js} +2 -2
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/{useAppStore-Akl8AoVN.js → useAppStore-BDADkWuX.js} +1 -1
  22. package/dist/useDebounce-CWb5QR9G.js +28 -0
  23. package/dist/{useLoading-rbrVwWuj.js → useLoading-PTqnaz_W.js} +1 -1
  24. package/dist/{useReportPermissions-BOEZU86S.js → useReportPermissions-C3Uzu7vB.js} +3 -3
  25. package/package.json +1 -1
  26. package/dist/AuditLogList-CaoW9uYd.js +0 -1011
  27. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
  28. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  29. package/dist/TeamMemberList-CZZv4Pu5.js +0 -1038
  30. package/dist/team-BGLhgx5P.js +0 -33
  31. package/dist/useSearch-BAPEUu1R.js +0 -15
@@ -1,41 +1,29 @@
1
- import { watch as J, toRaw as je, defineComponent as Me, ref as v, computed as I, resolveComponent as _, createElementBlock as j, openBlock as b, Fragment as ve, renderSlot as Ge, createVNode as i, unref as s, withCtx as w, createElementVNode as c, createBlock as K, createCommentVNode as B, toDisplayString as N, renderList as Le, withKeys as Fe, withModifiers as se, normalizeClass as Ae, onUnmounted as We, isRef as Ie, createTextVNode as qe, h as pe } from "vue";
1
+ import { toRaw as je, defineComponent as Me, ref as v, computed as I, watch as ae, resolveComponent as g, createElementBlock as j, openBlock as _, Fragment as pe, renderSlot as Ge, createVNode as u, unref as s, withCtx as b, createElementVNode as c, createBlock as B, createCommentVNode as T, toDisplayString as D, renderList as Le, withKeys as Fe, withModifiers as te, normalizeClass as Ae, onUnmounted as qe, isRef as Ie, createTextVNode as We, h as ce } from "vue";
2
2
  import { useI18n as Pe, useCoreStore as He } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as De, components as Ne, useDialog as Je, useBreakpoints as Qe } from "@feedmepos/ui-library";
4
- import { S as fe, _ as Ye } from "./SelectFilter-DUj7GBtT.js";
5
- import { _ as Ze, a as Xe } from "./app-R5EioPr4.js";
6
- import { _ as ke, H as ea } from "./FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js";
7
- import { u as aa, _ as ta } from "./useDiscardConfirm-DPhEV6v0.js";
8
- import { _ as la } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
9
- import { _ as Se } from "./Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js";
10
- import { u as sa } from "./useSearch-BAPEUu1R.js";
11
- import { u as Oe, E as oa } from "./employee-DwQlWLkL.js";
12
- import { u as Te } from "./iteration-UBGGRoxQ.js";
13
- import { l as ra } from "./lodash-CC6qHVUo.js";
4
+ import { S as me, _ as Ye } from "./SelectFilter-DUj7GBtT.js";
5
+ import { _ as Ze, a as Xe } from "./app-SadE2J6-.js";
6
+ import { _ as ke, u as ea, H as aa } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
7
+ import { u as ta, _ as la } from "./useDiscardConfirm-DPhEV6v0.js";
8
+ import { _ as sa } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
9
+ import { u as oa, _ as Se } from "./useDebounce-CWb5QR9G.js";
10
+ import { u as Oe, E as ra } from "./employee-3KJs872J.js";
11
+ import { u as ze } from "./iteration-QZxp7XeE.js";
12
+ import { l as na } from "./lodash-DrksHyHu.js";
14
13
  import { _ as Re } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
15
- import { u as ze } from "./useLoading-rbrVwWuj.js";
16
- import { u as xe } from "./useAppStore-Akl8AoVN.js";
14
+ import { u as Ke } from "./useLoading-PTqnaz_W.js";
15
+ import { u as xe } from "./useAppStore-BDADkWuX.js";
17
16
  /* empty css */
18
- function na(C, Q, u = 300) {
19
- let y;
20
- const p = J(C, (Y) => {
21
- y && clearTimeout(y), y = setTimeout(() => {
22
- Q(Y);
23
- }, u);
24
- });
25
- return () => {
26
- p(), y && (clearTimeout(y), y = void 0);
27
- };
17
+ function Ue(N) {
18
+ return JSON.parse(JSON.stringify(N));
28
19
  }
29
- function Ue(C) {
30
- return JSON.parse(JSON.stringify(C));
31
- }
32
- function Ce(C) {
20
+ function Ce(N) {
33
21
  if (typeof structuredClone > "u")
34
- return Ue(C);
22
+ return Ue(N);
35
23
  try {
36
- return structuredClone(je(C));
24
+ return structuredClone(je(N));
37
25
  } catch {
38
- return Ue(C);
26
+ return Ue(N);
39
27
  }
40
28
  }
41
29
  const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, da = { class: "flex flex-row gap-16" }, ca = { class: "space-y-16" }, ma = { class: "rounded-lg border border-fm-color-neutral-gray-200 p-16 space-y-16" }, pa = { class: "fm-typo-en-title-sm-600" }, fa = { class: "space-y-16" }, va = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ya = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ha = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ga = { class: "flex justify-self-end" }, _a = ["aria-label", "onClick", "onKeydown"], ba = { class: "flex gap-8 items-center justify-start" }, $e = 4, wa = /* @__PURE__ */ Me({
@@ -47,32 +35,32 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
47
35
  }
48
36
  },
49
37
  emits: ["submitted"],
50
- setup(C, { expose: Q, emit: u }) {
51
- const y = xe(), p = Te(), k = Oe(), Y = De(), A = ze(Y), ye = u, { t: d } = Pe(), x = v(!1), P = v(!0);
38
+ setup(N, { expose: fe, emit: i }) {
39
+ const V = xe(), f = ze(), U = Oe(), ve = De(), L = Ke(ve), ye = i, { t: d } = Pe(), w = v(!1), A = v(!0);
52
40
  function G() {
53
41
  return {
54
42
  restaurantId: "",
55
43
  roleId: ""
56
44
  };
57
45
  }
58
- function oe(r) {
59
- if (!r) return Z();
46
+ function le(r) {
47
+ if (!r) return J();
60
48
  const t = Ce(r);
61
49
  return {
62
50
  code: t.code ?? "",
63
51
  isMasterUser: t.isMasterUser ?? !1,
64
52
  name: t.name ?? "",
65
53
  passcode: t.passcode ?? "",
66
- restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId: n, roleId: h }) => ({
54
+ restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId: n, roleId: y }) => ({
67
55
  restaurantId: n,
68
- roleId: h
56
+ roleId: y
69
57
  })) : [G()]
70
58
  };
71
59
  }
72
- const re = (r) => {
73
- l.value = oe(r), $.value = Ce(l.value), V.value = r == null ? void 0 : r._id, E.value = [], l.value.passcode && (E.value = l.value.passcode.split(""), O.value = !0), P.value = !r, x.value = !0;
60
+ const se = (r) => {
61
+ l.value = le(r), C.value = Ce(l.value), x.value = r == null ? void 0 : r._id, E.value = [], l.value.passcode && (E.value = l.value.passcode.split(""), O.value = !0), A.value = !r, w.value = !0;
74
62
  };
75
- function Z() {
63
+ function J() {
76
64
  return {
77
65
  code: "",
78
66
  isMasterUser: !1,
@@ -81,30 +69,30 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
81
69
  restaurants: [G()]
82
70
  };
83
71
  }
84
- const S = I(() => P.value ? d("hr.employee.form.add") : d("hr.employee.form.update")), W = I(() => P.value ? d("common.create") : d("common.update")), $ = v(Z()), l = v(Z()), V = v(void 0), ne = I(
72
+ const k = I(() => A.value ? d("hr.employee.form.add") : d("hr.employee.form.update")), q = I(() => A.value ? d("common.create") : d("common.update")), C = v(J()), l = v(J()), x = v(void 0), oe = I(
85
73
  () => l.value.restaurants.map((r) => r.restaurantId).filter(Boolean)
86
74
  );
87
- function R(r) {
75
+ function S(r) {
88
76
  var t;
89
- return r ? !((t = p.restaurants.value.find((n) => n._id === r)) != null && t.managable) : !1;
77
+ return r ? !((t = f.restaurants.value.find((n) => n._id === r)) != null && t.managable) : !1;
90
78
  }
91
- function ue(r = "") {
92
- return p.restaurants.value.filter((t) => t.managable || t._id === r).map((t) => ({
79
+ function re(r = "") {
80
+ return f.restaurants.value.filter((t) => t.managable || t._id === r).map((t) => ({
93
81
  label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
94
82
  value: t._id,
95
- disabled: ne.value.includes(t._id) && t._id !== r
83
+ disabled: oe.value.includes(t._id) && t._id !== r
96
84
  }));
97
85
  }
98
- function X(r, t = "") {
99
- return r ? y.roles.value.filter((n) => n.restaurants.some((h) => h.id == r)).map((n) => ({
86
+ function Q(r, t = "") {
87
+ return r ? V.roles.value.filter((n) => n.restaurants.some((y) => y.id == r)).map((n) => ({
100
88
  label: n.name,
101
89
  value: n._id,
102
90
  disabled: !n.isUsable && n._id !== t
103
91
  })) : [];
104
92
  }
105
93
  function he(r, t) {
106
- var g, U, z, D;
107
- const n = ((g = l.value.restaurants[r]) == null ? void 0 : g.roleId) ?? "", h = X(t, n), F = ((U = h.find((L) => L.value === n && !L.disabled)) == null ? void 0 : U.value) ?? ((z = h.find((L) => !L.disabled)) == null ? void 0 : z.value) ?? ((D = h[0]) == null ? void 0 : D.value) ?? "";
94
+ var h, R, K, P;
95
+ const n = ((h = l.value.restaurants[r]) == null ? void 0 : h.roleId) ?? "", y = Q(t, n), F = ((R = y.find((M) => M.value === n && !M.disabled)) == null ? void 0 : R.value) ?? ((K = y.find((M) => !M.disabled)) == null ? void 0 : K.value) ?? ((P = y[0]) == null ? void 0 : P.value) ?? "";
108
96
  l.value.restaurants[r] = {
109
97
  restaurantId: t,
110
98
  roleId: F
@@ -119,7 +107,7 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
119
107
  G()
120
108
  ];
121
109
  }
122
- function ee(r) {
110
+ function Y(r) {
123
111
  if (l.value.restaurants.length === 1) {
124
112
  l.value.restaurants = [G()];
125
113
  return;
@@ -128,31 +116,31 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
128
116
  (t, n) => n !== r
129
117
  );
130
118
  }
131
- const q = I(() => {
132
- const r = p.restaurants.value.some(
133
- (n) => n.managable && !ne.value.includes(n._id)
119
+ const W = I(() => {
120
+ const r = f.restaurants.value.some(
121
+ (n) => n.managable && !oe.value.includes(n._id)
134
122
  ), t = l.value.restaurants.every(
135
123
  (n) => n.restaurantId && n.roleId
136
124
  );
137
125
  return r && t;
138
126
  }), E = v([]), O = v(!1);
139
- function ae() {
127
+ function Z() {
140
128
  O.value && (O.value = !1, E.value = []);
141
129
  }
142
- const M = v(!1), T = v(!1);
143
- async function ie() {
144
- T.value = !0;
130
+ const $ = v(!1), z = v(!1);
131
+ async function ne() {
132
+ z.value = !0;
145
133
  try {
146
- const r = await oa.generateEmployeePasscode();
134
+ const r = await ra.generateEmployeePasscode();
147
135
  O.value = !1, E.value = r.split("");
148
136
  } finally {
149
- T.value = !1;
137
+ z.value = !1;
150
138
  }
151
139
  }
152
- const te = aa(
153
- () => !ra.isEqual(l.value, $.value),
140
+ const X = ta(
141
+ () => !na.isEqual(l.value, C.value),
154
142
  () => {
155
- x.value = !1;
143
+ w.value = !1;
156
144
  }
157
145
  );
158
146
  async function be() {
@@ -164,113 +152,113 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
164
152
  },
165
153
  roles: l.value.restaurants
166
154
  };
167
- l.value.isMasterUser ? await k.createMasterEmployee(r) : (delete r.user.code, await k.createEmployee(r));
155
+ l.value.isMasterUser ? await U.createMasterEmployee(r) : (delete r.user.code, await U.createEmployee(r));
168
156
  }
169
- async function de() {
170
- var h, F;
171
- const r = $.value, t = V.value, n = {
157
+ async function ue() {
158
+ var y, F;
159
+ const r = C.value, t = x.value, n = {
172
160
  user: {
173
161
  name: l.value.name,
174
162
  passcode: l.value.passcode
175
163
  },
176
164
  roles: l.value.restaurants,
177
- previousRoles: (h = r.restaurants) == null ? void 0 : h.map((g) => ({
178
- restaurantId: g.restaurantId,
179
- roleId: g.roleId
165
+ previousRoles: (y = r.restaurants) == null ? void 0 : y.map((h) => ({
166
+ restaurantId: h.restaurantId,
167
+ roleId: h.roleId
180
168
  }))
181
169
  };
182
170
  if (!l.value.isMasterUser)
183
- await k.updateEmployee(t, n);
171
+ await U.updateEmployee(t, n);
184
172
  else {
185
- const g = {
173
+ const h = {
186
174
  user: {
187
175
  name: l.value.name,
188
176
  passcode: l.value.passcode,
189
177
  code: l.value.code
190
178
  },
191
179
  roles: l.value.restaurants,
192
- previousRoles: (F = r.restaurants) == null ? void 0 : F.map((U) => ({
193
- restaurantId: U.restaurantId,
194
- roleId: U.roleId
180
+ previousRoles: (F = r.restaurants) == null ? void 0 : F.map((R) => ({
181
+ restaurantId: R.restaurantId,
182
+ roleId: R.roleId
195
183
  }))
196
184
  };
197
- $.value.isMasterUser ? await k.updateMasterEmployee(t, g) : await k.migrateToMasterUser(t, g);
185
+ C.value.isMasterUser ? await U.updateMasterEmployee(t, h) : await U.migrateToMasterUser(t, h);
198
186
  }
199
187
  }
200
- async function ce() {
201
- P.value ? await A.minor(
188
+ async function ie() {
189
+ A.value ? await L.minor(
202
190
  async () => {
203
191
  await be();
204
192
  },
205
193
  {
206
194
  successMessage: d("hr.employee.create.successMessage"),
207
- isLoading: M
195
+ isLoading: $
208
196
  }
209
- ) : await A.minor(
197
+ ) : await L.minor(
210
198
  async () => {
211
- await de();
199
+ await ue();
212
200
  },
213
201
  {
214
202
  successMessage: d("hr.employee.update.successMessage"),
215
- isLoading: M
203
+ isLoading: $
216
204
  }
217
- ), ye("submitted"), x.value = !1;
205
+ ), ye("submitted"), w.value = !1;
218
206
  }
219
- return J(
220
- () => x.value,
207
+ return ae(
208
+ () => w.value,
221
209
  (r) => {
222
210
  }
223
- ), Q({
224
- show: x,
225
- trigger: re
211
+ ), fe({
212
+ show: w,
213
+ trigger: se
226
214
  }), (r, t) => {
227
- const n = _("FmSwitch"), h = _("FmTextField"), F = _("FmPinField"), g = _("FmFormGroup"), U = _("FmButton"), z = _("FmSelect"), D = _("FmIcon"), L = _("fm-button"), a = _("fm-side-sheet");
228
- return b(), j(ve, null, [
229
- Ge(r.$slots, "default", { trigger: re }),
230
- i(a, {
215
+ const n = g("FmSwitch"), y = g("FmTextField"), F = g("FmPinField"), h = g("FmFormGroup"), R = g("FmButton"), K = g("FmSelect"), P = g("FmIcon"), M = g("fm-button"), a = g("fm-side-sheet");
216
+ return _(), j(pe, null, [
217
+ Ge(r.$slots, "default", { trigger: se }),
218
+ u(a, {
231
219
  id: "unit-form",
232
- modelValue: x.value,
233
- "onUpdate:modelValue": t[8] || (t[8] = (e) => x.value = e),
220
+ modelValue: w.value,
221
+ "onUpdate:modelValue": t[8] || (t[8] = (e) => w.value = e),
234
222
  "is-container": s(Ne).FmForm,
235
223
  "is-container-props": {
236
- onValidationSuccess: ce,
224
+ onValidationSuccess: ie,
237
225
  blameFormChildOnValidationFailed: !0
238
226
  },
239
227
  "max-width": 960,
240
- "onOn:clickedAway": s(te)
228
+ "onOn:clickedAway": s(X)
241
229
  }, {
242
- "side-sheet-header": w(() => [
243
- c("p", ua, N(S.value), 1)
230
+ "side-sheet-header": b(() => [
231
+ c("p", ua, D(k.value), 1)
244
232
  ]),
245
- "side-sheet-footer": w(() => [
233
+ "side-sheet-footer": b(() => [
246
234
  c("div", ba, [
247
- i(L, {
248
- label: W.value,
235
+ u(M, {
236
+ label: q.value,
249
237
  size: "lg",
250
238
  type: "submit",
251
239
  variant: "primary",
252
- disabled: M.value
240
+ disabled: $.value
253
241
  }, null, 8, ["label", "disabled"]),
254
- i(L, {
242
+ u(M, {
255
243
  label: s(d)("common.cancel"),
256
244
  size: "lg",
257
245
  variant: "tertiary",
258
- disabled: M.value,
259
- onClick: t[7] || (t[7] = () => x.value = !1)
246
+ disabled: $.value,
247
+ onClick: t[7] || (t[7] = () => w.value = !1)
260
248
  }, null, 8, ["label", "disabled"])
261
249
  ])
262
250
  ]),
263
- default: w(() => [
251
+ default: b(() => [
264
252
  c("div", ia, [
265
- i(Re, {
253
+ u(Re, {
266
254
  title: s(d)("hr.employee.form.employeeSetting")
267
255
  }, {
268
- default: w(() => [
269
- i(ke, {
256
+ default: b(() => [
257
+ u(ke, {
270
258
  label: s(d)("hr.employee.form.masterUserConfig")
271
259
  }, {
272
- default: w(() => [
273
- i(n, {
260
+ default: b(() => [
261
+ u(n, {
274
262
  modelValue: l.value.isMasterUser,
275
263
  "onUpdate:modelValue": t[0] || (t[0] = (e) => l.value.isMasterUser = e),
276
264
  value: "masterUser",
@@ -282,13 +270,13 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
282
270
  _: 1
283
271
  }, 8, ["label"]),
284
272
  c("div", da, [
285
- l.value.isMasterUser ? (b(), K(h, {
273
+ l.value.isMasterUser ? (_(), B(y, {
286
274
  key: 0,
287
275
  modelValue: l.value.code,
288
276
  "onUpdate:modelValue": t[1] || (t[1] = (e) => l.value.code = e),
289
277
  label: s(d)("hr.employee.form.code")
290
- }, null, 8, ["modelValue", "label"])) : B("", !0),
291
- i(h, {
278
+ }, null, 8, ["modelValue", "label"])) : T("", !0),
279
+ u(y, {
292
280
  modelValue: l.value.name,
293
281
  "onUpdate:modelValue": t[2] || (t[2] = (e) => l.value.name = e),
294
282
  class: "w-full",
@@ -296,38 +284,38 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
296
284
  rules: [(e) => !!e || s(d)("hr.employee.form.required")]
297
285
  }, null, 8, ["modelValue", "label", "rules"])
298
286
  ]),
299
- i(ke, {
287
+ u(ke, {
300
288
  label: s(d)("hr.employee.form.passcode")
301
289
  }, {
302
- default: w(() => [
290
+ default: b(() => [
303
291
  c("div", ca, [
304
- i(g, {
292
+ u(h, {
305
293
  modelValue: E.value,
306
294
  "onUpdate:modelValue": t[5] || (t[5] = (e) => E.value = e),
307
295
  rules: [
308
296
  (e) => (e == null ? void 0 : e.filter((o) => !!o).length) !== $e ? s(d)("hr.employee.form.passcodeRequired") : !0
309
297
  ]
310
298
  }, {
311
- default: w(() => [
312
- i(F, {
299
+ default: b(() => [
300
+ u(F, {
313
301
  modelValue: E.value,
314
302
  "onUpdate:modelValue": t[3] || (t[3] = (e) => E.value = e),
315
303
  length: $e,
316
304
  masked: O.value,
317
305
  onComplete: t[4] || (t[4] = (e) => l.value.passcode = e),
318
- onFocus: ae
306
+ onFocus: Z
319
307
  }, null, 8, ["modelValue", "masked"])
320
308
  ]),
321
309
  _: 1
322
310
  }, 8, ["modelValue", "rules"]),
323
- i(U, {
311
+ u(R, {
324
312
  variant: "secondary",
325
313
  "text-color": "primary",
326
314
  "border-color": "primary",
327
315
  label: s(d)("hr.employee.form.passcodeGenerate"),
328
316
  size: "md",
329
- loading: T.value,
330
- onClick: ie
317
+ loading: z.value,
318
+ onClick: ne
331
319
  }, null, 8, ["label", "loading"])
332
320
  ])
333
321
  ]),
@@ -336,9 +324,9 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
336
324
  ]),
337
325
  _: 1
338
326
  }, 8, ["title"]),
339
- i(Re, null, {
340
- default: w(() => [
341
- i(g, {
327
+ u(Re, null, {
328
+ default: b(() => [
329
+ u(h, {
342
330
  modelValue: l.value.restaurants,
343
331
  "onUpdate:modelValue": t[6] || (t[6] = (e) => l.value.restaurants = e),
344
332
  tag: "div",
@@ -347,62 +335,62 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
347
335
  (e) => e.every((o) => o.restaurantId && o.roleId) || s(d)("hr.employee.form.roleRequired")
348
336
  ]
349
337
  }, {
350
- default: w(() => [
338
+ default: b(() => [
351
339
  c("div", ma, [
352
- c("div", pa, N(s(d)("hr.employee.form.assignmentSection")), 1),
340
+ c("div", pa, D(s(d)("hr.employee.form.assignmentSection")), 1),
353
341
  c("div", fa, [
354
342
  c("div", va, [
355
- c("div", ya, N(s(d)("hr.employee.columns.restaurants")), 1),
356
- c("div", ha, N(s(d)("hr.employee.form.role")), 1),
343
+ c("div", ya, D(s(d)("hr.employee.columns.restaurants")), 1),
344
+ c("div", ha, D(s(d)("hr.employee.form.role")), 1),
357
345
  t[9] || (t[9] = c("div", null, null, -1))
358
346
  ]),
359
- (b(!0), j(ve, null, Le(l.value.restaurants, (e, o) => (b(), j("div", {
347
+ (_(!0), j(pe, null, Le(l.value.restaurants, (e, o) => (_(), j("div", {
360
348
  key: `${e.restaurantId || "new"}-${o}`,
361
349
  class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
362
350
  }, [
363
- i(z, {
351
+ u(K, {
364
352
  class: "min-w-0",
365
353
  "model-value": e.restaurantId,
366
- items: ue(e.restaurantId),
354
+ items: re(e.restaurantId),
367
355
  multiselect: !1,
368
356
  placeholder: s(d)("hr.employee.columns.restaurants"),
369
- disabled: R(e.restaurantId),
370
- "onUpdate:modelValue": (f) => he(o, f)
357
+ disabled: S(e.restaurantId),
358
+ "onUpdate:modelValue": (p) => he(o, p)
371
359
  }, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
372
- i(z, {
360
+ u(K, {
373
361
  class: "min-w-0",
374
362
  "model-value": e.roleId,
375
- items: X(e.restaurantId, e.roleId),
363
+ items: Q(e.restaurantId, e.roleId),
376
364
  multiselect: !1,
377
365
  placeholder: s(d)("hr.employee.form.role"),
378
- disabled: !e.restaurantId || R(e.restaurantId),
379
- "onUpdate:modelValue": (f) => ge(o, f)
366
+ disabled: !e.restaurantId || S(e.restaurantId),
367
+ "onUpdate:modelValue": (p) => ge(o, p)
380
368
  }, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
381
369
  c("div", ga, [
382
- l.value.restaurants.length > 1 ? (b(), j("div", {
370
+ l.value.restaurants.length > 1 ? (_(), j("div", {
383
371
  key: 0,
384
372
  role: "button",
385
373
  tabindex: "0",
386
374
  class: Ae(["inline-flex h-40 w-40 shrink-0 items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary disabled:cursor-not-allowed disabled:text-fm-color-neutral-gray-200 disabled:hover:bg-transparent", {
387
- "cursor-pointer": !R(e.restaurantId),
388
- "pointer-events-none": R(e.restaurantId)
375
+ "cursor-pointer": !S(e.restaurantId),
376
+ "pointer-events-none": S(e.restaurantId)
389
377
  }]),
390
378
  "aria-label": s(d)("common.remove"),
391
- onClick: se((f) => ee(o), ["stop"]),
379
+ onClick: te((p) => Y(o), ["stop"]),
392
380
  onKeydown: [
393
- Fe(se((f) => ee(o), ["prevent", "stop"]), ["enter"]),
394
- Fe(se((f) => ee(o), ["prevent", "stop"]), ["space"])
381
+ Fe(te((p) => Y(o), ["prevent", "stop"]), ["enter"]),
382
+ Fe(te((p) => Y(o), ["prevent", "stop"]), ["space"])
395
383
  ]
396
384
  }, [
397
- i(D, {
385
+ u(P, {
398
386
  name: "delete",
399
387
  size: "md"
400
388
  })
401
- ], 42, _a)) : B("", !0)
389
+ ], 42, _a)) : T("", !0)
402
390
  ])
403
391
  ]))), 128))
404
392
  ]),
405
- i(U, {
393
+ u(R, {
406
394
  type: "button",
407
395
  variant: "secondary",
408
396
  "text-color": "primary",
@@ -410,8 +398,8 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
410
398
  "prepend-icon": "add",
411
399
  label: s(d)("hr.employee.form.addAnother"),
412
400
  size: "md",
413
- disabled: !q.value,
414
- onClick: se(_e, ["stop"])
401
+ disabled: !W.value,
402
+ onClick: te(_e, ["stop"])
415
403
  }, null, 8, ["label", "disabled"])
416
404
  ])
417
405
  ]),
@@ -456,132 +444,132 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
456
444
  class: "text-fm-color-typo-secondary"
457
445
  }, H = 200, Aa = /* @__PURE__ */ Me({
458
446
  __name: "EmployeeList",
459
- setup(C, {
460
- expose: Q
447
+ setup(N, {
448
+ expose: fe
461
449
  }) {
462
450
  const {
463
- t: u
464
- } = Pe(), y = v(), p = Oe(), k = Te(), Y = He(), {
465
- currentBusiness: A,
451
+ t: i
452
+ } = Pe(), V = v(), f = Oe(), U = ze(), ve = He(), {
453
+ currentBusiness: L,
466
454
  sessionUser: ye
467
- } = Y, d = xe(), x = v(k.restaurants.value.length === 0), P = v(d.roles.value.length === 0), G = J(k.restaurants, (a) => {
455
+ } = ve, d = xe(), w = v(U.restaurants.value.length === 0), A = v(d.roles.value.length === 0), G = ae(U.restaurants, (a) => {
468
456
  if (a.length > 0) {
469
- if (x.value = !1, p.listEmployees.value.length > 0) {
457
+ if (w.value = !1, f.listEmployees.value.length > 0) {
470
458
  const e = new Map(a.map((o) => [o._id, o]));
471
- p.listEmployees.value = p.listEmployees.value.map((o) => ({
459
+ f.listEmployees.value = f.listEmployees.value.map((o) => ({
472
460
  ...o,
473
- restaurants: o.restaurants.map((f) => {
474
- var le, me;
461
+ restaurants: o.restaurants.map((p) => {
462
+ var ee, de;
475
463
  return {
476
- ...f,
477
- restaurantName: ((le = e.get(f.restaurantId)) == null ? void 0 : le.profile.name) || f.restaurantName,
478
- restaurantCode: ((me = e.get(f.restaurantId)) == null ? void 0 : me.profile.code) ?? void 0
464
+ ...p,
465
+ restaurantName: ((ee = e.get(p.restaurantId)) == null ? void 0 : ee.profile.name) || p.restaurantName,
466
+ restaurantCode: ((de = e.get(p.restaurantId)) == null ? void 0 : de.profile.code) ?? void 0
479
467
  };
480
468
  })
481
469
  }));
482
470
  }
483
471
  G();
484
472
  }
485
- }), oe = I(() => k.restaurants.value.map((a) => ({
473
+ }), le = I(() => U.restaurants.value.map((a) => ({
486
474
  label: `${a.profile.code ? `${a.profile.code} - ` : ""}${a.profile.name}`,
487
475
  value: a._id
488
- }))), re = J(d.roles, (a) => {
476
+ }))), se = ae(d.roles, (a) => {
489
477
  if (a.length > 0) {
490
- if (P.value = !1, p.listEmployees.value.length > 0) {
478
+ if (A.value = !1, f.listEmployees.value.length > 0) {
491
479
  const e = new Map(a.map((o) => [o._id, o.name]));
492
- p.listEmployees.value = p.listEmployees.value.map((o) => ({
480
+ f.listEmployees.value = f.listEmployees.value.map((o) => ({
493
481
  ...o,
494
- restaurants: o.restaurants.map((f) => ({
495
- ...f,
496
- roleName: e.get(f.roleId) || f.roleName
482
+ restaurants: o.restaurants.map((p) => ({
483
+ ...p,
484
+ roleName: e.get(p.roleId) || p.roleName
497
485
  }))
498
486
  }));
499
487
  }
500
- re();
488
+ se();
501
489
  }
502
- }), Z = I(() => p.listEmployees.value), {
503
- searchKey: S
504
- } = sa(), W = v(""), $ = I(() => Z.value), l = I(() => p.totalEmployees.value), V = v(1), ne = I(() => p.isLoading.value), R = v(!1), ue = I(() => {
490
+ }), J = I(() => f.listEmployees.value), {
491
+ searchKey: k
492
+ } = ea(), q = v(""), C = I(() => J.value), l = I(() => f.totalEmployees.value), x = v(1), oe = I(() => f.isLoading.value), S = v(!1), re = I(() => {
505
493
  var a;
506
494
  return JSON.stringify({
507
- businessId: ((a = A.value) == null ? void 0 : a._id) ?? "",
508
- search: W.value.trim(),
509
- restaurantIds: [...y.value ?? []].sort(),
495
+ businessId: ((a = L.value) == null ? void 0 : a._id) ?? "",
496
+ search: q.value.trim(),
497
+ restaurantIds: [...V.value ?? []].sort(),
510
498
  roleIds: [...n.value ?? []].sort()
511
499
  });
512
- }), X = (a) => {
500
+ }), Q = (a) => {
513
501
  const e = a.restaurantCode, o = a.restaurantName;
514
502
  return e ? `${e} - ${o}` : o;
515
503
  }, he = (a) => a.roleName || "-";
516
504
  function ge(a) {
517
505
  return [{
518
- label: u("hr.employee.form.update"),
519
- onClick: () => te(a)
506
+ label: i("hr.employee.form.update"),
507
+ onClick: () => X(a)
520
508
  }, {
521
- label: u("hr.employee.remove.title"),
522
- onClick: () => de(a),
509
+ label: i("hr.employee.remove.title"),
510
+ onClick: () => ue(a),
523
511
  itemClass: "text-fm-color-typo-error"
524
512
  }];
525
513
  }
526
514
  const _e = ({
527
515
  employee: a,
528
516
  className: e = ""
529
- }) => i("div", {
517
+ }) => u("div", {
530
518
  class: e,
531
519
  onClick: (o) => {
532
520
  o.stopPropagation();
533
521
  }
534
- }, [i(ta, {
522
+ }, [u(la, {
535
523
  items: ge(a)
536
- }, null)]), ee = [{
524
+ }, null)]), Y = [{
537
525
  accessorKey: "code",
538
526
  size: 100,
539
- header: () => u("hr.employee.columns.code")
527
+ header: () => i("hr.employee.columns.code")
540
528
  }, {
541
529
  accessorKey: "name",
542
- header: () => u("hr.employee.columns.name"),
530
+ header: () => i("hr.employee.columns.name"),
543
531
  enableSorting: !1,
544
532
  cell(a) {
545
533
  const e = a.row.original;
546
- return i("div", {
534
+ return u("div", {
547
535
  class: "flex items-center gap-8"
548
- }, [i(Ne.FmAvatar, {
536
+ }, [u(Ne.FmAvatar, {
549
537
  initials: e.name,
550
538
  size: "sm",
551
539
  class: "shrink-0"
552
- }, null), i("span", {
540
+ }, null), u("span", {
553
541
  class: "truncate"
554
542
  }, [e.name])]);
555
543
  }
556
544
  }, {
557
545
  accessorKey: "restaurants",
558
546
  align: "center",
559
- header: () => u("hr.employee.columns.restaurants"),
547
+ header: () => i("hr.employee.columns.restaurants"),
560
548
  enableSorting: !1,
561
549
  cell(a) {
562
- return x.value || P.value ? pe(Se) : a.row.original.restaurants.map((e, o) => {
563
- const f = X(e);
564
- return pe("div", (o ? `
565
- ` : "") + f);
550
+ return w.value || A.value ? ce(Se) : a.row.original.restaurants.map((e, o) => {
551
+ const p = Q(e);
552
+ return ce("div", (o ? `
553
+ ` : "") + p);
566
554
  });
567
555
  }
568
556
  }, {
569
557
  accessorKey: "assignedRole",
570
558
  align: "center",
571
- header: () => u("hr.employee.columns.assignedRole"),
559
+ header: () => i("hr.employee.columns.assignedRole"),
572
560
  enableSorting: !1,
573
561
  cell(a) {
574
- return x.value || P.value ? pe(Se, {
562
+ return w.value || A.value ? ce(Se, {
575
563
  width: "120px"
576
564
  }) : a.row.original.restaurants.map((e, o) => {
577
- const f = he(e);
578
- return pe("div", (o ? `
579
- ` : "") + f);
565
+ const p = he(e);
566
+ return ce("div", (o ? `
567
+ ` : "") + p);
580
568
  });
581
569
  }
582
570
  }, {
583
571
  accessorKey: "since",
584
- header: () => u("hr.employee.columns.since"),
572
+ header: () => i("hr.employee.columns.since"),
585
573
  enableSorting: !1
586
574
  }, {
587
575
  id: "action",
@@ -596,244 +584,244 @@ const ua = { class: "fm-typo-en-title-md-600" }, ia = { class: "space-y-40" }, d
596
584
  className: "flex w-full items-center justify-end"
597
585
  });
598
586
  }
599
- }], q = De(), E = Je(), O = ze(q), ae = v(!1), M = v(), T = v();
600
- function ie(a) {
587
+ }], W = De(), E = Je(), O = Ke(W), Z = v(!1), $ = v(), z = v();
588
+ function ne(a) {
601
589
  const e = a.isRestricted;
602
- return e && q.open({
603
- message: u("hr.employee.cannotUpdateMasterUser", {
590
+ return e && W.open({
591
+ message: i("hr.employee.cannotUpdateMasterUser", {
604
592
  name: a.name
605
593
  }),
606
594
  type: "error"
607
595
  }), e;
608
596
  }
609
- const te = (a) => {
597
+ const X = (a) => {
610
598
  var o;
611
- a && ie(a) || (o = T.value) == null || o.trigger(a);
599
+ a && ne(a) || (o = z.value) == null || o.trigger(a);
612
600
  }, {
613
601
  breakpoints: be
614
- } = Qe(), de = (a) => {
615
- ie(a) || E.open({
616
- title: u("hr.employee.remove.title"),
617
- message: u("hr.employee.remove.message", {
602
+ } = Qe(), ue = (a) => {
603
+ ne(a) || E.open({
604
+ title: i("hr.employee.remove.title"),
605
+ message: i("hr.employee.remove.message", {
618
606
  name: a.name
619
607
  }),
620
608
  minWidth: be.value.lg ? 588 : 0,
621
609
  primaryActions: {
622
- text: u("common.remove"),
610
+ text: i("common.remove"),
623
611
  close: !1,
624
612
  variant: "destructive",
625
- isLoading: ae
613
+ isLoading: Z
626
614
  },
627
615
  secondaryActions: {
628
- text: u("common.cancel"),
616
+ text: i("common.cancel"),
629
617
  close: !0
630
618
  }
631
619
  }).onPrimary(async () => {
632
- if (ae.value) return;
633
- const o = a.isMasterUser ? p.deleteMasterEmployee : p.deleteEmployee;
620
+ if (Z.value) return;
621
+ const o = a.isMasterUser ? f.deleteMasterEmployee : f.deleteEmployee;
634
622
  await O.minor(async () => {
635
- await o(a), await g();
623
+ await o(a), await h();
636
624
  }, {
637
- isLoading: ae,
638
- successMessage: u("hr.employee.remove.successMessage", {
625
+ isLoading: Z,
626
+ successMessage: i("hr.employee.remove.successMessage", {
639
627
  name: a.name
640
628
  })
641
629
  }).catch(() => {
642
630
  }), E.close();
643
631
  });
644
- }, ce = v("");
632
+ }, ie = v("");
645
633
  function r() {
646
634
  var a;
647
- (a = T.value) == null || a.trigger();
635
+ (a = z.value) == null || a.trigger();
648
636
  }
649
637
  const t = I(() => xe().roles.value.map((a) => ({
650
638
  label: a.name,
651
639
  value: a._id
652
640
  }))), n = v();
653
- async function h() {
641
+ async function y() {
654
642
  try {
655
- await p.syncUsersMeta(), await g(), q.open({
656
- message: u("hr.employee.sync.successMessage"),
643
+ await f.syncUsersMeta(), await h(), W.open({
644
+ message: i("hr.employee.sync.successMessage"),
657
645
  type: "success"
658
646
  });
659
647
  } catch (a) {
660
- console.error("Error syncing users:", a), q.open({
661
- message: u("hr.employee.sync.errorMessage"),
648
+ console.error("Error syncing users:", a), W.open({
649
+ message: i("hr.employee.sync.errorMessage"),
662
650
  type: "error"
663
651
  });
664
652
  }
665
653
  }
666
- async function F(a = V.value) {
654
+ async function F(a = x.value) {
667
655
  var e, o;
668
- await p.readEmployeesPage({
656
+ await f.readEmployeesPage({
669
657
  limit: H,
670
658
  offset: (a - 1) * H,
671
- search: W.value.trim() || void 0,
672
- restaurantIds: (e = y.value) != null && e.length ? y.value : void 0,
659
+ search: q.value.trim() || void 0,
660
+ restaurantIds: (e = V.value) != null && e.length ? V.value : void 0,
673
661
  roleIds: (o = n.value) != null && o.length ? n.value : void 0
674
662
  });
675
663
  }
676
- async function g() {
664
+ async function h() {
677
665
  var e;
678
- if (!((e = A.value) != null && e._id)) return;
679
- await F(V.value);
666
+ if (!((e = L.value) != null && e._id)) return;
667
+ await F(x.value);
680
668
  const a = Math.max(1, Math.ceil(l.value / H));
681
- V.value > a && (V.value = a, await F(V.value));
669
+ x.value > a && (x.value = a, await F(x.value));
682
670
  }
683
- async function U() {
671
+ async function R() {
684
672
  var a, e;
685
- return await p.readAllEmployeesPage({
686
- search: W.value.trim() || void 0,
687
- restaurantIds: (a = y.value) != null && a.length ? y.value : void 0,
673
+ return await f.readAllEmployeesPage({
674
+ search: q.value.trim() || void 0,
675
+ restaurantIds: (a = V.value) != null && a.length ? V.value : void 0,
688
676
  roleIds: (e = n.value) != null && e.length ? n.value : void 0
689
677
  }, l.value);
690
678
  }
691
- const z = na(S, () => {
692
- W.value = S.value;
679
+ const K = oa(k, () => {
680
+ q.value = k.value;
693
681
  }, 300);
694
- We(z);
695
- let D = !1;
696
- async function L({
682
+ qe(K);
683
+ let P = !1;
684
+ async function M({
697
685
  pageIndex: a
698
686
  }) {
699
687
  var e;
700
- if ((e = A.value) != null && e._id && !D && !(a === 0 && V.value === 1 && $.value.length > 0)) {
701
- D = !0, V.value = a + 1;
688
+ if ((e = L.value) != null && e._id && !P && !(a === 0 && x.value === 1 && C.value.length > 0)) {
689
+ P = !0, x.value = a + 1;
702
690
  try {
703
- await F(V.value);
691
+ await F(x.value);
704
692
  } finally {
705
- D = !1;
693
+ P = !1;
706
694
  }
707
695
  }
708
696
  }
709
- return J(ue, async () => {
697
+ return ae(re, async () => {
710
698
  var a;
711
- V.value = 1, R.value = !1, (a = A.value) != null && a._id && (await F(1), R.value = !0);
699
+ x.value = 1, S.value = !1, (a = L.value) != null && a._id && (await F(1), S.value = !0);
712
700
  }, {
713
701
  immediate: !0
714
- }), J(() => M.value && M.value.restaurants, (a) => {
715
- a && a.length > 0 && (ce.value = "");
716
- }), Q({
702
+ }), ae(() => $.value && $.value.restaurants, (a) => {
703
+ a && a.length > 0 && (ie.value = "");
704
+ }), fe({
717
705
  create: r,
718
- filteredEmployees: $,
719
- exportEmployees: U
706
+ filteredEmployees: C,
707
+ exportEmployees: R
720
708
  }), (a, e) => {
721
709
  var Ve, Ee;
722
- const o = _("FmButton"), f = _("FmTooltip"), le = _("FmSearch"), me = _("FmTable"), Ke = _("FmListItem"), Be = _("FmList");
723
- return b(), j(ve, null, [i(wa, {
710
+ const o = g("FmButton"), p = g("FmTooltip"), ee = g("FmSearch"), de = g("FmTable"), Be = g("FmListItem"), Te = g("FmList");
711
+ return _(), j(pe, null, [u(wa, {
724
712
  ref_key: "employeeFormRef",
725
- ref: T,
726
- modelValue: M.value,
727
- "onUpdate:modelValue": e[0] || (e[0] = (m) => M.value = m),
728
- "role-error-message": ce.value,
713
+ ref: z,
714
+ modelValue: $.value,
715
+ "onUpdate:modelValue": e[0] || (e[0] = (m) => $.value = m),
716
+ "role-error-message": ie.value,
729
717
  class: "gap-8",
730
- onSubmitted: g
731
- }, null, 8, ["modelValue", "role-error-message"]), c("div", xa, [c("div", Va, [c("div", Ea, [i(fe, {
732
- modelValue: y.value,
733
- "onUpdate:modelValue": e[1] || (e[1] = (m) => y.value = m),
718
+ onSubmitted: h
719
+ }, null, 8, ["modelValue", "role-error-message"]), c("div", xa, [c("div", Va, [c("div", Ea, [u(me, {
720
+ modelValue: V.value,
721
+ "onUpdate:modelValue": e[1] || (e[1] = (m) => V.value = m),
734
722
  multiple: "",
735
- items: oe.value,
723
+ items: le.value,
736
724
  variant: "dark",
737
- "selected-prefix": s(u)("hr.role.columns.restaurants"),
738
- placeholder: s(u)("hr.role.columns.restaurants"),
725
+ "selected-prefix": s(i)("hr.role.columns.restaurants"),
726
+ placeholder: s(i)("hr.role.columns.restaurants"),
739
727
  class: "!w-auto"
740
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(fe, {
728
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(me, {
741
729
  modelValue: n.value,
742
730
  "onUpdate:modelValue": e[2] || (e[2] = (m) => n.value = m),
743
731
  multiple: "",
744
732
  variant: "dark",
745
733
  items: t.value,
746
- "selected-prefix": s(u)("hr.employee.filter.selected_role_prefix"),
747
- placeholder: s(u)("hr.employee.filter.role_placeholder")
748
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", Fa, [(Ve = s(ye)) != null && Ve.role.isAdmin ? (b(), K(f, {
734
+ "selected-prefix": s(i)("hr.employee.filter.selected_role_prefix"),
735
+ placeholder: s(i)("hr.employee.filter.role_placeholder")
736
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", Fa, [(Ve = s(ye)) != null && Ve.role.isAdmin ? (_(), B(p, {
749
737
  key: 0,
750
- content: s(u)("hr.employee.sync.tooltip")
738
+ content: s(i)("hr.employee.sync.tooltip")
751
739
  }, {
752
- default: w(() => [i(o, {
740
+ default: b(() => [u(o, {
753
741
  icon: "refresh",
754
- label: s(u)("hr.employee.sync.tooltip"),
742
+ label: s(i)("hr.employee.sync.tooltip"),
755
743
  variant: "tertiary",
756
- onClick: h
744
+ onClick: y
757
745
  }, null, 8, ["label"])]),
758
746
  _: 1
759
- }, 8, ["content"])) : B("", !0), i(le, {
760
- modelValue: s(S),
761
- "onUpdate:modelValue": e[3] || (e[3] = (m) => Ie(S) ? S.value = m : null),
747
+ }, 8, ["content"])) : T("", !0), u(ee, {
748
+ modelValue: s(k),
749
+ "onUpdate:modelValue": e[3] || (e[3] = (m) => Ie(k) ? k.value = m : null),
762
750
  autofocus: "",
763
751
  class: "pl-4 w-[320px]",
764
- placeholder: s(u)("hr.employee.search.placeholder")
765
- }, null, 8, ["modelValue", "placeholder"])])]), c("div", Ia, [c("div", ka, [i(le, {
766
- modelValue: s(S),
767
- "onUpdate:modelValue": e[4] || (e[4] = (m) => Ie(S) ? S.value = m : null),
752
+ placeholder: s(i)("hr.employee.search.placeholder")
753
+ }, null, 8, ["modelValue", "placeholder"])])]), c("div", Ia, [c("div", ka, [u(ee, {
754
+ modelValue: s(k),
755
+ "onUpdate:modelValue": e[4] || (e[4] = (m) => Ie(k) ? k.value = m : null),
768
756
  autofocus: "",
769
- placeholder: s(u)("hr.employee.search.placeholder")
770
- }, null, 8, ["modelValue", "placeholder"])]), i(ea), c("div", Sa, [i(fe, {
771
- modelValue: y.value,
772
- "onUpdate:modelValue": e[5] || (e[5] = (m) => y.value = m),
757
+ placeholder: s(i)("hr.employee.search.placeholder")
758
+ }, null, 8, ["modelValue", "placeholder"])]), u(aa), c("div", Sa, [u(me, {
759
+ modelValue: V.value,
760
+ "onUpdate:modelValue": e[5] || (e[5] = (m) => V.value = m),
773
761
  multiple: "",
774
- items: oe.value,
762
+ items: le.value,
775
763
  variant: "dark",
776
- "selected-prefix": s(u)("hr.role.columns.restaurants"),
777
- placeholder: s(u)("hr.role.columns.restaurants"),
764
+ "selected-prefix": s(i)("hr.role.columns.restaurants"),
765
+ placeholder: s(i)("hr.role.columns.restaurants"),
778
766
  class: "!w-auto"
779
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(fe, {
767
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(me, {
780
768
  modelValue: n.value,
781
769
  "onUpdate:modelValue": e[6] || (e[6] = (m) => n.value = m),
782
770
  multiple: "",
783
771
  items: t.value,
784
772
  variant: "dark",
785
- "selected-prefix": s(u)("hr.employee.filter.selected_role_prefix"),
786
- placeholder: s(u)("hr.employee.filter.role_placeholder")
787
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (Ee = s(A)) != null && Ee._id ? (b(), K(Ze, {
773
+ "selected-prefix": s(i)("hr.employee.filter.selected_role_prefix"),
774
+ placeholder: s(i)("hr.employee.filter.role_placeholder")
775
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (Ee = s(L)) != null && Ee._id ? (_(), B(Ze, {
788
776
  key: 0
789
777
  }, {
790
- default: w(() => [c("div", Ra, [!R.value && s(p).isLoading.value ? (b(), K(Xe, {
778
+ default: b(() => [c("div", Ra, [!S.value && s(f).isLoading.value ? (_(), B(Xe, {
791
779
  key: 0
792
- })) : !R.value || l.value === 0 ? (b(), K(s(la), {
780
+ })) : !S.value || l.value === 0 ? (_(), B(s(sa), {
793
781
  key: 1,
794
- title: s(u)("hr.employee.noData.title"),
795
- subtitle: s(u)("hr.employee.noData.subtitle")
796
- }, null, 8, ["title", "subtitle"])) : B("", !0), R.value ? (b(), K(me, {
797
- key: ue.value,
782
+ title: s(i)("hr.employee.noData.title"),
783
+ subtitle: s(i)("hr.employee.noData.subtitle")
784
+ }, null, 8, ["title", "subtitle"])) : T("", !0), S.value ? (_(), B(de, {
785
+ key: re.value,
798
786
  class: Ae(["xs:hidden employee-list-table min-h-0 flex-1", {
799
- "employee-list-table--pagination-loading": ne.value
787
+ "employee-list-table--pagination-loading": oe.value
800
788
  }]),
801
- "column-defs": ee,
802
- "row-data": $.value,
789
+ "column-defs": Y,
790
+ "row-data": C.value,
803
791
  "page-size": H,
804
792
  "page-count": Math.ceil(l.value / H),
805
793
  "row-count": l.value,
806
- "fetch-fn": L,
794
+ "fetch-fn": M,
807
795
  "hide-footer": l.value <= H,
808
- loading: s(p).isLoading.value,
796
+ loading: s(f).isLoading.value,
809
797
  virtual: !1,
810
798
  "pin-header-row": "",
811
- onRowClick: e[7] || (e[7] = (m) => te(m.original))
812
- }, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : B("", !0), c("div", Ua, [i(Be, {
799
+ onRowClick: e[7] || (e[7] = (m) => X(m.original))
800
+ }, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : T("", !0), c("div", Ua, [u(Te, {
813
801
  separator: ""
814
802
  }, {
815
- default: w(() => [(b(!0), j(ve, null, Le($.value, (m) => (b(), K(Ke, {
803
+ default: b(() => [(_(!0), j(pe, null, Le(C.value, (m) => (_(), B(Be, {
816
804
  key: m._id,
817
805
  class: "py-12 px-16 items-center justify-between",
818
- onClick: (we) => te(m)
806
+ onClick: (we) => X(m)
819
807
  }, {
820
- default: w(() => [c("div", Ca, [c("p", $a, [m.code ? (b(), j("span", Ma, N(m.code) + ".", 1)) : B("", !0), qe(N(m.name), 1)]), c("div", La, [c("p", null, N(s(u)("hr.employee.restaurants", {
821
- restaurants: m.restaurants.map((we) => X(we)).join(", ")
822
- })), 1), c("p", null, " Since: " + N(m.since), 1)])]), i(o, {
808
+ default: b(() => [c("div", Ca, [c("p", $a, [m.code ? (_(), j("span", Ma, D(m.code) + ".", 1)) : T("", !0), We(D(m.name), 1)]), c("div", La, [c("p", null, D(s(i)("hr.employee.restaurants", {
809
+ restaurants: m.restaurants.map((we) => Q(we)).join(", ")
810
+ })), 1), c("p", null, " Since: " + D(m.since), 1)])]), u(o, {
823
811
  icon: "delete",
824
812
  variant: "tertiary",
825
813
  "text-color": "neutral-gray-400",
826
- onClick: se((we) => de(m), ["stop"])
814
+ onClick: te((we) => ue(m), ["stop"])
827
815
  }, null, 8, ["onClick"])]),
828
816
  _: 2
829
817
  }, 1032, ["onClick"]))), 128))]),
830
818
  _: 1
831
819
  })])])]),
832
820
  _: 1
833
- })) : B("", !0)])], 64);
821
+ })) : T("", !0)])], 64);
834
822
  };
835
823
  }
836
- }), Xa = /* @__PURE__ */ Ye(Aa, [["__scopeId", "data-v-e931839a"]]);
824
+ }), Za = /* @__PURE__ */ Ye(Aa, [["__scopeId", "data-v-e931839a"]]);
837
825
  export {
838
- Xa as default
826
+ Za as default
839
827
  };