@feedmepos/mf-hrm-portal 2.0.19 → 2.0.20-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.
Files changed (66) hide show
  1. package/dist/AuditLogList-ChxAzO74.js +1037 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-Cs-Mn6UA.js +843 -0
  4. package/dist/FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js +45 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  6. package/dist/{Main-BPM7QyFL.js → Main-B9_TyRDo.js} +2009 -2005
  7. package/dist/Main-CdHW4UkN.js +90 -0
  8. package/dist/Main-DcvmP7s-.js +574 -0
  9. package/dist/PermissionSetList-VFVS0g0v.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js +3444 -0
  11. package/dist/RoleList-BZ6RZvm2.js +556 -0
  12. package/dist/TeamMemberList-C-zhFauD.js +1115 -0
  13. package/dist/{TimesheetList-CdWXksIf.js → TimesheetList-CZex54an.js} +129 -115
  14. package/dist/{app-D6OxaCEx.js → app-CLL3p27X.js} +699 -653
  15. package/dist/app.js +1 -1
  16. package/dist/{dayjs.min-C0I-OiL6.js → dayjs.min-CDt1i9vl.js} +1 -1
  17. package/dist/employee-BpRvjWNh.js +200 -0
  18. package/dist/{iteration-CcZFMm5X.js → iteration-BVjUzYL5.js} +9314 -9272
  19. package/dist/{lodash-CW7MBjcM.js → lodash-CrwgACp2.js} +1 -1
  20. package/dist/{rule-6Lg9M_3I.js → rule-BlQ5YZ9Z.js} +274 -275
  21. package/dist/src/api/audit-log/index.d.ts +9 -0
  22. package/dist/src/api/index.d.ts +0 -1
  23. package/dist/src/api/restaurant/index.d.ts +5 -0
  24. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  25. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  26. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  27. package/dist/src/composables/useBasePermission.d.ts +1 -0
  28. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  29. package/dist/src/stores/restaurant.d.ts +181 -0
  30. package/dist/src/stores/role.d.ts +7 -7
  31. package/dist/src/stores/team.d.ts +6 -6
  32. package/dist/src/types/restaurant.d.ts +11 -0
  33. package/dist/src/types/team.d.ts +2 -1
  34. package/dist/src/views/hr/locales/index.d.ts +16 -0
  35. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
  36. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  37. package/dist/src/views/team/locales/index.d.ts +32 -0
  38. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  39. package/dist/src/views/team/member/TeamMemberMasterUser.vue.d.ts +3 -3
  40. package/dist/style.css +1 -1
  41. package/dist/{timesheet-CaSIm-Rv.js → timesheet-jFs4GTAL.js} +2 -2
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/useAppStore-DMAL8VFY.js +169 -0
  44. package/dist/useDebounce-CWb5QR9G.js +28 -0
  45. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  46. package/dist/{useLoading-cnpr1-pP.js → useLoading-AFTjRLyO.js} +1 -1
  47. package/dist/{useReportPermissions-CNr0AdOf.js → useReportPermissions-hODG0Xx3.js} +3 -3
  48. package/package.json +1 -1
  49. package/dist/AuditLogList-Bw3sRBhW.js +0 -980
  50. package/dist/EmployeeList-C4tVWPJE.js +0 -736
  51. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  52. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  53. package/dist/Main-BC20s7cs.js +0 -560
  54. package/dist/Main-eN8MDWpv.js +0 -85
  55. package/dist/PermissionSetList-CPSRrCsu.js +0 -341
  56. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CXt721Zo.js +0 -3480
  57. package/dist/RoleList-tRu19xyl.js +0 -530
  58. package/dist/TeamMemberList-CvitYIKw.js +0 -1114
  59. package/dist/TeamMemberList.vue_vue_type_style_index_0_scoped_473cbd86_lang-BDjrD45a.js +0 -34
  60. package/dist/employee-yT17VCCS.js +0 -204
  61. package/dist/src/api/account/index.d.ts +0 -4
  62. package/dist/src/composables/useSupportedCountries.d.ts +0 -5
  63. package/dist/useAppStore-CONZvtGc.js +0 -171
  64. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  65. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  66. package/dist/useSearch-B6WK1LBB.js +0 -15
@@ -0,0 +1,347 @@
1
+ import { defineComponent as H, ref as d, computed as b, watch as ne, resolveComponent as h, createBlock as M, openBlock as L, unref as r, withCtx as j, createVNode as p, createElementVNode as A, toDisplayString as ie, nextTick as ae, onMounted as le, createElementBlock as re, Fragment as me, h as S } from "vue";
2
+ import { useI18n as Q, useCoreStore as ce } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Y, useDialog as ue, useBreakpoints as de, components as J } from "@feedmepos/ui-library";
4
+ import { _ as pe } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
5
+ import { u as fe, _ as ve } from "./useDiscardConfirm-DPhEV6v0.js";
6
+ import { u as Z, c as ee, d as se, p as X, i as Se, b as be, m as O, l as he, n as Pe, s as _e, o as ge, v as ye } from "./rule-BlQ5YZ9Z.js";
7
+ import { l as q } from "./lodash-CrwgACp2.js";
8
+ import { d as we, A as Fe } from "./iteration-BVjUzYL5.js";
9
+ import { u as ke } from "./useLoading-AFTjRLyO.js";
10
+ import { b as G } from "./app-CLL3p27X.js";
11
+ import { _ as xe } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js";
12
+ const Ve = { class: "fm-typo-en-title-md-600" }, Ce = { class: "flex items-center justify-start gap-8" }, Re = /* @__PURE__ */ H({
13
+ __name: "PermissionSetForm",
14
+ props: {
15
+ modelValue: {
16
+ type: Object,
17
+ default: () => ({})
18
+ }
19
+ },
20
+ setup(K, { expose: D }) {
21
+ const s = K, { t: a } = Q(), f = d(!1), B = b(() => {
22
+ var e;
23
+ return (e = s.modelValue) != null && e.id ? a("permissionSet.form.update.title") : a("permissionSet.form.create.title");
24
+ }), x = d(), N = Y(), V = ke(N), P = Z(), l = d({ ...s.modelValue }), i = d([]), c = d([]), C = [(e) => !!e || a("permissionSet.form.nameRequired")], z = b(() => {
25
+ var e;
26
+ return (e = s.modelValue) != null && e.id ? a("permissionSet.form.update.confirmButtonLabel") : a("permissionSet.form.create.confirmButtonLabel");
27
+ }), T = b(
28
+ () => P.permissionSets.value.filter((e) => {
29
+ var o;
30
+ return e.id !== ((o = s.modelValue) == null ? void 0 : o.id);
31
+ }).map((e) => ({ label: e.name, value: e.id }))
32
+ ), g = b(
33
+ () => ee(i.value, P.permissionSets.value)
34
+ ), {
35
+ fetchCustomReportPermissions: U,
36
+ customReportPermissions: $,
37
+ isLoaded: n
38
+ } = se(), t = new Set(
39
+ X.filter((e) => e.subject.startsWith(Se)).map((e) => e.subject)
40
+ ), m = b(() => {
41
+ const e = new Set(t);
42
+ for (const o of $.value) e.add(o.subject);
43
+ return e;
44
+ }), y = b(() => {
45
+ const e = /* @__PURE__ */ new Set();
46
+ for (const o of X)
47
+ o.category === G.reports && e.add(o.subject);
48
+ for (const o of $.value)
49
+ o.category === G.reports && e.add(o.subject);
50
+ return e;
51
+ }), v = d({ name: "", permissionSetIds: [], userPermissions: [] });
52
+ async function _() {
53
+ var o, u;
54
+ await ae(), f.value = !f.value, l.value = { ...s.modelValue }, i.value = ((o = s.modelValue) == null ? void 0 : o.permissionSetIds) ?? [];
55
+ const e = ((u = s.modelValue) == null ? void 0 : u.permissions) ?? [];
56
+ c.value = be(
57
+ O(g.value),
58
+ e
59
+ ), v.value = {
60
+ name: l.value.name ?? "",
61
+ permissionSetIds: [...i.value],
62
+ userPermissions: we(c.value)
63
+ };
64
+ }
65
+ ne(f, async (e) => {
66
+ e && await U();
67
+ });
68
+ const w = fe(
69
+ () => !q.isEqual(l.value.name ?? "", v.value.name) || !q.isEqual(i.value, v.value.permissionSetIds) || !q.isEqual(c.value, v.value.userPermissions),
70
+ () => {
71
+ f.value = !1;
72
+ }
73
+ );
74
+ function W() {
75
+ const e = O(g.value), o = n.value ? m.value : t, u = he(c.value, o), F = Pe(u, y.value), k = _e(F);
76
+ return ge(e, k);
77
+ }
78
+ function oe() {
79
+ c.value = O(g.value);
80
+ }
81
+ async function te() {
82
+ var u, F;
83
+ const e = await ((u = x.value) == null ? void 0 : u.validateInputsWithoutSubmit()), o = (F = ce().currentBusiness.value) == null ? void 0 : F.id;
84
+ !(e != null && e.length) && o && V.minor(async () => {
85
+ var R;
86
+ const k = W();
87
+ if ((R = s.modelValue) != null && R.id) {
88
+ const I = {
89
+ name: l.value.name,
90
+ permissions: k,
91
+ permissionSetIds: i.value,
92
+ businessId: l.value.businessId
93
+ };
94
+ await P.updatePermissionSet(s.modelValue.id, I);
95
+ } else {
96
+ const I = {
97
+ name: l.value.name,
98
+ businessId: o,
99
+ permissions: k,
100
+ permissionSetIds: i.value
101
+ };
102
+ await P.createPermissionSet(I);
103
+ }
104
+ f.value = !1;
105
+ });
106
+ }
107
+ return D({
108
+ trigger: _
109
+ }), (e, o) => {
110
+ const u = h("FmTextField"), F = h("FmSelect"), k = h("FmForm"), R = h("FmButton"), I = h("FmSideSheet");
111
+ return L(), M(I, {
112
+ "model-value": f.value,
113
+ "max-width": 960,
114
+ "onOn:clickedAway": r(w),
115
+ "onOn:close": r(w)
116
+ }, {
117
+ "side-sheet-header": j(() => [
118
+ A("p", Ve, ie(B.value), 1)
119
+ ]),
120
+ "side-sheet-footer": j(() => [
121
+ A("div", Ce, [
122
+ p(R, {
123
+ label: z.value,
124
+ size: "md",
125
+ variant: "primary",
126
+ type: "submit",
127
+ onClick: te
128
+ }, null, 8, ["label"]),
129
+ p(R, {
130
+ label: r(a)("common.cancel"),
131
+ size: "md",
132
+ variant: "secondary",
133
+ onClick: r(w)
134
+ }, null, 8, ["label", "onClick"])
135
+ ])
136
+ ]),
137
+ default: j(() => [
138
+ p(k, {
139
+ ref_key: "formRef",
140
+ ref: x
141
+ }, {
142
+ default: j(() => [
143
+ p(u, {
144
+ modelValue: l.value.name,
145
+ "onUpdate:modelValue": o[0] || (o[0] = (E) => l.value.name = E),
146
+ label: r(a)("permissionSet.form.name"),
147
+ placeholder: r(a)("permissionSet.form.namePlaceholder"),
148
+ rules: C
149
+ }, null, 8, ["modelValue", "label", "placeholder"]),
150
+ p(F, {
151
+ modelValue: i.value,
152
+ "onUpdate:modelValue": [
153
+ o[1] || (o[1] = (E) => i.value = E),
154
+ oe
155
+ ],
156
+ multiselect: "",
157
+ searchable: "",
158
+ "search-debounce": 300,
159
+ items: T.value,
160
+ label: r(a)("permissionSet.form.includedSets"),
161
+ placeholder: r(a)("permissionSet.form.includedSetsPlaceholder"),
162
+ class: "mt-16"
163
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
164
+ p(xe, {
165
+ modelValue: c.value,
166
+ "onUpdate:modelValue": o[2] || (o[2] = (E) => c.value = E),
167
+ "inherit-permissions": g.value,
168
+ class: "mt-24"
169
+ }, null, 8, ["modelValue", "inherit-permissions"])
170
+ ]),
171
+ _: 1
172
+ }, 512)
173
+ ]),
174
+ _: 1
175
+ }, 8, ["model-value", "onOn:clickedAway", "onOn:close"]);
176
+ };
177
+ }
178
+ }), Ie = { class: "space-y-8" }, Ee = { class: "flex justify-end xs:px-16" }, We = /* @__PURE__ */ H({
179
+ __name: "PermissionSetList",
180
+ setup(K, { expose: D }) {
181
+ const { t: s } = Q(), { customReportPermissions: a, fetchCustomReportPermissions: f } = se(), B = Y(), x = ue(), { breakpoints: N } = de(), V = d(""), P = b(() => {
182
+ var n;
183
+ return (n = c.value) == null ? void 0 : n.filter((t) => {
184
+ const m = V.value.toLowerCase();
185
+ return t.name.toLowerCase().includes(m);
186
+ });
187
+ }), l = d(), i = Z(), c = b(
188
+ () => i.permissionSets.value
189
+ ), C = d();
190
+ async function z() {
191
+ await i.readPermissionSets();
192
+ }
193
+ function T(n) {
194
+ var t;
195
+ C.value = n, (t = l.value) == null || t.trigger();
196
+ }
197
+ const g = [
198
+ {
199
+ accessorKey: "name",
200
+ header: () => s("permissionSet.table.columns.name")
201
+ },
202
+ {
203
+ accessorKey: "permission",
204
+ header: () => s("permissionSet.table.columns.permissions"),
205
+ enableSorting: !1,
206
+ cell(n) {
207
+ const t = n.row.original, m = ee(
208
+ [t.id],
209
+ i.permissionSets.value
210
+ ), y = O(m), v = y.length, _ = ye(
211
+ y,
212
+ a.value
213
+ );
214
+ return S("div", { class: "flex items-center gap-8" }, [
215
+ S("span", s("team.labels.allowed", { count: v })),
216
+ S(
217
+ J.FmTooltip,
218
+ { variant: "plain", placement: "top" },
219
+ {
220
+ default: () => S(J.FmIcon, {
221
+ name: "info",
222
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
223
+ }),
224
+ content: () => S("div", [
225
+ s("team.labels.permission"),
226
+ ..._.map(
227
+ (w, W) => S("div", { key: `${w}-${W}` }, `- ${w}`)
228
+ )
229
+ ])
230
+ }
231
+ )
232
+ ]);
233
+ }
234
+ },
235
+ {
236
+ id: "action",
237
+ size: 52,
238
+ meta: {
239
+ cellClass: "pl-16",
240
+ headerContentClass: "-mx-16"
241
+ },
242
+ cell(n) {
243
+ const t = n.row.original;
244
+ return S(
245
+ "div",
246
+ {
247
+ class: "flex w-full items-center justify-end",
248
+ onClick: (m) => m.stopPropagation()
249
+ },
250
+ [
251
+ S(ve, {
252
+ items: [
253
+ { label: s("common.update"), onClick: () => T(t) },
254
+ {
255
+ label: s("common.remove"),
256
+ onClick: () => $(t),
257
+ itemClass: "text-fm-color-typo-error"
258
+ }
259
+ ]
260
+ })
261
+ ]
262
+ );
263
+ },
264
+ enableSorting: !1
265
+ }
266
+ ];
267
+ function U() {
268
+ var n;
269
+ C.value = void 0, (n = l.value) == null || n.trigger();
270
+ }
271
+ async function $(n) {
272
+ x.open({
273
+ title: s("permissionSet.form.delete.title"),
274
+ message: s("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
275
+ minWidth: N.value.lg ? 588 : 0,
276
+ primaryActions: {
277
+ text: s("common.remove"),
278
+ close: !1,
279
+ variant: "destructive"
280
+ },
281
+ secondaryActions: { text: s("common.cancel"), close: !0 }
282
+ }).onPrimary(async () => {
283
+ try {
284
+ await i.deletePermissionSet(n.id), B.open({
285
+ message: s("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
286
+ type: "success"
287
+ });
288
+ } catch (t) {
289
+ const m = t instanceof Fe && t.status === 409 ? t.message.includes("referenced by") ? s("permissionSet.form.delete.setReferencedConflictError", {
290
+ permissionSetName: n.name
291
+ }) : s("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
292
+ B.open({ message: m, type: "error" });
293
+ }
294
+ x.close();
295
+ });
296
+ }
297
+ return le(() => {
298
+ z(), f();
299
+ }), D({
300
+ create: U
301
+ }), (n, t) => {
302
+ const m = h("FmSearch"), y = h("FmTable"), v = h("FullWrapper");
303
+ return L(), re(me, null, [
304
+ p(Re, {
305
+ ref_key: "permissionSetFormRef",
306
+ ref: l,
307
+ "model-value": C.value
308
+ }, null, 8, ["model-value"]),
309
+ A("div", Ie, [
310
+ A("div", Ee, [
311
+ p(m, {
312
+ modelValue: V.value,
313
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => V.value = _),
314
+ class: "w-[320px] xs:w-full",
315
+ autofocus: "",
316
+ placeholder: r(s)("permissionSet.search.placeholder")
317
+ }, null, 8, ["modelValue", "placeholder"])
318
+ ]),
319
+ c.value.length > 0 ? (L(), M(v, {
320
+ key: 0,
321
+ class: "overflow-auto"
322
+ }, {
323
+ default: j(() => [
324
+ p(y, {
325
+ "column-defs": g,
326
+ "row-data": P.value,
327
+ "page-size": P.value.length,
328
+ "pin-header-row": "",
329
+ "hide-footer": "",
330
+ "shrink-at": !1,
331
+ onRowClick: t[1] || (t[1] = (_) => T(_.original))
332
+ }, null, 8, ["row-data", "page-size"])
333
+ ]),
334
+ _: 1
335
+ })) : (L(), M(r(pe), {
336
+ key: 1,
337
+ title: r(s)("permissionSet.noData.title"),
338
+ subtitle: r(s)("permissionSet.noData.subtitle")
339
+ }, null, 8, ["title", "subtitle"]))
340
+ ])
341
+ ], 64);
342
+ };
343
+ }
344
+ });
345
+ export {
346
+ We as default
347
+ };