@feedmepos/mf-hrm-portal 2.0.20-dev.2 → 2.0.20-dev.4
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/{AuditLogList-ChxAzO74.js → AuditLogList-BYYLqx_Y.js} +4 -4
- package/dist/{EmployeeList-Cs-Mn6UA.js → EmployeeList-faGmAgin.js} +214 -206
- package/dist/{Main-B9_TyRDo.js → Main-BAKU5xhk.js} +9 -9
- package/dist/{Main-DcvmP7s-.js → Main-BqGguhdK.js} +4 -4
- package/dist/{Main-CdHW4UkN.js → Main-DYtpusvH.js} +5 -5
- package/dist/{PermissionSetList-VFVS0g0v.js → PermissionSetList-BkNXF5wd.js} +115 -107
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BSLC4-XO.js} +687 -674
- package/dist/{RoleList-BZ6RZvm2.js → RoleList-CU6fMUKg.js} +201 -193
- package/dist/{TeamMemberList-C-zhFauD.js → TeamMemberList-DWXfFltX.js} +427 -418
- package/dist/{TimesheetList-CZex54an.js → TimesheetList-oVhzBmO4.js} +6 -6
- package/dist/{app-CLL3p27X.js → app-C6YPb0ie.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CDt1i9vl.js → dayjs.min-DjBQkDnl.js} +1 -1
- package/dist/{employee-BpRvjWNh.js → employee-CgQNP7Yg.js} +3 -3
- package/dist/{iteration-BVjUzYL5.js → iteration-DK5wFKKW.js} +1 -1
- package/dist/{lodash-CrwgACp2.js → lodash-D2og8lPS.js} +1 -1
- package/dist/{rule-BlQ5YZ9Z.js → rule-CkKkOqTh.js} +2 -2
- package/dist/{timesheet-jFs4GTAL.js → timesheet-AUYF-qUh.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DMAL8VFY.js → useAppStore-BvpZCRgH.js} +1 -1
- package/dist/{useLoading-AFTjRLyO.js → useLoading-RPOCpcNO.js} +1 -1
- package/dist/{useReportPermissions-hODG0Xx3.js → useReportPermissions-wHthaWRW.js} +3 -3
- package/package.json +1 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as Ve, useCoreStore as
|
|
3
|
-
import { useSnackbar as
|
|
4
|
-
import { u as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { b as
|
|
7
|
-
import { u as
|
|
1
|
+
import { defineComponent as Se, resolveComponent as S, createElementBlock as A, openBlock as h, createElementVNode as r, createVNode as u, toDisplayString as P, unref as o, ref as v, computed as w, createCommentVNode as J, withCtx as ue, createBlock as H, watch as me, Fragment as ke, renderList as as, withKeys as Be, withModifiers as Fe, nextTick as ls, onUnmounted as os, h as ns, createTextVNode as rs } from "vue";
|
|
2
|
+
import { useI18n as Ve, useCoreStore as $e, baseClientInstance as je } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as Je, useDialog as is, useBreakpoints as us, components as Ne } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as ms, _ as ds } from "./useDebounce-CWb5QR9G.js";
|
|
5
|
+
import { _ as cs, S as be } from "./SelectFilter-DUj7GBtT.js";
|
|
6
|
+
import { b as Ee, m as ps, C as vs, _ as fs, a as bs } from "./app-C6YPb0ie.js";
|
|
7
|
+
import { u as _s, _ as ys } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
8
|
import { _ as hs } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
9
|
-
import { u as gs } from "./useLoading-
|
|
10
|
-
import { l as
|
|
11
|
-
import { g as
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as
|
|
9
|
+
import { u as gs } from "./useLoading-RPOCpcNO.js";
|
|
10
|
+
import { l as De } from "./lodash-D2og8lPS.js";
|
|
11
|
+
import { g as Le, d as pe, u as Xe } from "./iteration-DK5wFKKW.js";
|
|
12
|
+
import { u as Ze, c as Te, b as qe, m as Ie, d as Qe, p as Ke, i as xs, j as ze, k as Ge, l as Us, n as Fs, s as Ss, o as Vs, q as ws, t as Ue } from "./rule-CkKkOqTh.js";
|
|
13
|
+
import { u as Ye } from "./useAppStore-BvpZCRgH.js";
|
|
14
14
|
/* empty css */
|
|
15
|
-
import { _ as
|
|
15
|
+
import { _ as Ps } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BSLC4-XO.js";
|
|
16
16
|
var ye = /* @__PURE__ */ ((m) => (m.Update = "Update", m.Remove = "Remove", m))(ye || {});
|
|
17
|
-
const
|
|
17
|
+
const Is = { class: "w-full flex flex-col gap-16" }, ks = { class: "flex items-center gap-16" }, $s = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Cs = { class: "fm-typo-en-body-lg-600 truncate" }, Ms = { class: "w-full flex gap-16 items-center" }, Ns = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, As = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Bs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, js = { class: "fm-typo-en-body-lg-600 truncate" }, Es = /* @__PURE__ */ Se({
|
|
18
18
|
__name: "MemberInfo",
|
|
19
19
|
props: {
|
|
20
20
|
data: {}
|
|
21
21
|
},
|
|
22
22
|
setup(m) {
|
|
23
|
-
const { t:
|
|
23
|
+
const { t: O } = Ve();
|
|
24
24
|
return (n, a) => {
|
|
25
|
-
const d =
|
|
26
|
-
return
|
|
27
|
-
|
|
25
|
+
const d = S("FmAvatar");
|
|
26
|
+
return h(), A("div", Is, [
|
|
27
|
+
r("div", ks, [
|
|
28
28
|
u(d, {
|
|
29
29
|
size: "xl",
|
|
30
30
|
initials: m.data.name
|
|
31
31
|
}, null, 8, ["initials"]),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
r("div", $s, [
|
|
33
|
+
r("p", Rs, P(o(O)("team.memberForm.memberInfo.memberName")), 1),
|
|
34
|
+
r("p", Cs, P(m.data.name || "--"), 1)
|
|
35
35
|
])
|
|
36
36
|
]),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
r("div", Ms, [
|
|
38
|
+
r("div", Ns, [
|
|
39
|
+
r("p", Ds, P(o(O)("team.memberForm.memberInfo.mobileNumber")), 1),
|
|
40
|
+
r("p", As, P(m.data.phoneNumber || "--"), 1)
|
|
41
41
|
]),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
r("div", Os, [
|
|
43
|
+
r("p", Bs, P(o(O)("team.memberForm.memberInfo.emailAddress")), 1),
|
|
44
|
+
r("p", js, P(m.data.email || "--"), 1)
|
|
45
45
|
])
|
|
46
46
|
])
|
|
47
47
|
]);
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), We = {
|
|
51
51
|
async readPermissionUserByPhoneNo(m) {
|
|
52
52
|
var n;
|
|
53
|
-
const { currentBusiness:
|
|
54
|
-
return
|
|
55
|
-
await
|
|
53
|
+
const { currentBusiness: O } = $e();
|
|
54
|
+
return Le(
|
|
55
|
+
await je("/").get(`/user/b/${(n = O.value) == null ? void 0 : n._id}/phone/${m}`)
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
async readPermissionUserByEmail(m) {
|
|
59
59
|
var n;
|
|
60
|
-
const { currentBusiness:
|
|
61
|
-
return
|
|
62
|
-
await
|
|
60
|
+
const { currentBusiness: O } = $e();
|
|
61
|
+
return Le(
|
|
62
|
+
await je("/").get(`/user/b/${(n = O.value) == null ? void 0 : n._id}/email/${m}`)
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, Ls = { class: "flex flex-col gap-24 w-full" }, Ts = {
|
|
66
66
|
key: 0,
|
|
67
67
|
class: "flex flex-col gap-8"
|
|
68
|
-
},
|
|
68
|
+
}, qs = { class: "user-info-icon user-info-icon--lg" }, Ks = { class: "flex-1 overflow-hidden" }, zs = { class: "profile-displayName" }, Gs = { class: "profile-email" }, Ws = { class: "profile-phone" }, Js = { key: 2 }, Xs = /* @__PURE__ */ Se({
|
|
69
69
|
__name: "PortalUserSearcher",
|
|
70
70
|
emits: ["invite"],
|
|
71
|
-
setup(m, { emit:
|
|
72
|
-
const n =
|
|
71
|
+
setup(m, { emit: O }) {
|
|
72
|
+
const n = O, { t: a } = Ve(), d = Je(), R = $e(), C = v("phone"), x = v(""), B = v(""), p = v();
|
|
73
73
|
async function b() {
|
|
74
74
|
if (!x.value && !B.value) {
|
|
75
75
|
d.open({
|
|
@@ -78,54 +78,54 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
78
78
|
});
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const V = C.value === "phone" ? await We.readPermissionUserByPhoneNo(x.value.replace(/ /g, "")) : await We.readPermissionUserByEmail(B.value);
|
|
82
|
+
V || d.open({
|
|
83
83
|
type: "error",
|
|
84
84
|
title: a("team.memberForm.searchUser.userNotFound")
|
|
85
|
-
}), p.value =
|
|
85
|
+
}), p.value = V;
|
|
86
86
|
}
|
|
87
|
-
const ee =
|
|
88
|
-
var
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
const [
|
|
92
|
-
return D ? `${
|
|
87
|
+
const ee = w(() => {
|
|
88
|
+
var q;
|
|
89
|
+
let V = ((q = p.value) == null ? void 0 : q.displayName) ?? "";
|
|
90
|
+
V || (V = "Feed Me");
|
|
91
|
+
const [_, D] = V.split(" ");
|
|
92
|
+
return D ? `${_[0]}${D[0]}` : _.slice(0, 2);
|
|
93
93
|
}), E = v(!1);
|
|
94
|
-
function
|
|
95
|
-
n("invite",
|
|
94
|
+
function oe(V) {
|
|
95
|
+
n("invite", V), E.value = !0;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function T() {
|
|
98
98
|
E.value = !1;
|
|
99
99
|
}
|
|
100
|
-
return (
|
|
101
|
-
var
|
|
102
|
-
const D =
|
|
103
|
-
return
|
|
104
|
-
E.value ? J("", !0) : (
|
|
105
|
-
u(
|
|
106
|
-
modelValue:
|
|
107
|
-
"onUpdate:modelValue":
|
|
100
|
+
return (V, _) => {
|
|
101
|
+
var g, M, X;
|
|
102
|
+
const D = S("FmRadio"), q = S("FmPhoneNumber"), ae = S("FmTextField"), i = S("FmRadioGroup"), l = S("FmButton");
|
|
103
|
+
return h(), A("div", Ls, [
|
|
104
|
+
E.value ? J("", !0) : (h(), A("div", Ts, [
|
|
105
|
+
u(i, {
|
|
106
|
+
modelValue: C.value,
|
|
107
|
+
"onUpdate:modelValue": _[2] || (_[2] = (j) => C.value = j)
|
|
108
108
|
}, {
|
|
109
|
-
default:
|
|
109
|
+
default: ue(() => [
|
|
110
110
|
u(D, {
|
|
111
111
|
value: "phone",
|
|
112
112
|
label: o(a)("team.memberForm.searchUser.phoneNumber")
|
|
113
113
|
}, null, 8, ["label"]),
|
|
114
|
-
|
|
114
|
+
C.value === "phone" ? (h(), H(q, {
|
|
115
115
|
key: 0,
|
|
116
116
|
modelValue: x.value,
|
|
117
|
-
"onUpdate:modelValue":
|
|
118
|
-
"extra-country-codes": o(
|
|
117
|
+
"onUpdate:modelValue": _[0] || (_[0] = (j) => x.value = j),
|
|
118
|
+
"extra-country-codes": o(R).enabledCountries.value,
|
|
119
119
|
class: "ml-8"
|
|
120
120
|
}, null, 8, ["modelValue", "extra-country-codes"])) : J("", !0),
|
|
121
121
|
u(D, {
|
|
122
122
|
value: "email",
|
|
123
123
|
label: o(a)("team.memberForm.searchUser.email")
|
|
124
124
|
}, null, 8, ["label"]),
|
|
125
|
-
|
|
125
|
+
C.value === "email" ? (h(), H(ae, {
|
|
126
126
|
key: 1,
|
|
127
127
|
modelValue: B.value,
|
|
128
|
-
"onUpdate:modelValue":
|
|
128
|
+
"onUpdate:modelValue": _[1] || (_[1] = (j) => B.value = j),
|
|
129
129
|
placeholder: o(a)("team.memberForm.searchUser.emailPlaceholder"),
|
|
130
130
|
class: "ml-8"
|
|
131
131
|
}, null, 8, ["modelValue", "placeholder"])) : J("", !0)
|
|
@@ -138,29 +138,29 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
138
138
|
onClick: b
|
|
139
139
|
}, null, 8, ["label"])
|
|
140
140
|
])),
|
|
141
|
-
p.value ? (
|
|
141
|
+
p.value ? (h(), A("div", {
|
|
142
142
|
key: 1,
|
|
143
143
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
144
|
-
onClick:
|
|
144
|
+
onClick: _[3] || (_[3] = (j) => oe(p.value))
|
|
145
145
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
r("div", qs, P(ee.value), 1),
|
|
147
|
+
r("div", Ks, [
|
|
148
|
+
r("p", zs, P((g = p.value) == null ? void 0 : g.displayName), 1),
|
|
149
|
+
r("p", Gs, P((M = p.value) == null ? void 0 : M.email), 1),
|
|
150
|
+
r("p", Ws, P((X = p.value) == null ? void 0 : X.phoneNumber), 1)
|
|
151
151
|
])
|
|
152
152
|
])) : J("", !0),
|
|
153
|
-
E.value ? (
|
|
153
|
+
E.value ? (h(), A("div", Js, [
|
|
154
154
|
u(l, {
|
|
155
155
|
label: o(a)("team.memberForm.searchUser.changeUser"),
|
|
156
156
|
variant: "secondary",
|
|
157
|
-
onClick:
|
|
157
|
+
onClick: T
|
|
158
158
|
}, null, 8, ["label"])
|
|
159
159
|
])) : J("", !0)
|
|
160
160
|
]);
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
}),
|
|
163
|
+
}), Zs = /* @__PURE__ */ cs(Xs, [["__scopeId", "data-v-c2c7ed35"]]), Qs = { class: "flex flex-col gap-40" }, Ys = { class: "flex items-center" }, Hs = { class: "flex-1 flex flex-col" }, et = { class: "fm-typo-en-title-sm-600" }, st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tt = { class: "flex flex-row gap-16" }, at = { class: "flex flex-col gap-8" }, lt = { class: "fm-typo-en-body-lg-400" }, ot = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, nt = { class: "fm-typo-en-title-sm-600" }, rt = { class: "space-y-16" }, it = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ut = { class: "text-sm font-semibold text-fm-color-typo-primary" }, mt = { class: "text-sm font-semibold text-fm-color-typo-primary" }, dt = { class: "flex justify-self-end" }, ct = ["aria-label", "onClick", "onKeydown"], Ae = 4, pt = /* @__PURE__ */ Se({
|
|
164
164
|
__name: "TeamMemberMasterUser",
|
|
165
165
|
props: {
|
|
166
166
|
modelValue: {
|
|
@@ -185,133 +185,133 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
187
|
emits: ["update:model-value"],
|
|
188
|
-
setup(m, { emit:
|
|
189
|
-
const n = m, a =
|
|
188
|
+
setup(m, { emit: O }) {
|
|
189
|
+
const n = m, a = O, { t: d } = Ve(), R = v(!0), C = v([]);
|
|
190
190
|
function x() {
|
|
191
191
|
return { restaurantId: "", roleId: "" };
|
|
192
192
|
}
|
|
193
|
-
const B =
|
|
193
|
+
const B = w(
|
|
194
194
|
() => {
|
|
195
|
-
var
|
|
196
|
-
return ((
|
|
195
|
+
var i;
|
|
196
|
+
return ((i = n.modelValue) == null ? void 0 : i.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
|
-
function p(
|
|
200
|
-
|
|
199
|
+
function p(i) {
|
|
200
|
+
i ? n.modelValue || a("update:model-value", {
|
|
201
201
|
code: "",
|
|
202
202
|
name: n.fallbackName,
|
|
203
203
|
roles: [x()],
|
|
204
204
|
passcode: n.fallbackPasscode || ""
|
|
205
205
|
}) : a("update:model-value", null);
|
|
206
206
|
}
|
|
207
|
-
function b(
|
|
208
|
-
if (!n.modelValue ||
|
|
209
|
-
const
|
|
210
|
-
|
|
207
|
+
function b(i, l) {
|
|
208
|
+
if (!n.modelValue || i === "passcode" && n.modelValue.passcode === l) return;
|
|
209
|
+
const g = pe(n.modelValue);
|
|
210
|
+
g[i] = l, a("update:model-value", g);
|
|
211
211
|
}
|
|
212
|
-
function ee(
|
|
213
|
-
return n.restaurants.filter((l) => l.managable || l._id ===
|
|
212
|
+
function ee(i = "") {
|
|
213
|
+
return n.restaurants.filter((l) => l.managable || l._id === i).map((l) => ({
|
|
214
214
|
label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
|
|
215
215
|
value: l._id,
|
|
216
|
-
disabled: B.value.includes(l._id) && l._id !==
|
|
216
|
+
disabled: B.value.includes(l._id) && l._id !== i
|
|
217
217
|
}));
|
|
218
218
|
}
|
|
219
|
-
function E(
|
|
219
|
+
function E(i = "") {
|
|
220
220
|
return n.roles.map((l) => ({
|
|
221
221
|
label: l.label,
|
|
222
222
|
value: l.value,
|
|
223
|
-
disabled: !!l.disabled && l.value !==
|
|
223
|
+
disabled: !!l.disabled && l.value !== i
|
|
224
224
|
}));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
var
|
|
226
|
+
function oe(i, l) {
|
|
227
|
+
var K, L, z;
|
|
228
228
|
if (!n.modelValue) return;
|
|
229
|
-
const
|
|
230
|
-
|
|
229
|
+
const g = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()], M = ((K = g[i]) == null ? void 0 : K.roleId) ?? "", X = E(M), j = ((L = X.find((c) => c.value === M && !c.disabled)) == null ? void 0 : L.value) ?? ((z = X.find((c) => !c.disabled)) == null ? void 0 : z.value) ?? "";
|
|
230
|
+
g[i] = { restaurantId: l, roleId: j }, b("roles", g);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
var
|
|
232
|
+
function T(i, l) {
|
|
233
|
+
var M;
|
|
234
234
|
if (!n.modelValue) return;
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
restaurantId: ((
|
|
235
|
+
const g = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
|
|
236
|
+
g[i] = {
|
|
237
|
+
restaurantId: ((M = g[i]) == null ? void 0 : M.restaurantId) ?? "",
|
|
238
238
|
roleId: l
|
|
239
|
-
}, b("roles",
|
|
239
|
+
}, b("roles", g);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function V() {
|
|
242
242
|
n.modelValue && b("roles", [...n.modelValue.roles, x()]);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function _(i) {
|
|
245
245
|
if (!n.modelValue) return;
|
|
246
246
|
const l = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
|
|
247
247
|
b(
|
|
248
248
|
"roles",
|
|
249
|
-
l.length === 1 ? [x()] : l.filter((
|
|
249
|
+
l.length === 1 ? [x()] : l.filter((g, M) => M !== i)
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
|
-
const D =
|
|
252
|
+
const D = w(() => {
|
|
253
253
|
if (!n.modelValue) return !1;
|
|
254
|
-
const
|
|
255
|
-
(
|
|
254
|
+
const i = n.restaurants.some(
|
|
255
|
+
(g) => g.managable && !B.value.includes(g._id)
|
|
256
256
|
), l = n.modelValue.roles.every(
|
|
257
|
-
(
|
|
257
|
+
(g) => g.restaurantId && g.roleId
|
|
258
258
|
);
|
|
259
|
-
return
|
|
259
|
+
return i && l;
|
|
260
260
|
});
|
|
261
|
-
function
|
|
262
|
-
|
|
261
|
+
function q() {
|
|
262
|
+
R.value && (R.value = !1, C.value = [], b("passcode", ""));
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
me(
|
|
265
265
|
() => {
|
|
266
|
-
var
|
|
267
|
-
return (
|
|
266
|
+
var i;
|
|
267
|
+
return (i = n.modelValue) == null ? void 0 : i.passcode;
|
|
268
268
|
},
|
|
269
|
-
(
|
|
270
|
-
|
|
269
|
+
(i) => {
|
|
270
|
+
i && i.length === Ae ? (C.value = i.split(""), R.value = !0) : (C.value = [], R.value = !1);
|
|
271
271
|
},
|
|
272
272
|
{ immediate: !0 }
|
|
273
|
-
),
|
|
273
|
+
), me(
|
|
274
274
|
() => {
|
|
275
|
-
var
|
|
276
|
-
return (
|
|
275
|
+
var i;
|
|
276
|
+
return (i = n.modelValue) == null ? void 0 : i.roles;
|
|
277
277
|
},
|
|
278
|
-
(
|
|
279
|
-
n.modelValue && (!
|
|
278
|
+
(i) => {
|
|
279
|
+
n.modelValue && (!i || i.length === 0) && b("roles", [x()]);
|
|
280
280
|
},
|
|
281
281
|
{ immediate: !0, deep: !0 }
|
|
282
282
|
);
|
|
283
|
-
const ae =
|
|
283
|
+
const ae = w({
|
|
284
284
|
get: () => {
|
|
285
|
-
var
|
|
286
|
-
return ((
|
|
285
|
+
var i;
|
|
286
|
+
return ((i = n.modelValue) == null ? void 0 : i.roles) ?? [];
|
|
287
287
|
},
|
|
288
288
|
set: () => {
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
return (
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
291
|
+
return (i, l) => {
|
|
292
|
+
const g = S("FmSwitch"), M = S("FmTextField"), X = S("FmPinField"), j = S("FmFormGroup"), K = S("FmSelect"), L = S("FmIcon"), z = S("FmButton");
|
|
293
|
+
return h(), A("div", Qs, [
|
|
294
|
+
r("div", Ys, [
|
|
295
|
+
r("div", Hs, [
|
|
296
|
+
r("div", et, P(o(d)("team.memberForm.masterUser.title")), 1),
|
|
297
|
+
r("div", st, P(o(d)("team.memberForm.masterUser.sublabel")), 1)
|
|
298
298
|
]),
|
|
299
|
-
|
|
300
|
-
u(
|
|
299
|
+
r("div", null, [
|
|
300
|
+
u(g, {
|
|
301
301
|
"model-value": !!m.modelValue,
|
|
302
302
|
value: "master-user",
|
|
303
303
|
"onUpdate:modelValue": p
|
|
304
304
|
}, null, 8, ["model-value"])
|
|
305
305
|
])
|
|
306
306
|
]),
|
|
307
|
-
m.modelValue ? (
|
|
308
|
-
|
|
309
|
-
u(
|
|
307
|
+
m.modelValue ? (h(), A(ke, { key: 0 }, [
|
|
308
|
+
r("div", tt, [
|
|
309
|
+
u(M, {
|
|
310
310
|
"model-value": m.modelValue.code,
|
|
311
311
|
label: o(d)("team.memberForm.masterUser.code"),
|
|
312
312
|
"onUpdate:modelValue": l[0] || (l[0] = (c) => b("code", c))
|
|
313
313
|
}, null, 8, ["model-value", "label"]),
|
|
314
|
-
u(
|
|
314
|
+
u(M, {
|
|
315
315
|
"model-value": m.modelValue.name,
|
|
316
316
|
class: "w-full",
|
|
317
317
|
label: o(d)("team.memberForm.masterUser.name"),
|
|
@@ -319,24 +319,24 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
319
319
|
"onUpdate:modelValue": l[1] || (l[1] = (c) => b("name", c))
|
|
320
320
|
}, null, 8, ["model-value", "label", "rules"])
|
|
321
321
|
]),
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
r("div", at, [
|
|
323
|
+
r("div", lt, P(o(d)("team.memberForm.masterUser.passcode")), 1),
|
|
324
324
|
u(j, {
|
|
325
|
-
modelValue:
|
|
326
|
-
"onUpdate:modelValue": l[4] || (l[4] = (c) =>
|
|
325
|
+
modelValue: C.value,
|
|
326
|
+
"onUpdate:modelValue": l[4] || (l[4] = (c) => C.value = c),
|
|
327
327
|
rules: [
|
|
328
|
-
(c) => (c == null ? void 0 : c.filter((
|
|
328
|
+
(c) => (c == null ? void 0 : c.filter((y) => !!y).length) !== Ae ? o(d)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
329
329
|
]
|
|
330
330
|
}, {
|
|
331
|
-
default:
|
|
332
|
-
(
|
|
333
|
-
key: `pin-field-${
|
|
334
|
-
modelValue:
|
|
335
|
-
"onUpdate:modelValue": l[2] || (l[2] = (c) =>
|
|
336
|
-
length:
|
|
337
|
-
masked:
|
|
331
|
+
default: ue(() => [
|
|
332
|
+
(h(), H(X, {
|
|
333
|
+
key: `pin-field-${R.value}`,
|
|
334
|
+
modelValue: C.value,
|
|
335
|
+
"onUpdate:modelValue": l[2] || (l[2] = (c) => C.value = c),
|
|
336
|
+
length: Ae,
|
|
337
|
+
masked: R.value,
|
|
338
338
|
onComplete: l[3] || (l[3] = (c) => b("passcode", c)),
|
|
339
|
-
onFocus:
|
|
339
|
+
onFocus: q
|
|
340
340
|
}, null, 8, ["modelValue", "masked"]))
|
|
341
341
|
]),
|
|
342
342
|
_: 1
|
|
@@ -347,61 +347,61 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
347
347
|
modelValue: ae.value,
|
|
348
348
|
"onUpdate:modelValue": l[5] || (l[5] = (c) => ae.value = c),
|
|
349
349
|
rules: [
|
|
350
|
-
(c) => !c || c.length === 0 || c.every((
|
|
350
|
+
(c) => !c || c.length === 0 || c.every((y) => !y.restaurantId) ? o(d)("team.memberForm.masterUser.restaurantRequired") : c.some((y) => !y.restaurantId || !y.roleId) ? o(d)("team.memberForm.masterUser.roleRequired") : !0
|
|
351
351
|
]
|
|
352
352
|
}, {
|
|
353
|
-
default:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
l[6] || (l[6] =
|
|
353
|
+
default: ue(() => [
|
|
354
|
+
r("div", ot, [
|
|
355
|
+
r("div", nt, P(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
|
|
356
|
+
r("div", rt, [
|
|
357
|
+
r("div", it, [
|
|
358
|
+
r("div", ut, P(o(d)("team.table.columns.restaurant")), 1),
|
|
359
|
+
r("div", mt, P(o(d)("team.memberForm.masterUser.role")), 1),
|
|
360
|
+
l[6] || (l[6] = r("div", null, null, -1))
|
|
361
361
|
]),
|
|
362
|
-
(
|
|
363
|
-
key: `${c.restaurantId || "new"}-${
|
|
362
|
+
(h(!0), A(ke, null, as(m.modelValue.roles, (c, y) => (h(), A("div", {
|
|
363
|
+
key: `${c.restaurantId || "new"}-${y}`,
|
|
364
364
|
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
365
365
|
}, [
|
|
366
|
-
u(
|
|
366
|
+
u(K, {
|
|
367
367
|
class: "min-w-0",
|
|
368
368
|
"model-value": c.restaurantId,
|
|
369
369
|
items: ee(c.restaurantId),
|
|
370
370
|
multiselect: !1,
|
|
371
371
|
placeholder: o(d)("team.table.columns.restaurant"),
|
|
372
|
-
"onUpdate:modelValue": (
|
|
372
|
+
"onUpdate:modelValue": (G) => oe(y, G)
|
|
373
373
|
}, null, 8, ["model-value", "items", "placeholder", "onUpdate:modelValue"]),
|
|
374
|
-
u(
|
|
374
|
+
u(K, {
|
|
375
375
|
class: "min-w-0",
|
|
376
376
|
"model-value": c.roleId,
|
|
377
377
|
items: E(c.roleId),
|
|
378
378
|
multiselect: !1,
|
|
379
379
|
placeholder: o(d)("team.memberForm.masterUser.role"),
|
|
380
380
|
disabled: !c.restaurantId,
|
|
381
|
-
"onUpdate:modelValue": (
|
|
381
|
+
"onUpdate:modelValue": (G) => T(y, G)
|
|
382
382
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
383
|
-
|
|
384
|
-
m.modelValue.roles.length > 1 ? (
|
|
383
|
+
r("div", dt, [
|
|
384
|
+
m.modelValue.roles.length > 1 ? (h(), A("div", {
|
|
385
385
|
key: 0,
|
|
386
386
|
role: "button",
|
|
387
387
|
tabindex: "0",
|
|
388
388
|
class: "inline-flex h-40 w-40 shrink-0 cursor-pointer items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary",
|
|
389
389
|
"aria-label": o(d)("common.remove"),
|
|
390
|
-
onClick:
|
|
390
|
+
onClick: Fe((G) => _(y), ["stop"]),
|
|
391
391
|
onKeydown: [
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
Be(Fe((G) => _(y), ["prevent", "stop"]), ["enter"]),
|
|
393
|
+
Be(Fe((G) => _(y), ["prevent", "stop"]), ["space"])
|
|
394
394
|
]
|
|
395
395
|
}, [
|
|
396
396
|
u(L, {
|
|
397
397
|
name: "delete",
|
|
398
398
|
size: "md"
|
|
399
399
|
})
|
|
400
|
-
], 40,
|
|
400
|
+
], 40, ct)) : J("", !0)
|
|
401
401
|
])
|
|
402
402
|
]))), 128))
|
|
403
403
|
]),
|
|
404
|
-
u(
|
|
404
|
+
u(z, {
|
|
405
405
|
type: "button",
|
|
406
406
|
variant: "secondary",
|
|
407
407
|
"text-color": "primary",
|
|
@@ -410,7 +410,7 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
410
410
|
label: o(d)("team.memberForm.masterUser.addAnother"),
|
|
411
411
|
size: "md",
|
|
412
412
|
disabled: !D.value,
|
|
413
|
-
onClick:
|
|
413
|
+
onClick: Fe(V, ["stop"])
|
|
414
414
|
}, null, 8, ["label", "disabled"])
|
|
415
415
|
])
|
|
416
416
|
]),
|
|
@@ -420,13 +420,13 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
420
420
|
]);
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
}),
|
|
423
|
+
}), vt = { class: "flex flex-col gap-32" }, ft = { class: "flex w-full" }, bt = {
|
|
424
424
|
key: 0,
|
|
425
425
|
class: "space-y-24"
|
|
426
|
-
},
|
|
426
|
+
}, _t = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, yt = { class: "fm-typo-en-title-sm-600" }, ht = { class: "space-y-16" }, gt = { class: "fm-typo-en-title-sm-600" }, xt = {
|
|
427
427
|
key: 1,
|
|
428
428
|
class: "flex items-center justify-center py-64"
|
|
429
|
-
},
|
|
429
|
+
}, Ut = /* @__PURE__ */ Se({
|
|
430
430
|
__name: "AddMemberForm",
|
|
431
431
|
props: {
|
|
432
432
|
initialValue: {
|
|
@@ -441,38 +441,38 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
441
441
|
default: !1
|
|
442
442
|
}
|
|
443
443
|
},
|
|
444
|
-
setup(m, { expose:
|
|
445
|
-
var
|
|
446
|
-
const n = m, { t: a } = Ve(), d = v(),
|
|
447
|
-
() =>
|
|
444
|
+
setup(m, { expose: O }) {
|
|
445
|
+
var fe, he, ge;
|
|
446
|
+
const n = m, { t: a } = Ve(), d = v(), R = Ze(), C = w(
|
|
447
|
+
() => R.permissionSets.value.map((t) => ({
|
|
448
448
|
label: t.name,
|
|
449
449
|
value: t.id
|
|
450
450
|
}))
|
|
451
|
-
), x = v(((
|
|
452
|
-
() =>
|
|
453
|
-
), p = v((
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
((
|
|
451
|
+
), x = v(((fe = n.initialValue) == null ? void 0 : fe.permissionSetIds) || []), B = w(
|
|
452
|
+
() => Te(x.value, R.permissionSets.value)
|
|
453
|
+
), p = v((he = n.initialValue) == null ? void 0 : he.posUser), b = v(
|
|
454
|
+
qe(
|
|
455
|
+
Ie(B.value),
|
|
456
|
+
((ge = n.initialValue) == null ? void 0 : ge.permissions) || []
|
|
457
457
|
)
|
|
458
|
-
), { customReportPermissions: ee, isLoaded: E } =
|
|
459
|
-
|
|
460
|
-
),
|
|
461
|
-
const t = new Set(
|
|
458
|
+
), { customReportPermissions: ee, isLoaded: E } = Qe(), oe = new Set(
|
|
459
|
+
Ke.filter((t) => t.subject.startsWith(xs)).map((t) => t.subject)
|
|
460
|
+
), T = w(() => {
|
|
461
|
+
const t = new Set(oe);
|
|
462
462
|
for (const f of ee.value) t.add(f.subject);
|
|
463
463
|
return t;
|
|
464
|
-
}),
|
|
464
|
+
}), V = w(() => {
|
|
465
465
|
const t = /* @__PURE__ */ new Set();
|
|
466
|
-
for (const f of
|
|
467
|
-
f.category ===
|
|
466
|
+
for (const f of Ke)
|
|
467
|
+
f.category === Ee.reports && t.add(f.subject);
|
|
468
468
|
for (const f of ee.value)
|
|
469
|
-
f.category ===
|
|
469
|
+
f.category === Ee.reports && t.add(f.subject);
|
|
470
470
|
return t;
|
|
471
|
-
}),
|
|
472
|
-
const t =
|
|
473
|
-
return t === null ?
|
|
474
|
-
}),
|
|
475
|
-
const t =
|
|
471
|
+
}), _ = Xe(), D = Ye().roles, q = w(() => ze(b.value)), ae = w(() => {
|
|
472
|
+
const t = Ge(b.value);
|
|
473
|
+
return t === null ? _.restaurants.value : _.restaurants.value.filter((f) => t.includes(f._id));
|
|
474
|
+
}), i = w(() => {
|
|
475
|
+
const t = q.value;
|
|
476
476
|
return D.value.map(
|
|
477
477
|
(f) => ({
|
|
478
478
|
label: f.name,
|
|
@@ -481,130 +481,130 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
481
481
|
})
|
|
482
482
|
);
|
|
483
483
|
}), l = v({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
|
|
484
|
-
function
|
|
485
|
-
d.value = void 0, x.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], b.value =
|
|
486
|
-
|
|
487
|
-
|
|
484
|
+
function g(t) {
|
|
485
|
+
d.value = void 0, x.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], b.value = qe(
|
|
486
|
+
Ie(
|
|
487
|
+
Te(
|
|
488
488
|
x.value,
|
|
489
|
-
|
|
489
|
+
R.permissionSets.value
|
|
490
490
|
)
|
|
491
491
|
),
|
|
492
492
|
(t == null ? void 0 : t.permissions) || []
|
|
493
|
-
), p.value = t != null && t.posUser ?
|
|
493
|
+
), p.value = t != null && t.posUser ? y(pe(t.posUser), b.value) : void 0, G.value = !!p.value, l.value = {
|
|
494
494
|
permissionSetIds: [...x.value],
|
|
495
|
-
userPermissions:
|
|
496
|
-
posUser: p.value ?
|
|
495
|
+
userPermissions: pe(b.value),
|
|
496
|
+
posUser: p.value ? pe(p.value) : void 0
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
return !n.initialValue && d.value ? !0 : !
|
|
499
|
+
function M() {
|
|
500
|
+
return !n.initialValue && d.value ? !0 : !De.isEqual(x.value, l.value.permissionSetIds) || !De.isEqual(b.value, l.value.userPermissions) || !De.isEqual(p.value, l.value.posUser);
|
|
501
501
|
}
|
|
502
502
|
function X(t) {
|
|
503
503
|
d.value = t;
|
|
504
504
|
}
|
|
505
505
|
function j(t) {
|
|
506
|
-
p.value =
|
|
506
|
+
p.value = y(p.value, t);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
const t =
|
|
510
|
-
return
|
|
508
|
+
function K() {
|
|
509
|
+
const t = Ie(B.value), f = E.value ? T.value : oe, I = Us(b.value, f), k = Fs(I, V.value), $ = Ss(k);
|
|
510
|
+
return Vs(t, $);
|
|
511
511
|
}
|
|
512
512
|
function L() {
|
|
513
|
-
var I, k,
|
|
514
|
-
const t =
|
|
513
|
+
var I, k, $, Z, re, ie, de, se, Q, ce;
|
|
514
|
+
const t = K(), f = b.value.filter((Y) => !Y.inverted);
|
|
515
515
|
return {
|
|
516
516
|
email: ((I = d.value) == null ? void 0 : I.email) ?? void 0,
|
|
517
517
|
phoneNumber: ((k = d.value) == null ? void 0 : k.phoneNumber) ?? void 0,
|
|
518
518
|
customPermissions: t,
|
|
519
519
|
permissions: f.map((Y) => ({
|
|
520
520
|
...Y,
|
|
521
|
-
subject:
|
|
521
|
+
subject: ps(Y.subject)
|
|
522
522
|
})),
|
|
523
523
|
permissionSetIds: x.value,
|
|
524
|
-
name: ((
|
|
524
|
+
name: (($ = d.value) == null ? void 0 : $.displayName) || ((Z = n.initialValue) == null ? void 0 : Z.name) || "",
|
|
525
525
|
posUser: p.value ? {
|
|
526
526
|
...p.value,
|
|
527
|
-
name: p.value.name || ((
|
|
528
|
-
code: p.value.code || ((
|
|
527
|
+
name: p.value.name || ((ie = (re = n.initialValue) == null ? void 0 : re.posUser) == null ? void 0 : ie.name) || ((de = n.initialValue) == null ? void 0 : de.name) || ((se = d.value) == null ? void 0 : se.displayName) || "",
|
|
528
|
+
code: p.value.code || ((ce = (Q = n.initialValue) == null ? void 0 : Q.posUser) == null ? void 0 : ce.code) || "",
|
|
529
529
|
passcode: p.value.passcode,
|
|
530
530
|
roles: p.value.roles.filter((Y) => !!Y.roleId)
|
|
531
531
|
} : p.value === null ? null : void 0
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
const
|
|
534
|
+
const z = v();
|
|
535
535
|
function c() {
|
|
536
|
-
b.value =
|
|
536
|
+
b.value = Ie(B.value);
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function y(t, f) {
|
|
539
539
|
if (!t) return t;
|
|
540
|
-
const I =
|
|
540
|
+
const I = ze(f), k = Ge(f);
|
|
541
541
|
if (I === null && k === null) return t;
|
|
542
|
-
const
|
|
543
|
-
return
|
|
542
|
+
const $ = pe(t);
|
|
543
|
+
return $.roles = $.roles.filter(
|
|
544
544
|
(Z) => (I === null || I.includes(Z.roleId)) && (k === null || k.includes(Z.restaurantId))
|
|
545
|
-
),
|
|
545
|
+
), $;
|
|
546
546
|
}
|
|
547
|
-
const
|
|
547
|
+
const G = v(!!p.value), ve = v(!1);
|
|
548
548
|
function Re(t) {
|
|
549
|
-
p.value = t,
|
|
549
|
+
p.value = t, ve.value = !0;
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
me(
|
|
552
552
|
() => !!p.value,
|
|
553
553
|
async (t) => {
|
|
554
|
-
t && !
|
|
554
|
+
t && !G.value && ve.value && (await ls(), z.value && z.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), G.value = t;
|
|
555
555
|
}
|
|
556
556
|
);
|
|
557
|
-
const
|
|
557
|
+
const ne = v();
|
|
558
558
|
async function we() {
|
|
559
|
-
return (await
|
|
559
|
+
return (await ne.value.validateInputsWithoutSubmit()).length ? null : L();
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return me(
|
|
562
562
|
() => n.initialValue,
|
|
563
563
|
(t, f) => {
|
|
564
564
|
if (!f || !t) {
|
|
565
|
-
|
|
565
|
+
ve.value = !1, g(t);
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
568
|
-
t.posUser !== void 0 && !
|
|
568
|
+
t.posUser !== void 0 && !ve.value && (p.value = t.posUser ? y(pe(t.posUser), b.value) : void 0, l.value = {
|
|
569
569
|
...l.value,
|
|
570
|
-
posUser: p.value ?
|
|
570
|
+
posUser: p.value ? pe(p.value) : void 0
|
|
571
571
|
});
|
|
572
572
|
},
|
|
573
573
|
{ immediate: !0 }
|
|
574
|
-
),
|
|
574
|
+
), me(
|
|
575
575
|
b,
|
|
576
576
|
(t) => {
|
|
577
|
-
p.value =
|
|
577
|
+
p.value = y(p.value, t);
|
|
578
578
|
},
|
|
579
579
|
{ deep: !0 }
|
|
580
|
-
),
|
|
580
|
+
), O({
|
|
581
581
|
readFormData: L,
|
|
582
582
|
validate: we,
|
|
583
|
-
isModified:
|
|
583
|
+
isModified: M
|
|
584
584
|
}), (t, f) => {
|
|
585
|
-
const I =
|
|
586
|
-
return
|
|
585
|
+
const I = S("FmSelect"), k = S("FmCircularProgress"), $ = S("FmForm");
|
|
586
|
+
return h(), H($, {
|
|
587
587
|
ref_key: "formRef",
|
|
588
|
-
ref:
|
|
588
|
+
ref: ne,
|
|
589
589
|
class: "mx-4"
|
|
590
590
|
}, {
|
|
591
|
-
default:
|
|
592
|
-
var Z,
|
|
591
|
+
default: ue(() => {
|
|
592
|
+
var Z, re, ie, de, se;
|
|
593
593
|
return [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
m.initialValue ? (
|
|
594
|
+
r("div", vt, [
|
|
595
|
+
r("div", ft, [
|
|
596
|
+
m.initialValue ? (h(), H(Es, {
|
|
597
597
|
key: 1,
|
|
598
598
|
data: m.initialValue
|
|
599
|
-
}, null, 8, ["data"])) : (
|
|
599
|
+
}, null, 8, ["data"])) : (h(), H(Zs, {
|
|
600
600
|
key: 0,
|
|
601
601
|
onInvite: f[0] || (f[0] = (Q) => X(Q))
|
|
602
602
|
}))
|
|
603
603
|
]),
|
|
604
|
-
d.value || m.initialValue ? (
|
|
605
|
-
(Z = m.initialValue) != null && Z.isOwner ? J("", !0) : (
|
|
606
|
-
|
|
607
|
-
|
|
604
|
+
d.value || m.initialValue ? (h(), A(ke, { key: 0 }, [
|
|
605
|
+
(Z = m.initialValue) != null && Z.isOwner ? J("", !0) : (h(), A("div", bt, [
|
|
606
|
+
r("div", _t, [
|
|
607
|
+
r("div", yt, P(o(a)("team.memberForm.permissionSet.title")), 1),
|
|
608
608
|
u(I, {
|
|
609
609
|
modelValue: x.value,
|
|
610
610
|
"onUpdate:modelValue": [
|
|
@@ -614,13 +614,13 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
614
614
|
multiselect: "",
|
|
615
615
|
searchable: "",
|
|
616
616
|
"search-debounce": 300,
|
|
617
|
-
items:
|
|
617
|
+
items: C.value,
|
|
618
618
|
placeholder: o(a)("team.memberForm.permissionSet.selectPlaceholder")
|
|
619
619
|
}, null, 8, ["modelValue", "items", "placeholder"])
|
|
620
620
|
]),
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
u(
|
|
621
|
+
r("div", ht, [
|
|
622
|
+
r("div", gt, P(o(a)("team.memberForm.permissions.title")), 1),
|
|
623
|
+
u(Ps, {
|
|
624
624
|
modelValue: b.value,
|
|
625
625
|
"onUpdate:modelValue": f[2] || (f[2] = (Q) => b.value = Q),
|
|
626
626
|
"inherit-permissions": B.value,
|
|
@@ -628,16 +628,16 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
628
628
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
629
629
|
])
|
|
630
630
|
])),
|
|
631
|
-
m.loading ? (
|
|
631
|
+
m.loading ? (h(), A("div", xt, [
|
|
632
632
|
u(k, { size: "xl" })
|
|
633
|
-
])) : (
|
|
633
|
+
])) : (h(), H(pt, {
|
|
634
634
|
key: 2,
|
|
635
635
|
ref_key: "masterUserContentRef",
|
|
636
|
-
ref:
|
|
636
|
+
ref: z,
|
|
637
637
|
"model-value": p.value,
|
|
638
|
-
"fallback-name": ((
|
|
639
|
-
"fallback-passcode": (se = (
|
|
640
|
-
roles:
|
|
638
|
+
"fallback-name": ((re = m.initialValue) == null ? void 0 : re.name) || ((ie = d.value) == null ? void 0 : ie.displayName) || "",
|
|
639
|
+
"fallback-passcode": (se = (de = m.initialValue) == null ? void 0 : de.posUser) == null ? void 0 : se.passcode,
|
|
640
|
+
roles: i.value,
|
|
641
641
|
restaurants: ae.value,
|
|
642
642
|
"onUpdate:modelValue": Re
|
|
643
643
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
|
|
@@ -649,67 +649,71 @@ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-c
|
|
|
649
649
|
}, 512);
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
|
-
}),
|
|
652
|
+
}), Ft = {
|
|
653
653
|
class: "space-y-24"
|
|
654
654
|
}, St = {
|
|
655
655
|
class: "space-y-8"
|
|
656
|
-
},
|
|
656
|
+
}, Vt = {
|
|
657
657
|
key: 0,
|
|
658
658
|
class: "flex w-full items-start justify-between px-16"
|
|
659
|
-
}, Vt = {
|
|
660
|
-
class: "flex items-start gap-8"
|
|
661
659
|
}, wt = {
|
|
660
|
+
class: "flex items-start gap-8"
|
|
661
|
+
}, Pt = {
|
|
662
662
|
key: 1,
|
|
663
663
|
class: "space-y-4 px-16"
|
|
664
|
-
}, Pt = {
|
|
665
|
-
class: "flex items-start gap-8"
|
|
666
664
|
}, It = {
|
|
667
|
-
class: "flex
|
|
665
|
+
class: "flex items-start gap-8"
|
|
668
666
|
}, kt = {
|
|
667
|
+
class: "flex h-full flex-col"
|
|
668
|
+
}, $t = {
|
|
669
|
+
class: "flex w-full items-center justify-between"
|
|
670
|
+
}, Rt = {
|
|
671
|
+
class: "fm-typo-en-title-md-600"
|
|
672
|
+
}, Ct = {
|
|
669
673
|
class: "flex items-center justify-start gap-8"
|
|
670
|
-
},
|
|
674
|
+
}, _e = 100;
|
|
671
675
|
var te = /* @__PURE__ */ function(m) {
|
|
672
676
|
return m[m.ADD = 0] = "ADD", m[m.UPDATE = 1] = "UPDATE", m[m.CLOSED = 2] = "CLOSED", m;
|
|
673
677
|
}(te || {});
|
|
674
|
-
const
|
|
678
|
+
const Jt = /* @__PURE__ */ Se({
|
|
675
679
|
__name: "TeamMemberList",
|
|
676
680
|
setup(m, {
|
|
677
|
-
expose:
|
|
681
|
+
expose: O
|
|
678
682
|
}) {
|
|
679
683
|
const {
|
|
680
684
|
fetchCustomReportPermissions: n
|
|
681
|
-
} =
|
|
685
|
+
} = Qe(), {
|
|
682
686
|
t: a
|
|
683
|
-
} = Ve(), d =
|
|
684
|
-
|
|
685
|
-
if (e.length > 0 &&
|
|
686
|
-
const s = new Map(e.map((
|
|
687
|
-
|
|
688
|
-
...
|
|
689
|
-
restaurants:
|
|
687
|
+
} = Ve(), d = $e(), R = Xe(), C = Ye(), x = Je(), B = gs(x), p = Ze(), b = ws(), ee = v(!0), E = v(!1), oe = w(() => R.isLoading.value), T = v([]), V = v(0), _ = v(1), D = v(""), q = v("");
|
|
688
|
+
me(R.restaurants, (e) => {
|
|
689
|
+
if (e.length > 0 && T.value.length > 0) {
|
|
690
|
+
const s = new Map(e.map((F) => [F._id, F.profile.name])), U = e.map((F) => F.profile.name).sort();
|
|
691
|
+
T.value = T.value.map((F) => ({
|
|
692
|
+
...F,
|
|
693
|
+
restaurants: F.managableRestaurantIds === null ? U : F.managableRestaurantIds.map((W) => s.get(W) ?? "").filter(Boolean).sort()
|
|
690
694
|
}));
|
|
691
695
|
}
|
|
692
696
|
});
|
|
693
|
-
const ae =
|
|
697
|
+
const ae = w(() => R.restaurants.value.map((e) => ({
|
|
694
698
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
695
699
|
value: e._id
|
|
696
|
-
}))),
|
|
700
|
+
}))), i = ({
|
|
697
701
|
member: e,
|
|
698
702
|
className: s = ""
|
|
699
703
|
}) => {
|
|
700
704
|
const U = {
|
|
701
705
|
label: a("team.actions.updateMember"),
|
|
702
|
-
onClick: () =>
|
|
703
|
-
},
|
|
706
|
+
onClick: () => z(ye.Update, e)
|
|
707
|
+
}, F = {
|
|
704
708
|
label: a("team.actions.removeMember"),
|
|
705
|
-
onClick: () =>
|
|
709
|
+
onClick: () => z(ye.Remove, e),
|
|
706
710
|
itemClass: "text-fm-color-typo-error"
|
|
707
|
-
},
|
|
711
|
+
}, W = e.doc.isOwner ? [U] : [U, F];
|
|
708
712
|
return u(ys, {
|
|
709
713
|
class: s,
|
|
710
|
-
items:
|
|
714
|
+
items: W
|
|
711
715
|
}, null);
|
|
712
|
-
}, l = (e) => e.doc.isOwner ? a("team.labels.businessOwner") : e.restaurants.join(", "),
|
|
716
|
+
}, l = (e) => e.doc.isOwner ? a("team.labels.businessOwner") : e.restaurants.join(", "), g = [{
|
|
713
717
|
accessorKey: "name",
|
|
714
718
|
header: () => a("team.table.columns.name"),
|
|
715
719
|
enableSorting: !1,
|
|
@@ -717,7 +721,7 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
717
721
|
const s = e.row.original;
|
|
718
722
|
return u("div", {
|
|
719
723
|
class: "flex items-center gap-8"
|
|
720
|
-
}, [u(
|
|
724
|
+
}, [u(Ne.FmAvatar, {
|
|
721
725
|
initials: s.name,
|
|
722
726
|
size: "sm",
|
|
723
727
|
class: "shrink-0"
|
|
@@ -734,8 +738,8 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
734
738
|
header: () => a("team.table.columns.restaurant"),
|
|
735
739
|
enableSorting: !1,
|
|
736
740
|
cell(e) {
|
|
737
|
-
if (
|
|
738
|
-
return
|
|
741
|
+
if (oe.value)
|
|
742
|
+
return ns(ds);
|
|
739
743
|
const s = e.row.original;
|
|
740
744
|
return l(s);
|
|
741
745
|
}
|
|
@@ -744,8 +748,8 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
744
748
|
header: () => a("team.table.columns.assignedRoles"),
|
|
745
749
|
enableSorting: !1,
|
|
746
750
|
cell(e) {
|
|
747
|
-
const s = e.row.original, U = b.getPermissionAssignmentByUserId(s.id),
|
|
748
|
-
return p.permissionSets.value.filter((
|
|
751
|
+
const s = e.row.original, U = b.getPermissionAssignmentByUserId(s.id), F = (U == null ? void 0 : U.permissionSetIds) || s.doc.permissionSetIds || [];
|
|
752
|
+
return p.permissionSets.value.filter((le) => F.includes(le.id)).map((le) => le.name).join(", ");
|
|
749
753
|
}
|
|
750
754
|
}, {
|
|
751
755
|
accessorKey: "permission",
|
|
@@ -753,7 +757,7 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
753
757
|
enableSorting: !1,
|
|
754
758
|
cell(e) {
|
|
755
759
|
const s = e.row.original;
|
|
756
|
-
return
|
|
760
|
+
return M(s);
|
|
757
761
|
},
|
|
758
762
|
meta: {
|
|
759
763
|
width: "200px"
|
|
@@ -766,25 +770,25 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
766
770
|
},
|
|
767
771
|
cell(e) {
|
|
768
772
|
const s = e.row.original;
|
|
769
|
-
return
|
|
773
|
+
return i({
|
|
770
774
|
member: s,
|
|
771
775
|
className: "flex justify-end w-full"
|
|
772
776
|
});
|
|
773
777
|
},
|
|
774
778
|
enableSorting: !1
|
|
775
779
|
}];
|
|
776
|
-
function
|
|
780
|
+
function M(e) {
|
|
777
781
|
if (e.doc.isOwner)
|
|
778
782
|
return a("team.labels.businessOwner");
|
|
779
|
-
const s = u(
|
|
783
|
+
const s = u(Ne.FmTooltip, {
|
|
780
784
|
variant: "plain",
|
|
781
785
|
placement: "top"
|
|
782
786
|
}, {
|
|
783
|
-
default: () => u(
|
|
787
|
+
default: () => u(Ne.FmIcon, {
|
|
784
788
|
name: "info",
|
|
785
789
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
786
790
|
}, null),
|
|
787
|
-
content: () => u("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => u("div", null, [
|
|
791
|
+
content: () => u("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => u("div", null, [rs("- "), U]))])
|
|
788
792
|
});
|
|
789
793
|
return u("div", {
|
|
790
794
|
class: "flex flex-row items-center gap-8"
|
|
@@ -793,8 +797,8 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
793
797
|
})]), e.permissionLabels.length > 0 && s]);
|
|
794
798
|
}
|
|
795
799
|
function X(e) {
|
|
796
|
-
var
|
|
797
|
-
const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [],
|
|
800
|
+
var W, le, Pe, xe;
|
|
801
|
+
const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], F = (s == null ? void 0 : s.permissionSetIds) || [];
|
|
798
802
|
return {
|
|
799
803
|
id: e.id,
|
|
800
804
|
isOwner: e.doc.isOwner,
|
|
@@ -802,17 +806,17 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
802
806
|
phoneNumber: e.phoneNumber,
|
|
803
807
|
email: e.email,
|
|
804
808
|
permissions: U,
|
|
805
|
-
permissionSetIds:
|
|
809
|
+
permissionSetIds: F,
|
|
806
810
|
posUser: e.doc.posUser ? {
|
|
807
|
-
code: ((
|
|
808
|
-
name: ((
|
|
809
|
-
passcode: ((
|
|
810
|
-
roles: ((
|
|
811
|
+
code: ((W = e.doc.posUser) == null ? void 0 : W.code) ?? "",
|
|
812
|
+
name: ((le = e.doc.posUser) == null ? void 0 : le.name) ?? e.name,
|
|
813
|
+
passcode: ((Pe = e.doc.posUser) == null ? void 0 : Pe.passcode) ?? "",
|
|
814
|
+
roles: ((xe = e.doc.posUser) == null ? void 0 : xe.roles) ?? []
|
|
811
815
|
} : void 0
|
|
812
816
|
};
|
|
813
817
|
}
|
|
814
818
|
function j(e) {
|
|
815
|
-
const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [],
|
|
819
|
+
const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], F = (s == null ? void 0 : s.permissionSetIds) || [];
|
|
816
820
|
return {
|
|
817
821
|
id: e.id,
|
|
818
822
|
isOwner: e.doc.isOwner,
|
|
@@ -820,105 +824,105 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
820
824
|
phoneNumber: e.phoneNumber,
|
|
821
825
|
email: e.email,
|
|
822
826
|
permissions: U,
|
|
823
|
-
permissionSetIds:
|
|
827
|
+
permissionSetIds: F,
|
|
824
828
|
posUser: void 0
|
|
825
829
|
};
|
|
826
830
|
}
|
|
827
|
-
const
|
|
831
|
+
const K = v(!1);
|
|
828
832
|
let L = 0;
|
|
829
|
-
const
|
|
833
|
+
const z = async (e, s) => {
|
|
830
834
|
if (e == ye.Update) {
|
|
831
835
|
const U = ++L;
|
|
832
|
-
|
|
836
|
+
ne.value = j(s), y.value = te.UPDATE, K.value = s.doc.hasPosUser === !0;
|
|
833
837
|
try {
|
|
834
|
-
const
|
|
838
|
+
const F = await Ue.readTeamMember(s.id);
|
|
835
839
|
if (U !== L) return;
|
|
836
|
-
|
|
840
|
+
ne.value = X(F);
|
|
837
841
|
} catch {
|
|
838
842
|
if (U !== L) return;
|
|
839
843
|
x.open({
|
|
840
844
|
message: a("common.error"),
|
|
841
845
|
type: "error"
|
|
842
|
-
}),
|
|
846
|
+
}), he();
|
|
843
847
|
} finally {
|
|
844
|
-
U === L && (
|
|
848
|
+
U === L && (K.value = !1);
|
|
845
849
|
}
|
|
846
850
|
}
|
|
847
851
|
e == ye.Remove && t(s);
|
|
848
|
-
}, c =
|
|
852
|
+
}, c = is(), y = v(te.CLOSED), G = w(() => y.value !== te.CLOSED), ve = w(() => y.value === te.ADD ? a("common.add") : a("common.update")), Re = w(() => y.value === te.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), ne = v();
|
|
849
853
|
function we() {
|
|
850
|
-
L++,
|
|
854
|
+
L++, K.value = !1, y.value = te.CLOSED;
|
|
851
855
|
}
|
|
852
|
-
const
|
|
856
|
+
const fe = _s(() => {
|
|
853
857
|
var e;
|
|
854
|
-
return ((e =
|
|
858
|
+
return ((e = ce.value) == null ? void 0 : e.isModified()) ?? !1;
|
|
855
859
|
}, we);
|
|
856
|
-
function
|
|
857
|
-
|
|
860
|
+
function he() {
|
|
861
|
+
fe();
|
|
858
862
|
}
|
|
859
863
|
const {
|
|
860
|
-
breakpoints:
|
|
861
|
-
} =
|
|
864
|
+
breakpoints: ge
|
|
865
|
+
} = us(), t = (e) => {
|
|
862
866
|
c.open({
|
|
863
867
|
title: a("team.actions.removeMember"),
|
|
864
868
|
message: a("team.removeMember.confirmationMessage", {
|
|
865
869
|
memberName: e.name
|
|
866
870
|
}),
|
|
867
|
-
minWidth:
|
|
871
|
+
minWidth: ge.value.lg ? 588 : 0,
|
|
868
872
|
primaryActions: {
|
|
869
873
|
text: "Remove",
|
|
870
874
|
close: !1,
|
|
871
875
|
variant: "destructive",
|
|
872
|
-
isLoading:
|
|
876
|
+
isLoading: Ce
|
|
873
877
|
},
|
|
874
878
|
secondaryActions: {
|
|
875
879
|
text: "Cancel",
|
|
876
880
|
close: !0
|
|
877
881
|
}
|
|
878
882
|
}).onPrimary(async () => {
|
|
879
|
-
|
|
883
|
+
Ce.value || (await B.minor(async () => {
|
|
880
884
|
await Ue.deleteTeamMember(e.id), await Q();
|
|
881
885
|
}, {
|
|
882
|
-
isLoading:
|
|
886
|
+
isLoading: Ce,
|
|
883
887
|
successMessage: a("team.removeMember.successMessage", {
|
|
884
888
|
memberName: e.name
|
|
885
889
|
})
|
|
886
890
|
}), c.close());
|
|
887
891
|
});
|
|
888
892
|
}, f = () => {
|
|
889
|
-
|
|
890
|
-
}, I = v(), k = v(),
|
|
893
|
+
ne.value = null, y.value = te.ADD;
|
|
894
|
+
}, I = v(), k = v(), $ = v(), Z = w(() => {
|
|
891
895
|
var e;
|
|
892
896
|
return JSON.stringify({
|
|
893
897
|
businessId: ((e = d.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
894
|
-
search:
|
|
898
|
+
search: q.value.trim(),
|
|
895
899
|
restaurantIds: [...I.value ?? []].sort(),
|
|
896
900
|
permissionSubjects: [...k.value ?? []].sort(),
|
|
897
|
-
permissionSetIds: [
|
|
901
|
+
permissionSetIds: [...$.value ?? []].sort()
|
|
898
902
|
});
|
|
899
|
-
}),
|
|
903
|
+
}), re = w(() => Object.values(vs).map((e) => ({
|
|
900
904
|
label: e.label,
|
|
901
905
|
value: e.subject
|
|
902
|
-
}))),
|
|
906
|
+
}))), ie = w(() => p.permissionSets.value.map((e) => ({
|
|
903
907
|
label: e.name,
|
|
904
908
|
value: e.id
|
|
905
909
|
})));
|
|
906
|
-
async function
|
|
907
|
-
await
|
|
910
|
+
async function de() {
|
|
911
|
+
await C.readRoles();
|
|
908
912
|
}
|
|
909
|
-
async function se(e =
|
|
910
|
-
var s, U,
|
|
913
|
+
async function se(e = _.value) {
|
|
914
|
+
var s, U, F;
|
|
911
915
|
ee.value = !0;
|
|
912
916
|
try {
|
|
913
|
-
const
|
|
914
|
-
limit:
|
|
915
|
-
offset: (e - 1) *
|
|
916
|
-
search:
|
|
917
|
+
const W = await Ue.readTeamMembersPage({
|
|
918
|
+
limit: _e,
|
|
919
|
+
offset: (e - 1) * _e,
|
|
920
|
+
search: q.value.trim() || void 0,
|
|
917
921
|
restaurantIds: (s = I.value) != null && s.length ? I.value : void 0,
|
|
918
922
|
permissionSubjects: (U = k.value) != null && U.length ? k.value : void 0,
|
|
919
|
-
permissionSetIds: (
|
|
923
|
+
permissionSetIds: (F = $.value) != null && F.length ? $.value : void 0
|
|
920
924
|
});
|
|
921
|
-
|
|
925
|
+
T.value = W.items, V.value = W.total;
|
|
922
926
|
} finally {
|
|
923
927
|
ee.value = !1;
|
|
924
928
|
}
|
|
@@ -926,18 +930,18 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
926
930
|
async function Q() {
|
|
927
931
|
var s;
|
|
928
932
|
if (!((s = d.currentBusiness.value) != null && s._id)) return;
|
|
929
|
-
await se(
|
|
930
|
-
const e = Math.max(1, Math.ceil(
|
|
931
|
-
|
|
933
|
+
await se(_.value);
|
|
934
|
+
const e = Math.max(1, Math.ceil(V.value / _e));
|
|
935
|
+
_.value > e && (_.value = e, await se(_.value));
|
|
932
936
|
}
|
|
933
|
-
const
|
|
934
|
-
async function
|
|
935
|
-
if (!
|
|
936
|
-
const e = await
|
|
937
|
+
const ce = v(), Y = v(!1), Ce = v(!1);
|
|
938
|
+
async function He() {
|
|
939
|
+
if (!ce.value) return;
|
|
940
|
+
const e = await ce.value.validate();
|
|
937
941
|
if (!e) return;
|
|
938
|
-
const s =
|
|
942
|
+
const s = y.value === te.ADD;
|
|
939
943
|
await B.minor(async () => {
|
|
940
|
-
await (s ? Ue.createTeamMember(e) : Ue.updateTeamMember(
|
|
944
|
+
await (s ? Ue.createTeamMember(e) : Ue.updateTeamMember(ne.value.id, e)), we(), await Oe(), await Q();
|
|
941
945
|
}, {
|
|
942
946
|
successMessage: s ? a("team.addMember.successMessage", {
|
|
943
947
|
memberName: e.name
|
|
@@ -945,41 +949,41 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
945
949
|
memberName: e.name
|
|
946
950
|
}),
|
|
947
951
|
isLoading: Y
|
|
948
|
-
}),
|
|
952
|
+
}), y.value = te.CLOSED;
|
|
949
953
|
}
|
|
950
|
-
async function
|
|
954
|
+
async function es() {
|
|
951
955
|
await p.readPermissionSets();
|
|
952
956
|
}
|
|
953
957
|
async function Oe() {
|
|
954
958
|
await b.readPermissionAssignments();
|
|
955
959
|
}
|
|
956
|
-
let
|
|
957
|
-
async function
|
|
960
|
+
let Me = !1;
|
|
961
|
+
async function ss({
|
|
958
962
|
pageIndex: e
|
|
959
963
|
}) {
|
|
960
964
|
var s;
|
|
961
|
-
if ((s = d.currentBusiness.value) != null && s._id && !
|
|
962
|
-
|
|
965
|
+
if ((s = d.currentBusiness.value) != null && s._id && !Me && !(e === 0 && _.value === 1 && T.value.length > 0)) {
|
|
966
|
+
Me = !0, _.value = e + 1;
|
|
963
967
|
try {
|
|
964
|
-
await se(
|
|
968
|
+
await se(_.value);
|
|
965
969
|
} finally {
|
|
966
|
-
|
|
970
|
+
Me = !1;
|
|
967
971
|
}
|
|
968
972
|
}
|
|
969
973
|
}
|
|
970
|
-
const
|
|
971
|
-
|
|
974
|
+
const ts = ms(D, () => {
|
|
975
|
+
q.value = D.value;
|
|
972
976
|
});
|
|
973
|
-
return
|
|
977
|
+
return os(ts), me(Z, async () => {
|
|
974
978
|
var e;
|
|
975
|
-
|
|
979
|
+
_.value = 1, E.value = !1, (e = d.currentBusiness.value) != null && e._id && (await se(1), E.value = !0);
|
|
976
980
|
}, {
|
|
977
981
|
immediate: !0
|
|
978
|
-
}),
|
|
982
|
+
}), me(d.currentBusiness, async () => {
|
|
979
983
|
var e;
|
|
980
984
|
if ((e = d.currentBusiness.value) != null && e._id)
|
|
981
985
|
try {
|
|
982
|
-
await Promise.all([
|
|
986
|
+
await Promise.all([R.readRestaurants(), es(), Oe(), n(), de()]);
|
|
983
987
|
} catch (s) {
|
|
984
988
|
console.error("Failed to load team member dependencies:", s), x.open({
|
|
985
989
|
message: s instanceof Error ? s.message : String(s),
|
|
@@ -988,128 +992,133 @@ const zt = /* @__PURE__ */ Fe({
|
|
|
988
992
|
}
|
|
989
993
|
}, {
|
|
990
994
|
immediate: !0
|
|
991
|
-
}),
|
|
995
|
+
}), O({
|
|
992
996
|
create: f
|
|
993
997
|
}), (e, s) => {
|
|
994
998
|
var xe;
|
|
995
|
-
const U =
|
|
996
|
-
return
|
|
999
|
+
const U = S("FmSearch"), F = S("FmTable"), W = S("FmIcon"), le = S("FmButton"), Pe = S("FmSideSheet");
|
|
1000
|
+
return h(), A(ke, null, [r("div", Ft, [r("div", St, [o(ge).xs ? (h(), A("div", Pt, [u(U, {
|
|
997
1001
|
modelValue: D.value,
|
|
998
|
-
"onUpdate:modelValue": s[4] || (s[4] = (
|
|
1002
|
+
"onUpdate:modelValue": s[4] || (s[4] = (N) => D.value = N),
|
|
999
1003
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1000
1004
|
placeholder: o(a)("team.search.placeholder")
|
|
1001
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
1005
|
+
}, null, 8, ["modelValue", "placeholder"]), r("div", It, [u(be, {
|
|
1002
1006
|
modelValue: I.value,
|
|
1003
|
-
"onUpdate:modelValue": s[5] || (s[5] = (
|
|
1007
|
+
"onUpdate:modelValue": s[5] || (s[5] = (N) => I.value = N),
|
|
1004
1008
|
multiple: "",
|
|
1005
1009
|
items: ae.value,
|
|
1006
1010
|
variant: "dark",
|
|
1007
1011
|
"selected-prefix": o(a)("team.table.columns.restaurant"),
|
|
1008
1012
|
placeholder: o(a)("team.table.columns.restaurant"),
|
|
1009
1013
|
class: "!w-auto"
|
|
1010
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(
|
|
1014
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(be, {
|
|
1011
1015
|
modelValue: k.value,
|
|
1012
|
-
"onUpdate:modelValue": s[6] || (s[6] = (
|
|
1016
|
+
"onUpdate:modelValue": s[6] || (s[6] = (N) => k.value = N),
|
|
1013
1017
|
multiple: "",
|
|
1014
1018
|
variant: "dark",
|
|
1015
|
-
items:
|
|
1019
|
+
items: re.value,
|
|
1016
1020
|
"selected-prefix": o(a)("team.filter.selected_permission_prefix"),
|
|
1017
1021
|
placeholder: o(a)("team.filter.permission_placeholder")
|
|
1018
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(
|
|
1019
|
-
modelValue:
|
|
1020
|
-
"onUpdate:modelValue": s[7] || (s[7] = (
|
|
1022
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(be, {
|
|
1023
|
+
modelValue: $.value,
|
|
1024
|
+
"onUpdate:modelValue": s[7] || (s[7] = (N) => $.value = N),
|
|
1021
1025
|
multiple: "",
|
|
1022
1026
|
variant: "dark",
|
|
1023
|
-
items:
|
|
1027
|
+
items: ie.value,
|
|
1024
1028
|
"selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
|
|
1025
1029
|
placeholder: o(a)("team.filter.assigned_role_placeholder")
|
|
1026
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (
|
|
1030
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (h(), A("div", Vt, [r("div", wt, [u(be, {
|
|
1027
1031
|
modelValue: I.value,
|
|
1028
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
1032
|
+
"onUpdate:modelValue": s[0] || (s[0] = (N) => I.value = N),
|
|
1029
1033
|
multiple: "",
|
|
1030
1034
|
items: ae.value,
|
|
1031
1035
|
variant: "dark",
|
|
1032
1036
|
"selected-prefix": o(a)("team.table.columns.restaurant"),
|
|
1033
1037
|
placeholder: o(a)("team.table.columns.restaurant"),
|
|
1034
1038
|
class: "!w-auto"
|
|
1035
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(
|
|
1039
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(be, {
|
|
1036
1040
|
modelValue: k.value,
|
|
1037
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
1041
|
+
"onUpdate:modelValue": s[1] || (s[1] = (N) => k.value = N),
|
|
1038
1042
|
multiple: "",
|
|
1039
1043
|
variant: "dark",
|
|
1040
|
-
items:
|
|
1044
|
+
items: re.value,
|
|
1041
1045
|
"selected-prefix": o(a)("team.filter.selected_permission_prefix"),
|
|
1042
1046
|
placeholder: o(a)("team.filter.permission_placeholder")
|
|
1043
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(
|
|
1044
|
-
modelValue:
|
|
1045
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
1047
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(be, {
|
|
1048
|
+
modelValue: $.value,
|
|
1049
|
+
"onUpdate:modelValue": s[2] || (s[2] = (N) => $.value = N),
|
|
1046
1050
|
multiple: "",
|
|
1047
1051
|
variant: "dark",
|
|
1048
|
-
items:
|
|
1052
|
+
items: ie.value,
|
|
1049
1053
|
"selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
|
|
1050
1054
|
placeholder: o(a)("team.filter.assigned_role_placeholder")
|
|
1051
1055
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), u(U, {
|
|
1052
1056
|
modelValue: D.value,
|
|
1053
|
-
"onUpdate:modelValue": s[3] || (s[3] = (
|
|
1057
|
+
"onUpdate:modelValue": s[3] || (s[3] = (N) => D.value = N),
|
|
1054
1058
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1055
1059
|
autofocus: "",
|
|
1056
1060
|
placeholder: o(a)("team.search.placeholder")
|
|
1057
|
-
}, null, 8, ["modelValue", "placeholder"])])), (xe = o(d).currentBusiness.value) != null && xe._id ? (
|
|
1061
|
+
}, null, 8, ["modelValue", "placeholder"])])), (xe = o(d).currentBusiness.value) != null && xe._id ? (h(), H(fs, {
|
|
1058
1062
|
key: 2
|
|
1059
1063
|
}, {
|
|
1060
|
-
default:
|
|
1064
|
+
default: ue(() => [r("div", kt, [E.value ? V.value === 0 ? (h(), H(o(hs), {
|
|
1061
1065
|
key: 1,
|
|
1062
1066
|
title: o(a)("team.emptyState.title"),
|
|
1063
1067
|
subtitle: o(a)("team.emptyState.description")
|
|
1064
|
-
}, null, 8, ["title", "subtitle"])) : J("", !0) : (
|
|
1068
|
+
}, null, 8, ["title", "subtitle"])) : J("", !0) : (h(), H(bs, {
|
|
1065
1069
|
key: 0
|
|
1066
|
-
})), E.value ? (
|
|
1070
|
+
})), E.value ? (h(), H(F, {
|
|
1067
1071
|
key: Z.value,
|
|
1068
|
-
"column-defs":
|
|
1069
|
-
"row-data":
|
|
1070
|
-
"page-size":
|
|
1071
|
-
"page-count": Math.ceil(
|
|
1072
|
-
"row-count":
|
|
1073
|
-
"fetch-fn":
|
|
1074
|
-
"hide-footer":
|
|
1072
|
+
"column-defs": g,
|
|
1073
|
+
"row-data": T.value,
|
|
1074
|
+
"page-size": _e,
|
|
1075
|
+
"page-count": Math.ceil(V.value / _e),
|
|
1076
|
+
"row-count": V.value,
|
|
1077
|
+
"fetch-fn": ss,
|
|
1078
|
+
"hide-footer": V.value <= _e,
|
|
1075
1079
|
loading: ee.value,
|
|
1076
1080
|
"pin-header-row": "",
|
|
1077
|
-
onRowClick: s[8] || (s[8] = (
|
|
1081
|
+
onRowClick: s[8] || (s[8] = (N) => z(o(ye).Update, N.original))
|
|
1078
1082
|
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])) : J("", !0)])]),
|
|
1079
1083
|
_: 1
|
|
1080
|
-
})) : J("", !0)])]), u(
|
|
1081
|
-
|
|
1082
|
-
"model-value": W.value,
|
|
1084
|
+
})) : J("", !0)])]), u(Pe, {
|
|
1085
|
+
"model-value": G.value,
|
|
1083
1086
|
"max-width": 960,
|
|
1084
|
-
"
|
|
1085
|
-
"onOn:
|
|
1087
|
+
"close-button": !1,
|
|
1088
|
+
"onOn:clickedAway": o(fe)
|
|
1086
1089
|
}, {
|
|
1087
|
-
"side-sheet-
|
|
1088
|
-
|
|
1090
|
+
"side-sheet-header": ue(() => [r("div", $t, [r("p", Rt, P(Re.value), 1), u(W, {
|
|
1091
|
+
name: "close",
|
|
1092
|
+
size: "md",
|
|
1093
|
+
class: "cursor-pointer",
|
|
1094
|
+
onClick: o(fe)
|
|
1095
|
+
}, null, 8, ["onClick"])])]),
|
|
1096
|
+
"side-sheet-footer": ue(() => [r("div", Ct, [u(le, {
|
|
1097
|
+
label: ve.value,
|
|
1089
1098
|
size: "md",
|
|
1090
1099
|
variant: "primary",
|
|
1091
1100
|
"is-loading": Y.value,
|
|
1092
1101
|
disabled: Y.value,
|
|
1093
|
-
onClick:
|
|
1094
|
-
}, null, 8, ["label", "is-loading", "disabled"]), u(
|
|
1102
|
+
onClick: Fe(He, ["prevent"])
|
|
1103
|
+
}, null, 8, ["label", "is-loading", "disabled"]), u(le, {
|
|
1095
1104
|
label: o(a)("common.cancel"),
|
|
1096
1105
|
size: "md",
|
|
1097
1106
|
variant: "secondary",
|
|
1098
1107
|
disabled: Y.value,
|
|
1099
|
-
onClick:
|
|
1108
|
+
onClick: he
|
|
1100
1109
|
}, null, 8, ["label", "disabled"])])]),
|
|
1101
|
-
default:
|
|
1110
|
+
default: ue(() => [u(Ut, {
|
|
1102
1111
|
ref_key: "memberForm",
|
|
1103
|
-
ref:
|
|
1104
|
-
initialValue:
|
|
1105
|
-
loading:
|
|
1112
|
+
ref: ce,
|
|
1113
|
+
initialValue: ne.value,
|
|
1114
|
+
loading: K.value,
|
|
1106
1115
|
class: "gap-8"
|
|
1107
1116
|
}, null, 8, ["initialValue", "loading"])]),
|
|
1108
1117
|
_: 1
|
|
1109
|
-
}, 8, ["
|
|
1118
|
+
}, 8, ["model-value", "onOn:clickedAway"])], 64);
|
|
1110
1119
|
};
|
|
1111
1120
|
}
|
|
1112
1121
|
});
|
|
1113
1122
|
export {
|
|
1114
|
-
|
|
1123
|
+
Jt as default
|
|
1115
1124
|
};
|