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