@feedmepos/mf-hrm-portal 1.1.0-dev → 1.1.1-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.
- package/dist/AuditLogList-D62QRWN-.js +232 -0
- package/dist/{EmployeeList-tmUqs5a6.js → EmployeeList-CMUbRS7j.js} +156 -150
- package/dist/Main-BbZ-t-pu.js +85 -0
- package/dist/{main-DOtgCRZe.js → Main-un3v_g6p.js} +1500 -1532
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js → PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js} +2 -2
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js +3119 -0
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/{RoleList-C5xG7LHg.js → RoleList-mlTepnhN.js} +52 -50
- package/dist/RolePermissionList-tR-Kmlu7.js +285 -0
- package/dist/TeamMemberList-BkRQl6x8.js +948 -0
- package/dist/{TimesheetList-CZfo4Dua.js → TimesheetList-i5yaAzhB.js} +21 -21
- package/dist/api/audit-log/index.d.ts +10 -0
- package/dist/api/index.d.ts +1 -3
- package/dist/api/permission-assignment/index.d.ts +10 -0
- package/dist/api/permission-set/index.d.ts +8 -0
- package/dist/api/team/index.d.ts +2 -1
- package/dist/app-4LaGLcWC.js +2305 -0
- package/dist/app.js +1 -1
- package/dist/components/AppForm.vue.d.ts +3 -2
- package/dist/components/CheckboxInput.vue.d.ts +10 -4
- package/dist/components/CollapsibleWrapper.vue.d.ts +3 -2
- package/dist/components/form/SelectFilter.vue.d.ts +3 -2
- package/dist/components/layout/FormColumn.vue.d.ts +6 -3
- package/dist/components/layout/FormItem.vue.d.ts +2 -1
- package/dist/components/layout/FormSection.vue.d.ts +2 -1
- package/dist/components/layout/FullWrapper.vue.d.ts +6 -3
- package/dist/components/layout/PageLayout.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenu.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +6 -3
- package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +6 -3
- package/dist/composables/useAppStore.d.ts +6 -6
- package/dist/composables/useDateRange.d.ts +1 -1
- package/dist/composables/useRestaurantMap.d.ts +4 -8
- package/dist/composables/useSheet.d.ts +1 -1
- package/dist/{employee-BQc7Wgpu.js → employee-BZTntAR0.js} +9 -9
- package/dist/helpers/permission-set.d.ts +32 -0
- package/dist/helpers/portal-user.d.ts +8 -0
- package/dist/helpers/rule.d.ts +4 -3
- package/dist/index-BsEM84j5.js +8440 -0
- package/dist/{empty-placeholder-ey8LJtN1.js → index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js} +43 -2
- package/dist/{lodash-DNzKT_gG.js → lodash-DYaYvsmp.js} +326 -343
- package/dist/router/shared.d.ts +3 -1
- package/dist/stores/employee.d.ts +4 -4
- package/dist/stores/permission-assignment.d.ts +277 -0
- package/dist/stores/permission-set.d.ts +250 -0
- package/dist/stores/role.d.ts +4 -4
- package/dist/stores/team.d.ts +288 -0
- package/dist/stores/timesheet.d.ts +19 -19
- package/dist/team-eo_yQh1g.js +26 -0
- package/dist/{timesheet-B4M1nCIm.js → timesheet-CfPIK52Q.js} +14 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/audit-log.d.ts +18 -0
- package/dist/types/permission-assignment.d.ts +20 -0
- package/dist/types/permission-set.d.ts +20 -0
- package/dist/types/permission.d.ts +4 -3
- package/dist/types/team.d.ts +13 -3
- package/dist/useAppStore-D0F-tWJO.js +180 -0
- package/dist/useLoading-DpbOtToC.js +99 -0
- package/dist/useRestaurantMap-D5BNPLKh.js +107 -0
- package/dist/{useSearch-C25VELOk.js → useSearch-C6gRA62e.js} +8 -8
- package/dist/views/hr/employee/{components/EmployeeForm.vue.d.ts → EmployeeForm.vue.d.ts} +10 -7
- package/dist/views/hr/locales/index.d.ts +0 -214
- package/dist/views/team/components/BasePermission.vue.d.ts +76 -0
- package/dist/views/team/components/{TeamMemberConditionPermission.vue.d.ts → ConditionPermission.vue.d.ts} +14 -1
- package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +68 -28
- package/dist/views/team/components/{TeamMemberRolePermission.vue.d.ts → PosRolePermission.vue.d.ts} +14 -1
- package/dist/views/team/locales/index.d.ts +176 -4
- package/dist/views/team/{components → member}/AddMemberForm.vue.d.ts +1 -0
- package/dist/views/team/member/TeamMemberList.vue.d.ts +4 -0
- package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +55 -0
- package/dist/views/team/role/RolePermissionForm.vue.d.ts +19 -0
- package/dist/views/{hr/grant-user/GrantUserList.vue.d.ts → team/role/RolePermissionList.vue.d.ts} +0 -12
- package/package.json +14 -9
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BY9VGOoM.js +0 -71
- package/dist/HorizontalSplitter-B9DVYJIM.js +0 -12
- package/dist/Main-ebQsujY3.js +0 -600
- package/dist/TeamMemberList-09_3YTHe.js +0 -1509
- package/dist/api/grant-user/index.d.ts +0 -8
- package/dist/app-B4KDGOw1.js +0 -1432
- package/dist/index-CSG8t9Dl.js +0 -58
- package/dist/role-DGAu9X1X.js +0 -9728
- package/dist/rule-CSj0p2P3.js +0 -450
- package/dist/stores/grant-user.d.ts +0 -86
- package/dist/types/grant-user.d.ts +0 -17
- package/dist/useAppStore-CKmMR-gI.js +0 -93
- package/dist/useLoading-v4m-6mEy.js +0 -141
- package/dist/useRestaurantMap-e9fQJiLC.js +0 -39
- package/dist/views/hr/grant-user/components/GrantUserForm.vue.d.ts +0 -14
- package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +0 -36
- package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +0 -718
- /package/dist/views/hr/{grant-user/Main.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/hr/{main.vue.d.ts → audit-log/AuditLogList.vue.d.ts} +0 -0
- /package/dist/views/team/{TeamMemberList.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/team/{components → member}/MemberInfo.vue.d.ts +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AuditLogMetadata {
|
|
2
|
+
reason: string;
|
|
3
|
+
resolvedFrom: 'admin' | 'staff' | 'permissionSet' | 'custom' | 'unknown';
|
|
4
|
+
permissionSetId?: string;
|
|
5
|
+
requestPath?: string;
|
|
6
|
+
requestMethod?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AuditLogEntry {
|
|
9
|
+
timestamp: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
subject: string;
|
|
12
|
+
action: string;
|
|
13
|
+
field?: string | null;
|
|
14
|
+
businessId?: string | null;
|
|
15
|
+
restaurantId?: string | null;
|
|
16
|
+
outcome: 'allowed' | 'denied';
|
|
17
|
+
metadata: AuditLogMetadata;
|
|
18
|
+
}
|
|
@@ -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,5 @@
|
|
|
1
|
-
export { Permission,
|
|
1
|
+
export { Permission, FullPortalPermissions, FullPosPermissions, LegacyPermissionMapping, type AbilityConstructOption, type PermissionLevelDetail, type IFdtoPortalPermission, type IPermissionUser, } from '@feedmepos/hrm-permission';
|
|
2
2
|
export declare const inventorySubjects: string[];
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const hrmSubjects: string[];
|
|
4
|
+
export declare const crmSubjects: string[];
|
|
5
|
+
export declare const generalSubjects: string[];
|
package/dist/types/team.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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:
|
|
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-BsEM84j5.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-D0F-tWJO.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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as F, computed as c, defineComponent as G, watch as J, nextTick as Q, resolveComponent as w,
|
|
1
|
+
import { ref as F, computed as c, defineComponent as G, watch as J, nextTick as Q, resolveComponent as w, createElementBlock as h, openBlock as i, createElementVNode as A, createVNode as S, renderSlot as V, withCtx as L, createCommentVNode as C, normalizeStyle as W, Fragment as B, createBlock as P, unref as x, renderList as K, normalizeClass as X, toDisplayString as Y, withModifiers as Z } from "vue";
|
|
2
2
|
import "@feedmepos/ui-library";
|
|
3
3
|
/* empty css */
|
|
4
4
|
function ee(u, t, v = u) {
|
|
@@ -128,7 +128,7 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
128
128
|
"selector-for-dismiss-away-event-exclusion": ".fm-dialog, .fm-select__menu__wrapper"
|
|
129
129
|
}, {
|
|
130
130
|
"menu-button": L(() => [
|
|
131
|
-
|
|
131
|
+
V(a.$slots, "menu-button", {}, () => [
|
|
132
132
|
A("div", te, [
|
|
133
133
|
S(U, { disabled: u.disabled }, {
|
|
134
134
|
default: L(() => [
|
|
@@ -184,7 +184,7 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
184
184
|
class: "flex-1 overflow-y-auto min-h-0",
|
|
185
185
|
style: W({ maxHeight: typeof u.maxHeight == "number" ? u.maxHeight + "px" : u.maxHeight })
|
|
186
186
|
}, [
|
|
187
|
-
u.multiple ? (i(), h(
|
|
187
|
+
u.multiple ? (i(), h(B, { key: 0 }, [
|
|
188
188
|
u.showSelectAll ? (i(), P(z, {
|
|
189
189
|
key: 0,
|
|
190
190
|
label: "All",
|
|
@@ -193,9 +193,9 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
193
193
|
indeterminate: x(D),
|
|
194
194
|
onClick: x(E)
|
|
195
195
|
}, null, 8, ["model-value", "indeterminate", "onClick"])) : C("", !0),
|
|
196
|
-
r.value.length ? (i(!0), h(
|
|
196
|
+
r.value.length ? (i(!0), h(B, { key: 1 }, K(r.value, (s) => {
|
|
197
197
|
var I;
|
|
198
|
-
return
|
|
198
|
+
return V(a.$slots, "option", {
|
|
199
199
|
option: s,
|
|
200
200
|
selected: x($) || Array.isArray(e.value) && ((I = e.value) == null ? void 0 : I.includes(s.value)),
|
|
201
201
|
toggle: () => x(H)(s.value)
|
|
@@ -212,8 +212,8 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
212
212
|
];
|
|
213
213
|
}, !0);
|
|
214
214
|
}), 256)) : C("", !0)
|
|
215
|
-
], 64)) : (i(), h(
|
|
216
|
-
r.value.length ? (i(!0), h(
|
|
215
|
+
], 64)) : (i(), h(B, { key: 1 }, [
|
|
216
|
+
r.value.length ? (i(!0), h(B, { key: 0 }, K(r.value, (s) => V(a.$slots, "option", {
|
|
217
217
|
option: s,
|
|
218
218
|
selected: e.value === s.value,
|
|
219
219
|
toggle: () => O(s.value)
|
|
@@ -230,7 +230,7 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
230
230
|
]),
|
|
231
231
|
_: 3
|
|
232
232
|
}, 8, ["disabled"]),
|
|
233
|
-
|
|
233
|
+
V(a.$slots, "append-right", {}, void 0, !0)
|
|
234
234
|
])
|
|
235
235
|
]);
|
|
236
236
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { EmployeeData } from '@/types/employee';
|
|
2
|
-
declare
|
|
2
|
+
declare var __VLS_1: {
|
|
3
|
+
trigger: (data?: EmployeeData) => void;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
9
|
roleErrorMessage: {
|
|
4
10
|
type: StringConstructor;
|
|
5
11
|
default: string;
|
|
6
12
|
};
|
|
7
13
|
}>, {
|
|
8
14
|
show: import("vue").Ref<boolean, boolean>;
|
|
9
|
-
trigger: (data?: EmployeeData
|
|
15
|
+
trigger: (data?: EmployeeData) => void;
|
|
10
16
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
17
|
roleErrorMessage: {
|
|
12
18
|
type: StringConstructor;
|
|
@@ -14,11 +20,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("vu
|
|
|
14
20
|
};
|
|
15
21
|
}>> & Readonly<{}>, {
|
|
16
22
|
roleErrorMessage: string;
|
|
17
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any
|
|
18
|
-
|
|
19
|
-
trigger: (data?: EmployeeData | undefined) => void;
|
|
20
|
-
}) => any) | undefined;
|
|
21
|
-
}>;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
25
|
export default _default;
|
|
23
26
|
type __VLS_WithSlots<T, S> = T & {
|
|
24
27
|
new (): {
|