@feedmepos/mf-hrm-portal 2.2.2-dev → 2.2.2-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalCodeList-B9O8QzzI.js → ApprovalCodeList-BjRRA_sc.js} +2 -2
- package/dist/{AuditLogList-CtFEXKWZ.js → AuditLogList-B8kE39lt.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C9MYbxum.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Ba8w1BwT.js} +2 -2
- package/dist/{EmployeeList-BFxMwFJq.js → EmployeeList-7e069yPp.js} +66 -65
- package/dist/{GrantUserList-CZtmMRoS.js → GrantUserList-CTYamty5.js} +3 -3
- package/dist/{Main-on0TXkQt.js → Main-B-3s0bf_.js} +5 -5
- package/dist/{Main-DD6IthCS.js → Main-DcPLufZ5.js} +2 -2
- package/dist/{Main-B622Z4q4.js → Main-DfeNUiyv.js} +9 -9
- package/dist/{PermissionSetList-FCX3TBoi.js → PermissionSetList-CNujxzHF.js} +77 -76
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cl_YNh0k.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cq9xp1TW.js} +585 -580
- package/dist/RoleList-YaY7Np_9.js +739 -0
- package/dist/{TeamMemberList-BAU7Y3jh.js → TeamMemberList-B-I3KjnH.js} +305 -305
- package/dist/{TimesheetList-DtFBWhma.js → TimesheetList-BTsvEiD6.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-Tatn3jUv.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CJYgeUxK.js} +2 -2
- package/dist/{app-Bbf6hEPt.js → app-C3u5orep.js} +16 -12
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BAnGg8q2.js → dayjs.min-B-sLuqme.js} +1 -1
- package/dist/{employee-DVSD3L51.js → employee-DaduVi88.js} +3 -3
- package/dist/{iteration-BTZViJtd.js → iteration-Cii8ZeX3.js} +1 -1
- package/dist/{lodash-Cgdk4_YL.js → lodash-BifZ3B1q.js} +1 -1
- package/dist/{role-CXVpO6fB.js → role-tzqciGzt.js} +1 -1
- package/dist/{rule-TR3MVo-b.js → rule-GhzA0R9H.js} +287 -260
- package/dist/src/api/user/index.d.ts +2 -2
- package/dist/src/composables/useReportPermissions.d.ts +1 -0
- package/dist/src/helpers/rule.d.ts +2 -0
- package/dist/src/types/role.d.ts +1 -0
- package/dist/src/views/hr/locales/index.d.ts +12 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useReportPermissions-BRLy3D7v.js +82 -0
- package/package.json +2 -2
- package/dist/RoleList-p_9KHzqF.js +0 -725
- package/dist/useReportPermissions-BpAFyO17.js +0 -71
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as Pe, useCoreStore as
|
|
3
|
-
import { useSnackbar as He, useDialog as es, useBreakpoints as ss, components as
|
|
1
|
+
import { defineComponent as we, resolveComponent as F, createElementBlock as M, openBlock as y, createElementVNode as i, createVNode as d, toDisplayString as k, unref as r, computed as w, ref as b, createCommentVNode as K, withCtx as ue, createBlock as z, watch as fe, Fragment as Ne, renderList as us, withKeys as Te, withModifiers as Ve, nextTick as ms, onUnmounted as ds, h as cs, createTextVNode as ps } from "vue";
|
|
2
|
+
import { useI18n as Pe, useCoreStore as Ye } from "@feedmepos/mf-common";
|
|
3
|
+
import { useSnackbar as He, useDialog as es, useBreakpoints as ss, components as Be } from "@feedmepos/ui-library";
|
|
4
4
|
import { u as fs } from "./useDebounce-B8ZPVS5C.js";
|
|
5
5
|
import { _ as vs, S as ye } from "./SelectFilter-ATOm0hdn.js";
|
|
6
|
-
import { b as
|
|
7
|
-
import { u as gs, _ as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { b as qe, m as bs, d as hs, _ as ys, a as _s } from "./app-C3u5orep.js";
|
|
7
|
+
import { u as gs, _ as Us } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
|
+
import { _ as xs } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
9
9
|
import { _ as Ss } from "./Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js";
|
|
10
10
|
import { u as Fs } from "./useLoading-CXzTpIVv.js";
|
|
11
|
-
import { l as Se } from "./lodash-
|
|
12
|
-
import { c as he } from "./iteration-
|
|
13
|
-
import { u as ts, c as
|
|
14
|
-
import { u as ls } from "./role-
|
|
11
|
+
import { l as Se } from "./lodash-BifZ3B1q.js";
|
|
12
|
+
import { c as he } from "./iteration-Cii8ZeX3.js";
|
|
13
|
+
import { u as ts, c as je, d as Ke, m as Me, i as as, p as ze, j as Vs, k as Ge, l as We, n as Is, o as ws, q as Ps, v as ks, w as Rs, t as Fe } from "./rule-GhzA0R9H.js";
|
|
14
|
+
import { u as ls } from "./role-tzqciGzt.js";
|
|
15
15
|
import { u as os, i as $s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-XHuHin8t.js";
|
|
16
|
-
import { g as
|
|
17
|
-
import { _ as Cs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
var ge = /* @__PURE__ */ ((
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
if (!(
|
|
22
|
-
const
|
|
23
|
-
return
|
|
16
|
+
import { g as Je, b as Xe, u as rs } from "./restaurant-BTpBmfBV.js";
|
|
17
|
+
import { _ as Cs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Cq9xp1TW.js";
|
|
18
|
+
var ge = /* @__PURE__ */ ((n) => (n.Update = "Update", n.Remove = "Remove", n))(ge || {});
|
|
19
|
+
const Ie = "__unassigned__";
|
|
20
|
+
function Ze(n) {
|
|
21
|
+
if (!(n != null && n.length) || n[0] === Ie) return n;
|
|
22
|
+
const D = n.filter((u) => u !== Ie);
|
|
23
|
+
return D.length === n.length ? n : [Ie, ...D];
|
|
24
24
|
}
|
|
25
|
-
const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-center gap-16" }, As = { class: "space-y-4 min-w-0 flex-1" }, Es = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "w-full flex gap-16 items-center" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ls = { class: "fm-typo-en-body-lg-600 truncate" }, Ts = { class: "flex-1 flex flex-col gap-4 min-w-0" }, qs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ks = { class: "fm-typo-en-body-lg-600 truncate" }, zs = /* @__PURE__ */
|
|
25
|
+
const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-center gap-16" }, As = { class: "space-y-4 min-w-0 flex-1" }, Es = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "w-full flex gap-16 items-center" }, Bs = { class: "flex-1 flex flex-col gap-4 min-w-0" }, js = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ls = { class: "fm-typo-en-body-lg-600 truncate" }, Ts = { class: "flex-1 flex flex-col gap-4 min-w-0" }, qs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ks = { class: "fm-typo-en-body-lg-600 truncate" }, zs = /* @__PURE__ */ we({
|
|
26
26
|
__name: "MemberInfo",
|
|
27
27
|
props: {
|
|
28
28
|
data: {}
|
|
29
29
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const { t:
|
|
32
|
-
return (
|
|
30
|
+
setup(n) {
|
|
31
|
+
const { t: D } = Pe();
|
|
32
|
+
return (u, a) => {
|
|
33
33
|
const f = F("FmAvatar");
|
|
34
|
-
return y(),
|
|
35
|
-
|
|
34
|
+
return y(), M("div", Ms, [
|
|
35
|
+
i("div", Ns, [
|
|
36
36
|
d(f, {
|
|
37
37
|
size: "xl",
|
|
38
|
-
name:
|
|
38
|
+
name: n.data.name
|
|
39
39
|
}, null, 8, ["name"]),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
i("div", As, [
|
|
41
|
+
i("p", Es, k(r(D)("team.memberForm.memberInfo.memberName")), 1),
|
|
42
|
+
i("p", Ds, k(n.data.name || "--"), 1)
|
|
43
43
|
])
|
|
44
44
|
]),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
i("div", Os, [
|
|
46
|
+
i("div", Bs, [
|
|
47
|
+
i("p", js, k(r(D)("team.memberForm.memberInfo.mobileNumber")), 1),
|
|
48
|
+
i("p", Ls, k(n.data.phoneNumber || "--"), 1)
|
|
49
49
|
]),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
i("div", Ts, [
|
|
51
|
+
i("p", qs, k(r(D)("team.memberForm.memberInfo.emailAddress")), 1),
|
|
52
|
+
i("p", Ks, k(n.data.email || "--"), 1)
|
|
53
53
|
])
|
|
54
54
|
])
|
|
55
55
|
]);
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
}),
|
|
59
|
-
async readPermissionUserByPhoneNo(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
}), Qe = {
|
|
59
|
+
async readPermissionUserByPhoneNo(n) {
|
|
60
|
+
return Je(
|
|
61
|
+
await Xe().get(
|
|
62
|
+
`/portal-users/search-by-phone/${encodeURIComponent(n)}`
|
|
63
|
+
)
|
|
64
64
|
);
|
|
65
65
|
},
|
|
66
|
-
async readPermissionUserByEmail(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
async readPermissionUserByEmail(n) {
|
|
67
|
+
return Je(
|
|
68
|
+
await Xe().get(
|
|
69
|
+
`/portal-users/search-by-email/${encodeURIComponent(n)}`
|
|
70
|
+
)
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
}, Gs = { class: "flex flex-col gap-24 w-full" }, Ws = {
|
|
74
74
|
key: 0,
|
|
75
75
|
class: "flex flex-col gap-8"
|
|
76
|
-
}, Js = { class: "user-info-icon user-info-icon--lg" }, Xs = { class: "flex-1 overflow-hidden" }, Zs = { class: "profile-displayName" }, Qs = { class: "profile-email" }, Ys = { class: "profile-phone" }, Hs = { key: 2 }, et = /* @__PURE__ */
|
|
76
|
+
}, Js = { class: "user-info-icon user-info-icon--lg" }, Xs = { class: "flex-1 overflow-hidden" }, Zs = { class: "profile-displayName" }, Qs = { class: "profile-email" }, Ys = { class: "profile-phone" }, Hs = { key: 2 }, et = /* @__PURE__ */ we({
|
|
77
77
|
__name: "PortalUserSearcher",
|
|
78
78
|
emits: ["invite"],
|
|
79
|
-
setup(
|
|
80
|
-
const
|
|
79
|
+
setup(n, { emit: D }) {
|
|
80
|
+
const u = D, { t: a } = Pe(), f = He(), N = Ye(), { supportedCountries: V, ready: R } = os(), se = w(() => {
|
|
81
81
|
var l;
|
|
82
|
-
const o = (l =
|
|
82
|
+
const o = (l = N.currentCountry.value) == null ? void 0 : l.toUpperCase();
|
|
83
83
|
return o && $s(o) ? o : void 0;
|
|
84
|
-
}), g = b("phone"), S = b(""), p = b(""), h = b(), me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, j =
|
|
84
|
+
}), g = b("phone"), S = b(""), p = b(""), h = b(), me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, j = w(() => me.test(p.value.trim()));
|
|
85
85
|
async function L() {
|
|
86
86
|
const o = g.value === "phone" ? S.value.replace(/ /g, "") : p.value.trim();
|
|
87
87
|
if (!o) {
|
|
@@ -105,7 +105,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
107
|
try {
|
|
108
|
-
const v = g.value === "phone" ? await
|
|
108
|
+
const v = g.value === "phone" ? await Qe.readPermissionUserByPhoneNo(o) : await Qe.readPermissionUserByEmail(o);
|
|
109
109
|
if (!v) {
|
|
110
110
|
l();
|
|
111
111
|
return;
|
|
@@ -118,37 +118,37 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
let o = ((
|
|
121
|
+
const $ = w(() => {
|
|
122
|
+
var U;
|
|
123
|
+
let o = ((U = h.value) == null ? void 0 : U.displayName) ?? "";
|
|
124
124
|
o || (o = "Feed Me");
|
|
125
125
|
const [l, v] = o.split(" ");
|
|
126
126
|
return v ? `${l[0]}${v[0]}` : l.slice(0, 2);
|
|
127
|
-
}),
|
|
127
|
+
}), A = b(!1);
|
|
128
128
|
function W(o) {
|
|
129
|
-
|
|
129
|
+
u("invite", o), A.value = !0;
|
|
130
130
|
}
|
|
131
131
|
function te() {
|
|
132
|
-
|
|
132
|
+
A.value = !1;
|
|
133
133
|
}
|
|
134
134
|
return (o, l) => {
|
|
135
135
|
var B, m, _;
|
|
136
|
-
const v = F("FmRadio"),
|
|
137
|
-
return y(),
|
|
138
|
-
|
|
136
|
+
const v = F("FmRadio"), U = F("FmPhoneNumber"), J = F("FmCircularProgress"), X = F("FmTextField"), O = F("FmRadioGroup"), E = F("FmButton");
|
|
137
|
+
return y(), M("div", Gs, [
|
|
138
|
+
A.value ? K("", !0) : (y(), M("div", Ws, [
|
|
139
139
|
d(O, {
|
|
140
140
|
modelValue: g.value,
|
|
141
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
141
|
+
"onUpdate:modelValue": l[2] || (l[2] = (I) => g.value = I)
|
|
142
142
|
}, {
|
|
143
143
|
default: ue(() => [
|
|
144
144
|
d(v, {
|
|
145
145
|
value: "phone",
|
|
146
146
|
label: r(a)("team.memberForm.searchUser.phoneNumber")
|
|
147
147
|
}, null, 8, ["label"]),
|
|
148
|
-
g.value === "phone" && r(
|
|
148
|
+
g.value === "phone" && r(R) ? (y(), z(U, {
|
|
149
149
|
key: 0,
|
|
150
150
|
modelValue: S.value,
|
|
151
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
151
|
+
"onUpdate:modelValue": l[0] || (l[0] = (I) => S.value = I),
|
|
152
152
|
"default-country": se.value,
|
|
153
153
|
"extra-country-codes": r(V),
|
|
154
154
|
class: "ml-8"
|
|
@@ -163,36 +163,36 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
163
163
|
g.value === "email" ? (y(), z(X, {
|
|
164
164
|
key: 2,
|
|
165
165
|
modelValue: p.value,
|
|
166
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
166
|
+
"onUpdate:modelValue": l[1] || (l[1] = (I) => p.value = I),
|
|
167
167
|
placeholder: r(a)("team.memberForm.searchUser.emailPlaceholder"),
|
|
168
168
|
rules: [
|
|
169
|
-
(
|
|
169
|
+
(I) => !I || j.value || r(a)("team.memberForm.searchUser.invalidEmail")
|
|
170
170
|
],
|
|
171
171
|
class: "ml-8"
|
|
172
172
|
}, null, 8, ["modelValue", "placeholder", "rules"])) : K("", !0)
|
|
173
173
|
]),
|
|
174
174
|
_: 1
|
|
175
175
|
}, 8, ["modelValue"]),
|
|
176
|
-
d(
|
|
176
|
+
d(E, {
|
|
177
177
|
label: r(a)("team.memberForm.searchUser.search"),
|
|
178
178
|
variant: "secondary",
|
|
179
179
|
onClick: L
|
|
180
180
|
}, null, 8, ["label"])
|
|
181
181
|
])),
|
|
182
|
-
h.value ? (y(),
|
|
182
|
+
h.value ? (y(), M("div", {
|
|
183
183
|
key: 1,
|
|
184
184
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
185
|
-
onClick: l[3] || (l[3] = (
|
|
185
|
+
onClick: l[3] || (l[3] = (I) => W(h.value))
|
|
186
186
|
}, [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
i("div", Js, k($.value), 1),
|
|
188
|
+
i("div", Xs, [
|
|
189
|
+
i("p", Zs, k((B = h.value) == null ? void 0 : B.displayName), 1),
|
|
190
|
+
i("p", Qs, k((m = h.value) == null ? void 0 : m.email), 1),
|
|
191
|
+
i("p", Ys, k((_ = h.value) == null ? void 0 : _.phoneNumber), 1)
|
|
192
192
|
])
|
|
193
193
|
])) : K("", !0),
|
|
194
|
-
|
|
195
|
-
d(
|
|
194
|
+
A.value ? (y(), M("div", Hs, [
|
|
195
|
+
d(E, {
|
|
196
196
|
label: r(a)("team.memberForm.searchUser.changeUser"),
|
|
197
197
|
variant: "secondary",
|
|
198
198
|
onClick: te
|
|
@@ -201,7 +201,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
201
201
|
]);
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
}), st = /* @__PURE__ */ vs(et, [["__scopeId", "data-v-827dfd60"]]), tt = { class: "flex flex-col gap-40" }, at = { class: "flex items-center" }, lt = { class: "flex-1 flex flex-col" }, ot = { class: "fm-typo-en-title-sm-600" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nt = { class: "flex flex-row gap-16" }, it = { class: "flex flex-col gap-8" }, ut = { class: "fm-typo-en-body-lg-400" }, mt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, dt = { class: "fm-typo-en-title-sm-600" }, ct = { class: "space-y-16" }, pt = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ft = { class: "text-sm font-semibold text-fm-color-typo-primary" }, vt = { class: "text-sm font-semibold text-fm-color-typo-primary" }, bt = { class: "flex justify-self-end" }, ht = ["aria-label", "onClick", "onKeydown"],
|
|
204
|
+
}), st = /* @__PURE__ */ vs(et, [["__scopeId", "data-v-827dfd60"]]), tt = { class: "flex flex-col gap-40" }, at = { class: "flex items-center" }, lt = { class: "flex-1 flex flex-col" }, ot = { class: "fm-typo-en-title-sm-600" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nt = { class: "flex flex-row gap-16" }, it = { class: "flex flex-col gap-8" }, ut = { class: "fm-typo-en-body-lg-400" }, mt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, dt = { class: "fm-typo-en-title-sm-600" }, ct = { class: "space-y-16" }, pt = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ft = { class: "text-sm font-semibold text-fm-color-typo-primary" }, vt = { class: "text-sm font-semibold text-fm-color-typo-primary" }, bt = { class: "flex justify-self-end" }, ht = ["aria-label", "onClick", "onKeydown"], Le = 4, yt = /* @__PURE__ */ we({
|
|
205
205
|
__name: "TeamMemberMasterUser",
|
|
206
206
|
props: {
|
|
207
207
|
modelValue: {
|
|
@@ -226,156 +226,156 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
emits: ["update:model-value"],
|
|
229
|
-
setup(
|
|
230
|
-
const
|
|
231
|
-
function
|
|
229
|
+
setup(n, { emit: D }) {
|
|
230
|
+
const u = n, a = D, { t: f } = Pe(), N = b(!0), V = b([]);
|
|
231
|
+
function R() {
|
|
232
232
|
return { restaurantId: "", roleId: "" };
|
|
233
233
|
}
|
|
234
|
-
const se =
|
|
234
|
+
const se = w(
|
|
235
235
|
() => {
|
|
236
236
|
var o;
|
|
237
|
-
return ((o =
|
|
237
|
+
return ((o = u.modelValue) == null ? void 0 : o.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
|
|
238
238
|
}
|
|
239
239
|
);
|
|
240
240
|
function g(o) {
|
|
241
|
-
o ?
|
|
241
|
+
o ? u.modelValue || a("update:model-value", {
|
|
242
242
|
code: "",
|
|
243
|
-
name:
|
|
244
|
-
roles: [
|
|
245
|
-
passcode:
|
|
243
|
+
name: u.fallbackName,
|
|
244
|
+
roles: [R()],
|
|
245
|
+
passcode: u.fallbackPasscode || ""
|
|
246
246
|
}) : a("update:model-value", null);
|
|
247
247
|
}
|
|
248
248
|
function S(o, l) {
|
|
249
|
-
if (!
|
|
250
|
-
const v = he(
|
|
249
|
+
if (!u.modelValue || o === "passcode" && u.modelValue.passcode === l) return;
|
|
250
|
+
const v = he(u.modelValue);
|
|
251
251
|
v[o] = l, a("update:model-value", v);
|
|
252
252
|
}
|
|
253
253
|
function p(o = "") {
|
|
254
|
-
return
|
|
254
|
+
return u.restaurants.filter((l) => l.managable || l._id === o).map((l) => ({
|
|
255
255
|
label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
|
|
256
256
|
value: l._id,
|
|
257
257
|
disabled: se.value.includes(l._id) && l._id !== o
|
|
258
258
|
}));
|
|
259
259
|
}
|
|
260
260
|
function h(o = "") {
|
|
261
|
-
return
|
|
261
|
+
return u.roles.map((l) => ({
|
|
262
262
|
label: l.label,
|
|
263
263
|
value: l.value,
|
|
264
264
|
disabled: !!l.disabled && l.value !== o
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
267
|
function me(o, l) {
|
|
268
|
-
var O,
|
|
269
|
-
if (!
|
|
270
|
-
const v =
|
|
268
|
+
var O, E, B;
|
|
269
|
+
if (!u.modelValue) return;
|
|
270
|
+
const v = u.modelValue.roles.length > 0 ? [...u.modelValue.roles] : [R()], U = ((O = v[o]) == null ? void 0 : O.roleId) ?? "", J = h(U), X = ((E = J.find((m) => m.value === U && !m.disabled)) == null ? void 0 : E.value) ?? ((B = J.find((m) => !m.disabled)) == null ? void 0 : B.value) ?? "";
|
|
271
271
|
v[o] = { restaurantId: l, roleId: X }, S("roles", v);
|
|
272
272
|
}
|
|
273
273
|
function j(o, l) {
|
|
274
|
-
var
|
|
275
|
-
if (!
|
|
276
|
-
const v =
|
|
274
|
+
var U;
|
|
275
|
+
if (!u.modelValue) return;
|
|
276
|
+
const v = u.modelValue.roles.length > 0 ? [...u.modelValue.roles] : [R()];
|
|
277
277
|
v[o] = {
|
|
278
|
-
restaurantId: ((
|
|
278
|
+
restaurantId: ((U = v[o]) == null ? void 0 : U.restaurantId) ?? "",
|
|
279
279
|
roleId: l
|
|
280
280
|
}, S("roles", v);
|
|
281
281
|
}
|
|
282
282
|
function L() {
|
|
283
|
-
|
|
283
|
+
u.modelValue && S("roles", [...u.modelValue.roles, R()]);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
const l =
|
|
285
|
+
function $(o) {
|
|
286
|
+
if (!u.modelValue) return;
|
|
287
|
+
const l = u.modelValue.roles.length > 0 ? [...u.modelValue.roles] : [R()];
|
|
288
288
|
S(
|
|
289
289
|
"roles",
|
|
290
|
-
l.length === 1 ? [
|
|
290
|
+
l.length === 1 ? [R()] : l.filter((v, U) => U !== o)
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
295
|
-
const o =
|
|
293
|
+
const A = w(() => {
|
|
294
|
+
if (!u.modelValue) return !1;
|
|
295
|
+
const o = u.restaurants.some(
|
|
296
296
|
(v) => v.managable && !se.value.includes(v._id)
|
|
297
|
-
), l =
|
|
297
|
+
), l = u.modelValue.roles.every(
|
|
298
298
|
(v) => v.restaurantId && v.roleId
|
|
299
299
|
);
|
|
300
300
|
return o && l;
|
|
301
301
|
});
|
|
302
302
|
function W() {
|
|
303
|
-
|
|
303
|
+
N.value && (N.value = !1, V.value = [], S("passcode", ""));
|
|
304
304
|
}
|
|
305
305
|
fe(
|
|
306
306
|
() => {
|
|
307
307
|
var o;
|
|
308
|
-
return (o =
|
|
308
|
+
return (o = u.modelValue) == null ? void 0 : o.passcode;
|
|
309
309
|
},
|
|
310
310
|
(o) => {
|
|
311
|
-
o && o.length ===
|
|
311
|
+
o && o.length === Le ? (V.value = o.split(""), N.value = !0) : (V.value = [], N.value = !1);
|
|
312
312
|
},
|
|
313
313
|
{ immediate: !0 }
|
|
314
314
|
), fe(
|
|
315
315
|
() => {
|
|
316
316
|
var o;
|
|
317
|
-
return (o =
|
|
317
|
+
return (o = u.modelValue) == null ? void 0 : o.roles;
|
|
318
318
|
},
|
|
319
319
|
(o) => {
|
|
320
|
-
|
|
320
|
+
u.modelValue && (!o || o.length === 0) && S("roles", [R()]);
|
|
321
321
|
},
|
|
322
322
|
{ immediate: !0, deep: !0 }
|
|
323
323
|
);
|
|
324
|
-
const te =
|
|
324
|
+
const te = w({
|
|
325
325
|
get: () => {
|
|
326
326
|
var o;
|
|
327
|
-
return ((o =
|
|
327
|
+
return ((o = u.modelValue) == null ? void 0 : o.roles) ?? [];
|
|
328
328
|
},
|
|
329
329
|
set: () => {
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
332
|
return (o, l) => {
|
|
333
|
-
const v = F("FmSwitch"),
|
|
334
|
-
return y(),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
333
|
+
const v = F("FmSwitch"), U = F("FmTextField"), J = F("FmPinField"), X = F("FmFormGroup"), O = F("FmSelect"), E = F("FmIcon"), B = F("FmButton");
|
|
334
|
+
return y(), M("div", tt, [
|
|
335
|
+
i("div", at, [
|
|
336
|
+
i("div", lt, [
|
|
337
|
+
i("div", ot, k(r(f)("team.memberForm.masterUser.title")), 1),
|
|
338
|
+
i("div", rt, k(r(f)("team.memberForm.masterUser.sublabel")), 1)
|
|
339
339
|
]),
|
|
340
|
-
|
|
340
|
+
i("div", null, [
|
|
341
341
|
d(v, {
|
|
342
|
-
"model-value": !!
|
|
342
|
+
"model-value": !!n.modelValue,
|
|
343
343
|
value: "master-user",
|
|
344
344
|
"onUpdate:modelValue": g
|
|
345
345
|
}, null, 8, ["model-value"])
|
|
346
346
|
])
|
|
347
347
|
]),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
d(
|
|
351
|
-
"model-value":
|
|
348
|
+
n.modelValue ? (y(), M(Ne, { key: 0 }, [
|
|
349
|
+
i("div", nt, [
|
|
350
|
+
d(U, {
|
|
351
|
+
"model-value": n.modelValue.code,
|
|
352
352
|
label: r(f)("team.memberForm.masterUser.code"),
|
|
353
353
|
"onUpdate:modelValue": l[0] || (l[0] = (m) => S("code", m))
|
|
354
354
|
}, null, 8, ["model-value", "label"]),
|
|
355
|
-
d(
|
|
356
|
-
"model-value":
|
|
355
|
+
d(U, {
|
|
356
|
+
"model-value": n.modelValue.name,
|
|
357
357
|
class: "w-full",
|
|
358
358
|
label: r(f)("team.memberForm.masterUser.name"),
|
|
359
359
|
rules: [(m) => !!m || r(f)("team.memberForm.masterUser.nameEmptyError")],
|
|
360
360
|
"onUpdate:modelValue": l[1] || (l[1] = (m) => S("name", m))
|
|
361
361
|
}, null, 8, ["model-value", "label", "rules"])
|
|
362
362
|
]),
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
i("div", it, [
|
|
364
|
+
i("div", ut, k(r(f)("team.memberForm.masterUser.passcode")), 1),
|
|
365
365
|
d(X, {
|
|
366
366
|
modelValue: V.value,
|
|
367
367
|
"onUpdate:modelValue": l[4] || (l[4] = (m) => V.value = m),
|
|
368
368
|
rules: [
|
|
369
|
-
(m) => (m == null ? void 0 : m.filter((_) => !!_).length) !==
|
|
369
|
+
(m) => (m == null ? void 0 : m.filter((_) => !!_).length) !== Le ? r(f)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
370
370
|
]
|
|
371
371
|
}, {
|
|
372
372
|
default: ue(() => [
|
|
373
373
|
(y(), z(J, {
|
|
374
|
-
key: `pin-field-${
|
|
374
|
+
key: `pin-field-${N.value}`,
|
|
375
375
|
modelValue: V.value,
|
|
376
376
|
"onUpdate:modelValue": l[2] || (l[2] = (m) => V.value = m),
|
|
377
|
-
length:
|
|
378
|
-
masked:
|
|
377
|
+
length: Le,
|
|
378
|
+
masked: N.value,
|
|
379
379
|
onComplete: l[3] || (l[3] = (m) => S("passcode", m)),
|
|
380
380
|
onFocus: W
|
|
381
381
|
}, null, 8, ["modelValue", "masked"]))
|
|
@@ -392,15 +392,15 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
392
392
|
]
|
|
393
393
|
}, {
|
|
394
394
|
default: ue(() => [
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
l[6] || (l[6] =
|
|
395
|
+
i("div", mt, [
|
|
396
|
+
i("div", dt, k(r(f)("team.memberForm.masterUser.assignmentSection")), 1),
|
|
397
|
+
i("div", ct, [
|
|
398
|
+
i("div", pt, [
|
|
399
|
+
i("div", ft, k(r(f)("team.table.columns.restaurant")), 1),
|
|
400
|
+
i("div", vt, k(r(f)("team.memberForm.masterUser.role")), 1),
|
|
401
|
+
l[6] || (l[6] = i("div", null, null, -1))
|
|
402
402
|
]),
|
|
403
|
-
(y(!0),
|
|
403
|
+
(y(!0), M(Ne, null, us(n.modelValue.roles, (m, _) => (y(), M("div", {
|
|
404
404
|
key: `${m.restaurantId || "new"}-${_}`,
|
|
405
405
|
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
406
406
|
}, [
|
|
@@ -410,7 +410,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
410
410
|
items: p(m.restaurantId),
|
|
411
411
|
multiselect: !1,
|
|
412
412
|
placeholder: r(f)("team.table.columns.restaurant"),
|
|
413
|
-
"onUpdate:modelValue": (
|
|
413
|
+
"onUpdate:modelValue": (I) => me(_, I)
|
|
414
414
|
}, null, 8, ["model-value", "items", "placeholder", "onUpdate:modelValue"]),
|
|
415
415
|
d(O, {
|
|
416
416
|
class: "min-w-0",
|
|
@@ -419,22 +419,22 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
419
419
|
multiselect: !1,
|
|
420
420
|
placeholder: r(f)("team.memberForm.masterUser.role"),
|
|
421
421
|
disabled: !m.restaurantId,
|
|
422
|
-
"onUpdate:modelValue": (
|
|
422
|
+
"onUpdate:modelValue": (I) => j(_, I)
|
|
423
423
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
i("div", bt, [
|
|
425
|
+
n.modelValue.roles.length > 1 ? (y(), M("div", {
|
|
426
426
|
key: 0,
|
|
427
427
|
role: "button",
|
|
428
428
|
tabindex: "0",
|
|
429
429
|
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",
|
|
430
430
|
"aria-label": r(f)("common.remove"),
|
|
431
|
-
onClick: Ve((
|
|
431
|
+
onClick: Ve((I) => $(_), ["stop"]),
|
|
432
432
|
onKeydown: [
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
Te(Ve((I) => $(_), ["prevent", "stop"]), ["enter"]),
|
|
434
|
+
Te(Ve((I) => $(_), ["prevent", "stop"]), ["space"])
|
|
435
435
|
]
|
|
436
436
|
}, [
|
|
437
|
-
d(
|
|
437
|
+
d(E, {
|
|
438
438
|
name: "delete",
|
|
439
439
|
size: "md"
|
|
440
440
|
})
|
|
@@ -450,7 +450,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
450
450
|
"prepend-icon": "add",
|
|
451
451
|
label: r(f)("team.memberForm.masterUser.addAnother"),
|
|
452
452
|
size: "md",
|
|
453
|
-
disabled: !
|
|
453
|
+
disabled: !A.value,
|
|
454
454
|
onClick: Ve(L, ["stop"])
|
|
455
455
|
}, null, 8, ["label", "disabled"])
|
|
456
456
|
])
|
|
@@ -461,13 +461,13 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
461
461
|
]);
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
}), _t = { class: "flex flex-col gap-32" }, gt = { class: "flex w-full" },
|
|
464
|
+
}), _t = { class: "flex flex-col gap-32" }, gt = { class: "flex w-full" }, Ut = {
|
|
465
465
|
key: 0,
|
|
466
466
|
class: "space-y-24"
|
|
467
|
-
},
|
|
467
|
+
}, xt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, St = { class: "fm-typo-en-title-sm-600" }, Ft = { class: "space-y-16" }, Vt = { class: "fm-typo-en-title-sm-600" }, It = {
|
|
468
468
|
key: 1,
|
|
469
469
|
class: "flex items-center justify-center py-64"
|
|
470
|
-
},
|
|
470
|
+
}, wt = /* @__PURE__ */ we({
|
|
471
471
|
__name: "AddMemberForm",
|
|
472
472
|
props: {
|
|
473
473
|
initialValue: {
|
|
@@ -482,37 +482,37 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
482
482
|
default: !1
|
|
483
483
|
}
|
|
484
484
|
},
|
|
485
|
-
setup(
|
|
485
|
+
setup(n, { expose: D }) {
|
|
486
486
|
var Re, le, Z;
|
|
487
|
-
const
|
|
488
|
-
() =>
|
|
487
|
+
const u = n, { t: a } = Pe(), f = es(), { breakpoints: N } = ss(), V = b(), R = ts(), se = w(
|
|
488
|
+
() => R.permissionSets.value.map((s) => ({
|
|
489
489
|
label: s.name,
|
|
490
490
|
value: s.id
|
|
491
491
|
}))
|
|
492
|
-
), g = b(((Re =
|
|
493
|
-
() =>
|
|
494
|
-
), p = b((le =
|
|
495
|
-
|
|
492
|
+
), g = b(((Re = u.initialValue) == null ? void 0 : Re.permissionSetIds) || []), S = w(
|
|
493
|
+
() => je(g.value, R.permissionSets.value)
|
|
494
|
+
), p = b((le = u.initialValue) == null ? void 0 : le.posUser), h = b(
|
|
495
|
+
Ke(
|
|
496
496
|
Me(S.value),
|
|
497
|
-
((Z =
|
|
497
|
+
((Z = u.initialValue) == null ? void 0 : Z.permissions) || []
|
|
498
498
|
)
|
|
499
499
|
), { customReportPermissions: me, isLoaded: j } = as(), L = new Set(
|
|
500
|
-
|
|
501
|
-
),
|
|
500
|
+
ze.filter((s) => s.subject.startsWith(Vs)).map((s) => s.subject)
|
|
501
|
+
), $ = w(() => {
|
|
502
502
|
const s = new Set(L);
|
|
503
503
|
for (const c of me.value) s.add(c.subject);
|
|
504
504
|
return s;
|
|
505
|
-
}),
|
|
505
|
+
}), A = w(() => {
|
|
506
506
|
const s = /* @__PURE__ */ new Set();
|
|
507
|
-
for (const c of
|
|
508
|
-
c.category ===
|
|
507
|
+
for (const c of ze)
|
|
508
|
+
c.category === qe.reports && s.add(c.subject);
|
|
509
509
|
for (const c of me.value)
|
|
510
|
-
c.category ===
|
|
510
|
+
c.category === qe.reports && s.add(c.subject);
|
|
511
511
|
return s;
|
|
512
|
-
}), W = rs(), te = ls().roles, o =
|
|
513
|
-
const s =
|
|
512
|
+
}), W = rs(), te = ls().roles, o = w(() => Ge(h.value)), l = w(() => {
|
|
513
|
+
const s = We(h.value);
|
|
514
514
|
return s === null ? W.restaurants.value : W.restaurants.value.filter((c) => s.includes(c._id));
|
|
515
|
-
}), v =
|
|
515
|
+
}), v = w(() => {
|
|
516
516
|
const s = o.value;
|
|
517
517
|
return te.value.map(
|
|
518
518
|
(c) => ({
|
|
@@ -521,34 +521,34 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
521
521
|
disabled: !!s && !s.includes(c._id)
|
|
522
522
|
})
|
|
523
523
|
);
|
|
524
|
-
}),
|
|
524
|
+
}), U = b({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
|
|
525
525
|
function J(s) {
|
|
526
|
-
V.value = void 0, g.value = [...(s == null ? void 0 : s.permissionSetIds) ?? []], h.value =
|
|
526
|
+
V.value = void 0, g.value = [...(s == null ? void 0 : s.permissionSetIds) ?? []], h.value = Ke(
|
|
527
527
|
Me(
|
|
528
|
-
|
|
528
|
+
je(
|
|
529
529
|
g.value,
|
|
530
|
-
|
|
530
|
+
R.permissionSets.value
|
|
531
531
|
)
|
|
532
532
|
),
|
|
533
533
|
(s == null ? void 0 : s.permissions) || []
|
|
534
|
-
), p.value = s != null && s.posUser ? ve(he(s.posUser), h.value) : void 0, be.value = !!p.value,
|
|
534
|
+
), p.value = s != null && s.posUser ? ve(he(s.posUser), h.value) : void 0, be.value = !!p.value, U.value = {
|
|
535
535
|
permissionSetIds: [...g.value],
|
|
536
536
|
userPermissions: he(h.value),
|
|
537
537
|
posUser: p.value ? he(p.value) : void 0
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
540
|
function X() {
|
|
541
|
-
return !
|
|
541
|
+
return !u.initialValue && V.value ? !0 : !Se.isEqual(g.value, U.value.permissionSetIds) || !Se.isEqual(h.value, U.value.userPermissions) || !Se.isEqual(p.value, U.value.posUser);
|
|
542
542
|
}
|
|
543
543
|
function O(s) {
|
|
544
544
|
V.value = s;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function E(s) {
|
|
547
547
|
p.value = ve(p.value, s);
|
|
548
548
|
}
|
|
549
549
|
function B(s) {
|
|
550
550
|
return Me(
|
|
551
|
-
|
|
551
|
+
je(s, R.permissionSets.value)
|
|
552
552
|
);
|
|
553
553
|
}
|
|
554
554
|
function m(s) {
|
|
@@ -568,7 +568,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
568
568
|
f.open({
|
|
569
569
|
title: a("permissionSet.form.overrideInherited.title"),
|
|
570
570
|
message: a("permissionSet.form.overrideInherited.message"),
|
|
571
|
-
minWidth:
|
|
571
|
+
minWidth: N.value.lg ? 588 : 0,
|
|
572
572
|
primaryActions: {
|
|
573
573
|
text: a("permissionSet.form.overrideInherited.override"),
|
|
574
574
|
close: !1
|
|
@@ -581,17 +581,17 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
581
581
|
m(c), f.close();
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
const s = j.value ?
|
|
586
|
-
return ks(c,
|
|
584
|
+
function I() {
|
|
585
|
+
const s = j.value ? $.value : L, c = Ps(h.value, s);
|
|
586
|
+
return ks(c, A.value);
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
const s = Me(S.value), c =
|
|
590
|
-
return
|
|
588
|
+
function Ae() {
|
|
589
|
+
const s = Me(S.value), c = Is(I());
|
|
590
|
+
return ws(s, c);
|
|
591
591
|
}
|
|
592
592
|
function ke() {
|
|
593
593
|
var T, G, Q, q, ce, Y, H, oe, pe, $e;
|
|
594
|
-
const s =
|
|
594
|
+
const s = Ae(), c = I().filter((re) => !re.inverted);
|
|
595
595
|
return {
|
|
596
596
|
email: ((T = V.value) == null ? void 0 : T.email) ?? void 0,
|
|
597
597
|
phoneNumber: ((G = V.value) == null ? void 0 : G.phoneNumber) ?? void 0,
|
|
@@ -601,11 +601,11 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
601
601
|
subject: bs(re.subject)
|
|
602
602
|
})),
|
|
603
603
|
permissionSetIds: g.value,
|
|
604
|
-
name: ((Q = V.value) == null ? void 0 : Q.displayName) || ((q =
|
|
604
|
+
name: ((Q = V.value) == null ? void 0 : Q.displayName) || ((q = u.initialValue) == null ? void 0 : q.name) || "",
|
|
605
605
|
posUser: p.value ? {
|
|
606
606
|
...p.value,
|
|
607
|
-
name: p.value.name || ((Y = (ce =
|
|
608
|
-
code: p.value.code || (($e = (pe =
|
|
607
|
+
name: p.value.name || ((Y = (ce = u.initialValue) == null ? void 0 : ce.posUser) == null ? void 0 : Y.name) || ((H = u.initialValue) == null ? void 0 : H.name) || ((oe = V.value) == null ? void 0 : oe.displayName) || "",
|
|
608
|
+
code: p.value.code || (($e = (pe = u.initialValue) == null ? void 0 : pe.posUser) == null ? void 0 : $e.code) || "",
|
|
609
609
|
passcode: p.value.passcode,
|
|
610
610
|
roles: p.value.roles.filter((re) => !!re.roleId)
|
|
611
611
|
} : p.value === null ? null : void 0
|
|
@@ -614,7 +614,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
614
614
|
const ae = b();
|
|
615
615
|
function ve(s, c) {
|
|
616
616
|
if (!s) return s;
|
|
617
|
-
const T =
|
|
617
|
+
const T = Ge(c), G = We(c);
|
|
618
618
|
if (T === null && G === null) return s;
|
|
619
619
|
const Q = he(s);
|
|
620
620
|
return Q.roles = Q.roles.filter(
|
|
@@ -622,7 +622,7 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
622
622
|
), Q;
|
|
623
623
|
}
|
|
624
624
|
const be = b(!!p.value), de = b(!1);
|
|
625
|
-
function
|
|
625
|
+
function Ee(s) {
|
|
626
626
|
p.value = s, de.value = !0;
|
|
627
627
|
}
|
|
628
628
|
fe(
|
|
@@ -631,19 +631,19 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
631
631
|
s && !be.value && de.value && (await ms(), ae.value && ae.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), be.value = s;
|
|
632
632
|
}
|
|
633
633
|
);
|
|
634
|
-
const
|
|
635
|
-
async function
|
|
636
|
-
return (await
|
|
634
|
+
const Ue = b();
|
|
635
|
+
async function De() {
|
|
636
|
+
return (await Ue.value.validateInputsWithoutSubmit()).length ? null : ke();
|
|
637
637
|
}
|
|
638
638
|
return fe(
|
|
639
|
-
() =>
|
|
639
|
+
() => u.initialValue,
|
|
640
640
|
(s, c) => {
|
|
641
641
|
if (!c || !s || c.id !== s.id) {
|
|
642
642
|
de.value = !1, J(s);
|
|
643
643
|
return;
|
|
644
644
|
}
|
|
645
|
-
s.posUser !== void 0 && !de.value && (p.value = s.posUser ? ve(he(s.posUser), h.value) : void 0,
|
|
646
|
-
...
|
|
645
|
+
s.posUser !== void 0 && !de.value && (p.value = s.posUser ? ve(he(s.posUser), h.value) : void 0, U.value = {
|
|
646
|
+
...U.value,
|
|
647
647
|
posUser: p.value ? he(p.value) : void 0
|
|
648
648
|
});
|
|
649
649
|
},
|
|
@@ -654,34 +654,34 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
654
654
|
p.value = ve(p.value, s);
|
|
655
655
|
},
|
|
656
656
|
{ deep: !0 }
|
|
657
|
-
),
|
|
657
|
+
), D({
|
|
658
658
|
readFormData: ke,
|
|
659
|
-
validate:
|
|
659
|
+
validate: De,
|
|
660
660
|
isModified: X
|
|
661
661
|
}), (s, c) => {
|
|
662
662
|
const T = F("FmSelect"), G = F("FmCircularProgress"), Q = F("FmForm");
|
|
663
663
|
return y(), z(Q, {
|
|
664
664
|
ref_key: "formRef",
|
|
665
|
-
ref:
|
|
665
|
+
ref: Ue,
|
|
666
666
|
class: "mx-4"
|
|
667
667
|
}, {
|
|
668
668
|
default: ue(() => {
|
|
669
669
|
var q, ce, Y, H, oe;
|
|
670
670
|
return [
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
671
|
+
i("div", _t, [
|
|
672
|
+
i("div", gt, [
|
|
673
|
+
n.initialValue ? (y(), z(zs, {
|
|
674
674
|
key: 1,
|
|
675
|
-
data:
|
|
675
|
+
data: n.initialValue
|
|
676
676
|
}, null, 8, ["data"])) : (y(), z(st, {
|
|
677
677
|
key: 0,
|
|
678
678
|
onInvite: c[0] || (c[0] = (pe) => O(pe))
|
|
679
679
|
}))
|
|
680
680
|
]),
|
|
681
|
-
V.value ||
|
|
682
|
-
(q =
|
|
683
|
-
|
|
684
|
-
|
|
681
|
+
V.value || n.initialValue ? (y(), M(Ne, { key: 0 }, [
|
|
682
|
+
(q = n.initialValue) != null && q.isOwner ? K("", !0) : (y(), M("div", Ut, [
|
|
683
|
+
i("div", xt, [
|
|
684
|
+
i("div", St, k(r(a)("team.memberForm.permissionSet.title")), 1),
|
|
685
685
|
d(T, {
|
|
686
686
|
"model-value": g.value,
|
|
687
687
|
multiselect: "",
|
|
@@ -692,28 +692,28 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
692
692
|
"onUpdate:modelValue": _
|
|
693
693
|
}, null, 8, ["model-value", "items", "placeholder"])
|
|
694
694
|
]),
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
i("div", Ft, [
|
|
696
|
+
i("div", Vt, k(r(a)("team.memberForm.permissions.title")), 1),
|
|
697
697
|
d(Cs, {
|
|
698
698
|
modelValue: h.value,
|
|
699
699
|
"onUpdate:modelValue": c[1] || (c[1] = (pe) => h.value = pe),
|
|
700
700
|
"inherit-permissions": S.value,
|
|
701
|
-
onPermissionChanged:
|
|
701
|
+
onPermissionChanged: E
|
|
702
702
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
703
703
|
])
|
|
704
704
|
])),
|
|
705
|
-
|
|
705
|
+
n.loading ? (y(), M("div", It, [
|
|
706
706
|
d(G, { size: "xl" })
|
|
707
707
|
])) : (y(), z(yt, {
|
|
708
708
|
key: 2,
|
|
709
709
|
ref_key: "masterUserContentRef",
|
|
710
710
|
ref: ae,
|
|
711
711
|
"model-value": p.value,
|
|
712
|
-
"fallback-name": ((ce =
|
|
713
|
-
"fallback-passcode": (oe = (H =
|
|
712
|
+
"fallback-name": ((ce = n.initialValue) == null ? void 0 : ce.name) || ((Y = V.value) == null ? void 0 : Y.displayName) || "",
|
|
713
|
+
"fallback-passcode": (oe = (H = n.initialValue) == null ? void 0 : H.posUser) == null ? void 0 : oe.passcode,
|
|
714
714
|
roles: v.value,
|
|
715
715
|
restaurants: l.value,
|
|
716
|
-
"onUpdate:modelValue":
|
|
716
|
+
"onUpdate:modelValue": Ee
|
|
717
717
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
|
|
718
718
|
], 64)) : K("", !0)
|
|
719
719
|
])
|
|
@@ -746,49 +746,49 @@ const Ms = { class: "w-full flex flex-col gap-16" }, Ns = { class: "flex items-c
|
|
|
746
746
|
}, Dt = {
|
|
747
747
|
class: "flex items-center justify-start gap-8"
|
|
748
748
|
}, _e = 100;
|
|
749
|
-
var ee = /* @__PURE__ */ function(
|
|
750
|
-
return
|
|
749
|
+
var ee = /* @__PURE__ */ function(n) {
|
|
750
|
+
return n[n.ADD = 0] = "ADD", n[n.UPDATE = 1] = "UPDATE", n[n.CLOSED = 2] = "CLOSED", n;
|
|
751
751
|
}(ee || {});
|
|
752
|
-
const sa = /* @__PURE__ */
|
|
752
|
+
const sa = /* @__PURE__ */ we({
|
|
753
753
|
__name: "TeamMemberList",
|
|
754
|
-
setup(
|
|
755
|
-
expose:
|
|
754
|
+
setup(n, {
|
|
755
|
+
expose: D
|
|
756
756
|
}) {
|
|
757
757
|
const {
|
|
758
|
-
fetchCustomReportPermissions:
|
|
758
|
+
fetchCustomReportPermissions: u
|
|
759
759
|
} = as();
|
|
760
760
|
os();
|
|
761
761
|
const {
|
|
762
762
|
t: a
|
|
763
|
-
} = Pe(), f =
|
|
764
|
-
fe(
|
|
763
|
+
} = Pe(), f = Ye(), N = rs(), V = ls(), R = He(), se = Fs(R), g = ts(), S = Rs(), p = b(!0), h = b(!1), me = w(() => N.isLoading.value), j = b([]), L = b(0), $ = b(1), A = b(""), W = b("");
|
|
764
|
+
fe(N.restaurants, (e) => {
|
|
765
765
|
if (e.length > 0 && j.value.length > 0) {
|
|
766
|
-
const t = new Map(e.map((P) => [P._id, P.profile.name])),
|
|
766
|
+
const t = new Map(e.map((P) => [P._id, P.profile.name])), x = e.map((P) => P.profile.name).sort();
|
|
767
767
|
j.value = j.value.map((P) => ({
|
|
768
768
|
...P,
|
|
769
|
-
restaurants: P.managableRestaurantIds === null ?
|
|
769
|
+
restaurants: P.managableRestaurantIds === null ? x : P.managableRestaurantIds.map((ne) => t.get(ne) ?? "").filter(Boolean).sort()
|
|
770
770
|
}));
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
|
-
const te =
|
|
773
|
+
const te = w(() => [{
|
|
774
774
|
label: a("team.filter.unassigned_label"),
|
|
775
|
-
value:
|
|
776
|
-
}, ...
|
|
775
|
+
value: Ie
|
|
776
|
+
}, ...N.restaurants.value.map((e) => ({
|
|
777
777
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
778
778
|
value: e._id
|
|
779
779
|
}))]), o = ({
|
|
780
780
|
member: e,
|
|
781
781
|
className: t = ""
|
|
782
782
|
}) => {
|
|
783
|
-
const
|
|
783
|
+
const x = {
|
|
784
784
|
label: a("team.actions.updateMember"),
|
|
785
785
|
onClick: () => B(ge.Update, e)
|
|
786
786
|
}, P = {
|
|
787
787
|
label: a("team.actions.removeMember"),
|
|
788
788
|
onClick: () => B(ge.Remove, e),
|
|
789
789
|
itemClass: "text-fm-color-typo-error"
|
|
790
|
-
}, ne = e.doc.isOwner ? [
|
|
791
|
-
return d(
|
|
790
|
+
}, ne = e.doc.isOwner ? [x] : [x, P];
|
|
791
|
+
return d(Us, {
|
|
792
792
|
class: t,
|
|
793
793
|
items: ne
|
|
794
794
|
}, null);
|
|
@@ -800,7 +800,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
800
800
|
const t = e.row.original;
|
|
801
801
|
return d("div", {
|
|
802
802
|
class: "flex items-center gap-8"
|
|
803
|
-
}, [d(
|
|
803
|
+
}, [d(Be.FmAvatar, {
|
|
804
804
|
name: t.name,
|
|
805
805
|
size: "sm",
|
|
806
806
|
class: "shrink-0"
|
|
@@ -827,7 +827,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
827
827
|
header: () => a("team.table.columns.assignedRoles"),
|
|
828
828
|
enableSorting: !1,
|
|
829
829
|
cell(e) {
|
|
830
|
-
const t = e.row.original,
|
|
830
|
+
const t = e.row.original, x = S.getPermissionAssignmentByUserId(t.id), P = (x == null ? void 0 : x.permissionSetIds) || t.doc.permissionSetIds || [];
|
|
831
831
|
return g.permissionSets.value.filter((ie) => P.includes(ie.id)).map((ie) => ie.name).join(", ");
|
|
832
832
|
}
|
|
833
833
|
}, {
|
|
@@ -836,7 +836,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
836
836
|
enableSorting: !1,
|
|
837
837
|
cell(e) {
|
|
838
838
|
const t = e.row.original;
|
|
839
|
-
return
|
|
839
|
+
return U(t);
|
|
840
840
|
},
|
|
841
841
|
meta: {
|
|
842
842
|
width: "200px"
|
|
@@ -856,18 +856,18 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
856
856
|
},
|
|
857
857
|
enableSorting: !1
|
|
858
858
|
}];
|
|
859
|
-
function
|
|
859
|
+
function U(e) {
|
|
860
860
|
if (e.doc.isOwner)
|
|
861
861
|
return a("team.labels.businessOwner");
|
|
862
|
-
const t = d(
|
|
862
|
+
const t = d(Be.FmTooltip, {
|
|
863
863
|
variant: "plain",
|
|
864
864
|
placement: "top"
|
|
865
865
|
}, {
|
|
866
|
-
default: () => d(
|
|
866
|
+
default: () => d(Be.FmIcon, {
|
|
867
867
|
name: "info",
|
|
868
868
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
869
869
|
}, null),
|
|
870
|
-
content: () => d("div", null, [a("team.labels.permission"), e.permissionLabels.map((
|
|
870
|
+
content: () => d("div", null, [a("team.labels.permission"), e.permissionLabels.map((x) => d("div", null, [ps("- "), x]))])
|
|
871
871
|
});
|
|
872
872
|
return d("div", {
|
|
873
873
|
class: "flex flex-row items-center gap-8"
|
|
@@ -876,61 +876,61 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
876
876
|
})]), e.permissionLabels.length > 0 && t]);
|
|
877
877
|
}
|
|
878
878
|
function J(e) {
|
|
879
|
-
var ne, ie, Ce,
|
|
880
|
-
const t = S.getPermissionAssignmentByUserId(e.id),
|
|
879
|
+
var ne, ie, Ce, xe;
|
|
880
|
+
const t = S.getPermissionAssignmentByUserId(e.id), x = (t == null ? void 0 : t.customPermissions) ?? e.permissions ?? [], P = (t == null ? void 0 : t.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
881
881
|
return {
|
|
882
882
|
id: e.id,
|
|
883
883
|
isOwner: e.doc.isOwner,
|
|
884
884
|
name: e.name,
|
|
885
885
|
phoneNumber: e.phoneNumber,
|
|
886
886
|
email: e.email,
|
|
887
|
-
permissions:
|
|
887
|
+
permissions: x,
|
|
888
888
|
permissionSetIds: P,
|
|
889
889
|
posUser: e.doc.posUser ? {
|
|
890
890
|
code: ((ne = e.doc.posUser) == null ? void 0 : ne.code) ?? "",
|
|
891
891
|
name: ((ie = e.doc.posUser) == null ? void 0 : ie.name) ?? e.name,
|
|
892
892
|
passcode: ((Ce = e.doc.posUser) == null ? void 0 : Ce.passcode) ?? "",
|
|
893
|
-
roles: ((
|
|
893
|
+
roles: ((xe = e.doc.posUser) == null ? void 0 : xe.roles) ?? []
|
|
894
894
|
} : void 0
|
|
895
895
|
};
|
|
896
896
|
}
|
|
897
897
|
function X(e) {
|
|
898
|
-
const t = S.getPermissionAssignmentByUserId(e.id),
|
|
898
|
+
const t = S.getPermissionAssignmentByUserId(e.id), x = (t == null ? void 0 : t.customPermissions) ?? e.permissions ?? [], P = (t == null ? void 0 : t.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
899
899
|
return {
|
|
900
900
|
id: e.id,
|
|
901
901
|
isOwner: e.doc.isOwner,
|
|
902
902
|
name: e.name,
|
|
903
903
|
phoneNumber: e.phoneNumber,
|
|
904
904
|
email: e.email,
|
|
905
|
-
permissions:
|
|
905
|
+
permissions: x,
|
|
906
906
|
permissionSetIds: P,
|
|
907
907
|
posUser: void 0
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
910
|
const O = b(!1);
|
|
911
|
-
let
|
|
911
|
+
let E = 0;
|
|
912
912
|
const B = async (e, t) => {
|
|
913
913
|
if (e == ge.Update) {
|
|
914
|
-
const
|
|
914
|
+
const x = ++E;
|
|
915
915
|
ae.value = X(t), _.value = ee.UPDATE, O.value = t.doc.hasPosUser === !0;
|
|
916
916
|
try {
|
|
917
917
|
const P = await Fe.readTeamMember(t.id);
|
|
918
|
-
if (
|
|
918
|
+
if (x !== E) return;
|
|
919
919
|
ae.value = J(P);
|
|
920
920
|
} catch {
|
|
921
|
-
if (
|
|
922
|
-
|
|
921
|
+
if (x !== E) return;
|
|
922
|
+
R.open({
|
|
923
923
|
message: a("common.error"),
|
|
924
924
|
type: "error"
|
|
925
925
|
}), de();
|
|
926
926
|
} finally {
|
|
927
|
-
|
|
927
|
+
x === E && (O.value = !1);
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
e == ge.Remove &&
|
|
931
|
-
}, m = es(), _ = b(ee.CLOSED),
|
|
930
|
+
e == ge.Remove && De(t);
|
|
931
|
+
}, m = es(), _ = b(ee.CLOSED), I = w(() => _.value !== ee.CLOSED), Ae = w(() => _.value === ee.ADD ? a("common.add") : a("common.update")), ke = w(() => _.value === ee.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), ae = b();
|
|
932
932
|
function ve() {
|
|
933
|
-
|
|
933
|
+
E++, O.value = !1, _.value = ee.CLOSED;
|
|
934
934
|
}
|
|
935
935
|
const be = gs(() => {
|
|
936
936
|
var e;
|
|
@@ -939,18 +939,18 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
939
939
|
function de() {
|
|
940
940
|
be();
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Ee(e) {
|
|
943
943
|
e || de();
|
|
944
944
|
}
|
|
945
945
|
const {
|
|
946
|
-
breakpoints:
|
|
947
|
-
} = ss(),
|
|
946
|
+
breakpoints: Ue
|
|
947
|
+
} = ss(), De = (e) => {
|
|
948
948
|
m.open({
|
|
949
949
|
title: a("team.actions.removeMember"),
|
|
950
950
|
message: a("team.removeMember.confirmationMessage", {
|
|
951
951
|
memberName: e.name
|
|
952
952
|
}),
|
|
953
|
-
minWidth:
|
|
953
|
+
minWidth: Ue.value.lg ? 588 : 0,
|
|
954
954
|
primaryActions: {
|
|
955
955
|
text: "Remove",
|
|
956
956
|
close: !1,
|
|
@@ -973,7 +973,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
973
973
|
});
|
|
974
974
|
}, Re = () => {
|
|
975
975
|
ae.value = null, _.value = ee.ADD;
|
|
976
|
-
}, le = b(), Z = b(), s = b(), c =
|
|
976
|
+
}, le = b(), Z = b(), s = b(), c = w(() => {
|
|
977
977
|
var e;
|
|
978
978
|
return JSON.stringify({
|
|
979
979
|
businessId: ((e = f.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
@@ -982,12 +982,12 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
982
982
|
permissionSubjects: [...Z.value ?? []].sort(),
|
|
983
983
|
permissionSetIds: [...s.value ?? []].sort()
|
|
984
984
|
});
|
|
985
|
-
}), T =
|
|
985
|
+
}), T = w(() => Object.values(hs).map((e) => ({
|
|
986
986
|
label: e.label,
|
|
987
987
|
value: e.subject
|
|
988
|
-
}))), G =
|
|
988
|
+
}))), G = w(() => [{
|
|
989
989
|
label: a("team.filter.unassigned_label"),
|
|
990
|
-
value:
|
|
990
|
+
value: Ie
|
|
991
991
|
}, ...g.permissionSets.value.map((e) => ({
|
|
992
992
|
label: e.name,
|
|
993
993
|
value: e.id
|
|
@@ -995,19 +995,19 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
995
995
|
async function Q() {
|
|
996
996
|
await V.readRoles();
|
|
997
997
|
}
|
|
998
|
-
async function q(e =
|
|
998
|
+
async function q(e = $.value) {
|
|
999
999
|
var t;
|
|
1000
1000
|
p.value = !0;
|
|
1001
1001
|
try {
|
|
1002
|
-
const
|
|
1002
|
+
const x = await Fe.readTeamMembersPage({
|
|
1003
1003
|
limit: _e,
|
|
1004
1004
|
offset: (e - 1) * _e,
|
|
1005
1005
|
search: W.value.trim() || void 0,
|
|
1006
|
-
restaurantIds:
|
|
1006
|
+
restaurantIds: Ze(le.value),
|
|
1007
1007
|
permissionSubjects: (t = Z.value) != null && t.length ? Z.value : void 0,
|
|
1008
|
-
permissionSetIds:
|
|
1008
|
+
permissionSetIds: Ze(s.value)
|
|
1009
1009
|
});
|
|
1010
|
-
j.value =
|
|
1010
|
+
j.value = x.items, L.value = x.total;
|
|
1011
1011
|
} finally {
|
|
1012
1012
|
p.value = !1;
|
|
1013
1013
|
}
|
|
@@ -1015,9 +1015,9 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1015
1015
|
async function ce() {
|
|
1016
1016
|
var t;
|
|
1017
1017
|
if (!((t = f.currentBusiness.value) != null && t._id)) return;
|
|
1018
|
-
await q(
|
|
1018
|
+
await q($.value);
|
|
1019
1019
|
const e = Math.max(1, Math.ceil(L.value / _e));
|
|
1020
|
-
|
|
1020
|
+
$.value > e && ($.value = e, await q($.value));
|
|
1021
1021
|
}
|
|
1022
1022
|
const Y = b(), H = b(!1), oe = b(!1);
|
|
1023
1023
|
async function pe() {
|
|
@@ -1042,54 +1042,54 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1042
1042
|
async function re() {
|
|
1043
1043
|
await S.readPermissionAssignments();
|
|
1044
1044
|
}
|
|
1045
|
-
let
|
|
1045
|
+
let Oe = !1;
|
|
1046
1046
|
async function ns({
|
|
1047
1047
|
pageIndex: e
|
|
1048
1048
|
}) {
|
|
1049
1049
|
var t;
|
|
1050
|
-
if ((t = f.currentBusiness.value) != null && t._id && !
|
|
1051
|
-
|
|
1050
|
+
if ((t = f.currentBusiness.value) != null && t._id && !Oe && !(e === 0 && $.value === 1 && j.value.length > 0)) {
|
|
1051
|
+
Oe = !0, $.value = e + 1;
|
|
1052
1052
|
try {
|
|
1053
|
-
await q(
|
|
1053
|
+
await q($.value);
|
|
1054
1054
|
} finally {
|
|
1055
|
-
|
|
1055
|
+
Oe = !1;
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
|
-
const is = fs(
|
|
1060
|
-
W.value =
|
|
1059
|
+
const is = fs(A, () => {
|
|
1060
|
+
W.value = A.value;
|
|
1061
1061
|
});
|
|
1062
1062
|
return ds(is), fe(c, async () => {
|
|
1063
1063
|
var e;
|
|
1064
|
-
|
|
1064
|
+
$.value = 1, h.value = !1, (e = f.currentBusiness.value) != null && e._id && (await q(1), h.value = !0);
|
|
1065
1065
|
}, {
|
|
1066
1066
|
immediate: !0
|
|
1067
1067
|
}), fe(f.currentBusiness, async () => {
|
|
1068
1068
|
var e;
|
|
1069
1069
|
if ((e = f.currentBusiness.value) != null && e._id)
|
|
1070
1070
|
try {
|
|
1071
|
-
await Promise.all([
|
|
1071
|
+
await Promise.all([N.readRestaurants(), $e(), re(), u(), Q()]);
|
|
1072
1072
|
} catch (t) {
|
|
1073
|
-
console.error("Failed to load team member dependencies:", t),
|
|
1073
|
+
console.error("Failed to load team member dependencies:", t), R.open({
|
|
1074
1074
|
message: t instanceof Error ? t.message : String(t),
|
|
1075
1075
|
type: "error"
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
1078
|
}, {
|
|
1079
1079
|
immediate: !0
|
|
1080
|
-
}),
|
|
1080
|
+
}), D({
|
|
1081
1081
|
create: Re
|
|
1082
1082
|
}), (e, t) => {
|
|
1083
|
-
var
|
|
1084
|
-
const
|
|
1085
|
-
return y(),
|
|
1086
|
-
modelValue:
|
|
1087
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1083
|
+
var xe;
|
|
1084
|
+
const x = F("FmSearch"), P = F("FmTable"), ne = F("FmIcon"), ie = F("FmButton"), Ce = F("FmSideSheet");
|
|
1085
|
+
return y(), M(Ne, null, [i("div", Pt, [i("div", kt, [r(Ue).xs ? (y(), M("div", Ct, [d(x, {
|
|
1086
|
+
modelValue: A.value,
|
|
1087
|
+
"onUpdate:modelValue": t[4] || (t[4] = (C) => A.value = C),
|
|
1088
1088
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1089
1089
|
placeholder: r(a)("team.search.placeholder")
|
|
1090
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
1090
|
+
}, null, 8, ["modelValue", "placeholder"]), i("div", Mt, [d(ye, {
|
|
1091
1091
|
modelValue: le.value,
|
|
1092
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
1092
|
+
"onUpdate:modelValue": t[5] || (t[5] = (C) => le.value = C),
|
|
1093
1093
|
multiple: "",
|
|
1094
1094
|
items: te.value,
|
|
1095
1095
|
variant: "dark",
|
|
@@ -1098,7 +1098,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1098
1098
|
class: "!w-auto"
|
|
1099
1099
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1100
1100
|
modelValue: Z.value,
|
|
1101
|
-
"onUpdate:modelValue": t[6] || (t[6] = (
|
|
1101
|
+
"onUpdate:modelValue": t[6] || (t[6] = (C) => Z.value = C),
|
|
1102
1102
|
multiple: "",
|
|
1103
1103
|
variant: "dark",
|
|
1104
1104
|
items: T.value,
|
|
@@ -1106,15 +1106,15 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1106
1106
|
placeholder: r(a)("team.filter.permission_placeholder")
|
|
1107
1107
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1108
1108
|
modelValue: s.value,
|
|
1109
|
-
"onUpdate:modelValue": t[7] || (t[7] = (
|
|
1109
|
+
"onUpdate:modelValue": t[7] || (t[7] = (C) => s.value = C),
|
|
1110
1110
|
multiple: "",
|
|
1111
1111
|
variant: "dark",
|
|
1112
1112
|
items: G.value,
|
|
1113
1113
|
"selected-prefix": r(a)("team.filter.selected_assigned_role_prefix"),
|
|
1114
1114
|
placeholder: r(a)("team.filter.assigned_role_placeholder")
|
|
1115
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (y(),
|
|
1115
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (y(), M("div", Rt, [i("div", $t, [d(ye, {
|
|
1116
1116
|
modelValue: le.value,
|
|
1117
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1117
|
+
"onUpdate:modelValue": t[0] || (t[0] = (C) => le.value = C),
|
|
1118
1118
|
multiple: "",
|
|
1119
1119
|
items: te.value,
|
|
1120
1120
|
variant: "dark",
|
|
@@ -1123,7 +1123,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1123
1123
|
class: "!w-auto"
|
|
1124
1124
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1125
1125
|
modelValue: Z.value,
|
|
1126
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
1126
|
+
"onUpdate:modelValue": t[1] || (t[1] = (C) => Z.value = C),
|
|
1127
1127
|
multiple: "",
|
|
1128
1128
|
variant: "dark",
|
|
1129
1129
|
items: T.value,
|
|
@@ -1131,24 +1131,24 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1131
1131
|
placeholder: r(a)("team.filter.permission_placeholder")
|
|
1132
1132
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), d(ye, {
|
|
1133
1133
|
modelValue: s.value,
|
|
1134
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
1134
|
+
"onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
|
|
1135
1135
|
multiple: "",
|
|
1136
1136
|
variant: "dark",
|
|
1137
1137
|
items: G.value,
|
|
1138
1138
|
"selected-prefix": r(a)("team.filter.selected_assigned_role_prefix"),
|
|
1139
1139
|
placeholder: r(a)("team.filter.assigned_role_placeholder")
|
|
1140
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d(
|
|
1141
|
-
modelValue:
|
|
1142
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
1140
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d(x, {
|
|
1141
|
+
modelValue: A.value,
|
|
1142
|
+
"onUpdate:modelValue": t[3] || (t[3] = (C) => A.value = C),
|
|
1143
1143
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1144
1144
|
autofocus: "",
|
|
1145
1145
|
placeholder: r(a)("team.search.placeholder")
|
|
1146
|
-
}, null, 8, ["modelValue", "placeholder"])])), (
|
|
1146
|
+
}, null, 8, ["modelValue", "placeholder"])])), (xe = r(f).currentBusiness.value) != null && xe._id ? (y(), z(ys, {
|
|
1147
1147
|
key: 2
|
|
1148
1148
|
}, {
|
|
1149
|
-
default: ue(() => [
|
|
1149
|
+
default: ue(() => [i("div", Nt, [h.value ? K("", !0) : (y(), z(_s, {
|
|
1150
1150
|
key: 0
|
|
1151
|
-
})), h.value ? (y(), z(
|
|
1151
|
+
})), h.value ? (y(), z(xs, {
|
|
1152
1152
|
key: 1,
|
|
1153
1153
|
"is-loading": p.value,
|
|
1154
1154
|
"is-empty": L.value === 0,
|
|
@@ -1166,26 +1166,26 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1166
1166
|
"hide-footer": L.value <= _e,
|
|
1167
1167
|
loading: p.value,
|
|
1168
1168
|
"pin-header-row": "",
|
|
1169
|
-
onRowClick: t[8] || (t[8] = (
|
|
1169
|
+
onRowClick: t[8] || (t[8] = (C) => B(r(ge).Update, C.original))
|
|
1170
1170
|
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
1171
1171
|
_: 1
|
|
1172
1172
|
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) : K("", !0)])]),
|
|
1173
1173
|
_: 1
|
|
1174
1174
|
})) : K("", !0)])]), d(Ce, {
|
|
1175
|
-
"model-value":
|
|
1175
|
+
"model-value": I.value,
|
|
1176
1176
|
"max-width": 960,
|
|
1177
1177
|
"close-button": !1,
|
|
1178
|
-
"onUpdate:modelValue":
|
|
1178
|
+
"onUpdate:modelValue": Ee,
|
|
1179
1179
|
"onOn:clickedAway": r(be)
|
|
1180
1180
|
}, {
|
|
1181
|
-
"side-sheet-header": ue(() => [
|
|
1181
|
+
"side-sheet-header": ue(() => [i("div", At, [i("p", Et, k(ke.value), 1), d(ne, {
|
|
1182
1182
|
name: "close",
|
|
1183
1183
|
size: "md",
|
|
1184
1184
|
class: "cursor-pointer",
|
|
1185
1185
|
onClick: r(be)
|
|
1186
1186
|
}, null, 8, ["onClick"])])]),
|
|
1187
|
-
"side-sheet-footer": ue(() => [
|
|
1188
|
-
label:
|
|
1187
|
+
"side-sheet-footer": ue(() => [i("div", Dt, [d(ie, {
|
|
1188
|
+
label: Ae.value,
|
|
1189
1189
|
size: "md",
|
|
1190
1190
|
variant: "primary",
|
|
1191
1191
|
"is-loading": H.value,
|
|
@@ -1198,7 +1198,7 @@ const sa = /* @__PURE__ */ Ie({
|
|
|
1198
1198
|
disabled: H.value,
|
|
1199
1199
|
onClick: de
|
|
1200
1200
|
}, null, 8, ["label", "disabled"])])]),
|
|
1201
|
-
default: ue(() => [
|
|
1201
|
+
default: ue(() => [I.value ? (y(), z(wt, {
|
|
1202
1202
|
key: 0,
|
|
1203
1203
|
ref_key: "memberForm",
|
|
1204
1204
|
ref: Y,
|