@feedmepos/mf-hrm-portal 2.0.12-dev → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuditLogList-Am6PW6qN.js → AuditLogList-Bd00VQx_.js} +4 -4
- package/dist/EmployeeList-CK7KmG5w.js +697 -0
- package/dist/{Main-BC_y5Gzg.js → Main-B_8kCVUX.js} +4 -4
- package/dist/{Main-BY_V1guq.js → Main-BlREdQ9j.js} +9 -9
- package/dist/{Main-Chau30wK.js → Main-DkBOgy7G.js} +5 -5
- package/dist/{PermissionSetList-CDUFrGRE.js → PermissionSetList-DfDMzjya.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CGIontQw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Akov0s-D.js} +683 -683
- package/dist/{RoleList-BVQ4zkA8.js → RoleList-BxXhMLc4.js} +7 -7
- package/dist/{TeamMemberList-D65MpqIr.js → TeamMemberList--YzyKgRn.js} +209 -208
- package/dist/{TimesheetList-Dc295zCI.js → TimesheetList-K8CKfOu5.js} +7 -7
- package/dist/{app-Iv5hLrRX.js → app-CDx8kP2V.js} +43 -43
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CJGjjQIJ.js → dayjs.min-SNComb-n.js} +1 -1
- package/dist/{employee-C2Qhr8xO.js → employee-CGtCzQdZ.js} +4 -4
- package/dist/{index-DzRWjF3a.js → index-Ctx7lXyr.js} +1 -1
- package/dist/{index-5ziPpN4I.js → index-qJ7dWPV1.js} +17 -17
- package/dist/{iteration-L8TLGaCI.js → iteration-Df2doI7u.js} +2 -2
- package/dist/{lodash-Bbes-RWy.js → lodash--VoFIg3j.js} +1 -1
- package/dist/src/composables/useDebounce.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{timesheet-Dbp6blBA.js → timesheet-C8L7eQVO.js} +3 -3
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-e7cSGuDZ.js → useAppStore-FR1TO4HT.js} +1 -1
- package/dist/useDebounce-B8ZPVS5C.js +15 -0
- package/dist/{useLoading-C8ko-jia.js → useLoading-CKrnW2DY.js} +1 -1
- package/dist/{useReportPermissions-B0EDgKey.js → useReportPermissions-BeiN0ZNJ.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-00LF0l6U.js +0 -696
- package/dist/useDebounce-BngBuKwH.js +0 -12
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as me, ref as b, resolveComponent as F, createBlock as k, openBlock as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as me, ref as b, resolveComponent as F, createBlock as k, openBlock as f, withCtx as T, createElementVNode as c, renderSlot as Pe, createCommentVNode as A, withModifiers as je, nextTick as Ee, createElementBlock as q, normalizeClass as Ae, createTextVNode as Te, toDisplayString as O, computed as I, Fragment as ye, renderList as ke, createVNode as p, unref as m, watch as he, isRef as es, createSlots as ss, onUnmounted as ts, withDirectives as as, vShow as ls } from "vue";
|
|
2
|
+
import { u as os } from "./useDebounce-B8ZPVS5C.js";
|
|
3
3
|
import { useI18n as ge, useCoreStore as _e, baseClientInstance as $e, RestaurantSelector as Ie } from "@feedmepos/mf-common";
|
|
4
|
-
import { useBreakpoints as qe, useSnackbar as Ke, useDialog as
|
|
4
|
+
import { useBreakpoints as qe, useSnackbar as Ke, useDialog as ns, components as Me } from "@feedmepos/ui-library";
|
|
5
5
|
import { _ as ze, S as Ce } from "./SelectFilter-DUj7GBtT.js";
|
|
6
|
-
import { p as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { u as
|
|
9
|
-
import { g as
|
|
10
|
-
import { u as We, c as
|
|
11
|
-
import "./index-
|
|
12
|
-
import { u as Xe } from "./useAppStore-
|
|
6
|
+
import { p as De, f as rs, k as is, _ as us } from "./app-CDx8kP2V.js";
|
|
7
|
+
import { _ as ms } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
8
|
+
import { u as cs } from "./useLoading-CKrnW2DY.js";
|
|
9
|
+
import { g as Ne, d as Ge } from "./iteration-Df2doI7u.js";
|
|
10
|
+
import { u as We, c as ds, d as Ve, m as fe, j as Je, p as Be, k as ps, l as Oe, n as vs, o as fs, s as bs, q as hs, v as ys, t as be } from "./index-qJ7dWPV1.js";
|
|
11
|
+
import "./index-Ctx7lXyr.js";
|
|
12
|
+
import { u as Xe } from "./useAppStore-FR1TO4HT.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { _ as
|
|
15
|
-
import { u as
|
|
16
|
-
const
|
|
14
|
+
import { _ as _s, a as gs } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Akov0s-D.js";
|
|
15
|
+
import { u as xs } from "./useSearch-B6WK1LBB.js";
|
|
16
|
+
const Fs = /* @__PURE__ */ me({
|
|
17
17
|
__name: "BottomSheetMenu",
|
|
18
18
|
setup(a) {
|
|
19
|
-
const
|
|
19
|
+
const h = b(!1);
|
|
20
20
|
async function o() {
|
|
21
|
-
await Ee(),
|
|
21
|
+
await Ee(), h.value = !h.value;
|
|
22
22
|
}
|
|
23
23
|
return (t, n) => {
|
|
24
24
|
const L = F("FmButton"), M = F("FmBottomSheet");
|
|
25
|
-
return
|
|
26
|
-
modelValue:
|
|
27
|
-
"onUpdate:modelValue": n[1] || (n[1] = (_) =>
|
|
25
|
+
return f(), k(M, {
|
|
26
|
+
modelValue: h.value,
|
|
27
|
+
"onUpdate:modelValue": n[1] || (n[1] = (_) => h.value = _),
|
|
28
28
|
"dismiss-away": "",
|
|
29
29
|
"no-header": "",
|
|
30
30
|
"z-index": 110
|
|
31
31
|
}, {
|
|
32
32
|
"bottom-sheet-button": T(() => [
|
|
33
|
-
t.$slots.button ? A("", !0) : (
|
|
33
|
+
t.$slots.button ? A("", !0) : (f(), k(L, {
|
|
34
34
|
key: 0,
|
|
35
35
|
icon: "more_vert",
|
|
36
36
|
variant: "tertiary",
|
|
@@ -40,7 +40,7 @@ const gs = /* @__PURE__ */ me({
|
|
|
40
40
|
]),
|
|
41
41
|
default: T(() => [
|
|
42
42
|
c("div", {
|
|
43
|
-
onClick: n[0] || (n[0] = (_) =>
|
|
43
|
+
onClick: n[0] || (n[0] = (_) => h.value = !1)
|
|
44
44
|
}, [
|
|
45
45
|
Pe(t.$slots, "default")
|
|
46
46
|
])
|
|
@@ -49,7 +49,7 @@ const gs = /* @__PURE__ */ me({
|
|
|
49
49
|
}, 8, ["modelValue"]);
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
}),
|
|
52
|
+
}), Ss = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Us = /* @__PURE__ */ me({
|
|
53
53
|
__name: "BottomSheetMenuItem",
|
|
54
54
|
props: {
|
|
55
55
|
label: {},
|
|
@@ -58,20 +58,20 @@ const gs = /* @__PURE__ */ me({
|
|
|
58
58
|
itemClass: {}
|
|
59
59
|
},
|
|
60
60
|
setup(a) {
|
|
61
|
-
const
|
|
61
|
+
const h = a;
|
|
62
62
|
return (o, t) => {
|
|
63
63
|
const n = F("FmIcon");
|
|
64
|
-
return
|
|
65
|
-
o.$slots.content ? A("", !0) : (
|
|
64
|
+
return f(), q("div", Ss, [
|
|
65
|
+
o.$slots.content ? A("", !0) : (f(), q("div", {
|
|
66
66
|
key: 0,
|
|
67
67
|
class: Ae(["flex items-center", {
|
|
68
|
-
"text-fm-color-typo-disabled":
|
|
69
|
-
"cursor-pointer": !
|
|
70
|
-
"cursor-not-allowed":
|
|
71
|
-
[
|
|
68
|
+
"text-fm-color-typo-disabled": h.disabled,
|
|
69
|
+
"cursor-pointer": !h.disabled,
|
|
70
|
+
"cursor-not-allowed": h.disabled,
|
|
71
|
+
[h.itemClass || ""]: h.itemClass && !h.disabled
|
|
72
72
|
}])
|
|
73
73
|
}, [
|
|
74
|
-
a.icon ? (
|
|
74
|
+
a.icon ? (f(), k(n, {
|
|
75
75
|
key: 0,
|
|
76
76
|
name: a.icon
|
|
77
77
|
}, null, 8, ["name"])) : A("", !0),
|
|
@@ -81,20 +81,20 @@ const gs = /* @__PURE__ */ me({
|
|
|
81
81
|
]);
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
84
|
+
}), Vs = /* @__PURE__ */ me({
|
|
85
85
|
__name: "ResponsiveContextMenu",
|
|
86
86
|
props: {
|
|
87
87
|
items: {}
|
|
88
88
|
},
|
|
89
89
|
setup(a) {
|
|
90
|
-
const
|
|
90
|
+
const h = qe(), o = I(() => h.breakpoints.value.xs);
|
|
91
91
|
return (t, n) => {
|
|
92
92
|
const L = F("FmButton"), M = F("FmMenuItem"), _ = F("FmMenu");
|
|
93
|
-
return o.value ? (
|
|
93
|
+
return o.value ? (f(), k(Fs, { key: 0 }, {
|
|
94
94
|
default: T(() => [
|
|
95
|
-
(
|
|
95
|
+
(f(!0), q(ye, null, ke(a.items, ({ icon: y, label: u, disabled: S, itemClass: w, onClick: U }) => (f(), k(Us, {
|
|
96
96
|
key: u,
|
|
97
|
-
icon:
|
|
97
|
+
icon: y,
|
|
98
98
|
label: u,
|
|
99
99
|
disabled: S,
|
|
100
100
|
itemClass: w,
|
|
@@ -104,7 +104,7 @@ const gs = /* @__PURE__ */ me({
|
|
|
104
104
|
}, null, 8, ["icon", "label", "disabled", "itemClass", "onClick"]))), 128))
|
|
105
105
|
]),
|
|
106
106
|
_: 1
|
|
107
|
-
})) : (
|
|
107
|
+
})) : (f(), k(_, {
|
|
108
108
|
key: 1,
|
|
109
109
|
"stop-click-propagation": "",
|
|
110
110
|
shift: !0
|
|
@@ -119,10 +119,10 @@ const gs = /* @__PURE__ */ me({
|
|
|
119
119
|
})
|
|
120
120
|
]),
|
|
121
121
|
default: T(() => [
|
|
122
|
-
(
|
|
123
|
-
key:
|
|
122
|
+
(f(!0), q(ye, null, ke(a.items, ({ label: y, disabled: u, itemClass: S, onClick: w }) => (f(), k(M, {
|
|
123
|
+
key: y,
|
|
124
124
|
disabled: u,
|
|
125
|
-
label:
|
|
125
|
+
label: y,
|
|
126
126
|
onClick: () => {
|
|
127
127
|
!u && (w == null || w());
|
|
128
128
|
}
|
|
@@ -130,7 +130,7 @@ const gs = /* @__PURE__ */ me({
|
|
|
130
130
|
label: T(() => [
|
|
131
131
|
c("span", {
|
|
132
132
|
class: Ae(u ? "text-fm-color-typo-disabled" : S)
|
|
133
|
-
}, O(
|
|
133
|
+
}, O(y), 3)
|
|
134
134
|
]),
|
|
135
135
|
_: 2
|
|
136
136
|
}, 1032, ["disabled", "label", "onClick"]))), 128))
|
|
@@ -141,34 +141,34 @@ const gs = /* @__PURE__ */ me({
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
var pe = /* @__PURE__ */ ((a) => (a.Update = "Update", a.Remove = "Remove", a))(pe || {});
|
|
144
|
-
const
|
|
144
|
+
const ws = { class: "w-full flex flex-col gap-16" }, Ps = { class: "flex items-center gap-16" }, ks = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, $s = { class: "fm-typo-en-body-lg-600 truncate" }, Is = { class: "w-full flex gap-16 items-center" }, Ms = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Cs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Ns = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Bs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Os = { class: "fm-typo-en-body-lg-600 truncate" }, Ls = /* @__PURE__ */ me({
|
|
145
145
|
__name: "MemberInfo",
|
|
146
146
|
props: {
|
|
147
147
|
data: {}
|
|
148
148
|
},
|
|
149
149
|
setup(a) {
|
|
150
|
-
const { t:
|
|
150
|
+
const { t: h } = ge();
|
|
151
151
|
return (o, t) => {
|
|
152
152
|
const n = F("FmAvatar");
|
|
153
|
-
return
|
|
154
|
-
c("div",
|
|
153
|
+
return f(), q("div", ws, [
|
|
154
|
+
c("div", Ps, [
|
|
155
155
|
p(n, {
|
|
156
156
|
size: "xl",
|
|
157
157
|
initials: a.data.name
|
|
158
158
|
}, null, 8, ["initials"]),
|
|
159
|
-
c("div",
|
|
160
|
-
c("p",
|
|
161
|
-
c("p",
|
|
159
|
+
c("div", ks, [
|
|
160
|
+
c("p", Rs, O(m(h)("team.memberForm.memberInfo.memberName")), 1),
|
|
161
|
+
c("p", $s, O(a.data.name || "--"), 1)
|
|
162
162
|
])
|
|
163
163
|
]),
|
|
164
|
-
c("div",
|
|
165
|
-
c("div",
|
|
166
|
-
c("p",
|
|
167
|
-
c("p",
|
|
164
|
+
c("div", Is, [
|
|
165
|
+
c("div", Ms, [
|
|
166
|
+
c("p", Cs, O(m(h)("team.memberForm.memberInfo.mobileNumber")), 1),
|
|
167
|
+
c("p", Ds, O(a.data.phoneNumber || "--"), 1)
|
|
168
168
|
]),
|
|
169
|
-
c("div",
|
|
170
|
-
c("p",
|
|
171
|
-
c("p",
|
|
169
|
+
c("div", Ns, [
|
|
170
|
+
c("p", Bs, O(m(h)("team.memberForm.memberInfo.emailAddress")), 1),
|
|
171
|
+
c("p", Os, O(a.data.email || "--"), 1)
|
|
172
172
|
])
|
|
173
173
|
])
|
|
174
174
|
]);
|
|
@@ -177,35 +177,35 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
177
177
|
}), Le = {
|
|
178
178
|
async readPermissionUserByPhoneNo(a) {
|
|
179
179
|
var o;
|
|
180
|
-
const { currentBusiness:
|
|
181
|
-
return
|
|
182
|
-
await $e("/").get(`/user/b/${(o =
|
|
180
|
+
const { currentBusiness: h } = _e();
|
|
181
|
+
return Ne(
|
|
182
|
+
await $e("/").get(`/user/b/${(o = h.value) == null ? void 0 : o._id}/phone/${a}`)
|
|
183
183
|
);
|
|
184
184
|
},
|
|
185
185
|
async readPermissionUserByEmail(a) {
|
|
186
186
|
var o;
|
|
187
|
-
const { currentBusiness:
|
|
188
|
-
return
|
|
189
|
-
await $e("/").get(`/user/b/${(o =
|
|
187
|
+
const { currentBusiness: h } = _e();
|
|
188
|
+
return Ne(
|
|
189
|
+
await $e("/").get(`/user/b/${(o = h.value) == null ? void 0 : o._id}/email/${a}`)
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
192
|
+
}, js = { class: "flex flex-col gap-24 w-full" }, Es = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "flex flex-col gap-8"
|
|
195
|
-
},
|
|
195
|
+
}, As = { class: "user-info-icon user-info-icon--lg" }, Ts = { class: "flex-1 overflow-hidden" }, qs = { class: "profile-displayName" }, Ks = { class: "profile-email" }, zs = { class: "profile-phone" }, Gs = { key: 2 }, Ws = /* @__PURE__ */ me({
|
|
196
196
|
__name: "PortalUserSearcher",
|
|
197
197
|
emits: ["invite"],
|
|
198
|
-
setup(a, { emit:
|
|
199
|
-
const o =
|
|
198
|
+
setup(a, { emit: h }) {
|
|
199
|
+
const o = h, { t } = ge(), n = Ke(), L = _e(), M = b("phone"), _ = b(""), y = b(""), u = b();
|
|
200
200
|
async function S() {
|
|
201
|
-
if (!_.value && !
|
|
201
|
+
if (!_.value && !y.value) {
|
|
202
202
|
n.open({
|
|
203
203
|
type: "error",
|
|
204
204
|
title: t("team.memberForm.searchUser.emptyError")
|
|
205
205
|
});
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
|
-
const g = M.value === "phone" ? await Le.readPermissionUserByPhoneNo(_.value.replace(/ /g, "")) : await Le.readPermissionUserByEmail(
|
|
208
|
+
const g = M.value === "phone" ? await Le.readPermissionUserByPhoneNo(_.value.replace(/ /g, "")) : await Le.readPermissionUserByEmail(y.value);
|
|
209
209
|
g || n.open({
|
|
210
210
|
type: "error",
|
|
211
211
|
title: t("team.memberForm.searchUser.userNotFound")
|
|
@@ -227,8 +227,8 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
227
227
|
return (g, P) => {
|
|
228
228
|
var R, K, C;
|
|
229
229
|
const Q = F("FmRadio"), se = F("FmPhoneNumber"), le = F("FmTextField"), l = F("FmRadioGroup"), i = F("FmButton");
|
|
230
|
-
return
|
|
231
|
-
U.value ? A("", !0) : (
|
|
230
|
+
return f(), q("div", js, [
|
|
231
|
+
U.value ? A("", !0) : (f(), q("div", Es, [
|
|
232
232
|
p(l, {
|
|
233
233
|
modelValue: M.value,
|
|
234
234
|
"onUpdate:modelValue": P[2] || (P[2] = (V) => M.value = V)
|
|
@@ -238,7 +238,7 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
238
238
|
value: "phone",
|
|
239
239
|
label: m(t)("team.memberForm.searchUser.phoneNumber")
|
|
240
240
|
}, null, 8, ["label"]),
|
|
241
|
-
M.value === "phone" ? (
|
|
241
|
+
M.value === "phone" ? (f(), k(se, {
|
|
242
242
|
key: 0,
|
|
243
243
|
modelValue: _.value,
|
|
244
244
|
"onUpdate:modelValue": P[0] || (P[0] = (V) => _.value = V),
|
|
@@ -249,10 +249,10 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
249
249
|
value: "email",
|
|
250
250
|
label: m(t)("team.memberForm.searchUser.email")
|
|
251
251
|
}, null, 8, ["label"]),
|
|
252
|
-
M.value === "email" ? (
|
|
252
|
+
M.value === "email" ? (f(), k(le, {
|
|
253
253
|
key: 1,
|
|
254
|
-
modelValue:
|
|
255
|
-
"onUpdate:modelValue": P[1] || (P[1] = (V) =>
|
|
254
|
+
modelValue: y.value,
|
|
255
|
+
"onUpdate:modelValue": P[1] || (P[1] = (V) => y.value = V),
|
|
256
256
|
placeholder: m(t)("team.memberForm.searchUser.emailPlaceholder"),
|
|
257
257
|
class: "ml-8"
|
|
258
258
|
}, null, 8, ["modelValue", "placeholder"])) : A("", !0)
|
|
@@ -265,19 +265,19 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
265
265
|
onClick: S
|
|
266
266
|
}, null, 8, ["label"])
|
|
267
267
|
])),
|
|
268
|
-
u.value ? (
|
|
268
|
+
u.value ? (f(), q("div", {
|
|
269
269
|
key: 1,
|
|
270
270
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
271
271
|
onClick: P[3] || (P[3] = (V) => j(u.value))
|
|
272
272
|
}, [
|
|
273
|
-
c("div",
|
|
274
|
-
c("div",
|
|
275
|
-
c("p",
|
|
276
|
-
c("p",
|
|
277
|
-
c("p",
|
|
273
|
+
c("div", As, O(w.value), 1),
|
|
274
|
+
c("div", Ts, [
|
|
275
|
+
c("p", qs, O((R = u.value) == null ? void 0 : R.displayName), 1),
|
|
276
|
+
c("p", Ks, O((K = u.value) == null ? void 0 : K.email), 1),
|
|
277
|
+
c("p", zs, O((C = u.value) == null ? void 0 : C.phoneNumber), 1)
|
|
278
278
|
])
|
|
279
279
|
])) : A("", !0),
|
|
280
|
-
U.value ? (
|
|
280
|
+
U.value ? (f(), q("div", Gs, [
|
|
281
281
|
p(i, {
|
|
282
282
|
label: m(t)("team.memberForm.searchUser.changeUser"),
|
|
283
283
|
variant: "secondary",
|
|
@@ -287,7 +287,7 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
287
287
|
]);
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
}),
|
|
290
|
+
}), Js = /* @__PURE__ */ ze(Ws, [["__scopeId", "data-v-c2c7ed35"]]), Xs = { class: "flex flex-col gap-40" }, Zs = { class: "flex items-center" }, Qs = { class: "flex-1 flex flex-col" }, Ys = { class: "fm-typo-en-title-sm-600" }, Hs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, et = { class: "flex flex-row gap-16" }, st = { class: "flex flex-col gap-8" }, tt = { class: "fm-typo-en-body-lg-400" }, at = { class: "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" }, we = 4, lt = /* @__PURE__ */ me({
|
|
291
291
|
__name: "TeamMemberMasterUser",
|
|
292
292
|
props: {
|
|
293
293
|
modelValue: {
|
|
@@ -312,8 +312,8 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
314
|
emits: ["update:model-value"],
|
|
315
|
-
setup(a, { emit:
|
|
316
|
-
const o = a, t =
|
|
315
|
+
setup(a, { emit: h }) {
|
|
316
|
+
const o = a, t = h, { t: n } = ge(), { searchKey: L, filter: M } = xs(""), _ = b(!0), y = b([]), u = I(() => {
|
|
317
317
|
const l = {};
|
|
318
318
|
return o.roles.forEach((i) => {
|
|
319
319
|
l[i.value] = i.label;
|
|
@@ -377,15 +377,15 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
377
377
|
]);
|
|
378
378
|
}
|
|
379
379
|
function se() {
|
|
380
|
-
_.value && (_.value = !1,
|
|
380
|
+
_.value && (_.value = !1, y.value = [], g("passcode", ""));
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
he(
|
|
383
383
|
() => {
|
|
384
384
|
var l;
|
|
385
385
|
return (l = o.modelValue) == null ? void 0 : l.passcode;
|
|
386
386
|
},
|
|
387
387
|
(l) => {
|
|
388
|
-
l && l.length === we ? (
|
|
388
|
+
l && l.length === we ? (y.value = l.split(""), _.value = !0) : (y.value = [], _.value = !1);
|
|
389
389
|
},
|
|
390
390
|
{ immediate: !0 }
|
|
391
391
|
);
|
|
@@ -399,11 +399,11 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
399
399
|
});
|
|
400
400
|
return (l, i) => {
|
|
401
401
|
const R = F("FmSwitch"), K = F("FmTextField"), C = F("FmPinField"), V = F("FmFormGroup"), W = F("FmSearch"), J = F("FmSelect");
|
|
402
|
-
return
|
|
403
|
-
c("div",
|
|
404
|
-
c("div",
|
|
405
|
-
c("div",
|
|
406
|
-
c("div",
|
|
402
|
+
return f(), q("div", Xs, [
|
|
403
|
+
c("div", Zs, [
|
|
404
|
+
c("div", Qs, [
|
|
405
|
+
c("div", Ys, O(m(n)("team.memberForm.masterUser.title")), 1),
|
|
406
|
+
c("div", Hs, O(m(n)("team.memberForm.masterUser.sublabel")), 1)
|
|
407
407
|
]),
|
|
408
408
|
c("div", null, [
|
|
409
409
|
p(R, {
|
|
@@ -413,8 +413,8 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
413
413
|
}, null, 8, ["model-value"])
|
|
414
414
|
])
|
|
415
415
|
]),
|
|
416
|
-
a.modelValue ? (
|
|
417
|
-
c("div",
|
|
416
|
+
a.modelValue ? (f(), q(ye, { key: 0 }, [
|
|
417
|
+
c("div", et, [
|
|
418
418
|
p(K, {
|
|
419
419
|
"model-value": a.modelValue.code,
|
|
420
420
|
label: m(n)("team.memberForm.masterUser.code"),
|
|
@@ -428,20 +428,20 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
428
428
|
"onUpdate:modelValue": i[1] || (i[1] = (d) => g("name", d))
|
|
429
429
|
}, null, 8, ["model-value", "label", "rules"])
|
|
430
430
|
]),
|
|
431
|
-
c("div",
|
|
432
|
-
c("div",
|
|
431
|
+
c("div", st, [
|
|
432
|
+
c("div", tt, O(m(n)("team.memberForm.masterUser.passcode")), 1),
|
|
433
433
|
p(V, {
|
|
434
|
-
modelValue:
|
|
435
|
-
"onUpdate:modelValue": i[4] || (i[4] = (d) =>
|
|
434
|
+
modelValue: y.value,
|
|
435
|
+
"onUpdate:modelValue": i[4] || (i[4] = (d) => y.value = d),
|
|
436
436
|
rules: [
|
|
437
437
|
(d) => (d == null ? void 0 : d.filter((X) => !!X).length) !== we ? m(n)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
438
438
|
]
|
|
439
439
|
}, {
|
|
440
440
|
default: T(() => [
|
|
441
|
-
(
|
|
441
|
+
(f(), k(C, {
|
|
442
442
|
key: `pin-field-${_.value}`,
|
|
443
|
-
modelValue:
|
|
444
|
-
"onUpdate:modelValue": i[2] || (i[2] = (d) =>
|
|
443
|
+
modelValue: y.value,
|
|
444
|
+
"onUpdate:modelValue": i[2] || (i[2] = (d) => y.value = d),
|
|
445
445
|
length: we,
|
|
446
446
|
masked: _.value,
|
|
447
447
|
onComplete: i[3] || (i[3] = (d) => g("passcode", d)),
|
|
@@ -459,20 +459,20 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
459
459
|
]
|
|
460
460
|
}, {
|
|
461
461
|
default: T(() => [
|
|
462
|
-
c("div",
|
|
462
|
+
c("div", at, [
|
|
463
463
|
p(W, {
|
|
464
464
|
modelValue: m(L),
|
|
465
|
-
"onUpdate:modelValue": i[5] || (i[5] = (d) =>
|
|
465
|
+
"onUpdate:modelValue": i[5] || (i[5] = (d) => es(L) ? L.value = d : null),
|
|
466
466
|
placeholder: m(n)("team.memberForm.posRole.placeholder"),
|
|
467
467
|
class: "mb-16"
|
|
468
468
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
469
|
-
p(
|
|
469
|
+
p(_s, {
|
|
470
470
|
"model-value": a.modelValue.roles.map((d) => d.restaurantId),
|
|
471
471
|
options: w.value,
|
|
472
472
|
min: 1,
|
|
473
473
|
title: m(n)("team.memberForm.masterUser.role"),
|
|
474
474
|
"onUpdate:modelValue": P
|
|
475
|
-
},
|
|
475
|
+
}, ss({ _: 2 }, [
|
|
476
476
|
ke(w.value, (d) => ({
|
|
477
477
|
name: d.slot,
|
|
478
478
|
fn: T(() => {
|
|
@@ -480,9 +480,9 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
480
480
|
return [
|
|
481
481
|
c("div", null, [
|
|
482
482
|
p(J, {
|
|
483
|
-
"model-value": ((X = a.modelValue.roles.find((
|
|
483
|
+
"model-value": ((X = a.modelValue.roles.find((D) => D.restaurantId === d.value)) == null ? void 0 : X.roleId) || U.value,
|
|
484
484
|
items: d.roleOptions,
|
|
485
|
-
"onUpdate:modelValue": (
|
|
485
|
+
"onUpdate:modelValue": (D) => Q(d.value, D)
|
|
486
486
|
}, null, 8, ["model-value", "items", "onUpdate:modelValue"])
|
|
487
487
|
])
|
|
488
488
|
];
|
|
@@ -497,10 +497,10 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
497
497
|
]);
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
}),
|
|
500
|
+
}), ot = { class: "flex flex-col gap-32" }, nt = { class: "flex w-full" }, rt = {
|
|
501
501
|
key: 2,
|
|
502
502
|
class: "flex items-center justify-center py-24"
|
|
503
|
-
},
|
|
503
|
+
}, it = /* @__PURE__ */ me({
|
|
504
504
|
__name: "AddMemberForm",
|
|
505
505
|
props: {
|
|
506
506
|
initialValue: {
|
|
@@ -515,40 +515,40 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
515
515
|
default: !1
|
|
516
516
|
}
|
|
517
517
|
},
|
|
518
|
-
setup(a, { expose:
|
|
518
|
+
setup(a, { expose: h }) {
|
|
519
519
|
var xe, Fe, oe;
|
|
520
520
|
const o = a, { t } = ge(), n = b(), L = We(), M = I(
|
|
521
521
|
() => L.permissionSets.value.map((r) => ({
|
|
522
522
|
label: r.name,
|
|
523
523
|
value: r.id
|
|
524
524
|
}))
|
|
525
|
-
), _ = b(((xe = o.initialValue) == null ? void 0 : xe.permissionSetIds) || []),
|
|
526
|
-
() =>
|
|
525
|
+
), _ = b(((xe = o.initialValue) == null ? void 0 : xe.permissionSetIds) || []), y = I(
|
|
526
|
+
() => ds(_.value, L.permissionSets.value)
|
|
527
527
|
), u = b((Fe = o.initialValue) == null ? void 0 : Fe.posUser), S = b(!1), w = b(!1), U = b(
|
|
528
528
|
Ve(
|
|
529
|
-
|
|
529
|
+
fe(y.value),
|
|
530
530
|
((oe = o.initialValue) == null ? void 0 : oe.permissions) || []
|
|
531
531
|
)
|
|
532
532
|
), { customReportPermissions: j, isLoaded: E } = Je(), g = new Set(
|
|
533
|
-
Be.filter((r) => r.subject.startsWith(
|
|
533
|
+
Be.filter((r) => r.subject.startsWith(ps)).map((r) => r.subject)
|
|
534
534
|
), P = I(() => {
|
|
535
535
|
const r = new Set(g);
|
|
536
|
-
for (const
|
|
536
|
+
for (const v of j.value) r.add(v.subject);
|
|
537
537
|
return r;
|
|
538
538
|
}), Q = I(() => {
|
|
539
539
|
const r = /* @__PURE__ */ new Set();
|
|
540
|
-
for (const
|
|
541
|
-
|
|
542
|
-
for (const
|
|
543
|
-
|
|
540
|
+
for (const v of Be)
|
|
541
|
+
v.category === De.reports && r.add(v.subject);
|
|
542
|
+
for (const v of j.value)
|
|
543
|
+
v.category === De.reports && r.add(v.subject);
|
|
544
544
|
return r;
|
|
545
545
|
}), { restaurants: se } = _e(), le = Xe().roles, l = I(() => Oe(U.value)), i = I(() => {
|
|
546
546
|
const r = l.value;
|
|
547
547
|
return le.value.map(
|
|
548
|
-
(
|
|
549
|
-
label:
|
|
550
|
-
value:
|
|
551
|
-
disabled: !!r && !r.includes(
|
|
548
|
+
(v) => ({
|
|
549
|
+
label: v.name,
|
|
550
|
+
value: v._id,
|
|
551
|
+
disabled: !!r && !r.includes(v._id)
|
|
552
552
|
})
|
|
553
553
|
);
|
|
554
554
|
});
|
|
@@ -557,27 +557,27 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
557
557
|
}
|
|
558
558
|
function K(r) {
|
|
559
559
|
w.value = !0;
|
|
560
|
-
const
|
|
561
|
-
|
|
560
|
+
const v = d(u.value, r);
|
|
561
|
+
v !== u.value && (S.value = !0), u.value = v;
|
|
562
562
|
}
|
|
563
563
|
function C() {
|
|
564
|
-
const r =
|
|
565
|
-
return
|
|
564
|
+
const r = fe(y.value), v = E.value ? P.value : g, Y = vs(U.value, v), Z = fs(Y, Q.value), H = bs(Z);
|
|
565
|
+
return hs(r, H);
|
|
566
566
|
}
|
|
567
567
|
function V() {
|
|
568
|
-
var Y, Z, H,
|
|
569
|
-
const r = C(),
|
|
568
|
+
var Y, Z, H, N, z, ne, re, ce, ae, G;
|
|
569
|
+
const r = C(), v = U.value.filter((te) => !te.inverted);
|
|
570
570
|
return {
|
|
571
571
|
email: ((Y = n.value) == null ? void 0 : Y.email) ?? void 0,
|
|
572
572
|
phoneNumber: ((Z = n.value) == null ? void 0 : Z.phoneNumber) ?? void 0,
|
|
573
573
|
customPermissions: r,
|
|
574
574
|
// Deprecated: keep for backward compatibility, will be removed in the future
|
|
575
|
-
permissions:
|
|
575
|
+
permissions: v.map((te) => ({
|
|
576
576
|
...te,
|
|
577
|
-
subject:
|
|
577
|
+
subject: rs(te.subject)
|
|
578
578
|
})),
|
|
579
579
|
permissionSetIds: _.value,
|
|
580
|
-
name: ((H = n.value) == null ? void 0 : H.displayName) || ((
|
|
580
|
+
name: ((H = n.value) == null ? void 0 : H.displayName) || ((N = o.initialValue) == null ? void 0 : N.name) || "",
|
|
581
581
|
posUser: !o.initialValue || S.value ? u.value != null ? {
|
|
582
582
|
...u.value,
|
|
583
583
|
name: u.value.name || ((ne = (z = o.initialValue) == null ? void 0 : z.posUser) == null ? void 0 : ne.name) || ((re = o.initialValue) == null ? void 0 : re.name) || ((ce = n.value) == null ? void 0 : ce.displayName) || "",
|
|
@@ -589,11 +589,11 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
589
589
|
};
|
|
590
590
|
}
|
|
591
591
|
const W = b();
|
|
592
|
-
|
|
592
|
+
he(
|
|
593
593
|
() => o.initialValue,
|
|
594
594
|
(r) => {
|
|
595
595
|
if (!r) {
|
|
596
|
-
_.value = [], u.value = void 0, S.value = !1, w.value = !1, U.value = Ve(
|
|
596
|
+
_.value = [], u.value = void 0, S.value = !1, w.value = !1, U.value = Ve(fe([]), []);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
599
|
if (w.value) {
|
|
@@ -601,60 +601,60 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
603
|
_.value = r.permissionSetIds || [], (!S.value || r.posUser !== void 0) && (u.value = r.posUser), U.value = Ve(
|
|
604
|
-
|
|
604
|
+
fe(y.value),
|
|
605
605
|
r.permissions || []
|
|
606
606
|
), S.value = !1;
|
|
607
607
|
},
|
|
608
608
|
{ immediate: !0 }
|
|
609
609
|
);
|
|
610
610
|
function J() {
|
|
611
|
-
U.value =
|
|
611
|
+
U.value = fe(y.value), w.value = !0;
|
|
612
612
|
const r = d(u.value, U.value);
|
|
613
613
|
r !== u.value && (S.value = !0), u.value = r;
|
|
614
614
|
}
|
|
615
|
-
function d(r,
|
|
615
|
+
function d(r, v) {
|
|
616
616
|
if (!r) return r;
|
|
617
|
-
const Y = Oe(
|
|
617
|
+
const Y = Oe(v);
|
|
618
618
|
if (!Y) return r;
|
|
619
619
|
const Z = Ge(r);
|
|
620
|
-
return Z.roles = Z.roles.reduce((H,
|
|
620
|
+
return Z.roles = Z.roles.reduce((H, N) => (Y.includes(N.roleId) && H.push(N), H), []), Z;
|
|
621
621
|
}
|
|
622
622
|
async function X() {
|
|
623
623
|
await Ee(), W.value && W.value.$el.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
624
624
|
}
|
|
625
|
-
const
|
|
625
|
+
const D = b();
|
|
626
626
|
async function Se() {
|
|
627
|
-
return (await
|
|
627
|
+
return (await D.value.validateInputsWithoutSubmit()).length ? null : V();
|
|
628
628
|
}
|
|
629
|
-
return
|
|
629
|
+
return h({
|
|
630
630
|
readFormData: V,
|
|
631
631
|
validate: Se
|
|
632
|
-
}), (r,
|
|
632
|
+
}), (r, v) => {
|
|
633
633
|
const Y = F("FmSelect"), Z = F("FmCircularProgress"), H = F("FmForm");
|
|
634
|
-
return
|
|
634
|
+
return f(), k(H, {
|
|
635
635
|
ref_key: "formRef",
|
|
636
|
-
ref:
|
|
636
|
+
ref: D,
|
|
637
637
|
class: "mx-4"
|
|
638
638
|
}, {
|
|
639
639
|
default: T(() => {
|
|
640
|
-
var
|
|
640
|
+
var N, z, ne, re, ce, ae;
|
|
641
641
|
return [
|
|
642
|
-
c("div",
|
|
643
|
-
c("div",
|
|
644
|
-
a.initialValue ? (
|
|
642
|
+
c("div", ot, [
|
|
643
|
+
c("div", nt, [
|
|
644
|
+
a.initialValue ? (f(), k(Ls, {
|
|
645
645
|
key: 1,
|
|
646
646
|
data: a.initialValue
|
|
647
|
-
}, null, 8, ["data"])) : (
|
|
647
|
+
}, null, 8, ["data"])) : (f(), k(Js, {
|
|
648
648
|
key: 0,
|
|
649
|
-
onInvite:
|
|
649
|
+
onInvite: v[0] || (v[0] = (G) => R(G))
|
|
650
650
|
}))
|
|
651
651
|
]),
|
|
652
|
-
n.value || a.initialValue ? (
|
|
653
|
-
(
|
|
652
|
+
n.value || a.initialValue ? (f(), q(ye, { key: 0 }, [
|
|
653
|
+
(N = a.initialValue) != null && N.isOwner ? A("", !0) : (f(), k(Y, {
|
|
654
654
|
key: 0,
|
|
655
655
|
modelValue: _.value,
|
|
656
656
|
"onUpdate:modelValue": [
|
|
657
|
-
|
|
657
|
+
v[1] || (v[1] = (G) => _.value = G),
|
|
658
658
|
J
|
|
659
659
|
],
|
|
660
660
|
multiselect: "",
|
|
@@ -664,16 +664,16 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
664
664
|
label: m(t)("team.memberForm.permissionSet.title"),
|
|
665
665
|
placeholder: m(t)("team.memberForm.permissionSet.selectPlaceholder")
|
|
666
666
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])),
|
|
667
|
-
(z = a.initialValue) != null && z.isOwner ? A("", !0) : (
|
|
667
|
+
(z = a.initialValue) != null && z.isOwner ? A("", !0) : (f(), k(gs, {
|
|
668
668
|
key: 1,
|
|
669
669
|
modelValue: U.value,
|
|
670
|
-
"onUpdate:modelValue":
|
|
671
|
-
"inherit-permissions":
|
|
670
|
+
"onUpdate:modelValue": v[2] || (v[2] = (G) => U.value = G),
|
|
671
|
+
"inherit-permissions": y.value,
|
|
672
672
|
onPermissionChanged: K
|
|
673
673
|
}, null, 8, ["modelValue", "inherit-permissions"])),
|
|
674
|
-
a.isLoadingMasterUser ? (
|
|
674
|
+
a.isLoadingMasterUser ? (f(), q("div", rt, [
|
|
675
675
|
p(Z)
|
|
676
|
-
])) : (
|
|
676
|
+
])) : (f(), k(lt, {
|
|
677
677
|
key: 3,
|
|
678
678
|
ref_key: "masterUserContentRef",
|
|
679
679
|
ref: W,
|
|
@@ -682,7 +682,7 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
682
682
|
"fallback-passcode": (ae = (ce = a.initialValue) == null ? void 0 : ce.posUser) == null ? void 0 : ae.passcode,
|
|
683
683
|
roles: i.value,
|
|
684
684
|
restaurants: m(se),
|
|
685
|
-
"onUpdate:modelValue":
|
|
685
|
+
"onUpdate:modelValue": v[3] || (v[3] = (G) => {
|
|
686
686
|
u.value = G, S.value = !0, w.value = !0, X();
|
|
687
687
|
})
|
|
688
688
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
|
|
@@ -694,36 +694,36 @@ const Us = { class: "w-full flex flex-col gap-16" }, Vs = { class: "flex items-c
|
|
|
694
694
|
}, 512);
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
}),
|
|
697
|
+
}), ut = {
|
|
698
698
|
class: "space-y-24"
|
|
699
|
-
}, it = {
|
|
700
|
-
class: "space-y-8"
|
|
701
|
-
}, ut = {
|
|
702
|
-
class: "xs:hidden flex w-full items-start justify-between px-16"
|
|
703
699
|
}, mt = {
|
|
704
|
-
class: "
|
|
700
|
+
class: "space-y-8"
|
|
705
701
|
}, ct = {
|
|
706
|
-
class: "
|
|
702
|
+
class: "xs:hidden flex w-full items-start justify-between px-16"
|
|
707
703
|
}, dt = {
|
|
708
704
|
class: "flex items-start gap-8"
|
|
709
705
|
}, pt = {
|
|
710
|
-
class: "
|
|
706
|
+
class: "space-y-4 sm:hidden md:hidden lg:hidden px-16"
|
|
707
|
+
}, vt = {
|
|
708
|
+
class: "flex items-start gap-8"
|
|
711
709
|
}, ft = {
|
|
710
|
+
class: "flex h-full flex-col"
|
|
711
|
+
}, bt = {
|
|
712
712
|
class: "flex items-center justify-start gap-8"
|
|
713
713
|
}, de = 100;
|
|
714
714
|
var ee = /* @__PURE__ */ function(a) {
|
|
715
715
|
return a[a.ADD = 0] = "ADD", a[a.UPDATE = 1] = "UPDATE", a[a.CLOSED = 2] = "CLOSED", a;
|
|
716
716
|
}(ee || {});
|
|
717
|
-
const
|
|
717
|
+
const ht = /* @__PURE__ */ me({
|
|
718
718
|
__name: "TeamMemberList",
|
|
719
719
|
setup(a, {
|
|
720
|
-
expose:
|
|
720
|
+
expose: h
|
|
721
721
|
}) {
|
|
722
722
|
const {
|
|
723
723
|
fetchCustomReportPermissions: o
|
|
724
724
|
} = Je(), {
|
|
725
725
|
t
|
|
726
|
-
} = ge(), n = _e(), L = Xe(), M = Ke(), _ =
|
|
726
|
+
} = ge(), n = _e(), L = Xe(), M = Ke(), _ = cs(M), y = We(), u = ys(), S = b(!0), w = b(n.restaurants.value.length === 0), U = b([]), j = b(0), E = b(1), g = b(""), P = b(""), Q = he(n.restaurants, (e) => {
|
|
727
727
|
e.length > 0 && (w.value = !1, Q());
|
|
728
728
|
}), se = ({
|
|
729
729
|
member: e,
|
|
@@ -737,7 +737,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
737
737
|
onClick: () => W(pe.Remove, e),
|
|
738
738
|
itemClass: "text-fm-color-typo-error"
|
|
739
739
|
}, ie = e.doc.isOwner ? [x] : [x, B];
|
|
740
|
-
return p(
|
|
740
|
+
return p(Vs, {
|
|
741
741
|
class: s,
|
|
742
742
|
items: ie
|
|
743
743
|
}, null);
|
|
@@ -768,7 +768,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
768
768
|
enableSorting: !1,
|
|
769
769
|
cell(e) {
|
|
770
770
|
const s = e.row.original, x = u.getPermissionAssignmentByUserId(s.id), B = (x == null ? void 0 : x.permissionSetIds) || s.doc.permissionSetIds || [];
|
|
771
|
-
return
|
|
771
|
+
return y.permissionSets.value.filter((ue) => B.includes(ue.id)).map((ue) => ue.name).join(", ");
|
|
772
772
|
}
|
|
773
773
|
}, {
|
|
774
774
|
accessorKey: "permission",
|
|
@@ -816,7 +816,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
816
816
|
})]), e.permissionLabels.length > 0 && s]);
|
|
817
817
|
}
|
|
818
818
|
function R(e) {
|
|
819
|
-
var ie, ue,
|
|
819
|
+
var ie, ue, ve, $;
|
|
820
820
|
const s = u.getPermissionAssignmentByUserId(e.id), x = (s == null ? void 0 : s.customPermissions) || e.permissions || [], B = (s == null ? void 0 : s.permissionSetIds) || [];
|
|
821
821
|
return {
|
|
822
822
|
id: e.id,
|
|
@@ -829,7 +829,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
829
829
|
posUser: e.doc.posUser ? {
|
|
830
830
|
code: ((ie = e.doc.posUser) == null ? void 0 : ie.code) ?? "",
|
|
831
831
|
name: ((ue = e.doc.posUser) == null ? void 0 : ue.name) ?? e.name,
|
|
832
|
-
passcode: ((
|
|
832
|
+
passcode: ((ve = e.doc.posUser) == null ? void 0 : ve.passcode) ?? "",
|
|
833
833
|
roles: (($ = e.doc.posUser) == null ? void 0 : $.roles) ?? []
|
|
834
834
|
} : void 0
|
|
835
835
|
};
|
|
@@ -852,7 +852,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
852
852
|
const W = async (e, s) => {
|
|
853
853
|
if (e == pe.Update) {
|
|
854
854
|
const x = ++V;
|
|
855
|
-
oe.value = K(s),
|
|
855
|
+
oe.value = K(s), D.value = ee.UPDATE, C.value = s.doc.hasPosUser === !0;
|
|
856
856
|
try {
|
|
857
857
|
const B = await be.readTeamMember(s.id);
|
|
858
858
|
if (x !== V) return;
|
|
@@ -862,18 +862,18 @@ const vt = /* @__PURE__ */ me({
|
|
|
862
862
|
M.open({
|
|
863
863
|
message: t("common.error"),
|
|
864
864
|
type: "error"
|
|
865
|
-
}),
|
|
865
|
+
}), v();
|
|
866
866
|
} finally {
|
|
867
867
|
x === V && (C.value = !1);
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
870
|
e == pe.Remove && Z(s);
|
|
871
|
-
}, J =
|
|
871
|
+
}, J = ns(), d = b(!1), X = b(!1), D = b(ee.CLOSED), Se = I(() => D.value !== ee.CLOSED), xe = I(() => D.value === ee.ADD ? t("common.add") : t("common.update")), Fe = I(() => D.value === ee.ADD ? t("team.actions.addMember") : t("team.actions.updateMember")), oe = b();
|
|
872
872
|
function r(e) {
|
|
873
|
-
e || (V++, C.value = !1,
|
|
873
|
+
e || (V++, C.value = !1, D.value = ee.CLOSED);
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
V++, C.value = !1,
|
|
875
|
+
function v() {
|
|
876
|
+
V++, C.value = !1, D.value = ee.CLOSED;
|
|
877
877
|
}
|
|
878
878
|
const {
|
|
879
879
|
breakpoints: Y
|
|
@@ -906,16 +906,16 @@ const vt = /* @__PURE__ */ me({
|
|
|
906
906
|
}), J.close());
|
|
907
907
|
});
|
|
908
908
|
}, H = () => {
|
|
909
|
-
oe.value = null,
|
|
910
|
-
},
|
|
909
|
+
oe.value = null, D.value = ee.ADD;
|
|
910
|
+
}, N = b(), z = b(), ne = I(() => {
|
|
911
911
|
var e;
|
|
912
912
|
return JSON.stringify({
|
|
913
913
|
businessId: ((e = n.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
914
914
|
search: P.value.trim(),
|
|
915
|
-
restaurantIds: [...
|
|
915
|
+
restaurantIds: [...N.value ?? []].sort(),
|
|
916
916
|
permissionSubjects: [...z.value ?? []].sort()
|
|
917
917
|
});
|
|
918
|
-
}), re = I(() => Object.values(
|
|
918
|
+
}), re = I(() => Object.values(is).map((e) => ({
|
|
919
919
|
label: e.label,
|
|
920
920
|
value: e.subject
|
|
921
921
|
})));
|
|
@@ -930,7 +930,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
930
930
|
limit: de,
|
|
931
931
|
offset: (e - 1) * de,
|
|
932
932
|
search: P.value.trim() || void 0,
|
|
933
|
-
restaurantIds: (s =
|
|
933
|
+
restaurantIds: (s = N.value) != null && s.length ? N.value : void 0,
|
|
934
934
|
permissionSubjects: (x = z.value) != null && x.length ? z.value : void 0
|
|
935
935
|
});
|
|
936
936
|
U.value = B.items, j.value = B.total;
|
|
@@ -950,9 +950,9 @@ const vt = /* @__PURE__ */ me({
|
|
|
950
950
|
if (!te.value) return;
|
|
951
951
|
const e = await te.value.validate();
|
|
952
952
|
if (!e) return;
|
|
953
|
-
const s =
|
|
953
|
+
const s = D.value === ee.ADD;
|
|
954
954
|
await _.minor(async () => {
|
|
955
|
-
await (s ? be.createTeamMember(e) : be.updateTeamMember(oe.value.id, e)),
|
|
955
|
+
await (s ? be.createTeamMember(e) : be.updateTeamMember(oe.value.id, e)), v(), await Re(), await G();
|
|
956
956
|
}, {
|
|
957
957
|
isLoading: d,
|
|
958
958
|
successMessage: s ? t("team.addMember.successMessage", {
|
|
@@ -960,10 +960,10 @@ const vt = /* @__PURE__ */ me({
|
|
|
960
960
|
}) : t("team.updateMember.successMessage", {
|
|
961
961
|
memberName: e.name
|
|
962
962
|
})
|
|
963
|
-
}),
|
|
963
|
+
}), D.value = ee.CLOSED;
|
|
964
964
|
}
|
|
965
965
|
async function Qe() {
|
|
966
|
-
await
|
|
966
|
+
await y.readPermissionSets();
|
|
967
967
|
}
|
|
968
968
|
async function Re() {
|
|
969
969
|
await u.readPermissionAssignments();
|
|
@@ -982,23 +982,24 @@ const vt = /* @__PURE__ */ me({
|
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
|
|
985
|
+
const He = os(g, () => {
|
|
986
986
|
P.value = g.value;
|
|
987
|
-
})
|
|
987
|
+
});
|
|
988
|
+
return ts(He), he(ne, () => {
|
|
988
989
|
E.value = 1;
|
|
989
|
-
}),
|
|
990
|
+
}), he(n.currentBusiness, async () => {
|
|
990
991
|
var e;
|
|
991
992
|
(e = n.currentBusiness.value) != null && e._id && (await Promise.all([Qe(), Re(), o(), n.restaurants.value.length === 0 ? n.readRestaurants() : Promise.resolve()]), ce());
|
|
992
993
|
}, {
|
|
993
994
|
immediate: !0
|
|
994
|
-
}),
|
|
995
|
+
}), h({
|
|
995
996
|
create: H
|
|
996
997
|
}), (e, s) => {
|
|
997
|
-
var
|
|
998
|
+
var ve;
|
|
998
999
|
const x = F("FmSearch"), B = F("FmTable"), ie = F("FmButton"), ue = F("FmSideSheet");
|
|
999
|
-
return
|
|
1000
|
-
modelValue:
|
|
1001
|
-
"onUpdate:modelValue": s[0] || (s[0] = ($) =>
|
|
1000
|
+
return f(), q(ye, null, [c("div", ut, [c("div", mt, [c("div", ct, [c("div", dt, [p(m(Ie), {
|
|
1001
|
+
modelValue: N.value,
|
|
1002
|
+
"onUpdate:modelValue": s[0] || (s[0] = ($) => N.value = $),
|
|
1002
1003
|
"managable-only": !1,
|
|
1003
1004
|
multiple: "",
|
|
1004
1005
|
variant: "dark",
|
|
@@ -1017,15 +1018,15 @@ const vt = /* @__PURE__ */ me({
|
|
|
1017
1018
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1018
1019
|
autofocus: "",
|
|
1019
1020
|
placeholder: m(t)("team.search.placeholder")
|
|
1020
|
-
}, null, 8, ["modelValue", "placeholder"])]), c("div",
|
|
1021
|
+
}, null, 8, ["modelValue", "placeholder"])]), c("div", pt, [p(x, {
|
|
1021
1022
|
modelValue: g.value,
|
|
1022
1023
|
"onUpdate:modelValue": s[3] || (s[3] = ($) => g.value = $),
|
|
1023
1024
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1024
1025
|
autofocus: "",
|
|
1025
1026
|
placeholder: m(t)("team.search.placeholder")
|
|
1026
|
-
}, null, 8, ["modelValue", "placeholder"]), c("div",
|
|
1027
|
-
modelValue:
|
|
1028
|
-
"onUpdate:modelValue": s[4] || (s[4] = ($) =>
|
|
1027
|
+
}, null, 8, ["modelValue", "placeholder"]), c("div", vt, [p(m(Ie), {
|
|
1028
|
+
modelValue: N.value,
|
|
1029
|
+
"onUpdate:modelValue": s[4] || (s[4] = ($) => N.value = $),
|
|
1029
1030
|
"managable-only": !1,
|
|
1030
1031
|
multiple: "",
|
|
1031
1032
|
variant: "dark",
|
|
@@ -1038,14 +1039,14 @@ const vt = /* @__PURE__ */ me({
|
|
|
1038
1039
|
items: re.value,
|
|
1039
1040
|
"selected-prefix": m(t)("team.filter.selected_permission_prefix"),
|
|
1040
1041
|
placeholder: m(t)("team.filter.permission_placeholder")
|
|
1041
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (
|
|
1042
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), (ve = m(n).currentBusiness.value) != null && ve._id ? (f(), k(us, {
|
|
1042
1043
|
key: 0
|
|
1043
1044
|
}, {
|
|
1044
|
-
default: T(() => [c("div",
|
|
1045
|
+
default: T(() => [c("div", ft, [j.value === 0 && !S.value ? (f(), k(m(ms), {
|
|
1045
1046
|
key: 0,
|
|
1046
1047
|
title: m(t)("team.emptyState.title"),
|
|
1047
1048
|
subtitle: m(t)("team.emptyState.description")
|
|
1048
|
-
}, null, 8, ["title", "subtitle"])) : A("", !0),
|
|
1049
|
+
}, null, 8, ["title", "subtitle"])) : A("", !0), as((f(), k(B, {
|
|
1049
1050
|
key: ne.value,
|
|
1050
1051
|
"column-defs": l,
|
|
1051
1052
|
"row-data": U.value,
|
|
@@ -1059,7 +1060,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
1059
1060
|
class: "team-member-list-table min-h-0 flex-1",
|
|
1060
1061
|
"pin-header-row": "",
|
|
1061
1062
|
onRowClick: s[6] || (s[6] = ($) => W(m(pe).Update, $.original))
|
|
1062
|
-
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])), [[
|
|
1063
|
+
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])), [[ls, j.value > 0 || S.value]])])]),
|
|
1063
1064
|
_: 1
|
|
1064
1065
|
})) : A("", !0)])]), p(ue, {
|
|
1065
1066
|
header: Fe.value,
|
|
@@ -1069,7 +1070,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
1069
1070
|
class: "absolute",
|
|
1070
1071
|
"onUpdate:modelValue": s[7] || (s[7] = ($) => r($))
|
|
1071
1072
|
}, {
|
|
1072
|
-
"side-sheet-footer": T(() => [c("div",
|
|
1073
|
+
"side-sheet-footer": T(() => [c("div", bt, [p(ie, {
|
|
1073
1074
|
label: xe.value,
|
|
1074
1075
|
size: "md",
|
|
1075
1076
|
variant: "primary",
|
|
@@ -1080,9 +1081,9 @@ const vt = /* @__PURE__ */ me({
|
|
|
1080
1081
|
size: "md",
|
|
1081
1082
|
variant: "secondary",
|
|
1082
1083
|
disabled: d.value,
|
|
1083
|
-
onClick:
|
|
1084
|
+
onClick: v
|
|
1084
1085
|
}, null, 8, ["label", "disabled"])])]),
|
|
1085
|
-
default: T(() => [p(
|
|
1086
|
+
default: T(() => [p(it, {
|
|
1086
1087
|
ref_key: "memberForm",
|
|
1087
1088
|
ref: te,
|
|
1088
1089
|
initialValue: oe.value,
|
|
@@ -1092,7 +1093,7 @@ const vt = /* @__PURE__ */ me({
|
|
|
1092
1093
|
}, 8, ["header", "model-value"])], 64);
|
|
1093
1094
|
};
|
|
1094
1095
|
}
|
|
1095
|
-
}),
|
|
1096
|
+
}), Ct = /* @__PURE__ */ ze(ht, [["__scopeId", "data-v-ad3a788a"]]);
|
|
1096
1097
|
export {
|
|
1097
|
-
|
|
1098
|
+
Ct as default
|
|
1098
1099
|
};
|