@feedmepos/mf-hrm-portal 2.0.25 → 2.1.0-dev

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 (55) hide show
  1. package/dist/AuditLogList-C1bGND8z.js +1037 -0
  2. package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-tiuei7CA.js +383 -0
  3. package/dist/{EmployeeList-aRGYYmxf.js → EmployeeList-DqQF9xEx.js} +78 -78
  4. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js → FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js} +1 -1
  5. package/dist/{Main-C6YMg19H.js → Main-BgOhmojO.js} +6 -6
  6. package/dist/{Main-CyqPnLTe.js → Main-D2Wf__wM.js} +1138 -1142
  7. package/dist/Main-DcKVuIjB.js +90 -0
  8. package/dist/PermissionSetList-CQpTa0eY.js +384 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CCKVpAwv.js +4030 -0
  10. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-DWeS7VXx.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-D-14ca2J.js} +1 -1
  11. package/dist/RoleList-tSC8RJHe.js +674 -0
  12. package/dist/SelectFilter-DUj7GBtT.js +251 -0
  13. package/dist/TeamMemberList-Bz-kDJ0e.js +1163 -0
  14. package/dist/{TimesheetList-DzeE73Ns.js → TimesheetList-BFVhmcRt.js} +10 -10
  15. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-CTQs7MIl.js → TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-CtHuL5tW.js} +2 -2
  16. package/dist/{app-Df4eEEIU.js → app-DRnSocX8.js} +5052 -2394
  17. package/dist/app.js +1 -1
  18. package/dist/{dayjs.min-DmGoh5hw.js → dayjs.min-B8xOAypU.js} +1 -1
  19. package/dist/{employee-zWTRoOkw.js → employee-UrXqUaik.js} +3 -3
  20. package/dist/{iteration-DTV3udF0.js → iteration-LEYoQKiI.js} +3 -3
  21. package/dist/{lodash-LInzVEDS.js → lodash-Bq6_eZZ0.js} +1 -1
  22. package/dist/rule-CJC6Cq6S.js +1047 -0
  23. package/dist/src/api/audit-log/index.d.ts +0 -17
  24. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  25. package/dist/src/components/form/SelectFilter.vue.d.ts +0 -3
  26. package/dist/src/composables/useBasePermission.d.ts +1 -0
  27. package/dist/src/composables/useConditionDraft.d.ts +40 -0
  28. package/dist/src/composables/useCoverConditionOverride.d.ts +61 -0
  29. package/dist/src/helpers/business-timezone.d.ts +22 -0
  30. package/dist/src/helpers/permission-set.d.ts +4 -2
  31. package/dist/src/helpers/rule.d.ts +2 -1
  32. package/dist/src/stores/team.d.ts +1 -4
  33. package/dist/src/views/audit-log/locales/index.d.ts +16 -24
  34. package/dist/src/views/hr/locales/index.d.ts +0 -4
  35. package/dist/src/views/team/components/BasePermission.vue.d.ts +13 -0
  36. package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +22 -0
  37. package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +23 -0
  38. package/dist/src/views/team/condition-builders/component-map.d.ts +4 -0
  39. package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +23 -0
  40. package/dist/src/views/team/locales/index.d.ts +68 -4
  41. package/dist/style.css +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{useAppStore-BlQSL2ZO.js → useAppStore-BGsfYWAR.js} +1 -1
  44. package/dist/{useLoading-NkUvAr71.js → useLoading-BUM5R2qV.js} +1 -1
  45. package/dist/{useReportPermissions-R-eg1L2r.js → useReportPermissions-nlQ_BBL2.js} +3 -3
  46. package/package.json +2 -2
  47. package/dist/AuditLogList-BWwgm5wH.js +0 -1145
  48. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  49. package/dist/Main-DQg87aB2.js +0 -94
  50. package/dist/PermissionSetList-BfKgFFUh.js +0 -356
  51. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CNEAlTnY.js +0 -3457
  52. package/dist/RoleList-CtcVwAPE.js +0 -566
  53. package/dist/SelectFilter-ATOm0hdn.js +0 -269
  54. package/dist/TeamMemberList-DU1jYeql.js +0 -1130
  55. package/dist/rule-O-E9JWJz.js +0 -995
@@ -0,0 +1,383 @@
1
+ import { defineComponent as B, ref as x, onMounted as ee, nextTick as te, onUnmounted as ne, resolveComponent as h, createElementBlock as g, openBlock as i, Fragment as U, createElementVNode as w, renderSlot as P, createCommentVNode as E, toDisplayString as oe, createVNode as ae, normalizeStyle as le, watch as W, defineAsyncComponent as ue, computed as I, renderList as M, createBlock as p, withCtx as G, unref as D, resolveDynamicComponent as re } from "vue";
2
+ import { e as H, f as se, U as j } from "./app-DRnSocX8.js";
3
+ import { useI18n as ie, useCoreStore as de } from "@feedmepos/mf-common";
4
+ import { l as ce } from "./lodash-Bq6_eZZ0.js";
5
+ const me = { class: "flex items-center" }, fe = {
6
+ key: 0,
7
+ class: "ml-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
8
+ }, ve = { class: "ml-auto" }, Se = /* @__PURE__ */ B({
9
+ __name: "CollapsibleWrapper",
10
+ props: {
11
+ title: { default: "" },
12
+ subtitle: { default: "" },
13
+ initiallyCollapsed: { type: Boolean, default: !1 }
14
+ },
15
+ setup(t) {
16
+ const a = x(t.initiallyCollapsed), c = x(), m = x(0);
17
+ let f;
18
+ function F() {
19
+ a.value = !a.value;
20
+ }
21
+ function v() {
22
+ c.value && (m.value = c.value.scrollHeight);
23
+ }
24
+ return ee(async () => {
25
+ await te(), c.value && (f = new ResizeObserver(() => {
26
+ v();
27
+ }), f.observe(c.value));
28
+ }), ne(() => {
29
+ f == null || f.disconnect();
30
+ }), (k, r) => {
31
+ const d = h("FmButton");
32
+ return i(), g(U, null, [
33
+ w("div", { onClick: F }, [
34
+ w("div", me, [
35
+ P(k.$slots, "title"),
36
+ a.value && t.subtitle ? (i(), g("span", fe, oe(t.subtitle), 1)) : E("", !0),
37
+ w("div", ve, [
38
+ ae(d, {
39
+ icon: a.value ? "keyboard_arrow_down" : "keyboard_arrow_up",
40
+ "text-color": "neutral-gray-400",
41
+ variant: "tertiary",
42
+ size: "md"
43
+ }, null, 8, ["icon"])
44
+ ])
45
+ ])
46
+ ]),
47
+ w("div", {
48
+ ref_key: "contentRef",
49
+ ref: c,
50
+ class: "transition-all duration-300 ease-in-out overflow-hidden",
51
+ style: le({ maxHeight: a.value ? "0" : m.value + "px" })
52
+ }, [
53
+ P(k.$slots, "default")
54
+ ], 4)
55
+ ], 64);
56
+ };
57
+ }
58
+ });
59
+ function O(t) {
60
+ return `${t.subject}::${t.builderKey}`;
61
+ }
62
+ function xe(t) {
63
+ const u = x(/* @__PURE__ */ new Map());
64
+ function a(r, d) {
65
+ const y = new Map(u.value);
66
+ y.set(O(r), d), u.value = y;
67
+ }
68
+ function c(r) {
69
+ return u.value.get(O(r));
70
+ }
71
+ function m(r) {
72
+ for (const d of u.value.keys())
73
+ if (d.startsWith(`${r}::`)) return !0;
74
+ return !1;
75
+ }
76
+ function f(r) {
77
+ const d = /* @__PURE__ */ new Map();
78
+ for (const [y, N] of u.value.entries())
79
+ y.startsWith(`${r}::`) && d.set(y, N);
80
+ return d;
81
+ }
82
+ function F(r) {
83
+ const d = new Map(u.value);
84
+ for (const y of Array.from(d.keys()))
85
+ y.startsWith(`${r}::`) && d.delete(y);
86
+ u.value = d;
87
+ }
88
+ function v() {
89
+ u.value = /* @__PURE__ */ new Map();
90
+ }
91
+ function k(r) {
92
+ const d = new Map(u.value);
93
+ d.delete(O(r)), u.value = d;
94
+ }
95
+ return t && W(
96
+ t,
97
+ () => {
98
+ v();
99
+ },
100
+ { deep: !0 }
101
+ ), {
102
+ drafts: u,
103
+ setDraft: a,
104
+ getDraft: c,
105
+ hasDraftsForSubject: m,
106
+ getDraftsForSubject: f,
107
+ clearDraftsForSubject: F,
108
+ clearAllDrafts: v,
109
+ clearDraft: k
110
+ };
111
+ }
112
+ const be = {}, L = /* @__PURE__ */ new Map();
113
+ function ye(t) {
114
+ const u = L.get(t);
115
+ if (u) return u;
116
+ const a = be[t];
117
+ if (!a) return;
118
+ const c = ue(a);
119
+ return L.set(t, c), c;
120
+ }
121
+ function pe(t, u) {
122
+ return !ce.isEqual(t, u);
123
+ }
124
+ const ke = { class: "flex flex-col gap-8" }, Ve = { class: "flex flex-col gap-4" }, he = "condition-form-select-menu", Z = 120, ge = 220, Fe = /* @__PURE__ */ B({
125
+ __name: "ConditionFormRenderer",
126
+ props: {
127
+ config: {},
128
+ modelValue: {},
129
+ disabled: { type: Boolean, default: !1 },
130
+ optionProviders: { default: () => ({}) }
131
+ },
132
+ emits: ["update:modelValue"],
133
+ setup(t, { emit: u }) {
134
+ const a = t, c = u, { t: m } = ie(), f = de(), F = I(() => H(a.config, a.modelValue));
135
+ let v = a.modelValue;
136
+ W(
137
+ () => a.modelValue,
138
+ (e) => {
139
+ v = e;
140
+ }
141
+ );
142
+ function k(e) {
143
+ return "static" in e ? e.static.map((n) => ({ value: n.value, label: m(n.labelKey) })) : a.optionProviders[e.provider] ?? [];
144
+ }
145
+ function r(e, n) {
146
+ const l = d(
147
+ se(a.config, { ...a.modelValue, [e]: n })
148
+ );
149
+ pe(l, v) && (v = l, c("update:modelValue", l));
150
+ }
151
+ function d(e) {
152
+ const n = { ...e };
153
+ for (const l of H(a.config, n))
154
+ l.kind === "date" && !n[l.key] && (n[l.key] = K(J()));
155
+ return n;
156
+ }
157
+ function y() {
158
+ const e = f.currentBusiness.value;
159
+ if (e != null && e.timezone) return e.timezone;
160
+ if (e != null && e.timeZone) return e.timeZone;
161
+ const n = (e == null ? void 0 : e.country) ?? (f.currentCountry.value instanceof Object ? f.currentCountry.value.code : f.currentCountry.value);
162
+ return N(n);
163
+ }
164
+ function N(e) {
165
+ switch ((e || "").toUpperCase()) {
166
+ case "MY":
167
+ return "Asia/Kuala_Lumpur";
168
+ case "SG":
169
+ return "Asia/Singapore";
170
+ case "TH":
171
+ return "Asia/Bangkok";
172
+ case "ID":
173
+ return "Asia/Jakarta";
174
+ case "MO":
175
+ return "Asia/Macau";
176
+ case "BN":
177
+ return "Asia/Brunei";
178
+ case "PK":
179
+ return "Asia/Karachi";
180
+ case "MV":
181
+ return "Indian/Maldives";
182
+ case "VN":
183
+ return "Asia/Ho_Chi_Minh";
184
+ case "JP":
185
+ return "Asia/Tokyo";
186
+ case "AU":
187
+ return "Australia/Sydney";
188
+ case "AE":
189
+ return "Asia/Dubai";
190
+ case "UK":
191
+ return "Europe/London";
192
+ default:
193
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
194
+ }
195
+ }
196
+ function $(e, n) {
197
+ const l = new Intl.DateTimeFormat("en-CA", {
198
+ timeZone: n,
199
+ year: "numeric",
200
+ month: "2-digit",
201
+ day: "2-digit",
202
+ hour: "2-digit",
203
+ minute: "2-digit",
204
+ second: "2-digit",
205
+ hourCycle: "h23"
206
+ }).formatToParts(e), b = Object.fromEntries(
207
+ l.filter((V) => V.type !== "literal").map((V) => [V.type, V.value])
208
+ );
209
+ return {
210
+ year: Number(b.year),
211
+ month: Number(b.month),
212
+ day: Number(b.day),
213
+ hour: Number(b.hour),
214
+ minute: Number(b.minute),
215
+ second: Number(b.second)
216
+ };
217
+ }
218
+ function z(e, n) {
219
+ try {
220
+ const l = $(n, e);
221
+ return (Date.UTC(
222
+ l.year,
223
+ l.month - 1,
224
+ l.day,
225
+ l.hour,
226
+ l.minute,
227
+ l.second
228
+ ) - n.getTime()) / 6e4;
229
+ } catch {
230
+ return 0;
231
+ }
232
+ }
233
+ function K(e) {
234
+ const [n, l, b] = e.split("-").map(Number);
235
+ if (!n || !l || !b) return "";
236
+ const V = y(), C = new Date(Date.UTC(n, l - 1, b, 0, 0, 0, 0)), _ = z(V, C), S = new Date(C.getTime() - _ * 6e4), A = z(V, S);
237
+ return new Date(C.getTime() - A * 6e4).toISOString();
238
+ }
239
+ function R(e) {
240
+ const n = new Date(e);
241
+ if (Number.isNaN(n.getTime())) return "";
242
+ try {
243
+ const l = $(n, y());
244
+ return `${String(l.year).padStart(4, "0")}-${String(l.month).padStart(2, "0")}-${String(l.day).padStart(2, "0")}`;
245
+ } catch {
246
+ return e.slice(0, 10);
247
+ }
248
+ }
249
+ function J() {
250
+ return R((/* @__PURE__ */ new Date()).toISOString());
251
+ }
252
+ function T(e) {
253
+ return "options" in e ? k(e.options) : [];
254
+ }
255
+ function X(e) {
256
+ const n = a.modelValue[e];
257
+ return n == null ? "" : String(n);
258
+ }
259
+ function q(e) {
260
+ const n = a.modelValue[e];
261
+ return typeof n != "string" || !n ? "" : R(n);
262
+ }
263
+ function Y(e, n) {
264
+ r(e, n ? K(n) : "");
265
+ }
266
+ return (e, n) => {
267
+ const l = h("FmRadio"), b = h("FmRadioGroup"), V = h("FmSelect"), C = h("FmTextField"), _ = h("FmDatePicker"), S = h("FmCheckbox"), A = h("FmFormGroup");
268
+ return i(), g("div", ke, [
269
+ (i(!0), g(U, null, M(F.value, (o) => (i(), g(U, {
270
+ key: o.key
271
+ }, [
272
+ o.kind === "radio" ? (i(), p(b, {
273
+ key: 0,
274
+ "model-value": t.modelValue[o.key],
275
+ disabled: t.disabled,
276
+ "onUpdate:modelValue": (s) => r(o.key, s)
277
+ }, {
278
+ default: G(() => [
279
+ (i(!0), g(U, null, M(T(o), (s) => (i(), p(l, {
280
+ key: s.value,
281
+ value: s.value,
282
+ label: s.label
283
+ }, null, 8, ["value", "label"]))), 128))
284
+ ]),
285
+ _: 2
286
+ }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])) : o.kind === "select" ? (i(), p(V, {
287
+ key: 1,
288
+ "model-value": t.modelValue[o.key],
289
+ label: D(m)(o.labelKey),
290
+ items: T(o),
291
+ "menu-id": he,
292
+ "menu-z-index": Z,
293
+ "max-height": ge,
294
+ "shift-menu": "",
295
+ placement: "bottom-start",
296
+ disabled: t.disabled,
297
+ "onUpdate:modelValue": (s) => r(o.key, s)
298
+ }, null, 8, ["model-value", "label", "items", "disabled", "onUpdate:modelValue"])) : o.kind === "number" ? (i(), p(C, {
299
+ key: 2,
300
+ "model-value": X(o.key),
301
+ type: "number",
302
+ class: "!w-[120px] ml-32",
303
+ label: D(m)(o.labelKey),
304
+ disabled: t.disabled,
305
+ "onUpdate:modelValue": (s) => r(o.key, Math.floor(Number(s) || (o.min ?? 0)))
306
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "text" ? (i(), p(C, {
307
+ key: 3,
308
+ "model-value": t.modelValue[o.key] ?? "",
309
+ label: D(m)(o.labelKey),
310
+ disabled: t.disabled,
311
+ "onUpdate:modelValue": (s) => r(o.key, s)
312
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "date" ? (i(), p(_, {
313
+ key: 4,
314
+ "model-value": q(o.key),
315
+ label: D(m)(o.labelKey),
316
+ "z-index": Z,
317
+ disabled: t.disabled,
318
+ "onUpdate:modelValue": (s) => Y(o.key, s)
319
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "switch" ? (i(), p(S, {
320
+ key: 5,
321
+ "model-value": !!t.modelValue[o.key],
322
+ value: !0,
323
+ label: D(m)(o.labelKey),
324
+ disabled: t.disabled,
325
+ "onUpdate:modelValue": (s) => r(o.key, s)
326
+ }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : o.kind === "multiselect" ? (i(), p(A, {
327
+ key: 6,
328
+ "model-value": t.modelValue[o.key] ?? [],
329
+ "onUpdate:modelValue": (s) => r(o.key, s)
330
+ }, {
331
+ default: G(() => [
332
+ w("div", Ve, [
333
+ (i(!0), g(U, null, M(T(o), (s) => (i(), p(S, {
334
+ key: s.value,
335
+ "model-value": t.modelValue[o.key] ?? [],
336
+ value: s.value,
337
+ label: s.label,
338
+ disabled: t.disabled,
339
+ "onUpdate:modelValue": (Q) => r(o.key, Q)
340
+ }, null, 8, ["model-value", "value", "label", "disabled", "onUpdate:modelValue"]))), 128))
341
+ ])
342
+ ]),
343
+ _: 2
344
+ }, 1032, ["model-value", "onUpdate:modelValue"])) : E("", !0)
345
+ ], 64))), 128))
346
+ ]);
347
+ };
348
+ }
349
+ }), Ne = /* @__PURE__ */ B({
350
+ __name: "ConditionFormHost",
351
+ props: {
352
+ builder: {},
353
+ modelValue: {},
354
+ disable: { type: Boolean, default: !1 },
355
+ optionProviders: { default: () => ({}) }
356
+ },
357
+ emits: ["update:modelValue"],
358
+ setup(t, { emit: u }) {
359
+ const a = t, c = u, m = I(
360
+ () => a.builder.form && j(a.builder.form) ? a.builder.form : void 0
361
+ ), f = I(
362
+ () => a.builder.form && !j(a.builder.form) ? ye(a.builder.form.component) : void 0
363
+ );
364
+ return (F, v) => m.value ? (i(), p(Fe, {
365
+ key: 0,
366
+ config: m.value,
367
+ "model-value": t.modelValue ?? m.value.defaults,
368
+ disabled: t.disable,
369
+ "option-providers": t.optionProviders,
370
+ "onUpdate:modelValue": v[0] || (v[0] = (k) => c("update:modelValue", k))
371
+ }, null, 8, ["config", "model-value", "disabled", "option-providers"])) : f.value ? (i(), p(re(f.value), {
372
+ key: 1,
373
+ "model-value": t.modelValue,
374
+ disable: t.disable,
375
+ "onUpdate:modelValue": v[1] || (v[1] = (k) => c("update:modelValue", k))
376
+ }, null, 8, ["model-value", "disable"])) : E("", !0);
377
+ }
378
+ });
379
+ export {
380
+ Se as _,
381
+ Ne as a,
382
+ xe as u
383
+ };