@feedmepos/mf-hrm-portal 2.3.2-dev → 2.3.3-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalCodeList-xOyDG5ug.js → ApprovalCodeList-D8ZVkmrF.js} +13 -14
- package/dist/{AuditLogList-Dd6HyFhk.js → AuditLogList-Fby1fcGU.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Cixg_icC.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B1uS6T3r.js} +2 -2
- package/dist/{EmployeeList-BG2KPvOB.js → EmployeeList-DY2Y-FtT.js} +16 -17
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BDGewUFD.js +90 -0
- package/dist/{GrantUserList-CUkuf3VV.js → GrantUserList-RK38DjjY.js} +14 -15
- package/dist/{Main-Cg9SOzcz.js → Main-424HHE7m.js} +5 -5
- package/dist/{Main-BSHf8gTE.js → Main-BuJe2QNl.js} +12 -11
- package/dist/{Main-BcixH7R5.js → Main-Pv9x678t.js} +11 -11
- package/dist/{MyPosProfile-CN8Bj3aV.js → MyPosProfile-Rc2ZTeQR.js} +1 -1
- package/dist/{PermissionSetList-I3u2_qHR.js → PermissionSetList-BT1oUm8M.js} +20 -20
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBoRXQPn.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BRrhFF3y.js} +1008 -1008
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-B5QDOF0L.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CD3d4RX6.js} +1 -1
- package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DS4eMJ6w.js +547 -0
- package/dist/RoleList-CrLxn4_K.js +274 -0
- package/dist/TeamMemberList-D32ZtSLP.js +2060 -0
- package/dist/{TimesheetList-CECFKt7H.js → TimesheetList-ByUp0yfA.js} +7 -7
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-RIyoAmeb.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-9x0jnL2P.js} +3 -3
- package/dist/{app-CdrnR_Pw.js → app-BsAwRWj0.js} +208 -188
- package/dist/app.js +1 -1
- package/dist/{approval-code-Bwvwehz9.js → approval-code-BUuYtJAO.js} +1 -1
- package/dist/{dayjs.min-BO8bcI17.js → dayjs.min-C9xnIrg1.js} +1 -1
- package/dist/{employee-Dg-J9goA.js → employee-DAwBQ0bc.js} +5 -5
- package/dist/{grant-user-whFOaPZI.js → grant-user-D-PdX5g-.js} +1 -1
- package/dist/{iteration-ZpERYj3o.js → iteration-Dat4Ismm.js} +1 -1
- package/dist/{lodash-7SZBZ8VQ.js → lodash-DjYVoggD.js} +1 -1
- package/dist/{member-grant-C46lvrh2.js → member-grant-CQHFGo-k.js} +2 -2
- package/dist/{restaurant-CKhT6kgj.js → restaurant-dbllb9m8.js} +1 -1
- package/dist/{role-C6hFKOfU.js → role-DN-jiQnS.js} +3 -3
- package/dist/{rule-BlMymDXm.js → rule-Bgcb9R7I.js} +19 -19
- package/dist/src/helpers/pos-assignment-rows.d.ts +2 -0
- package/dist/src/views/hr/locales/index.d.ts +20 -0
- package/dist/src/views/hr/role/RoleForm.vue.d.ts +29 -2
- package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +2 -6
- package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -2
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +0 -2
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +0 -2
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-CL6EEDuw.js → useAppStore-BABlZnfR.js} +1 -1
- package/dist/{useLoading-BBjBUzGJ.js → useLoading-B47q5dVg.js} +1 -1
- package/dist/{useReportPermissions-Bg0fma6m.js → useReportPermissions-D-nbQAm5.js} +5 -5
- package/package.json +1 -1
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js +0 -45
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/RoleList-ALmAwN0U.js +0 -739
- package/dist/TeamMemberList-DZfEnOs1.js +0 -2097
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { computed as g, defineComponent as se, ref as U, onMounted as te, resolveComponent as x, createElementBlock as $, openBlock as h, Fragment as A, createBlock as R, createElementVNode as r, createVNode as m, unref as a, withCtx as b, h as u, renderList as ne, toDisplayString as p, createTextVNode as T, resolveDynamicComponent as z, withModifiers as re, nextTick as K } from "vue";
|
|
2
|
+
import { e as d } from "./iteration-Dat4Ismm.js";
|
|
3
|
+
import { useI18n as ae } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialog as le, useSnackbar as ie, useBreakpoints as ce, components as D, FmButtonColorThemeVariant as me } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as ue } from "./app-BsAwRWj0.js";
|
|
6
|
+
import { _ as W } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
7
|
+
import { _ as de } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
8
|
+
import { f as w, r as pe, h as fe } from "./rule-Bgcb9R7I.js";
|
|
9
|
+
import { u as j } from "./restaurant-dbllb9m8.js";
|
|
10
|
+
import { u as _e } from "./role-DN-jiQnS.js";
|
|
11
|
+
import { u as he } from "./useReportPermissions-D-nbQAm5.js";
|
|
12
|
+
import { _ as ve } from "./RoleForm.vue_vue_type_script_setup_true_lang-DS4eMJ6w.js";
|
|
13
|
+
function ge() {
|
|
14
|
+
const B = j();
|
|
15
|
+
return g(() => {
|
|
16
|
+
const s = {};
|
|
17
|
+
return B.restaurants.value.forEach((f) => {
|
|
18
|
+
s[f._id] = f;
|
|
19
|
+
}), s;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const ye = {
|
|
23
|
+
class: "space-y-8"
|
|
24
|
+
}, Ce = {
|
|
25
|
+
class: "flex justify-end xs:px-16"
|
|
26
|
+
}, xe = {
|
|
27
|
+
class: "flex flex-col h-full overflow-auto"
|
|
28
|
+
}, Re = {
|
|
29
|
+
class: "pb-64 sm:hidden md:hidden lg:hidden"
|
|
30
|
+
}, be = {
|
|
31
|
+
class: "space-y-4"
|
|
32
|
+
}, we = {
|
|
33
|
+
class: "fm-typo-en-body-lg-600"
|
|
34
|
+
}, Fe = {
|
|
35
|
+
class: "text-fm-color-typo-secondary"
|
|
36
|
+
}, Ee = {
|
|
37
|
+
class: "line-clamp-2"
|
|
38
|
+
}, Le = {
|
|
39
|
+
class: "font-bold"
|
|
40
|
+
}, ke = {
|
|
41
|
+
class: "flex items-start gap-4"
|
|
42
|
+
}, Se = {
|
|
43
|
+
class: "line-clamp-2"
|
|
44
|
+
}, Ue = {
|
|
45
|
+
class: "font-bold"
|
|
46
|
+
}, Te = {
|
|
47
|
+
class: "flex items-start gap-4"
|
|
48
|
+
}, Be = {
|
|
49
|
+
class: "line-clamp-2"
|
|
50
|
+
}, Me = {
|
|
51
|
+
class: "font-bold"
|
|
52
|
+
}, Ge = /* @__PURE__ */ se({
|
|
53
|
+
__name: "RoleList",
|
|
54
|
+
setup(B, {
|
|
55
|
+
expose: M
|
|
56
|
+
}) {
|
|
57
|
+
const {
|
|
58
|
+
t: s
|
|
59
|
+
} = ae(), {
|
|
60
|
+
allReportPermissions: f
|
|
61
|
+
} = he(), G = j(), q = g(() => G.restaurants.value), I = g(() => q.value.map((e) => e._id));
|
|
62
|
+
function F(e, o) {
|
|
63
|
+
const n = o === d.F_RULE_SUBJECT.enum.report ? f.value : void 0, t = w(e, o, n);
|
|
64
|
+
return ["-", "All"].includes(t) ? () => null : () => u(D.FmTooltip, {
|
|
65
|
+
"z-index": "999",
|
|
66
|
+
placement: "top",
|
|
67
|
+
class: "ml-2"
|
|
68
|
+
}, {
|
|
69
|
+
content: () => u("div", [s("hr.role.tooltip.labels.permission"), ...e.filter((i) => i.subject === o).map((i) => u("div", ["- ", pe(i).label]))]),
|
|
70
|
+
default: () => u(D.FmIcon, {
|
|
71
|
+
name: "info",
|
|
72
|
+
color: me.NeutralGray400
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function J(e, o) {
|
|
77
|
+
const n = o === d.F_RULE_SUBJECT.enum.report ? f.value : void 0, t = w(e, o, n);
|
|
78
|
+
return () => t === "All" ? t : u("div", {
|
|
79
|
+
class: "flex items-center"
|
|
80
|
+
}, [t, F(e, o)()]);
|
|
81
|
+
}
|
|
82
|
+
function N(e) {
|
|
83
|
+
return [{
|
|
84
|
+
label: s("hr.role.form.update"),
|
|
85
|
+
onClick: () => E(e)
|
|
86
|
+
}, {
|
|
87
|
+
label: s("hr.role.remove.title"),
|
|
88
|
+
onClick: () => Z(e),
|
|
89
|
+
itemClass: "text-fm-color-typo-error",
|
|
90
|
+
disabled: fe(e.permissions)
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
const H = ({
|
|
94
|
+
role: e,
|
|
95
|
+
className: o = ""
|
|
96
|
+
}) => m("div", {
|
|
97
|
+
class: o,
|
|
98
|
+
onClick: (n) => {
|
|
99
|
+
n.stopPropagation();
|
|
100
|
+
}
|
|
101
|
+
}, [m(W, {
|
|
102
|
+
items: N(e)
|
|
103
|
+
}, null)]), O = [{
|
|
104
|
+
accessorKey: "name",
|
|
105
|
+
header: () => s("hr.role.columns.name"),
|
|
106
|
+
enableSorting: !1
|
|
107
|
+
}, {
|
|
108
|
+
accessorKey: "operation",
|
|
109
|
+
header: () => s("hr.role.columns.operation"),
|
|
110
|
+
cell: (e) => u(J(e.row.original.permissions, d.F_RULE_SUBJECT.enum.order)),
|
|
111
|
+
enableSorting: !1
|
|
112
|
+
}, {
|
|
113
|
+
accessorKey: "report",
|
|
114
|
+
header: () => s("hr.role.columns.report"),
|
|
115
|
+
cell: (e) => u(J(e.row.original.permissions, d.F_RULE_SUBJECT.enum.report)),
|
|
116
|
+
enableSorting: !1
|
|
117
|
+
}, {
|
|
118
|
+
accessorKey: "restaurants",
|
|
119
|
+
header: () => s("hr.role.columns.restaurants"),
|
|
120
|
+
cell: (e) => e.row.original.restaurants.map((o, n) => {
|
|
121
|
+
const t = o.code, i = `${t ? t + " - " : ""}${o.name}`;
|
|
122
|
+
return u("div", (n ? `
|
|
123
|
+
` : "") + i);
|
|
124
|
+
}),
|
|
125
|
+
enableSorting: !1
|
|
126
|
+
}, {
|
|
127
|
+
id: "action",
|
|
128
|
+
size: 52,
|
|
129
|
+
meta: {
|
|
130
|
+
cellClass: "pl-16",
|
|
131
|
+
headerContentClass: "-mx-16"
|
|
132
|
+
},
|
|
133
|
+
cell: (e) => H({
|
|
134
|
+
role: e.row.original,
|
|
135
|
+
className: "flex w-full items-center justify-end"
|
|
136
|
+
})
|
|
137
|
+
}], E = async (e) => {
|
|
138
|
+
var o;
|
|
139
|
+
C.value = e._id, await K(), (o = S.value) == null || o.trigger();
|
|
140
|
+
}, _ = _e(), Q = ge(), X = g(() => {
|
|
141
|
+
const e = _.roles.value || [];
|
|
142
|
+
return (I.value.length === 0 ? e : e.filter((n) => n.restaurants.some((t) => I.value.includes(t.id)))).map((n) => {
|
|
143
|
+
const t = n.restaurants.map((i) => {
|
|
144
|
+
const c = Q.value[i.id];
|
|
145
|
+
return {
|
|
146
|
+
...i,
|
|
147
|
+
// Prefer live data from restaurantMap so names populate reactively
|
|
148
|
+
// even when restaurants loaded after roles.
|
|
149
|
+
name: (c == null ? void 0 : c.profile.name) || i.name,
|
|
150
|
+
code: c == null ? void 0 : c.profile.code
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
...n,
|
|
155
|
+
restaurants: t
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}), y = g(() => {
|
|
159
|
+
var o;
|
|
160
|
+
return (o = X.value) == null ? void 0 : o.filter((n) => {
|
|
161
|
+
const t = k.value.toLowerCase(), i = n.name.toLowerCase().includes(t), l = (n.restaurants || []).some((v) => {
|
|
162
|
+
var V;
|
|
163
|
+
return v.name.toLowerCase().includes(t) || ((V = v.code) == null ? void 0 : V.toLowerCase().includes(t));
|
|
164
|
+
});
|
|
165
|
+
return i || l;
|
|
166
|
+
});
|
|
167
|
+
}), P = le(), L = ie(), {
|
|
168
|
+
breakpoints: Y
|
|
169
|
+
} = ce(), Z = (e) => {
|
|
170
|
+
P.open({
|
|
171
|
+
title: s("hr.role.remove.title"),
|
|
172
|
+
message: s("hr.role.remove.message", {
|
|
173
|
+
name: e.name
|
|
174
|
+
}),
|
|
175
|
+
minWidth: Y.value.lg ? 588 : 0,
|
|
176
|
+
primaryActions: {
|
|
177
|
+
text: s("common.remove"),
|
|
178
|
+
close: !1,
|
|
179
|
+
variant: "destructive"
|
|
180
|
+
},
|
|
181
|
+
secondaryActions: {
|
|
182
|
+
text: s("common.cancel"),
|
|
183
|
+
close: !0
|
|
184
|
+
}
|
|
185
|
+
}).onPrimary(async () => {
|
|
186
|
+
await _.deleteRole(e).then(() => L.open({
|
|
187
|
+
message: s("hr.role.remove.successMessage", {
|
|
188
|
+
name: e.name
|
|
189
|
+
}),
|
|
190
|
+
type: "success"
|
|
191
|
+
})).catch((o) => L.open({
|
|
192
|
+
message: o,
|
|
193
|
+
type: "error"
|
|
194
|
+
})), P.close();
|
|
195
|
+
});
|
|
196
|
+
}, k = U(""), S = U(), C = U(void 0);
|
|
197
|
+
async function ee() {
|
|
198
|
+
var e;
|
|
199
|
+
C.value = void 0, await K(), (e = S.value) == null || e.trigger();
|
|
200
|
+
}
|
|
201
|
+
async function oe() {
|
|
202
|
+
if (_.roles.value.length === 0)
|
|
203
|
+
try {
|
|
204
|
+
await _.readRoles();
|
|
205
|
+
} catch (e) {
|
|
206
|
+
console.error("Failed to load roles:", e), L.open({
|
|
207
|
+
message: e instanceof Error ? e.message : String(e),
|
|
208
|
+
type: "error"
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return te(() => {
|
|
213
|
+
oe();
|
|
214
|
+
}), M({
|
|
215
|
+
create: ee
|
|
216
|
+
}), (e, o) => {
|
|
217
|
+
const n = x("FmSearch"), t = x("FmTable"), i = x("FmListItem"), c = x("FmList");
|
|
218
|
+
return h(), $(A, null, [(h(), R(ve, {
|
|
219
|
+
id: C.value,
|
|
220
|
+
key: C.value,
|
|
221
|
+
ref_key: "roleFormRef",
|
|
222
|
+
ref: S
|
|
223
|
+
}, null, 8, ["id"])), r("div", ye, [r("div", Ce, [m(n, {
|
|
224
|
+
modelValue: k.value,
|
|
225
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => k.value = l),
|
|
226
|
+
class: "w-[320px] xs:w-full",
|
|
227
|
+
autofocus: "",
|
|
228
|
+
placeholder: a(s)("hr.role.search.placeholder") + " / " + a(s)("hr.restaurant.search.placeholder")
|
|
229
|
+
}, null, 8, ["modelValue", "placeholder"])]), m(ue, null, {
|
|
230
|
+
default: b(() => [r("div", xe, [m(de, {
|
|
231
|
+
"is-loading": a(_).isLoading.value,
|
|
232
|
+
"is-empty": y.value.length === 0,
|
|
233
|
+
"collapse-at": "xs",
|
|
234
|
+
title: a(s)("hr.role.noData.title"),
|
|
235
|
+
subtitle: a(s)("hr.role.noData.subtitle")
|
|
236
|
+
}, {
|
|
237
|
+
default: b(() => [m(t, {
|
|
238
|
+
class: "xs:hidden",
|
|
239
|
+
"column-defs": O,
|
|
240
|
+
"row-data": y.value,
|
|
241
|
+
"page-size": y.value.length,
|
|
242
|
+
loading: a(_).isLoading.value,
|
|
243
|
+
"pin-header-row": "",
|
|
244
|
+
"hide-footer": "",
|
|
245
|
+
"shrink-at": !1,
|
|
246
|
+
onRowClick: o[1] || (o[1] = (l) => E(l.original))
|
|
247
|
+
}, null, 8, ["row-data", "page-size", "loading"])]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, ["is-loading", "is-empty", "title", "subtitle"]), r("div", Re, [m(c, {
|
|
250
|
+
separator: ""
|
|
251
|
+
}, {
|
|
252
|
+
default: b(() => [(h(!0), $(A, null, ne(y.value, (l) => (h(), R(i, {
|
|
253
|
+
key: l._id,
|
|
254
|
+
class: "py-12 px-16 items-center justify-between",
|
|
255
|
+
onClick: (v) => E(l)
|
|
256
|
+
}, {
|
|
257
|
+
default: b(() => [r("div", be, [r("p", we, p(l.name), 1), r("div", Fe, [r("p", Ee, [r("span", Le, p(a(s)("hr.role.labels.restaurant")) + ":", 1), T(" " + p(l.restaurants.map((v) => v.name).join(", ")), 1)]), r("p", ke, [r("span", Se, [r("span", Ue, p(a(s)("hr.role.labels.operation")) + ":", 1), T(" " + p(a(w)(l.permissions, a(d.F_RULE_SUBJECT).enum.order)), 1)]), (h(), R(z(F(l.permissions, a(d.F_RULE_SUBJECT).enum.order))))]), r("p", Te, [r("span", Be, [r("span", Me, p(a(s)("hr.role.labels.report")) + ":", 1), T(" " + p(a(w)(l.permissions, a(d.F_RULE_SUBJECT).enum.report, a(f))), 1)]), (h(), R(z(F(l.permissions, a(d.F_RULE_SUBJECT).enum.report))))])])]), r("div", {
|
|
258
|
+
onClick: o[2] || (o[2] = re(() => {
|
|
259
|
+
}, ["stop"]))
|
|
260
|
+
}, [m(W, {
|
|
261
|
+
items: N(l)
|
|
262
|
+
}, null, 8, ["items"])])]),
|
|
263
|
+
_: 2
|
|
264
|
+
}, 1032, ["onClick"]))), 128))]),
|
|
265
|
+
_: 1
|
|
266
|
+
})])])]),
|
|
267
|
+
_: 1
|
|
268
|
+
})])], 64);
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
export {
|
|
273
|
+
Ge as default
|
|
274
|
+
};
|