@feedmepos/mf-hrm-portal 2.3.2-dev.5 → 2.3.2-dev.6

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 (52) hide show
  1. package/dist/{ApprovalCodeList-NYJNwdDZ.js → ApprovalCodeList-ix9OeJEQ.js} +7 -7
  2. package/dist/{AuditLogList-Ghn4aBnn.js → AuditLogList-D5H_O9Q0.js} +5 -5
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BxZ9t3MZ.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CuELLYY4.js} +10 -10
  4. package/dist/{EmployeeList-jc8LTznV.js → EmployeeList-DICzZjVM.js} +8 -8
  5. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-DLgm6oCz.js → FormSection.vue_vue_type_script_setup_true_lang-BQzSWAqC.js} +1 -1
  6. package/dist/{GrantUserList-BtPTpypR.js → GrantUserList-DoMN7Eks.js} +8 -8
  7. package/dist/{Main-McMZU_cR.js → Main-CHIExpOV.js} +5 -5
  8. package/dist/{Main-BizCV-_x.js → Main-CQ42sYi9.js} +11 -11
  9. package/dist/{Main-BF8hlYeV.js → Main-DwYh9cxQ.js} +10 -10
  10. package/dist/{MyPosProfile-BjeCnBvL.js → MyPosProfile-DaUdREQX.js} +1 -1
  11. package/dist/{PermissionSetList-NWLoqFHC.js → PermissionSetList-B7WM9N-p.js} +66 -66
  12. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BSVtyLlL.js +4207 -0
  13. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-nwpdr7T7.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-C7fnnbme.js} +19 -19
  14. package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-eT-dPsOX.js → RoleForm.vue_vue_type_script_setup_true_lang-AbQIllkX.js} +30 -30
  15. package/dist/{RoleList-CIfN10zu.js → RoleList-vQsHxlNc.js} +96 -105
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CMTXC_UR.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-D52LhvGG.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-8vS1DUrk.js → ScheduleGeneralPage-BLqh7jH6.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Br4AcF1g.js → ScheduleModal.vue_vue_type_script_setup_true_lang-C9doSgov.js} +4 -4
  19. package/dist/{SchedulePage-DqbE1PoV.js → SchedulePage-YADV_6w9.js} +9 -9
  20. package/dist/{SchedulePositionPage-DUnkT0Tp.js → SchedulePositionPage-BowDQMG_.js} +3 -3
  21. package/dist/{SelectFilter-voMj4_j1.js → SelectFilter-CBp1qxLd.js} +2 -3
  22. package/dist/{TeamMemberList-DoEOWNDC.js → TeamMemberList-BoJ87moU.js} +184 -184
  23. package/dist/TimesheetList-BULw75oo.js +401 -0
  24. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-h-bWBmpI.js → TimesheetList.vue_vue_type_style_index_0_scoped_c98b0b84_lang-VlnjH9aQ.js} +3 -3
  25. package/dist/{app-CDCO87ji.js → app-DOFDND9j.js} +5444 -4624
  26. package/dist/app.js +1 -1
  27. package/dist/{approval-code-CLE9s5dL.js → approval-code-Dgj6S82q.js} +1 -1
  28. package/dist/{dayjs.min-BW6-XAUB.js → dayjs.min-AoirQCgL.js} +1 -1
  29. package/dist/{employee-BaCU-FLC.js → employee-VB6YmuSS.js} +5 -5
  30. package/dist/{grant-user-DMtilLJx.js → grant-user-C-ptrq7l.js} +1 -1
  31. package/dist/{iteration-CPLGGFBb.js → iteration-DmuDXP8U.js} +1 -1
  32. package/dist/{lodash-snXoiw60.js → lodash-CBFO-xTu.js} +1 -1
  33. package/dist/member-grant-CHOB8eQ_.js +54 -0
  34. package/dist/restaurant-DH2Fxzi7.js +52 -0
  35. package/dist/role-DUpHwRiY.js +97 -0
  36. package/dist/rule-aUPH1VOW.js +842 -0
  37. package/dist/src/helpers/permission-set.d.ts +1 -102
  38. package/dist/src/helpers/rule.d.ts +2 -2
  39. package/dist/src/stores/restaurant.d.ts +61 -1
  40. package/dist/src/views/audit-log/locales/index.d.ts +12 -0
  41. package/dist/style.css +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{useAppStore-pKAGQL6q.js → useAppStore-DwmJbpf-.js} +1 -1
  44. package/dist/{useLoading-D67DIqfk.js → useLoading-Dmlm4oSU.js} +1 -1
  45. package/dist/{useReportPermissions-CfgnE0NY.js → useReportPermissions-XPn-p57R.js} +5 -5
  46. package/package.json +3 -3
  47. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-UPcpeVD5.js +0 -4243
  48. package/dist/TimesheetList-BBv2SV96.js +0 -402
  49. package/dist/member-grant-CJyOr-q0.js +0 -55
  50. package/dist/restaurant-BMlLIUqe.js +0 -51
  51. package/dist/role-DqcBOWHL.js +0 -93
  52. package/dist/rule-B5YNhGJ4.js +0 -788
@@ -1,6 +1,6 @@
1
1
  import { computed as T, ref as x } from "vue";
2
2
  import { useCoreStore as N0 } from "@feedmepos/mf-common";
3
- import { g as C0, b as G0, T as B0, m as d0, h as j0, j as k0 } from "./app-CDCO87ji.js";
3
+ import { g as C0, b as G0, T as B0, m as d0, l as k0, h as j0 } from "./app-DOFDND9j.js";
4
4
  const U0 = {
5
5
  async readProviders() {
6
6
  return C0(await G0("sso-providers").get(""));
@@ -854,7 +854,7 @@ function G1(d) {
854
854
  function B1(d) {
855
855
  return L1.test(d);
856
856
  }
857
- function j1(d) {
857
+ function k1(d) {
858
858
  var e = d.number, $ = d.ext;
859
859
  if (!e)
860
860
  return "";
@@ -867,7 +867,7 @@ var o0 = {
867
867
  return "".concat(e).concat(t.ext()).concat($);
868
868
  }
869
869
  };
870
- function k1(d, e, $, t) {
870
+ function j1(d, e, $, t) {
871
871
  if ($ ? $ = K1({}, o0, $) : $ = o0, t = new s(t), d.country && d.country !== "001") {
872
872
  if (!t.hasCountry(d.country))
873
873
  throw new Error("Unknown country: ".concat(d.country));
@@ -878,13 +878,13 @@ function k1(d, e, $, t) {
878
878
  var r = t.countryCallingCode(), n = $.v2 ? d.nationalNumber : d.phone, i;
879
879
  switch (e) {
880
880
  case "NATIONAL":
881
- return n ? (i = R(n, d.carrierCode, "NATIONAL", t, $), j(i, d.ext, t, $.formatExtension)) : "";
881
+ return n ? (i = R(n, d.carrierCode, "NATIONAL", t, $), k(i, d.ext, t, $.formatExtension)) : "";
882
882
  case "INTERNATIONAL":
883
- return n ? (i = R(n, null, "INTERNATIONAL", t, $), i = "+".concat(r, " ").concat(i), j(i, d.ext, t, $.formatExtension)) : "+".concat(r);
883
+ return n ? (i = R(n, null, "INTERNATIONAL", t, $), i = "+".concat(r, " ").concat(i), k(i, d.ext, t, $.formatExtension)) : "+".concat(r);
884
884
  case "E.164":
885
885
  return "+".concat(r).concat(n);
886
886
  case "RFC3966":
887
- return j1({
887
+ return k1({
888
888
  number: "+".concat(r).concat(n),
889
889
  ext: d.ext
890
890
  });
@@ -892,7 +892,7 @@ function k1(d, e, $, t) {
892
892
  if (!$.fromCountry)
893
893
  return;
894
894
  var o = H1(n, d.carrierCode, r, $.fromCountry, t);
895
- return j(o, d.ext, t, $.formatExtension);
895
+ return k(o, d.ext, t, $.formatExtension);
896
896
  default:
897
897
  throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e, '"'));
898
898
  }
@@ -914,7 +914,7 @@ function U1(d, e) {
914
914
  return v(e, $.pattern());
915
915
  });
916
916
  }
917
- function j(d, e, $, t) {
917
+ function k(d, e, $, t) {
918
918
  return e ? t(d, e, $) : d;
919
919
  }
920
920
  function H1(d, e, $, t, r) {
@@ -1089,7 +1089,7 @@ var Q1 = /* @__PURE__ */ function() {
1089
1089
  }, {
1090
1090
  key: "format",
1091
1091
  value: function($, t) {
1092
- return k1(this, $, t ? u0(u0({}, t), {}, {
1092
+ return j1(this, $, t ? u0(u0({}, t), {}, {
1093
1093
  v2: !0
1094
1094
  }) : {
1095
1095
  v2: !0
@@ -1539,17 +1539,17 @@ function Bd(d) {
1539
1539
  for (var e = 1; e < arguments.length; e++) {
1540
1540
  var $ = arguments[e] != null ? arguments[e] : {};
1541
1541
  e % 2 ? h0(Object($), !0).forEach(function(t) {
1542
- jd(d, t, $[t]);
1542
+ kd(d, t, $[t]);
1543
1543
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(d, Object.getOwnPropertyDescriptors($)) : h0(Object($)).forEach(function(t) {
1544
1544
  Object.defineProperty(d, t, Object.getOwnPropertyDescriptor($, t));
1545
1545
  });
1546
1546
  }
1547
1547
  return d;
1548
1548
  }
1549
- function jd(d, e, $) {
1550
- return (e = kd(e)) in d ? Object.defineProperty(d, e, { value: $, enumerable: !0, configurable: !0, writable: !0 }) : d[e] = $, d;
1549
+ function kd(d, e, $) {
1550
+ return (e = jd(e)) in d ? Object.defineProperty(d, e, { value: $, enumerable: !0, configurable: !0, writable: !0 }) : d[e] = $, d;
1551
1551
  }
1552
- function kd(d) {
1552
+ function jd(d) {
1553
1553
  var e = Ud(d, "string");
1554
1554
  return I(e) == "symbol" ? e : e + "";
1555
1555
  }
@@ -1712,7 +1712,7 @@ function i2(d) {
1712
1712
  [
1713
1713
  {
1714
1714
  action: d0.Action.create,
1715
- subject: j0.hrm_portalUsers,
1715
+ subject: k0.hrm_portalUsers,
1716
1716
  coverSubject: d0.Subject.Business.hrm_teamMember
1717
1717
  }
1718
1718
  ],
@@ -1801,19 +1801,19 @@ const y2 = {
1801
1801
  // GET /api/login/supported-countries -> { countries: ["MY","SG",...] }
1802
1802
  async getSupportedCountries() {
1803
1803
  return C0(
1804
- await k0().get("/login/supported-countries")
1804
+ await j0().get("/login/supported-countries")
1805
1805
  ).countries ?? [];
1806
1806
  }
1807
- }, P0 = x([]), k = x(!1);
1807
+ }, P0 = x([]), j = x(!1);
1808
1808
  let U = null;
1809
1809
  function I2() {
1810
- return U || (k.value = !1, U = y2.getSupportedCountries().then((d) => {
1810
+ return U || (j.value = !1, U = y2.getSupportedCountries().then((d) => {
1811
1811
  P0.value = d.filter((e) => $2(e));
1812
1812
  }).catch(() => {
1813
1813
  U = null;
1814
1814
  }).finally(() => {
1815
- k.value = !0;
1816
- })), { supportedCountries: P0, ready: k };
1815
+ j.value = !0;
1816
+ })), { supportedCountries: P0, ready: j };
1817
1817
  }
1818
1818
  export {
1819
1819
  P2 as D,
@@ -1,16 +1,16 @@
1
- import { defineComponent as ze, computed as y, ref as C, watch as q, onMounted as Le, resolveComponent as w, createBlock as E, openBlock as h, unref as o, withCtx as V, createElementVNode as c, createVNode as _, toDisplayString as M, createElementBlock as S, Fragment as z, renderList as ee, createCommentVNode as te, normalizeClass as he } from "vue";
2
- import { l as W } from "./lodash-snXoiw60.js";
3
- import { e as be } from "./iteration-CPLGGFBb.js";
1
+ import { defineComponent as ze, computed as y, ref as D, watch as q, onMounted as Le, resolveComponent as w, createBlock as E, openBlock as h, unref as o, withCtx as V, createElementVNode as c, createVNode as _, toDisplayString as M, createElementBlock as S, Fragment as z, renderList as ee, createCommentVNode as te, normalizeClass as he } from "vue";
2
+ import { l as W } from "./lodash-CBFO-xTu.js";
3
+ import { e as be } from "./iteration-DmuDXP8U.js";
4
4
  import { useI18n as Ne } from "@feedmepos/mf-common";
5
5
  import { useBreakpoints as Ke, useSnackbar as Te, components as qe } from "@feedmepos/ui-library";
6
- import { u as We, _ as Ge, a as _e } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BxZ9t3MZ.js";
6
+ import { u as We, _ as Ge, a as _e } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CuELLYY4.js";
7
7
  import { u as Je } from "./useDiscardConfirm-CzZSPyvh.js";
8
- import { u as He } from "./useLoading-D67DIqfk.js";
9
- import { u as Qe } from "./useReportPermissions-CfgnE0NY.js";
10
- import { D as Xe, k as Ye, A as Ze, S as et } from "./app-CDCO87ji.js";
11
- import { r as ae, h as tt, e as at, s as st, i as ge, j as lt } from "./rule-B5YNhGJ4.js";
12
- import { u as rt } from "./restaurant-BMlLIUqe.js";
13
- import { u as ot } from "./role-DqcBOWHL.js";
8
+ import { u as He } from "./useLoading-Dmlm4oSU.js";
9
+ import { u as Qe } from "./useReportPermissions-XPn-p57R.js";
10
+ import { s as Xe, j as Ye, A as Ze, S as et } from "./app-DOFDND9j.js";
11
+ import { r as ae, h as tt, d as at, s as st, g as ge, e as lt } from "./rule-aUPH1VOW.js";
12
+ import { u as rt } from "./restaurant-DH2Fxzi7.js";
13
+ import { u as ot } from "./role-DUpHwRiY.js";
14
14
  function Tt(d) {
15
15
  const n = [];
16
16
  for (const { restaurantId: m, roleId: a } of d) {
@@ -68,7 +68,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
68
68
  }, ht = { class: "flex flex-col gap-8" }, bt = { class: "flex flex-col gap-16 rounded-[16px] border border-fm-color-neutral-gray-200 p-16" }, _t = { class: "flex flex-col gap-8" }, gt = { class: "fm-typo-en-title-sm-600" }, yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = { class: "flex flex-col gap-24" }, Rt = { class: "text-[18px] font-semibold leading-[24px] text-fm-color-typo-primary" }, It = { class: "mt-16 space-y-8" }, Ft = { class: "flex items-center" }, kt = { class: "h-[24px] w-[24px] flex items-center justify-center" }, wt = { class: "h-[24px] w-[24px] flex items-center justify-center" }, Vt = {
69
69
  key: 0,
70
70
  class: "ml-20 mt-8 flex max-w-[320px] flex-row items-start gap-8"
71
- }, Dt = { class: "mt-8 whitespace-nowrap" }, Ct = { class: "flex gap-8 items-center justify-start" }, St = "condition-form-select-menu", Xt = /* @__PURE__ */ ze({
71
+ }, Ct = { class: "mt-8 whitespace-nowrap" }, Dt = { class: "flex gap-8 items-center justify-start" }, St = "condition-form-select-menu", Xt = /* @__PURE__ */ ze({
72
72
  __name: "RoleForm",
73
73
  props: {
74
74
  id: {
@@ -88,7 +88,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
88
88
  },
89
89
  emits: ["created"],
90
90
  setup(d, { expose: n, emit: m }) {
91
- const { t: a } = Ne(), { breakpoints: u } = Ke(), x = y(() => u.value.xs || u.value.sm), v = rt(), P = y(() => v.restaurants.value), le = C(v.restaurants.value.length === 0);
91
+ const { t: a } = Ne(), { breakpoints: u } = Ke(), x = y(() => u.value.xs || u.value.sm), v = rt(), P = y(() => v.restaurants.value), le = D(v.restaurants.value.length === 0);
92
92
  q(
93
93
  () => v.restaurants.value.length,
94
94
  (e) => {
@@ -101,9 +101,9 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
101
101
  availableReportKeys: oe,
102
102
  customReportKeys: Ie,
103
103
  isLoaded: Fe
104
- } = Qe(), L = d, ke = m, R = C(!1), we = () => {
104
+ } = Qe(), L = d, ke = m, R = D(!1), we = () => {
105
105
  R.value = !R.value, R.value && fe();
106
- }, Ve = y(() => L.id ? a("hr.role.form.update") : a("hr.role.form.addTitle")), De = y(() => L.id ? a("common.update") : a("hr.role.form.add")), G = y(() => {
106
+ }, Ve = y(() => L.id ? a("hr.role.form.update") : a("hr.role.form.addTitle")), Ce = y(() => L.id ? a("common.update") : a("hr.role.form.add")), G = y(() => {
107
107
  const e = Xe.filter(
108
108
  (l) => l.subject !== be.F_RULE_SUBJECT.enum.report
109
109
  ).map((l) => ae(l)), t = Re.value.map((l) => ae(l));
@@ -113,7 +113,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
113
113
  restaurantIds: [],
114
114
  permissions: [],
115
115
  maxDiscountPercentage: 100
116
- }), s = C(N()), J = C([]), K = C([]), ne = C([]), I = C(/* @__PURE__ */ new Map()), U = We(I), H = Ye("report");
116
+ }), s = D(N()), J = D([]), K = D([]), ne = D([]), I = D(/* @__PURE__ */ new Map()), U = We(I), H = Ye("report");
117
117
  function ue(e) {
118
118
  const t = I.value.get(e);
119
119
  return !!t && Object.keys(t).length > 0;
@@ -127,16 +127,16 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
127
127
  function de(e, t, l) {
128
128
  U.setDraft({ subject: e, builderKey: t.builderKey }, { formValue: l });
129
129
  }
130
- const Q = C(null);
130
+ const Q = D(null);
131
131
  function me(e, t) {
132
132
  if (U.getDraftsForSubject(e).size === 0) {
133
133
  t == null || t();
134
134
  return;
135
135
  }
136
136
  const p = [];
137
- for (const D of H) {
138
- const O = U.getDraft({ subject: e, builderKey: D.builderKey });
139
- O && p.push({ builder: D, form: O.formValue });
137
+ for (const C of H) {
138
+ const O = U.getDraft({ subject: e, builderKey: C.builderKey });
139
+ O && p.push({ builder: C, form: O.formValue });
140
140
  }
141
141
  if (p.length === 0) {
142
142
  t == null || t();
@@ -144,14 +144,14 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
144
144
  }
145
145
  const j = I.value.get(e), F = et(
146
146
  j,
147
- p.map(({ builder: D, form: O }) => ({ builder: D, formValue: O }))
147
+ p.map(({ builder: C, form: O }) => ({ builder: C, formValue: O }))
148
148
  ), k = new Map(I.value);
149
149
  Object.keys(F).length === 0 ? k.delete(e) : k.set(e, F), I.value = k, U.clearDraftsForSubject(e), t == null || t();
150
150
  }
151
151
  function ce(e) {
152
152
  return U.hasDraftsForSubject(e);
153
153
  }
154
- const Ce = y(() => [
154
+ const De = y(() => [
155
155
  {
156
156
  title: a("hr.role.labels.operation"),
157
157
  filter: (e) => e.isOrderOperation
@@ -199,8 +199,8 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
199
199
  b.value.permissions
200
200
  );
201
201
  for (const F of b.value.permissions) {
202
- const k = ae(F), D = lt(F);
203
- D && I.value.set(k.value, D);
202
+ const k = ae(F), C = lt(F);
203
+ C && I.value.set(k.value, C);
204
204
  }
205
205
  } else
206
206
  s.value.restaurantIds = [...L.restaurantIds];
@@ -219,7 +219,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
219
219
  I.value = e;
220
220
  }
221
221
  });
222
- const Se = C(""), Pe = y(() => ({
222
+ const Se = D(""), Pe = y(() => ({
223
223
  restaurantIds: s.value.restaurantIds,
224
224
  role: {
225
225
  name: s.value.name,
@@ -287,7 +287,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
287
287
  show: R,
288
288
  trigger: we
289
289
  }), (e, t) => {
290
- const l = w("FmButton"), p = w("FmIcon"), j = w("FmTextField"), F = w("FmCircularProgress"), k = w("FmCheckbox"), D = w("FmFormGroup"), O = w("FmBottomSheet"), Ae = w("FmPopover"), ve = w("fm-button"), Be = w("fm-side-sheet");
290
+ const l = w("FmButton"), p = w("FmIcon"), j = w("FmTextField"), F = w("FmCircularProgress"), k = w("FmCheckbox"), C = w("FmFormGroup"), O = w("FmBottomSheet"), Ae = w("FmPopover"), ve = w("fm-button"), Be = w("fm-side-sheet");
291
291
  return h(), E(Be, {
292
292
  id: "unit-form",
293
293
  modelValue: R.value,
@@ -322,9 +322,9 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
322
322
  ])
323
323
  ]),
324
324
  "side-sheet-footer": V(() => [
325
- c("div", Ct, [
325
+ c("div", Dt, [
326
326
  _(ve, {
327
- label: De.value,
327
+ label: Ce.value,
328
328
  size: "md",
329
329
  type: "submit",
330
330
  variant: "primary",
@@ -356,7 +356,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
356
356
  c("p", pt, M(o(a)("hr.role.form.restaurant")), 1),
357
357
  le.value ? (h(), S("div", vt, [
358
358
  _(F)
359
- ])) : (h(), E(D, {
359
+ ])) : (h(), E(C, {
360
360
  key: 1,
361
361
  modelValue: s.value.restaurantIds,
362
362
  "onUpdate:modelValue": t[2] || (t[2] = (f) => s.value.restaurantIds = f),
@@ -391,7 +391,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
391
391
  c("p", yt, M(o(a)("hr.role.form.permissionsSubtitle")), 1)
392
392
  ]),
393
393
  c("div", xt, [
394
- (h(!0), S(z, null, ee(Ce.value, (f) => (h(), S("div", {
394
+ (h(!0), S(z, null, ee(De.value, (f) => (h(), S("div", {
395
395
  key: f.title
396
396
  }, [
397
397
  _(Ge, {
@@ -505,7 +505,7 @@ const ut = { class: "flex w-full items-center gap-4" }, it = { class: "min-w-0 f
505
505
  ], 64)) : te("", !0)
506
506
  ]),
507
507
  r.value === "order:discount" && s.value.permissions.includes(r.value) ? (h(), S("div", Vt, [
508
- c("div", Dt, M(o(a)("hr.role.form.maxDiscountPercentage")), 1),
508
+ c("div", Ct, M(o(a)("hr.role.form.maxDiscountPercentage")), 1),
509
509
  _(j, {
510
510
  modelValue: s.value.maxDiscountPercentage,
511
511
  "onUpdate:modelValue": t[4] || (t[4] = (i) => s.value.maxDiscountPercentage = i),
@@ -1,80 +1,71 @@
1
- import { computed as g, defineComponent as se, ref as U, onMounted as te, resolveComponent as x, createElementBlock as $, openBlock as h, Fragment as A, createBlock as R, createElementVNode as r, createVNode as m, unref as a, withCtx as b, h as u, renderList as ne, toDisplayString as p, createTextVNode as T, resolveDynamicComponent as z, withModifiers as re, nextTick as K } from "vue";
2
- import { e as d } from "./iteration-CPLGGFBb.js";
3
- import { useI18n as ae } from "@feedmepos/mf-common";
4
- import { useDialog as le, useSnackbar as ie, useBreakpoints as ce, components as D, FmButtonColorThemeVariant as me } from "@feedmepos/ui-library";
5
- import { _ as ue } from "./app-CDCO87ji.js";
6
- import { _ as W } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
7
- import { _ as de } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { f as w, r as pe, h as fe } from "./rule-B5YNhGJ4.js";
9
- import { u as j } from "./restaurant-BMlLIUqe.js";
10
- import { u as _e } from "./role-DqcBOWHL.js";
11
- import { u as he } from "./useReportPermissions-CfgnE0NY.js";
12
- import { _ as ve } from "./RoleForm.vue_vue_type_script_setup_true_lang-eT-dPsOX.js";
13
- function ge() {
14
- const B = j();
15
- return g(() => {
16
- const s = {};
17
- return B.restaurants.value.forEach((f) => {
18
- s[f._id] = f;
19
- }), s;
20
- });
21
- }
22
- const ye = {
1
+ import { defineComponent as Z, computed as y, ref as S, onMounted as ee, resolveComponent as C, createElementBlock as $, openBlock as _, Fragment as A, createBlock as x, createElementVNode as r, createVNode as m, unref as a, withCtx as R, h as u, renderList as oe, toDisplayString as p, createTextVNode as T, resolveDynamicComponent as M, withModifiers as se, nextTick as z } from "vue";
2
+ import { e as d } from "./iteration-DmuDXP8U.js";
3
+ import { useI18n as te } from "@feedmepos/mf-common";
4
+ import { useDialog as ne, useSnackbar as re, useBreakpoints as ae, components as K, FmButtonColorThemeVariant as le } from "@feedmepos/ui-library";
5
+ import { _ as ie } from "./app-DOFDND9j.js";
6
+ import { _ as D } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
7
+ import { _ as ce } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
+ import { f as b, r as me, h as ue } from "./rule-aUPH1VOW.js";
9
+ import { u as de } from "./restaurant-DH2Fxzi7.js";
10
+ import { u as pe } from "./role-DUpHwRiY.js";
11
+ import { u as fe } from "./useReportPermissions-XPn-p57R.js";
12
+ import { _ as _e } from "./RoleForm.vue_vue_type_script_setup_true_lang-AbQIllkX.js";
13
+ const he = {
23
14
  class: "space-y-8"
24
- }, Ce = {
15
+ }, ve = {
25
16
  class: "flex justify-end xs:px-16"
26
- }, xe = {
17
+ }, ge = {
27
18
  class: "flex flex-col h-full overflow-auto"
28
- }, Re = {
19
+ }, ye = {
29
20
  class: "pb-64 sm:hidden md:hidden lg:hidden"
30
- }, be = {
21
+ }, Ce = {
31
22
  class: "space-y-4"
32
- }, we = {
23
+ }, xe = {
33
24
  class: "fm-typo-en-body-lg-600"
34
- }, Fe = {
25
+ }, Re = {
35
26
  class: "text-fm-color-typo-secondary"
36
- }, Ee = {
27
+ }, be = {
37
28
  class: "line-clamp-2"
38
- }, Le = {
29
+ }, we = {
39
30
  class: "font-bold"
40
- }, ke = {
31
+ }, Fe = {
41
32
  class: "flex items-start gap-4"
42
- }, Se = {
33
+ }, Le = {
43
34
  class: "line-clamp-2"
44
- }, Ue = {
35
+ }, Ee = {
45
36
  class: "font-bold"
46
- }, Te = {
37
+ }, ke = {
47
38
  class: "flex items-start gap-4"
48
- }, Be = {
39
+ }, Ue = {
49
40
  class: "line-clamp-2"
50
- }, Me = {
41
+ }, Se = {
51
42
  class: "font-bold"
52
- }, Ge = /* @__PURE__ */ se({
43
+ }, We = /* @__PURE__ */ Z({
53
44
  __name: "RoleList",
54
- setup(B, {
55
- expose: M
45
+ setup(Te, {
46
+ expose: W
56
47
  }) {
57
48
  const {
58
49
  t: s
59
- } = ae(), {
60
- allReportPermissions: f
61
- } = he(), G = j(), q = g(() => G.restaurants.value), I = g(() => q.value.map((e) => e._id));
50
+ } = te(), {
51
+ allReportPermissions: w
52
+ } = fe(), B = de(), j = y(() => B.restaurants.value), I = y(() => j.value.map((e) => e._id));
62
53
  function F(e, o) {
63
- const n = o === d.F_RULE_SUBJECT.enum.report ? f.value : void 0, t = w(e, o, n);
64
- return ["-", "All"].includes(t) ? () => null : () => u(D.FmTooltip, {
54
+ const n = o === d.F_RULE_SUBJECT.enum.report ? w.value : void 0, t = b(e, o, n);
55
+ return ["-", "All"].includes(t) ? () => null : () => u(K.FmTooltip, {
65
56
  "z-index": "999",
66
57
  placement: "top",
67
58
  class: "ml-2"
68
59
  }, {
69
- content: () => u("div", [s("hr.role.tooltip.labels.permission"), ...e.filter((i) => i.subject === o).map((i) => u("div", ["- ", pe(i).label]))]),
70
- default: () => u(D.FmIcon, {
60
+ content: () => u("div", [s("hr.role.tooltip.labels.permission"), ...e.filter((i) => i.subject === o).map((i) => u("div", ["- ", me(i).label]))]),
61
+ default: () => u(K.FmIcon, {
71
62
  name: "info",
72
- color: me.NeutralGray400
63
+ color: le.NeutralGray400
73
64
  })
74
65
  });
75
66
  }
76
67
  function J(e, o) {
77
- const n = o === d.F_RULE_SUBJECT.enum.report ? f.value : void 0, t = w(e, o, n);
68
+ const n = o === d.F_RULE_SUBJECT.enum.report ? w.value : void 0, t = b(e, o, n);
78
69
  return () => t === "All" ? t : u("div", {
79
70
  class: "flex items-center"
80
71
  }, [t, F(e, o)()]);
@@ -82,15 +73,15 @@ const ye = {
82
73
  function N(e) {
83
74
  return [{
84
75
  label: s("hr.role.form.update"),
85
- onClick: () => E(e)
76
+ onClick: () => L(e)
86
77
  }, {
87
78
  label: s("hr.role.remove.title"),
88
- onClick: () => Z(e),
79
+ onClick: () => Q(e),
89
80
  itemClass: "text-fm-color-typo-error",
90
- disabled: fe(e.permissions)
81
+ disabled: ue(e.permissions)
91
82
  }];
92
83
  }
93
- const H = ({
84
+ const G = ({
94
85
  role: e,
95
86
  className: o = ""
96
87
  }) => m("div", {
@@ -98,9 +89,9 @@ const ye = {
98
89
  onClick: (n) => {
99
90
  n.stopPropagation();
100
91
  }
101
- }, [m(W, {
92
+ }, [m(D, {
102
93
  items: N(e)
103
- }, null)]), O = [{
94
+ }, null)]), q = [{
104
95
  accessorKey: "name",
105
96
  header: () => s("hr.role.columns.name"),
106
97
  enableSorting: !1
@@ -130,21 +121,21 @@ const ye = {
130
121
  cellClass: "pl-16",
131
122
  headerContentClass: "-mx-16"
132
123
  },
133
- cell: (e) => H({
124
+ cell: (e) => G({
134
125
  role: e.row.original,
135
126
  className: "flex w-full items-center justify-end"
136
127
  })
137
- }], E = async (e) => {
128
+ }], L = async (e) => {
138
129
  var o;
139
- C.value = e._id, await K(), (o = S.value) == null || o.trigger();
140
- }, _ = _e(), Q = ge(), X = g(() => {
141
- const e = _.roles.value || [];
130
+ g.value = e._id, await z(), (o = U.value) == null || o.trigger();
131
+ }, f = pe(), H = y(() => {
132
+ const e = f.roles.value || [];
142
133
  return (I.value.length === 0 ? e : e.filter((n) => n.restaurants.some((t) => I.value.includes(t.id)))).map((n) => {
143
134
  const t = n.restaurants.map((i) => {
144
- const c = Q.value[i.id];
135
+ const c = B.restaurantsById.value.get(i.id);
145
136
  return {
146
137
  ...i,
147
- // Prefer live data from restaurantMap so names populate reactively
138
+ // Prefer live data from restaurantStore so names populate reactively
148
139
  // even when restaurants loaded after roles.
149
140
  name: (c == null ? void 0 : c.profile.name) || i.name,
150
141
  code: c == null ? void 0 : c.profile.code
@@ -155,24 +146,24 @@ const ye = {
155
146
  restaurants: t
156
147
  };
157
148
  });
158
- }), y = g(() => {
149
+ }), v = y(() => {
159
150
  var o;
160
- return (o = X.value) == null ? void 0 : o.filter((n) => {
161
- const t = k.value.toLowerCase(), i = n.name.toLowerCase().includes(t), l = (n.restaurants || []).some((v) => {
151
+ return (o = H.value) == null ? void 0 : o.filter((n) => {
152
+ const t = k.value.toLowerCase(), i = n.name.toLowerCase().includes(t), l = (n.restaurants || []).some((h) => {
162
153
  var V;
163
- return v.name.toLowerCase().includes(t) || ((V = v.code) == null ? void 0 : V.toLowerCase().includes(t));
154
+ return h.name.toLowerCase().includes(t) || ((V = h.code) == null ? void 0 : V.toLowerCase().includes(t));
164
155
  });
165
156
  return i || l;
166
157
  });
167
- }), P = le(), L = ie(), {
168
- breakpoints: Y
169
- } = ce(), Z = (e) => {
158
+ }), P = ne(), E = re(), {
159
+ breakpoints: O
160
+ } = ae(), Q = (e) => {
170
161
  P.open({
171
162
  title: s("hr.role.remove.title"),
172
163
  message: s("hr.role.remove.message", {
173
164
  name: e.name
174
165
  }),
175
- minWidth: Y.value.lg ? 588 : 0,
166
+ minWidth: O.value.lg ? 588 : 0,
176
167
  primaryActions: {
177
168
  text: s("common.remove"),
178
169
  close: !1,
@@ -183,81 +174,81 @@ const ye = {
183
174
  close: !0
184
175
  }
185
176
  }).onPrimary(async () => {
186
- await _.deleteRole(e).then(() => L.open({
177
+ await f.deleteRole(e).then(() => E.open({
187
178
  message: s("hr.role.remove.successMessage", {
188
179
  name: e.name
189
180
  }),
190
181
  type: "success"
191
- })).catch((o) => L.open({
182
+ })).catch((o) => E.open({
192
183
  message: o,
193
184
  type: "error"
194
185
  })), P.close();
195
186
  });
196
- }, k = U(""), S = U(), C = U(void 0);
197
- async function ee() {
187
+ }, k = S(""), U = S(), g = S(void 0);
188
+ async function X() {
198
189
  var e;
199
- C.value = void 0, await K(), (e = S.value) == null || e.trigger();
190
+ g.value = void 0, await z(), (e = U.value) == null || e.trigger();
200
191
  }
201
- async function oe() {
202
- if (_.roles.value.length === 0)
192
+ async function Y() {
193
+ if (f.roles.value.length === 0)
203
194
  try {
204
- await _.readRoles();
195
+ await f.readRoles();
205
196
  } catch (e) {
206
- console.error("Failed to load roles:", e), L.open({
197
+ console.error("Failed to load roles:", e), E.open({
207
198
  message: e instanceof Error ? e.message : String(e),
208
199
  type: "error"
209
200
  });
210
201
  }
211
202
  }
212
- return te(() => {
213
- oe();
214
- }), M({
215
- create: ee
203
+ return ee(() => {
204
+ Y();
205
+ }), W({
206
+ create: X
216
207
  }), (e, o) => {
217
- const n = x("FmSearch"), t = x("FmTable"), i = x("FmListItem"), c = x("FmList");
218
- return h(), $(A, null, [(h(), R(ve, {
219
- id: C.value,
220
- key: C.value,
208
+ const n = C("FmSearch"), t = C("FmTable"), i = C("FmListItem"), c = C("FmList");
209
+ return _(), $(A, null, [(_(), x(_e, {
210
+ id: g.value,
211
+ key: g.value,
221
212
  ref_key: "roleFormRef",
222
- ref: S
223
- }, null, 8, ["id"])), r("div", ye, [r("div", Ce, [m(n, {
213
+ ref: U
214
+ }, null, 8, ["id"])), r("div", he, [r("div", ve, [m(n, {
224
215
  modelValue: k.value,
225
216
  "onUpdate:modelValue": o[0] || (o[0] = (l) => k.value = l),
226
217
  class: "w-[320px] xs:w-full",
227
218
  autofocus: "",
228
219
  placeholder: a(s)("hr.role.search.placeholder") + " / " + a(s)("hr.restaurant.search.placeholder")
229
- }, null, 8, ["modelValue", "placeholder"])]), m(ue, null, {
230
- default: b(() => [r("div", xe, [m(de, {
231
- "is-loading": a(_).isLoading.value,
232
- "is-empty": y.value.length === 0,
220
+ }, null, 8, ["modelValue", "placeholder"])]), m(ie, null, {
221
+ default: R(() => [r("div", ge, [m(ce, {
222
+ "is-loading": a(f).isLoading.value,
223
+ "is-empty": v.value.length === 0,
233
224
  "collapse-at": "xs",
234
225
  title: a(s)("hr.role.noData.title"),
235
226
  subtitle: a(s)("hr.role.noData.subtitle")
236
227
  }, {
237
- default: b(() => [m(t, {
228
+ default: R(() => [m(t, {
238
229
  class: "xs:hidden",
239
- "column-defs": O,
240
- "row-data": y.value,
241
- "page-size": y.value.length,
242
- loading: a(_).isLoading.value,
230
+ "column-defs": q,
231
+ "row-data": v.value,
232
+ "page-size": v.value.length,
233
+ loading: a(f).isLoading.value,
243
234
  "pin-header-row": "",
244
235
  "hide-footer": "",
245
236
  "shrink-at": !1,
246
- onRowClick: o[1] || (o[1] = (l) => E(l.original))
237
+ onRowClick: o[1] || (o[1] = (l) => L(l.original))
247
238
  }, null, 8, ["row-data", "page-size", "loading"])]),
248
239
  _: 1
249
- }, 8, ["is-loading", "is-empty", "title", "subtitle"]), r("div", Re, [m(c, {
240
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"]), r("div", ye, [m(c, {
250
241
  separator: ""
251
242
  }, {
252
- default: b(() => [(h(!0), $(A, null, ne(y.value, (l) => (h(), R(i, {
243
+ default: R(() => [(_(!0), $(A, null, oe(v.value, (l) => (_(), x(i, {
253
244
  key: l._id,
254
245
  class: "py-12 px-16 items-center justify-between",
255
- onClick: (v) => E(l)
246
+ onClick: (h) => L(l)
256
247
  }, {
257
- default: b(() => [r("div", be, [r("p", we, p(l.name), 1), r("div", Fe, [r("p", Ee, [r("span", Le, p(a(s)("hr.role.labels.restaurant")) + ":", 1), T(" " + p(l.restaurants.map((v) => v.name).join(", ")), 1)]), r("p", ke, [r("span", Se, [r("span", Ue, p(a(s)("hr.role.labels.operation")) + ":", 1), T(" " + p(a(w)(l.permissions, a(d.F_RULE_SUBJECT).enum.order)), 1)]), (h(), R(z(F(l.permissions, a(d.F_RULE_SUBJECT).enum.order))))]), r("p", Te, [r("span", Be, [r("span", Me, p(a(s)("hr.role.labels.report")) + ":", 1), T(" " + p(a(w)(l.permissions, a(d.F_RULE_SUBJECT).enum.report, a(f))), 1)]), (h(), R(z(F(l.permissions, a(d.F_RULE_SUBJECT).enum.report))))])])]), r("div", {
258
- onClick: o[2] || (o[2] = re(() => {
248
+ default: R(() => [r("div", Ce, [r("p", xe, p(l.name), 1), r("div", Re, [r("p", be, [r("span", we, p(a(s)("hr.role.labels.restaurant")) + ":", 1), T(" " + p(l.restaurants.map((h) => h.name).join(", ")), 1)]), r("p", Fe, [r("span", Le, [r("span", Ee, p(a(s)("hr.role.labels.operation")) + ":", 1), T(" " + p(a(b)(l.permissions, a(d.F_RULE_SUBJECT).enum.order)), 1)]), (_(), x(M(F(l.permissions, a(d.F_RULE_SUBJECT).enum.order))))]), r("p", ke, [r("span", Ue, [r("span", Se, p(a(s)("hr.role.labels.report")) + ":", 1), T(" " + p(a(b)(l.permissions, a(d.F_RULE_SUBJECT).enum.report, a(w))), 1)]), (_(), x(M(F(l.permissions, a(d.F_RULE_SUBJECT).enum.report))))])])]), r("div", {
249
+ onClick: o[2] || (o[2] = se(() => {
259
250
  }, ["stop"]))
260
- }, [m(W, {
251
+ }, [m(D, {
261
252
  items: N(l)
262
253
  }, null, 8, ["items"])])]),
263
254
  _: 2
@@ -270,5 +261,5 @@ const ye = {
270
261
  }
271
262
  });
272
263
  export {
273
- Ge as default
264
+ We as default
274
265
  };
@@ -1,6 +1,6 @@
1
1
  import { ref as k, watch as he, computed as z, reactive as Pe, nextTick as we, defineComponent as Ne, createBlock as ne, openBlock as b, withCtx as T, createElementVNode as i, createVNode as H, toDisplayString as v, unref as o, createElementBlock as E, withDirectives as fe, withKeys as Ce, vModelText as ye, normalizeClass as ge, createTextVNode as V, createCommentVNode as Z, Fragment as Ie, renderList as Se } from "vue";
2
2
  import { useI18n as ie } from "@feedmepos/mf-common";
3
- import { az as oe, p as D, aD as ke, aE as se, aF as pe, y as Ee, aG as $e, K as te, e as _, ay as xe, av as W } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-Br4AcF1g.js";
3
+ import { az as oe, p as D, aD as ke, aE as se, aF as pe, y as Ee, aG as $e, K as te, e as _, ay as xe, av as W } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-C9doSgov.js";
4
4
  function be() {
5
5
  return oe.map((e) => ({ id: e.id, name: e.name }));
6
6
  }