@feedmepos/mf-hrm-portal 2.1.1-dev → 2.1.1-dev.3

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 (83) hide show
  1. package/dist/ApprovalCodeList-BH5sgVMU.js +638 -0
  2. package/dist/AuditLogList-Q4L5Te8O.js +1145 -0
  3. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  4. package/dist/EmployeeList-GtKmJZbf.js +899 -0
  5. package/dist/GrantUserList-CnLjOi5_.js +468 -0
  6. package/dist/Main-Cn7Dawg4.js +120 -0
  7. package/dist/{Main-mTxcltDY.js → Main-DLlpEU3j.js} +11 -9
  8. package/dist/{Main-BLRr_ORG.js → Main-cskEZ3k_.js} +1033 -1035
  9. package/dist/PermissionSetList-C2fK2pTz.js +357 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js +3458 -0
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-Czo3FLbc.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +1 -2
  12. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
  13. package/dist/RoleList-CcuT1ERb.js +567 -0
  14. package/dist/TeamMemberList-Dfs2iNdC.js +1131 -0
  15. package/dist/{TimesheetList-D21j4zLV.js → TimesheetList-B1H_6zfP.js} +136 -141
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CRmmIfTk.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js} +14 -13
  17. package/dist/{app-CX-St7pv.js → app-DX-PG6wx.js} +2725 -5281
  18. package/dist/app.js +1 -1
  19. package/dist/approval-code-Q4666xp5.js +58 -0
  20. package/dist/{dayjs.min-MDoe5X-P.js → dayjs.min-BJrHE7oz.js} +1 -1
  21. package/dist/{employee-B2cdx2t4.js → employee-BJcqtqLM.js} +27 -26
  22. package/dist/grant-user-CQZaTzVt.js +67 -0
  23. package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
  24. package/dist/iteration-Cfaqt-0s.js +7682 -0
  25. package/dist/{lodash-DZAGPZLQ.js → lodash-ClKqCmlZ.js} +1 -1
  26. package/dist/restaurant-YOVMuuFY.js +1876 -0
  27. package/dist/role-CR_-nBDY.js +82 -0
  28. package/dist/rule-BB-3S-2R.js +996 -0
  29. package/dist/src/api/approval-code/index.d.ts +7 -0
  30. package/dist/src/api/audit-log/index.d.ts +0 -6
  31. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  32. package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
  33. package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
  34. package/dist/src/composables/useBasePermission.d.ts +1 -2
  35. package/dist/src/helpers/permission-set.d.ts +4 -8
  36. package/dist/src/helpers/rule.d.ts +1 -2
  37. package/dist/src/router/shared.d.ts +3 -1
  38. package/dist/src/stores/approval-code.d.ts +140 -0
  39. package/dist/src/stores/permission-set.d.ts +3 -12
  40. package/dist/src/types/approval-code.d.ts +99 -0
  41. package/dist/src/types/audit-log.d.ts +1 -1
  42. package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
  43. package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +17 -0
  44. package/dist/src/views/approval-code/locales/index.d.ts +320 -0
  45. package/dist/src/views/audit-log/locales/index.d.ts +0 -296
  46. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
  47. package/dist/src/views/pos-access/locales/index.d.ts +48 -0
  48. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
  49. package/dist/src/views/team/locales/index.d.ts +0 -72
  50. package/dist/style.css +1 -1
  51. package/dist/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/useAppStore-DNTlIeMv.js +93 -0
  53. package/dist/useDebounce-CWb5QR9G.js +28 -0
  54. package/dist/{useLoading-qgSjOzRD.js → useLoading-BH02lYns.js} +1 -1
  55. package/dist/{useReportPermissions-CIhkjN3B.js → useReportPermissions-ybHA26cJ.js} +3 -3
  56. package/package.json +2 -2
  57. package/dist/AuditLogList-Cvp-5_0y.js +0 -1608
  58. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-Cb8-YaiH.js +0 -387
  59. package/dist/EmployeeList-DgrD3Hjm.js +0 -884
  60. package/dist/Main-G3am-0Xi.js +0 -577
  61. package/dist/PermissionSetList-OzyfE-Yg.js +0 -392
  62. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ca2NnAAF.js +0 -4121
  63. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
  64. package/dist/RoleList-DOZ5RJ6A.js +0 -684
  65. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
  66. package/dist/TeamMemberList-CAqLUyQK.js +0 -1186
  67. package/dist/iteration-B38iapI_.js +0 -9556
  68. package/dist/rule-DftQBR76.js +0 -1057
  69. package/dist/src/composables/useConditionDraft.d.ts +0 -40
  70. package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
  71. package/dist/src/helpers/business-timezone.d.ts +0 -22
  72. package/dist/src/helpers/filter.d.ts +0 -15
  73. package/dist/src/helpers/permission-reconcile.d.ts +0 -15
  74. package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
  75. package/dist/src/views/audit-log/event-line.d.ts +0 -13
  76. package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
  77. package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
  78. package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
  79. package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
  80. package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
  81. package/dist/useAppStore-BBsP5C3E.js +0 -169
  82. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  83. /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
@@ -1,41 +1,42 @@
1
- import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as E, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as b, createCommentVNode as ve, toDisplayString as O, createTextVNode as he, isRef as ge, renderList as we, createBlock as te, nextTick as ye } from "vue";
2
- import { d as v } from "./dayjs.min-MDoe5X-P.js";
3
- import { useI18n as _e } from "@feedmepos/mf-common";
4
- import { useSnackbar as be, components as xe } from "@feedmepos/ui-library";
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 we, nextTick as ye } from "vue";
2
+ import { d as f } from "./dayjs.min-BJrHE7oz.js";
3
+ import { useI18n as be } from "@feedmepos/mf-common";
4
+ import { useSnackbar as _e, components as xe } from "@feedmepos/ui-library";
5
5
  import { S as De, _ as Se } from "./SelectFilter-ATOm0hdn.js";
6
- import { _ as Ve } from "./app-CX-St7pv.js";
7
- import { _ as ke } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js";
8
- import { u as Ce } from "./useLoading-qgSjOzRD.js";
9
- import { u as Fe, c as Ye, s as Le } from "./iteration-B38iapI_.js";
10
- import { f as Me } from "./utils-BZkjJbju.js";
11
- import { u as Te } from "./employee-B2cdx2t4.js";
12
- import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CRmmIfTk.js";
6
+ import { _ as ke } from "./app-DX-PG6wx.js";
7
+ import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
8
+ import { u as Ce } from "./useLoading-BH02lYns.js";
9
+ import { g as Fe, s as Ye } from "./iteration-Cfaqt-0s.js";
10
+ import { f as Le } from "./utils-BZkjJbju.js";
11
+ import { u as Me } from "./employee-BJcqtqLM.js";
12
+ import { u as Te } from "./restaurant-YOVMuuFY.js";
13
+ import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js";
13
14
  function Ie(x, a) {
14
15
  return ["years", "months"].find((S) => {
15
- const V = x.startOf(S), m = x.endOf(S);
16
- return x.isSame(V, "day") && a.isSame(m, "day");
16
+ const k = x.startOf(S), v = x.endOf(S);
17
+ return x.isSame(k, "day") && a.isSame(v, "day");
17
18
  }) || "days";
18
19
  }
19
20
  function $e() {
20
21
  const x = {
21
- startDate: v().format("YYYY-MM-DD"),
22
- endDate: v().format("YYYY-MM-DD")
22
+ startDate: f().format("YYYY-MM-DD"),
23
+ endDate: f().format("YYYY-MM-DD")
23
24
  }, a = d(x), D = g(() => {
24
25
  if (!a.value) return "No dates selected.";
25
- const m = a.value.startDate ?? "Start", _ = a.value.endDate ?? "End";
26
- return `${m} - ${_}`;
26
+ const v = a.value.startDate ?? "Start", b = a.value.endDate ?? "End";
27
+ return `${v} - ${b}`;
27
28
  }), S = g(() => ({
28
29
  startDate: new Date(a.value.startDate),
29
30
  endDate: new Date(a.value.endDate)
30
31
  }));
31
- function V(m) {
32
- const _ = v(a.value.startDate), c = v(a.value.endDate), h = Ie(_, c), k = h === "days" ? c.diff(_, "days") + 1 : 1, C = m === "subtract" ? (F) => F.subtract(k, h) : (F) => F.add(k, h);
32
+ function k(v) {
33
+ const b = f(a.value.startDate), c = f(a.value.endDate), h = Ie(b, c), V = h === "days" ? c.diff(b, "days") + 1 : 1, C = v === "subtract" ? (F) => F.subtract(V, h) : (F) => F.add(V, h);
33
34
  a.value = {
34
- startDate: C(_).startOf(h).format("YYYY-MM-DD"),
35
+ startDate: C(b).startOf(h).format("YYYY-MM-DD"),
35
36
  endDate: C(c).endOf(h).format("YYYY-MM-DD")
36
37
  };
37
38
  }
38
- return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: V };
39
+ return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: k };
39
40
  }
40
41
  const Ee = {
41
42
  class: "my-16 flex w-[350px] flex-col gap-40"
@@ -70,59 +71,57 @@ const Ee = {
70
71
  class: "flex items-start gap-8 flex-wrap xs:px-16"
71
72
  }, We = {
72
73
  class: "flex items-center gap-8"
73
- }, Xe = {
74
- class: "flex h-full flex-col overflow-auto"
75
- }, Ze = /* @__PURE__ */ pe({
74
+ }, Xe = /* @__PURE__ */ pe({
76
75
  __name: "TimesheetList",
77
76
  setup(x) {
78
77
  const {
79
78
  t: a
80
- } = _e(), D = be(), S = Ce(D), V = [{
79
+ } = be(), D = _e(), S = Ce(D), k = [{
81
80
  label: a("hr.timesheet.listView"),
82
81
  value: "listView"
83
82
  }, {
84
83
  label: a("hr.timesheet.userView"),
85
84
  value: "userView"
86
- }], m = d("listView"), _ = g(() => {
85
+ }], v = d("listView"), b = g(() => {
87
86
  var t;
88
- return (t = V.find((e) => e.value === m.value)) == null ? void 0 : t.label;
89
- }), c = d(""), h = Re(), k = Te(), C = Fe(), F = g(() => k.employees.value), j = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
87
+ return (t = k.find((e) => e.value === v.value)) == null ? void 0 : t.label;
88
+ }), c = d(""), h = Re(), V = Me(), C = Te(), F = g(() => V.employees.value), N = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
90
89
  var y;
91
- const r = (y = C.restaurants.value.find((f) => f._id === s.restaurantId)) == null ? void 0 : y.profile.code, w = F.value.find((f) => f._id === s.user.id);
90
+ 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);
92
91
  return {
93
92
  ...s,
94
- restaurantCode: r,
93
+ restaurantCode: n,
95
94
  user: {
96
95
  ...s.user,
97
96
  code: w ? w.code : ""
98
97
  }
99
98
  };
100
- })), z = g(() => j.value.filter((t) => {
99
+ })), j = g(() => N.value.filter((t) => {
101
100
  var e, s;
102
101
  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()));
103
102
  })), H = g(() => {
104
- const t = Ye(j.value, (s) => s.user.name), e = Object.entries(t).map(([s, r]) => {
105
- const w = F.value.find((y) => y._id === r[0].user.id);
103
+ const t = Fe(N.value, (s) => s.user.name), e = Object.entries(t).map(([s, n]) => {
104
+ const w = F.value.find((y) => y._id === n[0].user.id);
106
105
  return {
107
106
  key: s,
108
- user: r[0].user.name,
109
- code: w ? w.code : r[0].user.code || "",
110
- timesheets: r,
111
- total: Me(r.reduce((y, f) => y + f.totalMin, 0))
107
+ user: n[0].user.name,
108
+ code: w ? w.code : n[0].user.code || "",
109
+ timesheets: n,
110
+ total: Le(n.reduce((y, p) => y + p.totalMin, 0))
112
111
  };
113
112
  });
114
- return Le(e, {
113
+ return Ye(e, {
115
114
  selector: "user"
116
115
  });
117
- }), N = g(() => H.value.filter((t) => {
116
+ }), G = g(() => H.value.filter((t) => {
118
117
  var e;
119
118
  return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
120
- })), Y = d(!1), U = async () => {
119
+ })), L = d(!1), U = async () => {
121
120
  const {
122
121
  startDate: t,
123
122
  endDate: e
124
- } = L.value;
125
- Y.value = !0;
123
+ } = M.value;
124
+ L.value = !0;
126
125
  try {
127
126
  await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
128
127
  } catch (s) {
@@ -131,12 +130,12 @@ const Ee = {
131
130
  type: "error"
132
131
  });
133
132
  } finally {
134
- Y.value = !1;
133
+ L.value = !1;
135
134
  }
136
135
  };
137
136
  fe(async () => {
138
137
  try {
139
- await C.readRestaurants(), k.employees.value.length === 0 && await k.readEmployees();
138
+ await C.readRestaurants(), V.employees.value.length === 0 && await V.readEmployees();
140
139
  } catch (t) {
141
140
  console.error("Failed to load timesheet dependencies:", t), D.open({
142
141
  message: t instanceof Error ? t.message : String(t),
@@ -149,11 +148,11 @@ const Ee = {
149
148
  label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
150
149
  value: t._id
151
150
  }))), {
152
- dateRange: L,
151
+ dateRange: M,
153
152
  dateRangeLabel: oe,
154
- setRange: G
153
+ setRange: q
155
154
  } = $e();
156
- Z(L, async () => {
155
+ ee(M, async () => {
157
156
  U();
158
157
  });
159
158
  const se = [{
@@ -207,8 +206,8 @@ const Ee = {
207
206
  return l("div", {
208
207
  class: "flex items-center gap-8"
209
208
  }, [l("div", {
210
- onClick: (r) => {
211
- r.stopPropagation(), t.row.getToggleExpandedHandler()(r);
209
+ onClick: (n) => {
210
+ n.stopPropagation(), t.row.getToggleExpandedHandler()(n);
212
211
  }
213
212
  }, [l(xe.FmButton, {
214
213
  variant: "tertiary",
@@ -242,67 +241,67 @@ const Ee = {
242
241
  return e.total ? `Total: ${e.total}` : e.duration;
243
242
  },
244
243
  enableSorting: !1
245
- }], M = d(!1);
246
- function q(t) {
247
- p.value = t, T.value = v(p.value.startedAt).format("YYYY-MM-DD"), I.value = v(p.value.endedAt || p.value.startedAt).format("YYYY-MM-DD"), R.value = v(p.value.startedAt).format("HH:mm"), $.value = v(p.value.endedAt || p.value.startedAt).format("HH:mm"), M.value = !0;
244
+ }], T = d(!1);
245
+ function J(t) {
246
+ m.value = t, R.value = f(m.value.startedAt).format("YYYY-MM-DD"), $.value = f(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), I.value = f(m.value.startedAt).format("HH:mm"), E.value = f(m.value.endedAt || m.value.startedAt).format("HH:mm"), T.value = !0;
248
247
  }
249
- const T = d(), R = d(), I = d(), $ = d(), p = d(), K = d("");
250
- async function ne() {
251
- const t = J(T.value, R.value), e = J(I.value, $.value);
252
- if (v(t).isAfter(e)) {
248
+ const R = d(), I = d(), $ = d(), E = d(), m = d(), K = d("");
249
+ async function re() {
250
+ const t = Q(R.value, I.value), e = Q($.value, E.value);
251
+ if (f(t).isAfter(e)) {
253
252
  K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
254
253
  return;
255
254
  }
256
255
  S.minor(async () => {
257
- await h.updateTimesheet(p.value, t, e);
256
+ await h.updateTimesheet(m.value, t, e);
258
257
  }, {
259
258
  successMessage: a("hr.timesheet.update.successMessage")
260
- }), U(), M.value = !1;
259
+ }), U(), T.value = !1;
261
260
  }
262
- const J = (t, e) => v(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
263
- return Z([T, I, R, $], ([t, e, s, r]) => {
264
- (t || e || s || r) && (K.value = "");
261
+ const Q = (t, e) => f(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
262
+ return ee([R, $, I, E], ([t, e, s, n]) => {
263
+ (t || e || s || n) && (K.value = "");
265
264
  }), (t, e) => {
266
- const s = u("FmAvatar"), r = u("FmDatePicker"), w = u("FmTimePicker"), y = u("FmIcon"), f = u("FmButton"), re = u("FmSideSheet"), Q = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), W = u("FmTable");
267
- return E(), P(ee, null, [l(re, {
268
- modelValue: M.value,
269
- "onUpdate:modelValue": e[5] || (e[5] = (o) => M.value = o),
265
+ 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");
266
+ return _(), P(te, null, [l(ne, {
267
+ modelValue: T.value,
268
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => T.value = o),
270
269
  "dismiss-away": "",
271
- header: n(a)("hr.timesheet.update.title")
270
+ header: r(a)("hr.timesheet.update.title")
272
271
  }, {
273
- "side-sheet-footer": b(() => [i("div", qe, [l(f, {
274
- label: n(a)("common.update"),
272
+ "side-sheet-footer": Y(() => [i("div", qe, [l(p, {
273
+ label: r(a)("common.update"),
275
274
  size: "md",
276
275
  variant: "primary",
277
- onClick: ne
278
- }, null, 8, ["label"]), l(f, {
279
- label: n(a)("common.cancel"),
276
+ onClick: re
277
+ }, null, 8, ["label"]), l(p, {
278
+ label: r(a)("common.cancel"),
280
279
  size: "md",
281
280
  variant: "secondary",
282
- onClick: e[4] || (e[4] = (o) => M.value = !1)
281
+ onClick: e[4] || (e[4] = (o) => T.value = !1)
283
282
  }, null, 8, ["label"])])]),
284
- default: b(() => [i("div", Ee, [i("div", Oe, [l(s, {
285
- name: p.value.user.name,
283
+ default: Y(() => [i("div", Ee, [i("div", Oe, [l(s, {
284
+ name: m.value.user.name,
286
285
  size: "lg"
287
- }, null, 8, ["name"]), i("div", Ae, [i("div", Ke, O(n(a)("hr.timesheet.employeeName")), 1), i("div", ze, O(p.value.user.name), 1)])]), i("div", Ne, [i("div", Ue, O(n(a)("hr.timesheet.update.checkIn")), 1), i("div", Be, [l(r, {
288
- modelValue: T.value,
289
- "onUpdate:modelValue": e[0] || (e[0] = (o) => T.value = o),
286
+ }, null, 8, ["name"]), 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, {
287
+ modelValue: R.value,
288
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => R.value = o),
290
289
  disabled: !1,
291
- label: n(a)("hr.timesheet.update.date")
290
+ label: r(a)("hr.timesheet.update.date")
292
291
  }, null, 8, ["modelValue", "label"]), l(w, {
293
- modelValue: R.value,
294
- "onUpdate:modelValue": e[1] || (e[1] = (o) => R.value = o),
295
- label: n(a)("hr.timesheet.update.time")
296
- }, null, 8, ["modelValue", "label"])])]), i("div", Pe, [i("div", je, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", He, [l(r, {
297
292
  modelValue: I.value,
298
- "onUpdate:modelValue": e[2] || (e[2] = (o) => I.value = o),
293
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => I.value = o),
294
+ label: r(a)("hr.timesheet.update.time")
295
+ }, null, 8, ["modelValue", "label"])])]), i("div", Pe, [i("div", je, O(r(a)("hr.timesheet.update.checkOut")), 1), i("div", He, [l(n, {
296
+ modelValue: $.value,
297
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => $.value = o),
299
298
  disabled: !1,
300
- label: n(a)("hr.timesheet.update.date")
299
+ label: r(a)("hr.timesheet.update.date")
301
300
  }, null, 8, ["modelValue", "label"]), l(w, {
302
- modelValue: $.value,
303
- "onUpdate:modelValue": e[3] || (e[3] = (o) => $.value = o),
304
- label: n(a)("hr.timesheet.update.time")
305
- }, null, 8, ["modelValue", "label"])])]), K.value ? (E(), P("div", Ge, [l(y, {
301
+ modelValue: E.value,
302
+ "onUpdate:modelValue": e[3] || (e[3] = (o) => E.value = o),
303
+ label: r(a)("hr.timesheet.update.time")
304
+ }, null, 8, ["modelValue", "label"])])]), K.value ? (_(), P("div", Ge, [l(y, {
306
305
  color: "#FF3B30",
307
306
  name: "error",
308
307
  size: "sm"
@@ -314,86 +313,82 @@ const Ee = {
314
313
  multiple: "",
315
314
  items: ae.value,
316
315
  variant: "dark",
317
- "selected-prefix": n(a)("hr.role.columns.restaurants"),
318
- placeholder: n(a)("hr.role.columns.restaurants"),
316
+ "selected-prefix": r(a)("hr.role.columns.restaurants"),
317
+ placeholder: r(a)("hr.role.columns.restaurants"),
319
318
  class: "!w-auto pt-[3px]"
320
319
  }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", We, [l(ie, {
321
- modelValue: n(L),
322
- "onUpdate:modelValue": e[7] || (e[7] = (o) => ge(L) ? L.value = o : null),
320
+ modelValue: r(M),
321
+ "onUpdate:modelValue": e[7] || (e[7] = (o) => ge(M) ? M.value = o : null),
323
322
  "show-predefined-range": ""
324
323
  }, {
325
- "trigger-button": b(() => [l(Q, {
326
- label: n(oe)
324
+ "trigger-button": Y(() => [l(W, {
325
+ label: r(oe)
327
326
  }, null, 8, ["label"])]),
328
327
  _: 1
329
- }, 8, ["modelValue"]), l(f, {
328
+ }, 8, ["modelValue"]), l(p, {
330
329
  icon: "chevron_left",
331
330
  variant: "tertiary",
332
- onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
333
- }), l(f, {
331
+ onClick: e[8] || (e[8] = (o) => r(q)("subtract"))
332
+ }), l(p, {
334
333
  icon: "chevron_right",
335
334
  variant: "tertiary",
336
- onClick: e[9] || (e[9] = (o) => n(G)("add"))
335
+ onClick: e[9] || (e[9] = (o) => r(q)("add"))
337
336
  })]), l(de, {
338
337
  class: "pt-[3px]"
339
338
  }, {
340
- "menu-button": b(() => [l(Q, {
341
- label: _.value,
339
+ "menu-button": Y(() => [l(W, {
340
+ label: b.value,
342
341
  "right-icon": "keyboard_arrow_down"
343
342
  }, null, 8, ["label"])]),
344
- default: b(() => [(E(), P(ee, null, we(V, (o) => l(ue, {
343
+ default: Y(() => [(_(), P(te, null, we(k, (o) => l(ue, {
345
344
  key: o.value,
346
345
  label: o.label,
347
- onClick: (X) => m.value = o.value
346
+ onClick: (Z) => v.value = o.value
348
347
  }, null, 8, ["label", "onClick"])), 64))]),
349
348
  _: 1
350
349
  }), l(ce), l(me, {
351
350
  modelValue: c.value,
352
351
  "onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
353
352
  class: "w-[320px]",
354
- placeholder: n(a)("hr.timesheet.search.placeholder")
355
- }, null, 8, ["modelValue", "placeholder"])]), l(Ve, {
356
- class: "w-full xs:px-16"
353
+ placeholder: r(a)("hr.timesheet.search.placeholder")
354
+ }, null, 8, ["modelValue", "placeholder"])]), N.value.length === 0 && !L.value ? (_(), z(r(Ve), {
355
+ key: 0,
356
+ title: r(a)("hr.timesheet.noData.title"),
357
+ subtitle: ""
358
+ }, null, 8, ["title"])) : (_(), z(ke, {
359
+ key: 1,
360
+ class: "w-full xs:px-16 overflow-auto"
357
361
  }, {
358
- default: b(() => [i("div", Xe, [l(ke, {
359
- "is-loading": Y.value,
360
- "is-empty": m.value === "listView" ? z.value.length === 0 : N.value.length === 0,
361
- "collapse-at": !1,
362
- title: n(a)("hr.timesheet.noData.title"),
363
- subtitle: ""
364
- }, {
365
- default: b(() => [m.value === "listView" ? (E(), te(W, {
366
- key: 0,
367
- class: "min-w-[640px]",
368
- "column-defs": se,
369
- "row-data": z.value,
370
- "page-size": z.value.length,
371
- loading: Y.value,
372
- "pin-header-row": "",
373
- "hide-footer": "",
374
- "shrink-at": !1,
375
- onRowClick: e[11] || (e[11] = (o) => q(o.original))
376
- }, null, 8, ["row-data", "page-size", "loading"])) : (E(), te(W, {
377
- key: 1,
378
- class: "min-w-[640px] timesheet-user-view",
379
- "column-defs": le,
380
- "row-data": N.value,
381
- "page-size": N.value.reduce((o, X) => o + 1 + X.timesheets.length, 0),
382
- loading: Y.value,
383
- "pin-header-row": "",
384
- "shrink-at": !1,
385
- "expanded-state": B.value,
386
- "get-sub-row": (o) => o.timesheets,
387
- "onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
388
- onRowClick: e[13] || (e[13] = (o) => q(o.original))
389
- }, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
390
- _: 1
391
- }, 8, ["is-loading", "is-empty", "title"])])]),
362
+ default: Y(() => [v.value === "listView" ? (_(), z(X, {
363
+ key: 0,
364
+ class: "min-w-[640px]",
365
+ "column-defs": se,
366
+ "row-data": j.value,
367
+ "page-size": j.value.length,
368
+ loading: L.value,
369
+ "pin-header-row": "",
370
+ "hide-footer": "",
371
+ "shrink-at": !1,
372
+ onRowClick: e[11] || (e[11] = (o) => J(o.original))
373
+ }, null, 8, ["row-data", "page-size", "loading"])) : (_(), z(X, {
374
+ key: 1,
375
+ class: "min-w-[640px] timesheet-user-view",
376
+ "column-defs": le,
377
+ "row-data": G.value,
378
+ "page-size": G.value.reduce((o, Z) => o + 1 + Z.timesheets.length, 0),
379
+ loading: L.value,
380
+ "pin-header-row": "",
381
+ "shrink-at": !1,
382
+ "expanded-state": B.value,
383
+ "get-sub-row": (o) => o.timesheets,
384
+ "onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
385
+ onRowClick: e[13] || (e[13] = (o) => J(o.original))
386
+ }, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
392
387
  _: 1
393
- })])], 64);
388
+ }))])], 64);
394
389
  };
395
390
  }
396
- }), mt = /* @__PURE__ */ Se(Ze, [["__scopeId", "data-v-2c7a177a"]]);
391
+ }), mt = /* @__PURE__ */ Se(Xe, [["__scopeId", "data-v-91afda4e"]]);
397
392
  export {
398
393
  mt as default
399
394
  };
@@ -1,7 +1,8 @@
1
- import { d as i } from "./dayjs.min-MDoe5X-P.js";
1
+ import { d as i } from "./dayjs.min-BJrHE7oz.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-B38iapI_.js";
4
+ import { b as c, g as y } from "./restaurant-YOVMuuFY.js";
5
+ import { s as S } from "./iteration-Cfaqt-0s.js";
5
6
  import { i as f, f as g } from "./utils-BZkjJbju.js";
6
7
  const u = {
7
8
  async readTimesheets(t, e) {
@@ -13,10 +14,10 @@ const u = {
13
14
  };
14
15
  function A(t) {
15
16
  const e = t.map((n) => {
16
- const { startedAt: s, endedAt: a } = n, r = i(f(s)), o = a ? i(f(a)) : null, m = (o == null ? void 0 : o.diff(r, "minute", !1)) || 0, h = o ? g(m) : "", d = "YYYY-MM-DD hh:mm a";
17
+ const { startedAt: s, endedAt: r } = n, a = i(f(s)), o = r ? i(f(r)) : null, m = (o == null ? void 0 : o.diff(a, "minute", !1)) || 0, h = o ? g(m) : "", d = "YYYY-MM-DD hh:mm a";
17
18
  return {
18
19
  ...n,
19
- start: r.format(d),
20
+ start: a.format(d),
20
21
  end: o ? o.format(d) : "",
21
22
  totalMin: m,
22
23
  duration: h
@@ -26,18 +27,18 @@ function A(t) {
26
27
  }
27
28
  const D = p("timesheet", () => {
28
29
  const t = l([]);
29
- async function e(s, a) {
30
- const r = await u.readTimesheets(
30
+ async function e(s, r) {
31
+ const a = await u.readTimesheets(
31
32
  i(s).startOf("day").toISOString(),
32
- i(a).endOf("day").toISOString()
33
+ i(r).endOf("day").toISOString()
33
34
  );
34
- t.value = A(r);
35
+ t.value = A(a);
35
36
  }
36
- async function n(s, a, r) {
37
+ async function n(s, r, a) {
37
38
  await u.updateTimesheet(s.restaurantId, {
38
39
  id: s._id,
39
- startAt: a,
40
- endAt: r
40
+ startAt: r,
41
+ endAt: a
41
42
  });
42
43
  }
43
44
  return {
@@ -45,7 +46,7 @@ const D = p("timesheet", () => {
45
46
  readTimesheet: e,
46
47
  updateTimesheet: n
47
48
  };
48
- }), $ = () => {
49
+ }), b = () => {
49
50
  const t = D();
50
51
  return {
51
52
  ...t,
@@ -53,5 +54,5 @@ const D = p("timesheet", () => {
53
54
  };
54
55
  };
55
56
  export {
56
- $ as u
57
+ b as u
57
58
  };