@feedmepos/mf-hrm-portal 2.0.11-dev → 2.0.11-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AuditLogList-CPCwaKH1.js +915 -0
- package/dist/EmployeeList-CnioGTrn.js +621 -0
- package/dist/{Main-BhNhmkn8.js → Main-BfqR98z8.js} +4 -4
- package/dist/{Main-Bu-UNnSQ.js → Main-CiC6919R.js} +6 -6
- package/dist/{Main-6td6JhCb.js → Main-DcM7-Kf8.js} +1054 -1055
- package/dist/{PermissionSetList-IG15Aj5D.js → PermissionSetList-YAJeeVq4.js} +128 -124
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CDA9oDkd.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BWwzKIj4.js} +737 -737
- package/dist/RoleList-DLRKQTNn.js +499 -0
- package/dist/TeamMemberList-WGkdgvP7.js +989 -0
- package/dist/{TimesheetList-D_JT5iyS.js → TimesheetList-FC5d0cQs.js} +74 -74
- package/dist/{app-h2mRYtCE.js → app-hhkxg2ia.js} +680 -687
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-QbzmY4D1.js → dayjs.min-CmSGUQz6.js} +1 -1
- package/dist/employee-qLhiRdik.js +145 -0
- package/dist/{index-CBgvOHm7.js → index-3SJ5p2tN.js} +1 -1
- package/dist/{index-BLm_-G4e.js → index-DTHsTgiv.js} +81 -104
- package/dist/{iteration-J_5O7DIo.js → iteration-DE9d6AWC.js} +1 -1
- package/dist/{lodash-btS1GWf0.js → lodash-COiHEEND.js} +1 -1
- package/dist/src/api/employee/index.d.ts +3 -4
- package/dist/src/api/team/index.d.ts +1 -3
- package/dist/src/stores/employee.d.ts +6 -515
- package/dist/src/stores/team.d.ts +0 -6
- package/dist/src/types/employee.d.ts +1 -35
- package/dist/src/types/team.d.ts +2 -18
- package/dist/src/views/hr/employee/EmployeeForm.vue.d.ts +2 -6
- package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -3
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +0 -9
- package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +5 -5
- package/dist/style.css +1 -1
- package/dist/team-DRHPhNaF.js +33 -0
- package/dist/{timesheet-B4Vja79b.js → timesheet-B8VEnofv.js} +3 -3
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-CEidzV7L.js → useAppStore-bIHeIja6.js} +1 -1
- package/dist/{useLoading-fH82N_CS.js → useLoading-hhc0q3-4.js} +1 -1
- package/dist/{useReportPermissions-BZS4zPhT.js → useReportPermissions-CutJVfnG.js} +3 -3
- package/package.json +1 -1
- package/dist/AuditLogList-C7QcWwHq.js +0 -941
- package/dist/EmployeeList-CQzS4gXV.js +0 -690
- package/dist/RoleList-Cziztrpo.js +0 -519
- package/dist/TeamMemberList-DwxhZcrA.js +0 -1081
- package/dist/employee-CY4sYUu8.js +0 -232
- package/dist/src/components/table/TablePagination.vue.d.ts +0 -14
- package/dist/src/composables/useDebounce.d.ts +0 -9
- package/dist/useDebounce-Cnv3r01W.js +0 -83
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { d as _ } from "./dayjs.min-QbzmY4D1.js";
|
|
2
|
-
import { defineStore as A, storeToRefs as x } from "pinia";
|
|
3
|
-
import { ref as E } from "vue";
|
|
4
|
-
import { useCoreStore as h } from "@feedmepos/mf-common";
|
|
5
|
-
import { b as n, g as p, s as M } from "./iteration-J_5O7DIo.js";
|
|
6
|
-
import { t as z, i as P } from "./index-BLm_-G4e.js";
|
|
7
|
-
import { u as N } from "./useAppStore-CEidzV7L.js";
|
|
8
|
-
const l = {
|
|
9
|
-
async readEmployees() {
|
|
10
|
-
return p(await n().get("/pos-users"));
|
|
11
|
-
},
|
|
12
|
-
async readEmployeesPage(e) {
|
|
13
|
-
var t, i;
|
|
14
|
-
return p(
|
|
15
|
-
await n().get("/pos-users/paged", {
|
|
16
|
-
params: {
|
|
17
|
-
limit: e.limit,
|
|
18
|
-
offset: e.offset,
|
|
19
|
-
search: e.search,
|
|
20
|
-
restaurantIds: (t = e.restaurantIds) != null && t.length ? e.restaurantIds : void 0,
|
|
21
|
-
roleIds: (i = e.roleIds) != null && i.length ? e.roleIds : void 0
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
async createEmployee(e) {
|
|
27
|
-
return p(await n().post("/pos-users", e));
|
|
28
|
-
},
|
|
29
|
-
async createMasterEmployee(e) {
|
|
30
|
-
return p(await n().post("/pos-users/master-user", e));
|
|
31
|
-
},
|
|
32
|
-
async migrateToMasterEmployee(e, t) {
|
|
33
|
-
return p(
|
|
34
|
-
await n().put(`/pos-users/migrate/${e}`, t)
|
|
35
|
-
);
|
|
36
|
-
},
|
|
37
|
-
async updateEmployee(e, t) {
|
|
38
|
-
return p(await n().put(`/pos-users/${e}`, t));
|
|
39
|
-
},
|
|
40
|
-
async updateMasterEmployee(e, t) {
|
|
41
|
-
return p(
|
|
42
|
-
await n().put(`/pos-users/master-user/${e}`, t)
|
|
43
|
-
);
|
|
44
|
-
},
|
|
45
|
-
async deleteEmployee(e) {
|
|
46
|
-
return p(
|
|
47
|
-
await n().put(`/pos-users/${e._id}`, {
|
|
48
|
-
user: e,
|
|
49
|
-
roles: [],
|
|
50
|
-
previousRoles: e.restaurants.map((t) => ({
|
|
51
|
-
restaurantId: t.restaurantId,
|
|
52
|
-
roleId: t.roleId
|
|
53
|
-
}))
|
|
54
|
-
})
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
async deleteMasterEmployee(e) {
|
|
58
|
-
return p(
|
|
59
|
-
await n().put(`/pos-users/master-user/${e._id}`, {
|
|
60
|
-
user: e,
|
|
61
|
-
roles: [],
|
|
62
|
-
previousRoles: e.restaurants.map((t) => ({
|
|
63
|
-
restaurantId: t.restaurantId,
|
|
64
|
-
roleId: t.roleId
|
|
65
|
-
}))
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
},
|
|
69
|
-
async generateEmployeePasscode() {
|
|
70
|
-
return `${p(
|
|
71
|
-
await n().get("/pos-users/generate-passcode")
|
|
72
|
-
)}`;
|
|
73
|
-
},
|
|
74
|
-
async syncUsersMeta() {
|
|
75
|
-
await n().post("/pos-users/create-users-meta");
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
async function m(e) {
|
|
79
|
-
const t = N().roles.value, { restaurants: i } = h(), c = new Map(
|
|
80
|
-
i.value.map((a) => [a._id, a.profile.name])
|
|
81
|
-
), d = new Map(t.map((a) => [a._id, a.name])), o = /* @__PURE__ */ new Map();
|
|
82
|
-
for (const a of e) {
|
|
83
|
-
const f = {
|
|
84
|
-
restaurantId: a.restaurantId,
|
|
85
|
-
restaurantName: c.get(a.restaurantId) || "",
|
|
86
|
-
roleId: a.role,
|
|
87
|
-
roleName: d.get(a.role) || ""
|
|
88
|
-
}, y = o.get(a._id);
|
|
89
|
-
if (!y) {
|
|
90
|
-
o.set(a._id, {
|
|
91
|
-
...a,
|
|
92
|
-
since: _(P(a._id)).format("DD/MM/YYYY"),
|
|
93
|
-
restaurants: [f]
|
|
94
|
-
});
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
y.restaurants.some((w) => w.restaurantId === a.restaurantId) || (y.restaurants = M([...y.restaurants, f], {
|
|
98
|
-
selector: "restaurantName"
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
return M([...o.values()], { selector: "name" });
|
|
102
|
-
}
|
|
103
|
-
function v(e) {
|
|
104
|
-
const { restaurants: t } = h(), i = N().roles.value, c = new Map(
|
|
105
|
-
t.value.map((a) => [a._id, a.profile.name])
|
|
106
|
-
), d = new Map(i.map((a) => [a._id, a.name])), o = e.restaurantRole[0];
|
|
107
|
-
return {
|
|
108
|
-
_id: e._id,
|
|
109
|
-
name: e.name,
|
|
110
|
-
code: e.code,
|
|
111
|
-
passcode: e.passcode,
|
|
112
|
-
isMasterUser: e.isMasterUser,
|
|
113
|
-
restaurantId: (o == null ? void 0 : o.restaurantId) || "",
|
|
114
|
-
role: (o == null ? void 0 : o.roleId) || "",
|
|
115
|
-
since: _(P(e._id)).format("DD/MM/YYYY"),
|
|
116
|
-
restaurants: M(
|
|
117
|
-
e.restaurantRole.map((a) => ({
|
|
118
|
-
restaurantId: a.restaurantId,
|
|
119
|
-
restaurantName: c.get(a.restaurantId) || "",
|
|
120
|
-
roleId: a.roleId,
|
|
121
|
-
roleName: d.get(a.roleId) || ""
|
|
122
|
-
})),
|
|
123
|
-
{ selector: "restaurantName" }
|
|
124
|
-
)
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const C = A("employee", () => {
|
|
128
|
-
const e = E([]), t = E([]), i = E(0), c = E(!1), d = E([]);
|
|
129
|
-
async function o() {
|
|
130
|
-
try {
|
|
131
|
-
c.value = !0;
|
|
132
|
-
const s = await l.readEmployees();
|
|
133
|
-
e.value = await m(s);
|
|
134
|
-
} catch (s) {
|
|
135
|
-
console.log("Error reading employees:", s);
|
|
136
|
-
} finally {
|
|
137
|
-
c.value = !1;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
async function a(s) {
|
|
141
|
-
try {
|
|
142
|
-
c.value = !0;
|
|
143
|
-
const r = await l.readEmployeesPage(s);
|
|
144
|
-
t.value = r.items.map(v), i.value = r.total;
|
|
145
|
-
} catch (r) {
|
|
146
|
-
console.log("Error reading employee page:", r);
|
|
147
|
-
} finally {
|
|
148
|
-
c.value = !1;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
async function f(s) {
|
|
152
|
-
const u = [];
|
|
153
|
-
let I = 0;
|
|
154
|
-
for (; ; ) {
|
|
155
|
-
const g = await l.readEmployeesPage({
|
|
156
|
-
...s,
|
|
157
|
-
limit: 200,
|
|
158
|
-
offset: I
|
|
159
|
-
});
|
|
160
|
-
if (u.push(...g.items.map(v)), I += g.items.length, I >= g.total || g.items.length === 0)
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
return u;
|
|
164
|
-
}
|
|
165
|
-
async function y(s) {
|
|
166
|
-
const r = await l.createEmployee(s);
|
|
167
|
-
e.value = await m(r);
|
|
168
|
-
}
|
|
169
|
-
async function w(s, r) {
|
|
170
|
-
const u = await l.updateEmployee(s, r);
|
|
171
|
-
e.value = await m(u);
|
|
172
|
-
}
|
|
173
|
-
async function S(s) {
|
|
174
|
-
const r = await l.deleteEmployee(s);
|
|
175
|
-
e.value = await m(r);
|
|
176
|
-
}
|
|
177
|
-
async function U(s) {
|
|
178
|
-
const r = await l.deleteMasterEmployee(s);
|
|
179
|
-
e.value = await m(r);
|
|
180
|
-
}
|
|
181
|
-
async function Y(s) {
|
|
182
|
-
const r = await l.createMasterEmployee(s);
|
|
183
|
-
e.value = await m(r);
|
|
184
|
-
}
|
|
185
|
-
async function T(s, r) {
|
|
186
|
-
const u = await l.updateMasterEmployee(s, r);
|
|
187
|
-
e.value = await m(u);
|
|
188
|
-
}
|
|
189
|
-
async function b(s, r) {
|
|
190
|
-
const u = await l.migrateToMasterEmployee(s, r);
|
|
191
|
-
e.value = await m(u);
|
|
192
|
-
}
|
|
193
|
-
async function D() {
|
|
194
|
-
try {
|
|
195
|
-
d.value = await z.readTeamMemberPosUserIds();
|
|
196
|
-
} catch (s) {
|
|
197
|
-
console.log("Error reading team member pos user ids:", s);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
async function $() {
|
|
201
|
-
await l.syncUsersMeta();
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
employees: e,
|
|
205
|
-
listEmployees: t,
|
|
206
|
-
totalEmployees: i,
|
|
207
|
-
restrictEmployeeIds: d,
|
|
208
|
-
isLoading: c,
|
|
209
|
-
readEmployees: o,
|
|
210
|
-
readEmployeesPage: a,
|
|
211
|
-
readAllEmployeesPage: f,
|
|
212
|
-
createEmployee: y,
|
|
213
|
-
updateEmployee: w,
|
|
214
|
-
deleteEmployee: S,
|
|
215
|
-
createMasterEmployee: Y,
|
|
216
|
-
updateMasterEmployee: T,
|
|
217
|
-
deleteMasterEmployee: U,
|
|
218
|
-
migrateToMasterUser: b,
|
|
219
|
-
readTeamMemberPosUserIds: D,
|
|
220
|
-
syncUsersMeta: $
|
|
221
|
-
};
|
|
222
|
-
}), J = () => {
|
|
223
|
-
const e = C();
|
|
224
|
-
return {
|
|
225
|
-
...e,
|
|
226
|
-
...x(e)
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
export {
|
|
230
|
-
l as E,
|
|
231
|
-
J as u
|
|
232
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
currentPage: number;
|
|
3
|
-
pageSize: number;
|
|
4
|
-
totalItems: number;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
|
-
"update:currentPage": (value: number) => any;
|
|
9
|
-
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
10
|
-
"onUpdate:currentPage"?: ((value: number) => any) | undefined;
|
|
11
|
-
}>, {
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Ref } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Composable for debouncing watch callbacks
|
|
4
|
-
* @param source - The ref to watch
|
|
5
|
-
* @param callback - Function to call after debounce delay
|
|
6
|
-
* @param delay - Debounce delay in milliseconds (default: 300ms)
|
|
7
|
-
* @returns Stop function to stop the watcher
|
|
8
|
-
*/
|
|
9
|
-
export declare function useDebouncedWatch<T>(source: Ref<T>, callback: (newVal: T) => void | Promise<void>, delay?: number): import("vue").WatchHandle;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { defineComponent as x, computed as i, resolveComponent as f, createElementBlock as P, openBlock as k, createElementVNode as r, toDisplayString as c, createVNode as d, watch as I } from "vue";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import { _ as S } from "./SelectFilter-DUj7GBtT.js";
|
|
4
|
-
const T = { class: "sticky bottom-0 z-10 flex shrink-0 items-center justify-between gap-12 border-fm-color-border-default bg-white px-24 py-4 xs:flex-col xs:items-stretch xs:px-16" }, V = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, z = { class: "flex items-center gap-8 xs:justify-between" }, B = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, F = { class: "flex items-center gap-4" }, M = /* @__PURE__ */ x({
|
|
5
|
-
__name: "TablePagination",
|
|
6
|
-
props: {
|
|
7
|
-
currentPage: {},
|
|
8
|
-
pageSize: {},
|
|
9
|
-
totalItems: {},
|
|
10
|
-
disabled: { type: Boolean, default: !1 }
|
|
11
|
-
},
|
|
12
|
-
emits: ["update:currentPage"],
|
|
13
|
-
setup(o, { emit: u }) {
|
|
14
|
-
const e = o, n = u, l = i(() => Math.max(1, Math.ceil(e.totalItems / e.pageSize))), t = i(() => Math.min(Math.max(1, e.currentPage), l.value)), b = i(
|
|
15
|
-
() => Array.from({ length: l.value }, (s, a) => ({
|
|
16
|
-
label: `${a + 1}`,
|
|
17
|
-
value: a + 1
|
|
18
|
-
}))
|
|
19
|
-
), m = i({
|
|
20
|
-
get: () => t.value,
|
|
21
|
-
set: (s) => {
|
|
22
|
-
const a = typeof s == "string" ? parseInt(s, 10) : s;
|
|
23
|
-
!Number.isFinite(a) || a === e.currentPage || n("update:currentPage", a);
|
|
24
|
-
}
|
|
25
|
-
}), p = i(() => {
|
|
26
|
-
if (e.totalItems === 0)
|
|
27
|
-
return { start: 0, end: 0 };
|
|
28
|
-
const s = (t.value - 1) * e.pageSize + 1, a = Math.min(t.value * e.pageSize, e.totalItems);
|
|
29
|
-
return { start: s, end: a };
|
|
30
|
-
});
|
|
31
|
-
function v() {
|
|
32
|
-
e.disabled || t.value <= 1 || n("update:currentPage", t.value - 1);
|
|
33
|
-
}
|
|
34
|
-
function _() {
|
|
35
|
-
e.disabled || t.value >= l.value || n("update:currentPage", t.value + 1);
|
|
36
|
-
}
|
|
37
|
-
return (s, a) => {
|
|
38
|
-
const h = f("FmSelect"), g = f("FmButton");
|
|
39
|
-
return k(), P("div", T, [
|
|
40
|
-
r("span", V, c(p.value.start) + "-" + c(p.value.end) + " of " + c(o.totalItems) + " items ", 1),
|
|
41
|
-
r("div", z, [
|
|
42
|
-
d(h, {
|
|
43
|
-
modelValue: m.value,
|
|
44
|
-
"onUpdate:modelValue": a[0] || (a[0] = (y) => m.value = y),
|
|
45
|
-
class: "table-pagination__page-select",
|
|
46
|
-
items: b.value,
|
|
47
|
-
disabled: o.disabled,
|
|
48
|
-
multiselect: !1
|
|
49
|
-
}, null, 8, ["modelValue", "items", "disabled"]),
|
|
50
|
-
r("span", B, " of " + c(l.value) + " pages ", 1),
|
|
51
|
-
r("div", F, [
|
|
52
|
-
d(g, {
|
|
53
|
-
variant: "tertiary",
|
|
54
|
-
icon: "chevron_left",
|
|
55
|
-
"icon-color": "neutral-black",
|
|
56
|
-
disabled: o.disabled || t.value <= 1,
|
|
57
|
-
onClick: v
|
|
58
|
-
}, null, 8, ["disabled"]),
|
|
59
|
-
d(g, {
|
|
60
|
-
variant: "tertiary",
|
|
61
|
-
icon: "chevron_right",
|
|
62
|
-
"icon-color": "neutral-black",
|
|
63
|
-
disabled: o.disabled || t.value >= l.value,
|
|
64
|
-
onClick: _
|
|
65
|
-
}, null, 8, ["disabled"])
|
|
66
|
-
])
|
|
67
|
-
])
|
|
68
|
-
]);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
}), j = /* @__PURE__ */ S(M, [["__scopeId", "data-v-8f46264b"]]);
|
|
72
|
-
function D(o, u, e = 300) {
|
|
73
|
-
let n;
|
|
74
|
-
return I(o, (t) => {
|
|
75
|
-
n && clearTimeout(n), n = setTimeout(() => {
|
|
76
|
-
u(t);
|
|
77
|
-
}, e);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
j as T,
|
|
82
|
-
D as u
|
|
83
|
-
};
|