@feedmepos/mf-hrm-portal 2.1.1-dev.2 → 2.1.1-dev.4

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 (50) hide show
  1. package/dist/ApprovalCodeList-B0PLZwav.js +758 -0
  2. package/dist/{AuditLogList-DHiqs9G0.js → AuditLogList-CRXwPImZ.js} +5 -5
  3. package/dist/{ConditionFormHost.vue_vue_type_script_setup_true_lang-CWqNWNdD.js → ConditionFormHost.vue_vue_type_script_setup_true_lang-zJwkM_Xb.js} +2 -2
  4. package/dist/{EmployeeList-CUd3VH5h.js → EmployeeList-DN2pnXcS.js} +7 -7
  5. package/dist/GrantUserList-DoyxknJZ.js +464 -0
  6. package/dist/{Main-DgemO-iy.js → Main-B5BKGpLg.js} +13 -11
  7. package/dist/Main-BGONIxo8.js +122 -0
  8. package/dist/{Main-B_L5flWT.js → Main-DQj4xtkB.js} +10 -8
  9. package/dist/{PermissionSetList-BaC4lKV5.js → PermissionSetList-4uIU9FvN.js} +13 -12
  10. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-D0luaKDb.js +4122 -0
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-DbPzVpnG.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DVVSBIx2.js} +1 -1
  12. package/dist/{RoleList-CThb6VEd.js → RoleList-Bj5Y5jd_.js} +12 -11
  13. package/dist/TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js +37 -0
  14. package/dist/TeamMemberList-Byjlca2Y.js +1216 -0
  15. package/dist/{TimesheetList-C_IMtsTH.js → TimesheetList-DwIcsOM-.js} +47 -46
  16. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DGwteHIL.js → TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-B9qlQ6KG.js} +14 -13
  17. package/dist/{app-BW91YDke.js → app-BZwE2coe.js} +2512 -2035
  18. package/dist/app.js +1 -1
  19. package/dist/approval-code-Q4666xp5.js +58 -0
  20. package/dist/{dayjs.min-DwQTpnVK.js → dayjs.min-BXBPls4m.js} +1 -1
  21. package/dist/{employee-yM0kdY70.js → employee-CJTbs1f7.js} +27 -26
  22. package/dist/grant-user-CQZaTzVt.js +67 -0
  23. package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
  24. package/dist/iteration-BCbIbdHR.js +7682 -0
  25. package/dist/{lodash-DLReQyP0.js → lodash-CUIS1iIz.js} +1 -1
  26. package/dist/restaurant-YOVMuuFY.js +1876 -0
  27. package/dist/role-CzXchcSS.js +82 -0
  28. package/dist/{rule-BJ-o-PKi.js → rule-BO6xj2Xa.js} +37 -36
  29. package/dist/src/api/approval-code/index.d.ts +7 -0
  30. package/dist/src/router/shared.d.ts +3 -1
  31. package/dist/src/stores/approval-code.d.ts +140 -0
  32. package/dist/src/types/approval-code.d.ts +114 -0
  33. package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
  34. package/dist/src/views/approval-code/components/ApprovalCodeCreatedDialog.vue.d.ts +9 -0
  35. package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +22 -0
  36. package/dist/src/views/approval-code/locales/index.d.ts +360 -0
  37. package/dist/src/views/pos-access/locales/index.d.ts +48 -0
  38. package/dist/src/views/team/locales/index.d.ts +8 -0
  39. package/dist/style.css +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/useAppStore-DNTlIeMv.js +93 -0
  42. package/dist/{useLoading-B89K5XKO.js → useLoading-BH02lYns.js} +1 -1
  43. package/dist/{useReportPermissions-Bjfhr6FD.js → useReportPermissions-Q-xLwz5N.js} +3 -3
  44. package/package.json +1 -1
  45. package/dist/Main-DUbLeLlK.js +0 -577
  46. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DddOxcG_.js +0 -4121
  47. package/dist/TeamMemberList-CAw4jr1b.js +0 -1186
  48. package/dist/iteration-Dj50K6I7.js +0 -9556
  49. package/dist/useAppStore-CHkGWiai.js +0 -169
  50. /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as St, ref as y, computed as w, onMounted as po, onBeforeUnmount as go, watch as ne, resolveComponent as U, createElementBlock as b, openBlock as v, createBlock as Ce, createCommentVNode as F, createElementVNode as l, Fragment as J, renderList as re, withCtx as B, createVNode as m, toDisplayString as r, unref as d, nextTick as ho, onUnmounted as bo, normalizeClass as yo, createTextVNode as We } from "vue";
2
- import { d as A } from "./dayjs.min-DwQTpnVK.js";
2
+ import { d as A } from "./dayjs.min-BXBPls4m.js";
3
3
  import { useI18n as wt, useCoreStore as _o } from "@feedmepos/mf-common";
4
- import { G as ht, _ as xo } from "./app-BW91YDke.js";
4
+ import { G as ht, _ as xo } from "./app-BZwE2coe.js";
5
5
  import { components as _e } from "@feedmepos/ui-library";
6
- import { g as qe, b as Ge } from "./iteration-Dj50K6I7.js";
6
+ import { g as qe, b as Ge } from "./restaurant-YOVMuuFY.js";
7
7
  import { S as je, _ as Lo } from "./SelectFilter-ATOm0hdn.js";
8
8
  import { _ as So } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
- import { _ as wo } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js";
10
- import { t as ko, p as bt } from "./rule-BJ-o-PKi.js";
9
+ import { _ as wo } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
10
+ import { t as ko, p as bt } from "./rule-BO6xj2Xa.js";
11
11
  import { defineStore as Io } from "pinia";
12
12
  import { u as Mo } from "./useDebounce-B8ZPVS5C.js";
13
13
  const xe = [
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as B, ref as N, onMounted as te, nextTick as ne, onUnmounted as oe, resolveComponent as h, createElementBlock as g, openBlock as s, Fragment as U, createElementVNode as x, renderSlot as P, createCommentVNode as E, toDisplayString as ae, createVNode as le, normalizeStyle as ue, watch as W, defineAsyncComponent as re, computed as I, renderList as A, createBlock as p, withCtx as G, unref as D, resolveDynamicComponent as ie } from "vue";
2
- import { e as H, f as se, U as j } from "./app-BW91YDke.js";
2
+ import { e as H, f as se, U as j } from "./app-BZwE2coe.js";
3
3
  import { useI18n as de, useCoreStore as ce } from "@feedmepos/mf-common";
4
- import { l as me } from "./lodash-DLReQyP0.js";
4
+ import { l as me } from "./lodash-CUIS1iIz.js";
5
5
  const fe = { class: "flex items-center" }, ve = {
6
6
  key: 0,
7
7
  class: "ml-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
@@ -2,18 +2,18 @@ import { toRaw as je, defineComponent as Ae, ref as v, computed as x, watch as a
2
2
  import { useI18n as De, useCoreStore as We } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as Ne, components as ze, useDialog as Qe, useBreakpoints as Ye } from "@feedmepos/ui-library";
4
4
  import { S as fe, _ as Ze } from "./SelectFilter-ATOm0hdn.js";
5
- import { _ as Xe, a as ea } from "./app-BW91YDke.js";
5
+ import { _ as Xe, a as ea } from "./app-BZwE2coe.js";
6
6
  import { _ as Re, u as aa, H as la } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
7
7
  import { u as ta, _ as sa } from "./useDiscardConfirm-DPhEV6v0.js";
8
- import { _ as oa } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js";
8
+ import { _ as oa } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
9
9
  import { _ as Ue } from "./Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js";
10
10
  import { u as ra } from "./useDebounce-B8ZPVS5C.js";
11
- import { u as Ke, E as na } from "./employee-yM0kdY70.js";
12
- import { u as Oe } from "./iteration-Dj50K6I7.js";
13
- import { l as ia } from "./lodash-DLReQyP0.js";
11
+ import { u as Ke, E as na } from "./employee-CJTbs1f7.js";
12
+ import { u as Oe } from "./restaurant-YOVMuuFY.js";
13
+ import { l as ia } from "./lodash-CUIS1iIz.js";
14
14
  import { _ as $e } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
15
- import { u as Be } from "./useLoading-B89K5XKO.js";
16
- import { u as Ee } from "./useAppStore-CHkGWiai.js";
15
+ import { u as Be } from "./useLoading-BH02lYns.js";
16
+ import { u as Ee } from "./role-CzXchcSS.js";
17
17
  /* empty css */
18
18
  function Me(z) {
19
19
  return JSON.parse(JSON.stringify(z));
@@ -0,0 +1,464 @@
1
+ import { defineComponent as X, ref as S, computed as f, watch as ue, resolveComponent as v, createElementBlock as D, openBlock as w, Fragment as E, renderSlot as de, createVNode as l, unref as s, withCtx as g, createElementVNode as o, toDisplayString as _, isRef as H, renderList as me, createBlock as pe, createCommentVNode as fe, withModifiers as W, createTextVNode as J, normalizeClass as ve, h as p } from "vue";
2
+ import { d as ge } from "./dayjs.min-BXBPls4m.js";
3
+ import { useI18n as Z } from "@feedmepos/mf-common";
4
+ import { useSnackbar as ee, components as K, useDialog as _e, useBreakpoints as ye, FmButtonVariant as O } from "@feedmepos/ui-library";
5
+ import { S as A } from "./SelectFilter-ATOm0hdn.js";
6
+ import { _ as he } from "./app-BZwE2coe.js";
7
+ import { _ as Q, u as Ue, H as xe } from "./FormItem.vue_vue_type_script_setup_true_lang-DPT2FoIc.js";
8
+ import { _ as be } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
9
+ import { u as te } from "./useLoading-BH02lYns.js";
10
+ import { u as ae } from "./grant-user-CQZaTzVt.js";
11
+ import { u as se } from "./restaurant-YOVMuuFY.js";
12
+ import { u as re } from "./role-CzXchcSS.js";
13
+ import { _ as Ve } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
+ const ke = { class: "fm-typo-en-title-md-600" }, Fe = { class: "space-y-40" }, we = { class: "flex gap-8 items-center justify-start" }, Se = /* @__PURE__ */ X({
15
+ __name: "GrantUserForm",
16
+ setup(le, { expose: M }) {
17
+ const a = ae(), I = re(), y = se(), x = ee(), C = te(x), { t: d } = Z(), h = S(!1), n = S({
18
+ name: "",
19
+ restaurantId: "",
20
+ roleId: ""
21
+ }), B = () => {
22
+ n.value = {
23
+ name: "",
24
+ restaurantId: "",
25
+ roleId: ""
26
+ }, h.value = !0;
27
+ }, U = f(() => d("grantUser.form.title")), b = f(() => d("common.create")), V = f(() => y.restaurants.value.map((c) => ({
28
+ label: `${c.profile.code ? c.profile.code + " - " : ""}${c.profile.name}`,
29
+ value: c._id
30
+ }))), $ = f(() => n.value.restaurantId ? I.roles.value.filter((c) => c.restaurants.some((i) => i.id === n.value.restaurantId)).map((c) => ({
31
+ label: c.name,
32
+ value: c._id,
33
+ disabled: !c.isUsable
34
+ })) : []);
35
+ ue(
36
+ () => n.value.restaurantId,
37
+ () => {
38
+ n.value.roleId = "";
39
+ }
40
+ );
41
+ async function N() {
42
+ await C.minor(async () => {
43
+ const c = await a.createGrantUser(n.value);
44
+ x.open({
45
+ message: d("grantUser.create.successMessage", {
46
+ passcode: c.passcode
47
+ }),
48
+ type: "success"
49
+ });
50
+ }), h.value = !1;
51
+ }
52
+ return M({
53
+ show: h,
54
+ trigger: B
55
+ }), (c, i) => {
56
+ const R = v("FmTextField"), z = v("FmSelect"), F = v("fm-button"), T = v("fm-side-sheet");
57
+ return w(), D(E, null, [
58
+ de(c.$slots, "default", { trigger: B }),
59
+ l(T, {
60
+ id: "grant-user-form",
61
+ modelValue: h.value,
62
+ "onUpdate:modelValue": i[4] || (i[4] = (u) => h.value = u),
63
+ "is-container": s(K).FmForm,
64
+ "is-container-props": {
65
+ onValidationSuccess: N,
66
+ blameFormChildOnValidationFailed: !0
67
+ },
68
+ "max-width": 560
69
+ }, {
70
+ "side-sheet-header": g(() => [
71
+ o("p", ke, _(U.value), 1)
72
+ ]),
73
+ "side-sheet-footer": g(() => [
74
+ o("div", we, [
75
+ l(F, {
76
+ label: b.value,
77
+ size: "lg",
78
+ type: "submit",
79
+ variant: "primary"
80
+ }, null, 8, ["label"]),
81
+ l(F, {
82
+ label: s(d)("common.cancel"),
83
+ size: "lg",
84
+ variant: "tertiary",
85
+ onClick: i[3] || (i[3] = () => h.value = !1)
86
+ }, null, 8, ["label"])
87
+ ])
88
+ ]),
89
+ default: g(() => [
90
+ o("div", Fe, [
91
+ l(Ve, {
92
+ title: s(d)("grantUser.form.section")
93
+ }, {
94
+ default: g(() => [
95
+ l(R, {
96
+ modelValue: n.value.name,
97
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => n.value.name = u),
98
+ label: s(d)("grantUser.form.name"),
99
+ rules: [(u) => !!u || s(d)("grantUser.form.nameRequired")]
100
+ }, null, 8, ["modelValue", "label", "rules"]),
101
+ l(Q, {
102
+ label: s(d)("grantUser.form.restaurant")
103
+ }, {
104
+ default: g(() => [
105
+ l(z, {
106
+ modelValue: n.value.restaurantId,
107
+ "onUpdate:modelValue": i[1] || (i[1] = (u) => n.value.restaurantId = u),
108
+ items: V.value,
109
+ placeholder: s(d)("grantUser.form.selectRestaurant"),
110
+ rules: [(u) => !!u || s(d)("grantUser.form.restaurantRequired")]
111
+ }, null, 8, ["modelValue", "items", "placeholder", "rules"])
112
+ ]),
113
+ _: 1
114
+ }, 8, ["label"]),
115
+ l(Q, {
116
+ label: s(d)("grantUser.form.role")
117
+ }, {
118
+ default: g(() => [
119
+ l(z, {
120
+ modelValue: n.value.roleId,
121
+ "onUpdate:modelValue": i[2] || (i[2] = (u) => n.value.roleId = u),
122
+ items: $.value,
123
+ placeholder: s(d)("grantUser.form.selectRole"),
124
+ disabled: !n.value.restaurantId,
125
+ rules: [(u) => !!u || s(d)("grantUser.form.roleRequired")]
126
+ }, null, 8, ["modelValue", "items", "placeholder", "disabled", "rules"])
127
+ ]),
128
+ _: 1
129
+ }, 8, ["label"])
130
+ ]),
131
+ _: 1
132
+ }, 8, ["title"])
133
+ ])
134
+ ]),
135
+ _: 1
136
+ }, 8, ["modelValue", "is-container", "is-container-props"])
137
+ ], 64);
138
+ };
139
+ }
140
+ }), Ie = {
141
+ class: "space-y-8"
142
+ }, Ce = {
143
+ class: "xs:hidden flex w-full items-start justify-between"
144
+ }, Be = {
145
+ class: "flex items-start gap-8"
146
+ }, $e = {
147
+ class: "space-y-4 hidden xs:block"
148
+ }, Ne = {
149
+ class: "px-16"
150
+ }, Re = {
151
+ class: "px-16 flex items-start gap-8"
152
+ }, ze = {
153
+ class: "flex h-full flex-col overflow-auto"
154
+ }, Le = {
155
+ class: "pb-64 hidden xs:block"
156
+ }, Ae = {
157
+ class: "space-y-4"
158
+ }, De = {
159
+ class: "flex items-center gap-8"
160
+ }, Ke = {
161
+ class: "fm-typo-en-body-lg-600"
162
+ }, Me = {
163
+ class: "font-mono text-lg font-bold mr-4"
164
+ }, Te = {
165
+ class: "text-fm-color-typo-secondary"
166
+ }, Ge = {
167
+ class: "mt-4 space-y-2"
168
+ }, je = {
169
+ class: "text-xs"
170
+ }, Oe = {
171
+ class: "text-xs"
172
+ }, Ee = {
173
+ key: 0,
174
+ class: "flex flex-col gap-4"
175
+ }, rt = /* @__PURE__ */ X({
176
+ __name: "GrantUserList",
177
+ setup(le, {
178
+ expose: M
179
+ }) {
180
+ const {
181
+ t: a
182
+ } = Z(), I = (e) => ge(e).format("DD/MM/YYYY, h:mm:ss A"), y = S(), x = ae(), {
183
+ restaurants: C
184
+ } = se(), {
185
+ roles: d
186
+ } = re(), h = f(() => x.grantUsers), {
187
+ searchKey: n,
188
+ filter: B
189
+ } = Ue(), U = f(() => {
190
+ var e;
191
+ return (e = h.value) == null ? void 0 : e.filter((t) => {
192
+ const m = !y.value || y.value.includes(t.restaurantId), G = !k.value || k.value.includes(t.status), L = b.value[t.restaurantId] || "", j = V.value[t.roleId] || "";
193
+ return m && G && B([t.passcode, t.name, L, j, t.grantByName]);
194
+ });
195
+ }), b = f(() => {
196
+ const e = {};
197
+ return C.value.forEach((t) => {
198
+ e[t._id] = t.profile.name;
199
+ }), e;
200
+ }), V = f(() => {
201
+ const e = {};
202
+ return d.value.forEach((t) => {
203
+ e[t._id] = t.name;
204
+ }), e;
205
+ }), $ = (e) => {
206
+ switch (e) {
207
+ case "active":
208
+ return "bg-fm-color-system-success-100 text-fm-color-typo-success";
209
+ case "used":
210
+ return "bg-fm-color-typo-tertiary text-fm-color-typo-primary";
211
+ case "revoked":
212
+ return "bg-fm-color-system-error-100 text-fm-color-typo-error";
213
+ default:
214
+ return "bg-fm-color-typo-secondary text-fm-color-typo-primary";
215
+ }
216
+ }, N = (e) => a(`grantUser.status.${e}`), c = [{
217
+ accessorKey: "passcode",
218
+ size: 120,
219
+ maxSize: 120,
220
+ minSize: 120,
221
+ header: () => a("grantUser.columns.passcode"),
222
+ cell(e) {
223
+ const t = e.row.original.passcode;
224
+ return p("div", {
225
+ class: "flex items-center gap-8"
226
+ }, [p(K.FmButton, {
227
+ variant: O.Tertiary,
228
+ textColor: "neutral-gray-400",
229
+ icon: "content_copy",
230
+ onClick: (m) => {
231
+ m.stopPropagation(), q(t);
232
+ }
233
+ }), p("span", {
234
+ class: "font-mono text-lg font-bold"
235
+ }, t)]);
236
+ }
237
+ }, {
238
+ accessorKey: "name",
239
+ header: () => a("grantUser.columns.name")
240
+ }, {
241
+ accessorKey: "restaurantName",
242
+ accessorFn: (e) => b.value[e.restaurantId],
243
+ header: () => a("grantUser.columns.restaurant"),
244
+ meta: {
245
+ width: "250px"
246
+ },
247
+ cell(e) {
248
+ return p("div", b.value[e.row.original.restaurantId] || "-");
249
+ }
250
+ }, {
251
+ accessorKey: "roleName",
252
+ accessorFn: (e) => V.value[e.roleId],
253
+ header: () => a("grantUser.columns.role"),
254
+ cell(e) {
255
+ const t = e.row.original.roleId, m = V.value[t] || "-";
256
+ return p("div", m);
257
+ }
258
+ }, {
259
+ accessorKey: "status",
260
+ header: () => a("grantUser.columns.status"),
261
+ meta: {
262
+ maxWidth: "120px"
263
+ },
264
+ cell(e) {
265
+ const t = e.row.original.status;
266
+ return p(K.FmChip, {
267
+ label: N(t),
268
+ class: $(t)
269
+ });
270
+ }
271
+ }, {
272
+ accessorKey: "grantByName",
273
+ header: () => a("grantUser.columns.grantedBy"),
274
+ cell(e) {
275
+ return p("div", e.row.original.grantByName);
276
+ }
277
+ }, {
278
+ accessorKey: "createdAt",
279
+ header: () => a("grantUser.columns.createdAt"),
280
+ cell(e) {
281
+ const t = e.row.original.createdAt;
282
+ return p("div", I(t));
283
+ }
284
+ }, {
285
+ id: "action",
286
+ size: 180,
287
+ meta: {
288
+ cellClass: "p-16",
289
+ headerContentClass: "-mx-16"
290
+ },
291
+ cell: (e) => {
292
+ const t = e.row.original;
293
+ return t.status !== "active" ? null : p("div", {
294
+ class: "w-full flex justify-end items-center gap-4"
295
+ }, [p(K.FmButton, {
296
+ label: a("grantUser.actions.revoke"),
297
+ variant: O.Secondary,
298
+ onClick: (m) => {
299
+ m.stopPropagation(), u(t);
300
+ }
301
+ })]);
302
+ }
303
+ }], i = ee(), R = _e(), z = te(i), F = S(), {
304
+ breakpoints: T
305
+ } = ye(), u = (e) => {
306
+ R.open({
307
+ title: a("grantUser.revoke.title"),
308
+ message: a("grantUser.revoke.message", {
309
+ name: e.name
310
+ }),
311
+ minWidth: T.value.lg ? 588 : 0,
312
+ primaryActions: {
313
+ text: a("grantUser.actions.revoke"),
314
+ close: !1,
315
+ variant: "destructive"
316
+ },
317
+ secondaryActions: {
318
+ text: a("common.cancel"),
319
+ close: !0
320
+ }
321
+ }).onPrimary(async () => {
322
+ z.minor(async () => {
323
+ await x.revokeGrantUser(e._id, e.restaurantId);
324
+ }, {
325
+ successMessage: a("grantUser.revoke.successMessage", {
326
+ name: e.name
327
+ })
328
+ }), R.close();
329
+ });
330
+ };
331
+ function oe() {
332
+ var e;
333
+ (e = F.value) == null || e.trigger();
334
+ }
335
+ const P = f(() => [{
336
+ label: a("grantUser.status.active"),
337
+ value: "active"
338
+ }, {
339
+ label: a("grantUser.status.used"),
340
+ value: "used"
341
+ }, {
342
+ label: a("grantUser.status.revoked"),
343
+ value: "revoked"
344
+ }]), Y = f(() => C.value.map((e) => ({
345
+ label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
346
+ value: e._id
347
+ }))), k = S();
348
+ async function q(e) {
349
+ try {
350
+ await navigator.clipboard.writeText(e), i.open({
351
+ message: a("grantUser.passcode.copied"),
352
+ type: "success"
353
+ });
354
+ } catch (t) {
355
+ i.open({
356
+ message: String(t),
357
+ type: "error"
358
+ });
359
+ }
360
+ }
361
+ return M({
362
+ create: oe,
363
+ filteredGrantUsers: U
364
+ }), (e, t) => {
365
+ const m = v("FmSearch"), G = v("FmTable"), L = v("FmButton"), j = v("FmChip"), ne = v("FmListItem"), ce = v("FmList");
366
+ return w(), D(E, null, [l(Se, {
367
+ ref_key: "grantUserFormRef",
368
+ ref: F,
369
+ class: "gap-8"
370
+ }, null, 512), o("div", Ie, [o("div", Ce, [o("div", Be, [l(A, {
371
+ modelValue: y.value,
372
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => y.value = r),
373
+ multiple: "",
374
+ items: Y.value,
375
+ variant: "dark",
376
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
377
+ placeholder: s(a)("grantUser.columns.restaurant"),
378
+ class: "!w-auto"
379
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(A, {
380
+ modelValue: k.value,
381
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => k.value = r),
382
+ multiple: "",
383
+ variant: "dark",
384
+ items: P.value,
385
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
386
+ placeholder: s(a)("grantUser.filter.status_placeholder")
387
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), l(m, {
388
+ modelValue: s(n),
389
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => H(n) ? n.value = r : null),
390
+ autofocus: "",
391
+ class: "pl-4 w-[320px]",
392
+ placeholder: s(a)("grantUser.search.placeholder")
393
+ }, null, 8, ["modelValue", "placeholder"])]), o("div", $e, [o("div", Ne, [l(m, {
394
+ modelValue: s(n),
395
+ "onUpdate:modelValue": t[3] || (t[3] = (r) => H(n) ? n.value = r : null),
396
+ autofocus: "",
397
+ placeholder: s(a)("grantUser.search.placeholder")
398
+ }, null, 8, ["modelValue", "placeholder"])]), l(xe), o("div", Re, [l(A, {
399
+ modelValue: y.value,
400
+ "onUpdate:modelValue": t[4] || (t[4] = (r) => y.value = r),
401
+ multiple: "",
402
+ items: Y.value,
403
+ variant: "dark",
404
+ "selected-prefix": s(a)("grantUser.columns.restaurant"),
405
+ placeholder: s(a)("grantUser.columns.restaurant"),
406
+ class: "!w-auto"
407
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), l(A, {
408
+ modelValue: k.value,
409
+ "onUpdate:modelValue": t[5] || (t[5] = (r) => k.value = r),
410
+ multiple: "",
411
+ items: P.value,
412
+ variant: "dark",
413
+ "selected-prefix": s(a)("grantUser.filter.selected_status_prefix"),
414
+ placeholder: s(a)("grantUser.filter.status_placeholder")
415
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), l(he, null, {
416
+ default: g(() => [o("div", ze, [l(be, {
417
+ "is-loading": s(x).isLoading,
418
+ "is-empty": U.value.length === 0,
419
+ title: s(a)("grantUser.noData.title"),
420
+ subtitle: s(a)("grantUser.noData.subtitle")
421
+ }, {
422
+ default: g(() => [l(G, {
423
+ class: "xs:hidden",
424
+ "column-defs": c,
425
+ "row-data": U.value,
426
+ "page-size": U.value.length,
427
+ loading: s(x).isLoading,
428
+ virtual: U.value.length > 0,
429
+ "pin-header-row": "",
430
+ "hide-footer": ""
431
+ }, null, 8, ["row-data", "page-size", "loading", "virtual"])]),
432
+ _: 1
433
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"]), o("div", Le, [l(ce, {
434
+ separator: ""
435
+ }, {
436
+ default: g(() => [(w(!0), D(E, null, me(U.value, (r) => (w(), pe(ne, {
437
+ key: r._id,
438
+ class: "py-12 px-16 items-center justify-between"
439
+ }, {
440
+ default: g(() => [o("div", Ae, [o("div", De, [l(L, {
441
+ variant: "tertiary",
442
+ "text-color": "neutral-gray-400",
443
+ icon: "content_copy",
444
+ onClick: W((ie) => q(r.passcode), ["stop"])
445
+ }, null, 8, ["onClick"]), o("p", Ke, [o("span", Me, _(r.passcode), 1), J(" - " + _(r.name), 1)])]), o("div", Te, [o("div", null, [J(_(b.value[r.restaurantId] || "-") + " ", 1), o("div", null, _(V.value[r.roleId] || "-"), 1)]), o("div", Ge, [o("div", je, _(s(a)("grantUser.columns.grantedBy")) + ": " + _(r.grantByName), 1), o("div", Oe, _(s(a)("grantUser.columns.createdAt")) + ": " + _(I(r.createdAt)), 1), l(j, {
446
+ label: N(r.status),
447
+ class: ve($(r.status))
448
+ }, null, 8, ["label", "class"])])])]), r.status === "active" ? (w(), D("div", Ee, [l(L, {
449
+ label: s(a)("grantUser.actions.revoke"),
450
+ variant: s(O).Secondary,
451
+ onClick: W((ie) => u(r), ["stop"])
452
+ }, null, 8, ["label", "variant", "onClick"])])) : fe("", !0)]),
453
+ _: 2
454
+ }, 1024))), 128))]),
455
+ _: 1
456
+ })])])]),
457
+ _: 1
458
+ })])], 64);
459
+ };
460
+ }
461
+ });
462
+ export {
463
+ rt as default
464
+ };
@@ -4,17 +4,19 @@ import { useCoreStore as uf, useI18n as vf } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as pf } from "@feedmepos/ui-library";
5
5
  import { _ as df } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js";
6
6
  import { _ as mf } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
7
- import { u as gf } from "./iteration-Dj50K6I7.js";
8
- import { u as _f } from "./useAppStore-CHkGWiai.js";
7
+ import { u as gf } from "./restaurant-YOVMuuFY.js";
8
+ import { u as _f } from "./role-CzXchcSS.js";
9
9
  /* empty css */
10
- import "./employee-yM0kdY70.js";
11
- import "./lodash-DLReQyP0.js";
10
+ import "./employee-CJTbs1f7.js";
11
+ import "./lodash-CUIS1iIz.js";
12
+ import "./useAppStore-DNTlIeMv.js";
13
+ import "./iteration-BCbIbdHR.js";
12
14
  /* empty css */
13
- import { R as pt } from "./app-BW91YDke.js";
14
- import "./rule-BJ-o-PKi.js";
15
- import "./useReportPermissions-Bjfhr6FD.js";
16
- import "./dayjs.min-DwQTpnVK.js";
17
- import "./TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DGwteHIL.js";
15
+ import { R as pt } from "./app-BZwE2coe.js";
16
+ import "./rule-BO6xj2Xa.js";
17
+ import "./useReportPermissions-Q-xLwz5N.js";
18
+ import "./dayjs.min-BXBPls4m.js";
19
+ import "./TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-B9qlQ6KG.js";
18
20
  var Nn = {};
19
21
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
20
22
  var qt = {};
@@ -15485,7 +15487,7 @@ var Zt = {
15485
15487
  const o2 = {
15486
15488
  key: 0,
15487
15489
  class: "mr-16"
15488
- }, c2 = { class: "space-y-24" }, N2 = /* @__PURE__ */ rf({
15490
+ }, c2 = { class: "space-y-24" }, C2 = /* @__PURE__ */ rf({
15489
15491
  __name: "Main",
15490
15492
  setup(e) {
15491
15493
  const t = cf(), r = hf(), { currentBusiness: n } = uf(), { restaurants: a, readRestaurants: i } = gf(), { readRoles: s, roles: f } = _f(), { t: o } = vf(), l = pf(), c = Ut(), d = Ut(), v = Ut(), p = Ut(!1), E = vt(() => p.value || a.value.length === 0), h = vt({
@@ -15625,5 +15627,5 @@ const o2 = {
15625
15627
  }
15626
15628
  });
15627
15629
  export {
15628
- N2 as default
15630
+ C2 as default
15629
15631
  };