@feedmepos/mf-hrm-portal 2.3.0-dev.2 → 2.3.0-dev.21

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 (127) hide show
  1. package/dist/{ApprovalCodeList-CJaNPHZC.js → ApprovalCodeList-DuPmMQ8Z.js} +7 -7
  2. package/dist/{AuditLogList-CHA98ZqW.js → AuditLogList-BeRA_284.js} +18 -19
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C7rvthEI.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-StnBAQOk.js} +2 -2
  4. package/dist/{EmployeeList-CVmMKt71.js → EmployeeList-qmjsbCjj.js} +255 -266
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-oQJgMciC.js} +6 -6
  6. package/dist/{GrantUserList-MYjgt5-F.js → GrantUserList--WUK7zrV.js} +8 -8
  7. package/dist/{Main-hlcHtrsc.js → Main-9X2iCXoX.js} +5 -5
  8. package/dist/{Main-C0cnqQ3B.js → Main-BIAeEQV9.js} +8 -8
  9. package/dist/{Main-BgB9lD4K.js → Main-tPL_YTwT.js} +11 -11
  10. package/dist/{PermissionSetList-5f1WIaVa.js → PermissionSetList-ByTyQe0s.js} +19 -18
  11. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bp9WwlnI.js +4167 -0
  12. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fe-Rdwn4.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js} +1 -1
  13. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  14. package/dist/{RoleList-DNR4miXr.js → RoleList-INlydQmP.js} +21 -20
  15. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-d8KDvgNu.js +530 -0
  16. package/dist/ScheduleGeneralPage-DbOoP9Ez.js +776 -0
  17. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-UowMybGr.js +2439 -0
  18. package/dist/SchedulePage-CjOZtRlK.js +19291 -0
  19. package/dist/{SchedulePositionPage-DyRckyUx.js → SchedulePositionPage-CnDqkvL9.js} +78 -80
  20. package/dist/{SelectFilter-CG13h83-.js → SelectFilter-BWw4B9tM.js} +1 -1
  21. package/dist/{TeamMemberList-mw5OveZG.js → TeamMemberList-BgYtoXht.js} +27 -27
  22. package/dist/{TimesheetList-BzXarZbM.js → TimesheetList-Dg0QYsWO.js} +52 -53
  23. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dq5i4poN.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-eTd4J1CB.js} +3 -3
  24. package/dist/{app-DSsdRLHg.js → app-CDo04LrB.js} +2891 -2474
  25. package/dist/app.js +1 -1
  26. package/dist/{approval-code-C9DmR4Md.js → approval-code-BXUiojPH.js} +1 -1
  27. package/dist/{dayjs.min-B6xBXQtU.js → dayjs.min-KFBmxZF3.js} +1 -1
  28. package/dist/{employee-hMhzuqk1.js → employee-BRaYoaOY.js} +4 -4
  29. package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-CBJ3gEgW.js} +1 -1
  30. package/dist/{iteration-B34AvpNC.js → iteration-p-TjO05t.js} +1 -1
  31. package/dist/{lodash-1Vyuy7Mu.js → lodash-D72lpJgs.js} +1 -1
  32. package/dist/object-Dwyg2LgX.js +16 -0
  33. package/dist/{restaurant-D7PEQjPY.js → restaurant-D2mfKHaH.js} +48 -48
  34. package/dist/{role-DKOrgO6f.js → role-a35Vc8gC.js} +2 -2
  35. package/dist/{rule-CBzQ3GeV.js → rule-BRRw0K7p.js} +3 -3
  36. package/dist/src/api/schedule/index.d.ts +9 -1
  37. package/dist/src/components/layout/SchedulePromoBanner.vue.d.ts +2 -0
  38. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  39. package/dist/src/types/schedule.d.ts +3 -4
  40. package/dist/src/views/audit-log/locales/index.d.ts +252 -0
  41. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +4 -8
  42. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -4
  43. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
  44. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
  45. package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +5 -0
  46. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +0 -6
  47. package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
  48. package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +0 -1
  49. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +4 -1
  50. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
  51. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +5 -0
  52. package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +0 -1
  53. package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleOnboardingAssignPositionModal.vue.d.ts} +2 -2
  54. package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
  55. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  56. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
  57. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
  58. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
  59. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +4 -2
  60. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
  61. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +4 -0
  62. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +1 -3
  63. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
  64. package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
  65. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
  66. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +3 -0
  67. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +6 -0
  68. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +29 -11
  69. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
  70. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
  71. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -9
  72. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +11 -3
  73. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +86 -11
  74. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
  75. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
  76. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -1
  77. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +16 -5
  78. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
  79. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +13 -3
  80. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
  81. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +20 -7
  82. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
  83. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +5 -1
  84. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +5 -0
  85. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -2
  86. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  87. package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +1 -1
  88. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +47 -3
  89. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +408 -29
  90. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +11 -8
  91. package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +3 -1
  92. package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
  93. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
  94. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
  95. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +7 -1
  96. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +2 -0
  97. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +70 -4
  98. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
  99. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
  100. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +41 -3
  101. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
  102. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +47 -6
  103. package/dist/src/views/scheduling/country-rules/index.d.ts +9 -4
  104. package/dist/src/views/scheduling/data.d.ts +22 -1
  105. package/dist/src/views/scheduling/locales/index.d.ts +28 -0
  106. package/dist/src/views/scheduling/schedule-state.d.ts +272 -208
  107. package/dist/src/views/scheduling/schedule-store.d.ts +36 -11
  108. package/dist/src/views/scheduling/types.d.ts +30 -5
  109. package/dist/style.css +1 -1
  110. package/dist/tsconfig.app.tsbuildinfo +1 -1
  111. package/dist/{useAppStore-d_nHyK5u.js → useAppStore-DZCdxlCd.js} +1 -1
  112. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  113. package/dist/{useLoading-JFoghhRz.js → useLoading-Nygx2zn8.js} +1 -1
  114. package/dist/{useReportPermissions-B2ev0j4w.js → useReportPermissions-Ca-9DEOI.js} +3 -3
  115. package/package.json +1 -1
  116. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CFoTAGIX.js +0 -4167
  117. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B4VUyKW3.js +0 -470
  118. package/dist/ScheduleGeneralPage-Cd5AlY4z.js +0 -666
  119. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-Cf0l2MRg.js +0 -2188
  120. package/dist/SchedulePage-C8m0-m3l.js +0 -18257
  121. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  122. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
  123. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
  124. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
  125. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
  126. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
  127. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -1,470 +0,0 @@
1
- import { ref as f, watch as he, computed as N, reactive as ge, nextTick as ke, defineComponent as be, createBlock as J, openBlock as h, withCtx as x, createElementVNode as n, createVNode as B, toDisplayString as v, unref as R, createElementBlock as $, withDirectives as ae, withKeys as we, vModelText as le, normalizeClass as te, createTextVNode as T, createCommentVNode as U, Fragment as ne, renderList as Ie } from "vue";
2
- import { ap as W, a as Pe, aq as $e, ar as oe, f as q, as as Ce, at as Se, E as Q, p as G, am as Ee, ak as O } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-Cf0l2MRg.js";
3
- import { useI18n as Ne } from "@feedmepos/mf-common";
4
- function se() {
5
- return W.map((e) => ({ id: e.id, name: e.name }));
6
- }
7
- function aa(e = {}) {
8
- const s = f(se());
9
- he(
10
- () => W.map((d) => `${d.id}:${d.name}`).join(" "),
11
- () => {
12
- s.value = se();
13
- }
14
- );
15
- const b = N(() => Pe()), a = f(!1), t = f(""), i = f(null), w = f(!1), y = f(null);
16
- function z(d) {
17
- return b.value.filter((g) => g.positions.includes(d)).length;
18
- }
19
- function j(d) {
20
- return s.value.some((g) => g.name.toLowerCase() === d.toLowerCase());
21
- }
22
- function C() {
23
- a.value = !0, t.value = "", i.value = null, y.value = null;
24
- }
25
- function D() {
26
- a.value = !1, t.value = "";
27
- }
28
- async function M() {
29
- var g, p;
30
- const d = t.value.trim().slice(0, 40);
31
- if (!(!d || j(d))) {
32
- w.value = !0, y.value = null;
33
- try {
34
- await oe({ name: d }), a.value = !1, t.value = "", (g = e.notify) == null || g.call(e, "Position added", "success");
35
- } catch (I) {
36
- y.value = I instanceof Error ? I.message : "Could not add this position", (p = e.notify) == null || p.call(e, y.value, "error");
37
- } finally {
38
- w.value = !1;
39
- }
40
- }
41
- }
42
- function S(d) {
43
- i.value = d;
44
- }
45
- function L() {
46
- i.value = null;
47
- }
48
- async function H(d) {
49
- var g, p;
50
- w.value = !0, y.value = null;
51
- try {
52
- await $e(d), i.value = null, (g = e.notify) == null || g.call(e, "Position removed", "success");
53
- } catch (I) {
54
- y.value = I instanceof Error ? I.message : "Could not delete this position", (p = e.notify) == null || p.call(e, y.value, "error");
55
- } finally {
56
- w.value = !1;
57
- }
58
- }
59
- const F = N(() => s.value.length);
60
- return {
61
- positions: s,
62
- count: F,
63
- isAdding: a,
64
- newName: t,
65
- pendingDeleteId: i,
66
- saving: w,
67
- error: y,
68
- usageCountFor: z,
69
- startAdd: C,
70
- cancelAdd: D,
71
- confirmAdd: M,
72
- askDelete: S,
73
- cancelDelete: L,
74
- confirmDelete: H
75
- };
76
- }
77
- function pe(e) {
78
- var b;
79
- const s = e.trim().split(/\s+/).filter(Boolean);
80
- return s.length ? (s[0][0] + (((b = s[1]) == null ? void 0 : b[0]) ?? "")).toUpperCase() : "??";
81
- }
82
- function la(e, s = {}) {
83
- const b = f(!1), a = f(""), t = f(""), i = ge({}), w = f(!1), y = f(null), z = f(null), j = f(!1), C = f(null);
84
- let D = "", M = /* @__PURE__ */ new Set();
85
- const S = N(() => {
86
- var o;
87
- const l = new Map((((o = q.value) == null ? void 0 : o.employees) ?? []).map((u) => [u.employeeId, u]));
88
- return Ce.value.map((u) => {
89
- var r;
90
- const m = l.get(u._id), k = [
91
- (r = m == null ? void 0 : m.primaryPosition) == null ? void 0 : r.positionName,
92
- ...((m == null ? void 0 : m.secondaryPositions) ?? []).map((A) => A.positionName)
93
- ].filter((A) => !!A);
94
- return { employeeId: u._id, name: u.name, initials: pe(u.name), held: k };
95
- });
96
- }), L = N(() => {
97
- const l = t.value.trim().toLowerCase();
98
- return S.value.filter((o) => !l || o.name.toLowerCase().includes(l));
99
- }), H = N(
100
- () => S.value.filter((l) => i[l.employeeId]).map((l) => l.employeeId)
101
- ), F = N(
102
- () => L.value.length > 0 && L.value.every((l) => i[l.employeeId])
103
- ), d = N(() => a.value.trim().slice(0, 40)), g = N(
104
- () => !!d.value && W.some(
105
- (l) => l.id !== C.value && l.name.toLowerCase() === d.value.toLowerCase()
106
- )
107
- ), p = N(() => !!d.value && !g.value && !w.value);
108
- function I() {
109
- a.value = "", t.value = "", Object.keys(i).forEach((l) => delete i[l]), y.value = null, j.value = !1, z.value = null, C.value = null, D = "", M = /* @__PURE__ */ new Set();
110
- }
111
- function ie() {
112
- I(), b.value = !0;
113
- }
114
- function de(l, o) {
115
- I(), C.value = l, a.value = o, D = o, M = new Set(
116
- S.value.filter((u) => u.held.includes(o)).map((u) => u.employeeId)
117
- ), M.forEach((u) => i[u] = !0), b.value = !0;
118
- }
119
- function ue() {
120
- b.value = !1, I();
121
- }
122
- function me(l) {
123
- i[l] = !i[l];
124
- }
125
- function ce() {
126
- if (F.value) {
127
- Object.keys(i).forEach((l) => delete i[l]);
128
- return;
129
- }
130
- L.value.forEach((l) => i[l.employeeId] = !0);
131
- }
132
- function X(l, o) {
133
- const u = !!(l != null && l.primaryPosition), m = ((l == null ? void 0 : l.secondaryPositions) ?? []).map((k) => k.positionName);
134
- return {
135
- ...u ? {} : { primaryPosition: G(o) },
136
- secondaryPositions: (u ? [...m, o] : m).map((k) => G(k)).filter((k) => !!k)
137
- };
138
- }
139
- async function re() {
140
- var k;
141
- const l = d.value;
142
- await oe({ name: l }), await ke(), e == null || e(l);
143
- const o = S.value.filter((r) => i[r.employeeId]), m = (await Promise.allSettled(
144
- o.map((r) => {
145
- var c;
146
- const A = (c = q.value) == null ? void 0 : c.employees.find((P) => P.employeeId === r.employeeId);
147
- return Q(r.employeeId, {
148
- employeeName: r.name,
149
- ...X(A, l)
150
- });
151
- })
152
- )).filter((r) => r.status === "rejected").length;
153
- return z.value = { name: l, assigned: o.length - m, failed: m }, (k = s.notify) == null || k.call(
154
- s,
155
- m ? `Position added, but ${m} employee assignment${m === 1 ? "" : "s"} failed` : "Position added",
156
- m ? "error" : "success"
157
- ), !0;
158
- }
159
- async function ve(l) {
160
- var A;
161
- const o = d.value;
162
- await Se(l, { name: o }), e == null || e(o);
163
- const u = S.value.filter(
164
- (c) => i[c.employeeId] && !M.has(c.employeeId)
165
- ), m = S.value.filter(
166
- (c) => !i[c.employeeId] && M.has(c.employeeId)
167
- ), r = (await Promise.allSettled([
168
- ...u.map((c) => {
169
- var V;
170
- const P = (V = q.value) == null ? void 0 : V.employees.find((K) => K.employeeId === c.employeeId);
171
- return Q(c.employeeId, {
172
- employeeName: c.name,
173
- ...X(P, o)
174
- });
175
- }),
176
- ...m.map((c) => {
177
- var _, ee;
178
- const P = (_ = q.value) == null ? void 0 : _.employees.find((E) => E.employeeId === c.employeeId), V = ((P == null ? void 0 : P.secondaryPositions) ?? []).map((E) => E.positionName).filter((E) => E !== D), K = ((ee = P == null ? void 0 : P.primaryPosition) == null ? void 0 : ee.positionName) === D, fe = K ? V.shift() : void 0;
179
- return Q(c.employeeId, {
180
- employeeName: c.name,
181
- ...K ? { primaryPosition: G(fe ?? "") ?? null } : {},
182
- secondaryPositions: V.map((E) => G(E)).filter((E) => !!E)
183
- });
184
- })
185
- ])).filter((c) => c.status === "rejected").length;
186
- return z.value = { name: o, assigned: Math.max(0, u.length - r), failed: r }, (A = s.notify) == null || A.call(
187
- s,
188
- r ? `Position updated, but ${r} employee assignment${r === 1 ? "" : "s"} failed` : "Position updated",
189
- r ? "error" : "success"
190
- ), !0;
191
- }
192
- async function Y() {
193
- var l;
194
- if (!d.value)
195
- return j.value = !0, !1;
196
- if (!p.value) return !1;
197
- w.value = !0, y.value = null;
198
- try {
199
- return await (C.value ? ve(C.value) : re());
200
- } catch (o) {
201
- return y.value = o instanceof Error ? o.message : `Could not ${C.value ? "save" : "add"} this position`, (l = s.notify) == null || l.call(s, y.value, "error"), !1;
202
- } finally {
203
- w.value = !1;
204
- }
205
- }
206
- function Z() {
207
- I();
208
- }
209
- async function ye() {
210
- await Y() && Z();
211
- }
212
- return {
213
- open: b,
214
- name: a,
215
- search: t,
216
- picks: i,
217
- saving: w,
218
- error: y,
219
- done: z,
220
- nameError: j,
221
- people: S,
222
- visible: L,
223
- pickedIds: H,
224
- allPicked: F,
225
- nameTaken: g,
226
- canSave: p,
227
- editingId: C,
228
- openNew: ie,
229
- openEdit: de,
230
- close: ue,
231
- toggle: me,
232
- toggleAll: ce,
233
- save: Y,
234
- saveAndAnother: ye,
235
- another: Z
236
- };
237
- }
238
- const Ae = { class: "am-head" }, xe = {
239
- id: "schedule-position-title",
240
- class: "am-title"
241
- }, Me = { class: "ce-body" }, Te = { key: 0 }, Oe = { class: "ce-field" }, ze = {
242
- class: "ce-field asg-field",
243
- style: { "margin-bottom": "0" }
244
- }, De = { class: "asg-head" }, Le = { class: "asg-count" }, je = { class: "asg-list" }, Ve = ["checked", "onChange"], Be = { class: "asg-av" }, Fe = { class: "asg-id" }, Ke = { class: "asg-nm" }, Re = { class: "asg-sub" }, Ue = { key: 1 }, qe = {
245
- key: 0,
246
- class: "asg-sub",
247
- style: { padding: "10px" }
248
- }, Ge = { key: 1 }, He = { class: "cg-done" }, Je = { class: "cg-st-main" }, Qe = {
249
- key: 0,
250
- class: "cg-done-also"
251
- }, We = { class: "am-foot" }, Xe = {
252
- key: 0,
253
- class: "am-foot-btns"
254
- }, Ye = {
255
- key: 1,
256
- class: "am-foot-btns"
257
- }, ta = /* @__PURE__ */ be({
258
- __name: "ScheduleAddPositionModal",
259
- props: {
260
- modal: {}
261
- },
262
- setup(e) {
263
- const { t: s } = Ne();
264
- return (b, a) => (h(), J(Ee, {
265
- open: e.modal.open.value,
266
- "panel-class": "ce-modal",
267
- "panel-style": "width: min(480px, 95vw)",
268
- "labelled-by": "schedule-position-title",
269
- onClose: a[11] || (a[11] = (t) => e.modal.close())
270
- }, {
271
- default: x(() => [
272
- n("div", Ae, [
273
- n("div", xe, v(e.modal.editingId.value ? R(s)("scheduling.positionModal.editTitle") : R(s)("scheduling.positionModal.addTitle")), 1),
274
- B(O, {
275
- hierarchy: "ghost",
276
- size: "xs",
277
- "icon-only": "",
278
- class: "ce-close-x",
279
- type: "button",
280
- "aria-label": "Close",
281
- onClick: a[0] || (a[0] = (t) => e.modal.close())
282
- }, {
283
- default: x(() => [...a[12] || (a[12] = [
284
- n("svg", {
285
- width: "20",
286
- height: "20",
287
- viewBox: "0 0 20 20",
288
- fill: "none",
289
- stroke: "currentColor",
290
- "stroke-width": "1.8",
291
- "stroke-linecap": "round",
292
- "aria-hidden": "true"
293
- }, [
294
- n("path", { d: "M5.5 5.5l9 9M14.5 5.5l-9 9" })
295
- ], -1)
296
- ])]),
297
- _: 1
298
- })
299
- ]),
300
- n("div", Me, [
301
- e.modal.done.value ? (h(), $("div", Ge, [
302
- n("div", He, [
303
- a[16] || (a[16] = n("span", {
304
- class: "cg-done-tick",
305
- "aria-hidden": "true"
306
- }, "✓", -1)),
307
- n("div", Je, [
308
- n("b", null, v(e.modal.done.value.name), 1),
309
- n("small", null, v(e.modal.editingId.value ? "Position updated" : e.modal.done.value.assigned ? `Added to ${e.modal.done.value.assigned} ${e.modal.done.value.assigned === 1 ? "employee" : "employees"}` : "Position added"), 1)
310
- ])
311
- ]),
312
- e.modal.done.value.failed ? (h(), $("div", Qe, v(e.modal.done.value.failed) + " " + v(e.modal.done.value.failed === 1 ? "employee" : "employees") + " could not be updated. Add the position to them from their profile. ", 1)) : U("", !0)
313
- ])) : (h(), $("div", Te, [
314
- n("div", Oe, [
315
- a[13] || (a[13] = n("label", {
316
- class: "ce-label",
317
- for: "skName"
318
- }, "Position name", -1)),
319
- ae(n("input", {
320
- id: "skName",
321
- "onUpdate:modelValue": a[1] || (a[1] = (t) => e.modal.name.value = t),
322
- class: "sch-input ce-input",
323
- maxlength: "40",
324
- placeholder: "e.g. FOH, Kitchen, Manager, Cashier…",
325
- autocomplete: "off",
326
- onInput: a[2] || (a[2] = (t) => e.modal.nameError.value = !1),
327
- onKeyup: a[3] || (a[3] = we((t) => e.modal.save(), ["enter"]))
328
- }, null, 544), [
329
- [le, e.modal.name.value]
330
- ]),
331
- n("div", {
332
- class: te(["ce-err", { show: e.modal.nameError.value || e.modal.nameTaken.value }])
333
- }, v(e.modal.nameTaken.value ? "A position with this name already exists" : "Give the position a name"), 3)
334
- ]),
335
- n("div", ze, [
336
- n("div", De, [
337
- a[14] || (a[14] = n("span", { class: "asg-lbl" }, "Employees with this position", -1)),
338
- B(O, {
339
- hierarchy: "ghost",
340
- size: "sm",
341
- class: "ce-add-link asg-all",
342
- type: "button",
343
- onClick: a[4] || (a[4] = (t) => e.modal.toggleAll())
344
- }, {
345
- default: x(() => [
346
- T(v(e.modal.allPicked.value ? "Clear all" : "Select all"), 1)
347
- ]),
348
- _: 1
349
- }),
350
- n("span", Le, v(e.modal.pickedIds.value.length) + " selected", 1)
351
- ]),
352
- ae(n("input", {
353
- "onUpdate:modelValue": a[5] || (a[5] = (t) => e.modal.search.value = t),
354
- class: "sch-input ce-input asg-search",
355
- placeholder: "Search team…",
356
- autocomplete: "off"
357
- }, null, 512), [
358
- [le, e.modal.search.value]
359
- ]),
360
- n("div", je, [
361
- (h(!0), $(ne, null, Ie(e.modal.visible.value, (t) => (h(), $("label", {
362
- key: t.employeeId,
363
- class: "asg-row"
364
- }, [
365
- n("input", {
366
- type: "checkbox",
367
- class: "sch-checkbox asg-check",
368
- checked: !!e.modal.picks[t.employeeId],
369
- onChange: (i) => e.modal.toggle(t.employeeId),
370
- "data-platform": "desktop"
371
- }, null, 40, Ve),
372
- n("span", Be, v(t.initials), 1),
373
- n("span", Fe, [
374
- n("span", Ke, v(t.name), 1),
375
- n("span", Re, [
376
- t.held.length ? (h(), $(ne, { key: 0 }, [
377
- T(v(t.held.join(", ")), 1)
378
- ], 64)) : (h(), $("i", Ue, "No positions added"))
379
- ])
380
- ])
381
- ]))), 128)),
382
- e.modal.visible.value.length ? U("", !0) : (h(), $("div", qe, " No one matches. "))
383
- ]),
384
- a[15] || (a[15] = n("div", { class: "ce-hint" }, "Ticked people can work this position.", -1))
385
- ]),
386
- n("div", {
387
- class: te(["ce-err", { show: !!e.modal.error.value }])
388
- }, v(e.modal.error.value), 3)
389
- ]))
390
- ]),
391
- n("div", We, [
392
- a[19] || (a[19] = n("div", { class: "am-cost-preview" }, null, -1)),
393
- e.modal.done.value ? (h(), $("div", Ye, [
394
- e.modal.editingId.value ? U("", !0) : (h(), J(O, {
395
- key: 0,
396
- hierarchy: "secondary",
397
- size: "sm",
398
- class: "am-btn am-btn-sec",
399
- type: "button",
400
- onClick: a[9] || (a[9] = (t) => e.modal.another())
401
- }, {
402
- default: x(() => [...a[18] || (a[18] = [
403
- T("Add another", -1)
404
- ])]),
405
- _: 1
406
- })),
407
- B(O, {
408
- hierarchy: "primary",
409
- size: "sm",
410
- class: "am-btn am-btn-primary",
411
- type: "button",
412
- onClick: a[10] || (a[10] = (t) => e.modal.close())
413
- }, {
414
- default: x(() => [
415
- T(v(R(s)("scheduling.common.done")), 1)
416
- ]),
417
- _: 1
418
- })
419
- ])) : (h(), $("div", Xe, [
420
- B(O, {
421
- hierarchy: "secondary",
422
- size: "sm",
423
- class: "am-btn am-btn-sec",
424
- type: "button",
425
- onClick: a[6] || (a[6] = (t) => e.modal.close())
426
- }, {
427
- default: x(() => [
428
- T(v(R(s)("scheduling.common.cancel")), 1)
429
- ]),
430
- _: 1
431
- }),
432
- e.modal.editingId.value ? U("", !0) : (h(), J(O, {
433
- key: 0,
434
- hierarchy: "secondary",
435
- size: "sm",
436
- class: "am-btn am-btn-sec",
437
- type: "button",
438
- disabled: !e.modal.canSave.value,
439
- onClick: a[7] || (a[7] = (t) => e.modal.saveAndAnother())
440
- }, {
441
- default: x(() => [...a[17] || (a[17] = [
442
- T(" Save & add another ", -1)
443
- ])]),
444
- _: 1
445
- }, 8, ["disabled"])),
446
- B(O, {
447
- hierarchy: "primary",
448
- size: "sm",
449
- class: "am-btn am-btn-primary",
450
- type: "button",
451
- disabled: !e.modal.canSave.value,
452
- onClick: a[8] || (a[8] = (t) => e.modal.save())
453
- }, {
454
- default: x(() => [
455
- T(v(e.modal.editingId.value ? e.modal.saving.value ? "Saving…" : "Save changes" : e.modal.saving.value ? "Adding…" : "Add position"), 1)
456
- ]),
457
- _: 1
458
- }, 8, ["disabled"])
459
- ]))
460
- ])
461
- ]),
462
- _: 1
463
- }, 8, ["open"]));
464
- }
465
- });
466
- export {
467
- ta as _,
468
- la as a,
469
- aa as u
470
- };