@feedmepos/mf-hrm-portal 2.2.5-dev.8 → 2.2.5-dev.9
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-BzL73nqc.js → ApprovalCodeList-D5l9vIsE.js} +2 -2
- package/dist/{AuditLogList-BEZoHLsX.js → AuditLogList-ByTa5UJY.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DDrP7ywR.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-mNdn1TYV.js} +2 -2
- package/dist/{EmployeeList-s4FYw1ZF.js → EmployeeList-Bv6ANk-P.js} +8 -9
- package/dist/{GrantUserList-Ci_ElhHZ.js → GrantUserList-Bt8w3p4j.js} +3 -3
- package/dist/{Main-BojQuzZI.js → Main-DHJcgePj.js} +5 -5
- package/dist/{Main-N1CNGDAy.js → Main-DkP8dWgn.js} +9 -9
- package/dist/{Main-CKr3RGvf.js → Main-DqiGpT4v.js} +2 -2
- package/dist/{PermissionSetList-DLknSOzA.js → PermissionSetList-BIGv1u67.js} +10 -11
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DK2Bx8Aw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-niywl_DX.js} +892 -893
- package/dist/{RoleList-Cm7_q5l9.js → RoleList-CH6NDKPU.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DrJ1vA88.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-T1ACkX_6.js} +39 -39
- package/dist/ScheduleButton.vue_vue_type_script_setup_true_lang-BzQuLLf5.js +690 -0
- package/dist/{ScheduleGeneralPage-CmR4BZAp.js → ScheduleGeneralPage-DJPENJZ2.js} +96 -99
- package/dist/SchedulePage-C1egcbIC.js +14421 -0
- package/dist/{SchedulePositionPage-Bv3zraaF.js → SchedulePositionPage-OhL_hsqG.js} +10 -10
- package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-B8W4sTsA.js +242 -0
- package/dist/{TeamMemberList-D2OfkfJP.js → TeamMemberList-BwfG3go2.js} +8 -9
- package/dist/{TimesheetList-DEdLpYuM.js → TimesheetList-DcoqzbLO.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BfMkNvCz.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-RyhiKTSd.js} +2 -2
- package/dist/{app-Dmmpy4k-.js → app-BcZ6C8M8.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DcfKURXN.js → dayjs.min-Ch0iysTG.js} +1 -1
- package/dist/employee-DwYHFacQ.js +204 -0
- package/dist/{index-BxkisKEs.js → iteration-D1uWLp0V.js} +726 -698
- package/dist/{lodash-p40sRkqQ.js → lodash-DErxm7xf.js} +1 -1
- package/dist/{role-CM1urkJZ.js → role-B9VanAny.js} +3 -4
- package/dist/{rule-BPApyMJY.js → rule-C4f_Ilzr.js} +36 -37
- package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +5 -1
- package/dist/src/views/scheduling/components/ScheduleGridSkeleton.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +18 -2
- package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +4 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +4 -0
- package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +2 -2
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +4 -0
- package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +21 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +11 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +10 -11
- package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +5 -3
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +7 -1
- package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +11 -2
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +11 -0
- package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +4 -1
- package/dist/src/views/scheduling/schedule-store.d.ts +25 -0
- package/dist/src/views/scheduling/types.d.ts +5 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-5EhPvVT9.js → useReportPermissions-CTr56kBo.js} +3 -3
- package/package.json +1 -1
- package/dist/ScheduleButton.vue_vue_type_script_setup_true_lang-DX5JR7bi.js +0 -600
- package/dist/SchedulePage-CN3ZsQ9E.js +0 -13905
- package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-Buu8NEQf.js +0 -221
- package/dist/employee-D3ZpYH4j.js +0 -139
- package/dist/index-D-VlxJu9.js +0 -70
- package/dist/iteration-CcXrOMQe.js +0 -30
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Y, useAttrs as Z, computed as h, ref as m, watch as ee, nextTick as N, onBeforeUnmount as te, createElementBlock as a, openBlock as l, normalizeClass as C, createElementVNode as f, createBlock as ne, mergeProps as oe, toDisplayString as v, Teleport as le, createCommentVNode as g, withDirectives as ie, vModelText as ae, Fragment as D, renderList as se, createTextVNode as ue } from "vue";
|
|
2
|
-
const re = ["disabled", "aria-expanded"], ce = { class: "sch" }, de = {
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "fx-pop-head"
|
|
5
|
-
}, fe = {
|
|
6
|
-
key: 1,
|
|
7
|
-
class: "fx-pop-search"
|
|
8
|
-
}, pe = {
|
|
9
|
-
key: 2,
|
|
10
|
-
class: "fx-opt is-off"
|
|
11
|
-
}, he = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "fx-grp"
|
|
14
|
-
}, me = ["aria-selected", "onClick"], ve = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "fx-opt-text"
|
|
17
|
-
}, ye = { key: 0 }, ke = /* @__PURE__ */ Y({
|
|
18
|
-
inheritAttrs: !1,
|
|
19
|
-
__name: "ScheduleSelect",
|
|
20
|
-
props: {
|
|
21
|
-
modelValue: {},
|
|
22
|
-
options: {},
|
|
23
|
-
disabled: { type: Boolean },
|
|
24
|
-
menuTitle: {},
|
|
25
|
-
searchable: { type: Boolean }
|
|
26
|
-
},
|
|
27
|
-
emits: ["update:modelValue"],
|
|
28
|
-
setup(c, { emit: z }) {
|
|
29
|
-
const i = c, L = z, P = Z(), U = h(() => P.class ?? ""), u = m(!1), $ = m(null), y = m(null), b = m(null), I = h(
|
|
30
|
-
() => {
|
|
31
|
-
var e;
|
|
32
|
-
return ((e = i.options.find((n) => n.value === i.modelValue)) == null ? void 0 : e.label) ?? "";
|
|
33
|
-
}
|
|
34
|
-
), B = h(() => !!i.menuTitle || i.options.some((e) => e.hint)), p = m(""), H = m(null), S = h(() => {
|
|
35
|
-
const e = p.value.trim().toLowerCase();
|
|
36
|
-
return !i.searchable || !e ? i.options : i.options.filter((n) => `${n.label} ${n.hint ?? ""}`.toLowerCase().includes(e));
|
|
37
|
-
}), T = h(() => {
|
|
38
|
-
const e = [];
|
|
39
|
-
let n;
|
|
40
|
-
for (const t of S.value)
|
|
41
|
-
t.group !== n && (n = t.group, n && e.push({ heading: n })), e.push({ option: t });
|
|
42
|
-
return e;
|
|
43
|
-
}), k = 5, r = 8;
|
|
44
|
-
function w() {
|
|
45
|
-
const e = b.value, n = y.value;
|
|
46
|
-
if (!e || !n) return;
|
|
47
|
-
const t = n.getBoundingClientRect(), o = window.innerWidth || document.documentElement.clientWidth, s = window.innerHeight || document.documentElement.clientHeight;
|
|
48
|
-
e.style.minWidth = `${Math.round(t.width)}px`, e.style.maxWidth = `${Math.max(180, Math.round(o - r * 2))}px`;
|
|
49
|
-
const x = s - t.bottom - k - r, J = t.top - k - r;
|
|
50
|
-
e.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(x, J)))}px`;
|
|
51
|
-
const E = e.offsetHeight, Q = e.offsetWidth;
|
|
52
|
-
let V = t.bottom + k;
|
|
53
|
-
V + E > s - r && (V = t.top - k - E >= r ? t.top - k - E : Math.max(r, s - E - r));
|
|
54
|
-
const X = Math.min(Math.max(r, t.left), Math.max(r, o - Q - r));
|
|
55
|
-
e.style.top = `${Math.round(V)}px`, e.style.left = `${Math.round(X)}px`, e.style.visibility = "visible";
|
|
56
|
-
}
|
|
57
|
-
function _(e) {
|
|
58
|
-
var t, o;
|
|
59
|
-
const n = e.target;
|
|
60
|
-
n && ((t = $.value) != null && t.contains(n) || (o = b.value) != null && o.contains(n)) || d();
|
|
61
|
-
}
|
|
62
|
-
function A(e) {
|
|
63
|
-
const n = b.value, t = e.target;
|
|
64
|
-
if (n && t && t !== document && n.contains(t)) return;
|
|
65
|
-
const o = y.value;
|
|
66
|
-
if (!o) return;
|
|
67
|
-
const s = o.getBoundingClientRect(), x = window.innerHeight || document.documentElement.clientHeight;
|
|
68
|
-
if (s.bottom < 0 || s.top > x) {
|
|
69
|
-
d();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
w();
|
|
73
|
-
}
|
|
74
|
-
function R() {
|
|
75
|
-
document.addEventListener("click", _), document.addEventListener("scroll", A, !0), window.addEventListener("resize", d);
|
|
76
|
-
}
|
|
77
|
-
function W() {
|
|
78
|
-
document.removeEventListener("click", _), document.removeEventListener("scroll", A, !0), window.removeEventListener("resize", d);
|
|
79
|
-
}
|
|
80
|
-
async function M() {
|
|
81
|
-
var e, n, t;
|
|
82
|
-
i.disabled || u.value || (p.value = "", u.value = !0, await N(), w(), (e = H.value) == null || e.focus(), (t = (n = b.value) == null ? void 0 : n.querySelector(".fx-opt.is-on")) == null || t.scrollIntoView({ block: "nearest" }), R());
|
|
83
|
-
}
|
|
84
|
-
function d() {
|
|
85
|
-
u.value && (u.value = !1, p.value = "", W());
|
|
86
|
-
}
|
|
87
|
-
ee(p, async () => {
|
|
88
|
-
u.value && (await N(), w());
|
|
89
|
-
});
|
|
90
|
-
function j(e) {
|
|
91
|
-
var n;
|
|
92
|
-
if (e.key === "Escape")
|
|
93
|
-
e.preventDefault(), d(), (n = y.value) == null || n.focus();
|
|
94
|
-
else if (e.key === "Enter") {
|
|
95
|
-
e.preventDefault();
|
|
96
|
-
const t = S.value.find((o) => !o.disabled);
|
|
97
|
-
t && K(t);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function q() {
|
|
101
|
-
u.value ? d() : M();
|
|
102
|
-
}
|
|
103
|
-
function K(e) {
|
|
104
|
-
e.disabled || (d(), e.value !== i.modelValue && L("update:modelValue", e.value));
|
|
105
|
-
}
|
|
106
|
-
const F = h(() => i.options.filter((e) => !e.disabled));
|
|
107
|
-
function G(e) {
|
|
108
|
-
const n = F.value;
|
|
109
|
-
if (!n.length) {
|
|
110
|
-
M();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const t = n.findIndex((x) => x.value === i.modelValue), o = e === "Home" ? 0 : e === "End" ? n.length - 1 : e === "ArrowDown" ? Math.min(n.length - 1, (t < 0 ? -1 : t) + 1) : Math.max(0, (t < 0 ? 1 : t) - 1), s = n[o];
|
|
114
|
-
s && s.value !== i.modelValue ? L("update:modelValue", s.value) : M();
|
|
115
|
-
}
|
|
116
|
-
function O(e) {
|
|
117
|
-
var n;
|
|
118
|
-
if (e.key === "Escape") {
|
|
119
|
-
if (!u.value) return;
|
|
120
|
-
e.preventDefault(), d(), (n = y.value) == null || n.focus();
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
124
|
-
e.preventDefault(), q();
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Home" && e.key !== "End" || (e.preventDefault(), G(e.key));
|
|
128
|
-
}
|
|
129
|
-
return te(W), (e, n) => (l(), a("div", {
|
|
130
|
-
ref_key: "rootEl",
|
|
131
|
-
ref: $,
|
|
132
|
-
class: C(["fx-sel", U.value])
|
|
133
|
-
}, [
|
|
134
|
-
f("button", oe({
|
|
135
|
-
ref_key: "btnEl",
|
|
136
|
-
ref: y
|
|
137
|
-
}, e.$attrs, {
|
|
138
|
-
type: "button",
|
|
139
|
-
class: ["rebus-input fx-btn", { "is-open": u.value }],
|
|
140
|
-
disabled: c.disabled,
|
|
141
|
-
"aria-haspopup": "listbox",
|
|
142
|
-
"aria-expanded": u.value,
|
|
143
|
-
onClick: n[0] || (n[0] = (t) => q()),
|
|
144
|
-
onKeydown: O
|
|
145
|
-
}), v(I.value), 17, re),
|
|
146
|
-
(l(), ne(le, { to: "body" }, [
|
|
147
|
-
f("div", ce, [
|
|
148
|
-
u.value ? (l(), a("div", {
|
|
149
|
-
key: 0,
|
|
150
|
-
ref_key: "popEl",
|
|
151
|
-
ref: b,
|
|
152
|
-
class: C(["fx-pop", { "fx-pop-rich": B.value }]),
|
|
153
|
-
role: "listbox",
|
|
154
|
-
style: { visibility: "hidden" }
|
|
155
|
-
}, [
|
|
156
|
-
c.menuTitle ? (l(), a("div", de, v(c.menuTitle), 1)) : g("", !0),
|
|
157
|
-
c.searchable ? (l(), a("div", fe, [
|
|
158
|
-
ie(f("input", {
|
|
159
|
-
ref_key: "searchEl",
|
|
160
|
-
ref: H,
|
|
161
|
-
"onUpdate:modelValue": n[1] || (n[1] = (t) => p.value = t),
|
|
162
|
-
class: "rebus-input fx-pop-q",
|
|
163
|
-
type: "search",
|
|
164
|
-
placeholder: "Search",
|
|
165
|
-
autocomplete: "off",
|
|
166
|
-
spellcheck: "false",
|
|
167
|
-
"aria-label": "Search",
|
|
168
|
-
onKeydown: j
|
|
169
|
-
}, null, 544), [
|
|
170
|
-
[ae, p.value]
|
|
171
|
-
])
|
|
172
|
-
])) : g("", !0),
|
|
173
|
-
c.searchable && !T.value.length ? (l(), a("div", pe, "No matches")) : g("", !0),
|
|
174
|
-
(l(!0), a(D, null, se(T.value, (t, o) => (l(), a(D, { key: o }, [
|
|
175
|
-
"heading" in t ? (l(), a("div", he, v(t.heading), 1)) : (l(), a("div", {
|
|
176
|
-
key: 1,
|
|
177
|
-
class: C(["fx-opt", {
|
|
178
|
-
"is-on": t.option.value === c.modelValue,
|
|
179
|
-
"is-off": t.option.disabled,
|
|
180
|
-
"is-new": t.option.command
|
|
181
|
-
}]),
|
|
182
|
-
role: "option",
|
|
183
|
-
"aria-selected": t.option.value === c.modelValue,
|
|
184
|
-
onClick: (s) => K(t.option)
|
|
185
|
-
}, [
|
|
186
|
-
n[2] || (n[2] = f("span", {
|
|
187
|
-
class: "fx-tick",
|
|
188
|
-
"aria-hidden": "true"
|
|
189
|
-
}, [
|
|
190
|
-
f("svg", {
|
|
191
|
-
width: "11",
|
|
192
|
-
height: "11",
|
|
193
|
-
viewBox: "0 0 16 16",
|
|
194
|
-
fill: "none"
|
|
195
|
-
}, [
|
|
196
|
-
f("path", {
|
|
197
|
-
d: "m3.5 8.4 3 3 6-7",
|
|
198
|
-
stroke: "currentColor",
|
|
199
|
-
"stroke-width": "2.2",
|
|
200
|
-
"stroke-linecap": "round",
|
|
201
|
-
"stroke-linejoin": "round"
|
|
202
|
-
})
|
|
203
|
-
])
|
|
204
|
-
], -1)),
|
|
205
|
-
B.value ? (l(), a("span", ve, [
|
|
206
|
-
f("b", null, v(t.option.label), 1),
|
|
207
|
-
t.option.hint ? (l(), a("small", ye, v(t.option.hint), 1)) : g("", !0)
|
|
208
|
-
])) : (l(), a(D, { key: 1 }, [
|
|
209
|
-
ue(v(t.option.label), 1)
|
|
210
|
-
], 64))
|
|
211
|
-
], 10, me))
|
|
212
|
-
], 64))), 128))
|
|
213
|
-
], 2)) : g("", !0)
|
|
214
|
-
])
|
|
215
|
-
]))
|
|
216
|
-
], 2));
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
export {
|
|
220
|
-
ke as _
|
|
221
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { d as w } from "./dayjs.min-DcfKURXN.js";
|
|
2
|
-
import { defineStore as D, storeToRefs as U } from "pinia";
|
|
3
|
-
import { ref as u } from "vue";
|
|
4
|
-
import { E as r } from "./index-D-VlxJu9.js";
|
|
5
|
-
import { s as y } from "./iteration-CcXrOMQe.js";
|
|
6
|
-
import { i as g } from "./utils-BZkjJbju.js";
|
|
7
|
-
import { u as I } from "./role-CM1urkJZ.js";
|
|
8
|
-
import { u as f } from "./restaurant-BTpBmfBV.js";
|
|
9
|
-
async function T(a) {
|
|
10
|
-
const i = I().roles.value, { restaurants: c } = f(), p = new Map(
|
|
11
|
-
c.value.map((e) => [e._id, e.profile.name])
|
|
12
|
-
), l = new Map(i.map((e) => [e._id, e.name])), s = /* @__PURE__ */ new Map();
|
|
13
|
-
for (const e of a) {
|
|
14
|
-
const o = {
|
|
15
|
-
restaurantId: e.restaurantId,
|
|
16
|
-
restaurantName: p.get(e.restaurantId) || "",
|
|
17
|
-
roleId: e.role,
|
|
18
|
-
roleName: l.get(e.role) || ""
|
|
19
|
-
}, m = s.get(e._id);
|
|
20
|
-
if (!m) {
|
|
21
|
-
s.set(e._id, {
|
|
22
|
-
...e,
|
|
23
|
-
isRestricted: !1,
|
|
24
|
-
since: w(g(e._id)).format("DD/MM/YYYY"),
|
|
25
|
-
restaurants: [o]
|
|
26
|
-
});
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
m.restaurants.some((d) => d.restaurantId === e.restaurantId) || (m.restaurants = y([...m.restaurants, o], {
|
|
30
|
-
selector: "restaurantName"
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
return y([...s.values()], { selector: "name" });
|
|
34
|
-
}
|
|
35
|
-
function M(a) {
|
|
36
|
-
const { restaurants: i } = f(), c = I().roles.value, p = new Map(
|
|
37
|
-
i.value.map((e) => [e._id, e])
|
|
38
|
-
), l = new Map(c.map((e) => [e._id, e.name])), s = a.restaurantRole[0];
|
|
39
|
-
return {
|
|
40
|
-
_id: a._id,
|
|
41
|
-
name: a.name,
|
|
42
|
-
code: a.code,
|
|
43
|
-
passcode: a.passcode,
|
|
44
|
-
isMasterUser: a.isMasterUser,
|
|
45
|
-
isRestricted: a.isRestricted,
|
|
46
|
-
restaurantId: (s == null ? void 0 : s.restaurantId) || "",
|
|
47
|
-
role: (s == null ? void 0 : s.roleId) || "",
|
|
48
|
-
since: w(g(a._id)).format("DD/MM/YYYY"),
|
|
49
|
-
restaurants: y(
|
|
50
|
-
a.restaurantRole.map((e) => {
|
|
51
|
-
const o = p.get(e.restaurantId);
|
|
52
|
-
return {
|
|
53
|
-
restaurantId: e.restaurantId,
|
|
54
|
-
restaurantName: (o == null ? void 0 : o.profile.name) || "",
|
|
55
|
-
restaurantCode: (o == null ? void 0 : o.profile.code) ?? void 0,
|
|
56
|
-
roleId: e.roleId,
|
|
57
|
-
roleName: l.get(e.roleId) || ""
|
|
58
|
-
};
|
|
59
|
-
}),
|
|
60
|
-
{ selector: "restaurantName" }
|
|
61
|
-
)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const j = D("employee", () => {
|
|
65
|
-
const a = f(), i = u([]), c = u([]), p = u(0), l = u(!1);
|
|
66
|
-
async function s() {
|
|
67
|
-
try {
|
|
68
|
-
l.value = !0, await a.readRestaurants();
|
|
69
|
-
const t = await r.readEmployees();
|
|
70
|
-
i.value = await T(t);
|
|
71
|
-
} finally {
|
|
72
|
-
l.value = !1;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function e(t) {
|
|
76
|
-
try {
|
|
77
|
-
l.value = !0, await a.readRestaurants();
|
|
78
|
-
const n = await r.readEmployeesPage(t);
|
|
79
|
-
c.value = n.items.map(M), p.value = n.total;
|
|
80
|
-
} finally {
|
|
81
|
-
l.value = !1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function o(t, n) {
|
|
85
|
-
await a.readRestaurants();
|
|
86
|
-
const E = n ?? (await r.readEmployeesPage({ ...t, limit: 1, offset: 0 })).total;
|
|
87
|
-
return E === 0 ? [] : (await r.readEmployeesPage({ ...t, limit: E, offset: 0 })).items.map(M);
|
|
88
|
-
}
|
|
89
|
-
async function m(t) {
|
|
90
|
-
await r.createEmployee(t);
|
|
91
|
-
}
|
|
92
|
-
async function d(t, n) {
|
|
93
|
-
await r.updateEmployee(t, n);
|
|
94
|
-
}
|
|
95
|
-
async function v(t) {
|
|
96
|
-
await r.deleteEmployee(t);
|
|
97
|
-
}
|
|
98
|
-
async function _(t) {
|
|
99
|
-
await r.deleteMasterEmployee(t);
|
|
100
|
-
}
|
|
101
|
-
async function Y(t) {
|
|
102
|
-
await r.createMasterEmployee(t);
|
|
103
|
-
}
|
|
104
|
-
async function N(t, n) {
|
|
105
|
-
await r.updateMasterEmployee(t, n);
|
|
106
|
-
}
|
|
107
|
-
async function S(t, n) {
|
|
108
|
-
await r.migrateToMasterEmployee(t, n);
|
|
109
|
-
}
|
|
110
|
-
async function P() {
|
|
111
|
-
await r.syncUsersMeta();
|
|
112
|
-
}
|
|
113
|
-
return {
|
|
114
|
-
employees: i,
|
|
115
|
-
listEmployees: c,
|
|
116
|
-
totalEmployees: p,
|
|
117
|
-
isLoading: l,
|
|
118
|
-
readEmployees: s,
|
|
119
|
-
readEmployeesPage: e,
|
|
120
|
-
readAllEmployeesPage: o,
|
|
121
|
-
createEmployee: m,
|
|
122
|
-
updateEmployee: d,
|
|
123
|
-
deleteEmployee: v,
|
|
124
|
-
createMasterEmployee: Y,
|
|
125
|
-
updateMasterEmployee: N,
|
|
126
|
-
deleteMasterEmployee: _,
|
|
127
|
-
migrateToMasterUser: S,
|
|
128
|
-
syncUsersMeta: P
|
|
129
|
-
};
|
|
130
|
-
}), z = () => {
|
|
131
|
-
const a = j();
|
|
132
|
-
return {
|
|
133
|
-
...a,
|
|
134
|
-
...U(a)
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
export {
|
|
138
|
-
z as u
|
|
139
|
-
};
|
package/dist/index-D-VlxJu9.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import "./index-BxkisKEs.js";
|
|
2
|
-
import { b as a, g as t } from "./restaurant-BTpBmfBV.js";
|
|
3
|
-
const u = {
|
|
4
|
-
async readEmployees() {
|
|
5
|
-
return t(await a().get("/pos-users"));
|
|
6
|
-
},
|
|
7
|
-
async readEmployeesPage(s) {
|
|
8
|
-
var e, r;
|
|
9
|
-
return t(
|
|
10
|
-
await a().get("/pos-users/paged", {
|
|
11
|
-
params: {
|
|
12
|
-
limit: s.limit,
|
|
13
|
-
offset: s.offset,
|
|
14
|
-
search: s.search,
|
|
15
|
-
restaurantIds: (e = s.restaurantIds) != null && e.length ? s.restaurantIds : void 0,
|
|
16
|
-
roleIds: (r = s.roleIds) != null && r.length ? s.roleIds : void 0
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
);
|
|
20
|
-
},
|
|
21
|
-
async createEmployee(s) {
|
|
22
|
-
await a().post("/pos-users", s);
|
|
23
|
-
},
|
|
24
|
-
async createMasterEmployee(s) {
|
|
25
|
-
await a().post("/pos-users/master-user", s);
|
|
26
|
-
},
|
|
27
|
-
async migrateToMasterEmployee(s, e) {
|
|
28
|
-
await a().put(`/pos-users/migrate/${s}`, e);
|
|
29
|
-
},
|
|
30
|
-
async updateEmployee(s, e) {
|
|
31
|
-
await a().put(`/pos-users/${s}`, e);
|
|
32
|
-
},
|
|
33
|
-
async updateMasterEmployee(s, e) {
|
|
34
|
-
await a().put(`/pos-users/master-user/${s}`, e);
|
|
35
|
-
},
|
|
36
|
-
async deleteEmployee(s) {
|
|
37
|
-
await a().put(`/pos-users/${s._id}`, {
|
|
38
|
-
user: s,
|
|
39
|
-
roles: [],
|
|
40
|
-
previousRoles: s.restaurants.map((e) => ({
|
|
41
|
-
restaurantId: e.restaurantId,
|
|
42
|
-
roleId: e.roleId
|
|
43
|
-
}))
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
async deleteMasterEmployee(s) {
|
|
47
|
-
await a().put(`/pos-users/master-user/${s._id}`, {
|
|
48
|
-
user: s,
|
|
49
|
-
roles: [],
|
|
50
|
-
previousRoles: s.restaurants.map((e) => ({
|
|
51
|
-
restaurantId: e.restaurantId,
|
|
52
|
-
roleId: e.roleId
|
|
53
|
-
}))
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
async generateEmployeePasscode(s) {
|
|
57
|
-
return `${t(
|
|
58
|
-
await a().post("/pos-users/generate-passcode", {
|
|
59
|
-
restaurantIds: s.restaurantIds,
|
|
60
|
-
excludePosUserId: s.excludePosUserId
|
|
61
|
-
})
|
|
62
|
-
)}`;
|
|
63
|
-
},
|
|
64
|
-
async syncUsersMeta() {
|
|
65
|
-
await a().post("/pos-users/create-users-meta");
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
u as E
|
|
70
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
function d(e, r = []) {
|
|
2
|
-
const c = JSON.parse(JSON.stringify(e));
|
|
3
|
-
return r.length > 0 && r.forEach((s) => {
|
|
4
|
-
c[s] !== void 0 && delete c[s];
|
|
5
|
-
}), c;
|
|
6
|
-
}
|
|
7
|
-
function f(e, r) {
|
|
8
|
-
return r === void 0 ? e : typeof r == "function" ? r(e) : `${e[r]}`;
|
|
9
|
-
}
|
|
10
|
-
function g(e, r) {
|
|
11
|
-
return d(e).sort((s, u) => {
|
|
12
|
-
let n = f(s, r == null ? void 0 : r.selector), t = f(u, r == null ? void 0 : r.selector);
|
|
13
|
-
if (r != null && r.descending) {
|
|
14
|
-
const [a, l] = [n, t];
|
|
15
|
-
n = l, t = a;
|
|
16
|
-
}
|
|
17
|
-
return n.localeCompare(t, "en", { numeric: !0, sensitivity: "base" });
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function i(e, r) {
|
|
21
|
-
return e.reduce((c, s) => {
|
|
22
|
-
const u = f(s, r);
|
|
23
|
-
return c[u] = [...c[u] || [], s], c;
|
|
24
|
-
}, {});
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
d as c,
|
|
28
|
-
i as g,
|
|
29
|
-
g as s
|
|
30
|
-
};
|