@feedmepos/mf-hrm-portal 2.2.1-dev → 2.2.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 (43) hide show
  1. package/dist/{ApprovalCodeList-BgPrC2H1.js → ApprovalCodeList-rL8dh-6s.js} +5 -5
  2. package/dist/{AuditLogList-B9k56ux1.js → AuditLogList-NvISIfUq.js} +4 -4
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BJgpH-kw.js +438 -0
  4. package/dist/{EmployeeList-f05XEwMS.js → EmployeeList-C3VvVY6A.js} +6 -6
  5. package/dist/{GrantUserList-Db4_e87R.js → GrantUserList-DjZ4O0VB.js} +6 -6
  6. package/dist/{Main-DPmBwatV.js → Main-ByWrRV70.js} +8 -8
  7. package/dist/{Main-C83-6ZYQ.js → Main-DVTx58X9.js} +11 -11
  8. package/dist/{Main-CZoUt9IM.js → Main-LaAbAOfs.js} +5 -5
  9. package/dist/{PermissionSetList-CqcbzdXp.js → PermissionSetList-DD45SSY3.js} +19 -19
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yDPvNHiW.js +4169 -0
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js} +1 -1
  12. package/dist/RoleList-BDxgwmAV.js +725 -0
  13. package/dist/{TeamMemberList-DuP1QWAS.js → TeamMemberList-DrLbMN34.js} +9 -9
  14. package/dist/{TimesheetList-D_Xq4ESR.js → TimesheetList-CdaxlO97.js} +7 -7
  15. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-O2_M0Ktw.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-ogjfztLs.js} +3 -3
  16. package/dist/{app-3bHRu-TD.js → app-B8eo04d6.js} +169 -158
  17. package/dist/app.js +1 -1
  18. package/dist/{approval-code-Q4666xp5.js → approval-code-jIjkeVEb.js} +1 -1
  19. package/dist/{dayjs.min-BjrK6J3b.js → dayjs.min-DZEHW2QB.js} +1 -1
  20. package/dist/{employee-Ck_DJyl9.js → employee-DX0CZF-B.js} +4 -4
  21. package/dist/{grant-user-CQZaTzVt.js → grant-user-SNiDV22U.js} +1 -1
  22. package/dist/{iteration-Bl07BT2c.js → iteration-yBS4dpFh.js} +1 -1
  23. package/dist/{lodash-CwAowwGK.js → lodash-344d5Ope.js} +1 -1
  24. package/dist/{restaurant-YOVMuuFY.js → restaurant-BTpBmfBV.js} +12 -14
  25. package/dist/role-BXBuBxs5.js +92 -0
  26. package/dist/rule-DWlFon04.js +1094 -0
  27. package/dist/src/composables/useReportPermissions.d.ts +1 -0
  28. package/dist/src/helpers/rule.d.ts +10 -1
  29. package/dist/src/stores/role.d.ts +6 -6
  30. package/dist/src/views/team/components/PortalConditionForm.vue.d.ts +44 -0
  31. package/dist/src/views/team/condition-builders/ConditionBuilderForm.vue.d.ts +39 -0
  32. package/dist/src/views/team/locales/index.d.ts +4 -0
  33. package/dist/tsconfig.app.tsbuildinfo +1 -1
  34. package/dist/{useAppStore-DNTlIeMv.js → useAppStore-DCwd8GWN.js} +1 -1
  35. package/dist/{useLoading-BH02lYns.js → useLoading-CXzTpIVv.js} +1 -1
  36. package/dist/useReportPermissions-C0exkIxU.js +71 -0
  37. package/package.json +2 -2
  38. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-BKxQPhjZ.js +0 -387
  39. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DMS04nsd.js +0 -4122
  40. package/dist/RoleList-DsINcxpz.js +0 -685
  41. package/dist/role-Z1BT4HFT.js +0 -82
  42. package/dist/rule-DYmHm3nE.js +0 -1066
  43. package/dist/useReportPermissions-DCF1U1Us.js +0 -70
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e, i as r, r as o } from "./app-3bHRu-TD.js";
1
+ import { j as e, i as r, r as o } from "./app-B8eo04d6.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,
@@ -1,6 +1,6 @@
1
1
  import { defineStore as C } from "pinia";
2
2
  import { ref as l } from "vue";
3
- import { g as p, b as s } from "./restaurant-YOVMuuFY.js";
3
+ import { g as p, b as s } from "./restaurant-BTpBmfBV.js";
4
4
  const n = {
5
5
  async getApprovalCodes() {
6
6
  return p(await s("approval-codes").get(""));
@@ -1,4 +1,4 @@
1
- import { g as Q, c as K } from "./app-3bHRu-TD.js";
1
+ import { g as Q, c as K } from "./app-B8eo04d6.js";
2
2
  var E = { exports: {} };
3
3
  (function(V, X) {
4
4
  (function(W, k) {
@@ -1,10 +1,10 @@
1
- import { d as g } from "./dayjs.min-BjrK6J3b.js";
1
+ import { d as g } from "./dayjs.min-DZEHW2QB.js";
2
2
  import { defineStore as $, storeToRefs as T } from "pinia";
3
3
  import { ref as m } from "vue";
4
- import { s as E } from "./iteration-Bl07BT2c.js";
5
- import { b as i, g as f, u as w } from "./restaurant-YOVMuuFY.js";
4
+ import { s as E } from "./iteration-yBS4dpFh.js";
5
+ import { b as i, g as f, u as w } from "./restaurant-BTpBmfBV.js";
6
6
  import { i as v } from "./utils-BZkjJbju.js";
7
- import { u as _ } from "./role-Z1BT4HFT.js";
7
+ import { u as _ } from "./role-BXBuBxs5.js";
8
8
  const o = {
9
9
  async readEmployees() {
10
10
  return f(await i().get("/pos-users"));
@@ -1,6 +1,6 @@
1
1
  import { defineStore as f } from "pinia";
2
2
  import { ref as u } from "vue";
3
- import { g as s, a as v, b as o } from "./restaurant-YOVMuuFY.js";
3
+ import { g as s, a as v, b as o } from "./restaurant-BTpBmfBV.js";
4
4
  const c = {
5
5
  async getGrantUsers() {
6
6
  return s(await o("grant").get(""));
@@ -1,4 +1,4 @@
1
- import { c as B } from "./app-3bHRu-TD.js";
1
+ import { c as B } from "./app-B8eo04d6.js";
2
2
  var ma = {}, Zt = {}, l = {}, ji = {}, Ei = {}, Ii = {}, Dn = {};
3
3
  (function(e) {
4
4
  Object.defineProperty(e, "__esModule", { value: !0 }), e.getParsedType = e.ZodParsedType = e.util = void 0;
@@ -1,4 +1,4 @@
1
- import { c as jt } from "./app-3bHRu-TD.js";
1
+ import { c as jt } from "./app-B8eo04d6.js";
2
2
  var Jr = { exports: {} };
3
3
  /**
4
4
  * @license
@@ -1833,24 +1833,22 @@ const nr = {
1833
1833
  const { currentBusiness: e } = re(), t = fe([]), n = fe(!1), r = fe(null);
1834
1834
  let s = null, o = null;
1835
1835
  async function i(c = !1) {
1836
- var l, u;
1837
- const f = ((l = e.value) == null ? void 0 : l._id) ?? ((u = e.value) == null ? void 0 : u.id) ?? null;
1836
+ var u, h;
1837
+ const f = ((u = e.value) == null ? void 0 : u._id) ?? ((h = e.value) == null ? void 0 : h.id) ?? null;
1838
1838
  if (!f) {
1839
1839
  t.value = [], r.value = null, s = null, o = null;
1840
1840
  return;
1841
1841
  }
1842
- if (r.value !== f && (t.value = [], r.value = null, s = null, o = null), !(!c && r.value === f)) {
1843
- if (!c && s && o === f)
1844
- return await s;
1845
- try {
1846
- n.value = !0;
1847
- const h = (async () => {
1848
- t.value = await nr.readRestaurants(), r.value = f;
1849
- })();
1850
- s = h, o = f, await h;
1851
- } finally {
1852
- s = null, o = null, n.value = !1;
1853
- }
1842
+ if (r.value && r.value !== f && (t.value = [], r.value = null), o && o !== f && (s = null, o = null), !c && r.value === f) return;
1843
+ if (!c && s && o === f)
1844
+ return await s;
1845
+ let l = null;
1846
+ try {
1847
+ n.value = !0, l = (async () => {
1848
+ t.value = await nr.readRestaurants(), r.value = f;
1849
+ })(), s = l, o = f, await l;
1850
+ } finally {
1851
+ s === l && (s = null, o = null), n.value = !1;
1854
1852
  }
1855
1853
  }
1856
1854
  return {
@@ -0,0 +1,92 @@
1
+ import { defineStore as x, storeToRefs as b } from "pinia";
2
+ import { ref as w } from "vue";
3
+ import { useCoreStore as B } from "@feedmepos/mf-common";
4
+ import { s as v } from "./iteration-yBS4dpFh.js";
5
+ import { g as f, b as p, u as I } from "./restaurant-BTpBmfBV.js";
6
+ const R = {
7
+ async readRoles() {
8
+ return f(await p().get("/pos-roles"));
9
+ },
10
+ async createRole(e) {
11
+ return f(await p().post("/pos-roles", e));
12
+ },
13
+ async updateRole(e, c) {
14
+ return f(await p().put(`/pos-roles/${e}`, c));
15
+ },
16
+ async deleteRole(e) {
17
+ return f(
18
+ await p().put(`/pos-roles/${e._id}`, {
19
+ restaurantIds: [],
20
+ role: e
21
+ })
22
+ );
23
+ }
24
+ };
25
+ async function m(e) {
26
+ const { restaurants: c } = I(), u = e.reduce((n, a) => {
27
+ var d;
28
+ const s = n.findIndex((o) => o._id === a._id), r = {
29
+ id: a.restaurantId,
30
+ name: ((d = c.value.find((o) => o._id === a.restaurantId)) == null ? void 0 : d.profile.name) || ""
31
+ };
32
+ return s < 0 ? n.push({
33
+ ...a,
34
+ restaurants: [r]
35
+ }) : n[s].restaurants.some((o) => o.id === a.restaurantId) || (n[s].restaurants = v([...n[s].restaurants, r], { selector: "name" })), n;
36
+ }, []);
37
+ return v(u, { selector: "name" });
38
+ }
39
+ const A = x("role", () => {
40
+ const { currentBusiness: e } = B(), c = I(), u = w([]), n = w(!1), a = w(null);
41
+ let s = null, r = null;
42
+ async function d(l = !1) {
43
+ var y;
44
+ const t = ((y = e.value) == null ? void 0 : y._id) ?? null;
45
+ if (!t) {
46
+ u.value = [], a.value = null, s = null, r = null;
47
+ return;
48
+ }
49
+ if (a.value && a.value !== t && (u.value = [], a.value = null), r && r !== t && (s = null, r = null), !l && a.value === t) return;
50
+ if (!l && s && r === t)
51
+ return await s;
52
+ let i = null;
53
+ try {
54
+ n.value = !0, i = (async () => {
55
+ await c.readRestaurants();
56
+ const _ = await R.readRoles();
57
+ u.value = await m(_), a.value = t;
58
+ })(), s = i, r = t, await i;
59
+ } finally {
60
+ s === i && (s = null, r = null), n.value = !1;
61
+ }
62
+ }
63
+ async function o(l) {
64
+ const t = await R.createRole(l);
65
+ u.value = await m(t);
66
+ }
67
+ async function g(l, t) {
68
+ const i = await R.updateRole(l, t);
69
+ u.value = await m(i);
70
+ }
71
+ async function S(l) {
72
+ const t = await R.deleteRole(l);
73
+ u.value = await m(t);
74
+ }
75
+ return {
76
+ roles: u,
77
+ isLoading: n,
78
+ readRoles: d,
79
+ createRole: o,
80
+ updateRole: g,
81
+ deleteRole: S
82
+ };
83
+ }), L = () => {
84
+ const e = A();
85
+ return {
86
+ ...e,
87
+ ...b(e)
88
+ };
89
+ };
90
+ export {
91
+ L as u
92
+ };