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