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