@feedmepos/mf-hrm-portal 2.0.25 → 2.1.0-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 (63) hide show
  1. package/dist/AuditLogList-AGlAsWwd.js +1608 -0
  2. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-BYHKFwRm.js +383 -0
  3. package/dist/EmployeeList-KvjoGI87.js +884 -0
  4. package/dist/{Main-C6YMg19H.js → Main-BLh16xRg.js} +187 -184
  5. package/dist/{Main-DQg87aB2.js → Main-D3TSdtSE.js} +7 -7
  6. package/dist/{Main-CyqPnLTe.js → Main-Dn1TfDRj.js} +1033 -1029
  7. package/dist/PermissionSetList-Ds69m9UU.js +392 -0
  8. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bk6ub3Dv.js +4030 -0
  9. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-DWeS7VXx.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BHxCP_uW.js} +1 -1
  10. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +42 -0
  11. package/dist/RoleList-v8McRCnz.js +684 -0
  12. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +16 -0
  13. package/dist/{index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js → TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js} +54 -20
  14. package/dist/TeamMemberList-BYQnNIhT.js +1169 -0
  15. package/dist/{TimesheetList-DzeE73Ns.js → TimesheetList-C1OWa6kf.js} +139 -133
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-CTQs7MIl.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CLu9gzzi.js} +2 -2
  17. package/dist/{app-Df4eEEIU.js → app-CJouCBgi.js} +5248 -2273
  18. package/dist/app.js +1 -1
  19. package/dist/{dayjs.min-DmGoh5hw.js → dayjs.min-DUugkgDM.js} +1 -1
  20. package/dist/{employee-zWTRoOkw.js → employee-D5rEVmge.js} +3 -3
  21. package/dist/{iteration-DTV3udF0.js → iteration-QRRNYlps.js} +3 -3
  22. package/dist/{lodash-LInzVEDS.js → lodash-BlZhpHhM.js} +1 -1
  23. package/dist/rule-Dy7eMChN.js +1053 -0
  24. package/dist/src/api/audit-log/index.d.ts +6 -0
  25. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  26. package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +7 -1
  27. package/dist/src/components/table/EmptyDataTemplate/index.vue.d.ts +4 -1
  28. package/dist/src/components/table/TableEmptyState.vue.d.ts +31 -0
  29. package/dist/src/composables/useBasePermission.d.ts +1 -0
  30. package/dist/src/composables/useConditionDraft.d.ts +40 -0
  31. package/dist/src/composables/useCoverConditionOverride.d.ts +61 -0
  32. package/dist/src/helpers/business-timezone.d.ts +22 -0
  33. package/dist/src/helpers/permission-set.d.ts +4 -2
  34. package/dist/src/helpers/rule.d.ts +2 -1
  35. package/dist/src/stores/permission-set.d.ts +12 -3
  36. package/dist/src/types/audit-log.d.ts +1 -1
  37. package/dist/src/views/audit-log/event-line.d.ts +13 -0
  38. package/dist/src/views/audit-log/locales/index.d.ts +296 -0
  39. package/dist/src/views/audit-log/snapshot-diff.d.ts +11 -0
  40. package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +1 -0
  41. package/dist/src/views/team/components/BasePermission.vue.d.ts +13 -0
  42. package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +22 -0
  43. package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +23 -0
  44. package/dist/src/views/team/condition-builders/component-map.d.ts +4 -0
  45. package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +23 -0
  46. package/dist/src/views/team/locales/index.d.ts +68 -0
  47. package/dist/style.css +1 -1
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/{useAppStore-BlQSL2ZO.js → useAppStore-CtMoad7V.js} +1 -1
  50. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  51. package/dist/{useLoading-NkUvAr71.js → useLoading-CNqlchYO.js} +1 -1
  52. package/dist/{useReportPermissions-R-eg1L2r.js → useReportPermissions-C5wGC9bf.js} +3 -3
  53. package/package.json +2 -2
  54. package/dist/AuditLogList-BWwgm5wH.js +0 -1145
  55. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  56. package/dist/EmployeeList-aRGYYmxf.js +0 -851
  57. package/dist/PermissionSetList-BfKgFFUh.js +0 -356
  58. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CNEAlTnY.js +0 -3457
  59. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +0 -38
  60. package/dist/RoleList-CtcVwAPE.js +0 -566
  61. package/dist/TeamMemberList-DU1jYeql.js +0 -1130
  62. package/dist/rule-O-E9JWJz.js +0 -995
  63. package/dist/useDebounce-CWb5QR9G.js +0 -28
@@ -0,0 +1,392 @@
1
+ import { defineComponent as Z, ref as f, computed as h, watch as ue, resolveComponent as _, createBlock as de, openBlock as ee, unref as r, withCtx as C, createVNode as m, createElementVNode as y, toDisplayString as G, nextTick as pe, onMounted as fe, createElementBlock as ve, Fragment as Se, h as S } from "vue";
2
+ import { useI18n as se, useCoreStore as he } from "@feedmepos/mf-common";
3
+ import { useSnackbar as oe, useDialog as te, useBreakpoints as ne, components as H } from "@feedmepos/ui-library";
4
+ import { v as Q, _ as _e } from "./app-CJouCBgi.js";
5
+ import { _ as be } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js";
6
+ import { u as ge, _ as Pe } from "./useDiscardConfirm-DPhEV6v0.js";
7
+ import { u as ie, c as M, i as ae, p as Y, j as ye, d as we, m as L, n as xe, o as Fe, s as ke, q as Ce, w as Ie } from "./rule-Dy7eMChN.js";
8
+ import { l as j } from "./lodash-BlZhpHhM.js";
9
+ import { d as Re, A as Ve } from "./iteration-QRRNYlps.js";
10
+ import { u as Ee } from "./useLoading-CNqlchYO.js";
11
+ import { _ as je } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bk6ub3Dv.js";
12
+ const Te = { class: "flex w-full items-center justify-between" }, $e = { class: "fm-typo-en-title-md-600" }, Be = { class: "fm-typo-en-title-sm-600 mt-24" }, Le = { class: "flex items-center justify-start gap-8" }, Ae = /* @__PURE__ */ Z({
13
+ __name: "PermissionSetForm",
14
+ props: {
15
+ modelValue: {
16
+ type: Object,
17
+ default: () => ({})
18
+ }
19
+ },
20
+ setup(K, { expose: A }) {
21
+ const o = K, { t: i } = se(), v = f(!1), T = h(() => {
22
+ var e;
23
+ return (e = o.modelValue) != null && e.id ? i("permissionSet.form.update.title") : i("permissionSet.form.create.title");
24
+ }), I = f(), D = oe(), w = te(), { breakpoints: R } = ne(), V = Ee(D), l = ie(), d = f({ ...o.modelValue }), a = f([]), p = f([]), $ = [(e) => !!e || i("permissionSet.form.nameRequired")], q = h(() => {
25
+ var e;
26
+ return (e = o.modelValue) != null && e.id ? i("permissionSet.form.update.confirmButtonLabel") : i("permissionSet.form.create.confirmButtonLabel");
27
+ }), N = h(
28
+ () => l.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
+ ), E = h(
33
+ () => M(a.value, l.permissionSets.value)
34
+ ), {
35
+ fetchCustomReportPermissions: n,
36
+ customReportPermissions: t,
37
+ isLoaded: c
38
+ } = ae(), b = new Set(
39
+ Y.filter((e) => e.subject.startsWith(ye)).map((e) => e.subject)
40
+ ), g = h(() => {
41
+ const e = new Set(b);
42
+ for (const s of t.value) e.add(s.subject);
43
+ return e;
44
+ }), O = h(() => {
45
+ const e = /* @__PURE__ */ new Set();
46
+ for (const s of Y)
47
+ s.category === Q.reports && e.add(s.subject);
48
+ for (const s of t.value)
49
+ s.category === Q.reports && e.add(s.subject);
50
+ return e;
51
+ }), P = f({ name: "", permissionSetIds: [], userPermissions: [] });
52
+ async function z() {
53
+ var s, u;
54
+ await pe(), v.value = !v.value, d.value = { ...o.modelValue }, a.value = ((s = o.modelValue) == null ? void 0 : s.permissionSetIds) ?? [];
55
+ const e = ((u = o.modelValue) == null ? void 0 : u.permissions) ?? [];
56
+ p.value = we(
57
+ L(E.value),
58
+ e
59
+ ), P.value = {
60
+ name: d.value.name ?? "",
61
+ permissionSetIds: [...a.value],
62
+ userPermissions: Re(p.value)
63
+ };
64
+ }
65
+ ue(v, async (e) => {
66
+ e && await n();
67
+ });
68
+ const U = ge(
69
+ () => !j.isEqual(d.value.name ?? "", P.value.name) || !j.isEqual(a.value, P.value.permissionSetIds) || !j.isEqual(p.value, P.value.userPermissions),
70
+ () => {
71
+ v.value = !1;
72
+ }
73
+ );
74
+ function re() {
75
+ const e = L(E.value), s = c.value ? g.value : b, u = xe(p.value, s), x = Fe(u, O.value), F = ke(x);
76
+ return Ce(e, F);
77
+ }
78
+ function J(e) {
79
+ return L(
80
+ M(e, l.permissionSets.value)
81
+ );
82
+ }
83
+ function X(e) {
84
+ p.value = J(e);
85
+ }
86
+ function le(e) {
87
+ const s = [...e ?? []];
88
+ if (j.isEqual(s, a.value)) return;
89
+ const u = !j.isEqual(
90
+ p.value,
91
+ J(a.value)
92
+ );
93
+ if (a.value = s, !u) {
94
+ X(s);
95
+ return;
96
+ }
97
+ w.open({
98
+ title: i("permissionSet.form.overrideInherited.title"),
99
+ message: i("permissionSet.form.overrideInherited.message"),
100
+ minWidth: R.value.lg ? 588 : 0,
101
+ primaryActions: {
102
+ text: i("permissionSet.form.overrideInherited.override"),
103
+ close: !1
104
+ },
105
+ secondaryActions: {
106
+ text: i("permissionSet.form.overrideInherited.keepCurrent"),
107
+ close: !0
108
+ }
109
+ }).onPrimary(() => {
110
+ X(s), w.close();
111
+ });
112
+ }
113
+ async function me() {
114
+ var u, x;
115
+ const e = await ((u = I.value) == null ? void 0 : u.validateInputsWithoutSubmit()), s = (x = he().currentBusiness.value) == null ? void 0 : x.id;
116
+ !(e != null && e.length) && s && V.minor(async () => {
117
+ var B;
118
+ const F = re();
119
+ if ((B = o.modelValue) != null && B.id) {
120
+ const k = {
121
+ name: d.value.name,
122
+ permissions: F,
123
+ permissionSetIds: a.value,
124
+ businessId: d.value.businessId
125
+ };
126
+ await l.updatePermissionSet(o.modelValue.id, k);
127
+ } else {
128
+ const k = {
129
+ name: d.value.name,
130
+ businessId: s,
131
+ permissions: F,
132
+ permissionSetIds: a.value
133
+ };
134
+ await l.createPermissionSet(k);
135
+ }
136
+ v.value = !1;
137
+ });
138
+ }
139
+ return A({
140
+ trigger: z
141
+ }), (e, s) => {
142
+ const u = _("FmIcon"), x = _("FmTextField"), F = _("FmSelect"), B = _("FmForm"), k = _("FmButton"), ce = _("FmSideSheet");
143
+ return ee(), de(ce, {
144
+ "model-value": v.value,
145
+ "max-width": 960,
146
+ "close-button": !1,
147
+ "onOn:clickedAway": r(U)
148
+ }, {
149
+ "side-sheet-header": C(() => [
150
+ y("div", Te, [
151
+ y("p", $e, G(T.value), 1),
152
+ m(u, {
153
+ name: "close",
154
+ size: "md",
155
+ class: "cursor-pointer",
156
+ onClick: r(U)
157
+ }, null, 8, ["onClick"])
158
+ ])
159
+ ]),
160
+ "side-sheet-footer": C(() => [
161
+ y("div", Le, [
162
+ m(k, {
163
+ label: q.value,
164
+ size: "md",
165
+ variant: "primary",
166
+ type: "submit",
167
+ onClick: me
168
+ }, null, 8, ["label"]),
169
+ m(k, {
170
+ label: r(i)("common.cancel"),
171
+ size: "md",
172
+ variant: "secondary",
173
+ onClick: r(U)
174
+ }, null, 8, ["label", "onClick"])
175
+ ])
176
+ ]),
177
+ default: C(() => [
178
+ m(B, {
179
+ ref_key: "formRef",
180
+ ref: I
181
+ }, {
182
+ default: C(() => [
183
+ m(x, {
184
+ modelValue: d.value.name,
185
+ "onUpdate:modelValue": s[0] || (s[0] = (W) => d.value.name = W),
186
+ label: r(i)("permissionSet.form.name"),
187
+ placeholder: r(i)("permissionSet.form.namePlaceholder"),
188
+ rules: $
189
+ }, null, 8, ["modelValue", "label", "placeholder"]),
190
+ m(F, {
191
+ "model-value": a.value,
192
+ multiselect: "",
193
+ searchable: "",
194
+ "search-debounce": 300,
195
+ items: N.value,
196
+ label: r(i)("permissionSet.form.includedSets"),
197
+ placeholder: r(i)("permissionSet.form.includedSetsPlaceholder"),
198
+ class: "mt-16",
199
+ "onUpdate:modelValue": le
200
+ }, null, 8, ["model-value", "items", "label", "placeholder"]),
201
+ y("div", Be, G(r(i)("team.memberForm.permissions.title")), 1),
202
+ m(je, {
203
+ modelValue: p.value,
204
+ "onUpdate:modelValue": s[1] || (s[1] = (W) => p.value = W),
205
+ "inherit-permissions": E.value,
206
+ class: "mt-16"
207
+ }, null, 8, ["modelValue", "inherit-permissions"])
208
+ ]),
209
+ _: 1
210
+ }, 512)
211
+ ]),
212
+ _: 1
213
+ }, 8, ["model-value", "onOn:clickedAway"]);
214
+ };
215
+ }
216
+ }), De = { class: "space-y-8" }, qe = { class: "flex justify-end xs:px-16" }, Ne = { class: "flex flex-col h-full overflow-auto" }, Ye = /* @__PURE__ */ Z({
217
+ __name: "PermissionSetList",
218
+ setup(K, { expose: A }) {
219
+ const { t: o } = se(), { customReportPermissions: i, fetchCustomReportPermissions: v } = ae(), T = oe(), I = te(), { breakpoints: D } = ne(), w = f(""), R = h(() => {
220
+ var n;
221
+ return (n = d.value) == null ? void 0 : n.filter((t) => {
222
+ const c = w.value.toLowerCase();
223
+ return t.name.toLowerCase().includes(c);
224
+ });
225
+ }), V = f(), l = ie(), d = h(
226
+ () => l.permissionSets.value
227
+ ), a = f();
228
+ async function p() {
229
+ await l.readPermissionSets();
230
+ }
231
+ function $(n) {
232
+ var t;
233
+ a.value = n, (t = V.value) == null || t.trigger();
234
+ }
235
+ const q = [
236
+ {
237
+ accessorKey: "name",
238
+ header: () => o("permissionSet.table.columns.name")
239
+ },
240
+ {
241
+ accessorKey: "permission",
242
+ header: () => o("permissionSet.table.columns.permissions"),
243
+ enableSorting: !1,
244
+ cell(n) {
245
+ const t = n.row.original, c = M(
246
+ [t.id],
247
+ l.permissionSets.value
248
+ ), b = L(c), g = b.length, O = Ie(
249
+ b,
250
+ i.value
251
+ );
252
+ return S("div", { class: "flex items-center gap-8" }, [
253
+ S("span", o("team.labels.allowed", { count: g })),
254
+ S(
255
+ H.FmTooltip,
256
+ { variant: "plain", placement: "top" },
257
+ {
258
+ default: () => S(H.FmIcon, {
259
+ name: "info",
260
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
261
+ }),
262
+ content: () => S("div", [
263
+ o("team.labels.permission"),
264
+ ...O.map(
265
+ (P, z) => S("div", { key: `${P}-${z}` }, `- ${P}`)
266
+ )
267
+ ])
268
+ }
269
+ )
270
+ ]);
271
+ }
272
+ },
273
+ {
274
+ id: "action",
275
+ size: 52,
276
+ meta: {
277
+ cellClass: "pl-16",
278
+ headerContentClass: "-mx-16"
279
+ },
280
+ cell(n) {
281
+ const t = n.row.original;
282
+ return S(
283
+ "div",
284
+ {
285
+ class: "flex w-full items-center justify-end",
286
+ onClick: (c) => c.stopPropagation()
287
+ },
288
+ [
289
+ S(Pe, {
290
+ items: [
291
+ { label: o("common.update"), onClick: () => $(t) },
292
+ {
293
+ label: o("common.remove"),
294
+ onClick: () => E(t),
295
+ itemClass: "text-fm-color-typo-error"
296
+ }
297
+ ]
298
+ })
299
+ ]
300
+ );
301
+ },
302
+ enableSorting: !1
303
+ }
304
+ ];
305
+ function N() {
306
+ var n;
307
+ a.value = void 0, (n = V.value) == null || n.trigger();
308
+ }
309
+ async function E(n) {
310
+ I.open({
311
+ title: o("permissionSet.form.delete.title"),
312
+ message: o("permissionSet.form.delete.confirmationMessage", { permissionSetName: n.name }),
313
+ minWidth: D.value.lg ? 588 : 0,
314
+ primaryActions: {
315
+ text: o("common.remove"),
316
+ close: !1,
317
+ variant: "destructive"
318
+ },
319
+ secondaryActions: { text: o("common.cancel"), close: !0 }
320
+ }).onPrimary(async () => {
321
+ try {
322
+ await l.deletePermissionSet(n.id), T.open({
323
+ message: o("permissionSet.form.delete.successMessage", { permissionSetName: n.name }),
324
+ type: "success"
325
+ });
326
+ } catch (t) {
327
+ const c = t instanceof Ve && t.status === 409 ? t.message.includes("referenced by") ? o("permissionSet.form.delete.setReferencedConflictError", {
328
+ permissionSetName: n.name
329
+ }) : o("permissionSet.form.delete.conflictError", { permissionSetName: n.name }) : t instanceof Error ? t.message : `${t}`;
330
+ T.open({ message: c, type: "error" });
331
+ }
332
+ I.close();
333
+ });
334
+ }
335
+ return fe(() => {
336
+ p(), v();
337
+ }), A({
338
+ create: N
339
+ }), (n, t) => {
340
+ const c = _("FmSearch"), b = _("FmTable");
341
+ return ee(), ve(Se, null, [
342
+ m(Ae, {
343
+ ref_key: "permissionSetFormRef",
344
+ ref: V,
345
+ "model-value": a.value
346
+ }, null, 8, ["model-value"]),
347
+ y("div", De, [
348
+ y("div", qe, [
349
+ m(c, {
350
+ modelValue: w.value,
351
+ "onUpdate:modelValue": t[0] || (t[0] = (g) => w.value = g),
352
+ class: "w-[320px] xs:w-full",
353
+ autofocus: "",
354
+ placeholder: r(o)("permissionSet.search.placeholder")
355
+ }, null, 8, ["modelValue", "placeholder"])
356
+ ]),
357
+ m(_e, null, {
358
+ default: C(() => [
359
+ y("div", Ne, [
360
+ m(be, {
361
+ "is-loading": r(l).isLoading.value,
362
+ "is-empty": R.value.length === 0,
363
+ "collapse-at": !1,
364
+ title: r(o)("permissionSet.noData.title"),
365
+ subtitle: r(o)("permissionSet.noData.subtitle")
366
+ }, {
367
+ default: C(() => [
368
+ m(b, {
369
+ "column-defs": q,
370
+ "row-data": R.value,
371
+ "page-size": R.value.length,
372
+ loading: r(l).isLoading.value,
373
+ "pin-header-row": "",
374
+ "hide-footer": "",
375
+ "shrink-at": !1,
376
+ onRowClick: t[1] || (t[1] = (g) => $(g.original))
377
+ }, null, 8, ["row-data", "page-size", "loading"])
378
+ ]),
379
+ _: 1
380
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"])
381
+ ])
382
+ ]),
383
+ _: 1
384
+ })
385
+ ])
386
+ ], 64);
387
+ };
388
+ }
389
+ });
390
+ export {
391
+ Ye as default
392
+ };