@feedmepos/mf-hrm-portal 2.3.2-dev.14 → 2.3.2-dev.16
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-BDMu2nlf.js → ApprovalCodeList-B3jNdAYD.js} +7 -7
- package/dist/{AuditLogList-BFBj-jk9.js → AuditLogList-khYZrM4O.js} +366 -361
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-D7UE_NiK.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-draQ4InF.js} +2 -2
- package/dist/{EmployeeList-yMAEN8HX.js → EmployeeList-Dnublgsa.js} +8 -8
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-BgRk-jRk.js → FormSection.vue_vue_type_script_setup_true_lang-BB43cRca.js} +1 -1
- package/dist/{GrantUserList-aYzD_hm0.js → GrantUserList-Cyde_ZvG.js} +8 -8
- package/dist/{Main-BiXZ2uwk.js → Main-D7L7IaSi.js} +12 -12
- package/dist/{Main-C8MhhDdW.js → Main-DunDfrfn.js} +5 -5
- package/dist/{Main-0iTpXb98.js → Main-MWuJXveM.js} +12 -12
- package/dist/{MyPosProfile-Calhn0WC.js → MyPosProfile-GLy8uIjr.js} +1 -1
- package/dist/{PermissionSetList-C-O_seZy.js → PermissionSetList-CTya3yQD.js} +6 -6
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-3FF5AMJb.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B819VW59.js} +762 -762
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-C07A8JOx.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-MXPrxf7_.js} +2 -2
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-DdVuso5Y.js → RoleForm.vue_vue_type_script_setup_true_lang-MEo4THC2.js} +9 -9
- package/dist/{RoleList-DExzw7JT.js → RoleList-D7cBVxYw.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-RRpzDisY.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DFIvDycw.js} +1 -1
- package/dist/{ScheduleGeneralPage-DlHMmhGJ.js → ScheduleGeneralPage-SFsD-TKY.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Dkkv_UZL.js → ScheduleModal.vue_vue_type_script_setup_true_lang-YeoRA-WZ.js} +4 -4
- package/dist/{SchedulePage-dhZaaOB9.js → SchedulePage-htF58vxp.js} +9 -9
- package/dist/{SchedulePositionPage-MzZ5rMOP.js → SchedulePositionPage-BVEpQvOB.js} +3 -3
- package/dist/{SelectFilter-D6i7dIWo.js → SelectFilter-C36mwNN9.js} +1 -1
- package/dist/{TeamMemberList-DcA_qRCm.js → TeamMemberList-CQ_Q-kK_.js} +723 -724
- package/dist/{TimesheetList-DbZ5S4W7.js → TimesheetList-CNixrC8s.js} +8 -8
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-5AgJfpEl.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CYtX4RNX.js} +3 -3
- package/dist/{app-DTHCLxcv.js → app-DwJPnksU.js} +909 -898
- package/dist/app.js +1 -1
- package/dist/{approval-code-Bs9_Zvb4.js → approval-code-2b26Pgxl.js} +1 -1
- package/dist/{dayjs.min-B1mxceq0.js → dayjs.min-cGJfyGlJ.js} +1 -1
- package/dist/{employee-7hJffW-T.js → employee-CGDFUIei.js} +5 -5
- package/dist/{grant-user-CDuaDJvW.js → grant-user-3wYZeemh.js} +1 -1
- package/dist/{iteration-Blu9ugj8.js → iteration-CN3qkp7j.js} +1 -1
- package/dist/{lodash-DeuHD52q.js → lodash-2kEG2kVJ.js} +1 -1
- package/dist/{member-grant-DxA40oCw.js → member-grant-Tup6x9_U.js} +2 -2
- package/dist/{restaurant-hEQn38rG.js → restaurant-BSeSCAtd.js} +1 -1
- package/dist/{role-CcTqE2HQ.js → role-DnK0aZXF.js} +3 -3
- package/dist/{rule-CfTomm23.js → rule-Di8SnWjQ.js} +3 -3
- package/dist/src/views/audit-log/constants.d.ts +1 -1
- package/dist/src/views/audit-log/locales/index.d.ts +16 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-D5U6wJfE.js → useAppStore-D7B1Uzy9.js} +1 -1
- package/dist/{useLoading-Ct27XghS.js → useLoading-Bfisabfg.js} +1 -1
- package/dist/{useReportPermissions-BD1IvbaS.js → useReportPermissions-BUmyfjFx.js} +3 -3
- package/dist/{useSsoProviders-uz6kcTrk.js → useSsoProviders-CJQTq0Fk.js} +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as oe, mergeModels as es, useModel as ts, createElementBlock as M, openBlock as
|
|
1
|
+
import { defineComponent as oe, mergeModels as es, useModel as ts, createElementBlock as M, openBlock as i, Fragment as de, renderList as Vt, normalizeClass as at, toDisplayString as N, unref as s, computed as I, resolveComponent as K, createElementVNode as p, createBlock as q, createCommentVNode as O, createVNode as m, ref as c, watch as ue, onUnmounted as Pt, createSlots as vt, withCtx as te, renderSlot as ss, withModifiers as Ft, nextTick as Mt, h as as, createTextVNode as ls } from "vue";
|
|
2
2
|
import { useI18n as ce, useCoreStore as lt } from "@feedmepos/mf-common";
|
|
3
|
-
import { g as be, b as ye, a as Rt, u as $t, h as ft, j as os, _ as rs, c as ns } from "./app-
|
|
3
|
+
import { g as be, b as ye, a as Rt, u as $t, h as ft, j as os, _ as rs, c as ns } from "./app-DwJPnksU.js";
|
|
4
4
|
import { useSnackbar as ot, useDialog as Ct, useBreakpoints as Dt, components as Ze, SnackbarPosition as Qe } from "@feedmepos/ui-library";
|
|
5
5
|
import { u as is } from "./useDebounce-B8ZPVS5C.js";
|
|
6
|
-
import { S as ie } from "./SelectFilter-
|
|
6
|
+
import { S as ie } from "./SelectFilter-C36mwNN9.js";
|
|
7
7
|
import { _ as bt } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
|
|
8
8
|
import { _ as us } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
9
9
|
import { s as ms, _ as ds, d as cs, e as ps } from "./PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js";
|
|
10
|
-
import { u as Nt } from "./useLoading-
|
|
10
|
+
import { u as Nt } from "./useLoading-Bfisabfg.js";
|
|
11
11
|
import { u as vs } from "./useDiscardConfirm-CzZSPyvh.js";
|
|
12
|
-
import { w as fs, h as bs, b as ys, E as gs, t as hs } from "./member-grant-
|
|
13
|
-
import { a as Xe, i as rt, t as Me, b as He, D as Et, E as At, h as Te, u as xs, s as ze, c as yt, d as gt, e as _s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-
|
|
12
|
+
import { w as fs, h as bs, b as ys, E as gs, t as hs } from "./member-grant-Tup6x9_U.js";
|
|
13
|
+
import { a as Xe, i as rt, t as Me, b as He, D as Et, E as At, h as Te, u as xs, s as ze, c as yt, d as gt, e as _s } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-MXPrxf7_.js";
|
|
14
14
|
import { n as nt } from "./string-DZQ1uNjn.js";
|
|
15
|
-
import { c as Pe } from "./iteration-
|
|
16
|
-
import { l as Le } from "./lodash-
|
|
17
|
-
import { _ as ht } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { t as Fe, u as Ot, P as et, H as xt, R as tt, a as Lt, p as _t, $ as Us, b as Ut, c as Is } from "./rule-
|
|
19
|
-
import { t as
|
|
20
|
-
import { u as Tt } from "./restaurant-
|
|
21
|
-
import { u as jt } from "./role-
|
|
15
|
+
import { c as Pe } from "./iteration-CN3qkp7j.js";
|
|
16
|
+
import { l as Le } from "./lodash-2kEG2kVJ.js";
|
|
17
|
+
import { _ as ht } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-B819VW59.js";
|
|
18
|
+
import { t as Fe, u as Ot, P as et, H as xt, R as tt, a as Lt, p as _t, $ as Us, b as Ut, c as Is } from "./rule-Di8SnWjQ.js";
|
|
19
|
+
import { t as ws, s as ks, a as It, c as Ss, r as Vs, b as Ps, d as wt, _ as Fs, p as Ms } from "./RoleForm.vue_vue_type_script_setup_true_lang-MEo4THC2.js";
|
|
20
|
+
import { u as Tt } from "./restaurant-BSeSCAtd.js";
|
|
21
|
+
import { u as jt } from "./role-DnK0aZXF.js";
|
|
22
22
|
var Ae = /* @__PURE__ */ ((l) => (l.Update = "Update", l.Remove = "Remove", l))(Ae || {});
|
|
23
23
|
const je = "__unassigned__";
|
|
24
|
-
function
|
|
24
|
+
function kt(l) {
|
|
25
25
|
if (!(l != null && l.length) || l[0] === je) return l;
|
|
26
|
-
const
|
|
27
|
-
return
|
|
26
|
+
const E = l.filter((v) => v !== je);
|
|
27
|
+
return E.length === l.length ? l : [je, ...E];
|
|
28
28
|
}
|
|
29
29
|
const Rs = {
|
|
30
30
|
role: "tablist",
|
|
@@ -40,20 +40,20 @@ const Rs = {
|
|
|
40
40
|
}),
|
|
41
41
|
emits: ["update:modelValue"],
|
|
42
42
|
setup(l) {
|
|
43
|
-
const
|
|
44
|
-
return (
|
|
45
|
-
(
|
|
46
|
-
key:
|
|
43
|
+
const E = ts(l, "modelValue");
|
|
44
|
+
return (v, t) => (i(), M("div", Rs, [
|
|
45
|
+
(i(!0), M(de, null, Vt(l.items, (g) => (i(), M("button", {
|
|
46
|
+
key: g.value,
|
|
47
47
|
type: "button",
|
|
48
48
|
role: "tab",
|
|
49
|
-
"aria-selected":
|
|
49
|
+
"aria-selected": E.value === g.value,
|
|
50
50
|
disabled: l.disabled,
|
|
51
51
|
class: at([
|
|
52
52
|
"flex-1 rounded-[8px] px-12 py-8 text-center text-[16px] leading-[24px] tracking-[0.04px] transition-colors disabled:cursor-not-allowed",
|
|
53
|
-
|
|
53
|
+
E.value === g.value ? "border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white font-semibold text-fm-color-typo-primary shadow-[0px_1px_2px_0px_rgba(28,28,30,0.04)]" : "border border-transparent font-medium text-fm-color-typo-tertiary hover:bg-fm-color-opacity-sm"
|
|
54
54
|
]),
|
|
55
|
-
onClick: (
|
|
56
|
-
},
|
|
55
|
+
onClick: (u) => E.value = g.value
|
|
56
|
+
}, N(g.label), 11, $s))), 128))
|
|
57
57
|
]));
|
|
58
58
|
}
|
|
59
59
|
}), it = /* @__PURE__ */ oe({
|
|
@@ -62,13 +62,13 @@ const Rs = {
|
|
|
62
62
|
status: {}
|
|
63
63
|
},
|
|
64
64
|
setup(l) {
|
|
65
|
-
const { t:
|
|
66
|
-
return (
|
|
65
|
+
const { t: E } = ce();
|
|
66
|
+
return (v, t) => (i(), M("span", {
|
|
67
67
|
class: at([
|
|
68
68
|
"inline-flex items-center rounded-[4px] px-4 py-[2px] text-[10px] font-medium leading-[14px] tracking-[0.2px] whitespace-nowrap",
|
|
69
69
|
l.status === "active" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-system-warning-100 text-fm-color-typo-warning"
|
|
70
70
|
])
|
|
71
|
-
},
|
|
71
|
+
}, N(s(E)(`team.status.${l.status}`)), 3));
|
|
72
72
|
}
|
|
73
73
|
}), Ds = {
|
|
74
74
|
class: "flex items-center gap-12 rounded-[16px] border border-[#995900] bg-fm-color-system-warning-100 p-16",
|
|
@@ -81,30 +81,30 @@ const Rs = {
|
|
|
81
81
|
match: {}
|
|
82
82
|
},
|
|
83
83
|
emits: ["update"],
|
|
84
|
-
setup(l, { emit:
|
|
85
|
-
const
|
|
86
|
-
() =>
|
|
87
|
-
),
|
|
88
|
-
return (W,
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
setup(l, { emit: E }) {
|
|
85
|
+
const v = l, t = E, { t: g } = ce(), u = I(() => v.existing.kind === "member" ? "active" : "invited"), j = I(
|
|
86
|
+
() => v.existing.restaurantCount === 1 ? g("team.existingMember.restaurantCount.one") : g("team.existingMember.restaurantCount.other", { count: v.existing.restaurantCount })
|
|
87
|
+
), B = I(() => v.existing.kind !== "member" || !v.existing.isOwner);
|
|
88
|
+
return (W, x) => {
|
|
89
|
+
const L = K("FmButton");
|
|
90
|
+
return i(), M("div", Ds, [
|
|
91
|
+
p("div", Ns, N(s(nt)(l.existing.name)), 1),
|
|
92
|
+
p("div", Es, [
|
|
93
|
+
p("div", As, [
|
|
94
|
+
p("p", Os, N(l.existing.name), 1),
|
|
95
|
+
m(it, { status: u.value }, null, 8, ["status"])
|
|
96
96
|
]),
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
p("p", Ls, N(s(g)(`team.existingMember.alreadyUses.${l.match}`, { restaurants: j.value })), 1),
|
|
98
|
+
p("p", Ts, N(B.value ? s(g)("team.existingMember.updateInstead") : s(g)("team.existingMember.isOwner")), 1)
|
|
99
99
|
]),
|
|
100
|
-
|
|
100
|
+
B.value ? (i(), q(L, {
|
|
101
101
|
key: 0,
|
|
102
|
-
label:
|
|
102
|
+
label: s(g)("team.existingMember.updateAccess"),
|
|
103
103
|
size: "md",
|
|
104
104
|
variant: "primary",
|
|
105
105
|
class: "shrink-0",
|
|
106
|
-
onClick:
|
|
107
|
-
}, null, 8, ["label"])) :
|
|
106
|
+
onClick: x[0] || (x[0] = (V) => t("update"))
|
|
107
|
+
}, null, 8, ["label"])) : O("", !0)
|
|
108
108
|
]);
|
|
109
109
|
};
|
|
110
110
|
}
|
|
@@ -114,18 +114,18 @@ const Rs = {
|
|
|
114
114
|
await ye("staff-invites").get("", { params: { status: l } })
|
|
115
115
|
);
|
|
116
116
|
},
|
|
117
|
-
async lookup(l,
|
|
117
|
+
async lookup(l, E) {
|
|
118
118
|
return be(
|
|
119
119
|
await ye("staff-invites").get("/lookup", {
|
|
120
|
-
params: { ...l, provider:
|
|
120
|
+
params: { ...l, provider: E }
|
|
121
121
|
})
|
|
122
122
|
) || null;
|
|
123
123
|
},
|
|
124
124
|
async createInvite(l) {
|
|
125
125
|
return be(await ye("staff-invites").post("", l));
|
|
126
126
|
},
|
|
127
|
-
async updateInvite(l,
|
|
128
|
-
return be(await ye("staff-invites").put(`/${l}`,
|
|
127
|
+
async updateInvite(l, E) {
|
|
128
|
+
return be(await ye("staff-invites").put(`/${l}`, E));
|
|
129
129
|
},
|
|
130
130
|
async revokeInvite(l) {
|
|
131
131
|
return be(await ye("staff-invites").delete(`/${l}`));
|
|
@@ -145,170 +145,170 @@ const Rs = {
|
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
emits: ["update-existing"],
|
|
148
|
-
setup(l, { expose:
|
|
148
|
+
setup(l, { expose: E, emit: v }) {
|
|
149
149
|
var re, se;
|
|
150
|
-
const
|
|
150
|
+
const t = l, g = v, { t: u } = ce(), j = lt(), { supportedCountries: B, ready: W } = Xe(), x = I(() => {
|
|
151
151
|
var o;
|
|
152
|
-
const C = (o =
|
|
152
|
+
const C = (o = j.currentCountry.value) == null ? void 0 : o.toUpperCase();
|
|
153
153
|
return C && rt(C) ? C : void 0;
|
|
154
|
-
}),
|
|
154
|
+
}), L = c(((re = t.providers[0]) == null ? void 0 : re.slug) ?? ""), V = I(() => t.providers.find((C) => C.slug === L.value)), _ = I(() => {
|
|
155
155
|
var C;
|
|
156
|
-
return ((C =
|
|
157
|
-
}), F =
|
|
158
|
-
() =>
|
|
159
|
-
), T =
|
|
160
|
-
{ label:
|
|
161
|
-
{ label:
|
|
162
|
-
]),
|
|
156
|
+
return ((C = V.value) == null ? void 0 : C.label) ?? "";
|
|
157
|
+
}), F = I(
|
|
158
|
+
() => t.providers.map((C) => ({ label: C.label, value: C.slug }))
|
|
159
|
+
), T = c(((se = V.value) == null ? void 0 : se.inviteMatch) ?? "mobile"), P = c(""), G = c(""), h = c(""), d = c(""), S = I(() => [
|
|
160
|
+
{ label: u("team.memberDetails.phoneNumber"), value: "mobile" },
|
|
161
|
+
{ label: u("team.memberDetails.emailAddress"), value: "email" }
|
|
162
|
+
]), b = I(() => {
|
|
163
163
|
if (T.value === "mobile") {
|
|
164
164
|
const C = Me(P.value);
|
|
165
165
|
return C ? { mobile: C } : null;
|
|
166
166
|
}
|
|
167
167
|
return He(G.value) ? { email: G.value.trim().toLowerCase() } : null;
|
|
168
|
-
}), r =
|
|
169
|
-
let
|
|
168
|
+
}), r = c(null);
|
|
169
|
+
let U, $ = 0;
|
|
170
170
|
ue(
|
|
171
|
-
[
|
|
171
|
+
[b, L],
|
|
172
172
|
([C]) => {
|
|
173
|
-
clearTimeout(
|
|
173
|
+
clearTimeout(U);
|
|
174
174
|
const o = ++$;
|
|
175
|
-
r.value = null, C && (
|
|
175
|
+
r.value = null, C && (U = setTimeout(async () => {
|
|
176
176
|
try {
|
|
177
|
-
const
|
|
178
|
-
o === $ && (r.value =
|
|
177
|
+
const w = await Oe.lookup(C, L.value || void 0);
|
|
178
|
+
o === $ && (r.value = w);
|
|
179
179
|
} catch {
|
|
180
180
|
}
|
|
181
181
|
}, Zs));
|
|
182
182
|
},
|
|
183
183
|
{ deep: !0 }
|
|
184
|
-
), Pt(() => clearTimeout(
|
|
184
|
+
), Pt(() => clearTimeout(U));
|
|
185
185
|
function X() {
|
|
186
186
|
const C = Te(P.value) ? Me(P.value) ?? "" : "", o = G.value.trim().toLowerCase();
|
|
187
187
|
return {
|
|
188
|
-
provider:
|
|
188
|
+
provider: L.value,
|
|
189
189
|
match: T.value,
|
|
190
190
|
...T.value === "mobile" ? { mobile: Me(P.value) ?? "", ...o ? { email: o } : {} } : { email: o, ...C ? { mobile: C } : {} },
|
|
191
191
|
displayName: h.value.trim(),
|
|
192
|
-
...
|
|
192
|
+
...d.value.trim() ? { employeeId: d.value.trim() } : {}
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
function Y() {
|
|
196
|
-
return Te(P.value) || !!G.value.trim() || !!h.value.trim() || !!
|
|
196
|
+
return Te(P.value) || !!G.value.trim() || !!h.value.trim() || !!d.value.trim();
|
|
197
197
|
}
|
|
198
|
-
return
|
|
198
|
+
return E({
|
|
199
199
|
readDetails: X,
|
|
200
200
|
isModified: Y,
|
|
201
201
|
/** Add is blocked while the key belongs to someone already. */
|
|
202
|
-
hasExisting:
|
|
203
|
-
providerLabel:
|
|
202
|
+
hasExisting: I(() => !!r.value),
|
|
203
|
+
providerLabel: _
|
|
204
204
|
}), (C, o) => {
|
|
205
|
-
const
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
205
|
+
const w = K("FmSelect"), z = K("FmPhoneNumber"), ne = K("FmCircularProgress"), Z = K("FmTextField");
|
|
206
|
+
return i(), M("div", Bs, [
|
|
207
|
+
p("div", qs, [
|
|
208
|
+
p("p", Gs, N(s(u)("team.memberDetails.title")), 1),
|
|
209
|
+
p("p", Ks, N(s(u)("team.memberDetails.ssoNotice", { label: _.value })), 1)
|
|
210
210
|
]),
|
|
211
|
-
l.providers.length > 1 ? (
|
|
211
|
+
l.providers.length > 1 ? (i(), q(w, {
|
|
212
212
|
key: 0,
|
|
213
|
-
modelValue:
|
|
214
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
215
|
-
label:
|
|
213
|
+
modelValue: L.value,
|
|
214
|
+
"onUpdate:modelValue": o[0] || (o[0] = (f) => L.value = f),
|
|
215
|
+
label: s(u)("team.memberDetails.provider"),
|
|
216
216
|
items: F.value
|
|
217
|
-
}, null, 8, ["modelValue", "label", "items"])) :
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
}, null, 8, ["modelValue", "label", "items"])) : O("", !0),
|
|
218
|
+
p("div", Ws, [
|
|
219
|
+
p("p", zs, N(s(u)("team.memberDetails.signInUsing")), 1),
|
|
220
|
+
m(Cs, {
|
|
221
221
|
modelValue: T.value,
|
|
222
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
223
|
-
items:
|
|
222
|
+
"onUpdate:modelValue": o[1] || (o[1] = (f) => T.value = f),
|
|
223
|
+
items: S.value
|
|
224
224
|
}, null, 8, ["modelValue", "items"])
|
|
225
225
|
]),
|
|
226
|
-
T.value === "mobile" ? (
|
|
227
|
-
|
|
226
|
+
T.value === "mobile" ? (i(), M(de, { key: 1 }, [
|
|
227
|
+
s(W) ? (i(), q(z, {
|
|
228
228
|
key: 0,
|
|
229
229
|
modelValue: P.value,
|
|
230
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
231
|
-
label:
|
|
232
|
-
"default-country":
|
|
233
|
-
"extra-country-codes":
|
|
234
|
-
rules: [(
|
|
230
|
+
"onUpdate:modelValue": o[2] || (o[2] = (f) => P.value = f),
|
|
231
|
+
label: s(u)("team.memberDetails.phoneNumber"),
|
|
232
|
+
"default-country": x.value,
|
|
233
|
+
"extra-country-codes": s(B),
|
|
234
|
+
rules: [(f) => !!s(Me)(f) || s(u)("team.memberDetails.errors.mobileInvalid")]
|
|
235
235
|
}, vt({ _: 2 }, [
|
|
236
|
-
|
|
236
|
+
b.value ? {
|
|
237
237
|
name: "helper-text",
|
|
238
238
|
fn: te(() => [
|
|
239
|
-
|
|
239
|
+
p("span", Hs, N(s(u)("team.memberDetails.signInHint.mobile", { label: _.value })), 1)
|
|
240
240
|
]),
|
|
241
241
|
key: "0"
|
|
242
242
|
} : void 0
|
|
243
|
-
]), 1032, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : (
|
|
244
|
-
], 64)) : (
|
|
243
|
+
]), 1032, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : (i(), q(ne, { key: 1 }))
|
|
244
|
+
], 64)) : (i(), q(Z, {
|
|
245
245
|
key: 2,
|
|
246
246
|
modelValue: G.value,
|
|
247
|
-
"onUpdate:modelValue": o[3] || (o[3] = (
|
|
248
|
-
label:
|
|
249
|
-
placeholder:
|
|
250
|
-
rules: [(
|
|
247
|
+
"onUpdate:modelValue": o[3] || (o[3] = (f) => G.value = f),
|
|
248
|
+
label: s(u)("team.memberDetails.emailAddress"),
|
|
249
|
+
placeholder: s(u)("team.memberDetails.emailPlaceholder"),
|
|
250
|
+
rules: [(f) => s(He)(f) || s(u)("team.memberDetails.errors.emailInvalid")]
|
|
251
251
|
}, vt({ _: 2 }, [
|
|
252
|
-
|
|
252
|
+
b.value ? {
|
|
253
253
|
name: "helper-text",
|
|
254
254
|
fn: te(() => [
|
|
255
|
-
|
|
255
|
+
p("span", Xs, N(s(u)("team.memberDetails.signInHint.email", { label: _.value })), 1)
|
|
256
256
|
]),
|
|
257
257
|
key: "0"
|
|
258
258
|
} : void 0
|
|
259
259
|
]), 1032, ["modelValue", "label", "placeholder", "rules"])),
|
|
260
|
-
r.value ? (
|
|
260
|
+
r.value ? (i(), q(js, {
|
|
261
261
|
key: 3,
|
|
262
262
|
existing: r.value,
|
|
263
263
|
match: T.value,
|
|
264
|
-
onUpdate: o[4] || (o[4] = (
|
|
265
|
-
}, null, 8, ["existing", "match"])) :
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
onUpdate: o[4] || (o[4] = (f) => g("update-existing", r.value))
|
|
265
|
+
}, null, 8, ["existing", "match"])) : O("", !0),
|
|
266
|
+
p("div", Ys, [
|
|
267
|
+
m(Z, {
|
|
268
268
|
modelValue: h.value,
|
|
269
|
-
"onUpdate:modelValue": o[5] || (o[5] = (
|
|
270
|
-
label:
|
|
271
|
-
placeholder:
|
|
269
|
+
"onUpdate:modelValue": o[5] || (o[5] = (f) => h.value = f),
|
|
270
|
+
label: s(u)("team.memberDetails.name"),
|
|
271
|
+
placeholder: s(u)("team.memberDetails.namePlaceholder"),
|
|
272
272
|
rules: [
|
|
273
|
-
(
|
|
274
|
-
(
|
|
273
|
+
(f) => !!f.trim() || s(u)("team.memberDetails.errors.nameRequired"),
|
|
274
|
+
(f) => f.trim().length <= s(Et) || s(u)("team.memberDetails.errors.nameTooLong")
|
|
275
275
|
]
|
|
276
276
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"]),
|
|
277
|
-
|
|
278
|
-
modelValue:
|
|
279
|
-
"onUpdate:modelValue": o[6] || (o[6] = (
|
|
280
|
-
label:
|
|
277
|
+
m(Z, {
|
|
278
|
+
modelValue: d.value,
|
|
279
|
+
"onUpdate:modelValue": o[6] || (o[6] = (f) => d.value = f),
|
|
280
|
+
label: s(u)("team.memberDetails.employeeId"),
|
|
281
281
|
"label-mark": "optional",
|
|
282
|
-
placeholder:
|
|
282
|
+
placeholder: s(u)("team.memberDetails.employeeIdPlaceholder"),
|
|
283
283
|
rules: [
|
|
284
|
-
(
|
|
284
|
+
(f) => f.trim().length <= s(At) || s(u)("team.memberDetails.errors.employeeIdTooLong")
|
|
285
285
|
]
|
|
286
286
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])
|
|
287
287
|
]),
|
|
288
|
-
|
|
289
|
-
T.value === "mobile" ? (
|
|
288
|
+
p("div", Js, [
|
|
289
|
+
T.value === "mobile" ? (i(), q(Z, {
|
|
290
290
|
key: 0,
|
|
291
291
|
modelValue: G.value,
|
|
292
|
-
"onUpdate:modelValue": o[7] || (o[7] = (
|
|
293
|
-
label:
|
|
292
|
+
"onUpdate:modelValue": o[7] || (o[7] = (f) => G.value = f),
|
|
293
|
+
label: s(u)("team.memberDetails.emailAddress"),
|
|
294
294
|
"label-mark": "optional",
|
|
295
|
-
placeholder:
|
|
295
|
+
placeholder: s(u)("team.memberDetails.emailPlaceholder"),
|
|
296
296
|
rules: [
|
|
297
|
-
(
|
|
297
|
+
(f) => !f.trim() || s(He)(f) || s(u)("team.memberDetails.errors.emailInvalid")
|
|
298
298
|
]
|
|
299
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : (
|
|
300
|
-
|
|
299
|
+
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : (i(), M(de, { key: 1 }, [
|
|
300
|
+
s(W) ? (i(), q(z, {
|
|
301
301
|
key: 0,
|
|
302
302
|
modelValue: P.value,
|
|
303
|
-
"onUpdate:modelValue": o[8] || (o[8] = (
|
|
304
|
-
label:
|
|
303
|
+
"onUpdate:modelValue": o[8] || (o[8] = (f) => P.value = f),
|
|
304
|
+
label: s(u)("team.memberDetails.phoneNumber"),
|
|
305
305
|
"label-mark": "optional",
|
|
306
|
-
"default-country":
|
|
307
|
-
"extra-country-codes":
|
|
306
|
+
"default-country": x.value,
|
|
307
|
+
"extra-country-codes": s(B),
|
|
308
308
|
rules: [
|
|
309
|
-
(
|
|
309
|
+
(f) => !s(Te)(f) || !!s(Me)(f) || s(u)("team.memberDetails.errors.mobileInvalid")
|
|
310
310
|
]
|
|
311
|
-
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) :
|
|
311
|
+
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : O("", !0)
|
|
312
312
|
], 64))
|
|
313
313
|
])
|
|
314
314
|
]);
|
|
@@ -332,20 +332,20 @@ const Rs = {
|
|
|
332
332
|
phoneNumber: {}
|
|
333
333
|
},
|
|
334
334
|
setup(l) {
|
|
335
|
-
const
|
|
336
|
-
return (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
335
|
+
const E = l, v = I(() => nt(E.name));
|
|
336
|
+
return (t, g) => (i(), M("div", ea, [
|
|
337
|
+
p("div", ta, [
|
|
338
|
+
p("div", sa, N(v.value), 1),
|
|
339
|
+
p("div", aa, [
|
|
340
|
+
p("div", la, [
|
|
341
|
+
p("p", oa, N(l.name), 1),
|
|
342
|
+
m(it, { status: l.status }, null, 8, ["status"])
|
|
343
343
|
]),
|
|
344
|
-
l.email ? (
|
|
345
|
-
l.phoneNumber ? (
|
|
344
|
+
l.email ? (i(), M("p", ra, N(l.email), 1)) : O("", !0),
|
|
345
|
+
l.phoneNumber ? (i(), M("p", na, N(l.phoneNumber), 1)) : O("", !0)
|
|
346
346
|
])
|
|
347
347
|
]),
|
|
348
|
-
ss(
|
|
348
|
+
ss(t.$slots, "default")
|
|
349
349
|
]));
|
|
350
350
|
}
|
|
351
351
|
}), ua = { class: "flex flex-col gap-12" }, ma = { class: "grid grid-cols-2 gap-x-[14px]" }, da = { class: "fm-typo-en-body-lg-600" }, ca = { class: "fm-typo-en-body-lg-600" }, pa = ["onClick"], va = ["disabled"], fa = /* @__PURE__ */ oe({
|
|
@@ -369,113 +369,113 @@ const Rs = {
|
|
|
369
369
|
}
|
|
370
370
|
},
|
|
371
371
|
emits: ["update:modelValue"],
|
|
372
|
-
setup(l, { emit:
|
|
373
|
-
const
|
|
374
|
-
function
|
|
375
|
-
const
|
|
376
|
-
return
|
|
372
|
+
setup(l, { emit: E }) {
|
|
373
|
+
const v = l, t = E, { t: g } = ce(), u = c(j(v.modelValue));
|
|
374
|
+
function j(d) {
|
|
375
|
+
const S = ws(d);
|
|
376
|
+
return S.length > 0 ? S : [{ restaurantIds: [], roleId: "" }];
|
|
377
377
|
}
|
|
378
378
|
ue(
|
|
379
|
-
() =>
|
|
380
|
-
(
|
|
381
|
-
|
|
379
|
+
() => v.modelValue,
|
|
380
|
+
(d) => {
|
|
381
|
+
ks(d, It(u.value)) || (u.value = j(d));
|
|
382
382
|
},
|
|
383
383
|
{ deep: !0 }
|
|
384
384
|
);
|
|
385
|
-
function
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
function W(
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const $ = { ...r, restaurantIds:
|
|
392
|
-
return { ...$, roleId: Ms(
|
|
385
|
+
function B(d) {
|
|
386
|
+
u.value = d, t("update:modelValue", It(d));
|
|
387
|
+
}
|
|
388
|
+
function W(d, S) {
|
|
389
|
+
const b = u.value.map((r, U) => {
|
|
390
|
+
if (U !== d) return r;
|
|
391
|
+
const $ = { ...r, restaurantIds: S };
|
|
392
|
+
return { ...$, roleId: Ms(v.roles, $, v.isRoleUsable) };
|
|
393
393
|
});
|
|
394
|
-
|
|
394
|
+
B(b);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
396
|
+
function x(d, S) {
|
|
397
|
+
B(u.value.map((b, r) => r === d ? { ...b, roleId: S } : b));
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
399
|
+
function L() {
|
|
400
|
+
B([...u.value, { restaurantIds: [], roleId: "" }]);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
var
|
|
404
|
-
|
|
402
|
+
function V(d, S) {
|
|
403
|
+
var b;
|
|
404
|
+
S || u.value.length < 2 || (b = u.value[d]) != null && b.restaurantIds.length || B(u.value.filter((r, U) => U !== d));
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
async function G(
|
|
408
|
-
var
|
|
409
|
-
P.value =
|
|
406
|
+
const _ = I(() => Ss(v.restaurants, u.value)), F = c(), T = c(!1), P = c(null);
|
|
407
|
+
async function G(d) {
|
|
408
|
+
var S;
|
|
409
|
+
P.value = d, T.value = !0, await Mt(), (S = F.value) == null || S.trigger();
|
|
410
410
|
}
|
|
411
|
-
function h(
|
|
412
|
-
const
|
|
411
|
+
function h(d) {
|
|
412
|
+
const S = P.value;
|
|
413
413
|
P.value = null;
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
(
|
|
418
|
-
) &&
|
|
414
|
+
const b = S === null ? void 0 : u.value[S];
|
|
415
|
+
if (S === null || !b) return;
|
|
416
|
+
wt(v.roles, b, v.isRoleUsable).some(
|
|
417
|
+
(U) => U.value === d && !U.disabled
|
|
418
|
+
) && x(S, d);
|
|
419
419
|
}
|
|
420
|
-
return (
|
|
420
|
+
return (d, S) => {
|
|
421
421
|
var r;
|
|
422
|
-
const
|
|
423
|
-
return
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
422
|
+
const b = K("FmSelect");
|
|
423
|
+
return i(), M("div", ua, [
|
|
424
|
+
p("div", ma, [
|
|
425
|
+
p("p", da, N(s(g)("team.posAccess.restaurants")), 1),
|
|
426
|
+
p("p", ca, N(s(g)("team.posAccess.posRole")), 1)
|
|
427
427
|
]),
|
|
428
|
-
(
|
|
428
|
+
(i(!0), M(de, null, Vt(u.value, (U, $) => (i(), M("div", {
|
|
429
429
|
key: $,
|
|
430
430
|
class: "grid grid-cols-2 items-center gap-x-[14px]",
|
|
431
431
|
"data-testid": "pos-assignment-row"
|
|
432
432
|
}, [
|
|
433
|
-
|
|
434
|
-
class: at(["min-w-0 pos-restaurant-select", { "pos-restaurant-select--filled":
|
|
435
|
-
"model-value":
|
|
436
|
-
items:
|
|
433
|
+
m(b, {
|
|
434
|
+
class: at(["min-w-0 pos-restaurant-select", { "pos-restaurant-select--filled": U.restaurantIds.length > 0 }]),
|
|
435
|
+
"model-value": U.restaurantIds,
|
|
436
|
+
items: s(Ps)(l.restaurants, u.value, $),
|
|
437
437
|
multiselect: "",
|
|
438
438
|
searchable: "",
|
|
439
439
|
"hide-chips": "",
|
|
440
440
|
"search-debounce": 300,
|
|
441
|
-
placeholder:
|
|
441
|
+
placeholder: s(Vs)(l.restaurants, U) || s(g)("team.posAccess.selectRestaurants"),
|
|
442
442
|
"onUpdate:modelValue": (X) => W($, X),
|
|
443
|
-
onDropdownChanged: (X) =>
|
|
443
|
+
onDropdownChanged: (X) => V($, X)
|
|
444
444
|
}, null, 8, ["class", "model-value", "items", "placeholder", "onUpdate:modelValue", "onDropdownChanged"]),
|
|
445
|
-
|
|
445
|
+
m(b, {
|
|
446
446
|
class: "min-w-0",
|
|
447
|
-
"model-value":
|
|
448
|
-
items:
|
|
449
|
-
placeholder:
|
|
450
|
-
disabled:
|
|
451
|
-
"onUpdate:modelValue": (X) =>
|
|
447
|
+
"model-value": U.roleId,
|
|
448
|
+
items: s(wt)(l.roles, U, l.isRoleUsable),
|
|
449
|
+
placeholder: s(g)("team.posAccess.selectRole"),
|
|
450
|
+
disabled: U.restaurantIds.length === 0,
|
|
451
|
+
"onUpdate:modelValue": (X) => x($, X)
|
|
452
452
|
}, {
|
|
453
453
|
"append-menu": te(() => [
|
|
454
|
-
|
|
454
|
+
p("button", {
|
|
455
455
|
type: "button",
|
|
456
456
|
class: "w-full px-12 py-8 text-left text-[12px] font-semibold text-fm-color-primary",
|
|
457
457
|
"data-testid": "create-pos-role",
|
|
458
458
|
onClick: (X) => G($)
|
|
459
|
-
}, " + " +
|
|
459
|
+
}, " + " + N(s(g)("team.posAccess.createRole")), 9, pa)
|
|
460
460
|
]),
|
|
461
461
|
_: 2
|
|
462
462
|
}, 1032, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"])
|
|
463
463
|
]))), 128)),
|
|
464
|
-
|
|
464
|
+
p("button", {
|
|
465
465
|
type: "button",
|
|
466
466
|
class: "self-start fm-typo-en-body-md-600 text-fm-color-primary disabled:cursor-not-allowed disabled:text-fm-color-typo-disabled",
|
|
467
|
-
disabled: !
|
|
467
|
+
disabled: !_.value,
|
|
468
468
|
"data-testid": "add-pos-row",
|
|
469
|
-
onClick: Ft(
|
|
470
|
-
}, " + " +
|
|
471
|
-
T.value ? (
|
|
469
|
+
onClick: Ft(L, ["stop"])
|
|
470
|
+
}, " + " + N(s(g)("team.posAccess.addRestaurant")), 9, va),
|
|
471
|
+
T.value ? (i(), q(Fs, {
|
|
472
472
|
key: 0,
|
|
473
473
|
ref_key: "roleFormRef",
|
|
474
474
|
ref: F,
|
|
475
475
|
"show-back": "",
|
|
476
|
-
"restaurant-ids": P.value === null ? [] : ((r =
|
|
476
|
+
"restaurant-ids": P.value === null ? [] : ((r = u.value[P.value]) == null ? void 0 : r.restaurantIds) ?? [],
|
|
477
477
|
onCreated: h
|
|
478
|
-
}, null, 8, ["restaurant-ids"])) :
|
|
478
|
+
}, null, 8, ["restaurant-ids"])) : O("", !0)
|
|
479
479
|
]);
|
|
480
480
|
};
|
|
481
481
|
}
|
|
@@ -485,7 +485,7 @@ const Rs = {
|
|
|
485
485
|
}, ga = { class: "flex items-center gap-8" }, ha = { class: "flex flex-1 flex-col gap-8" }, xa = { class: "fm-typo-en-title-sm-600" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ua = {
|
|
486
486
|
key: 0,
|
|
487
487
|
class: "flex flex-col gap-24"
|
|
488
|
-
}, Ia = { class: "flex flex-col gap-12" },
|
|
488
|
+
}, Ia = { class: "flex flex-col gap-12" }, wa = { class: "fm-typo-en-body-lg-600" }, ka = { class: "flex flex-col items-start gap-16" }, st = 4, Sa = /* @__PURE__ */ oe({
|
|
489
489
|
__name: "TeamMemberMasterUser",
|
|
490
490
|
props: {
|
|
491
491
|
modelValue: {
|
|
@@ -518,128 +518,128 @@ const Rs = {
|
|
|
518
518
|
}
|
|
519
519
|
},
|
|
520
520
|
emits: ["update:model-value"],
|
|
521
|
-
setup(l, { emit:
|
|
522
|
-
const
|
|
521
|
+
setup(l, { emit: E }) {
|
|
522
|
+
const v = l, t = E, { t: g } = ce(), u = ot(), j = Nt(u), B = c(!1), W = c([]), x = I(() => {
|
|
523
523
|
var h;
|
|
524
|
-
return ms(((h =
|
|
524
|
+
return ms(((h = v.modelValue) == null ? void 0 : h.roles) ?? []);
|
|
525
525
|
});
|
|
526
|
-
function
|
|
527
|
-
return
|
|
526
|
+
function L(h) {
|
|
527
|
+
return v.usableRoleIds === null || v.usableRoleIds.includes(h._id);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
h ?
|
|
529
|
+
function V(h) {
|
|
530
|
+
h ? v.modelValue || t("update:model-value", {
|
|
531
531
|
code: "",
|
|
532
|
-
name:
|
|
532
|
+
name: v.fallbackName,
|
|
533
533
|
roles: [],
|
|
534
|
-
passcode:
|
|
535
|
-
}) :
|
|
534
|
+
passcode: v.fallbackPasscode || ""
|
|
535
|
+
}) : t("update:model-value", null);
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
if (!
|
|
539
|
-
const
|
|
540
|
-
|
|
537
|
+
function _(h, d) {
|
|
538
|
+
if (!v.modelValue || h === "passcode" && v.modelValue.passcode === d) return;
|
|
539
|
+
const S = Pe(v.modelValue);
|
|
540
|
+
S[h] = d, t("update:model-value", S);
|
|
541
541
|
}
|
|
542
|
-
const F =
|
|
542
|
+
const F = c(!1), T = I(() => x.value.length > 0);
|
|
543
543
|
async function P() {
|
|
544
544
|
if (T.value)
|
|
545
545
|
try {
|
|
546
|
-
const h = await
|
|
546
|
+
const h = await j.custom(
|
|
547
547
|
() => Fe.generateMasterUserPasscode({
|
|
548
|
-
restaurantIds:
|
|
549
|
-
excludePosUserId:
|
|
548
|
+
restaurantIds: x.value,
|
|
549
|
+
excludePosUserId: v.posUserId
|
|
550
550
|
}),
|
|
551
551
|
{ isLoading: F }
|
|
552
552
|
);
|
|
553
|
-
|
|
553
|
+
B.value = !1, W.value = h.split(""), _("passcode", h);
|
|
554
554
|
} catch {
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
ue(
|
|
558
558
|
() => {
|
|
559
559
|
var h;
|
|
560
|
-
return (h =
|
|
560
|
+
return (h = v.modelValue) == null ? void 0 : h.passcode;
|
|
561
561
|
},
|
|
562
562
|
(h) => {
|
|
563
|
-
const
|
|
564
|
-
h !==
|
|
563
|
+
const d = W.value.join("");
|
|
564
|
+
h !== d && (h && h.length === st ? (W.value = h.split(""), B.value = !0) : (W.value = [], B.value = !1));
|
|
565
565
|
},
|
|
566
566
|
{ immediate: !0 }
|
|
567
567
|
);
|
|
568
|
-
const G =
|
|
568
|
+
const G = I({
|
|
569
569
|
get: () => {
|
|
570
570
|
var h;
|
|
571
|
-
return ((h =
|
|
571
|
+
return ((h = v.modelValue) == null ? void 0 : h.roles) ?? [];
|
|
572
572
|
},
|
|
573
573
|
set: () => {
|
|
574
574
|
}
|
|
575
575
|
});
|
|
576
|
-
return (h,
|
|
577
|
-
const
|
|
578
|
-
return
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
576
|
+
return (h, d) => {
|
|
577
|
+
const S = K("FmSwitch"), b = K("FmFormGroup");
|
|
578
|
+
return i(), M("div", ya, [
|
|
579
|
+
p("div", ga, [
|
|
580
|
+
p("div", ha, [
|
|
581
|
+
p("p", xa, N(s(g)("team.posAccess.title")), 1),
|
|
582
|
+
p("p", _a, N(s(g)("team.posAccess.subtitle")), 1)
|
|
583
583
|
]),
|
|
584
|
-
|
|
584
|
+
m(S, {
|
|
585
585
|
"model-value": !!l.modelValue,
|
|
586
586
|
value: "master-user",
|
|
587
|
-
"onUpdate:modelValue":
|
|
587
|
+
"onUpdate:modelValue": V
|
|
588
588
|
}, null, 8, ["model-value"])
|
|
589
589
|
]),
|
|
590
|
-
l.modelValue ? (
|
|
591
|
-
|
|
590
|
+
l.modelValue ? (i(), M("div", Ua, [
|
|
591
|
+
m(b, {
|
|
592
592
|
modelValue: G.value,
|
|
593
|
-
"onUpdate:modelValue":
|
|
593
|
+
"onUpdate:modelValue": d[1] || (d[1] = (r) => G.value = r),
|
|
594
594
|
tag: "div",
|
|
595
595
|
rules: [
|
|
596
|
-
(r) => !r || r.length === 0 ?
|
|
596
|
+
(r) => !r || r.length === 0 ? s(g)("team.memberForm.masterUser.restaurantRequired") : r.some((U) => !U.roleId) ? s(g)("team.memberForm.masterUser.roleRequired") : !0
|
|
597
597
|
]
|
|
598
598
|
}, {
|
|
599
599
|
default: te(() => [
|
|
600
|
-
|
|
600
|
+
m(ba, {
|
|
601
601
|
"model-value": l.modelValue.roles,
|
|
602
602
|
restaurants: l.restaurants,
|
|
603
603
|
roles: l.roles,
|
|
604
|
-
"is-role-usable":
|
|
605
|
-
"onUpdate:modelValue":
|
|
604
|
+
"is-role-usable": L,
|
|
605
|
+
"onUpdate:modelValue": d[0] || (d[0] = (r) => _("roles", r))
|
|
606
606
|
}, null, 8, ["model-value", "restaurants", "roles"])
|
|
607
607
|
]),
|
|
608
608
|
_: 1
|
|
609
609
|
}, 8, ["modelValue", "rules"]),
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
p("div", Ia, [
|
|
611
|
+
p("p", wa, N(s(g)("team.posAccess.passcode")), 1),
|
|
612
|
+
p("div", ka, [
|
|
613
|
+
m(b, {
|
|
614
614
|
modelValue: W.value,
|
|
615
|
-
"onUpdate:modelValue":
|
|
615
|
+
"onUpdate:modelValue": d[5] || (d[5] = (r) => W.value = r),
|
|
616
616
|
rules: [
|
|
617
|
-
(r) => (r == null ? void 0 : r.filter((
|
|
617
|
+
(r) => (r == null ? void 0 : r.filter((U) => !!U).length) !== st ? s(g)("team.memberForm.masterUser.passcodeRequired") : !0
|
|
618
618
|
]
|
|
619
619
|
}, {
|
|
620
620
|
default: te(() => [
|
|
621
|
-
|
|
621
|
+
m(ds, {
|
|
622
622
|
modelValue: W.value,
|
|
623
|
-
"onUpdate:modelValue":
|
|
624
|
-
masked:
|
|
625
|
-
"onUpdate:masked":
|
|
623
|
+
"onUpdate:modelValue": d[2] || (d[2] = (r) => W.value = r),
|
|
624
|
+
masked: B.value,
|
|
625
|
+
"onUpdate:masked": d[3] || (d[3] = (r) => B.value = r),
|
|
626
626
|
length: st,
|
|
627
|
-
"toggle-label":
|
|
628
|
-
onComplete:
|
|
627
|
+
"toggle-label": s(g)("team.memberForm.masterUser.passcodeToggleVisibility"),
|
|
628
|
+
onComplete: d[4] || (d[4] = (r) => _("passcode", r))
|
|
629
629
|
}, null, 8, ["modelValue", "masked", "toggle-label"])
|
|
630
630
|
]),
|
|
631
631
|
_: 1
|
|
632
632
|
}, 8, ["modelValue", "rules"]),
|
|
633
|
-
|
|
634
|
-
label:
|
|
635
|
-
hint:
|
|
633
|
+
m(cs, {
|
|
634
|
+
label: s(g)("team.memberForm.masterUser.passcodeGenerate"),
|
|
635
|
+
hint: s(g)("team.memberForm.masterUser.passcodeSelectOutletFirst"),
|
|
636
636
|
loading: F.value,
|
|
637
637
|
disabled: !T.value,
|
|
638
638
|
onClick: P
|
|
639
639
|
}, null, 8, ["label", "hint", "loading", "disabled"])
|
|
640
640
|
])
|
|
641
641
|
])
|
|
642
|
-
])) :
|
|
642
|
+
])) : O("", !0)
|
|
643
643
|
]);
|
|
644
644
|
};
|
|
645
645
|
}
|
|
@@ -670,220 +670,219 @@ const Rs = {
|
|
|
670
670
|
default: !1
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
|
-
setup(l, { expose:
|
|
673
|
+
setup(l, { expose: E }) {
|
|
674
674
|
var qe, he, ee;
|
|
675
|
-
const
|
|
676
|
-
() =>
|
|
675
|
+
const v = l, { t } = ce(), { isFoodCourt: g } = $t(), u = Ct(), { breakpoints: j } = Dt(), B = Ot(), W = I(
|
|
676
|
+
() => B.permissionSets.value.map((n) => ({
|
|
677
677
|
label: n.name,
|
|
678
678
|
value: n.id
|
|
679
679
|
}))
|
|
680
|
-
),
|
|
681
|
-
() => et(
|
|
682
|
-
),
|
|
680
|
+
), x = c(((qe = v.initialValue) == null ? void 0 : qe.permissionSetIds) || []), L = I(
|
|
681
|
+
() => et(x.value, B.permissionSets.value)
|
|
682
|
+
), V = c((he = v.initialValue) == null ? void 0 : he.posUser), _ = c(
|
|
683
683
|
xt(
|
|
684
|
-
tt(
|
|
685
|
-
((ee =
|
|
684
|
+
tt(L.value),
|
|
685
|
+
((ee = v.initialValue) == null ? void 0 : ee.permissions) || []
|
|
686
686
|
)
|
|
687
687
|
), { customReportPermissions: F, isLoaded: T } = Lt(), P = new Set(
|
|
688
688
|
_t.filter((n) => n.subject.startsWith(Us)).map((n) => n.subject)
|
|
689
|
-
), G =
|
|
689
|
+
), G = I(() => {
|
|
690
690
|
const n = new Set(P);
|
|
691
691
|
for (const R of F.value) n.add(R.subject);
|
|
692
692
|
return n;
|
|
693
|
-
}), h =
|
|
693
|
+
}), h = I(() => {
|
|
694
694
|
const n = /* @__PURE__ */ new Set();
|
|
695
695
|
for (const R of _t)
|
|
696
696
|
R.category === ft.reports && n.add(R.subject);
|
|
697
697
|
for (const R of F.value)
|
|
698
698
|
R.category === ft.reports && n.add(R.subject);
|
|
699
699
|
return n;
|
|
700
|
-
}),
|
|
700
|
+
}), d = I(() => {
|
|
701
701
|
var n;
|
|
702
|
-
return !!((n =
|
|
703
|
-
}),
|
|
704
|
-
() => Ut(
|
|
705
|
-
),
|
|
706
|
-
const n =
|
|
707
|
-
return n === null ?
|
|
708
|
-
}), $ =
|
|
702
|
+
return !!((n = v.initialValue) != null && n.isOwner);
|
|
703
|
+
}), S = I(
|
|
704
|
+
() => Ut(_.value, { isOwner: d.value })
|
|
705
|
+
), b = Tt(), r = jt().roles, U = I(() => {
|
|
706
|
+
const n = S.value.restaurantIds;
|
|
707
|
+
return n === null ? b.restaurants.value : b.restaurants.value.filter((R) => n.includes(R._id));
|
|
708
|
+
}), $ = c(!1);
|
|
709
709
|
function X(n) {
|
|
710
|
-
$.value = n, !n && (
|
|
710
|
+
$.value = n, !n && (x.value = [], _.value = fs(_.value));
|
|
711
711
|
}
|
|
712
|
-
const Y =
|
|
712
|
+
const Y = c({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
|
|
713
713
|
function re(n) {
|
|
714
|
-
|
|
714
|
+
x.value = [...(n == null ? void 0 : n.permissionSetIds) ?? []], _.value = xt(
|
|
715
715
|
tt(
|
|
716
716
|
et(
|
|
717
|
-
|
|
718
|
-
|
|
717
|
+
x.value,
|
|
718
|
+
B.permissionSets.value
|
|
719
719
|
)
|
|
720
720
|
),
|
|
721
721
|
(n == null ? void 0 : n.permissions) || []
|
|
722
|
-
),
|
|
723
|
-
permissionSetIds: [...
|
|
724
|
-
userPermissions: Pe(
|
|
725
|
-
posUser:
|
|
722
|
+
), V.value = n != null && n.posUser ? f(Pe(n.posUser), _.value) : void 0, A.value = !!V.value, $.value = bs(_.value, x.value), Y.value = {
|
|
723
|
+
permissionSetIds: [...x.value],
|
|
724
|
+
userPermissions: Pe(_.value),
|
|
725
|
+
posUser: V.value ? Pe(V.value) : void 0
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
728
|
function se() {
|
|
729
|
-
return !Le.isEqual(
|
|
729
|
+
return !Le.isEqual(x.value, Y.value.permissionSetIds) || !Le.isEqual(_.value, Y.value.userPermissions) || !Le.isEqual(V.value, Y.value.posUser);
|
|
730
730
|
}
|
|
731
731
|
function C(n) {
|
|
732
|
-
|
|
732
|
+
V.value = f(V.value, n);
|
|
733
733
|
}
|
|
734
734
|
function o(n) {
|
|
735
735
|
return tt(
|
|
736
|
-
et(n,
|
|
736
|
+
et(n, B.permissionSets.value)
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
|
|
739
|
+
function w(n) {
|
|
740
|
+
_.value = o(n);
|
|
741
741
|
}
|
|
742
742
|
function z(n) {
|
|
743
743
|
const R = [...n ?? []];
|
|
744
|
-
if (Le.isEqual(R,
|
|
744
|
+
if (Le.isEqual(R, x.value)) return;
|
|
745
745
|
const J = !Le.isEqual(
|
|
746
|
-
|
|
747
|
-
o(
|
|
746
|
+
_.value,
|
|
747
|
+
o(x.value)
|
|
748
748
|
);
|
|
749
|
-
if (
|
|
750
|
-
|
|
749
|
+
if (x.value = R, !J) {
|
|
750
|
+
w(R);
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
|
|
754
|
-
title:
|
|
755
|
-
message:
|
|
756
|
-
minWidth:
|
|
753
|
+
u.open({
|
|
754
|
+
title: t("permissionSet.form.overrideInherited.title"),
|
|
755
|
+
message: t("permissionSet.form.overrideInherited.message"),
|
|
756
|
+
minWidth: j.value.lg ? 588 : 0,
|
|
757
757
|
primaryActions: {
|
|
758
|
-
text:
|
|
758
|
+
text: t("permissionSet.form.overrideInherited.override"),
|
|
759
759
|
close: !1
|
|
760
760
|
},
|
|
761
761
|
secondaryActions: {
|
|
762
|
-
text:
|
|
762
|
+
text: t("permissionSet.form.overrideInherited.keepCurrent"),
|
|
763
763
|
close: !0
|
|
764
764
|
}
|
|
765
765
|
}).onPrimary(() => {
|
|
766
|
-
|
|
766
|
+
w(R), u.close();
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
function ne() {
|
|
770
770
|
var n, R;
|
|
771
771
|
return ys({
|
|
772
|
-
userPermissions:
|
|
773
|
-
inheritedPermissions:
|
|
774
|
-
permissionSetIds:
|
|
775
|
-
posUser:
|
|
772
|
+
userPermissions: _.value,
|
|
773
|
+
inheritedPermissions: L.value,
|
|
774
|
+
permissionSetIds: x.value,
|
|
775
|
+
posUser: V.value,
|
|
776
776
|
reportSubjects: T.value ? G.value : P,
|
|
777
777
|
defaultReportSubjects: h.value,
|
|
778
|
-
savedPosUser: (n =
|
|
779
|
-
fallbackName: ((R =
|
|
778
|
+
savedPosUser: (n = v.initialValue) == null ? void 0 : n.posUser,
|
|
779
|
+
fallbackName: ((R = v.initialValue) == null ? void 0 : R.name) || v.fallbackName
|
|
780
780
|
});
|
|
781
781
|
}
|
|
782
|
-
const Z =
|
|
783
|
-
function
|
|
782
|
+
const Z = c();
|
|
783
|
+
function f(n, R) {
|
|
784
784
|
if (!n) return n;
|
|
785
|
-
const J = Ut(R, { isOwner:
|
|
785
|
+
const J = Ut(R, { isOwner: d.value }), { roleIds: pe, restaurantIds: xe } = J;
|
|
786
786
|
if (pe === null && xe === null) return n;
|
|
787
787
|
const ve = Pe(n);
|
|
788
788
|
return ve.roles = ve.roles.filter(
|
|
789
789
|
(Q) => (pe === null || pe.includes(Q.roleId)) && (xe === null || xe.includes(Q.restaurantId))
|
|
790
790
|
), ve;
|
|
791
791
|
}
|
|
792
|
-
const
|
|
792
|
+
const A = c(!!V.value), ge = c(!1);
|
|
793
793
|
function Be(n) {
|
|
794
|
-
|
|
794
|
+
V.value = n, ge.value = !0;
|
|
795
795
|
}
|
|
796
796
|
return ue(
|
|
797
|
-
() => !!
|
|
797
|
+
() => !!V.value,
|
|
798
798
|
async (n) => {
|
|
799
|
-
n && !
|
|
799
|
+
n && !A.value && ge.value && (await Mt(), Z.value && Z.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), A.value = n;
|
|
800
800
|
}
|
|
801
801
|
), ue(
|
|
802
|
-
() =>
|
|
802
|
+
() => v.initialValue,
|
|
803
803
|
(n, R) => {
|
|
804
804
|
if (!R || !n || R.id !== n.id) {
|
|
805
805
|
ge.value = !1, re(n);
|
|
806
806
|
return;
|
|
807
807
|
}
|
|
808
|
-
n.posUser !== void 0 && !ge.value && (
|
|
808
|
+
n.posUser !== void 0 && !ge.value && (V.value = n.posUser ? f(Pe(n.posUser), _.value) : void 0, Y.value = {
|
|
809
809
|
...Y.value,
|
|
810
|
-
posUser:
|
|
810
|
+
posUser: V.value ? Pe(V.value) : void 0
|
|
811
811
|
});
|
|
812
812
|
},
|
|
813
813
|
{ immediate: !0 }
|
|
814
814
|
), ue(
|
|
815
|
-
|
|
815
|
+
_,
|
|
816
816
|
(n) => {
|
|
817
|
-
|
|
817
|
+
V.value = f(V.value, n);
|
|
818
818
|
},
|
|
819
819
|
{ deep: !0 }
|
|
820
|
-
),
|
|
820
|
+
), E({
|
|
821
821
|
readGrantData: ne,
|
|
822
822
|
isModified: se
|
|
823
823
|
}), (n, R) => {
|
|
824
824
|
var ve, Q, _e, Re, $e, Ge;
|
|
825
825
|
const J = K("FmCircularProgress"), pe = K("FmSwitch"), xe = K("FmSelect");
|
|
826
|
-
return
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
826
|
+
return i(), M("div", Va, [
|
|
827
|
+
(ve = l.initialValue) != null && ve.isOwner ? O("", !0) : (i(), M("section", Pa, [
|
|
828
|
+
p("div", Fa, [
|
|
829
|
+
p("p", Ma, N(s(t)("team.whereTheyWork.title")), 1),
|
|
830
|
+
p("p", Ra, N(s(t)("team.whereTheyWork.subtitle")), 1)
|
|
831
831
|
]),
|
|
832
|
-
|
|
833
|
-
modelValue:
|
|
834
|
-
"onUpdate:modelValue": R[0] || (R[0] = (Ue) =>
|
|
832
|
+
m(ht, {
|
|
833
|
+
modelValue: _.value,
|
|
834
|
+
"onUpdate:modelValue": R[0] || (R[0] = (Ue) => _.value = Ue),
|
|
835
835
|
part: "workplace",
|
|
836
|
-
"inherit-permissions":
|
|
836
|
+
"inherit-permissions": L.value,
|
|
837
837
|
onPermissionChanged: C
|
|
838
838
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
839
|
-
]))
|
|
840
|
-
l.loading ? (
|
|
841
|
-
|
|
842
|
-
])) :
|
|
839
|
+
])),
|
|
840
|
+
l.loading ? (i(), M("div", $a, [
|
|
841
|
+
m(J, { size: "xl" })
|
|
842
|
+
])) : s(g) ? O("", !0) : (i(), q(Sa, {
|
|
843
843
|
key: 2,
|
|
844
844
|
ref_key: "masterUserContentRef",
|
|
845
845
|
ref: Z,
|
|
846
|
-
"model-value":
|
|
846
|
+
"model-value": V.value,
|
|
847
847
|
"fallback-name": ((Q = l.initialValue) == null ? void 0 : Q.name) || l.fallbackName,
|
|
848
848
|
"fallback-passcode": (Re = (_e = l.initialValue) == null ? void 0 : _e.posUser) == null ? void 0 : Re.passcode,
|
|
849
|
-
roles:
|
|
850
|
-
"usable-role-ids":
|
|
851
|
-
restaurants:
|
|
849
|
+
roles: s(r),
|
|
850
|
+
"usable-role-ids": S.value.roleIds,
|
|
851
|
+
restaurants: U.value,
|
|
852
852
|
"pos-user-id": ($e = l.initialValue) == null ? void 0 : $e.posUserId,
|
|
853
853
|
"onUpdate:modelValue": Be
|
|
854
854
|
}, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "usable-role-ids", "restaurants", "pos-user-id"])),
|
|
855
|
-
(Ge = l.initialValue) != null && Ge.isOwner ?
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
855
|
+
(Ge = l.initialValue) != null && Ge.isOwner ? O("", !0) : (i(), M("section", Ca, [
|
|
856
|
+
p("div", Da, [
|
|
857
|
+
p("div", Na, [
|
|
858
|
+
p("p", Ea, N(s(t)("team.portalAccess.title")), 1),
|
|
859
|
+
p("p", Aa, N(s(t)("team.portalAccess.subtitle")), 1)
|
|
860
860
|
]),
|
|
861
|
-
|
|
862
|
-
key: 0,
|
|
861
|
+
m(pe, {
|
|
863
862
|
"model-value": $.value,
|
|
864
863
|
value: "portal-access",
|
|
865
864
|
"onUpdate:modelValue": X
|
|
866
|
-
}, null, 8, ["model-value"])
|
|
865
|
+
}, null, 8, ["model-value"])
|
|
867
866
|
]),
|
|
868
|
-
$.value
|
|
869
|
-
|
|
870
|
-
"model-value":
|
|
867
|
+
$.value ? (i(), M(de, { key: 0 }, [
|
|
868
|
+
m(xe, {
|
|
869
|
+
"model-value": x.value,
|
|
871
870
|
multiselect: "",
|
|
872
871
|
searchable: "",
|
|
873
872
|
"search-debounce": 300,
|
|
874
|
-
label: t
|
|
873
|
+
label: s(t)("team.memberForm.permissionSet.title"),
|
|
875
874
|
items: W.value,
|
|
876
|
-
placeholder: t
|
|
875
|
+
placeholder: s(t)("team.memberForm.permissionSet.selectPlaceholder"),
|
|
877
876
|
"onUpdate:modelValue": z
|
|
878
877
|
}, null, 8, ["model-value", "label", "items", "placeholder"]),
|
|
879
|
-
|
|
880
|
-
modelValue:
|
|
881
|
-
"onUpdate:modelValue": R[1] || (R[1] = (Ue) =>
|
|
878
|
+
m(ht, {
|
|
879
|
+
modelValue: _.value,
|
|
880
|
+
"onUpdate:modelValue": R[1] || (R[1] = (Ue) => _.value = Ue),
|
|
882
881
|
part: "portal",
|
|
883
|
-
"inherit-permissions":
|
|
882
|
+
"inherit-permissions": L.value,
|
|
884
883
|
onPermissionChanged: C
|
|
885
884
|
}, null, 8, ["modelValue", "inherit-permissions"])
|
|
886
|
-
], 64)) :
|
|
885
|
+
], 64)) : O("", !0)
|
|
887
886
|
]))
|
|
888
887
|
]);
|
|
889
888
|
};
|
|
@@ -909,128 +908,128 @@ const Rs = {
|
|
|
909
908
|
}, ja = { class: "user-info-icon user-info-icon--lg" }, Ba = { class: "flex-1 overflow-hidden" }, qa = { class: "profile-displayName" }, Ga = { class: "profile-email" }, Ka = { class: "profile-phone" }, Wa = { key: 2 }, za = /* @__PURE__ */ oe({
|
|
910
909
|
__name: "PortalUserSearcher",
|
|
911
910
|
emits: ["invite"],
|
|
912
|
-
setup(l, { emit:
|
|
913
|
-
const
|
|
911
|
+
setup(l, { emit: E }) {
|
|
912
|
+
const v = E, { t } = ce(), g = ot(), u = lt(), { supportedCountries: j, ready: B } = Xe(), W = I(() => {
|
|
914
913
|
var r;
|
|
915
|
-
const
|
|
916
|
-
return
|
|
917
|
-
}),
|
|
914
|
+
const b = (r = u.currentCountry.value) == null ? void 0 : r.toUpperCase();
|
|
915
|
+
return b && rt(b) ? b : void 0;
|
|
916
|
+
}), x = c("phone"), L = c(""), V = c(""), _ = c(), F = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, T = I(() => F.test(V.value.trim()));
|
|
918
917
|
async function P() {
|
|
919
|
-
const
|
|
920
|
-
if (!
|
|
921
|
-
|
|
918
|
+
const b = x.value === "phone" ? L.value.replace(/ /g, "") : V.value.trim();
|
|
919
|
+
if (!b) {
|
|
920
|
+
g.open({
|
|
922
921
|
type: "error",
|
|
923
|
-
title:
|
|
922
|
+
title: t("team.memberForm.searchUser.emptyError")
|
|
924
923
|
});
|
|
925
924
|
return;
|
|
926
925
|
}
|
|
927
|
-
if (
|
|
928
|
-
|
|
926
|
+
if (x.value === "email" && !T.value) {
|
|
927
|
+
g.open({
|
|
929
928
|
type: "error",
|
|
930
|
-
title:
|
|
929
|
+
title: t("team.memberForm.searchUser.invalidEmail")
|
|
931
930
|
});
|
|
932
931
|
return;
|
|
933
932
|
}
|
|
934
933
|
const r = () => {
|
|
935
|
-
|
|
934
|
+
_.value = void 0, g.open({
|
|
936
935
|
type: "error",
|
|
937
|
-
title:
|
|
936
|
+
title: t("team.memberForm.searchUser.userNotFound")
|
|
938
937
|
});
|
|
939
938
|
};
|
|
940
939
|
try {
|
|
941
|
-
const
|
|
942
|
-
if (!
|
|
940
|
+
const U = x.value === "phone" ? await St.readPermissionUserByPhoneNo(b) : await St.readPermissionUserByEmail(b);
|
|
941
|
+
if (!U) {
|
|
943
942
|
r();
|
|
944
943
|
return;
|
|
945
944
|
}
|
|
946
|
-
|
|
945
|
+
_.value = U;
|
|
947
946
|
} catch {
|
|
948
|
-
|
|
947
|
+
_.value = void 0, g.open({
|
|
949
948
|
type: "error",
|
|
950
|
-
title:
|
|
949
|
+
title: t("team.memberForm.searchUser.searchFailed")
|
|
951
950
|
});
|
|
952
951
|
}
|
|
953
952
|
}
|
|
954
|
-
const G =
|
|
953
|
+
const G = I(() => {
|
|
955
954
|
var $;
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
const [r,
|
|
959
|
-
return
|
|
960
|
-
}), h =
|
|
961
|
-
function
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
function
|
|
955
|
+
let b = (($ = _.value) == null ? void 0 : $.displayName) ?? "";
|
|
956
|
+
b || (b = "Feed Me");
|
|
957
|
+
const [r, U] = b.split(" ");
|
|
958
|
+
return U ? `${r[0]}${U[0]}` : r.slice(0, 2);
|
|
959
|
+
}), h = c(!1);
|
|
960
|
+
function d(b) {
|
|
961
|
+
v("invite", b), h.value = !0;
|
|
962
|
+
}
|
|
963
|
+
function S() {
|
|
965
964
|
h.value = !1;
|
|
966
965
|
}
|
|
967
|
-
return (
|
|
968
|
-
var C, o,
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
h.value ?
|
|
972
|
-
|
|
973
|
-
modelValue:
|
|
974
|
-
"onUpdate:modelValue": r[2] || (r[2] = (z) =>
|
|
966
|
+
return (b, r) => {
|
|
967
|
+
var C, o, w;
|
|
968
|
+
const U = K("FmRadio"), $ = K("FmPhoneNumber"), X = K("FmCircularProgress"), Y = K("FmTextField"), re = K("FmRadioGroup"), se = K("FmButton");
|
|
969
|
+
return i(), M("div", La, [
|
|
970
|
+
h.value ? O("", !0) : (i(), M("div", Ta, [
|
|
971
|
+
m(re, {
|
|
972
|
+
modelValue: x.value,
|
|
973
|
+
"onUpdate:modelValue": r[2] || (r[2] = (z) => x.value = z)
|
|
975
974
|
}, {
|
|
976
975
|
default: te(() => [
|
|
977
|
-
|
|
976
|
+
m(U, {
|
|
978
977
|
value: "phone",
|
|
979
|
-
label: t
|
|
978
|
+
label: s(t)("team.memberForm.searchUser.phoneNumber")
|
|
980
979
|
}, null, 8, ["label"]),
|
|
981
|
-
|
|
980
|
+
x.value === "phone" && s(B) ? (i(), q($, {
|
|
982
981
|
key: 0,
|
|
983
|
-
modelValue:
|
|
984
|
-
"onUpdate:modelValue": r[0] || (r[0] = (z) =>
|
|
982
|
+
modelValue: L.value,
|
|
983
|
+
"onUpdate:modelValue": r[0] || (r[0] = (z) => L.value = z),
|
|
985
984
|
"default-country": W.value,
|
|
986
|
-
"extra-country-codes":
|
|
985
|
+
"extra-country-codes": s(j),
|
|
987
986
|
class: "ml-8"
|
|
988
|
-
}, null, 8, ["modelValue", "default-country", "extra-country-codes"])) :
|
|
987
|
+
}, null, 8, ["modelValue", "default-country", "extra-country-codes"])) : x.value === "phone" ? (i(), q(X, {
|
|
989
988
|
key: 1,
|
|
990
989
|
class: "ml-8"
|
|
991
|
-
})) :
|
|
992
|
-
|
|
990
|
+
})) : O("", !0),
|
|
991
|
+
m(U, {
|
|
993
992
|
value: "email",
|
|
994
|
-
label: t
|
|
993
|
+
label: s(t)("team.memberForm.searchUser.email")
|
|
995
994
|
}, null, 8, ["label"]),
|
|
996
|
-
|
|
995
|
+
x.value === "email" ? (i(), q(Y, {
|
|
997
996
|
key: 2,
|
|
998
|
-
modelValue:
|
|
999
|
-
"onUpdate:modelValue": r[1] || (r[1] = (z) =>
|
|
1000
|
-
placeholder: t
|
|
997
|
+
modelValue: V.value,
|
|
998
|
+
"onUpdate:modelValue": r[1] || (r[1] = (z) => V.value = z),
|
|
999
|
+
placeholder: s(t)("team.memberForm.searchUser.emailPlaceholder"),
|
|
1001
1000
|
rules: [
|
|
1002
|
-
(z) => !z || T.value || t
|
|
1001
|
+
(z) => !z || T.value || s(t)("team.memberForm.searchUser.invalidEmail")
|
|
1003
1002
|
],
|
|
1004
1003
|
class: "ml-8"
|
|
1005
|
-
}, null, 8, ["modelValue", "placeholder", "rules"])) :
|
|
1004
|
+
}, null, 8, ["modelValue", "placeholder", "rules"])) : O("", !0)
|
|
1006
1005
|
]),
|
|
1007
1006
|
_: 1
|
|
1008
1007
|
}, 8, ["modelValue"]),
|
|
1009
|
-
|
|
1010
|
-
label: t
|
|
1008
|
+
m(se, {
|
|
1009
|
+
label: s(t)("team.memberForm.searchUser.search"),
|
|
1011
1010
|
variant: "secondary",
|
|
1012
1011
|
onClick: P
|
|
1013
1012
|
}, null, 8, ["label"])
|
|
1014
1013
|
])),
|
|
1015
|
-
|
|
1014
|
+
_.value ? (i(), M("div", {
|
|
1016
1015
|
key: 1,
|
|
1017
1016
|
class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
|
|
1018
|
-
onClick: r[3] || (r[3] = (z) =>
|
|
1017
|
+
onClick: r[3] || (r[3] = (z) => d(_.value))
|
|
1019
1018
|
}, [
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1019
|
+
p("div", ja, N(G.value), 1),
|
|
1020
|
+
p("div", Ba, [
|
|
1021
|
+
p("p", qa, N((C = _.value) == null ? void 0 : C.displayName), 1),
|
|
1022
|
+
p("p", Ga, N((o = _.value) == null ? void 0 : o.email), 1),
|
|
1023
|
+
p("p", Ka, N((w = _.value) == null ? void 0 : w.phoneNumber), 1)
|
|
1025
1024
|
])
|
|
1026
|
-
])) :
|
|
1027
|
-
h.value ? (
|
|
1028
|
-
|
|
1029
|
-
label: t
|
|
1025
|
+
])) : O("", !0),
|
|
1026
|
+
h.value ? (i(), M("div", Wa, [
|
|
1027
|
+
m(se, {
|
|
1028
|
+
label: s(t)("team.memberForm.searchUser.changeUser"),
|
|
1030
1029
|
variant: "secondary",
|
|
1031
|
-
onClick:
|
|
1030
|
+
onClick: S
|
|
1032
1031
|
}, null, 8, ["label"])
|
|
1033
|
-
])) :
|
|
1032
|
+
])) : O("", !0)
|
|
1034
1033
|
]);
|
|
1035
1034
|
};
|
|
1036
1035
|
}
|
|
@@ -1065,103 +1064,103 @@ const Rs = {
|
|
|
1065
1064
|
}
|
|
1066
1065
|
},
|
|
1067
1066
|
emits: ["update-existing"],
|
|
1068
|
-
setup(l, { expose:
|
|
1069
|
-
const
|
|
1070
|
-
var
|
|
1071
|
-
const o = (
|
|
1067
|
+
setup(l, { expose: E, emit: v }) {
|
|
1068
|
+
const t = l, g = v, u = I(() => !t.initialValue && t.providers.length > 0), { t: j } = ce(), B = lt(), { supportedCountries: W, ready: x } = Xe(), L = I(() => {
|
|
1069
|
+
var w;
|
|
1070
|
+
const o = (w = B.currentCountry.value) == null ? void 0 : w.toUpperCase();
|
|
1072
1071
|
return o && rt(o) ? o : void 0;
|
|
1073
|
-
}),
|
|
1072
|
+
}), V = I(() => {
|
|
1074
1073
|
var o;
|
|
1075
|
-
return ((o =
|
|
1076
|
-
}),
|
|
1074
|
+
return ((o = t.initialValue) == null ? void 0 : o.status) === "invited";
|
|
1075
|
+
}), _ = I(() => !!t.initialValue && !t.initialValue.isOwner), F = c(""), T = c(""), P = c("");
|
|
1077
1076
|
function G(o) {
|
|
1078
1077
|
F.value = (o == null ? void 0 : o.displayName) ?? (o == null ? void 0 : o.name) ?? "", T.value = (o == null ? void 0 : o.employeeId) ?? "", P.value = (o == null ? void 0 : o.contact) ?? "";
|
|
1079
1078
|
}
|
|
1080
|
-
G(
|
|
1079
|
+
G(t.initialValue);
|
|
1081
1080
|
function h() {
|
|
1082
|
-
var
|
|
1083
|
-
if (!
|
|
1084
|
-
const o = ((
|
|
1081
|
+
var w;
|
|
1082
|
+
if (!_.value) return null;
|
|
1083
|
+
const o = ((w = t.initialValue) == null ? void 0 : w.match) === "email" ? Te(P.value) ? Me(P.value) ?? "" : "" : P.value.trim().toLowerCase();
|
|
1085
1084
|
return {
|
|
1086
1085
|
displayName: F.value.trim(),
|
|
1087
1086
|
employeeId: T.value.trim(),
|
|
1088
1087
|
contact: o
|
|
1089
1088
|
};
|
|
1090
1089
|
}
|
|
1091
|
-
function
|
|
1092
|
-
const o =
|
|
1093
|
-
return !o || !
|
|
1090
|
+
function d() {
|
|
1091
|
+
const o = t.initialValue;
|
|
1092
|
+
return !o || !_.value ? !1 : T.value.trim() !== (o.employeeId ?? "") || V.value && (F.value.trim() !== (o.displayName ?? o.name) || P.value.trim() !== (o.contact ?? ""));
|
|
1094
1093
|
}
|
|
1095
|
-
const
|
|
1096
|
-
function
|
|
1097
|
-
var o,
|
|
1098
|
-
return
|
|
1094
|
+
const S = c(), b = c(), r = c();
|
|
1095
|
+
function U() {
|
|
1096
|
+
var o, w;
|
|
1097
|
+
return u.value && ((o = r.value) != null && o.isModified()) || d() || !t.initialValue && S.value ? !0 : ((w = b.value) == null ? void 0 : w.isModified()) ?? !1;
|
|
1099
1098
|
}
|
|
1100
1099
|
function $(o) {
|
|
1101
|
-
|
|
1100
|
+
S.value = o;
|
|
1102
1101
|
}
|
|
1103
1102
|
function X(o) {
|
|
1104
1103
|
return F.value === (o.displayName ?? o.name) && T.value === (o.employeeId ?? "") && P.value === (o.contact ?? "");
|
|
1105
1104
|
}
|
|
1106
1105
|
function Y() {
|
|
1107
|
-
var
|
|
1108
|
-
const o = ((
|
|
1106
|
+
var w, z, ne, Z, f;
|
|
1107
|
+
const o = ((w = b.value) == null ? void 0 : w.readGrantData()) ?? gs;
|
|
1109
1108
|
return {
|
|
1110
|
-
email: ((z =
|
|
1111
|
-
phoneNumber: ((ne =
|
|
1109
|
+
email: ((z = S.value) == null ? void 0 : z.email) ?? void 0,
|
|
1110
|
+
phoneNumber: ((ne = S.value) == null ? void 0 : ne.phoneNumber) ?? void 0,
|
|
1112
1111
|
customPermissions: o.customPermissions,
|
|
1113
1112
|
permissions: o.permissions,
|
|
1114
1113
|
permissionSetIds: o.permissionSetIds,
|
|
1115
|
-
name: ((Z =
|
|
1114
|
+
name: ((Z = S.value) == null ? void 0 : Z.displayName) || ((f = t.initialValue) == null ? void 0 : f.name) || "",
|
|
1116
1115
|
posUser: o.posUser
|
|
1117
1116
|
};
|
|
1118
1117
|
}
|
|
1119
1118
|
function re() {
|
|
1120
1119
|
var o;
|
|
1121
|
-
return
|
|
1120
|
+
return u.value ? ((o = r.value) == null ? void 0 : o.readDetails()) ?? null : null;
|
|
1122
1121
|
}
|
|
1123
|
-
const se =
|
|
1122
|
+
const se = c();
|
|
1124
1123
|
async function C() {
|
|
1125
1124
|
return (await se.value.validateInputsWithoutSubmit()).length ? null : Y();
|
|
1126
1125
|
}
|
|
1127
1126
|
return ue(
|
|
1128
|
-
() =>
|
|
1129
|
-
(o,
|
|
1130
|
-
(!
|
|
1127
|
+
() => t.initialValue,
|
|
1128
|
+
(o, w) => {
|
|
1129
|
+
(!w || !o || w.id !== o.id) && (S.value = void 0), (!w || !o || w.id !== o.id || X(w)) && G(o);
|
|
1131
1130
|
}
|
|
1132
|
-
),
|
|
1131
|
+
), E({
|
|
1133
1132
|
readFormData: Y,
|
|
1134
1133
|
readDetails: re,
|
|
1135
1134
|
readEdits: h,
|
|
1136
1135
|
validate: C,
|
|
1137
|
-
isModified:
|
|
1136
|
+
isModified: U,
|
|
1138
1137
|
/** Add stays disabled while the sign-in key belongs to someone already (AC4). */
|
|
1139
|
-
hasExisting:
|
|
1138
|
+
hasExisting: I(() => {
|
|
1140
1139
|
var o;
|
|
1141
1140
|
return !!((o = r.value) != null && o.hasExisting);
|
|
1142
1141
|
}),
|
|
1143
|
-
providerLabel:
|
|
1142
|
+
providerLabel: I(() => {
|
|
1144
1143
|
var o;
|
|
1145
1144
|
return ((o = r.value) == null ? void 0 : o.providerLabel) ?? "";
|
|
1146
1145
|
})
|
|
1147
|
-
}), (o,
|
|
1146
|
+
}), (o, w) => {
|
|
1148
1147
|
const z = K("FmTextField"), ne = K("FmPhoneNumber"), Z = K("FmForm");
|
|
1149
|
-
return
|
|
1148
|
+
return i(), q(Z, {
|
|
1150
1149
|
ref_key: "formRef",
|
|
1151
1150
|
ref: se,
|
|
1152
1151
|
class: "mx-4"
|
|
1153
1152
|
}, {
|
|
1154
1153
|
default: te(() => {
|
|
1155
|
-
var
|
|
1154
|
+
var f;
|
|
1156
1155
|
return [
|
|
1157
|
-
|
|
1158
|
-
|
|
1156
|
+
p("div", Xa, [
|
|
1157
|
+
u.value ? (i(), q(Qs, {
|
|
1159
1158
|
key: 0,
|
|
1160
1159
|
ref_key: "detailsRef",
|
|
1161
1160
|
ref: r,
|
|
1162
1161
|
providers: l.providers,
|
|
1163
|
-
onUpdateExisting:
|
|
1164
|
-
}, null, 8, ["providers"])) : l.initialValue ? (
|
|
1162
|
+
onUpdateExisting: w[0] || (w[0] = (A) => g("update-existing", A))
|
|
1163
|
+
}, null, 8, ["providers"])) : l.initialValue ? (i(), q(ia, {
|
|
1165
1164
|
key: 2,
|
|
1166
1165
|
name: l.initialValue.name,
|
|
1167
1166
|
status: l.initialValue.status ?? "active",
|
|
@@ -1169,68 +1168,68 @@ const Rs = {
|
|
|
1169
1168
|
"phone-number": l.initialValue.phoneNumber
|
|
1170
1169
|
}, {
|
|
1171
1170
|
default: te(() => [
|
|
1172
|
-
|
|
1173
|
-
|
|
1171
|
+
_.value ? (i(), M("div", Ja, [
|
|
1172
|
+
V.value ? (i(), q(z, {
|
|
1174
1173
|
key: 0,
|
|
1175
1174
|
modelValue: F.value,
|
|
1176
|
-
"onUpdate:modelValue":
|
|
1177
|
-
label:
|
|
1178
|
-
placeholder:
|
|
1175
|
+
"onUpdate:modelValue": w[2] || (w[2] = (A) => F.value = A),
|
|
1176
|
+
label: s(j)("team.memberDetails.name"),
|
|
1177
|
+
placeholder: s(j)("team.memberDetails.namePlaceholder"),
|
|
1179
1178
|
rules: [
|
|
1180
|
-
(
|
|
1181
|
-
(
|
|
1179
|
+
(A) => !!A.trim() || s(j)("team.memberDetails.errors.nameRequired"),
|
|
1180
|
+
(A) => A.trim().length <= s(Et) || s(j)("team.memberDetails.errors.nameTooLong")
|
|
1182
1181
|
]
|
|
1183
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) :
|
|
1184
|
-
|
|
1182
|
+
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : O("", !0),
|
|
1183
|
+
m(z, {
|
|
1185
1184
|
modelValue: T.value,
|
|
1186
|
-
"onUpdate:modelValue":
|
|
1187
|
-
label:
|
|
1185
|
+
"onUpdate:modelValue": w[3] || (w[3] = (A) => T.value = A),
|
|
1186
|
+
label: s(j)("team.memberDetails.employeeId"),
|
|
1188
1187
|
"label-mark": "optional",
|
|
1189
|
-
placeholder:
|
|
1188
|
+
placeholder: s(j)("team.memberDetails.employeeIdPlaceholder"),
|
|
1190
1189
|
rules: [
|
|
1191
|
-
(
|
|
1190
|
+
(A) => A.trim().length <= s(At) || s(j)("team.memberDetails.errors.employeeIdTooLong")
|
|
1192
1191
|
]
|
|
1193
1192
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"]),
|
|
1194
|
-
|
|
1195
|
-
l.initialValue.match === "mobile" ? (
|
|
1193
|
+
V.value ? (i(), M(de, { key: 1 }, [
|
|
1194
|
+
l.initialValue.match === "mobile" ? (i(), q(z, {
|
|
1196
1195
|
key: 0,
|
|
1197
1196
|
modelValue: P.value,
|
|
1198
|
-
"onUpdate:modelValue":
|
|
1199
|
-
label:
|
|
1197
|
+
"onUpdate:modelValue": w[4] || (w[4] = (A) => P.value = A),
|
|
1198
|
+
label: s(j)("team.memberDetails.emailAddress"),
|
|
1200
1199
|
"label-mark": "optional",
|
|
1201
|
-
placeholder:
|
|
1200
|
+
placeholder: s(j)("team.memberDetails.emailPlaceholder"),
|
|
1202
1201
|
rules: [
|
|
1203
|
-
(
|
|
1202
|
+
(A) => !A.trim() || s(He)(A) || s(j)("team.memberDetails.errors.emailInvalid")
|
|
1204
1203
|
]
|
|
1205
|
-
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) :
|
|
1204
|
+
}, null, 8, ["modelValue", "label", "placeholder", "rules"])) : s(x) ? (i(), q(ne, {
|
|
1206
1205
|
key: 1,
|
|
1207
1206
|
modelValue: P.value,
|
|
1208
|
-
"onUpdate:modelValue":
|
|
1209
|
-
label:
|
|
1207
|
+
"onUpdate:modelValue": w[5] || (w[5] = (A) => P.value = A),
|
|
1208
|
+
label: s(j)("team.memberDetails.phoneNumber"),
|
|
1210
1209
|
"label-mark": "optional",
|
|
1211
|
-
"default-country":
|
|
1212
|
-
"extra-country-codes":
|
|
1210
|
+
"default-country": L.value,
|
|
1211
|
+
"extra-country-codes": s(W),
|
|
1213
1212
|
rules: [
|
|
1214
|
-
(
|
|
1213
|
+
(A) => !s(Te)(A) || !!s(Me)(A) || s(j)("team.memberDetails.errors.mobileInvalid")
|
|
1215
1214
|
]
|
|
1216
|
-
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) :
|
|
1217
|
-
], 64)) :
|
|
1218
|
-
])) :
|
|
1215
|
+
}, null, 8, ["modelValue", "label", "default-country", "extra-country-codes", "rules"])) : O("", !0)
|
|
1216
|
+
], 64)) : O("", !0)
|
|
1217
|
+
])) : O("", !0)
|
|
1219
1218
|
]),
|
|
1220
1219
|
_: 1
|
|
1221
|
-
}, 8, ["name", "status", "email", "phone-number"])) : (
|
|
1222
|
-
|
|
1223
|
-
onInvite:
|
|
1220
|
+
}, 8, ["name", "status", "email", "phone-number"])) : (i(), M("div", Ya, [
|
|
1221
|
+
m(Ha, {
|
|
1222
|
+
onInvite: w[1] || (w[1] = (A) => $(A))
|
|
1224
1223
|
})
|
|
1225
1224
|
])),
|
|
1226
|
-
|
|
1225
|
+
u.value || S.value || l.initialValue ? (i(), q(Oa, {
|
|
1227
1226
|
key: 3,
|
|
1228
1227
|
ref_key: "grantFieldsRef",
|
|
1229
|
-
ref:
|
|
1228
|
+
ref: b,
|
|
1230
1229
|
"initial-value": l.initialValue,
|
|
1231
|
-
"fallback-name": ((
|
|
1230
|
+
"fallback-name": ((f = S.value) == null ? void 0 : f.displayName) || "",
|
|
1232
1231
|
loading: l.loading
|
|
1233
|
-
}, null, 8, ["initial-value", "fallback-name", "loading"])) :
|
|
1232
|
+
}, null, 8, ["initial-value", "fallback-name", "loading"])) : O("", !0)
|
|
1234
1233
|
])
|
|
1235
1234
|
];
|
|
1236
1235
|
}),
|
|
@@ -1267,153 +1266,153 @@ var ae = /* @__PURE__ */ function(l) {
|
|
|
1267
1266
|
const Rl = /* @__PURE__ */ oe({
|
|
1268
1267
|
__name: "TeamMemberList",
|
|
1269
1268
|
setup(l, {
|
|
1270
|
-
expose:
|
|
1269
|
+
expose: E
|
|
1271
1270
|
}) {
|
|
1272
1271
|
const {
|
|
1273
|
-
fetchCustomReportPermissions:
|
|
1272
|
+
fetchCustomReportPermissions: v
|
|
1274
1273
|
} = Lt();
|
|
1275
1274
|
Xe();
|
|
1276
1275
|
const {
|
|
1277
|
-
t
|
|
1278
|
-
} = ce(),
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
} =
|
|
1286
|
-
ue(
|
|
1287
|
-
if (e.length > 0 &&
|
|
1288
|
-
const a = new Map(e.map((k) => [k._id, k.profile.name])),
|
|
1289
|
-
|
|
1276
|
+
t
|
|
1277
|
+
} = ce(), {
|
|
1278
|
+
providers: g,
|
|
1279
|
+
hasProviders: u,
|
|
1280
|
+
canInvite: j,
|
|
1281
|
+
providerLabel: B
|
|
1282
|
+
} = xs(), W = I(() => j.value ? g.value : []), x = $t(), {
|
|
1283
|
+
isFoodCourt: L
|
|
1284
|
+
} = x, V = Tt(), _ = jt(), F = ot(), T = Nt(F), P = Ot(), G = Is(), h = c(!0), d = c(!1), S = I(() => V.isLoading.value), b = c([]), r = c(0), U = c(1), $ = c(""), X = c("");
|
|
1285
|
+
ue(V.restaurants, (e) => {
|
|
1286
|
+
if (e.length > 0 && b.value.length > 0) {
|
|
1287
|
+
const a = new Map(e.map((k) => [k._id, k.profile.name])), y = e.map((k) => k.profile.name).sort();
|
|
1288
|
+
b.value = b.value.map((k) => ({
|
|
1290
1289
|
...k,
|
|
1291
|
-
restaurants: k.managableRestaurantIds === null ?
|
|
1290
|
+
restaurants: k.managableRestaurantIds === null ? y : k.managableRestaurantIds.map((H) => a.get(H) ?? "").filter(Boolean).sort()
|
|
1292
1291
|
}));
|
|
1293
1292
|
}
|
|
1294
1293
|
});
|
|
1295
|
-
const Y =
|
|
1296
|
-
label:
|
|
1294
|
+
const Y = I(() => [{
|
|
1295
|
+
label: t("team.filter.unassigned_label"),
|
|
1297
1296
|
value: je
|
|
1298
|
-
}, ...
|
|
1297
|
+
}, ...V.restaurants.value.map((e) => ({
|
|
1299
1298
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
1300
1299
|
value: e._id
|
|
1301
1300
|
}))]), re = ({
|
|
1302
1301
|
member: e,
|
|
1303
1302
|
className: a = ""
|
|
1304
1303
|
}) => {
|
|
1305
|
-
const
|
|
1306
|
-
label:
|
|
1304
|
+
const y = {
|
|
1305
|
+
label: t("team.actions.updateMember"),
|
|
1307
1306
|
onClick: () => n(Ae.Update, e)
|
|
1308
1307
|
}, k = {
|
|
1309
|
-
label:
|
|
1308
|
+
label: t("team.actions.removeMember"),
|
|
1310
1309
|
onClick: () => n(Ae.Remove, e),
|
|
1311
1310
|
itemClass: "text-fm-color-typo-error"
|
|
1312
1311
|
};
|
|
1313
1312
|
if (e.status === "invited") {
|
|
1314
1313
|
const le = {
|
|
1315
|
-
label:
|
|
1314
|
+
label: t("team.staffInvite.actions.resend"),
|
|
1316
1315
|
onClick: () => Gt(e)
|
|
1317
1316
|
}, Ne = {
|
|
1318
|
-
label:
|
|
1317
|
+
label: t("team.staffInvite.actions.revoke"),
|
|
1319
1318
|
onClick: () => qt(e),
|
|
1320
1319
|
itemClass: "text-fm-color-typo-error"
|
|
1321
1320
|
};
|
|
1322
|
-
return
|
|
1321
|
+
return m(bt, {
|
|
1323
1322
|
class: a,
|
|
1324
|
-
items: [
|
|
1323
|
+
items: [y, le, Ne]
|
|
1325
1324
|
}, null);
|
|
1326
1325
|
}
|
|
1327
|
-
const H = e.doc.isOwner ? [
|
|
1328
|
-
return
|
|
1326
|
+
const H = e.doc.isOwner ? [y] : [y, k];
|
|
1327
|
+
return m(bt, {
|
|
1329
1328
|
class: a,
|
|
1330
1329
|
items: H
|
|
1331
1330
|
}, null);
|
|
1332
1331
|
}, se = (e) => {
|
|
1333
|
-
if (e.doc.isOwner) return
|
|
1334
|
-
const a = e.restaurants.slice(0, ul),
|
|
1335
|
-
return
|
|
1332
|
+
if (e.doc.isOwner) return t("team.labels.businessOwner");
|
|
1333
|
+
const a = e.restaurants.slice(0, ul), y = e.restaurants.length - a.length;
|
|
1334
|
+
return m("div", {
|
|
1336
1335
|
class: "flex flex-col gap-4 py-4"
|
|
1337
|
-
}, [a.map((k) =>
|
|
1336
|
+
}, [a.map((k) => m("span", {
|
|
1338
1337
|
class: "truncate"
|
|
1339
|
-
}, [k])),
|
|
1338
|
+
}, [k])), y > 0 && m("span", {
|
|
1340
1339
|
class: "text-fm-color-primary"
|
|
1341
|
-
}, [
|
|
1342
|
-
count:
|
|
1340
|
+
}, [t("team.labels.moreRestaurants", {
|
|
1341
|
+
count: y
|
|
1343
1342
|
})])]);
|
|
1344
1343
|
}, C = (e) => e.phoneNumber || e.email, o = [{
|
|
1345
1344
|
accessorKey: "name",
|
|
1346
|
-
header: () =>
|
|
1345
|
+
header: () => t("team.table.columns.name"),
|
|
1347
1346
|
enableSorting: !1,
|
|
1348
1347
|
cell(e) {
|
|
1349
1348
|
const a = e.row.original;
|
|
1350
|
-
return
|
|
1349
|
+
return m("div", {
|
|
1351
1350
|
class: "flex items-center gap-8"
|
|
1352
|
-
}, [
|
|
1351
|
+
}, [m(Ze.FmAvatar, {
|
|
1353
1352
|
name: a.name,
|
|
1354
1353
|
initials: nt(a.name),
|
|
1355
1354
|
size: "sm",
|
|
1356
1355
|
class: "shrink-0"
|
|
1357
|
-
}, null),
|
|
1356
|
+
}, null), m("span", {
|
|
1358
1357
|
class: "truncate"
|
|
1359
1358
|
}, [a.name])]);
|
|
1360
1359
|
}
|
|
1361
1360
|
}, {
|
|
1362
1361
|
accessorKey: "phoneNumber",
|
|
1363
|
-
header: () =>
|
|
1362
|
+
header: () => t("team.table.columns.phoneNumber"),
|
|
1364
1363
|
enableSorting: !1,
|
|
1365
1364
|
cell(e) {
|
|
1366
1365
|
const a = e.row.original;
|
|
1367
|
-
return
|
|
1366
|
+
return m("div", {
|
|
1368
1367
|
class: "flex min-w-0 items-center gap-8"
|
|
1369
|
-
}, [
|
|
1368
|
+
}, [m("span", {
|
|
1370
1369
|
class: "truncate"
|
|
1371
|
-
}, [C(a)]), a.loginMethod === "sso" &&
|
|
1370
|
+
}, [C(a)]), a.loginMethod === "sso" && m("span", {
|
|
1372
1371
|
class: "shrink-0 rounded-[4px] bg-fm-color-neutral-gray-100 px-4 py-[2px] text-[10px] font-medium leading-[14px] text-fm-color-typo-secondary"
|
|
1373
|
-
}, [
|
|
1372
|
+
}, [t("team.labels.sso")])]);
|
|
1374
1373
|
}
|
|
1375
|
-
}, ...
|
|
1374
|
+
}, ...L.value ? [] : [{
|
|
1376
1375
|
accessorKey: "restaurant",
|
|
1377
|
-
header: () =>
|
|
1376
|
+
header: () => t("team.table.columns.restaurant"),
|
|
1378
1377
|
enableSorting: !1,
|
|
1379
1378
|
cell(e) {
|
|
1380
|
-
if (
|
|
1379
|
+
if (S.value)
|
|
1381
1380
|
return as(ps);
|
|
1382
1381
|
const a = e.row.original;
|
|
1383
1382
|
return se(a);
|
|
1384
1383
|
}
|
|
1385
1384
|
}], {
|
|
1386
1385
|
accessorKey: "assignedRoles",
|
|
1387
|
-
header: () =>
|
|
1386
|
+
header: () => t("team.table.columns.assignedRoles"),
|
|
1388
1387
|
enableSorting: !1,
|
|
1389
1388
|
cell(e) {
|
|
1390
|
-
const a = e.row.original,
|
|
1389
|
+
const a = e.row.original, y = G.getPermissionAssignmentByUserId(a.id), k = (y == null ? void 0 : y.permissionSetIds) || a.doc.permissionSetIds || [];
|
|
1391
1390
|
return P.permissionSets.value.filter((le) => k.includes(le.id)).map((le) => le.name).join(", ");
|
|
1392
1391
|
}
|
|
1393
1392
|
}, {
|
|
1394
1393
|
accessorKey: "permission",
|
|
1395
|
-
header: () =>
|
|
1394
|
+
header: () => t("team.table.columns.permission"),
|
|
1396
1395
|
enableSorting: !1,
|
|
1397
1396
|
cell(e) {
|
|
1398
1397
|
const a = e.row.original;
|
|
1399
|
-
return
|
|
1398
|
+
return w(a);
|
|
1400
1399
|
},
|
|
1401
1400
|
meta: {
|
|
1402
1401
|
width: "200px"
|
|
1403
1402
|
}
|
|
1404
1403
|
}, {
|
|
1405
1404
|
accessorKey: "posAccess",
|
|
1406
|
-
header: () =>
|
|
1405
|
+
header: () => t("team.table.columns.posAccess"),
|
|
1407
1406
|
enableSorting: !1,
|
|
1408
1407
|
cell(e) {
|
|
1409
|
-
return e.row.original.doc.hasPosUser ?
|
|
1408
|
+
return e.row.original.doc.hasPosUser ? t("team.labels.yes") : t("team.labels.no");
|
|
1410
1409
|
}
|
|
1411
1410
|
}, {
|
|
1412
1411
|
accessorKey: "status",
|
|
1413
|
-
header: () =>
|
|
1412
|
+
header: () => t("team.table.columns.status"),
|
|
1414
1413
|
enableSorting: !1,
|
|
1415
1414
|
cell(e) {
|
|
1416
|
-
return
|
|
1415
|
+
return m(it, {
|
|
1417
1416
|
status: e.row.original.status
|
|
1418
1417
|
}, null);
|
|
1419
1418
|
}
|
|
@@ -1432,35 +1431,35 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1432
1431
|
},
|
|
1433
1432
|
enableSorting: !1
|
|
1434
1433
|
}];
|
|
1435
|
-
function
|
|
1434
|
+
function w(e) {
|
|
1436
1435
|
if (e.doc.isOwner)
|
|
1437
|
-
return
|
|
1438
|
-
const a =
|
|
1436
|
+
return t("team.labels.businessOwner");
|
|
1437
|
+
const a = m(Ze.FmTooltip, {
|
|
1439
1438
|
variant: "plain",
|
|
1440
1439
|
placement: "top"
|
|
1441
1440
|
}, {
|
|
1442
|
-
default: () =>
|
|
1441
|
+
default: () => m(Ze.FmIcon, {
|
|
1443
1442
|
name: "info",
|
|
1444
1443
|
class: "cursor-pointer text-fm-color-neutral-gray-300"
|
|
1445
1444
|
}, null),
|
|
1446
|
-
content: () =>
|
|
1445
|
+
content: () => m("div", null, [t("team.labels.permission"), e.permissionLabels.map((y) => m("div", null, [ls("- "), y]))])
|
|
1447
1446
|
});
|
|
1448
|
-
return
|
|
1447
|
+
return m("div", {
|
|
1449
1448
|
class: "flex flex-row items-center gap-8"
|
|
1450
|
-
}, [
|
|
1449
|
+
}, [m("span", null, [t("team.labels.allowed", {
|
|
1451
1450
|
count: e.permissionLabels.length
|
|
1452
1451
|
})]), e.permissionLabels.length > 0 && a]);
|
|
1453
1452
|
}
|
|
1454
1453
|
function z(e) {
|
|
1455
1454
|
var H, le, Ne, D;
|
|
1456
|
-
const a = G.getPermissionAssignmentByUserId(e.id),
|
|
1455
|
+
const a = G.getPermissionAssignmentByUserId(e.id), y = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [], k = (a == null ? void 0 : a.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
1457
1456
|
return {
|
|
1458
1457
|
id: e.id,
|
|
1459
1458
|
isOwner: e.doc.isOwner,
|
|
1460
1459
|
name: e.name,
|
|
1461
1460
|
phoneNumber: e.phoneNumber,
|
|
1462
1461
|
email: e.email,
|
|
1463
|
-
permissions:
|
|
1462
|
+
permissions: y,
|
|
1464
1463
|
permissionSetIds: k,
|
|
1465
1464
|
posUser: e.doc.posUser ? {
|
|
1466
1465
|
code: ((H = e.doc.posUser) == null ? void 0 : H.code) ?? "",
|
|
@@ -1474,14 +1473,14 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1474
1473
|
};
|
|
1475
1474
|
}
|
|
1476
1475
|
function ne(e) {
|
|
1477
|
-
const a = G.getPermissionAssignmentByUserId(e.id),
|
|
1476
|
+
const a = G.getPermissionAssignmentByUserId(e.id), y = (a == null ? void 0 : a.customPermissions) ?? e.permissions ?? [], k = (a == null ? void 0 : a.permissionSetIds) ?? e.doc.permissionSetIds ?? [];
|
|
1478
1477
|
return {
|
|
1479
1478
|
id: e.id,
|
|
1480
1479
|
isOwner: e.doc.isOwner,
|
|
1481
1480
|
name: e.name,
|
|
1482
1481
|
phoneNumber: e.phoneNumber,
|
|
1483
1482
|
email: e.email,
|
|
1484
|
-
permissions:
|
|
1483
|
+
permissions: y,
|
|
1485
1484
|
permissionSetIds: k,
|
|
1486
1485
|
posUser: void 0,
|
|
1487
1486
|
posUserId: e.doc.posUserId,
|
|
@@ -1490,13 +1489,13 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1490
1489
|
};
|
|
1491
1490
|
}
|
|
1492
1491
|
function Z(e) {
|
|
1493
|
-
var a,
|
|
1492
|
+
var a, y, k, H;
|
|
1494
1493
|
return {
|
|
1495
1494
|
id: e._id,
|
|
1496
1495
|
isOwner: !1,
|
|
1497
1496
|
name: e.displayName || e.mobile || e.email || "",
|
|
1498
1497
|
phoneNumber: e.mobile ?? ((a = e.contact) == null ? void 0 : a.mobile) ?? "",
|
|
1499
|
-
email: e.email ?? ((
|
|
1498
|
+
email: e.email ?? ((y = e.contact) == null ? void 0 : y.email) ?? "",
|
|
1500
1499
|
// Saved overrides on top of the roles, as for a member's assignment
|
|
1501
1500
|
permissions: e.grant.customPermissions,
|
|
1502
1501
|
permissionSetIds: e.grant.permissionSetIds,
|
|
@@ -1508,45 +1507,45 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1508
1507
|
contact: (e.match === "mobile" ? (k = e.contact) == null ? void 0 : k.email : (H = e.contact) == null ? void 0 : H.mobile) ?? ""
|
|
1509
1508
|
};
|
|
1510
1509
|
}
|
|
1511
|
-
const
|
|
1512
|
-
function
|
|
1510
|
+
const f = c(null);
|
|
1511
|
+
function A(e) {
|
|
1513
1512
|
return {
|
|
1514
|
-
label:
|
|
1513
|
+
label: B(e.provider),
|
|
1515
1514
|
match: e.match
|
|
1516
1515
|
};
|
|
1517
1516
|
}
|
|
1518
1517
|
async function ge(e) {
|
|
1519
1518
|
const a = ++ee;
|
|
1520
1519
|
try {
|
|
1521
|
-
const
|
|
1520
|
+
const y = typeof e == "string" ? (await Oe.readInvites()).find((k) => k._id === e) : e;
|
|
1522
1521
|
if (a !== ee) return;
|
|
1523
|
-
if (!
|
|
1522
|
+
if (!y) {
|
|
1524
1523
|
F.open({
|
|
1525
1524
|
type: "error",
|
|
1526
|
-
title:
|
|
1525
|
+
title: t("team.staffInvite.errors.not_pending")
|
|
1527
1526
|
}), await Se();
|
|
1528
1527
|
return;
|
|
1529
1528
|
}
|
|
1530
|
-
|
|
1529
|
+
f.value = y, Q.value = Z(y), J.value = ae.UPDATE;
|
|
1531
1530
|
} catch {
|
|
1532
1531
|
if (a !== ee) return;
|
|
1533
1532
|
F.open({
|
|
1534
|
-
message:
|
|
1533
|
+
message: t("common.error"),
|
|
1535
1534
|
type: "error"
|
|
1536
1535
|
});
|
|
1537
1536
|
}
|
|
1538
1537
|
}
|
|
1539
1538
|
async function Be(e) {
|
|
1540
1539
|
const a = ++ee;
|
|
1541
|
-
|
|
1540
|
+
f.value = null, Q.value = ne(e), J.value = ae.UPDATE, he.value = e.doc.hasPosUser === !0;
|
|
1542
1541
|
try {
|
|
1543
|
-
const
|
|
1542
|
+
const y = await Fe.readTeamMember(e.id);
|
|
1544
1543
|
if (a !== ee) return;
|
|
1545
|
-
Q.value = z(
|
|
1544
|
+
Q.value = z(y);
|
|
1546
1545
|
} catch {
|
|
1547
1546
|
if (a !== ee) return;
|
|
1548
1547
|
F.open({
|
|
1549
|
-
message:
|
|
1548
|
+
message: t("common.error"),
|
|
1550
1549
|
type: "error"
|
|
1551
1550
|
}), $e();
|
|
1552
1551
|
} finally {
|
|
@@ -1560,23 +1559,23 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1560
1559
|
}
|
|
1561
1560
|
const a = ++ee;
|
|
1562
1561
|
try {
|
|
1563
|
-
const
|
|
1562
|
+
const y = await Fe.readTeamMember(e.id);
|
|
1564
1563
|
if (a !== ee) return;
|
|
1565
|
-
await Be(
|
|
1564
|
+
await Be(y);
|
|
1566
1565
|
} catch {
|
|
1567
1566
|
F.open({
|
|
1568
|
-
message:
|
|
1567
|
+
message: t("common.error"),
|
|
1569
1568
|
type: "error"
|
|
1570
1569
|
});
|
|
1571
1570
|
}
|
|
1572
1571
|
}
|
|
1573
|
-
const he =
|
|
1572
|
+
const he = c(!1);
|
|
1574
1573
|
let ee = 0;
|
|
1575
1574
|
const n = async (e, a) => {
|
|
1576
1575
|
e == Ae.Update && (a.status === "invited" ? await ge(a.id) : await Be(a)), e == Ae.Remove && Bt(a);
|
|
1577
|
-
}, R = Ct(), J =
|
|
1576
|
+
}, R = Ct(), J = c(ae.CLOSED), pe = I(() => J.value !== ae.CLOSED), xe = I(() => J.value === ae.ADD ? t("common.add") : t("common.update")), ve = I(() => J.value === ae.ADD ? t("team.actions.addMember") : t("team.actions.updateMember")), Q = c();
|
|
1578
1577
|
function _e() {
|
|
1579
|
-
ee++, he.value = !1,
|
|
1578
|
+
ee++, he.value = !1, f.value = null, J.value = ae.CLOSED;
|
|
1580
1579
|
}
|
|
1581
1580
|
const Re = vs(() => {
|
|
1582
1581
|
var e;
|
|
@@ -1592,8 +1591,8 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1592
1591
|
breakpoints: Ue
|
|
1593
1592
|
} = Dt(), Bt = (e) => {
|
|
1594
1593
|
R.open({
|
|
1595
|
-
title:
|
|
1596
|
-
message:
|
|
1594
|
+
title: t("team.actions.removeMember"),
|
|
1595
|
+
message: t("team.removeMember.confirmationMessage", {
|
|
1597
1596
|
memberName: e.name
|
|
1598
1597
|
}),
|
|
1599
1598
|
minWidth: Ue.value.lg ? 588 : 0,
|
|
@@ -1612,7 +1611,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1612
1611
|
await Fe.deleteTeamMember(e.id), await Se();
|
|
1613
1612
|
}, {
|
|
1614
1613
|
isLoading: Ve,
|
|
1615
|
-
successMessage:
|
|
1614
|
+
successMessage: t("team.removeMember.successMessage", {
|
|
1616
1615
|
memberName: e.name
|
|
1617
1616
|
})
|
|
1618
1617
|
}), R.close());
|
|
@@ -1620,19 +1619,19 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1620
1619
|
};
|
|
1621
1620
|
function qt(e) {
|
|
1622
1621
|
R.open({
|
|
1623
|
-
title:
|
|
1624
|
-
message:
|
|
1622
|
+
title: t("team.staffInvite.revoke.title"),
|
|
1623
|
+
message: t("team.staffInvite.revoke.message", {
|
|
1625
1624
|
name: e.name
|
|
1626
1625
|
}),
|
|
1627
1626
|
minWidth: Ue.value.lg ? 588 : 0,
|
|
1628
1627
|
primaryActions: {
|
|
1629
|
-
text:
|
|
1628
|
+
text: t("team.staffInvite.actions.revoke"),
|
|
1630
1629
|
close: !1,
|
|
1631
1630
|
variant: "destructive",
|
|
1632
1631
|
isLoading: Ve
|
|
1633
1632
|
},
|
|
1634
1633
|
secondaryActions: {
|
|
1635
|
-
text:
|
|
1634
|
+
text: t("common.cancel"),
|
|
1636
1635
|
close: !0
|
|
1637
1636
|
}
|
|
1638
1637
|
}).onPrimary(async () => {
|
|
@@ -1641,7 +1640,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1641
1640
|
try {
|
|
1642
1641
|
await Oe.revokeInvite(e.id), F.open({
|
|
1643
1642
|
type: "success",
|
|
1644
|
-
title:
|
|
1643
|
+
title: t("team.staffInvite.revoke.successMessage")
|
|
1645
1644
|
});
|
|
1646
1645
|
} catch (a) {
|
|
1647
1646
|
F.open({
|
|
@@ -1649,7 +1648,7 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1649
1648
|
title: ze(a, {
|
|
1650
1649
|
label: "",
|
|
1651
1650
|
match: "mobile"
|
|
1652
|
-
},
|
|
1651
|
+
}, t)
|
|
1653
1652
|
});
|
|
1654
1653
|
} finally {
|
|
1655
1654
|
Ve.value = !1, R.close(), await Se();
|
|
@@ -1658,20 +1657,20 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1658
1657
|
});
|
|
1659
1658
|
}
|
|
1660
1659
|
async function Gt(e) {
|
|
1661
|
-
var
|
|
1660
|
+
var y;
|
|
1662
1661
|
const a = {
|
|
1663
|
-
label: ((
|
|
1662
|
+
label: ((y = g.value[0]) == null ? void 0 : y.label) ?? "",
|
|
1664
1663
|
match: e.phoneNumber ? "mobile" : "email"
|
|
1665
1664
|
};
|
|
1666
1665
|
try {
|
|
1667
1666
|
const k = await Oe.resendInvite(e.id);
|
|
1668
1667
|
k.warnings.length === 0 && F.open({
|
|
1669
1668
|
type: "success",
|
|
1670
|
-
title:
|
|
1669
|
+
title: t("team.staffInvite.resend.sent", {
|
|
1671
1670
|
label: a.label
|
|
1672
1671
|
})
|
|
1673
1672
|
});
|
|
1674
|
-
for (const H of yt(k.warnings, a,
|
|
1673
|
+
for (const H of yt(k.warnings, a, t))
|
|
1675
1674
|
F.open({
|
|
1676
1675
|
type: "warning",
|
|
1677
1676
|
message: H,
|
|
@@ -1680,82 +1679,82 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1680
1679
|
} catch (k) {
|
|
1681
1680
|
F.open({
|
|
1682
1681
|
type: "error",
|
|
1683
|
-
title: ze(k, a,
|
|
1682
|
+
title: ze(k, a, t)
|
|
1684
1683
|
}), gt(k) && await Se();
|
|
1685
1684
|
}
|
|
1686
1685
|
}
|
|
1687
1686
|
const Kt = () => {
|
|
1688
|
-
|
|
1689
|
-
}, Ce =
|
|
1690
|
-
label:
|
|
1687
|
+
f.value = null, Q.value = null, J.value = ae.ADD;
|
|
1688
|
+
}, Ce = c(), Ie = c(), De = c(), we = c(), ke = c(), ut = I(() => [{
|
|
1689
|
+
label: t("team.status.active"),
|
|
1691
1690
|
value: "active"
|
|
1692
1691
|
}, {
|
|
1693
|
-
label:
|
|
1692
|
+
label: t("team.status.invited"),
|
|
1694
1693
|
value: "invited"
|
|
1695
|
-
}]), Wt =
|
|
1694
|
+
}]), Wt = I(() => {
|
|
1696
1695
|
var a;
|
|
1697
|
-
const e = (a =
|
|
1698
|
-
return e ? /\bSSO\b/i.test(e) ? e :
|
|
1696
|
+
const e = (a = g.value[0]) == null ? void 0 : a.label;
|
|
1697
|
+
return e ? /\bSSO\b/i.test(e) ? e : t("team.loginMethod.ssoProvider", {
|
|
1699
1698
|
label: e
|
|
1700
|
-
}) :
|
|
1701
|
-
}), mt =
|
|
1699
|
+
}) : t("team.loginMethod.sso");
|
|
1700
|
+
}), mt = I(() => [{
|
|
1702
1701
|
label: Wt.value,
|
|
1703
1702
|
value: "sso"
|
|
1704
1703
|
}, {
|
|
1705
|
-
label:
|
|
1704
|
+
label: t("team.loginMethod.feedme"),
|
|
1706
1705
|
value: "feedme"
|
|
1707
|
-
}]), dt =
|
|
1708
|
-
businessId:
|
|
1706
|
+
}]), dt = I(() => JSON.stringify({
|
|
1707
|
+
businessId: x.id.value ?? "",
|
|
1709
1708
|
search: X.value.trim(),
|
|
1710
1709
|
restaurantIds: [...Ce.value ?? []].sort(),
|
|
1711
1710
|
permissionSubjects: [...Ie.value ?? []].sort(),
|
|
1712
1711
|
permissionSetIds: [...De.value ?? []].sort(),
|
|
1713
|
-
statuses: [...
|
|
1714
|
-
loginMethods: [...
|
|
1715
|
-
})), ct =
|
|
1712
|
+
statuses: [...we.value ?? []].sort(),
|
|
1713
|
+
loginMethods: [...ke.value ?? []].sort()
|
|
1714
|
+
})), ct = I(() => Object.values(os).map((e) => ({
|
|
1716
1715
|
label: e.label,
|
|
1717
1716
|
value: e.subject
|
|
1718
|
-
}))), pt =
|
|
1719
|
-
label:
|
|
1717
|
+
}))), pt = I(() => [{
|
|
1718
|
+
label: t("team.filter.unassigned_label"),
|
|
1720
1719
|
value: je
|
|
1721
1720
|
}, ...P.permissionSets.value.map((e) => ({
|
|
1722
1721
|
label: e.name,
|
|
1723
1722
|
value: e.id
|
|
1724
1723
|
}))]);
|
|
1725
1724
|
async function zt() {
|
|
1726
|
-
|
|
1725
|
+
L.value || await _.readRoles();
|
|
1727
1726
|
}
|
|
1728
|
-
async function Ke(e =
|
|
1729
|
-
var a,
|
|
1727
|
+
async function Ke(e = U.value) {
|
|
1728
|
+
var a, y, k;
|
|
1730
1729
|
h.value = !0;
|
|
1731
1730
|
try {
|
|
1732
1731
|
const H = await Fe.readTeamMembersPage({
|
|
1733
1732
|
limit: Ee,
|
|
1734
1733
|
offset: (e - 1) * Ee,
|
|
1735
1734
|
search: X.value.trim() || void 0,
|
|
1736
|
-
restaurantIds:
|
|
1735
|
+
restaurantIds: kt(Ce.value),
|
|
1737
1736
|
permissionSubjects: (a = Ie.value) != null && a.length ? Ie.value : void 0,
|
|
1738
|
-
permissionSetIds:
|
|
1739
|
-
statuses: (
|
|
1740
|
-
loginMethods: (k =
|
|
1737
|
+
permissionSetIds: kt(De.value),
|
|
1738
|
+
statuses: (y = we.value) != null && y.length ? we.value : void 0,
|
|
1739
|
+
loginMethods: (k = ke.value) != null && k.length ? ke.value : void 0
|
|
1741
1740
|
});
|
|
1742
|
-
|
|
1741
|
+
b.value = H.items, r.value = H.total;
|
|
1743
1742
|
} finally {
|
|
1744
1743
|
h.value = !1;
|
|
1745
1744
|
}
|
|
1746
1745
|
}
|
|
1747
1746
|
async function Se() {
|
|
1748
|
-
if (!
|
|
1749
|
-
await Ke(
|
|
1747
|
+
if (!x.id.value) return;
|
|
1748
|
+
await Ke(U.value);
|
|
1750
1749
|
const e = Math.max(1, Math.ceil(r.value / Ee));
|
|
1751
|
-
|
|
1750
|
+
U.value > e && (U.value = e, await Ke(U.value));
|
|
1752
1751
|
}
|
|
1753
|
-
const me =
|
|
1752
|
+
const me = c(), fe = c(!1), Ve = c(!1);
|
|
1754
1753
|
async function Ye() {
|
|
1755
1754
|
_e(), await We(), await Se();
|
|
1756
1755
|
}
|
|
1757
1756
|
async function Ht(e) {
|
|
1758
|
-
const a = me.value.readDetails(),
|
|
1757
|
+
const a = me.value.readDetails(), y = A(a);
|
|
1759
1758
|
fe.value = !0;
|
|
1760
1759
|
try {
|
|
1761
1760
|
const k = await Oe.createInvite({
|
|
@@ -1771,12 +1770,12 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1771
1770
|
});
|
|
1772
1771
|
F.open({
|
|
1773
1772
|
type: "success",
|
|
1774
|
-
title:
|
|
1773
|
+
title: t("team.addMember.successMessage", {
|
|
1775
1774
|
memberName: a.displayName
|
|
1776
1775
|
}),
|
|
1777
1776
|
position: Qe.BOTTOM
|
|
1778
1777
|
});
|
|
1779
|
-
for (const H of yt(k.warnings,
|
|
1778
|
+
for (const H of yt(k.warnings, y, t, k.result))
|
|
1780
1779
|
F.open({
|
|
1781
1780
|
type: "warning",
|
|
1782
1781
|
message: H,
|
|
@@ -1786,14 +1785,14 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1786
1785
|
} catch (k) {
|
|
1787
1786
|
F.open({
|
|
1788
1787
|
type: "error",
|
|
1789
|
-
title: ze(k,
|
|
1788
|
+
title: ze(k, y, t)
|
|
1790
1789
|
});
|
|
1791
1790
|
} finally {
|
|
1792
1791
|
fe.value = !1;
|
|
1793
1792
|
}
|
|
1794
1793
|
}
|
|
1795
1794
|
async function Xt(e, a) {
|
|
1796
|
-
const
|
|
1795
|
+
const y = A(e);
|
|
1797
1796
|
fe.value = !0;
|
|
1798
1797
|
try {
|
|
1799
1798
|
await Oe.updateInvite(e._id, _s(e, {
|
|
@@ -1803,14 +1802,14 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1803
1802
|
posUser: a.posUser
|
|
1804
1803
|
}, me.value.readEdits() ?? void 0)), F.open({
|
|
1805
1804
|
type: "success",
|
|
1806
|
-
title:
|
|
1805
|
+
title: t("team.updateMember.successMessage", {
|
|
1807
1806
|
memberName: Q.value.name
|
|
1808
1807
|
})
|
|
1809
1808
|
}), await Ye();
|
|
1810
1809
|
} catch (k) {
|
|
1811
1810
|
F.open({
|
|
1812
1811
|
type: "error",
|
|
1813
|
-
title: ze(k,
|
|
1812
|
+
title: ze(k, y, t)
|
|
1814
1813
|
}), gt(k) && await Ye();
|
|
1815
1814
|
} finally {
|
|
1816
1815
|
fe.value = !1;
|
|
@@ -1821,27 +1820,27 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1821
1820
|
const e = await me.value.validate();
|
|
1822
1821
|
if (!e) return;
|
|
1823
1822
|
const a = J.value === ae.ADD;
|
|
1824
|
-
if (a &&
|
|
1823
|
+
if (a && W.value.length > 0) {
|
|
1825
1824
|
me.value.hasExisting || await Ht(e);
|
|
1826
1825
|
return;
|
|
1827
1826
|
}
|
|
1828
|
-
if (!a &&
|
|
1829
|
-
await Xt(
|
|
1827
|
+
if (!a && f.value) {
|
|
1828
|
+
await Xt(f.value, e);
|
|
1830
1829
|
return;
|
|
1831
1830
|
}
|
|
1832
|
-
const
|
|
1831
|
+
const y = a ? null : me.value.readEdits();
|
|
1833
1832
|
await T.minor(async () => {
|
|
1834
1833
|
await (a ? Fe.createTeamMember(e) : Fe.updateTeamMember(Q.value.id, {
|
|
1835
1834
|
...hs(e, Q.value.posUser),
|
|
1836
1835
|
// '' clears it; the owner's sheet has no field, so it is left out
|
|
1837
|
-
...
|
|
1838
|
-
employeeId:
|
|
1836
|
+
...y ? {
|
|
1837
|
+
employeeId: y.employeeId
|
|
1839
1838
|
} : {}
|
|
1840
1839
|
})), _e(), await We(), await Se();
|
|
1841
1840
|
}, {
|
|
1842
|
-
successMessage: a ?
|
|
1841
|
+
successMessage: a ? t("team.addMember.successMessage", {
|
|
1843
1842
|
memberName: e.name
|
|
1844
|
-
}) :
|
|
1843
|
+
}) : t("team.updateMember.successMessage", {
|
|
1845
1844
|
memberName: e.name
|
|
1846
1845
|
}),
|
|
1847
1846
|
isLoading: fe
|
|
@@ -1857,10 +1856,10 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1857
1856
|
async function Zt({
|
|
1858
1857
|
pageIndex: e
|
|
1859
1858
|
}) {
|
|
1860
|
-
if (
|
|
1861
|
-
Je = !0,
|
|
1859
|
+
if (x.id.value && !Je && !(e === 0 && U.value === 1 && b.value.length > 0)) {
|
|
1860
|
+
Je = !0, U.value = e + 1;
|
|
1862
1861
|
try {
|
|
1863
|
-
await Ke(
|
|
1862
|
+
await Ke(U.value);
|
|
1864
1863
|
} finally {
|
|
1865
1864
|
Je = !1;
|
|
1866
1865
|
}
|
|
@@ -1870,13 +1869,13 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1870
1869
|
X.value = $.value;
|
|
1871
1870
|
});
|
|
1872
1871
|
return Pt(Qt), ue(dt, async () => {
|
|
1873
|
-
|
|
1872
|
+
U.value = 1, d.value = !1, x.id.value && (await Ke(1), d.value = !0);
|
|
1874
1873
|
}, {
|
|
1875
1874
|
immediate: !0
|
|
1876
|
-
}), ue(
|
|
1877
|
-
if (
|
|
1875
|
+
}), ue(x.id, async () => {
|
|
1876
|
+
if (x.id.value)
|
|
1878
1877
|
try {
|
|
1879
|
-
await Promise.all([
|
|
1878
|
+
await Promise.all([L.value ? Promise.resolve() : V.readRestaurants(), Jt(), We(), v(), zt()]);
|
|
1880
1879
|
} catch (e) {
|
|
1881
1880
|
console.error("Failed to load team member dependencies:", e), F.open({
|
|
1882
1881
|
message: e instanceof Error ? e.message : String(e),
|
|
@@ -1885,19 +1884,19 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1885
1884
|
}
|
|
1886
1885
|
}, {
|
|
1887
1886
|
immediate: !0
|
|
1888
|
-
}),
|
|
1887
|
+
}), E({
|
|
1889
1888
|
create: Kt,
|
|
1890
1889
|
refresh: async () => {
|
|
1891
1890
|
await We(), await Se();
|
|
1892
1891
|
}
|
|
1893
1892
|
}), (e, a) => {
|
|
1894
|
-
const
|
|
1895
|
-
return
|
|
1893
|
+
const y = K("FmSearch"), k = K("FmTable"), H = K("FmIcon"), le = K("FmButton"), Ne = K("FmSideSheet");
|
|
1894
|
+
return i(), M(de, null, [p("div", Qa, [p("div", el, [s(Ue).xs ? (i(), M("div", al, [m(y, {
|
|
1896
1895
|
modelValue: $.value,
|
|
1897
1896
|
"onUpdate:modelValue": a[6] || (a[6] = (D) => $.value = D),
|
|
1898
1897
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
1899
|
-
placeholder: t
|
|
1900
|
-
}, null, 8, ["modelValue", "placeholder"]),
|
|
1898
|
+
placeholder: s(t)("team.search.placeholder")
|
|
1899
|
+
}, null, 8, ["modelValue", "placeholder"]), p("div", ll, [s(L) ? O("", !0) : (i(), q(ie, {
|
|
1901
1900
|
key: 0,
|
|
1902
1901
|
modelValue: Ce.value,
|
|
1903
1902
|
"onUpdate:modelValue": a[7] || (a[7] = (D) => Ce.value = D),
|
|
@@ -1905,50 +1904,50 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1905
1904
|
items: Y.value,
|
|
1906
1905
|
variant: "dark",
|
|
1907
1906
|
"chip-icon": "storefront",
|
|
1908
|
-
"selected-prefix": t
|
|
1909
|
-
placeholder: t
|
|
1907
|
+
"selected-prefix": s(t)("team.table.columns.restaurant"),
|
|
1908
|
+
placeholder: s(t)("team.table.columns.restaurant"),
|
|
1910
1909
|
class: "!w-auto"
|
|
1911
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])),
|
|
1910
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])), m(ie, {
|
|
1912
1911
|
modelValue: De.value,
|
|
1913
1912
|
"onUpdate:modelValue": a[8] || (a[8] = (D) => De.value = D),
|
|
1914
1913
|
multiple: "",
|
|
1915
1914
|
variant: "dark",
|
|
1916
1915
|
"chip-icon": "account_circle",
|
|
1917
1916
|
items: pt.value,
|
|
1918
|
-
"selected-prefix": t
|
|
1919
|
-
placeholder: t
|
|
1920
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1917
|
+
"selected-prefix": s(t)("team.filter.selected_assigned_role_prefix"),
|
|
1918
|
+
placeholder: s(t)("team.filter.assigned_role_placeholder")
|
|
1919
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), m(ie, {
|
|
1921
1920
|
modelValue: Ie.value,
|
|
1922
1921
|
"onUpdate:modelValue": a[9] || (a[9] = (D) => Ie.value = D),
|
|
1923
1922
|
multiple: "",
|
|
1924
1923
|
variant: "dark",
|
|
1925
1924
|
"chip-icon": "settings_account_box",
|
|
1926
1925
|
items: ct.value,
|
|
1927
|
-
"selected-prefix": t
|
|
1928
|
-
placeholder: t
|
|
1929
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1926
|
+
"selected-prefix": s(t)("team.filter.selected_permission_prefix"),
|
|
1927
|
+
placeholder: s(t)("team.filter.permission_placeholder")
|
|
1928
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), s(u) ? (i(), M(de, {
|
|
1930
1929
|
key: 1
|
|
1931
|
-
}, [
|
|
1932
|
-
modelValue:
|
|
1933
|
-
"onUpdate:modelValue": a[10] || (a[10] = (D) =>
|
|
1930
|
+
}, [m(ie, {
|
|
1931
|
+
modelValue: we.value,
|
|
1932
|
+
"onUpdate:modelValue": a[10] || (a[10] = (D) => we.value = D),
|
|
1934
1933
|
multiple: "",
|
|
1935
1934
|
variant: "dark",
|
|
1936
1935
|
"chip-icon": "check_circle",
|
|
1937
1936
|
searchable: !1,
|
|
1938
1937
|
items: ut.value,
|
|
1939
|
-
"selected-prefix": t
|
|
1940
|
-
placeholder: t
|
|
1941
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1942
|
-
modelValue:
|
|
1943
|
-
"onUpdate:modelValue": a[11] || (a[11] = (D) =>
|
|
1938
|
+
"selected-prefix": s(t)("team.filter.selected_status_prefix"),
|
|
1939
|
+
placeholder: s(t)("team.filter.status_placeholder")
|
|
1940
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), m(ie, {
|
|
1941
|
+
modelValue: ke.value,
|
|
1942
|
+
"onUpdate:modelValue": a[11] || (a[11] = (D) => ke.value = D),
|
|
1944
1943
|
multiple: "",
|
|
1945
1944
|
variant: "dark",
|
|
1946
1945
|
"chip-icon": "check_circle",
|
|
1947
1946
|
searchable: !1,
|
|
1948
1947
|
items: mt.value,
|
|
1949
|
-
"selected-prefix": t
|
|
1950
|
-
placeholder: t
|
|
1951
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) :
|
|
1948
|
+
"selected-prefix": s(t)("team.filter.selected_login_method_prefix"),
|
|
1949
|
+
placeholder: s(t)("team.filter.login_method_placeholder")
|
|
1950
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) : O("", !0)])])) : (i(), M("div", tl, [p("div", sl, [s(L) ? O("", !0) : (i(), q(ie, {
|
|
1952
1951
|
key: 0,
|
|
1953
1952
|
modelValue: Ce.value,
|
|
1954
1953
|
"onUpdate:modelValue": a[0] || (a[0] = (D) => Ce.value = D),
|
|
@@ -1956,71 +1955,71 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
1956
1955
|
items: Y.value,
|
|
1957
1956
|
variant: "dark",
|
|
1958
1957
|
"chip-icon": "storefront",
|
|
1959
|
-
"selected-prefix": t
|
|
1960
|
-
placeholder: t
|
|
1958
|
+
"selected-prefix": s(t)("team.table.columns.restaurant"),
|
|
1959
|
+
placeholder: s(t)("team.table.columns.restaurant"),
|
|
1961
1960
|
class: "!w-auto"
|
|
1962
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])),
|
|
1961
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])), m(ie, {
|
|
1963
1962
|
modelValue: De.value,
|
|
1964
1963
|
"onUpdate:modelValue": a[1] || (a[1] = (D) => De.value = D),
|
|
1965
1964
|
multiple: "",
|
|
1966
1965
|
variant: "dark",
|
|
1967
1966
|
"chip-icon": "account_circle",
|
|
1968
1967
|
items: pt.value,
|
|
1969
|
-
"selected-prefix": t
|
|
1970
|
-
placeholder: t
|
|
1971
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1968
|
+
"selected-prefix": s(t)("team.filter.selected_assigned_role_prefix"),
|
|
1969
|
+
placeholder: s(t)("team.filter.assigned_role_placeholder")
|
|
1970
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), m(ie, {
|
|
1972
1971
|
modelValue: Ie.value,
|
|
1973
1972
|
"onUpdate:modelValue": a[2] || (a[2] = (D) => Ie.value = D),
|
|
1974
1973
|
multiple: "",
|
|
1975
1974
|
variant: "dark",
|
|
1976
1975
|
"chip-icon": "settings_account_box",
|
|
1977
1976
|
items: ct.value,
|
|
1978
|
-
"selected-prefix": t
|
|
1979
|
-
placeholder: t
|
|
1980
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1977
|
+
"selected-prefix": s(t)("team.filter.selected_permission_prefix"),
|
|
1978
|
+
placeholder: s(t)("team.filter.permission_placeholder")
|
|
1979
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), s(u) ? (i(), M(de, {
|
|
1981
1980
|
key: 1
|
|
1982
|
-
}, [
|
|
1983
|
-
modelValue:
|
|
1984
|
-
"onUpdate:modelValue": a[3] || (a[3] = (D) =>
|
|
1981
|
+
}, [m(ie, {
|
|
1982
|
+
modelValue: we.value,
|
|
1983
|
+
"onUpdate:modelValue": a[3] || (a[3] = (D) => we.value = D),
|
|
1985
1984
|
multiple: "",
|
|
1986
1985
|
variant: "dark",
|
|
1987
1986
|
"chip-icon": "check_circle",
|
|
1988
1987
|
searchable: !1,
|
|
1989
1988
|
items: ut.value,
|
|
1990
|
-
"selected-prefix": t
|
|
1991
|
-
placeholder: t
|
|
1992
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]),
|
|
1993
|
-
modelValue:
|
|
1994
|
-
"onUpdate:modelValue": a[4] || (a[4] = (D) =>
|
|
1989
|
+
"selected-prefix": s(t)("team.filter.selected_status_prefix"),
|
|
1990
|
+
placeholder: s(t)("team.filter.status_placeholder")
|
|
1991
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), m(ie, {
|
|
1992
|
+
modelValue: ke.value,
|
|
1993
|
+
"onUpdate:modelValue": a[4] || (a[4] = (D) => ke.value = D),
|
|
1995
1994
|
multiple: "",
|
|
1996
1995
|
variant: "dark",
|
|
1997
1996
|
"chip-icon": "check_circle",
|
|
1998
1997
|
searchable: !1,
|
|
1999
1998
|
items: mt.value,
|
|
2000
|
-
"selected-prefix": t
|
|
2001
|
-
placeholder: t
|
|
2002
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) :
|
|
1999
|
+
"selected-prefix": s(t)("team.filter.selected_login_method_prefix"),
|
|
2000
|
+
placeholder: s(t)("team.filter.login_method_placeholder")
|
|
2001
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])], 64)) : O("", !0)]), m(y, {
|
|
2003
2002
|
modelValue: $.value,
|
|
2004
2003
|
"onUpdate:modelValue": a[5] || (a[5] = (D) => $.value = D),
|
|
2005
2004
|
class: "w-[320px] xs:w-full xs:mt-8",
|
|
2006
2005
|
autofocus: "",
|
|
2007
|
-
placeholder: t
|
|
2008
|
-
}, null, 8, ["modelValue", "placeholder"])])),
|
|
2006
|
+
placeholder: s(t)("team.search.placeholder")
|
|
2007
|
+
}, null, 8, ["modelValue", "placeholder"])])), s(x).id.value ? (i(), q(rs, {
|
|
2009
2008
|
key: 2
|
|
2010
2009
|
}, {
|
|
2011
|
-
default: te(() => [
|
|
2010
|
+
default: te(() => [p("div", ol, [d.value ? O("", !0) : (i(), q(ns, {
|
|
2012
2011
|
key: 0
|
|
2013
|
-
})),
|
|
2012
|
+
})), d.value ? (i(), q(us, {
|
|
2014
2013
|
key: 1,
|
|
2015
2014
|
"is-loading": h.value,
|
|
2016
2015
|
"is-empty": r.value === 0,
|
|
2017
|
-
title: t
|
|
2018
|
-
subtitle: t
|
|
2016
|
+
title: s(t)("team.emptyState.title"),
|
|
2017
|
+
subtitle: s(t)("team.emptyState.description")
|
|
2019
2018
|
}, {
|
|
2020
|
-
default: te(() => [(
|
|
2019
|
+
default: te(() => [(i(), q(k, {
|
|
2021
2020
|
key: dt.value,
|
|
2022
2021
|
"column-defs": o,
|
|
2023
|
-
"row-data":
|
|
2022
|
+
"row-data": b.value,
|
|
2024
2023
|
"page-size": Ee,
|
|
2025
2024
|
"page-count": Math.ceil(r.value / Ee),
|
|
2026
2025
|
"row-count": r.value,
|
|
@@ -2028,51 +2027,51 @@ const Rl = /* @__PURE__ */ oe({
|
|
|
2028
2027
|
"hide-footer": r.value <= Ee,
|
|
2029
2028
|
loading: h.value,
|
|
2030
2029
|
"pin-header-row": "",
|
|
2031
|
-
onRowClick: a[12] || (a[12] = (D) => n(
|
|
2030
|
+
onRowClick: a[12] || (a[12] = (D) => n(s(Ae).Update, D.original))
|
|
2032
2031
|
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
2033
2032
|
_: 1
|
|
2034
|
-
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) :
|
|
2033
|
+
}, 8, ["is-loading", "is-empty", "title", "subtitle"])) : O("", !0)])]),
|
|
2035
2034
|
_: 1
|
|
2036
|
-
})) :
|
|
2035
|
+
})) : O("", !0)])]), m(Ne, {
|
|
2037
2036
|
"model-value": pe.value,
|
|
2038
2037
|
"max-width": 960,
|
|
2039
2038
|
"close-button": !1,
|
|
2040
2039
|
"onUpdate:modelValue": Ge,
|
|
2041
|
-
"onOn:clickedAway":
|
|
2040
|
+
"onOn:clickedAway": s(Re)
|
|
2042
2041
|
}, {
|
|
2043
|
-
"side-sheet-header": te(() => [
|
|
2042
|
+
"side-sheet-header": te(() => [p("div", rl, [p("p", nl, N(ve.value), 1), m(H, {
|
|
2044
2043
|
name: "close",
|
|
2045
2044
|
size: "md",
|
|
2046
2045
|
class: "cursor-pointer",
|
|
2047
|
-
onClick:
|
|
2046
|
+
onClick: s(Re)
|
|
2048
2047
|
}, null, 8, ["onClick"])])]),
|
|
2049
2048
|
"side-sheet-footer": te(() => {
|
|
2050
2049
|
var D;
|
|
2051
|
-
return [
|
|
2050
|
+
return [p("div", il, [m(le, {
|
|
2052
2051
|
label: xe.value,
|
|
2053
2052
|
size: "md",
|
|
2054
2053
|
variant: "primary",
|
|
2055
2054
|
"is-loading": fe.value,
|
|
2056
2055
|
disabled: fe.value || J.value === ae.ADD && ((D = me.value) == null ? void 0 : D.hasExisting),
|
|
2057
2056
|
onClick: Ft(Yt, ["prevent"])
|
|
2058
|
-
}, null, 8, ["label", "is-loading", "disabled"]),
|
|
2059
|
-
label: t
|
|
2057
|
+
}, null, 8, ["label", "is-loading", "disabled"]), m(le, {
|
|
2058
|
+
label: s(t)("common.cancel"),
|
|
2060
2059
|
size: "md",
|
|
2061
2060
|
variant: "secondary",
|
|
2062
2061
|
disabled: fe.value,
|
|
2063
2062
|
onClick: $e
|
|
2064
2063
|
}, null, 8, ["label", "disabled"])])];
|
|
2065
2064
|
}),
|
|
2066
|
-
default: te(() => [pe.value ? (
|
|
2065
|
+
default: te(() => [pe.value ? (i(), q(Za, {
|
|
2067
2066
|
key: 0,
|
|
2068
2067
|
ref_key: "memberForm",
|
|
2069
2068
|
ref: me,
|
|
2070
2069
|
initialValue: Q.value,
|
|
2071
|
-
providers:
|
|
2070
|
+
providers: W.value,
|
|
2072
2071
|
loading: he.value,
|
|
2073
2072
|
class: "gap-8",
|
|
2074
2073
|
onUpdateExisting: qe
|
|
2075
|
-
}, null, 8, ["initialValue", "providers", "loading"])) :
|
|
2074
|
+
}, null, 8, ["initialValue", "providers", "loading"])) : O("", !0)]),
|
|
2076
2075
|
_: 1
|
|
2077
2076
|
}, 8, ["model-value", "onOn:clickedAway"])], 64);
|
|
2078
2077
|
};
|