@feedmepos/mf-hrm-portal 2.0.17-dev.4 → 2.0.17-dev.5

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 (54) hide show
  1. package/dist/AuditLogList-Dl3Nmf00.js +1011 -0
  2. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
  3. package/dist/EmployeeList-DBd_rVW2.js +831 -0
  4. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +34 -0
  5. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  6. package/dist/{Main-BAx-c_oZ.js → Main-CQ3KwxDY.js} +1368 -1371
  7. package/dist/{Main-CyReTP3K.js → Main-pTgqNncY.js} +128 -128
  8. package/dist/{Main-CfAQYaaW.js → Main-w0XUUaBp.js} +16 -14
  9. package/dist/PermissionSetList-B8qNOWH6.js +347 -0
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js +3443 -0
  11. package/dist/RoleList-DMFJsUZv.js +545 -0
  12. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +16 -0
  13. package/dist/TeamMemberList-BLRTfKLz.js +1031 -0
  14. package/dist/{TimesheetList-NRUfSiYL.js → TimesheetList-Bwp9_xHe.js} +6 -6
  15. package/dist/{app-B0bANDrM.js → app-COJbSNM4.js} +759 -711
  16. package/dist/app.js +1 -1
  17. package/dist/{dayjs.min-DdUO0d-2.js → dayjs.min-CcBi6N-K.js} +1 -1
  18. package/dist/{employee-DJDUT0Wj.js → employee-xiV0LfnL.js} +3 -3
  19. package/dist/{iteration-DqYIXL4P.js → iteration-JOKbtlLf.js} +1 -1
  20. package/dist/{lodash-BBQT31li.js → lodash-D5xlVzib.js} +1 -1
  21. package/dist/{rule-T7VKkRdN.js → rule-3sXHiW0y.js} +179 -181
  22. package/dist/src/api/audit-log/index.d.ts +9 -0
  23. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  24. package/dist/src/components/CollapsibleWrapper.vue.d.ts +2 -0
  25. package/dist/src/components/Skeleton.vue.d.ts +7 -0
  26. package/dist/src/composables/useBasePermission.d.ts +1 -0
  27. package/dist/src/stores/team.d.ts +6 -6
  28. package/dist/src/types/team.d.ts +1 -1
  29. package/dist/src/views/hr/locales/index.d.ts +16 -0
  30. package/dist/src/views/team/components/BasePermission.vue.d.ts +3 -7
  31. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  32. package/dist/src/views/team/locales/index.d.ts +32 -0
  33. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +5 -3
  34. package/dist/style.css +1 -1
  35. package/dist/team-CyNektSD.js +33 -0
  36. package/dist/{timesheet-DjtuB4we.js → timesheet-DkD3AysG.js} +2 -2
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{useAppStore-CBb-dugK.js → useAppStore-CvmsaYSG.js} +1 -1
  39. package/dist/useDiscardConfirm-DPhEV6v0.js +157 -0
  40. package/dist/{useLoading-BCOj8y-t.js → useLoading-4TNmhm5N.js} +1 -1
  41. package/dist/{useReportPermissions-DyzhBpi8.js → useReportPermissions-CWMFFb8E.js} +3 -3
  42. package/dist/useSearch-BAPEUu1R.js +15 -0
  43. package/package.json +1 -1
  44. package/dist/AuditLogList-CV82_8fj.js +0 -980
  45. package/dist/EmployeeList-dE0So94R.js +0 -736
  46. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +0 -71
  47. package/dist/HorizontalSplitter-o860F4xM.js +0 -12
  48. package/dist/PermissionSetList-DmsJnW2i.js +0 -341
  49. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BbcY9q1x.js +0 -3480
  50. package/dist/RoleList-CKB8L-BW.js +0 -530
  51. package/dist/TeamMemberList-CszlbmAX.js +0 -1108
  52. package/dist/useDebounce-B8ZPVS5C.js +0 -15
  53. package/dist/useDiscardConfirm-BHni0LNu.js +0 -28
  54. package/dist/useSearch-B6WK1LBB.js +0 -15
@@ -0,0 +1,347 @@
1
+ import { defineComponent as H, ref as p, computed as b, watch as ne, resolveComponent as P, createBlock as M, openBlock as L, unref as m, withCtx as j, createVNode as f, createElementVNode as D, 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 A, k as Pe, l as he, s as _e, n as ge, q as ye } from "./rule-3sXHiW0y.js";
7
+ import { l as W } from "./lodash-D5xlVzib.js";
8
+ import { d as we, A as Fe } from "./iteration-JOKbtlLf.js";
9
+ import { u as Ve } from "./useLoading-4TNmhm5N.js";
10
+ import { d as G } from "./app-COJbSNM4.js";
11
+ import { _ as ke } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js";
12
+ const xe = { 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: N }) {
21
+ const o = K, { t: a } = Q(), u = p(!1), B = b(() => {
22
+ var e;
23
+ return (e = o.modelValue) != null && e.id ? a("permissionSet.form.update.title") : a("permissionSet.form.create.title");
24
+ }), k = p(), O = Y(), x = Ve(O), h = Z(), l = p({ ...o.modelValue }), i = p([]), c = p([]), C = [(e) => !!e || a("permissionSet.form.nameRequired")], U = b(() => {
25
+ var e;
26
+ return (e = o.modelValue) != null && e.id ? a("permissionSet.form.update.confirmButtonLabel") : a("permissionSet.form.create.confirmButtonLabel");
27
+ }), T = b(
28
+ () => h.permissionSets.value.filter((e) => {
29
+ var s;
30
+ return e.id !== ((s = o.modelValue) == null ? void 0 : s.id);
31
+ }).map((e) => ({ label: e.name, value: e.id }))
32
+ ), y = b(
33
+ () => ee(i.value, h.permissionSets.value)
34
+ ), {
35
+ fetchCustomReportPermissions: q,
36
+ customReportPermissions: $,
37
+ isLoaded: n
38
+ } = se(), t = new Set(
39
+ X.filter((e) => e.subject.startsWith(Se)).map((e) => e.subject)
40
+ ), r = b(() => {
41
+ const e = new Set(t);
42
+ for (const s of $.value) e.add(s.subject);
43
+ return e;
44
+ }), w = b(() => {
45
+ const e = /* @__PURE__ */ new Set();
46
+ for (const s of X)
47
+ s.category === G.reports && e.add(s.subject);
48
+ for (const s of $.value)
49
+ s.category === G.reports && e.add(s.subject);
50
+ return e;
51
+ }), v = p({ name: "", permissionSetIds: [], userPermissions: [] });
52
+ async function _() {
53
+ var s, d;
54
+ await ae(), u.value = !u.value, l.value = { ...o.modelValue }, i.value = ((s = o.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
55
+ const e = ((d = o.modelValue) == null ? void 0 : d.permissions) ?? [];
56
+ c.value = be(
57
+ A(y.value),
58
+ e
59
+ ), v.value = {
60
+ name: l.value.name ?? "",
61
+ permissionSetIds: [...i.value],
62
+ userPermissions: we(c.value)
63
+ };
64
+ }
65
+ ne(u, async (e) => {
66
+ e && await q();
67
+ });
68
+ const R = fe(
69
+ () => !W.isEqual(l.value.name ?? "", v.value.name) || !W.isEqual(i.value, v.value.permissionSetIds) || !W.isEqual(c.value, v.value.userPermissions),
70
+ () => {
71
+ u.value = !1;
72
+ }
73
+ );
74
+ function z() {
75
+ const e = A(y.value), s = n.value ? r.value : t, d = Pe(c.value, s), F = he(d, w.value), V = _e(F);
76
+ return ge(e, V);
77
+ }
78
+ function oe() {
79
+ c.value = A(y.value);
80
+ }
81
+ async function te() {
82
+ var d, F;
83
+ const e = await ((d = k.value) == null ? void 0 : d.validateInputsWithoutSubmit()), s = (F = ce().currentBusiness.value) == null ? void 0 : F.id;
84
+ !(e != null && e.length) && s && x.minor(async () => {
85
+ var I;
86
+ const V = z();
87
+ if ((I = o.modelValue) != null && I.id) {
88
+ const E = {
89
+ name: l.value.name,
90
+ permissions: V,
91
+ permissionSetIds: i.value,
92
+ businessId: l.value.businessId
93
+ };
94
+ await h.updatePermissionSet(o.modelValue.id, E);
95
+ } else {
96
+ const E = {
97
+ name: l.value.name,
98
+ businessId: s,
99
+ permissions: V,
100
+ permissionSetIds: i.value
101
+ };
102
+ await h.createPermissionSet(E);
103
+ }
104
+ u.value = !1;
105
+ });
106
+ }
107
+ return N({
108
+ trigger: _
109
+ }), (e, s) => {
110
+ const d = P("FmTextField"), F = P("FmSelect"), V = P("FmForm"), I = P("FmButton"), E = P("FmSideSheet");
111
+ return L(), M(E, {
112
+ modelValue: u.value,
113
+ "onUpdate:modelValue": s[3] || (s[3] = (g) => u.value = g),
114
+ "max-width": 960,
115
+ "onOn:clickedAway": m(R)
116
+ }, {
117
+ "side-sheet-header": j(() => [
118
+ D("p", xe, ie(B.value), 1)
119
+ ]),
120
+ "side-sheet-footer": j(() => [
121
+ D("div", Ce, [
122
+ f(I, {
123
+ label: U.value,
124
+ size: "md",
125
+ variant: "primary",
126
+ type: "submit",
127
+ onClick: te
128
+ }, null, 8, ["label"]),
129
+ f(I, {
130
+ label: m(a)("common.cancel"),
131
+ size: "md",
132
+ variant: "secondary",
133
+ onClick: m(R)
134
+ }, null, 8, ["label", "onClick"])
135
+ ])
136
+ ]),
137
+ default: j(() => [
138
+ f(V, {
139
+ ref_key: "formRef",
140
+ ref: k
141
+ }, {
142
+ default: j(() => [
143
+ f(d, {
144
+ modelValue: l.value.name,
145
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value.name = g),
146
+ label: m(a)("permissionSet.form.name"),
147
+ placeholder: m(a)("permissionSet.form.namePlaceholder"),
148
+ rules: C
149
+ }, null, 8, ["modelValue", "label", "placeholder"]),
150
+ f(F, {
151
+ modelValue: i.value,
152
+ "onUpdate:modelValue": [
153
+ s[1] || (s[1] = (g) => i.value = g),
154
+ oe
155
+ ],
156
+ multiselect: "",
157
+ searchable: "",
158
+ "search-debounce": 300,
159
+ items: T.value,
160
+ label: m(a)("permissionSet.form.includedSets"),
161
+ placeholder: m(a)("permissionSet.form.includedSetsPlaceholder"),
162
+ class: "mt-16"
163
+ }, null, 8, ["modelValue", "items", "label", "placeholder"]),
164
+ f(ke, {
165
+ modelValue: c.value,
166
+ "onUpdate:modelValue": s[2] || (s[2] = (g) => c.value = g),
167
+ "inherit-permissions": y.value,
168
+ class: "mt-24"
169
+ }, null, 8, ["modelValue", "inherit-permissions"])
170
+ ]),
171
+ _: 1
172
+ }, 512)
173
+ ]),
174
+ _: 1
175
+ }, 8, ["modelValue", "onOn:clickedAway"]);
176
+ };
177
+ }
178
+ }), Ie = { class: "space-y-8" }, Ee = { class: "flex justify-end xs:px-16" }, ze = /* @__PURE__ */ H({
179
+ __name: "PermissionSetList",
180
+ setup(K, { expose: N }) {
181
+ const { t: o } = Q(), { customReportPermissions: a, fetchCustomReportPermissions: u } = se(), B = Y(), k = ue(), { breakpoints: O } = de(), x = p(""), h = b(() => {
182
+ var n;
183
+ return (n = c.value) == null ? void 0 : n.filter((t) => {
184
+ const r = x.value.toLowerCase();
185
+ return t.name.toLowerCase().includes(r);
186
+ });
187
+ }), l = p(), i = Z(), c = b(
188
+ () => i.permissionSets.value
189
+ ), C = p();
190
+ async function U() {
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 y = [
198
+ {
199
+ accessorKey: "name",
200
+ header: () => o("permissionSet.table.columns.name")
201
+ },
202
+ {
203
+ accessorKey: "permission",
204
+ header: () => o("permissionSet.table.columns.permissions"),
205
+ enableSorting: !1,
206
+ cell(n) {
207
+ const t = n.row.original, r = ee(
208
+ [t.id],
209
+ i.permissionSets.value
210
+ ), w = A(r), v = w.length, _ = ye(
211
+ w,
212
+ a.value
213
+ );
214
+ return S("div", { class: "flex items-center gap-8" }, [
215
+ S("span", o("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
+ o("team.labels.permission"),
226
+ ..._.map(
227
+ (R, z) => S("div", { key: `${R}-${z}` }, `- ${R}`)
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: (r) => r.stopPropagation()
249
+ },
250
+ [
251
+ S(ve, {
252
+ items: [
253
+ { label: o("common.update"), onClick: () => T(t) },
254
+ {
255
+ label: o("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 q() {
268
+ var n;
269
+ C.value = void 0, (n = l.value) == null || n.trigger();
270
+ }
271
+ async function $(n) {
272
+ k.open({
273
+ title: o("permissionSet.form.delete.title"),
274
+ message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
275
+ minWidth: O.value.lg ? 588 : 0,
276
+ primaryActions: {
277
+ text: o("common.remove"),
278
+ close: !1,
279
+ variant: "destructive"
280
+ },
281
+ secondaryActions: { text: o("common.cancel"), close: !0 }
282
+ }).onPrimary(async () => {
283
+ try {
284
+ await i.deletePermissionSet(n.id), B.open({
285
+ message: o("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
286
+ type: "success"
287
+ });
288
+ } catch (t) {
289
+ const r = t instanceof Fe && t.status === 409 ? t.message.includes("referenced by") ? o("permissionSet.form.delete.setReferencedConflictError", {
290
+ permissionSetName: n.name
291
+ }) : o("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
292
+ B.open({ message: r, type: "error" });
293
+ }
294
+ k.close();
295
+ });
296
+ }
297
+ return le(() => {
298
+ U(), u();
299
+ }), N({
300
+ create: q
301
+ }), (n, t) => {
302
+ const r = P("FmSearch"), w = P("FmTable"), v = P("FullWrapper");
303
+ return L(), re(me, null, [
304
+ f(Re, {
305
+ ref_key: "permissionSetFormRef",
306
+ ref: l,
307
+ "model-value": C.value
308
+ }, null, 8, ["model-value"]),
309
+ D("div", Ie, [
310
+ D("div", Ee, [
311
+ f(r, {
312
+ modelValue: x.value,
313
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => x.value = _),
314
+ class: "w-[320px] xs:w-full",
315
+ autofocus: "",
316
+ placeholder: m(o)("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
+ f(w, {
325
+ "column-defs": y,
326
+ "row-data": h.value,
327
+ "page-size": h.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(m(pe), {
336
+ key: 1,
337
+ title: m(o)("permissionSet.noData.title"),
338
+ subtitle: m(o)("permissionSet.noData.subtitle")
339
+ }, null, 8, ["title", "subtitle"]))
340
+ ])
341
+ ], 64);
342
+ };
343
+ }
344
+ });
345
+ export {
346
+ ze as default
347
+ };