@feedmepos/mf-hrm-portal 2.0.21 → 2.0.23-dev

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 (25) hide show
  1. package/dist/{AuditLogList-COhT1PFG.js → AuditLogList-DZNv14Ii.js} +4 -4
  2. package/dist/{EmployeeList-CBfr6g9t.js → EmployeeList-CLyzXVHu.js} +6 -6
  3. package/dist/{Main-gByKBqZC.js → Main-B2a73bxV.js} +4 -4
  4. package/dist/{Main-BEfbP-bs.js → Main-DECstpL4.js} +6 -6
  5. package/dist/{Main-D1dN1FTE.js → Main-miavlomK.js} +9 -9
  6. package/dist/{PermissionSetList-CHLm6ueB.js → PermissionSetList-Bwm1kvTZ.js} +6 -6
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BRb3aRsV.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXlFv5XV.js} +804 -804
  8. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BW8o67ka.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-AvJQ8FF0.js} +1 -1
  9. package/dist/{RoleList-mgMUDQa_.js → RoleList-DKSkfV3M.js} +7 -7
  10. package/dist/{TeamMemberList-Bdtm1lLi.js → TeamMemberList-BwGAzb5q.js} +56 -56
  11. package/dist/{TimesheetList-BdO8bRzv.js → TimesheetList-DWgsblFA.js} +79 -80
  12. package/dist/{timesheet-q4UbovJv.js → TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-DIlDcQ8K.js} +2 -2
  13. package/dist/{app-DdGJIhvX.js → app-BjVOqAt4.js} +22 -7
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-Dn0iKqwG.js → dayjs.min-Cs7Dz0qO.js} +1 -1
  16. package/dist/{employee-rjbsWBRt.js → employee-BZNHhwz-.js} +3 -3
  17. package/dist/{iteration-iN8h5bwW.js → iteration-dOodV1U7.js} +3 -3
  18. package/dist/{lodash-BX4i2dq_.js → lodash-DcnVzoh_.js} +1 -1
  19. package/dist/{rule-CBauoBQ2.js → rule-CUTGoTLu.js} +25 -25
  20. package/dist/style.css +1 -1
  21. package/dist/tsconfig.app.tsbuildinfo +1 -1
  22. package/dist/{useAppStore-DPDMpfh5.js → useAppStore-CGruFhcg.js} +1 -1
  23. package/dist/{useLoading-DLMKZcST.js → useLoading-BJ29K6RW.js} +1 -1
  24. package/dist/{useReportPermissions-DjUtbNV6.js → useReportPermissions-CDme7_5P.js} +3 -3
  25. package/package.json +2 -2
@@ -1,20 +1,20 @@
1
- import { defineComponent as Se, resolveComponent as V, createElementBlock as D, openBlock as y, createElementVNode as r, createVNode as u, toDisplayString as I, unref as o, ref as f, computed as P, createCommentVNode as T, withCtx as ue, createBlock as q, watch as me, Fragment as ke, renderList as ls, withKeys as Be, withModifiers as Fe, nextTick as os, onUnmounted as ns, h as rs, createTextVNode as is } from "vue";
1
+ import { defineComponent as Se, resolveComponent as V, createElementBlock as D, openBlock as y, createElementVNode as r, createVNode as u, toDisplayString as k, unref as o, ref as f, computed as P, createCommentVNode as T, withCtx as ue, createBlock as q, watch as me, Fragment as Ie, renderList as ls, withKeys as Be, withModifiers as Fe, nextTick as os, onUnmounted as ns, h as rs, createTextVNode as is } from "vue";
2
2
  import { useI18n as Ve, useCoreStore as Ae, baseClientInstance as je } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as Je, useDialog as us, useBreakpoints as ms, components as Me } from "@feedmepos/ui-library";
4
4
  import { u as ds, _ as cs } from "./useDebounce-CWb5QR9G.js";
5
5
  import { _ as ps, S as be } from "./SelectFilter-DUj7GBtT.js";
6
- import { b as Ee, m as vs, C as fs, _ as bs, a as ys } from "./app-DdGJIhvX.js";
6
+ import { b as Ee, m as vs, k as fs, _ as bs, a as ys } from "./app-BjVOqAt4.js";
7
7
  import { u as _s, _ as hs } from "./useDiscardConfirm-DPhEV6v0.js";
8
8
  import { _ as gs } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
9
- import { u as xs } from "./useLoading-DLMKZcST.js";
10
- import { l as Ne } from "./lodash-BX4i2dq_.js";
11
- import { g as Le, d as pe, u as Xe } from "./iteration-iN8h5bwW.js";
12
- import { u as Ze, c as Te, b as qe, m as Ie, d as Qe, p as Ke, i as Us, j as ze, k as Ge, l as Fs, n as Ss, s as Vs, o as ws, q as Ps, t as Ue } from "./rule-CBauoBQ2.js";
13
- import { u as Ye } from "./useAppStore-DPDMpfh5.js";
14
- import { u as He } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BW8o67ka.js";
15
- import { _ as Is } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BRb3aRsV.js";
9
+ import { u as xs } from "./useLoading-BJ29K6RW.js";
10
+ import { l as Ne } from "./lodash-DcnVzoh_.js";
11
+ import { g as Le, d as pe, u as Xe } from "./iteration-dOodV1U7.js";
12
+ import { u as Ze, c as Te, b as qe, m as ke, d as Qe, p as Ke, i as Us, j as ze, k as Ge, l as Fs, n as Ss, s as Vs, o as ws, q as Ps, t as Ue } from "./rule-CUTGoTLu.js";
13
+ import { u as Ye } from "./useAppStore-CGruFhcg.js";
14
+ import { u as He } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-AvJQ8FF0.js";
15
+ import { _ as ks } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXlFv5XV.js";
16
16
  var _e = /* @__PURE__ */ ((m) => (m.Update = "Update", m.Remove = "Remove", m))(_e || {});
17
- const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-center gap-16" }, Rs = { class: "space-y-4 min-w-0 flex-1" }, Cs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ms = { class: "fm-typo-en-body-lg-600 truncate" }, Ns = { class: "w-full flex gap-16 items-center" }, Ds = { class: "flex-1 flex flex-col gap-4 min-w-0" }, As = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Os = { class: "fm-typo-en-body-lg-600 truncate" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Es = { class: "fm-typo-en-body-lg-600 truncate" }, Ls = /* @__PURE__ */ Se({
17
+ const Is = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-center gap-16" }, Rs = { class: "space-y-4 min-w-0 flex-1" }, Cs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ms = { class: "fm-typo-en-body-lg-600 truncate" }, Ns = { class: "w-full flex gap-16 items-center" }, Ds = { class: "flex-1 flex flex-col gap-4 min-w-0" }, As = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Os = { class: "fm-typo-en-body-lg-600 truncate" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Es = { class: "fm-typo-en-body-lg-600 truncate" }, Ls = /* @__PURE__ */ Se({
18
18
  __name: "MemberInfo",
19
19
  props: {
20
20
  data: {}
@@ -23,25 +23,25 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
23
23
  const { t: A } = Ve();
24
24
  return (n, a) => {
25
25
  const d = V("FmAvatar");
26
- return y(), D("div", ks, [
26
+ return y(), D("div", Is, [
27
27
  r("div", $s, [
28
28
  u(d, {
29
29
  size: "xl",
30
30
  initials: m.data.name
31
31
  }, null, 8, ["initials"]),
32
32
  r("div", Rs, [
33
- r("p", Cs, I(o(A)("team.memberForm.memberInfo.memberName")), 1),
34
- r("p", Ms, I(m.data.name || "--"), 1)
33
+ r("p", Cs, k(o(A)("team.memberForm.memberInfo.memberName")), 1),
34
+ r("p", Ms, k(m.data.name || "--"), 1)
35
35
  ])
36
36
  ]),
37
37
  r("div", Ns, [
38
38
  r("div", Ds, [
39
- r("p", As, I(o(A)("team.memberForm.memberInfo.mobileNumber")), 1),
40
- r("p", Os, I(m.data.phoneNumber || "--"), 1)
39
+ r("p", As, k(o(A)("team.memberForm.memberInfo.mobileNumber")), 1),
40
+ r("p", Os, k(m.data.phoneNumber || "--"), 1)
41
41
  ]),
42
42
  r("div", Bs, [
43
- r("p", js, I(o(A)("team.memberForm.memberInfo.emailAddress")), 1),
44
- r("p", Es, I(m.data.email || "--"), 1)
43
+ r("p", js, k(o(A)("team.memberForm.memberInfo.emailAddress")), 1),
44
+ r("p", Es, k(m.data.email || "--"), 1)
45
45
  ])
46
46
  ])
47
47
  ]);
@@ -146,11 +146,11 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
146
146
  class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
147
147
  onClick: S[3] || (S[3] = (w) => K(p.value))
148
148
  }, [
149
- r("div", Ks, I(X.value), 1),
149
+ r("div", Ks, k(X.value), 1),
150
150
  r("div", zs, [
151
- r("p", Gs, I((Q = p.value) == null ? void 0 : Q.displayName), 1),
152
- r("p", Ws, I((Y = p.value) == null ? void 0 : Y.email), 1),
153
- r("p", Js, I((B = p.value) == null ? void 0 : B.phoneNumber), 1)
151
+ r("p", Gs, k((Q = p.value) == null ? void 0 : Q.displayName), 1),
152
+ r("p", Ws, k((Y = p.value) == null ? void 0 : Y.email), 1),
153
+ r("p", Js, k((B = p.value) == null ? void 0 : B.phoneNumber), 1)
154
154
  ])
155
155
  ])) : T("", !0),
156
156
  Z.value ? (y(), D("div", Xs, [
@@ -296,8 +296,8 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
296
296
  return y(), D("div", Ys, [
297
297
  r("div", Hs, [
298
298
  r("div", et, [
299
- r("div", st, I(o(d)("team.memberForm.masterUser.title")), 1),
300
- r("div", tt, I(o(d)("team.memberForm.masterUser.sublabel")), 1)
299
+ r("div", st, k(o(d)("team.memberForm.masterUser.title")), 1),
300
+ r("div", tt, k(o(d)("team.memberForm.masterUser.sublabel")), 1)
301
301
  ]),
302
302
  r("div", null, [
303
303
  u(x, {
@@ -307,7 +307,7 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
307
307
  }, null, 8, ["model-value"])
308
308
  ])
309
309
  ]),
310
- m.modelValue ? (y(), D(ke, { key: 0 }, [
310
+ m.modelValue ? (y(), D(Ie, { key: 0 }, [
311
311
  r("div", at, [
312
312
  u(M, {
313
313
  "model-value": m.modelValue.code,
@@ -323,7 +323,7 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
323
323
  }, null, 8, ["model-value", "label", "rules"])
324
324
  ]),
325
325
  r("div", lt, [
326
- r("div", ot, I(o(d)("team.memberForm.masterUser.passcode")), 1),
326
+ r("div", ot, k(o(d)("team.memberForm.masterUser.passcode")), 1),
327
327
  u(Y, {
328
328
  modelValue: j.value,
329
329
  "onUpdate:modelValue": l[4] || (l[4] = (c) => j.value = c),
@@ -355,14 +355,14 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
355
355
  }, {
356
356
  default: ue(() => [
357
357
  r("div", nt, [
358
- r("div", rt, I(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
358
+ r("div", rt, k(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
359
359
  r("div", it, [
360
360
  r("div", ut, [
361
- r("div", mt, I(o(d)("team.table.columns.restaurant")), 1),
362
- r("div", dt, I(o(d)("team.memberForm.masterUser.role")), 1),
361
+ r("div", mt, k(o(d)("team.table.columns.restaurant")), 1),
362
+ r("div", dt, k(o(d)("team.memberForm.masterUser.role")), 1),
363
363
  l[6] || (l[6] = r("div", null, null, -1))
364
364
  ]),
365
- (y(!0), D(ke, null, ls(m.modelValue.roles, (c, h) => (y(), D("div", {
365
+ (y(!0), D(Ie, null, ls(m.modelValue.roles, (c, h) => (y(), D("div", {
366
366
  key: `${c.restaurantId || "new"}-${h}`,
367
367
  class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
368
368
  }, [
@@ -455,7 +455,7 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
455
455
  () => Te(_.value, C.permissionSets.value)
456
456
  ), v = f((he = n.initialValue) == null ? void 0 : he.posUser), p = f(
457
457
  qe(
458
- Ie(O.value),
458
+ ke(O.value),
459
459
  ((ge = n.initialValue) == null ? void 0 : ge.permissions) || []
460
460
  )
461
461
  ), { customReportPermissions: te, isLoaded: X } = Qe(), Z = new Set(
@@ -486,7 +486,7 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
486
486
  }), l = f({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
487
487
  function x(t) {
488
488
  d.value = void 0, _.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], p.value = qe(
489
- Ie(
489
+ ke(
490
490
  Te(
491
491
  _.value,
492
492
  C.permissionSets.value
@@ -509,14 +509,14 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
509
509
  v.value = h(v.value, t);
510
510
  }
511
511
  function B() {
512
- const t = Ie(O.value), b = X.value ? K.value : Z, k = Fs(p.value, b), $ = Ss(k, z.value), R = Vs($);
512
+ const t = ke(O.value), b = X.value ? K.value : Z, I = Fs(p.value, b), $ = Ss(I, z.value), R = Vs($);
513
513
  return ws(t, R);
514
514
  }
515
515
  function w() {
516
- var k, $, R, H, re, ie, de, ae, ee, ce;
516
+ var I, $, R, H, re, ie, de, ae, ee, ce;
517
517
  const t = B(), b = p.value.filter((se) => !se.inverted);
518
518
  return {
519
- email: ((k = d.value) == null ? void 0 : k.email) ?? void 0,
519
+ email: ((I = d.value) == null ? void 0 : I.email) ?? void 0,
520
520
  phoneNumber: (($ = d.value) == null ? void 0 : $.phoneNumber) ?? void 0,
521
521
  customPermissions: t,
522
522
  permissions: b.map((se) => ({
@@ -536,15 +536,15 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
536
536
  }
537
537
  const W = f();
538
538
  function c() {
539
- p.value = Ie(O.value);
539
+ p.value = ke(O.value);
540
540
  }
541
541
  function h(t, b) {
542
542
  if (!t) return t;
543
- const k = ze(b), $ = Ge(b);
544
- if (k === null && $ === null) return t;
543
+ const I = ze(b), $ = Ge(b);
544
+ if (I === null && $ === null) return t;
545
545
  const R = pe(t);
546
546
  return R.roles = R.roles.filter(
547
- (H) => (k === null || k.includes(H.roleId)) && ($ === null || $.includes(H.restaurantId))
547
+ (H) => (I === null || I.includes(H.roleId)) && ($ === null || $.includes(H.restaurantId))
548
548
  ), R;
549
549
  }
550
550
  const L = f(!!v.value), ve = f(!1);
@@ -585,7 +585,7 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
585
585
  validate: we,
586
586
  isModified: M
587
587
  }), (t, b) => {
588
- const k = V("FmSelect"), $ = V("FmCircularProgress"), R = V("FmForm");
588
+ const I = V("FmSelect"), $ = V("FmCircularProgress"), R = V("FmForm");
589
589
  return y(), q(R, {
590
590
  ref_key: "formRef",
591
591
  ref: ne,
@@ -604,11 +604,11 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
604
604
  onInvite: b[0] || (b[0] = (ee) => Q(ee))
605
605
  }))
606
606
  ]),
607
- d.value || m.initialValue ? (y(), D(ke, { key: 0 }, [
607
+ d.value || m.initialValue ? (y(), D(Ie, { key: 0 }, [
608
608
  (H = m.initialValue) != null && H.isOwner ? T("", !0) : (y(), D("div", yt, [
609
609
  r("div", _t, [
610
- r("div", ht, I(o(a)("team.memberForm.permissionSet.title")), 1),
611
- u(k, {
610
+ r("div", ht, k(o(a)("team.memberForm.permissionSet.title")), 1),
611
+ u(I, {
612
612
  modelValue: _.value,
613
613
  "onUpdate:modelValue": [
614
614
  b[1] || (b[1] = (ee) => _.value = ee),
@@ -622,8 +622,8 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
622
622
  }, null, 8, ["modelValue", "items", "placeholder"])
623
623
  ]),
624
624
  r("div", gt, [
625
- r("div", xt, I(o(a)("team.memberForm.permissions.title")), 1),
626
- u(Is, {
625
+ r("div", xt, k(o(a)("team.memberForm.permissions.title")), 1),
626
+ u(ks, {
627
627
  modelValue: p.value,
628
628
  "onUpdate:modelValue": b[2] || (b[2] = (ee) => p.value = ee),
629
629
  "inherit-permissions": O.value,
@@ -661,10 +661,10 @@ const ks = { class: "w-full flex flex-col gap-16" }, $s = { class: "flex items-c
661
661
  class: "flex w-full items-start justify-between px-16"
662
662
  }, Pt = {
663
663
  class: "flex items-start gap-8"
664
- }, It = {
664
+ }, kt = {
665
665
  key: 1,
666
666
  class: "space-y-4 px-16"
667
- }, kt = {
667
+ }, It = {
668
668
  class: "flex items-start gap-8"
669
669
  }, $t = {
670
670
  class: "flex h-full flex-col"
@@ -896,12 +896,12 @@ const Xt = /* @__PURE__ */ Se({
896
896
  });
897
897
  }, b = () => {
898
898
  ne.value = null, h.value = le.ADD;
899
- }, k = f(), $ = f(), R = f(), H = P(() => {
899
+ }, I = f(), $ = f(), R = f(), H = P(() => {
900
900
  var e;
901
901
  return JSON.stringify({
902
902
  businessId: ((e = d.currentBusiness.value) == null ? void 0 : e._id) ?? "",
903
903
  search: E.value.trim(),
904
- restaurantIds: [...k.value ?? []].sort(),
904
+ restaurantIds: [...I.value ?? []].sort(),
905
905
  permissionSubjects: [...$.value ?? []].sort(),
906
906
  permissionSetIds: [...R.value ?? []].sort()
907
907
  });
@@ -923,7 +923,7 @@ const Xt = /* @__PURE__ */ Se({
923
923
  limit: ye,
924
924
  offset: (e - 1) * ye,
925
925
  search: E.value.trim() || void 0,
926
- restaurantIds: (s = k.value) != null && s.length ? k.value : void 0,
926
+ restaurantIds: (s = I.value) != null && s.length ? I.value : void 0,
927
927
  permissionSubjects: (U = $.value) != null && U.length ? $.value : void 0,
928
928
  permissionSetIds: (F = R.value) != null && F.length ? R.value : void 0
929
929
  });
@@ -1002,14 +1002,14 @@ const Xt = /* @__PURE__ */ Se({
1002
1002
  }), (e, s) => {
1003
1003
  var xe;
1004
1004
  const U = V("FmSearch"), F = V("FmTable"), J = V("FmIcon"), oe = V("FmButton"), Pe = V("FmSideSheet");
1005
- return y(), D(ke, null, [r("div", St, [r("div", Vt, [o(ge).xs ? (y(), D("div", It, [u(U, {
1005
+ return y(), D(Ie, null, [r("div", St, [r("div", Vt, [o(ge).xs ? (y(), D("div", kt, [u(U, {
1006
1006
  modelValue: S.value,
1007
1007
  "onUpdate:modelValue": s[4] || (s[4] = (N) => S.value = N),
1008
1008
  class: "w-[320px] xs:w-full xs:mt-8",
1009
1009
  placeholder: o(a)("team.search.placeholder")
1010
- }, null, 8, ["modelValue", "placeholder"]), r("div", kt, [u(be, {
1011
- modelValue: k.value,
1012
- "onUpdate:modelValue": s[5] || (s[5] = (N) => k.value = N),
1010
+ }, null, 8, ["modelValue", "placeholder"]), r("div", It, [u(be, {
1011
+ modelValue: I.value,
1012
+ "onUpdate:modelValue": s[5] || (s[5] = (N) => I.value = N),
1013
1013
  multiple: "",
1014
1014
  items: G.value,
1015
1015
  variant: "dark",
@@ -1033,8 +1033,8 @@ const Xt = /* @__PURE__ */ Se({
1033
1033
  "selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
1034
1034
  placeholder: o(a)("team.filter.assigned_role_placeholder")
1035
1035
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (y(), D("div", wt, [r("div", Pt, [u(be, {
1036
- modelValue: k.value,
1037
- "onUpdate:modelValue": s[0] || (s[0] = (N) => k.value = N),
1036
+ modelValue: I.value,
1037
+ "onUpdate:modelValue": s[0] || (s[0] = (N) => I.value = N),
1038
1038
  multiple: "",
1039
1039
  items: G.value,
1040
1040
  variant: "dark",
@@ -1092,7 +1092,7 @@ const Xt = /* @__PURE__ */ Se({
1092
1092
  "close-button": !1,
1093
1093
  "onOn:clickedAway": o(fe)
1094
1094
  }, {
1095
- "side-sheet-header": ue(() => [r("div", Rt, [r("p", Ct, I($e.value), 1), u(J, {
1095
+ "side-sheet-header": ue(() => [r("div", Rt, [r("p", Ct, k($e.value), 1), u(J, {
1096
1096
  name: "close",
1097
1097
  size: "md",
1098
1098
  class: "cursor-pointer",
@@ -1,35 +1,35 @@
1
- import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as ee, resolveComponent as u, createElementBlock as P, openBlock as _, Fragment as te, createVNode as l, createElementVNode as i, unref as r, withCtx as Y, createCommentVNode as ve, toDisplayString as O, createTextVNode as he, createBlock as z, isRef as ge, renderList as ye, nextTick as we } from "vue";
2
- import { d as f } from "./dayjs.min-Dn0iKqwG.js";
1
+ import { ref as d, computed as g, defineComponent as pe, onMounted as ve, watch as ee, resolveComponent as u, createElementBlock as P, openBlock as _, Fragment as te, createVNode as l, createElementVNode as i, unref as r, withCtx as Y, createCommentVNode as fe, toDisplayString as O, createTextVNode as he, createBlock as z, isRef as ge, renderList as we, nextTick as ye } from "vue";
2
+ import { d as v } from "./dayjs.min-Cs7Dz0qO.js";
3
3
  import { useI18n as be } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as _e, components as xe } from "@feedmepos/ui-library";
5
- import { S as De } from "./SelectFilter-DUj7GBtT.js";
6
- import { _ as Se } from "./app-DdGJIhvX.js";
7
- import { _ as ke } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
8
- import { u as Ve } from "./useLoading-DLMKZcST.js";
9
- import { u as Ce, c as Fe, s as Ye } from "./iteration-iN8h5bwW.js";
10
- import { f as Le } from "./utils-BZkjJbju.js";
11
- import { u as Me } from "./employee-rjbsWBRt.js";
12
- import { u as Te } from "./timesheet-q4UbovJv.js";
13
- function Re(x, a) {
5
+ import { S as De, _ as Se } from "./SelectFilter-DUj7GBtT.js";
6
+ import { _ as ke } from "./app-BjVOqAt4.js";
7
+ import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
8
+ import { u as Ce } from "./useLoading-BJ29K6RW.js";
9
+ import { u as Fe, c as Ye, s as Le } from "./iteration-dOodV1U7.js";
10
+ import { f as Me } from "./utils-BZkjJbju.js";
11
+ import { u as Te } from "./employee-BZNHhwz-.js";
12
+ import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-DIlDcQ8K.js";
13
+ function Ie(x, a) {
14
14
  return ["years", "months"].find((S) => {
15
- const k = x.startOf(S), v = x.endOf(S);
16
- return x.isSame(k, "day") && a.isSame(v, "day");
15
+ const k = x.startOf(S), f = x.endOf(S);
16
+ return x.isSame(k, "day") && a.isSame(f, "day");
17
17
  }) || "days";
18
18
  }
19
19
  function $e() {
20
20
  const x = {
21
- startDate: f().format("YYYY-MM-DD"),
22
- endDate: f().format("YYYY-MM-DD")
21
+ startDate: v().format("YYYY-MM-DD"),
22
+ endDate: v().format("YYYY-MM-DD")
23
23
  }, a = d(x), D = g(() => {
24
24
  if (!a.value) return "No dates selected.";
25
- const v = a.value.startDate ?? "Start", b = a.value.endDate ?? "End";
26
- return `${v} - ${b}`;
25
+ const f = a.value.startDate ?? "Start", b = a.value.endDate ?? "End";
26
+ return `${f} - ${b}`;
27
27
  }), S = g(() => ({
28
28
  startDate: new Date(a.value.startDate),
29
29
  endDate: new Date(a.value.endDate)
30
30
  }));
31
- function k(v) {
32
- const b = f(a.value.startDate), c = f(a.value.endDate), h = Re(b, c), V = h === "days" ? c.diff(b, "days") + 1 : 1, C = v === "subtract" ? (F) => F.subtract(V, h) : (F) => F.add(V, h);
31
+ function k(f) {
32
+ const b = v(a.value.startDate), c = v(a.value.endDate), h = Ie(b, c), V = h === "days" ? c.diff(b, "days") + 1 : 1, C = f === "subtract" ? (F) => F.subtract(V, h) : (F) => F.add(V, h);
33
33
  a.value = {
34
34
  startDate: C(b).startOf(h).format("YYYY-MM-DD"),
35
35
  endDate: C(c).endOf(h).format("YYYY-MM-DD")
@@ -37,79 +37,79 @@ function $e() {
37
37
  }
38
38
  return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: k };
39
39
  }
40
- const Ie = {
40
+ const Ee = {
41
41
  class: "my-16 flex w-[350px] flex-col gap-40"
42
- }, Ee = {
43
- class: "flex gap-16"
44
42
  }, Oe = {
45
- class: "flex flex-col gap-4"
43
+ class: "flex gap-16"
46
44
  }, Ae = {
47
- class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
45
+ class: "flex flex-col gap-4"
48
46
  }, Ke = {
49
- class: "fm-typo-body-md-700 text-fm-color-typo-primary"
47
+ class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
50
48
  }, ze = {
51
- class: "flex flex-col gap-8"
49
+ class: "fm-typo-body-md-700 text-fm-color-typo-primary"
52
50
  }, Ne = {
53
- class: "fm-typo-body-xl-700"
51
+ class: "flex flex-col gap-8"
54
52
  }, Ue = {
55
- class: "flex flex-col gap-24"
53
+ class: "fm-typo-body-xl-700"
56
54
  }, Be = {
57
- class: "flex flex-col gap-8"
55
+ class: "flex flex-col gap-24"
58
56
  }, Pe = {
59
- class: "fm-typo-body-xl-700"
57
+ class: "flex flex-col gap-8"
60
58
  }, je = {
61
- class: "flex flex-col gap-24"
59
+ class: "fm-typo-body-xl-700"
62
60
  }, He = {
61
+ class: "flex flex-col gap-24"
62
+ }, Ge = {
63
63
  key: 0,
64
64
  class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
65
- }, Ge = {
66
- class: "flex items-center justify-start gap-8"
67
65
  }, qe = {
68
- class: "space-y-8"
66
+ class: "flex items-center justify-start gap-8"
69
67
  }, Je = {
70
- class: "flex items-start gap-8 flex-wrap xs:px-16"
68
+ class: "space-y-8"
71
69
  }, Qe = {
70
+ class: "flex items-start gap-8 flex-wrap xs:px-16"
71
+ }, We = {
72
72
  class: "flex items-center gap-8"
73
- }, ut = /* @__PURE__ */ pe({
73
+ }, Xe = /* @__PURE__ */ pe({
74
74
  __name: "TimesheetList",
75
75
  setup(x) {
76
76
  const {
77
77
  t: a
78
- } = be(), D = _e(), S = Ve(D), k = [{
78
+ } = be(), D = _e(), S = Ce(D), k = [{
79
79
  label: a("hr.timesheet.listView"),
80
80
  value: "listView"
81
81
  }, {
82
82
  label: a("hr.timesheet.userView"),
83
83
  value: "userView"
84
- }], v = d("listView"), b = g(() => {
84
+ }], f = d("listView"), b = g(() => {
85
85
  var t;
86
- return (t = k.find((e) => e.value === v.value)) == null ? void 0 : t.label;
87
- }), c = d(""), h = Te(), V = Me(), C = Ce(), F = g(() => V.employees.value), N = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
88
- var w;
89
- const n = (w = C.restaurants.value.find((p) => p._id === s.restaurantId)) == null ? void 0 : w.profile.code, y = F.value.find((p) => p._id === s.user.id);
86
+ return (t = k.find((e) => e.value === f.value)) == null ? void 0 : t.label;
87
+ }), c = d(""), h = Re(), V = Te(), C = Fe(), F = g(() => V.employees.value), N = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
88
+ var y;
89
+ const n = (y = C.restaurants.value.find((p) => p._id === s.restaurantId)) == null ? void 0 : y.profile.code, w = F.value.find((p) => p._id === s.user.id);
90
90
  return {
91
91
  ...s,
92
92
  restaurantCode: n,
93
93
  user: {
94
94
  ...s.user,
95
- code: y ? y.code : ""
95
+ code: w ? w.code : ""
96
96
  }
97
97
  };
98
98
  })), j = g(() => N.value.filter((t) => {
99
99
  var e, s;
100
100
  return t.user.name.toLowerCase().includes(c.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase())) || ((s = t.user.code) == null ? void 0 : s.toLowerCase().includes(c.value.toLowerCase()));
101
101
  })), H = g(() => {
102
- const t = Fe(N.value, (s) => s.user.name), e = Object.entries(t).map(([s, n]) => {
103
- const y = F.value.find((w) => w._id === n[0].user.id);
102
+ const t = Ye(N.value, (s) => s.user.name), e = Object.entries(t).map(([s, n]) => {
103
+ const w = F.value.find((y) => y._id === n[0].user.id);
104
104
  return {
105
105
  key: s,
106
106
  user: n[0].user.name,
107
- code: y ? y.code : n[0].user.code || "",
107
+ code: w ? w.code : n[0].user.code || "",
108
108
  timesheets: n,
109
- total: Le(n.reduce((w, p) => w + p.totalMin, 0))
109
+ total: Me(n.reduce((y, p) => y + p.totalMin, 0))
110
110
  };
111
111
  });
112
- return Ye(e, {
112
+ return Le(e, {
113
113
  selector: "user"
114
114
  });
115
115
  }), G = g(() => H.value.filter((t) => {
@@ -122,7 +122,7 @@ const Ie = {
122
122
  } = M.value;
123
123
  L.value = !0;
124
124
  try {
125
- await h.readTimesheet(new Date(t), new Date(e)), await we(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
125
+ await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
126
126
  } catch (s) {
127
127
  D.open({
128
128
  title: s instanceof Error ? s.message : `${s}`,
@@ -132,7 +132,7 @@ const Ie = {
132
132
  L.value = !1;
133
133
  }
134
134
  };
135
- fe(async () => {
135
+ ve(async () => {
136
136
  try {
137
137
  await C.readRestaurants(), V.employees.value.length === 0 && await V.readEmployees();
138
138
  } catch (t) {
@@ -242,12 +242,12 @@ const Ie = {
242
242
  enableSorting: !1
243
243
  }], T = d(!1);
244
244
  function J(t) {
245
- m.value = t, R.value = f(m.value.startedAt).format("YYYY-MM-DD"), I.value = f(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), $.value = f(m.value.startedAt).format("HH:mm"), E.value = f(m.value.endedAt || m.value.startedAt).format("HH:mm"), T.value = !0;
245
+ m.value = t, R.value = v(m.value.startedAt).format("YYYY-MM-DD"), $.value = v(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), I.value = v(m.value.startedAt).format("HH:mm"), E.value = v(m.value.endedAt || m.value.startedAt).format("HH:mm"), T.value = !0;
246
246
  }
247
- const R = d(), $ = d(), I = d(), E = d(), m = d(), K = d("");
247
+ const R = d(), I = d(), $ = d(), E = d(), m = d(), K = d("");
248
248
  async function re() {
249
- const t = Q(R.value, $.value), e = Q(I.value, E.value);
250
- if (f(t).isAfter(e)) {
249
+ const t = Q(R.value, I.value), e = Q($.value, E.value);
250
+ if (v(t).isAfter(e)) {
251
251
  K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
252
252
  return;
253
253
  }
@@ -257,18 +257,18 @@ const Ie = {
257
257
  successMessage: a("hr.timesheet.update.successMessage")
258
258
  }), U(), T.value = !1;
259
259
  }
260
- const Q = (t, e) => f(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
261
- return ee([R, I, $, E], ([t, e, s, n]) => {
260
+ const Q = (t, e) => v(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
261
+ return ee([R, $, I, E], ([t, e, s, n]) => {
262
262
  (t || e || s || n) && (K.value = "");
263
263
  }), (t, e) => {
264
- const s = u("FmAvatar"), n = u("FmDatePicker"), y = u("FmTimePicker"), w = u("FmIcon"), p = u("FmButton"), ne = u("FmSideSheet"), W = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), X = u("FmTable");
264
+ const s = u("FmAvatar"), n = u("FmDatePicker"), w = u("FmTimePicker"), y = u("FmIcon"), p = u("FmButton"), ne = u("FmSideSheet"), W = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), X = u("FmTable");
265
265
  return _(), P(te, null, [l(ne, {
266
266
  modelValue: T.value,
267
267
  "onUpdate:modelValue": e[5] || (e[5] = (o) => T.value = o),
268
268
  "dismiss-away": "",
269
269
  header: r(a)("hr.timesheet.update.title")
270
270
  }, {
271
- "side-sheet-footer": Y(() => [i("div", Ge, [l(p, {
271
+ "side-sheet-footer": Y(() => [i("div", qe, [l(p, {
272
272
  label: r(a)("common.update"),
273
273
  size: "md",
274
274
  variant: "primary",
@@ -279,34 +279,34 @@ const Ie = {
279
279
  variant: "secondary",
280
280
  onClick: e[4] || (e[4] = (o) => T.value = !1)
281
281
  }, null, 8, ["label"])])]),
282
- default: Y(() => [i("div", Ie, [i("div", Ee, [l(s, {
282
+ default: Y(() => [i("div", Ee, [i("div", Oe, [l(s, {
283
283
  initials: m.value.user.name,
284
284
  size: "lg"
285
- }, null, 8, ["initials"]), i("div", Oe, [i("div", Ae, O(r(a)("hr.timesheet.employeeName")), 1), i("div", Ke, O(m.value.user.name), 1)])]), i("div", ze, [i("div", Ne, O(r(a)("hr.timesheet.update.checkIn")), 1), i("div", Ue, [l(n, {
285
+ }, null, 8, ["initials"]), i("div", Ae, [i("div", Ke, O(r(a)("hr.timesheet.employeeName")), 1), i("div", ze, O(m.value.user.name), 1)])]), i("div", Ne, [i("div", Ue, O(r(a)("hr.timesheet.update.checkIn")), 1), i("div", Be, [l(n, {
286
286
  modelValue: R.value,
287
287
  "onUpdate:modelValue": e[0] || (e[0] = (o) => R.value = o),
288
288
  disabled: !1,
289
289
  label: r(a)("hr.timesheet.update.date")
290
- }, null, 8, ["modelValue", "label"]), l(y, {
291
- modelValue: $.value,
292
- "onUpdate:modelValue": e[1] || (e[1] = (o) => $.value = o),
293
- label: r(a)("hr.timesheet.update.time")
294
- }, null, 8, ["modelValue", "label"])])]), i("div", Be, [i("div", Pe, O(r(a)("hr.timesheet.update.checkOut")), 1), i("div", je, [l(n, {
290
+ }, null, 8, ["modelValue", "label"]), l(w, {
295
291
  modelValue: I.value,
296
- "onUpdate:modelValue": e[2] || (e[2] = (o) => I.value = o),
292
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => I.value = o),
293
+ label: r(a)("hr.timesheet.update.time")
294
+ }, null, 8, ["modelValue", "label"])])]), i("div", Pe, [i("div", je, O(r(a)("hr.timesheet.update.checkOut")), 1), i("div", He, [l(n, {
295
+ modelValue: $.value,
296
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => $.value = o),
297
297
  disabled: !1,
298
298
  label: r(a)("hr.timesheet.update.date")
299
- }, null, 8, ["modelValue", "label"]), l(y, {
299
+ }, null, 8, ["modelValue", "label"]), l(w, {
300
300
  modelValue: E.value,
301
301
  "onUpdate:modelValue": e[3] || (e[3] = (o) => E.value = o),
302
302
  label: r(a)("hr.timesheet.update.time")
303
- }, null, 8, ["modelValue", "label"])])]), K.value ? (_(), P("div", He, [l(w, {
303
+ }, null, 8, ["modelValue", "label"])])]), K.value ? (_(), P("div", Ge, [l(y, {
304
304
  color: "#FF3B30",
305
305
  name: "error",
306
306
  size: "sm"
307
- }), he(" " + O(K.value), 1)])) : ve("", !0)])]),
307
+ }), he(" " + O(K.value), 1)])) : fe("", !0)])]),
308
308
  _: 1
309
- }, 8, ["modelValue", "header"]), i("div", qe, [i("div", Je, [l(De, {
309
+ }, 8, ["modelValue", "header"]), i("div", Je, [i("div", Qe, [l(De, {
310
310
  modelValue: A.value,
311
311
  "onUpdate:modelValue": e[6] || (e[6] = (o) => A.value = o),
312
312
  multiple: "",
@@ -315,7 +315,7 @@ const Ie = {
315
315
  "selected-prefix": r(a)("hr.role.columns.restaurants"),
316
316
  placeholder: r(a)("hr.role.columns.restaurants"),
317
317
  class: "!w-auto pt-[3px]"
318
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", Qe, [l(ie, {
318
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", We, [l(ie, {
319
319
  modelValue: r(M),
320
320
  "onUpdate:modelValue": e[7] || (e[7] = (o) => ge(M) ? M.value = o : null),
321
321
  "show-predefined-range": ""
@@ -339,10 +339,10 @@ const Ie = {
339
339
  label: b.value,
340
340
  "right-icon": "keyboard_arrow_down"
341
341
  }, null, 8, ["label"])]),
342
- default: Y(() => [(_(), P(te, null, ye(k, (o) => l(ue, {
342
+ default: Y(() => [(_(), P(te, null, we(k, (o) => l(ue, {
343
343
  key: o.value,
344
344
  label: o.label,
345
- onClick: (Z) => v.value = o.value
345
+ onClick: (Z) => f.value = o.value
346
346
  }, null, 8, ["label", "onClick"])), 64))]),
347
347
  _: 1
348
348
  }), l(ce), l(me, {
@@ -350,15 +350,15 @@ const Ie = {
350
350
  "onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
351
351
  class: "w-[320px]",
352
352
  placeholder: r(a)("hr.timesheet.search.placeholder")
353
- }, null, 8, ["modelValue", "placeholder"])]), N.value.length === 0 && !L.value ? (_(), z(r(ke), {
353
+ }, null, 8, ["modelValue", "placeholder"])]), N.value.length === 0 && !L.value ? (_(), z(r(Ve), {
354
354
  key: 0,
355
355
  title: r(a)("hr.timesheet.noData.title"),
356
356
  subtitle: ""
357
- }, null, 8, ["title"])) : (_(), z(Se, {
357
+ }, null, 8, ["title"])) : (_(), z(ke, {
358
358
  key: 1,
359
359
  class: "w-full xs:px-16 overflow-auto"
360
360
  }, {
361
- default: Y(() => [v.value === "listView" ? (_(), z(X, {
361
+ default: Y(() => [f.value === "listView" ? (_(), z(X, {
362
362
  key: 0,
363
363
  class: "min-w-[640px]",
364
364
  "column-defs": se,
@@ -371,13 +371,12 @@ const Ie = {
371
371
  onRowClick: e[11] || (e[11] = (o) => J(o.original))
372
372
  }, null, 8, ["row-data", "page-size", "loading"])) : (_(), z(X, {
373
373
  key: 1,
374
- class: "min-w-[640px]",
374
+ class: "min-w-[640px] timesheet-user-view",
375
375
  "column-defs": le,
376
376
  "row-data": G.value,
377
377
  "page-size": G.value.reduce((o, Z) => o + 1 + Z.timesheets.length, 0),
378
378
  loading: L.value,
379
379
  "pin-header-row": "",
380
- "hide-footer": "",
381
380
  "shrink-at": !1,
382
381
  "expanded-state": B.value,
383
382
  "get-sub-row": (o) => o.timesheets,
@@ -388,7 +387,7 @@ const Ie = {
388
387
  }))])], 64);
389
388
  };
390
389
  }
391
- });
390
+ }), ct = /* @__PURE__ */ Se(Xe, [["__scopeId", "data-v-d7ed31d7"]]);
392
391
  export {
393
- ut as default
392
+ ct as default
394
393
  };
@@ -1,7 +1,7 @@
1
- import { d as i } from "./dayjs.min-Dn0iKqwG.js";
1
+ import { d as i } from "./dayjs.min-Cs7Dz0qO.js";
2
2
  import { defineStore as p, storeToRefs as T } from "pinia";
3
3
  import { ref as l } from "vue";
4
- import { b as c, g as y, s as S } from "./iteration-iN8h5bwW.js";
4
+ import { b as c, g as y, s as S } from "./iteration-dOodV1U7.js";
5
5
  import { i as f, f as g } from "./utils-BZkjJbju.js";
6
6
  const u = {
7
7
  async readTimesheets(t, e) {