@feedmepos/mf-hrm-portal 2.3.2-dev.5 → 2.3.2-dev.7
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.
- package/dist/{ApprovalCodeList-NYJNwdDZ.js → ApprovalCodeList-Bw0E-hZl.js} +7 -7
- package/dist/{AuditLogList-Ghn4aBnn.js → AuditLogList-CA-_t77n.js} +5 -5
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BxZ9t3MZ.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-LtjNCAFN.js} +10 -10
- package/dist/{EmployeeList-jc8LTznV.js → EmployeeList-D_bX0EhQ.js} +8 -8
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-DLgm6oCz.js → FormSection.vue_vue_type_script_setup_true_lang-CyZxQa-b.js} +1 -1
- package/dist/{GrantUserList-BtPTpypR.js → GrantUserList-Cg7ITk_M.js} +8 -8
- package/dist/{Main-BizCV-_x.js → Main-BaB4vgI5.js} +11 -11
- package/dist/{Main-McMZU_cR.js → Main-Bl-Ocx1G.js} +5 -5
- package/dist/{Main-BF8hlYeV.js → Main-D5wi42fp.js} +10 -10
- package/dist/{MyPosProfile-BjeCnBvL.js → MyPosProfile-CUG_201f.js} +1 -1
- package/dist/{PermissionSetList-NWLoqFHC.js → PermissionSetList-kgG9H3DX.js} +66 -66
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-y1YcZpGA.js +4207 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-nwpdr7T7.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fQyCtDXM.js} +19 -19
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-eT-dPsOX.js → RoleForm.vue_vue_type_script_setup_true_lang-3Q8udk43.js} +30 -30
- package/dist/{RoleList-CIfN10zu.js → RoleList-Cmz97HHP.js} +96 -105
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CMTXC_UR.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CggEy3OI.js} +1 -1
- package/dist/{ScheduleGeneralPage-8vS1DUrk.js → ScheduleGeneralPage-B39k3SQH.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Br4AcF1g.js → ScheduleModal.vue_vue_type_script_setup_true_lang-C5j3D4eF.js} +4 -4
- package/dist/{SchedulePage-DqbE1PoV.js → SchedulePage-AVmRkFi1.js} +9 -9
- package/dist/{SchedulePositionPage-DUnkT0Tp.js → SchedulePositionPage-3rE-O8CG.js} +3 -3
- package/dist/{SelectFilter-voMj4_j1.js → SelectFilter-R7ry_GEg.js} +2 -3
- package/dist/{TeamMemberList-DoEOWNDC.js → TeamMemberList-CvDnIILn.js} +184 -184
- package/dist/TimesheetList-DYoglTi8.js +401 -0
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_d0c6fd51_lang-DBpzyQ17.js +63 -0
- package/dist/{app-CDCO87ji.js → app-DKUCzcrc.js} +5444 -4624
- package/dist/app.js +1 -1
- package/dist/{approval-code-CLE9s5dL.js → approval-code-nsETgIry.js} +1 -1
- package/dist/{dayjs.min-BW6-XAUB.js → dayjs.min-CtULWW1N.js} +1 -1
- package/dist/{employee-BaCU-FLC.js → employee-DlsSqR3i.js} +5 -5
- package/dist/{grant-user-DMtilLJx.js → grant-user-Dpa_Rl6j.js} +1 -1
- package/dist/{iteration-CPLGGFBb.js → iteration-DpHBtiyr.js} +1 -1
- package/dist/{lodash-snXoiw60.js → lodash-YaHCUo_F.js} +1 -1
- package/dist/member-grant-CEokFI3_.js +54 -0
- package/dist/restaurant-CDFKqEFm.js +52 -0
- package/dist/role-DyBVVlEA.js +97 -0
- package/dist/rule-xErZqYmH.js +842 -0
- package/dist/src/api/timesheet/index.d.ts +1 -1
- package/dist/src/helpers/permission-set.d.ts +1 -102
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/stores/restaurant.d.ts +61 -1
- package/dist/src/stores/timesheet.d.ts +6 -6
- package/dist/src/views/audit-log/locales/index.d.ts +12 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-pKAGQL6q.js → useAppStore-BqsvPsPB.js} +1 -1
- package/dist/{useLoading-D67DIqfk.js → useLoading-BS1bnZg1.js} +1 -1
- package/dist/{useReportPermissions-CfgnE0NY.js → useReportPermissions-DJEhkyGc.js} +5 -5
- package/package.json +3 -3
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-UPcpeVD5.js +0 -4243
- package/dist/TimesheetList-BBv2SV96.js +0 -402
- package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-h-bWBmpI.js +0 -58
- package/dist/member-grant-CJyOr-q0.js +0 -55
- package/dist/restaurant-BMlLIUqe.js +0 -51
- package/dist/role-DqcBOWHL.js +0 -93
- 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,
|
|
3
|
+
import { g as C0, b as G0, T as B0, m as d0, l as k0, h as j0 } from "./app-DKUCzcrc.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
|
|
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
|
|
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, $),
|
|
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),
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
1550
|
-
return (e =
|
|
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
|
|
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:
|
|
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
|
|
1804
|
+
await j0().get("/login/supported-countries")
|
|
1805
1805
|
).countries ?? [];
|
|
1806
1806
|
}
|
|
1807
|
-
}, P0 = x([]),
|
|
1807
|
+
}, P0 = x([]), j = x(!1);
|
|
1808
1808
|
let U = null;
|
|
1809
1809
|
function I2() {
|
|
1810
|
-
return U || (
|
|
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
|
-
|
|
1816
|
-
})), { supportedCountries: P0, ready:
|
|
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
|
|
2
|
-
import { l as W } from "./lodash-
|
|
3
|
-
import { e as be } from "./iteration-
|
|
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-YaHCUo_F.js";
|
|
3
|
+
import { e as be } from "./iteration-DpHBtiyr.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-
|
|
6
|
+
import { u as We, _ as Ge, a as _e } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-LtjNCAFN.js";
|
|
7
7
|
import { u as Je } from "./useDiscardConfirm-CzZSPyvh.js";
|
|
8
|
-
import { u as He } from "./useLoading-
|
|
9
|
-
import { u as Qe } from "./useReportPermissions-
|
|
10
|
-
import {
|
|
11
|
-
import { r as ae, h as tt,
|
|
12
|
-
import { u as rt } from "./restaurant-
|
|
13
|
-
import { u as ot } from "./role-
|
|
8
|
+
import { u as He } from "./useLoading-BS1bnZg1.js";
|
|
9
|
+
import { u as Qe } from "./useReportPermissions-DJEhkyGc.js";
|
|
10
|
+
import { s as Xe, j as Ye, A as Ze, S as et } from "./app-DKUCzcrc.js";
|
|
11
|
+
import { r as ae, h as tt, d as at, s as st, g as ge, e as lt } from "./rule-xErZqYmH.js";
|
|
12
|
+
import { u as rt } from "./restaurant-CDFKqEFm.js";
|
|
13
|
+
import { u as ot } from "./role-DyBVVlEA.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
|
-
},
|
|
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 =
|
|
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 =
|
|
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")),
|
|
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 =
|
|
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 =
|
|
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
|
|
138
|
-
const O = U.getDraft({ subject: e, builderKey:
|
|
139
|
-
O && p.push({ builder:
|
|
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:
|
|
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
|
|
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),
|
|
203
|
-
|
|
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 =
|
|
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"),
|
|
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",
|
|
325
|
+
c("div", Dt, [
|
|
326
326
|
_(ve, {
|
|
327
|
-
label:
|
|
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(
|
|
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(
|
|
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",
|
|
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 {
|
|
2
|
-
import { e as d } from "./iteration-
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { useDialog as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { f as
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as
|
|
13
|
-
|
|
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-DpHBtiyr.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-DKUCzcrc.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-xErZqYmH.js";
|
|
9
|
+
import { u as de } from "./restaurant-CDFKqEFm.js";
|
|
10
|
+
import { u as pe } from "./role-DyBVVlEA.js";
|
|
11
|
+
import { u as fe } from "./useReportPermissions-DJEhkyGc.js";
|
|
12
|
+
import { _ as _e } from "./RoleForm.vue_vue_type_script_setup_true_lang-3Q8udk43.js";
|
|
13
|
+
const he = {
|
|
23
14
|
class: "space-y-8"
|
|
24
|
-
},
|
|
15
|
+
}, ve = {
|
|
25
16
|
class: "flex justify-end xs:px-16"
|
|
26
|
-
},
|
|
17
|
+
}, ge = {
|
|
27
18
|
class: "flex flex-col h-full overflow-auto"
|
|
28
|
-
},
|
|
19
|
+
}, ye = {
|
|
29
20
|
class: "pb-64 sm:hidden md:hidden lg:hidden"
|
|
30
|
-
},
|
|
21
|
+
}, Ce = {
|
|
31
22
|
class: "space-y-4"
|
|
32
|
-
},
|
|
23
|
+
}, xe = {
|
|
33
24
|
class: "fm-typo-en-body-lg-600"
|
|
34
|
-
},
|
|
25
|
+
}, Re = {
|
|
35
26
|
class: "text-fm-color-typo-secondary"
|
|
36
|
-
},
|
|
27
|
+
}, be = {
|
|
37
28
|
class: "line-clamp-2"
|
|
38
|
-
},
|
|
29
|
+
}, we = {
|
|
39
30
|
class: "font-bold"
|
|
40
|
-
},
|
|
31
|
+
}, Fe = {
|
|
41
32
|
class: "flex items-start gap-4"
|
|
42
|
-
},
|
|
33
|
+
}, Le = {
|
|
43
34
|
class: "line-clamp-2"
|
|
44
|
-
},
|
|
35
|
+
}, Ee = {
|
|
45
36
|
class: "font-bold"
|
|
46
|
-
},
|
|
37
|
+
}, ke = {
|
|
47
38
|
class: "flex items-start gap-4"
|
|
48
|
-
},
|
|
39
|
+
}, Ue = {
|
|
49
40
|
class: "line-clamp-2"
|
|
50
|
-
},
|
|
41
|
+
}, Se = {
|
|
51
42
|
class: "font-bold"
|
|
52
|
-
},
|
|
43
|
+
}, We = /* @__PURE__ */ Z({
|
|
53
44
|
__name: "RoleList",
|
|
54
|
-
setup(
|
|
55
|
-
expose:
|
|
45
|
+
setup(Te, {
|
|
46
|
+
expose: W
|
|
56
47
|
}) {
|
|
57
48
|
const {
|
|
58
49
|
t: s
|
|
59
|
-
} =
|
|
60
|
-
allReportPermissions:
|
|
61
|
-
} =
|
|
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 ?
|
|
64
|
-
return ["-", "All"].includes(t) ? () => null : () => u(
|
|
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", ["- ",
|
|
70
|
-
default: () => u(
|
|
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:
|
|
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 ?
|
|
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: () =>
|
|
76
|
+
onClick: () => L(e)
|
|
86
77
|
}, {
|
|
87
78
|
label: s("hr.role.remove.title"),
|
|
88
|
-
onClick: () =>
|
|
79
|
+
onClick: () => Q(e),
|
|
89
80
|
itemClass: "text-fm-color-typo-error",
|
|
90
|
-
disabled:
|
|
81
|
+
disabled: ue(e.permissions)
|
|
91
82
|
}];
|
|
92
83
|
}
|
|
93
|
-
const
|
|
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(
|
|
92
|
+
}, [m(D, {
|
|
102
93
|
items: N(e)
|
|
103
|
-
}, null)]),
|
|
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) =>
|
|
124
|
+
cell: (e) => G({
|
|
134
125
|
role: e.row.original,
|
|
135
126
|
className: "flex w-full items-center justify-end"
|
|
136
127
|
})
|
|
137
|
-
}],
|
|
128
|
+
}], L = async (e) => {
|
|
138
129
|
var o;
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
const e =
|
|
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 =
|
|
135
|
+
const c = B.restaurantsById.value.get(i.id);
|
|
145
136
|
return {
|
|
146
137
|
...i,
|
|
147
|
-
// Prefer live data from
|
|
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
|
-
}),
|
|
149
|
+
}), v = y(() => {
|
|
159
150
|
var o;
|
|
160
|
-
return (o =
|
|
161
|
-
const t = k.value.toLowerCase(), i = n.name.toLowerCase().includes(t), l = (n.restaurants || []).some((
|
|
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
|
|
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 =
|
|
168
|
-
breakpoints:
|
|
169
|
-
} =
|
|
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:
|
|
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
|
|
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) =>
|
|
182
|
+
})).catch((o) => E.open({
|
|
192
183
|
message: o,
|
|
193
184
|
type: "error"
|
|
194
185
|
})), P.close();
|
|
195
186
|
});
|
|
196
|
-
}, k =
|
|
197
|
-
async function
|
|
187
|
+
}, k = S(""), U = S(), g = S(void 0);
|
|
188
|
+
async function X() {
|
|
198
189
|
var e;
|
|
199
|
-
|
|
190
|
+
g.value = void 0, await z(), (e = U.value) == null || e.trigger();
|
|
200
191
|
}
|
|
201
|
-
async function
|
|
202
|
-
if (
|
|
192
|
+
async function Y() {
|
|
193
|
+
if (f.roles.value.length === 0)
|
|
203
194
|
try {
|
|
204
|
-
await
|
|
195
|
+
await f.readRoles();
|
|
205
196
|
} catch (e) {
|
|
206
|
-
console.error("Failed to load roles:", e),
|
|
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
|
|
213
|
-
|
|
214
|
-
}),
|
|
215
|
-
create:
|
|
203
|
+
return ee(() => {
|
|
204
|
+
Y();
|
|
205
|
+
}), W({
|
|
206
|
+
create: X
|
|
216
207
|
}), (e, o) => {
|
|
217
|
-
const n =
|
|
218
|
-
return
|
|
219
|
-
id:
|
|
220
|
-
key:
|
|
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:
|
|
223
|
-
}, null, 8, ["id"])), r("div",
|
|
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(
|
|
230
|
-
default:
|
|
231
|
-
"is-loading": a(
|
|
232
|
-
"is-empty":
|
|
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:
|
|
228
|
+
default: R(() => [m(t, {
|
|
238
229
|
class: "xs:hidden",
|
|
239
|
-
"column-defs":
|
|
240
|
-
"row-data":
|
|
241
|
-
"page-size":
|
|
242
|
-
loading: a(
|
|
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) =>
|
|
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",
|
|
240
|
+
}, 8, ["is-loading", "is-empty", "title", "subtitle"]), r("div", ye, [m(c, {
|
|
250
241
|
separator: ""
|
|
251
242
|
}, {
|
|
252
|
-
default:
|
|
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: (
|
|
246
|
+
onClick: (h) => L(l)
|
|
256
247
|
}, {
|
|
257
|
-
default:
|
|
258
|
-
onClick: o[2] || (o[2] =
|
|
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(
|
|
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
|
-
|
|
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-
|
|
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-C5j3D4eF.js";
|
|
4
4
|
function be() {
|
|
5
5
|
return oe.map((e) => ({ id: e.id, name: e.name }));
|
|
6
6
|
}
|