@feedmepos/mf-hrm-portal 2.2.1-dev.2 → 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 (42) hide show
  1. package/dist/{ApprovalCodeList-DZajn7xx.js → ApprovalCodeList-rL8dh-6s.js} +5 -5
  2. package/dist/{AuditLogList-CpKIq8I0.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-DDuxDdlJ.js → EmployeeList-C3VvVY6A.js} +6 -6
  5. package/dist/{GrantUserList-735upmIE.js → GrantUserList-DjZ4O0VB.js} +6 -6
  6. package/dist/{Main-DyZ6dJ2d.js → Main-ByWrRV70.js} +8 -8
  7. package/dist/{Main-tQ6MrkkP.js → Main-DVTx58X9.js} +11 -11
  8. package/dist/{Main-CHHR0r5b.js → Main-LaAbAOfs.js} +5 -5
  9. package/dist/{PermissionSetList-ZxLNYPEB.js → PermissionSetList-DD45SSY3.js} +7 -7
  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-B58boeR9.js → TeamMemberList-DrLbMN34.js} +9 -9
  14. package/dist/{TimesheetList-DMnNVVlB.js → TimesheetList-CdaxlO97.js} +7 -7
  15. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Ch8Ng6wi.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-ogjfztLs.js} +3 -3
  16. package/dist/{app-CtuaUGnw.js → app-B8eo04d6.js} +6 -6
  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-9pRWRTS9.js → dayjs.min-DZEHW2QB.js} +1 -1
  20. package/dist/{employee-JmfN-rQF.js → employee-DX0CZF-B.js} +4 -4
  21. package/dist/{grant-user-CQZaTzVt.js → grant-user-SNiDV22U.js} +1 -1
  22. package/dist/{iteration-CkzTvtOv.js → iteration-yBS4dpFh.js} +1 -1
  23. package/dist/{lodash-BNBzabCH.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/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/{useAppStore-DNTlIeMv.js → useAppStore-DCwd8GWN.js} +1 -1
  34. package/dist/{useLoading-BH02lYns.js → useLoading-CXzTpIVv.js} +1 -1
  35. package/dist/useReportPermissions-C0exkIxU.js +71 -0
  36. package/package.json +1 -1
  37. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-DCfvikJB.js +0 -387
  38. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-MoFevdmL.js +0 -4122
  39. package/dist/RoleList-BZbEGpCi.js +0 -685
  40. package/dist/role-R_9sO2QD.js +0 -82
  41. package/dist/rule-D1pKbnKR.js +0 -1066
  42. package/dist/useReportPermissions-ByxRc3kz.js +0 -70
@@ -3,18 +3,18 @@ import { useI18n as Pe, useCoreStore as Ae, baseClientInstance as Ke } from "@fe
3
3
  import { useSnackbar as He, useDialog as es, useBreakpoints as ss, components as je } from "@feedmepos/ui-library";
4
4
  import { u as fs } from "./useDebounce-B8ZPVS5C.js";
5
5
  import { _ as vs, S as ye } from "./SelectFilter-ATOm0hdn.js";
6
- import { b as ze, m as bs, d as hs, _ as ys, a as _s } from "./app-CtuaUGnw.js";
6
+ import { b as ze, m as bs, d as hs, _ as ys, a as _s } from "./app-B8eo04d6.js";
7
7
  import { u as gs, _ as xs } from "./useDiscardConfirm-DPhEV6v0.js";
8
8
  import { _ as Us } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
9
9
  import { _ as Ss } from "./Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js";
10
- import { u as Fs } from "./useLoading-BH02lYns.js";
11
- import { l as Se } from "./lodash-BNBzabCH.js";
12
- import { c as he } from "./iteration-CkzTvtOv.js";
13
- import { u as ts, c as Le, d as Ge, m as Me, i as as, p as We, j as Vs, k as Je, l as Xe, s as ws, n as Is, o as Ps, q as ks, v as Rs, t as Fe } from "./rule-D1pKbnKR.js";
14
- import { u as ls } from "./role-R_9sO2QD.js";
15
- import { u as os, i as $s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js";
16
- import { g as Ze, u as rs } from "./restaurant-YOVMuuFY.js";
17
- import { _ as Cs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-MoFevdmL.js";
10
+ import { u as Fs } from "./useLoading-CXzTpIVv.js";
11
+ import { l as Se } from "./lodash-344d5Ope.js";
12
+ import { c as he } from "./iteration-yBS4dpFh.js";
13
+ import { u as ts, c as Le, d as Ge, m as Me, i as as, p as We, j as Vs, k as Je, l as Xe, n as ws, o as Is, q as Ps, v as ks, w as Rs, t as Fe } from "./rule-DWlFon04.js";
14
+ import { u as ls } from "./role-BXBuBxs5.js";
15
+ import { u as os, i as $s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js";
16
+ import { g as Ze, u as rs } from "./restaurant-BTpBmfBV.js";
17
+ import { _ as Cs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-yDPvNHiW.js";
18
18
  var ge = /* @__PURE__ */ ((i) => (i.Update = "Update", i.Remove = "Remove", i))(ge || {});
19
19
  const we = "__unassigned__";
20
20
  function Qe(i) {
@@ -1,16 +1,16 @@
1
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 r, 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-9pRWRTS9.js";
2
+ import { d as v } from "./dayjs.min-DZEHW2QB.js";
3
3
  import { useI18n as _e } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as be, 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-CtuaUGnw.js";
6
+ import { _ as Ve } from "./app-B8eo04d6.js";
7
7
  import { _ as ke } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { u as Ce } from "./useLoading-BH02lYns.js";
9
- import { g as Fe, s as Ye } from "./iteration-CkzTvtOv.js";
8
+ import { u as Ce } from "./useLoading-CXzTpIVv.js";
9
+ import { g as Fe, s as Ye } from "./iteration-yBS4dpFh.js";
10
10
  import { f as Le } from "./utils-BZkjJbju.js";
11
- import { u as Me } from "./employee-JmfN-rQF.js";
12
- import { u as Te } from "./restaurant-YOVMuuFY.js";
13
- import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Ch8Ng6wi.js";
11
+ import { u as Me } from "./employee-DX0CZF-B.js";
12
+ import { u as Te } from "./restaurant-BTpBmfBV.js";
13
+ import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-ogjfztLs.js";
14
14
  function Ie(x, a) {
15
15
  return ["years", "months"].find((S) => {
16
16
  const V = x.startOf(S), m = x.endOf(S);
@@ -1,8 +1,8 @@
1
- import { d as i } from "./dayjs.min-9pRWRTS9.js";
1
+ import { d as i } from "./dayjs.min-DZEHW2QB.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 } from "./restaurant-YOVMuuFY.js";
5
- import { s as S } from "./iteration-CkzTvtOv.js";
4
+ import { b as c, g as y } from "./restaurant-BTpBmfBV.js";
5
+ import { s as S } from "./iteration-yBS4dpFh.js";
6
6
  import { i as f, f as g } from "./utils-BZkjJbju.js";
7
7
  const u = {
8
8
  async readTimesheets(t, e) {
@@ -3785,12 +3785,12 @@ const Br = {
3785
3785
  refund: "ขอคืนเงิน",
3786
3786
  counter: "เคาน์เตอร์",
3787
3787
  mallIntegration: "การเชื่อมต่อกับห้างสรรพสินค้า",
3788
- drawer: "ลิ้นชัก",
3788
+ drawer: "ลิ้นชักเก็บเงิน",
3789
3789
  menu: "เมนู",
3790
3790
  inventory: "สินค้าคงคลัง",
3791
3791
  deposit: "เงินมัดจำ",
3792
3792
  delivery: "การจัดส่ง",
3793
- counterRecord: "บันทึกเคาน์เตอร์",
3793
+ counterRecord: "จัดการรอบการขาย",
3794
3794
  restaurantSetting: "การตั้งค่าร้านอาหาร",
3795
3795
  display: "จอแสดงผล",
3796
3796
  printer: "เครื่องพิมพ์",
@@ -8661,10 +8661,10 @@ const Et = (e) => ({
8661
8661
  }
8662
8662
  ]
8663
8663
  }
8664
- }), al = Kt(Be(() => import("./Main-tQ6MrkkP.js"))), ol = Kt(Be(() => import("./Main-DyZ6dJ2d.js"))), il = Kt(
8665
- Be(() => import("./AuditLogList-CpKIq8I0.js"))
8666
- ), cl = Kt(Be(() => import("./Main-CHHR0r5b.js"))), ll = Be(() => import("./ApprovalCodeList-DZajn7xx.js")), ul = Be(() => import("./GrantUserList-735upmIE.js")), Al = Be(() => import("./EmployeeList-DDuxDdlJ.js")), dl = Be(() => import("./RoleList-BZbEGpCi.js")), ml = Be(() => import("./TimesheetList-DMnNVVlB.js")), gl = Be(() => import("./TeamMemberList-B58boeR9.js")), pl = Be(
8667
- () => import("./PermissionSetList-ZxLNYPEB.js")
8664
+ }), al = Kt(Be(() => import("./Main-DVTx58X9.js"))), ol = Kt(Be(() => import("./Main-ByWrRV70.js"))), il = Kt(
8665
+ Be(() => import("./AuditLogList-NvISIfUq.js"))
8666
+ ), cl = Kt(Be(() => import("./Main-LaAbAOfs.js"))), ll = Be(() => import("./ApprovalCodeList-rL8dh-6s.js")), ul = Be(() => import("./GrantUserList-DjZ4O0VB.js")), Al = Be(() => import("./EmployeeList-C3VvVY6A.js")), dl = Be(() => import("./RoleList-BDxgwmAV.js")), ml = Be(() => import("./TimesheetList-CdaxlO97.js")), gl = Be(() => import("./TeamMemberList-DrLbMN34.js")), pl = Be(
8667
+ () => import("./PermissionSetList-DD45SSY3.js")
8668
8668
  ), Fl = [
8669
8669
  {
8670
8670
  path: "/",
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e, i as r, r as o } from "./app-CtuaUGnw.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-CtuaUGnw.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-9pRWRTS9.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-CkzTvtOv.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-R_9sO2QD.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-CtuaUGnw.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-CtuaUGnw.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
+ };