@feedmepos/mf-hrm-portal 1.1.0-dev → 1.1.2-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 (101) hide show
  1. package/dist/AuditLogList-CjrocQS2.js +316 -0
  2. package/dist/{EmployeeList-tmUqs5a6.js → EmployeeList-CKHgrdAO.js} +157 -150
  3. package/dist/Main-HzplGv-e.js +85 -0
  4. package/dist/{main-DOtgCRZe.js → Main-YQ5f-v03.js} +1501 -1532
  5. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js → PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js} +2 -2
  6. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-xQ4fjIxa.js +3050 -0
  7. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
  8. package/dist/{RoleList-C5xG7LHg.js → RoleList-Bef-7IhW.js} +52 -50
  9. package/dist/RolePermissionList-BzwpQFeO.js +285 -0
  10. package/dist/{useSearch-C25VELOk.js → SelectFilter-NbXrJ4iH.js} +90 -101
  11. package/dist/TeamMemberList-D2Xey_w9.js +949 -0
  12. package/dist/{TimesheetList-CZfo4Dua.js → TimesheetList-DVIk0Tis.js} +30 -29
  13. package/dist/api/audit-log/index.d.ts +10 -0
  14. package/dist/api/index.d.ts +1 -3
  15. package/dist/api/permission-assignment/index.d.ts +10 -0
  16. package/dist/api/permission-set/index.d.ts +8 -0
  17. package/dist/api/team/index.d.ts +5 -1
  18. package/dist/app-DUs516v0.js +2592 -0
  19. package/dist/app.js +4 -4
  20. package/dist/components/AppForm.vue.d.ts +3 -2
  21. package/dist/components/CheckboxInput.vue.d.ts +10 -4
  22. package/dist/components/CollapsibleWrapper.vue.d.ts +3 -2
  23. package/dist/components/form/SelectFilter.vue.d.ts +3 -2
  24. package/dist/components/layout/FormColumn.vue.d.ts +6 -3
  25. package/dist/components/layout/FormItem.vue.d.ts +2 -1
  26. package/dist/components/layout/FormSection.vue.d.ts +2 -1
  27. package/dist/components/layout/FullWrapper.vue.d.ts +6 -3
  28. package/dist/components/layout/PageLayout.vue.d.ts +2 -1
  29. package/dist/components/menu/BottomSheetMenu.vue.d.ts +2 -1
  30. package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +6 -3
  31. package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +6 -3
  32. package/dist/composables/useAppStore.d.ts +6 -6
  33. package/dist/composables/useDateRange.d.ts +1 -1
  34. package/dist/composables/useRestaurantMap.d.ts +4 -8
  35. package/dist/composables/useSheet.d.ts +1 -1
  36. package/dist/dayjs.min-DVb8OkTL.js +282 -0
  37. package/dist/employee-jH7EJnhi.js +172 -0
  38. package/dist/helpers/permission-set.d.ts +32 -0
  39. package/dist/helpers/portal-user.d.ts +8 -0
  40. package/dist/helpers/rule.d.ts +4 -3
  41. package/dist/index-CicR1-Jp.js +8411 -0
  42. package/dist/{empty-placeholder-ey8LJtN1.js → index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js} +43 -2
  43. package/dist/{lodash-DNzKT_gG.js → lodash-DpoPPi_j.js} +326 -343
  44. package/dist/router/shared.d.ts +3 -1
  45. package/dist/stores/employee.d.ts +4 -4
  46. package/dist/stores/permission-assignment.d.ts +277 -0
  47. package/dist/stores/permission-set.d.ts +250 -0
  48. package/dist/stores/role.d.ts +4 -4
  49. package/dist/stores/team.d.ts +288 -0
  50. package/dist/stores/timesheet.d.ts +19 -19
  51. package/dist/team-CiZSNUQW.js +26 -0
  52. package/dist/timesheet-BRQvljNj.js +56 -0
  53. package/dist/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/types/audit-log.d.ts +19 -0
  55. package/dist/types/permission-assignment.d.ts +20 -0
  56. package/dist/types/permission-set.d.ts +20 -0
  57. package/dist/types/permission.d.ts +1 -4
  58. package/dist/types/team.d.ts +13 -3
  59. package/dist/useAppStore-RzLLN5d9.js +180 -0
  60. package/dist/useLoading-1OqFn86y.js +99 -0
  61. package/dist/useRestaurantMap-D5BNPLKh.js +107 -0
  62. package/dist/useSearch-B6WK1LBB.js +15 -0
  63. package/dist/views/audit-log/locales/index.d.ts +211 -0
  64. package/dist/views/hr/employee/{components/EmployeeForm.vue.d.ts → EmployeeForm.vue.d.ts} +10 -7
  65. package/dist/views/hr/locales/index.d.ts +0 -214
  66. package/dist/views/team/components/BasePermission.vue.d.ts +64 -0
  67. package/dist/views/team/components/{TeamMemberConditionPermission.vue.d.ts → ConditionPermission.vue.d.ts} +14 -1
  68. package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +14 -0
  69. package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +14 -0
  70. package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +68 -28
  71. package/dist/views/team/components/{TeamMemberRolePermission.vue.d.ts → PosRolePermission.vue.d.ts} +14 -1
  72. package/dist/views/team/locales/index.d.ts +176 -4
  73. package/dist/views/team/{components → member}/AddMemberForm.vue.d.ts +1 -0
  74. package/dist/views/team/member/TeamMemberList.vue.d.ts +4 -0
  75. package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +55 -0
  76. package/dist/views/team/role/RolePermissionForm.vue.d.ts +19 -0
  77. package/dist/views/{hr/grant-user/GrantUserList.vue.d.ts → team/role/RolePermissionList.vue.d.ts} +0 -12
  78. package/package.json +14 -9
  79. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BY9VGOoM.js +0 -71
  80. package/dist/HorizontalSplitter-B9DVYJIM.js +0 -12
  81. package/dist/Main-ebQsujY3.js +0 -600
  82. package/dist/TeamMemberList-09_3YTHe.js +0 -1509
  83. package/dist/api/grant-user/index.d.ts +0 -8
  84. package/dist/app-B4KDGOw1.js +0 -1432
  85. package/dist/employee-BQc7Wgpu.js +0 -450
  86. package/dist/index-CSG8t9Dl.js +0 -58
  87. package/dist/role-DGAu9X1X.js +0 -9728
  88. package/dist/rule-CSj0p2P3.js +0 -450
  89. package/dist/stores/grant-user.d.ts +0 -86
  90. package/dist/timesheet-B4M1nCIm.js +0 -57
  91. package/dist/types/grant-user.d.ts +0 -17
  92. package/dist/useAppStore-CKmMR-gI.js +0 -93
  93. package/dist/useLoading-v4m-6mEy.js +0 -141
  94. package/dist/useRestaurantMap-e9fQJiLC.js +0 -39
  95. package/dist/views/hr/grant-user/components/GrantUserForm.vue.d.ts +0 -14
  96. package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +0 -36
  97. package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +0 -718
  98. /package/dist/views/{hr/grant-user/Main.vue.d.ts → audit-log/AuditLogList.vue.d.ts} +0 -0
  99. /package/dist/views/hr/{main.vue.d.ts → Main.vue.d.ts} +0 -0
  100. /package/dist/views/team/{TeamMemberList.vue.d.ts → Main.vue.d.ts} +0 -0
  101. /package/dist/views/team/{components → member}/MemberInfo.vue.d.ts +0 -0
@@ -0,0 +1,19 @@
1
+ export interface AuditLogMetadata {
2
+ reason: string;
3
+ resolvedFrom: 'admin' | 'staff' | 'permissionSet' | 'custom' | 'unknown';
4
+ permissionSetId?: string;
5
+ requestPath?: string;
6
+ requestMethod?: string;
7
+ requestBody?: Record<string, unknown>;
8
+ }
9
+ export interface AuditLogEntry {
10
+ timestamp: string;
11
+ userId: string;
12
+ subject: string;
13
+ action: string;
14
+ field?: string | null;
15
+ businessId?: string | null;
16
+ restaurantId?: string | null;
17
+ outcome: 'allowed' | 'denied';
18
+ metadata: AuditLogMetadata;
19
+ }
@@ -0,0 +1,20 @@
1
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
+ export interface IFdtoPermissionAssignment {
3
+ id: string;
4
+ customPermissions: FdoPermissionRule[];
5
+ permissionSetIds: string[];
6
+ businessId: string;
7
+ userId: string;
8
+ }
9
+ export interface IFdtoUpdatePermissionAssignmentReq {
10
+ customPermissions: FdoPermissionRule[];
11
+ permissionSetIds: string[];
12
+ businessId: string;
13
+ userId: string;
14
+ }
15
+ export interface IFdtoCreatePermissionAssignmentReq {
16
+ customPermissions: FdoPermissionRule[];
17
+ permissionSetIds: string[];
18
+ businessId: string;
19
+ userId: string;
20
+ }
@@ -0,0 +1,20 @@
1
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
+ export interface IFdtoPermissionSet {
3
+ id: string;
4
+ permissions: FdoPermissionRule[];
5
+ businessId: string;
6
+ name: string;
7
+ }
8
+ export interface IFdtoCreatePermissionSetReq {
9
+ name: string;
10
+ businessId: string;
11
+ permissions: FdoPermissionRule[];
12
+ }
13
+ export interface IFdtoUpdatePermissionSetReq {
14
+ name?: string;
15
+ permissions?: FdoPermissionRule[];
16
+ }
17
+ export interface InheritedPermission {
18
+ id: string;
19
+ setNames: string[];
20
+ }
@@ -1,4 +1 @@
1
- export { Permission, fullPermission as fullPortalPermissions, type AbilityConstructOption, type PermissionLevelDetail, type IFdtoPortalPermission, type IPermissionUser, } from '@feedmepos/mf-common';
2
- export declare const inventorySubjects: string[];
3
- import type { FdoPermissionRule } from '@feedmepos/core/entity';
4
- export declare const fullPosPermissions: FdoPermissionRule[];
1
+ export { Permission, FullPortalPermissions, FullPosPermissions, LegacyPermissionMapping, PermissionCategory, PortalPermissionCategories, type PermissionCategoryValue, type AbilityConstructOption, type PermissionLevelDetail, type IFdtoPortalPermission, type IPermissionUser, } from '@feedmepos/hrm-permission';
@@ -1,4 +1,5 @@
1
1
  import type { RawRule } from '@casl/ability';
2
+ import type { FdoPermissionRule } from '@feedmepos/core/entity';
2
3
  export interface IPermissionUser {
3
4
  businessId: string;
4
5
  userId: string;
@@ -7,6 +8,7 @@ export interface IPermissionUser {
7
8
  /** @deprecated */
8
9
  phoneNumber?: string;
9
10
  permissions: RawRule[];
11
+ permissionSetIds: string[];
10
12
  }
11
13
  export interface IFdtoPortalUser extends IPermissionUser {
12
14
  id: string;
@@ -28,13 +30,20 @@ export interface IFdtoPermissionPosUserRole {
28
30
  roleId: string;
29
31
  }
30
32
  export interface IFdtoUpdatePortalUserReq {
31
- permissions?: RawRule[];
33
+ /** @deprecated use customPermissions instead */
34
+ permissions?: FdoPermissionRule[];
32
35
  posUser?: IFdtoPermissionPosUser;
36
+ permissionSetIds?: string[];
37
+ customPermissions?: FdoPermissionRule[];
33
38
  }
34
39
  export interface IFdtoCreatePortalUserReq {
35
40
  phoneNumber?: string;
36
41
  email?: string;
37
- permissions: RawRule[];
42
+ /** @deprecated use customPermissions instead */
43
+ permissions?: FdoPermissionRule[];
44
+ permissionSetIds?: string[];
45
+ customPermissions: FdoPermissionRule[];
46
+ name?: string;
38
47
  posUser?: IFdtoPermissionPosUser;
39
48
  }
40
49
  export interface FTeamMember {
@@ -44,6 +53,7 @@ export interface FTeamMember {
44
53
  email: string;
45
54
  restaurants: string[];
46
55
  managableRestaurantIds: string[];
47
- permissions: string[];
56
+ permissions: FdoPermissionRule[];
57
+ permissionLabels: string[];
48
58
  doc: IFdtoPortalUser;
49
59
  }
@@ -0,0 +1,180 @@
1
+ import { defineStore as f, storeToRefs as v } from "pinia";
2
+ import { ref as b } from "vue";
3
+ import { useCoreStore as I, baseClientInstance as h } from "@feedmepos/mf-common";
4
+ import { g as l, b as d, s as w } from "./index-CicR1-Jp.js";
5
+ const p = {
6
+ async readRoles() {
7
+ return l(await d().get("/pos-roles"));
8
+ },
9
+ async createRole(e) {
10
+ return l(await d().post("/pos-roles", e));
11
+ },
12
+ async updateRole(e, t) {
13
+ return l(await d().put(`/pos-roles/${e}`, t));
14
+ },
15
+ async deleteRole(e) {
16
+ return l(
17
+ await d().put(`/pos-roles/${e._id}`, {
18
+ restaurantIds: [],
19
+ role: e
20
+ })
21
+ );
22
+ }
23
+ };
24
+ async function g(e) {
25
+ const { restaurants: t } = I(), i = e.reduce((a, u) => {
26
+ var s;
27
+ const c = a.findIndex((o) => o._id === u._id), r = {
28
+ id: u.restaurantId,
29
+ name: ((s = t.value.find((o) => o._id === u.restaurantId)) == null ? void 0 : s.profile.name) || ""
30
+ };
31
+ return c < 0 ? a.push({
32
+ ...u,
33
+ restaurants: [r]
34
+ }) : a[c].restaurants.some((o) => o.id === u.restaurantId) || (a[c].restaurants = w([...a[c].restaurants, r], { selector: "name" })), a;
35
+ }, []);
36
+ return w(i, { selector: "name" });
37
+ }
38
+ const x = f("role", () => {
39
+ const e = b([]), t = b(!1);
40
+ async function i() {
41
+ try {
42
+ t.value = !0;
43
+ const r = await p.readRoles();
44
+ e.value = await g(r);
45
+ } catch (r) {
46
+ console.log("Error reading roles:", r);
47
+ } finally {
48
+ t.value = !1;
49
+ }
50
+ }
51
+ async function a(r) {
52
+ try {
53
+ const s = await p.createRole(r);
54
+ e.value = await g(s);
55
+ } catch (s) {
56
+ console.log("Error creating role:", s);
57
+ }
58
+ }
59
+ async function u(r, s) {
60
+ try {
61
+ const o = await p.updateRole(r, s);
62
+ e.value = await g(o);
63
+ } catch (o) {
64
+ console.log("Error updating role:", o);
65
+ }
66
+ }
67
+ async function c(r) {
68
+ try {
69
+ const s = await p.deleteRole(r);
70
+ e.value = await g(s);
71
+ } catch (s) {
72
+ console.log("Error deleting role:", s);
73
+ }
74
+ }
75
+ return {
76
+ roles: e,
77
+ isLoading: t,
78
+ readRoles: i,
79
+ createRole: a,
80
+ updateRole: u,
81
+ deleteRole: c
82
+ };
83
+ }), T = () => {
84
+ const e = x();
85
+ return {
86
+ ...e,
87
+ ...v(e)
88
+ };
89
+ };
90
+ var n = [];
91
+ for (var m = 0; m < 256; ++m)
92
+ n.push((m + 256).toString(16).slice(1));
93
+ function Q(e, t = 0) {
94
+ return (n[e[t + 0]] + n[e[t + 1]] + n[e[t + 2]] + n[e[t + 3]] + "-" + n[e[t + 4]] + n[e[t + 5]] + "-" + n[e[t + 6]] + n[e[t + 7]] + "-" + n[e[t + 8]] + n[e[t + 9]] + "-" + n[e[t + 10]] + n[e[t + 11]] + n[e[t + 12]] + n[e[t + 13]] + n[e[t + 14]] + n[e[t + 15]]).toLowerCase();
95
+ }
96
+ var y, U = new Uint8Array(16);
97
+ function D() {
98
+ if (!y && (y = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !y))
99
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
100
+ return y(U);
101
+ }
102
+ var A = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
103
+ const R = {
104
+ randomUUID: A
105
+ };
106
+ function E(e, t, i) {
107
+ if (R.randomUUID && !e)
108
+ return R.randomUUID();
109
+ e = e || {};
110
+ var a = e.random || (e.rng || D)();
111
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Q(a);
112
+ }
113
+ const S = {
114
+ async read() {
115
+ return l(await h("/").get("/public-setting"));
116
+ },
117
+ async update(e) {
118
+ return l(await h("/").put("/public-setting", e));
119
+ }
120
+ };
121
+ function L() {
122
+ return {
123
+ loadingQueue: [],
124
+ publicSetting: {
125
+ delivery: {
126
+ feedMe: {
127
+ areas: [],
128
+ enable: !1,
129
+ maxDistance: 0
130
+ }
131
+ },
132
+ sms: {
133
+ firebase: !1
134
+ },
135
+ assets: {
136
+ groups: []
137
+ },
138
+ aiSettings: {
139
+ remy: { enable: !1 }
140
+ }
141
+ }
142
+ };
143
+ }
144
+ const $ = f("portal-app-store", {
145
+ state: () => L(),
146
+ actions: {
147
+ addLoadingQueues(e) {
148
+ this.loadingQueue = [...this.loadingQueue, ...e];
149
+ },
150
+ clearLoadingQueue() {
151
+ this.loadingQueue = [];
152
+ },
153
+ resolveQueues(e) {
154
+ this.loadingQueue = this.loadingQueue.filter((t) => !e.includes(t.id));
155
+ },
156
+ async promise(e, t = !0) {
157
+ const i = E();
158
+ try {
159
+ const a = [{ id: i, isGlobal: t }];
160
+ return this.addLoadingQueues(a), await e();
161
+ } finally {
162
+ this.resolveQueues([i]);
163
+ }
164
+ },
165
+ async getPublicSetting() {
166
+ return this.publicSetting = await S.read(), this.publicSetting;
167
+ },
168
+ async updatePublicSetting(e) {
169
+ return this.publicSetting = await S.update({
170
+ ...this.publicSetting,
171
+ ...e
172
+ }), this.publicSetting;
173
+ }
174
+ }
175
+ });
176
+ export {
177
+ $ as a,
178
+ T as u,
179
+ E as v
180
+ };
@@ -0,0 +1,99 @@
1
+ import { computed as I, isRef as L, watch as M } from "vue";
2
+ import { SnackbarPosition as y } from "@feedmepos/ui-library";
3
+ import { a as w, v } from "./useAppStore-RzLLN5d9.js";
4
+ const E = (r) => {
5
+ async function d(u, e) {
6
+ var l, a;
7
+ let t = [];
8
+ !e || !e.customId ? t.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${v().split("-")[0]}`) : typeof e.customId == "string" ? t.push(e.customId) : t = e.customId;
9
+ const p = w();
10
+ p.addLoadingQueues(
11
+ t.map((s) => ({
12
+ id: s,
13
+ isGlobal: (e == null ? void 0 : e.isGlobal) || !1
14
+ }))
15
+ );
16
+ try {
17
+ const s = await u();
18
+ return await ((l = e == null ? void 0 : e.onSuccess) == null ? void 0 : l.call(e, s)), s;
19
+ } catch (s) {
20
+ const m = s instanceof Error ? s.message : `${s}`;
21
+ throw e != null && e.onError ? await e.onError(m) : r.open({
22
+ type: "error",
23
+ message: m
24
+ }), s;
25
+ } finally {
26
+ p.resolveQueues(t), (a = e == null ? void 0 : e.onComplete) == null || a.call(e);
27
+ }
28
+ }
29
+ const S = w();
30
+ return {
31
+ queue: I(() => S.loadingQueue),
32
+ checkIsLoading: (u) => S.loadingQueue.some((e) => e.id === u),
33
+ global: async (u, e) => await d(u, {
34
+ isGlobal: !0,
35
+ onSuccess: async (t) => {
36
+ var p;
37
+ await ((p = e == null ? void 0 : e.onSuccess) == null ? void 0 : p.call(e, t)), e != null && e.successMessage && r.open({
38
+ type: "success",
39
+ message: e.successMessage,
40
+ position: y.BOTTOM
41
+ });
42
+ }
43
+ }),
44
+ minor: async (u, e) => {
45
+ const t = r.open({
46
+ type: "info",
47
+ message: "Loading",
48
+ spinner: !0,
49
+ persistent: !0
50
+ }), p = (l, a) => {
51
+ if (!a) return;
52
+ const s = (m) => {
53
+ r.updateSnackbar(t, { [l]: m });
54
+ };
55
+ L(a) ? (s(a.value), M(a, (m) => s(m))) : s(a);
56
+ };
57
+ return p("title", e == null ? void 0 : e.message), p("message", e == null ? void 0 : e.caption), await d(
58
+ async () => (e != null && e.isLoading && (e.isLoading.value = !0), await u()),
59
+ {
60
+ onSuccess: () => {
61
+ const l = (e == null ? void 0 : e.successMessage) || "Completed";
62
+ r.close(t), r.open({
63
+ type: "success",
64
+ title: l,
65
+ position: y.BOTTOM
66
+ });
67
+ },
68
+ onError: (l) => {
69
+ const a = `${l}` || "Error";
70
+ r.close(t), r.open({
71
+ type: "error",
72
+ title: a,
73
+ position: y.BOTTOM
74
+ });
75
+ },
76
+ onComplete: () => {
77
+ e != null && e.isLoading && (e.isLoading.value = !1);
78
+ },
79
+ customId: e == null ? void 0 : e.customId
80
+ }
81
+ );
82
+ },
83
+ custom: async (u, e) => await d(
84
+ async () => (e != null && e.isLoading && (e.isLoading.value = !0), await u()),
85
+ {
86
+ onSuccess: async () => {
87
+ e != null && e.successMessage && r.open({ message: e.successMessage });
88
+ },
89
+ onComplete: () => {
90
+ e && e.isLoading && (e.isLoading.value = !1);
91
+ },
92
+ customId: e == null ? void 0 : e.customId
93
+ }
94
+ )
95
+ };
96
+ };
97
+ export {
98
+ E as u
99
+ };
@@ -0,0 +1,107 @@
1
+ import { defineComponent as m, createElementBlock as n, openBlock as a, createElementVNode as i, renderSlot as r, createCommentVNode as l, toDisplayString as c, normalizeClass as d, createVNode as p, withCtx as f, computed as y } from "vue";
2
+ import { useI18n as h, useCoreStore as _ } from "@feedmepos/mf-common";
3
+ import { useDialog as b } from "@feedmepos/ui-library";
4
+ const x = { class: "space-y-8" }, k = { class: "flex items-center justify-between" }, $ = { class: "space-y-8" }, v = { class: "fm-typo-en-body-lg-600" }, C = {
5
+ key: 0,
6
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
7
+ }, I = /* @__PURE__ */ m({
8
+ __name: "FormItem",
9
+ props: {
10
+ label: {},
11
+ description: {}
12
+ },
13
+ setup(e) {
14
+ return (t, s) => (a(), n("div", x, [
15
+ i("div", k, [
16
+ i("div", $, [
17
+ i("p", v, c(e.label), 1),
18
+ e.description ? (a(), n("p", C, c(e.description), 1)) : l("", !0)
19
+ ]),
20
+ r(t.$slots, "append")
21
+ ]),
22
+ r(t.$slots, "default")
23
+ ]));
24
+ }
25
+ }), g = /* @__PURE__ */ m({
26
+ __name: "FormColumn",
27
+ props: {
28
+ shrinkable: { type: Boolean }
29
+ },
30
+ setup(e) {
31
+ return (t, s) => (a(), n("div", {
32
+ class: d(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
33
+ }, [
34
+ r(t.$slots, "default")
35
+ ], 2));
36
+ }
37
+ }), S = {
38
+ key: 0,
39
+ class: "flex flex-row justify-between items-center"
40
+ }, w = { class: "space-y-4" }, B = { class: "fm-typo-en-title-sm-600" }, D = {
41
+ key: 0,
42
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
43
+ }, M = /* @__PURE__ */ m({
44
+ __name: "FormSection",
45
+ props: {
46
+ title: {},
47
+ subTitle: {},
48
+ shrinkable: { type: Boolean }
49
+ },
50
+ setup(e) {
51
+ return (t, s) => (a(), n("div", {
52
+ class: d(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
53
+ }, [
54
+ e.title ? (a(), n("div", S, [
55
+ i("div", w, [
56
+ i("p", B, c(e.title), 1),
57
+ e.subTitle ? (a(), n("p", D, c(e.subTitle), 1)) : l("", !0)
58
+ ]),
59
+ r(t.$slots, "append-title")
60
+ ])) : l("", !0),
61
+ p(g, { shrinkable: e.shrinkable }, {
62
+ default: f(() => [
63
+ r(t.$slots, "default")
64
+ ]),
65
+ _: 3
66
+ }, 8, ["shrinkable"])
67
+ ], 2));
68
+ }
69
+ });
70
+ function N(e, t) {
71
+ const s = b(), { t: o } = h();
72
+ function u() {
73
+ e() ? s.open({
74
+ title: o("portalCommon.dismiss.title"),
75
+ message: o("portalCommon.dismiss.message"),
76
+ zIndex: 200,
77
+ primaryActions: {
78
+ text: o("portalCommon.dismiss.primaryActions"),
79
+ variant: "primary",
80
+ close: !0
81
+ },
82
+ secondaryActions: {
83
+ text: o("common.cancel"),
84
+ variant: "tertiary",
85
+ close: !0
86
+ }
87
+ }).onPrimary(() => {
88
+ t();
89
+ }) : t();
90
+ }
91
+ return u;
92
+ }
93
+ function T() {
94
+ const e = _();
95
+ return y(() => {
96
+ const s = {};
97
+ return e.restaurants.value.forEach((o) => {
98
+ s[o._id] = o;
99
+ }), s;
100
+ });
101
+ }
102
+ export {
103
+ M as _,
104
+ I as a,
105
+ T as b,
106
+ N as u
107
+ };
@@ -0,0 +1,15 @@
1
+ import { ref as c, computed as s } from "vue";
2
+ const i = (u) => {
3
+ const r = c(u || "");
4
+ function t(e) {
5
+ return `${e}`.trim().toLowerCase();
6
+ }
7
+ const o = s(() => t(r.value));
8
+ function n(e) {
9
+ return o.value ? e.some((a) => t(a).includes(o.value)) : !0;
10
+ }
11
+ return { searchKey: r, filter: n };
12
+ };
13
+ export {
14
+ i as u
15
+ };