@feedmepos/mf-hrm-portal 2.2.5-dev.7 → 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.
Files changed (94) hide show
  1. package/dist/{ApprovalCodeList-dn-WwNAd.js → ApprovalCodeList-D5l9vIsE.js} +2 -2
  2. package/dist/{AuditLogList-BqVp9fxD.js → AuditLogList-ByTa5UJY.js} +3 -3
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DnAet2oc.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-mNdn1TYV.js} +2 -2
  4. package/dist/{EmployeeList-BwTJre5k.js → EmployeeList-Bv6ANk-P.js} +8 -9
  5. package/dist/{GrantUserList-CZek1r4F.js → GrantUserList-Bt8w3p4j.js} +3 -3
  6. package/dist/{Main-MjSYZdOq.js → Main-DHJcgePj.js} +5 -5
  7. package/dist/{Main-CbmA-SYo.js → Main-DkP8dWgn.js} +9 -9
  8. package/dist/{Main-DVA51sj2.js → Main-DqiGpT4v.js} +2 -2
  9. package/dist/{PermissionSetList-lkHmXhNm.js → PermissionSetList-BIGv1u67.js} +10 -11
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-cFQDQCal.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-niywl_DX.js} +687 -688
  11. package/dist/{RoleList-BSs0SmFo.js → RoleList-CH6NDKPU.js} +7 -7
  12. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-T1ACkX_6.js +426 -0
  13. package/dist/ScheduleButton.vue_vue_type_script_setup_true_lang-BzQuLLf5.js +690 -0
  14. package/dist/ScheduleGeneralPage-DJPENJZ2.js +320 -0
  15. package/dist/SchedulePage-C1egcbIC.js +14421 -0
  16. package/dist/SchedulePositionPage-OhL_hsqG.js +293 -0
  17. package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-B8W4sTsA.js +242 -0
  18. package/dist/{TeamMemberList-Dit_nV6d.js → TeamMemberList-BwfG3go2.js} +8 -9
  19. package/dist/{TimesheetList-B-FlRO7E.js → TimesheetList-DcoqzbLO.js} +5 -5
  20. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DZUJR8K_.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-RyhiKTSd.js} +2 -2
  21. package/dist/{app-BpnOPodL.js → app-BcZ6C8M8.js} +8 -8
  22. package/dist/app.js +1 -1
  23. package/dist/{dayjs.min-4GLfSOGZ.js → dayjs.min-Ch0iysTG.js} +1 -1
  24. package/dist/employee-DwYHFacQ.js +204 -0
  25. package/dist/{index-DYoVJQTd.js → iteration-D1uWLp0V.js} +726 -698
  26. package/dist/{lodash-CcFIMCiJ.js → lodash-DErxm7xf.js} +1 -1
  27. package/dist/{role-OXCiWTVq.js → role-B9VanAny.js} +3 -4
  28. package/dist/{rule-8iyCO_LZ.js → rule-C4f_Ilzr.js} +36 -37
  29. package/dist/src/api/schedule/index.d.ts +0 -3
  30. package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +1 -2
  31. package/dist/src/views/scheduling/SchedulePage.vue.d.ts +1 -2
  32. package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +1 -2
  33. package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +5 -1
  34. package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +5 -1
  35. package/dist/src/views/scheduling/components/ScheduleAddPositionModal.vue.d.ts +6 -0
  36. package/dist/src/views/scheduling/components/ScheduleAutoScheduleModal.vue.d.ts +5 -1
  37. package/dist/src/views/scheduling/components/ScheduleButton.vue.d.ts +23 -0
  38. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +1 -1
  39. package/dist/src/views/scheduling/components/ScheduleEmployeeMenu.vue.d.ts +6 -0
  40. package/dist/src/views/scheduling/components/ScheduleGridSkeleton.vue.d.ts +2 -0
  41. package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +4 -2
  42. package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +3 -0
  43. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +32 -2
  44. package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +4 -0
  45. package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +5 -1
  46. package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +2 -0
  47. package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +4 -2
  48. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +8 -2
  49. package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +4 -6
  50. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +5 -0
  51. package/dist/src/views/scheduling/composables/schedule-popover-position.d.ts +16 -0
  52. package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +21 -0
  53. package/dist/src/views/scheduling/composables/useCollapsedList.d.ts +9 -0
  54. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +12 -0
  55. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +14 -7
  56. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +11 -2
  57. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +18 -11
  58. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +11 -0
  59. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +5 -3
  60. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +0 -5
  61. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +12 -4
  62. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +7 -1
  63. package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +11 -2
  64. package/dist/src/views/scheduling/composables/useScheduleEmployeeMenu.d.ts +35 -0
  65. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  66. package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +53 -3
  67. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1192 -55
  68. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +1 -0
  69. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +50 -0
  70. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +2 -0
  71. package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +10 -1
  72. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +6 -0
  73. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +5 -5
  74. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +6 -0
  75. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +7 -0
  76. package/dist/src/views/scheduling/composables/useScheduleStaffRail.d.ts +4 -1
  77. package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +6 -1
  78. package/dist/src/views/scheduling/composables/useScheduleViewportFit.d.ts +9 -0
  79. package/dist/src/views/scheduling/data.d.ts +6 -1
  80. package/dist/src/views/scheduling/schedule-store.d.ts +36 -1
  81. package/dist/src/views/scheduling/types.d.ts +14 -1
  82. package/dist/style.css +1 -1
  83. package/dist/tsconfig.app.tsbuildinfo +1 -1
  84. package/dist/{useReportPermissions-C3fuFTUC.js → useReportPermissions-CTr56kBo.js} +3 -3
  85. package/package.json +1 -1
  86. package/dist/ScheduleGeneralPage-DD9n2TUe.js +0 -242
  87. package/dist/SchedulePage-B0X97zVC.js +0 -10761
  88. package/dist/SchedulePositionPage-BXz1USn3.js +0 -220
  89. package/dist/ScheduleSelect.vue_vue_type_script_setup_true_lang-DAHke2rH.js +0 -201
  90. package/dist/employee-ChdVnSmd.js +0 -139
  91. package/dist/index-CilJxsY7.js +0 -70
  92. package/dist/iteration-CcXrOMQe.js +0 -30
  93. package/dist/useScheduleOutlet-TPZJHgSY.js +0 -546
  94. package/dist/useSchedulePositions-DCkaKHQm.js +0 -103
@@ -1,220 +0,0 @@
1
- import { defineComponent as y, onMounted as h, createElementBlock as a, openBlock as d, createElementVNode as s, toDisplayString as l, unref as t, normalizeClass as c, createTextVNode as g, createCommentVNode as _, withDirectives as m, withKeys as u, vModelText as p, Fragment as v, renderList as C, withModifiers as r } from "vue";
2
- import { useRouter as w } from "vue-router";
3
- import { R as $ } from "./app-BpnOPodL.js";
4
- import { x as D, y as A } from "./useScheduleOutlet-TPZJHgSY.js";
5
- import { u as N } from "./useSchedulePositions-DCkaKHQm.js";
6
- import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const x = { class: "sch9" }, M = { class: "main" }, S = {
8
- id: "viewPositions",
9
- class: "view"
10
- }, P = { class: "sp-body" }, B = { class: "sp-content" }, F = { class: "sp-panel" }, V = { class: "cfg-head" }, I = { class: "cfg-count" }, K = { id: "skList" }, L = {
11
- key: 0,
12
- class: "cfg-empty"
13
- }, R = {
14
- key: 1,
15
- class: "cfg-list"
16
- }, U = {
17
- key: 0,
18
- class: "cfg-row"
19
- }, W = { class: "cfg-main" }, j = ["disabled"], T = ["disabled"], q = {
20
- key: 0,
21
- class: "cfg-row"
22
- }, z = { class: "cfg-main" }, H = ["onKeyup"], O = ["disabled", "onClick"], G = ["disabled"], J = ["onClick"], Q = { class: "cfg-main" }, X = { class: "cfg-name" }, Y = {
23
- key: 0,
24
- class: "cfg-confirm"
25
- }, Z = { class: "q" }, ee = ["disabled", "onClick"], te = ["disabled"], se = ["onClick"], oe = ["aria-label", "onClick"], ne = /* @__PURE__ */ y({
26
- __name: "SchedulePositionPage",
27
- setup(ie) {
28
- const f = w(), e = N(), b = D();
29
- h(async () => {
30
- await b.resolve() && await A(/* @__PURE__ */ new Date());
31
- });
32
- function k() {
33
- f.push({ name: $.SCHEDULE });
34
- }
35
- return (ae, o) => (d(), a("div", x, [
36
- s("div", M, [
37
- s("div", S, [
38
- s("div", { class: "sp-head" }, [
39
- s("button", {
40
- type: "button",
41
- class: "sp-back",
42
- onClick: k
43
- }, [...o[10] || (o[10] = [
44
- s("svg", {
45
- width: "12",
46
- height: "12",
47
- viewBox: "0 0 16 16",
48
- fill: "none",
49
- "aria-hidden": "true"
50
- }, [
51
- s("path", {
52
- d: "M10 3.5L5.5 8l4.5 4.5",
53
- stroke: "currentColor",
54
- "stroke-width": "1.7",
55
- "stroke-linecap": "round",
56
- "stroke-linejoin": "round"
57
- })
58
- ], -1),
59
- s("span", null, "Back to schedule", -1)
60
- ])]),
61
- o[11] || (o[11] = s("div", { class: "sp-title" }, "Position", -1)),
62
- o[12] || (o[12] = s("div", { class: "sp-sub" }, "What your staff can do — the same catalogue across every outlet.", -1))
63
- ]),
64
- s("div", P, [
65
- s("div", B, [
66
- s("div", F, [
67
- o[17] || (o[17] = s("div", { class: "cfg-lead" }, " What your staff can do. Positions drive who Auto-Schedule considers for a shift, and the top-ranked position on a person wins when more than one could cover it. ", -1)),
68
- s("div", V, [
69
- o[13] || (o[13] = s("div", { class: "cfg-title" }, "Configured positions", -1)),
70
- s("span", I, l(t(e).count.value), 1),
71
- o[14] || (o[14] = s("span", { class: "cfg-spacer" }, null, -1)),
72
- s("button", {
73
- type: "button",
74
- class: "am-btn am-btn-primary",
75
- onClick: o[0] || (o[0] = (n) => t(e).startAdd())
76
- }, " + Add position ")
77
- ]),
78
- s("div", {
79
- class: c(["ce-err", { show: t(e).error.value }])
80
- }, l(t(e).error.value), 3),
81
- s("div", K, [
82
- !t(e).positions.value.length && !t(e).isAdding.value ? (d(), a("div", L, [...o[15] || (o[15] = [
83
- g(" No positions yet.", -1),
84
- s("br", null, null, -1),
85
- g(" Add one and it becomes assignable on every employee. ", -1)
86
- ])])) : (d(), a("div", R, [
87
- t(e).isAdding.value ? (d(), a("div", U, [
88
- s("div", W, [
89
- m(s("input", {
90
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(e).newName.value = n),
91
- type: "text",
92
- class: "cfg-name-input",
93
- placeholder: "New position name",
94
- autofocus: "",
95
- onKeyup: [
96
- o[2] || (o[2] = u((n) => t(e).confirmAdd(), ["enter"])),
97
- o[3] || (o[3] = u((n) => t(e).cancelAdd(), ["esc"]))
98
- ]
99
- }, null, 544), [
100
- [p, t(e).newName.value]
101
- ])
102
- ]),
103
- s("button", {
104
- type: "button",
105
- class: "cfg-btn",
106
- disabled: !t(e).newName.value.trim() || t(e).saving.value,
107
- onClick: o[4] || (o[4] = (n) => t(e).confirmAdd())
108
- }, l(t(e).saving.value ? "Adding…" : "Add"), 9, j),
109
- s("button", {
110
- type: "button",
111
- class: "cfg-btn",
112
- disabled: t(e).saving.value,
113
- onClick: o[5] || (o[5] = (n) => t(e).cancelAdd())
114
- }, " Cancel ", 8, T)
115
- ])) : _("", !0),
116
- (d(!0), a(v, null, C(t(e).positions.value, (n) => (d(), a(v, {
117
- key: n.id
118
- }, [
119
- t(e).editingId.value === n.id ? (d(), a("div", q, [
120
- s("div", z, [
121
- m(s("input", {
122
- "onUpdate:modelValue": o[6] || (o[6] = (i) => t(e).editingName.value = i),
123
- type: "text",
124
- class: "cfg-name-input",
125
- autofocus: "",
126
- onKeyup: [
127
- u((i) => t(e).saveEdit(n.id), ["enter"]),
128
- o[7] || (o[7] = u((i) => t(e).cancelEdit(), ["esc"]))
129
- ]
130
- }, null, 40, H), [
131
- [p, t(e).editingName.value]
132
- ])
133
- ]),
134
- s("button", {
135
- type: "button",
136
- class: "cfg-btn",
137
- disabled: !t(e).editingName.value.trim() || t(e).saving.value,
138
- onClick: (i) => t(e).saveEdit(n.id)
139
- }, l(t(e).saving.value ? "Saving…" : "Save"), 9, O),
140
- s("button", {
141
- type: "button",
142
- class: "cfg-btn",
143
- disabled: t(e).saving.value,
144
- onClick: o[8] || (o[8] = (i) => t(e).cancelEdit())
145
- }, " Cancel ", 8, G)
146
- ])) : (d(), a("div", {
147
- key: 1,
148
- class: c(["cfg-row", { "is-clickable": t(e).pendingDeleteId.value !== n.id }]),
149
- onClick: (i) => t(e).pendingDeleteId.value !== n.id && t(e).startEdit(n.id)
150
- }, [
151
- s("div", Q, [
152
- s("div", X, l(n.name), 1)
153
- ]),
154
- t(e).pendingDeleteId.value === n.id ? (d(), a("div", Y, [
155
- s("span", Z, l(t(e).usageCountFor(n.name) ? `Remove from ${t(e).usageCountFor(n.name)} staff?` : "Delete?"), 1),
156
- s("button", {
157
- type: "button",
158
- class: "cfg-yes",
159
- disabled: t(e).saving.value,
160
- onClick: r((i) => t(e).confirmDelete(n.id), ["stop"])
161
- }, l(t(e).saving.value ? "Deleting…" : "Delete"), 9, ee),
162
- s("button", {
163
- type: "button",
164
- class: "cfg-no",
165
- disabled: t(e).saving.value,
166
- onClick: o[9] || (o[9] = r((i) => t(e).cancelDelete(), ["stop"]))
167
- }, " Keep ", 8, te)
168
- ])) : (d(), a(v, { key: 1 }, [
169
- s("span", {
170
- class: c(["cfg-used", { none: !t(e).usageCountFor(n.name) }])
171
- }, l(t(e).usageCountFor(n.name) ? `${t(e).usageCountFor(n.name)} staff` : "unused"), 3),
172
- s("button", {
173
- type: "button",
174
- class: "cfg-btn",
175
- onClick: r((i) => t(e).startEdit(n.id), ["stop"])
176
- }, " Edit ", 8, se),
177
- s("button", {
178
- type: "button",
179
- class: "cfg-del",
180
- "aria-label": `Delete ${n.name}`,
181
- onClick: r((i) => t(e).askDelete(n.id), ["stop"])
182
- }, [...o[16] || (o[16] = [
183
- s("svg", {
184
- width: "14",
185
- height: "14",
186
- viewBox: "0 0 16 16",
187
- fill: "none",
188
- "aria-hidden": "true"
189
- }, [
190
- s("path", {
191
- d: "M2.5 4.5h11M6 4.5V3a.8.8 0 0 1 .8-.8h2.4a.8.8 0 0 1 .8.8v1.5M4 4.5l.6 8.2a1 1 0 0 0 1 .93h4.8a1 1 0 0 0 1-.93l.6-8.2",
192
- stroke: "currentColor",
193
- "stroke-width": "1.4",
194
- "stroke-linecap": "round",
195
- "stroke-linejoin": "round"
196
- }),
197
- s("path", {
198
- d: "M6.6 7v4M9.4 7v4",
199
- stroke: "currentColor",
200
- "stroke-width": "1.3",
201
- "stroke-linecap": "round"
202
- })
203
- ], -1)
204
- ])], 8, oe)
205
- ], 64))
206
- ], 10, J))
207
- ], 64))), 128))
208
- ]))
209
- ])
210
- ])
211
- ])
212
- ])
213
- ])
214
- ])
215
- ]));
216
- }
217
- }), ge = /* @__PURE__ */ E(ne, [["__scopeId", "data-v-1c99a674"]]);
218
- export {
219
- ge as default
220
- };
@@ -1,201 +0,0 @@
1
- import { ref as m, reactive as G, computed as b, defineComponent as K, useAttrs as q, onBeforeUnmount as Q, createElementBlock as p, openBlock as d, normalizeClass as L, createElementVNode as h, createBlock as X, mergeProps as Y, toDisplayString as O, Teleport as Z, createCommentVNode as ee, Fragment as J, renderList as te, createTextVNode as oe, nextTick as ne } from "vue";
2
- import { b as a } from "./useScheduleOutlet-TPZJHgSY.js";
3
- const ce = [
4
- { key: "overtime", label: "Overtime" }
5
- ];
6
- function C() {
7
- return JSON.parse(
8
- JSON.stringify({
9
- salesForecast: a.salesForecast,
10
- labourTarget: a.labourTarget,
11
- budgetFromSales: a.budgetFromSales,
12
- budget: a.budget,
13
- payRate: a.payRate,
14
- otCapHours: a.otCapHours,
15
- otBudget: a.otBudget,
16
- notify: a.notify
17
- })
18
- );
19
- }
20
- function de() {
21
- const l = m(!1), y = m("overtime"), n = G(C());
22
- function k(f) {
23
- Object.assign(n, C()), y.value = f ?? "overtime", l.value = !0;
24
- }
25
- const x = b(() => JSON.stringify(n) !== JSON.stringify(C()));
26
- function M() {
27
- return x.value ? !1 : (l.value = !1, !0);
28
- }
29
- function i() {
30
- Object.assign(n, C()), l.value = !1;
31
- }
32
- function S() {
33
- a.salesForecast = n.salesForecast, a.labourTarget = n.labourTarget, a.budgetFromSales = n.budgetFromSales, a.budget = n.budget, a.payRate = JSON.parse(JSON.stringify(n.payRate)), a.otCapHours = n.otCapHours, a.otBudget = n.otBudget, a.notify = JSON.parse(JSON.stringify(n.notify)), l.value = !1;
34
- }
35
- return { isOpen: l, activeSection: y, draft: n, dirty: x, open: k, close: M, discard: i, save: S };
36
- }
37
- const ae = ["disabled", "aria-expanded"], ie = { class: "sch9" }, se = {
38
- key: 0,
39
- class: "fx-grp"
40
- }, le = ["aria-selected", "onClick"], fe = /* @__PURE__ */ K({
41
- inheritAttrs: !1,
42
- __name: "ScheduleSelect",
43
- props: {
44
- modelValue: {},
45
- options: {},
46
- disabled: { type: Boolean }
47
- },
48
- emits: ["update:modelValue"],
49
- setup(l, { emit: y }) {
50
- const n = l, k = y, x = q(), M = b(() => x.class ?? ""), i = m(!1), S = m(null), f = m(null), E = m(null), _ = b(
51
- () => {
52
- var e;
53
- return ((e = n.options.find((t) => t.value === n.modelValue)) == null ? void 0 : e.label) ?? "";
54
- }
55
- ), $ = b(() => {
56
- const e = [];
57
- let t;
58
- for (const o of n.options)
59
- o.group !== t && (t = o.group, t && e.push({ heading: t })), e.push({ option: o });
60
- return e;
61
- }), v = 5, r = 8;
62
- function B() {
63
- const e = E.value, t = f.value;
64
- if (!e || !t) return;
65
- const o = t.getBoundingClientRect(), u = window.innerWidth || document.documentElement.clientWidth, s = window.innerHeight || document.documentElement.clientHeight;
66
- e.style.minWidth = `${Math.round(o.width)}px`, e.style.maxWidth = `${Math.max(180, Math.round(u - r * 2))}px`;
67
- const g = s - o.bottom - v - r, z = o.top - v - r;
68
- e.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(g, z)))}px`;
69
- const w = e.offsetHeight, P = e.offsetWidth;
70
- let N = o.bottom + v;
71
- N + w > s - r && (N = o.top - v - w >= r ? o.top - v - w : Math.max(r, s - w - r));
72
- const U = Math.min(Math.max(r, o.left), Math.max(r, u - P - r));
73
- e.style.top = `${Math.round(N)}px`, e.style.left = `${Math.round(U)}px`, e.style.visibility = "visible";
74
- }
75
- function H(e) {
76
- var o;
77
- const t = e.target;
78
- t && ((o = S.value) != null && o.contains(t)) || c();
79
- }
80
- function T(e) {
81
- const t = E.value, o = e.target;
82
- if (t && o && o !== document && t.contains(o)) return;
83
- const u = f.value;
84
- if (!u) return;
85
- const s = u.getBoundingClientRect(), g = window.innerHeight || document.documentElement.clientHeight;
86
- if (s.bottom < 0 || s.top > g) {
87
- c();
88
- return;
89
- }
90
- B();
91
- }
92
- function A() {
93
- document.addEventListener("click", H), document.addEventListener("scroll", T, !0), window.addEventListener("resize", c);
94
- }
95
- function D() {
96
- document.removeEventListener("click", H), document.removeEventListener("scroll", T, !0), window.removeEventListener("resize", c);
97
- }
98
- async function V() {
99
- var e, t;
100
- n.disabled || i.value || (i.value = !0, await ne(), B(), (t = (e = E.value) == null ? void 0 : e.querySelector(".fx-opt.is-on")) == null || t.scrollIntoView({ block: "nearest" }), A());
101
- }
102
- function c() {
103
- i.value && (i.value = !1, D());
104
- }
105
- function F() {
106
- i.value ? c() : V();
107
- }
108
- function R(e) {
109
- e.disabled || (c(), e.value !== n.modelValue && k("update:modelValue", e.value));
110
- }
111
- const W = b(() => n.options.filter((e) => !e.disabled));
112
- function I(e) {
113
- const t = W.value;
114
- if (!t.length) {
115
- V();
116
- return;
117
- }
118
- const o = t.findIndex((g) => g.value === n.modelValue), u = e === "Home" ? 0 : e === "End" ? t.length - 1 : e === "ArrowDown" ? Math.min(t.length - 1, (o < 0 ? -1 : o) + 1) : Math.max(0, (o < 0 ? 1 : o) - 1), s = t[u];
119
- s && s.value !== n.modelValue ? k("update:modelValue", s.value) : V();
120
- }
121
- function j(e) {
122
- var t;
123
- if (e.key === "Escape") {
124
- if (!i.value) return;
125
- e.preventDefault(), c(), (t = f.value) == null || t.focus();
126
- return;
127
- }
128
- if (e.key === "Enter" || e.key === " ") {
129
- e.preventDefault(), F();
130
- return;
131
- }
132
- e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Home" && e.key !== "End" || (e.preventDefault(), I(e.key));
133
- }
134
- return Q(D), (e, t) => (d(), p("div", {
135
- ref_key: "rootEl",
136
- ref: S,
137
- class: L(["fx-sel", M.value])
138
- }, [
139
- h("button", Y({
140
- ref_key: "btnEl",
141
- ref: f
142
- }, e.$attrs, {
143
- type: "button",
144
- class: ["fx-btn", { "is-open": i.value }],
145
- disabled: l.disabled,
146
- "aria-haspopup": "listbox",
147
- "aria-expanded": i.value,
148
- onClick: t[0] || (t[0] = (o) => F()),
149
- onKeydown: j
150
- }), O(_.value), 17, ae),
151
- (d(), X(Z, { to: "body" }, [
152
- h("div", ie, [
153
- i.value ? (d(), p("div", {
154
- key: 0,
155
- ref_key: "popEl",
156
- ref: E,
157
- class: "fx-pop",
158
- role: "listbox",
159
- style: { visibility: "hidden" }
160
- }, [
161
- (d(!0), p(J, null, te($.value, (o, u) => (d(), p(J, { key: u }, [
162
- "heading" in o ? (d(), p("div", se, O(o.heading), 1)) : (d(), p("div", {
163
- key: 1,
164
- class: L(["fx-opt", { "is-on": o.option.value === l.modelValue, "is-off": o.option.disabled }]),
165
- role: "option",
166
- "aria-selected": o.option.value === l.modelValue,
167
- onClick: (s) => R(o.option)
168
- }, [
169
- t[1] || (t[1] = h("span", {
170
- class: "fx-tick",
171
- "aria-hidden": "true"
172
- }, [
173
- h("svg", {
174
- width: "11",
175
- height: "11",
176
- viewBox: "0 0 16 16",
177
- fill: "none"
178
- }, [
179
- h("path", {
180
- d: "m3.5 8.4 3 3 6-7",
181
- stroke: "currentColor",
182
- "stroke-width": "2.2",
183
- "stroke-linecap": "round",
184
- "stroke-linejoin": "round"
185
- })
186
- ])
187
- ], -1)),
188
- oe(" " + O(o.option.label), 1)
189
- ], 10, le))
190
- ], 64))), 128))
191
- ], 512)) : ee("", !0)
192
- ])
193
- ]))
194
- ], 2));
195
- }
196
- });
197
- export {
198
- ce as S,
199
- fe as _,
200
- de as u
201
- };
@@ -1,139 +0,0 @@
1
- import { d as w } from "./dayjs.min-4GLfSOGZ.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-CilJxsY7.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-OXCiWTVq.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
- };
@@ -1,70 +0,0 @@
1
- import "./index-DYoVJQTd.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
- };