@feedmepos/mf-hrm-portal 1.1.3-dev → 1.1.3-dev.10

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 (49) hide show
  1. package/dist/AuditLogList-BghaBoJj.js +436 -0
  2. package/dist/EmployeeList-C4knb1ZM.js +626 -0
  3. package/dist/{Main-DGymQNz9.js → Main-BGcdVWrj.js} +10 -9
  4. package/dist/{Main-BqhrqOzx.js → Main-DYuuBLTj.js} +28 -27
  5. package/dist/PermissionSetList-DPKmbnO4.js +323 -0
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-nbk54pp5.js +3092 -0
  7. package/dist/RoleList-CWUkSfcS.js +494 -0
  8. package/dist/TeamMemberList-BDB9zWwa.js +965 -0
  9. package/dist/{TimesheetList-hgT9DrHd.js → TimesheetList-CqVVoydR.js} +25 -24
  10. package/dist/api/index.d.ts +5 -0
  11. package/dist/api/report-query/index.d.ts +5 -0
  12. package/dist/api/team/index.d.ts +2 -5
  13. package/dist/{app-CcbYGJ22.js → app-C04LPGZa.js} +1606 -918
  14. package/dist/app.js +4 -4
  15. package/dist/composables/useReportPermissions.d.ts +14 -0
  16. package/dist/{dayjs.min-CgN1oBQf.js → dayjs.min-CKv07Hiu.js} +1 -1
  17. package/dist/employee-DyW4lRCb.js +144 -0
  18. package/dist/helpers/permission-set.d.ts +37 -0
  19. package/dist/helpers/rule.d.ts +1 -1
  20. package/dist/index-CIz_Nsy5.js +10340 -0
  21. package/dist/index-DGq_eY85.js +827 -0
  22. package/dist/{lodash-7Am6_Zd3.js → lodash-r0Tf8VGX.js} +1 -1
  23. package/dist/stores/permission-set.d.ts +15 -0
  24. package/dist/stores/team.d.ts +4 -1
  25. package/dist/style.css +1 -1
  26. package/dist/team-CSB4_BXX.js +29 -0
  27. package/dist/{timesheet-DKhEeLe7.js → timesheet-CTS0MzUs.js} +2 -2
  28. package/dist/tsconfig.app.tsbuildinfo +1 -1
  29. package/dist/types/audit-log.d.ts +1 -19
  30. package/dist/types/permission-set.d.ts +4 -0
  31. package/dist/types/report-query.d.ts +6 -0
  32. package/dist/{useAppStore-DOSLuH24.js → useAppStore-CWtHdJdl.js} +34 -46
  33. package/dist/{useLoading-BA-GSZ3R.js → useLoading-gYEFsA3E.js} +1 -1
  34. package/dist/useReportPermissions--n283f22.js +65 -0
  35. package/dist/views/audit-log/locales/index.d.ts +84 -0
  36. package/dist/views/team/locales/index.d.ts +32 -8
  37. package/package.json +4 -2
  38. package/dist/AuditLogList-DNQh1rE9.js +0 -316
  39. package/dist/EmployeeList-zU7fmC4c.js +0 -607
  40. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BvjXcknf.js +0 -3050
  41. package/dist/RoleList-jbZqer7A.js +0 -496
  42. package/dist/RolePermissionList-Dd8ks5i7.js +0 -285
  43. package/dist/TeamMemberList-uamoOFIV.js +0 -949
  44. package/dist/employee-khk560IC.js +0 -172
  45. package/dist/index-D5sdamN5.js +0 -8411
  46. package/dist/team-CFyc6tnm.js +0 -26
  47. package/dist/types/permission.d.ts +0 -1
  48. /package/dist/views/team/{role/RolePermissionForm.vue.d.ts → permission-set/PermissionSetForm.vue.d.ts} +0 -0
  49. /package/dist/views/team/{role/RolePermissionList.vue.d.ts → permission-set/PermissionSetList.vue.d.ts} +0 -0
@@ -1,607 +0,0 @@
1
- import { createElementBlock as $, openBlock as h, createElementVNode as c, toRaw as Ce, defineComponent as he, ref as g, computed as F, watch as _e, resolveComponent as v, Fragment as G, renderSlot as Me, createVNode as n, unref as o, withCtx as y, createBlock as B, createCommentVNode as Q, isRef as re, renderList as ge, toDisplayString as K, onMounted as Ie, h as se, createTextVNode as $e, withModifiers as Oe } from "vue";
2
- import { useCoreStore as be, useI18n as Ve, RestaurantSelector as me } from "@feedmepos/mf-common";
3
- import { useSnackbar as Fe, components as xe, useDialog as Le, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
4
- import { _ as Ne, S as ce } from "./SelectFilter-NbXrJ4iH.js";
5
- import { _ as Pe } from "./app-CcbYGJ22.js";
6
- import { _ as Te } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
7
- import { u as we } from "./useSearch-B6WK1LBB.js";
8
- import { u as ke, E as ze } from "./employee-khk560IC.js";
9
- import { l as Ae } from "./lodash-7Am6_Zd3.js";
10
- import { u as je, _ as de, a as pe, b as Ke } from "./useRestaurantMap-D5BNPLKh.js";
11
- import { u as Ge } from "./useLoading-BA-GSZ3R.js";
12
- import { u as ne } from "./useAppStore-DOSLuH24.js";
13
- const qe = {};
14
- function He(S, O) {
15
- return h(), $("div", null, [...O[0] || (O[0] = [
16
- c("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
17
- ])]);
18
- }
19
- const Je = /* @__PURE__ */ Ne(qe, [["render", He]]);
20
- function ve(S) {
21
- return JSON.parse(JSON.stringify(S));
22
- }
23
- function fe(S) {
24
- if (typeof structuredClone > "u")
25
- return ve(S);
26
- try {
27
- return structuredClone(Ce(S));
28
- } catch {
29
- return ve(S);
30
- }
31
- }
32
- const We = { class: "fm-typo-en-title-md-600" }, Qe = { class: "space-y-40" }, Xe = { class: "flex flex-row gap-16" }, Ye = { class: "space-y-16" }, Ze = { class: "flex gap-8 items-center justify-start" }, ye = 4, el = /* @__PURE__ */ he({
33
- __name: "EmployeeForm",
34
- props: {
35
- roleErrorMessage: {
36
- type: String,
37
- default: ""
38
- }
39
- },
40
- setup(S, { expose: O }) {
41
- const u = ne(), E = be(), d = ke(), q = Fe(), H = Ge(q), { t: i } = Ve(), f = g(!1), L = g(!0), R = (a) => {
42
- s.value = a ? fe(a) : D(), x.value = fe(s.value), l.value = [], b.value = s.value.restaurants.map((e) => e.restaurantId), s.value.passcode && (l.value = s.value.passcode.split(""), t.value = !0), L.value = !a, f.value = !0;
43
- };
44
- function D() {
45
- return {
46
- code: "",
47
- isMasterUser: !1,
48
- name: "",
49
- passcode: "",
50
- restaurants: []
51
- };
52
- }
53
- const N = F(() => L.value ? i("hr.employee.form.add") : i("hr.employee.form.update")), X = F(() => L.value ? i("common.create") : i("common.update")), x = g(D()), s = g(D()), { searchKey: C, filter: P } = we(), Y = F(() => {
54
- const a = {};
55
- return u.roles.value.forEach((e) => {
56
- a[e._id] = e.name;
57
- }), a;
58
- });
59
- function J(a) {
60
- const e = T(a) ?? "";
61
- return Y.value[e] || "";
62
- }
63
- const k = F(() => E.restaurants.value.filter(({ _id: e, profile: m }) => P([m.code, m.name, J(e)])).map(({ _id: e, profile: m }) => {
64
- const M = u.roles.value.filter((w) => w.restaurants.some((I) => I.id == e)).map((w) => ({
65
- label: w.name,
66
- value: w._id,
67
- disabled: !w.isUsable
68
- }));
69
- return {
70
- value: e,
71
- label: `${m.code ? m.code + "-" : ""}${m.name}`,
72
- roleOptions: M
73
- };
74
- })), Z = F(() => {
75
- const a = {};
76
- return s.value.restaurants.forEach((e) => {
77
- a[e.restaurantId] = e.roleId;
78
- }), a;
79
- }), T = (a) => Z.value[a] ?? null, W = (a, e) => {
80
- s.value.restaurants = [
81
- ...s.value.restaurants.filter((m) => m.restaurantId !== a),
82
- {
83
- restaurantId: a,
84
- roleId: e
85
- }
86
- ];
87
- }, b = g(s.value.restaurants.map((a) => a.restaurantId)), z = F(
88
- () => b.value.filter(
89
- (a) => k.value.some((e) => e.value === a)
90
- )
91
- ), U = F(() => k.value.length > 0 && k.value.length === z.value.length), ee = () => {
92
- const a = b.value.filter((e) => !z.value.includes(e));
93
- U.value === !0 ? A(a) : A(k.value.map((e) => e.value));
94
- }, A = (a) => {
95
- b.value = a, s.value.restaurants = a.map((e) => {
96
- var M, w, I;
97
- const m = ((w = (M = k.value.find((j) => j.value === e)) == null ? void 0 : M.roleOptions[0]) == null ? void 0 : w.value) || "";
98
- return {
99
- restaurantId: e,
100
- roleId: ((I = s.value.restaurants.find((j) => j.restaurantId === e)) == null ? void 0 : I.roleId) || m
101
- };
102
- });
103
- }, l = g([]), t = g(!1);
104
- function p() {
105
- t.value && (t.value = !1, l.value = []);
106
- }
107
- async function _() {
108
- const a = await ze.generateEmployeePasscode();
109
- t.value = !1, l.value = a.split("");
110
- }
111
- const V = je(
112
- () => !Ae.isEqual(s.value, x.value),
113
- () => {
114
- f.value = !1;
115
- }
116
- );
117
- async function le() {
118
- const a = {
119
- user: {
120
- name: s.value.name,
121
- passcode: s.value.passcode,
122
- code: s.value.code
123
- },
124
- roles: s.value.restaurants
125
- };
126
- s.value.isMasterUser ? await d.createMasterEmployee(a) : (delete a.user.code, await d.createEmployee(a));
127
- }
128
- async function ae() {
129
- const a = x.value, e = {
130
- user: {
131
- name: s.value.name,
132
- passcode: s.value.passcode
133
- },
134
- roles: s.value.restaurants
135
- };
136
- if (!s.value.isMasterUser)
137
- await d.updateEmployee(a._id, e);
138
- else {
139
- const m = {
140
- user: {
141
- name: s.value.name,
142
- passcode: s.value.passcode,
143
- code: s.value.code
144
- },
145
- roles: s.value.restaurants
146
- };
147
- x.value.isMasterUser ? await d.updateMasterEmployee(a._id, m) : await d.migrateToMasterUser(a._id, m);
148
- }
149
- }
150
- async function te() {
151
- L.value ? await H.minor(
152
- async () => {
153
- await le();
154
- },
155
- {
156
- successMessage: i("hr.employee.create.successMessage")
157
- }
158
- ) : await H.minor(
159
- async () => {
160
- await ae();
161
- },
162
- {
163
- successMessage: i("hr.employee.update.successMessage")
164
- }
165
- ), f.value = !1;
166
- }
167
- return _e(
168
- () => f.value,
169
- (a) => {
170
- }
171
- ), O({
172
- show: f,
173
- trigger: R
174
- }), (a, e) => {
175
- const m = v("FmSwitch"), M = v("FmTextField"), w = v("FmPinField"), I = v("FmFormGroup"), j = v("FmButton"), Ue = v("FmSearch"), ue = v("FmCheckbox"), Se = v("FmSelect"), ie = v("fm-button"), Ee = v("fm-side-sheet");
176
- return h(), $(G, null, [
177
- Me(a.$slots, "default", { trigger: R }),
178
- n(Ee, {
179
- id: "unit-form",
180
- modelValue: f.value,
181
- "onUpdate:modelValue": e[9] || (e[9] = (r) => f.value = r),
182
- "is-container": o(xe).FmForm,
183
- "is-container-props": {
184
- onValidationSuccess: te,
185
- blameFormChildOnValidationFailed: !0
186
- },
187
- "max-width": 560,
188
- "onOn:clickedAway": o(V)
189
- }, {
190
- "side-sheet-header": y(() => [
191
- c("p", We, K(N.value), 1)
192
- ]),
193
- "side-sheet-footer": y(() => [
194
- c("div", Ze, [
195
- n(ie, {
196
- label: X.value,
197
- size: "lg",
198
- type: "submit",
199
- variant: "primary"
200
- }, null, 8, ["label"]),
201
- n(ie, {
202
- label: o(i)("common.cancel"),
203
- size: "lg",
204
- variant: "tertiary",
205
- onClick: e[8] || (e[8] = () => f.value = !1)
206
- }, null, 8, ["label"])
207
- ])
208
- ]),
209
- default: y(() => [
210
- c("div", Qe, [
211
- n(de, {
212
- title: o(i)("hr.employee.form.employeeSetting")
213
- }, {
214
- default: y(() => [
215
- n(pe, {
216
- label: o(i)("hr.employee.form.masterUserConfig")
217
- }, {
218
- default: y(() => [
219
- n(m, {
220
- modelValue: s.value.isMasterUser,
221
- "onUpdate:modelValue": e[0] || (e[0] = (r) => s.value.isMasterUser = r),
222
- value: "masterUser",
223
- label: o(i)("hr.employee.form.masterUser"),
224
- sublabel: o(i)("hr.employee.form.masterUserSublabel"),
225
- "label-placement": "right"
226
- }, null, 8, ["modelValue", "label", "sublabel"])
227
- ]),
228
- _: 1
229
- }, 8, ["label"]),
230
- c("div", Xe, [
231
- s.value.isMasterUser ? (h(), B(M, {
232
- key: 0,
233
- modelValue: s.value.code,
234
- "onUpdate:modelValue": e[1] || (e[1] = (r) => s.value.code = r),
235
- label: o(i)("hr.employee.form.code")
236
- }, null, 8, ["modelValue", "label"])) : Q("", !0),
237
- n(M, {
238
- modelValue: s.value.name,
239
- "onUpdate:modelValue": e[2] || (e[2] = (r) => s.value.name = r),
240
- class: "w-full",
241
- label: o(i)("hr.employee.form.name"),
242
- rules: [(r) => !!r || o(i)("hr.employee.form.required")]
243
- }, null, 8, ["modelValue", "label", "rules"])
244
- ]),
245
- n(pe, {
246
- label: o(i)("hr.employee.form.passcode")
247
- }, {
248
- default: y(() => [
249
- c("div", Ye, [
250
- n(I, {
251
- modelValue: l.value,
252
- "onUpdate:modelValue": e[5] || (e[5] = (r) => l.value = r),
253
- rules: [
254
- (r) => (r == null ? void 0 : r.filter((oe) => !!oe).length) !== ye ? o(i)("hr.employee.form.passcodeRequired") : !0
255
- ]
256
- }, {
257
- default: y(() => [
258
- n(w, {
259
- modelValue: l.value,
260
- "onUpdate:modelValue": e[3] || (e[3] = (r) => l.value = r),
261
- length: ye,
262
- masked: t.value,
263
- onComplete: e[4] || (e[4] = (r) => s.value.passcode = r),
264
- onFocus: p
265
- }, null, 8, ["modelValue", "masked"])
266
- ]),
267
- _: 1
268
- }, 8, ["modelValue", "rules"]),
269
- n(j, {
270
- variant: "secondary",
271
- "text-color": "primary",
272
- "border-color": "primary",
273
- label: o(i)("hr.employee.form.passcodeGenerate"),
274
- size: "md",
275
- onClick: _
276
- }, null, 8, ["label"])
277
- ])
278
- ]),
279
- _: 1
280
- }, 8, ["label"])
281
- ]),
282
- _: 1
283
- }, 8, ["title"]),
284
- n(de, {
285
- title: o(i)("hr.employee.form.role")
286
- }, {
287
- default: y(() => [
288
- n(Ue, {
289
- modelValue: o(C),
290
- "onUpdate:modelValue": e[6] || (e[6] = (r) => re(C) ? C.value = r : null),
291
- placeholder: o(i)("hr.restaurant.search.placeholder")
292
- }, null, 8, ["modelValue", "placeholder"]),
293
- n(I, {
294
- modelValue: b.value,
295
- "onUpdate:modelValue": e[7] || (e[7] = (r) => b.value = r),
296
- rules: [(r) => r.length > 0 || o(i)("hr.employee.form.atLeastOneRestaurant")]
297
- }, {
298
- default: y(() => [
299
- n(ue, {
300
- "model-value": U.value,
301
- label: o(i)("hr.employee.form.all"),
302
- value: "1",
303
- indeterminate: b.value.length > 0,
304
- "onUpdate:modelValue": ee
305
- }, null, 8, ["model-value", "label", "indeterminate"]),
306
- (h(!0), $(G, null, ge(k.value, (r, oe) => (h(), $(G, { key: oe }, [
307
- n(ue, {
308
- "model-value": b.value,
309
- label: r.label,
310
- value: r.value,
311
- "onUpdate:modelValue": A
312
- }, null, 8, ["model-value", "label", "value"]),
313
- b.value.includes(r.value) ? (h(), B(Se, {
314
- key: 0,
315
- class: "ml-32 mr-8",
316
- items: r.roleOptions,
317
- "model-value": T(r.value),
318
- multiselect: !1,
319
- placeholder: r.roleOptions[0] ? r.roleOptions[0].label : "",
320
- "onUpdate:modelValue": (Re) => W(r.value, Re)
321
- }, null, 8, ["items", "model-value", "placeholder", "onUpdate:modelValue"])) : Q("", !0)
322
- ], 64))), 128))
323
- ]),
324
- _: 1
325
- }, 8, ["modelValue", "rules"])
326
- ]),
327
- _: 1
328
- }, 8, ["title"])
329
- ])
330
- ]),
331
- _: 1
332
- }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])
333
- ], 64);
334
- };
335
- }
336
- }), ll = {
337
- class: "space-y-8"
338
- }, al = {
339
- class: "xs:hidden flex w-full items-start justify-between"
340
- }, tl = {
341
- class: "flex items-start gap-8"
342
- }, ol = {
343
- class: "flex"
344
- }, sl = {
345
- class: "space-y-4 hidden xs:block"
346
- }, rl = {
347
- class: "px-16"
348
- }, nl = {
349
- class: "px-16 flex items-start gap-8"
350
- }, ul = {
351
- class: "pb-64 hidden xs:block"
352
- }, il = {
353
- class: "space-y-4"
354
- }, ml = {
355
- class: "fm-typo-en-body-lg-600"
356
- }, cl = {
357
- key: 0,
358
- class: "mr-4"
359
- }, dl = {
360
- class: "text-fm-color-typo-secondary"
361
- }, kl = /* @__PURE__ */ he({
362
- __name: "EmployeeList",
363
- setup(S, {
364
- expose: O
365
- }) {
366
- const {
367
- t: u
368
- } = Ve(), E = g(), d = ke(), q = ne(), {
369
- sessionUser: H
370
- } = be(), i = F(() => d.employees.value), {
371
- searchKey: f,
372
- filter: L
373
- } = we(""), R = F(() => {
374
- var l;
375
- return (l = i.value) == null ? void 0 : l.filter((t) => {
376
- const p = !E.value || t.restaurants.some((V) => E.value.includes(V.restaurantId)), _ = !U.value || t.restaurants.some((V) => V.roleId && U.value.includes(V.roleId));
377
- return p && _ && L([t.code, t.name, `${t.restaurants.map((V) => N(V)).join(" ")}`]);
378
- });
379
- }), D = Ke(), N = (l) => {
380
- var _;
381
- const t = (_ = D.value[l.restaurantId]) == null ? void 0 : _.profile.code;
382
- let p = l.restaurantName;
383
- return l.roleName && (p = `${t ? t + " - " : ""}${p} (${l.roleName})`), p;
384
- }, X = [{
385
- accessorKey: "code",
386
- size: 100,
387
- header: () => u("hr.employee.columns.code")
388
- }, {
389
- accessorKey: "name",
390
- header: () => u("hr.employee.columns.name"),
391
- enableSorting: !1
392
- }, {
393
- accessorKey: "restaurants",
394
- align: "center",
395
- header: () => u("hr.employee.columns.restaurants"),
396
- enableSorting: !1,
397
- cell(l) {
398
- return l.row.original.restaurants.map((t, p) => {
399
- const _ = N(t);
400
- return se("div", (p ? `
401
- ` : "") + _);
402
- });
403
- }
404
- }, {
405
- accessorKey: "since",
406
- header: () => u("hr.employee.columns.since"),
407
- enableSorting: !1
408
- }, {
409
- id: "action",
410
- size: 52,
411
- meta: {
412
- cellClass: "pl-16",
413
- headerContentClass: "-mx-16"
414
- },
415
- cell: (l) => se("div", {
416
- class: "w-full flex justify-end items-center"
417
- }, [se(xe.FmButton, {
418
- prependIcon: "delete",
419
- variant: De.Tertiary,
420
- textColor: "neutral-gray-400",
421
- onClick: (t) => {
422
- t.stopPropagation(), T(l.row.original);
423
- }
424
- })])
425
- }], x = Fe(), s = Le(), C = g(), P = g(), Y = F(() => d.restrictEmployeeIds.value);
426
- function J(l) {
427
- const t = Y.value.includes(l._id);
428
- return t && x.open({
429
- message: u("hr.employee.cannotUpdateMasterUser", {
430
- name: l.name
431
- }),
432
- type: "error"
433
- }), t;
434
- }
435
- const k = (l) => {
436
- var p;
437
- l && J(l) || (p = P.value) == null || p.trigger(l);
438
- }, {
439
- breakpoints: Z
440
- } = Be(), T = (l) => {
441
- J(l) || s.open({
442
- title: u("hr.employee.remove.title"),
443
- message: u("hr.employee.remove.message", {
444
- name: l.name
445
- }),
446
- minWidth: Z.value.lg ? 588 : 0,
447
- primaryActions: {
448
- text: u("common.remove"),
449
- close: !1,
450
- variant: "destructive"
451
- },
452
- secondaryActions: {
453
- text: u("common.cancel"),
454
- close: !0
455
- }
456
- }).onPrimary(async () => {
457
- await (l.isMasterUser ? d.deleteMasterEmployee : d.deleteEmployee)(l).then(() => x.open({
458
- message: u("hr.employee.remove.successMessage", {
459
- name: l.name
460
- }),
461
- type: "success"
462
- })).catch((_) => x.open({
463
- message: _,
464
- type: "error"
465
- })), s.close();
466
- });
467
- }, W = g("");
468
- _e(() => C.value && C.value.restaurants, (l) => {
469
- l && l.length > 0 && (W.value = "");
470
- });
471
- function b() {
472
- var l;
473
- (l = P.value) == null || l.trigger();
474
- }
475
- const z = F(() => ne().roles.value.map((l) => ({
476
- label: l.name,
477
- value: l._id
478
- }))), U = g();
479
- async function ee() {
480
- try {
481
- await d.syncUsersMeta(), await d.readEmployees(), x.open({
482
- message: u("hr.employee.sync.successMessage"),
483
- type: "success"
484
- });
485
- } catch (l) {
486
- console.error("Error syncing users:", l), x.open({
487
- message: u("hr.employee.sync.errorMessage"),
488
- type: "error"
489
- });
490
- }
491
- }
492
- async function A() {
493
- q.roles.value.length === 0 && await q.readRoles(), d.employees.value.length === 0 && await d.readEmployees();
494
- }
495
- return Ie(() => {
496
- A();
497
- }), O({
498
- create: b,
499
- filteredEmployees: R
500
- }), (l, t) => {
501
- var a;
502
- const p = v("FmButton"), _ = v("FmTooltip"), V = v("FmSearch"), le = v("FmTable"), ae = v("FmListItem"), te = v("FmList");
503
- return h(), $(G, null, [n(el, {
504
- ref_key: "employeeFormRef",
505
- ref: P,
506
- modelValue: C.value,
507
- "onUpdate:modelValue": t[0] || (t[0] = (e) => C.value = e),
508
- "role-error-message": W.value,
509
- class: "gap-8"
510
- }, null, 8, ["modelValue", "role-error-message"]), c("div", ll, [c("div", al, [c("div", tl, [n(o(me), {
511
- modelValue: E.value,
512
- "onUpdate:modelValue": t[1] || (t[1] = (e) => E.value = e),
513
- "managable-only": !1,
514
- multiple: "",
515
- variant: "dark",
516
- class: "!w-auto"
517
- }, null, 8, ["modelValue"]), n(ce, {
518
- modelValue: U.value,
519
- "onUpdate:modelValue": t[2] || (t[2] = (e) => U.value = e),
520
- multiple: "",
521
- variant: "dark",
522
- items: z.value,
523
- "selected-prefix": o(u)("hr.employee.filter.selected_role_prefix"),
524
- placeholder: o(u)("hr.employee.filter.role_placeholder")
525
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", ol, [(a = o(H)) != null && a.role.isAdmin ? (h(), B(_, {
526
- key: 0,
527
- content: o(u)("hr.employee.sync.tooltip")
528
- }, {
529
- default: y(() => [n(p, {
530
- icon: "refresh",
531
- label: o(u)("hr.employee.sync.tooltip"),
532
- variant: "tertiary",
533
- onClick: ee
534
- }, null, 8, ["label"])]),
535
- _: 1
536
- }, 8, ["content"])) : Q("", !0), n(V, {
537
- modelValue: o(f),
538
- "onUpdate:modelValue": t[3] || (t[3] = (e) => re(f) ? f.value = e : null),
539
- autofocus: "",
540
- class: "pl-4 w-[320px]",
541
- placeholder: o(u)("hr.employee.search.placeholder")
542
- }, null, 8, ["modelValue", "placeholder"])])]), c("div", sl, [c("div", rl, [n(V, {
543
- modelValue: o(f),
544
- "onUpdate:modelValue": t[4] || (t[4] = (e) => re(f) ? f.value = e : null),
545
- autofocus: "",
546
- placeholder: o(u)("hr.employee.search.placeholder")
547
- }, null, 8, ["modelValue", "placeholder"])]), n(Je), c("div", nl, [n(o(me), {
548
- modelValue: E.value,
549
- "onUpdate:modelValue": t[5] || (t[5] = (e) => E.value = e),
550
- "managable-only": !1,
551
- multiple: "",
552
- variant: "dark",
553
- class: "!w-auto"
554
- }, null, 8, ["modelValue"]), n(ce, {
555
- modelValue: U.value,
556
- "onUpdate:modelValue": t[6] || (t[6] = (e) => U.value = e),
557
- multiple: "",
558
- items: z.value,
559
- variant: "dark",
560
- "selected-prefix": o(u)("hr.employee.filter.selected_role_prefix"),
561
- placeholder: o(u)("hr.employee.filter.role_placeholder")
562
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(d).employees.value.length > 0 || o(d).isLoading.value ? (h(), B(Pe, {
563
- key: 0,
564
- class: "overflow-auto"
565
- }, {
566
- default: y(() => [n(le, {
567
- class: "xs:hidden",
568
- "column-defs": X,
569
- "row-data": R.value,
570
- "page-size": R.value.length,
571
- loading: o(d).isLoading.value,
572
- virtual: R.value.length > 0,
573
- "pin-header-row": "",
574
- "hide-footer": "",
575
- onRowClick: t[7] || (t[7] = (e) => k(e.original))
576
- }, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div", ul, [n(te, {
577
- separator: ""
578
- }, {
579
- default: y(() => [(h(!0), $(G, null, ge(R.value, (e) => (h(), B(ae, {
580
- key: e._id,
581
- class: "py-12 px-16 items-center justify-between",
582
- onClick: (m) => k(e)
583
- }, {
584
- default: y(() => [c("div", il, [c("p", ml, [e.code ? (h(), $("span", cl, K(e.code) + ".", 1)) : Q("", !0), $e(K(e.name), 1)]), c("div", dl, [c("p", null, K(o(u)("hr.employee.restaurants", {
585
- restaurants: e.restaurants.map((m) => N(m)).join(", ")
586
- })), 1), c("p", null, " Since: " + K(e.since), 1)])]), n(p, {
587
- icon: "delete",
588
- variant: "tertiary",
589
- "text-color": "neutral-gray-400",
590
- onClick: Oe((m) => T(e), ["stop"])
591
- }, null, 8, ["onClick"])]),
592
- _: 2
593
- }, 1032, ["onClick"]))), 128))]),
594
- _: 1
595
- })])]),
596
- _: 1
597
- })) : (h(), B(o(Te), {
598
- key: 1,
599
- title: o(u)("hr.employee.noData.title"),
600
- subtitle: o(u)("hr.employee.noData.subtitle")
601
- }, null, 8, ["title", "subtitle"]))])], 64);
602
- };
603
- }
604
- });
605
- export {
606
- kl as default
607
- };