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