@feedmepos/mf-hrm-portal 1.1.2-dev → 1.1.6-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 (89) hide show
  1. package/dist/{EmployeeList-CKHgrdAO.js → EmployeeList-CP42mLpi.js} +16 -18
  2. package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js → PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js} +2 -2
  3. package/dist/{RoleList-Bef-7IhW.js → RoleList-CsctaXlu.js} +53 -57
  4. package/dist/TeamMemberList-DtXoUa5K.js +1508 -0
  5. package/dist/{TimesheetList-DVIk0Tis.js → TimesheetList-qaolOL4w.js} +41 -42
  6. package/dist/api/team/index.d.ts +1 -5
  7. package/dist/app-G_Dbs0OJ.js +1202 -0
  8. package/dist/app.js +4 -4
  9. package/dist/components/AppForm.vue.d.ts +2 -3
  10. package/dist/components/CheckboxInput.vue.d.ts +4 -10
  11. package/dist/components/CollapsibleWrapper.vue.d.ts +2 -3
  12. package/dist/components/form/SelectFilter.vue.d.ts +2 -3
  13. package/dist/components/layout/FormColumn.vue.d.ts +3 -6
  14. package/dist/components/layout/FormItem.vue.d.ts +1 -2
  15. package/dist/components/layout/FormSection.vue.d.ts +1 -2
  16. package/dist/components/layout/FullWrapper.vue.d.ts +3 -6
  17. package/dist/components/layout/PageLayout.vue.d.ts +1 -2
  18. package/dist/components/menu/BottomSheetMenu.vue.d.ts +1 -2
  19. package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +3 -6
  20. package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +3 -6
  21. package/dist/composables/useAppStore.d.ts +6 -6
  22. package/dist/composables/useDateRange.d.ts +1 -1
  23. package/dist/composables/useRestaurantMap.d.ts +8 -4
  24. package/dist/composables/useSheet.d.ts +1 -1
  25. package/dist/employee-BTWpYxn5.js +449 -0
  26. package/dist/{index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js → empty-placeholder-ey8LJtN1.js} +2 -43
  27. package/dist/helpers/rule.d.ts +3 -4
  28. package/dist/index-8ift6lz3.js +57 -0
  29. package/dist/{lodash-DpoPPi_j.js → lodash-B5BTJU4_.js} +343 -326
  30. package/dist/{Main-YQ5f-v03.js → main-C370wsCl.js} +1531 -1501
  31. package/dist/router/shared.d.ts +1 -4
  32. package/dist/rule-CM7JgjNr.js +142112 -0
  33. package/dist/stores/employee.d.ts +4 -4
  34. package/dist/stores/role.d.ts +4 -4
  35. package/dist/stores/timesheet.d.ts +19 -19
  36. package/dist/{timesheet-BRQvljNj.js → timesheet-Cy-jSzje.js} +14 -14
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/types/permission.d.ts +4 -1
  39. package/dist/types/team.d.ts +3 -13
  40. package/dist/useAppStore-zINIo0LR.js +93 -0
  41. package/dist/useLoading-CWBRIBiy.js +141 -0
  42. package/dist/{useRestaurantMap-D5BNPLKh.js → useRestaurantMap-CpS9-OSq.js} +7 -7
  43. package/dist/{SelectFilter-NbXrJ4iH.js → useSearch-C25VELOk.js} +101 -90
  44. package/dist/views/hr/employee/{EmployeeForm.vue.d.ts → components/EmployeeForm.vue.d.ts} +7 -10
  45. package/dist/views/team/{member → components}/AddMemberForm.vue.d.ts +0 -1
  46. package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +28 -68
  47. package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +36 -0
  48. package/dist/views/team/components/{ConditionPermission.vue.d.ts → TeamMemberConditionPermission.vue.d.ts} +1 -14
  49. package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +718 -0
  50. package/dist/views/team/components/{PosRolePermission.vue.d.ts → TeamMemberRolePermission.vue.d.ts} +1 -14
  51. package/dist/views/team/locales/index.d.ts +4 -176
  52. package/package.json +8 -13
  53. package/dist/AuditLogList-CjrocQS2.js +0 -316
  54. package/dist/Main-HzplGv-e.js +0 -85
  55. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-xQ4fjIxa.js +0 -3050
  56. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +0 -38
  57. package/dist/RolePermissionList-BzwpQFeO.js +0 -285
  58. package/dist/TeamMemberList-D2Xey_w9.js +0 -949
  59. package/dist/api/audit-log/index.d.ts +0 -10
  60. package/dist/api/permission-assignment/index.d.ts +0 -10
  61. package/dist/api/permission-set/index.d.ts +0 -8
  62. package/dist/app-DUs516v0.js +0 -2592
  63. package/dist/dayjs.min-DVb8OkTL.js +0 -282
  64. package/dist/employee-jH7EJnhi.js +0 -172
  65. package/dist/helpers/permission-set.d.ts +0 -32
  66. package/dist/helpers/portal-user.d.ts +0 -8
  67. package/dist/index-CicR1-Jp.js +0 -8411
  68. package/dist/stores/permission-assignment.d.ts +0 -277
  69. package/dist/stores/permission-set.d.ts +0 -250
  70. package/dist/stores/team.d.ts +0 -288
  71. package/dist/team-CiZSNUQW.js +0 -26
  72. package/dist/types/audit-log.d.ts +0 -19
  73. package/dist/types/permission-assignment.d.ts +0 -20
  74. package/dist/types/permission-set.d.ts +0 -20
  75. package/dist/useAppStore-RzLLN5d9.js +0 -180
  76. package/dist/useLoading-1OqFn86y.js +0 -99
  77. package/dist/useSearch-B6WK1LBB.js +0 -15
  78. package/dist/views/audit-log/locales/index.d.ts +0 -211
  79. package/dist/views/team/Main.vue.d.ts +0 -2
  80. package/dist/views/team/components/BasePermission.vue.d.ts +0 -64
  81. package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +0 -14
  82. package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +0 -14
  83. package/dist/views/team/member/TeamMemberList.vue.d.ts +0 -4
  84. package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +0 -55
  85. package/dist/views/team/role/RolePermissionForm.vue.d.ts +0 -19
  86. package/dist/views/team/role/RolePermissionList.vue.d.ts +0 -5
  87. /package/dist/views/{audit-log/AuditLogList.vue.d.ts → hr/main.vue.d.ts} +0 -0
  88. /package/dist/views/{hr/Main.vue.d.ts → team/TeamMemberList.vue.d.ts} +0 -0
  89. /package/dist/views/team/{member → components}/MemberInfo.vue.d.ts +0 -0
@@ -1,288 +0,0 @@
1
- import type { FTeamMember } from '@/types/team';
2
- declare const useTeamStore: import("pinia").StoreDefinition<"team", Pick<{
3
- members: import("vue").Ref<{
4
- id: string;
5
- name: string;
6
- phoneNumber: string;
7
- email: string;
8
- restaurants: string[];
9
- managableRestaurantIds: string[];
10
- permissions: {
11
- reason?: string | null | undefined | undefined;
12
- conditions?: any;
13
- fields?: string[] | null | undefined | undefined;
14
- inverted?: boolean | null | undefined | undefined;
15
- label: string;
16
- subject: string;
17
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
18
- }[];
19
- permissionLabels: string[];
20
- doc: {
21
- id: string;
22
- posUserId: string;
23
- isOwner: boolean;
24
- name: string;
25
- phoneNumber: string;
26
- email: string;
27
- posUser?: {
28
- code: string;
29
- name: string;
30
- passcode: string;
31
- roles: {
32
- restaurantId: string;
33
- roleId: string;
34
- }[];
35
- } | undefined;
36
- businessId: string;
37
- userId: string;
38
- permissions: {
39
- subject: string | string[];
40
- actions: string | string[];
41
- fields?: string[] | undefined;
42
- conditions?: Object | undefined;
43
- inverted?: boolean | undefined;
44
- reason?: string | undefined;
45
- }[];
46
- permissionSetIds: string[];
47
- };
48
- }[], FTeamMember[] | {
49
- id: string;
50
- name: string;
51
- phoneNumber: string;
52
- email: string;
53
- restaurants: string[];
54
- managableRestaurantIds: string[];
55
- permissions: {
56
- reason?: string | null | undefined | undefined;
57
- conditions?: any;
58
- fields?: string[] | null | undefined | undefined;
59
- inverted?: boolean | null | undefined | undefined;
60
- label: string;
61
- subject: string;
62
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
63
- }[];
64
- permissionLabels: string[];
65
- doc: {
66
- id: string;
67
- posUserId: string;
68
- isOwner: boolean;
69
- name: string;
70
- phoneNumber: string;
71
- email: string;
72
- posUser?: {
73
- code: string;
74
- name: string;
75
- passcode: string;
76
- roles: {
77
- restaurantId: string;
78
- roleId: string;
79
- }[];
80
- } | undefined;
81
- businessId: string;
82
- userId: string;
83
- permissions: {
84
- subject: string | string[];
85
- actions: string | string[];
86
- fields?: string[] | undefined;
87
- conditions?: Object | undefined;
88
- inverted?: boolean | undefined;
89
- reason?: string | undefined;
90
- }[];
91
- permissionSetIds: string[];
92
- };
93
- }[]>;
94
- isLoading: import("vue").Ref<boolean, boolean>;
95
- userIdToName: import("vue").ComputedRef<Record<string, string>>;
96
- readTeamMembers: () => Promise<void>;
97
- }, "isLoading" | "members">, Pick<{
98
- members: import("vue").Ref<{
99
- id: string;
100
- name: string;
101
- phoneNumber: string;
102
- email: string;
103
- restaurants: string[];
104
- managableRestaurantIds: string[];
105
- permissions: {
106
- reason?: string | null | undefined | undefined;
107
- conditions?: any;
108
- fields?: string[] | null | undefined | undefined;
109
- inverted?: boolean | null | undefined | undefined;
110
- label: string;
111
- subject: string;
112
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
113
- }[];
114
- permissionLabels: string[];
115
- doc: {
116
- id: string;
117
- posUserId: string;
118
- isOwner: boolean;
119
- name: string;
120
- phoneNumber: string;
121
- email: string;
122
- posUser?: {
123
- code: string;
124
- name: string;
125
- passcode: string;
126
- roles: {
127
- restaurantId: string;
128
- roleId: string;
129
- }[];
130
- } | undefined;
131
- businessId: string;
132
- userId: string;
133
- permissions: {
134
- subject: string | string[];
135
- actions: string | string[];
136
- fields?: string[] | undefined;
137
- conditions?: Object | undefined;
138
- inverted?: boolean | undefined;
139
- reason?: string | undefined;
140
- }[];
141
- permissionSetIds: string[];
142
- };
143
- }[], FTeamMember[] | {
144
- id: string;
145
- name: string;
146
- phoneNumber: string;
147
- email: string;
148
- restaurants: string[];
149
- managableRestaurantIds: string[];
150
- permissions: {
151
- reason?: string | null | undefined | undefined;
152
- conditions?: any;
153
- fields?: string[] | null | undefined | undefined;
154
- inverted?: boolean | null | undefined | undefined;
155
- label: string;
156
- subject: string;
157
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
158
- }[];
159
- permissionLabels: string[];
160
- doc: {
161
- id: string;
162
- posUserId: string;
163
- isOwner: boolean;
164
- name: string;
165
- phoneNumber: string;
166
- email: string;
167
- posUser?: {
168
- code: string;
169
- name: string;
170
- passcode: string;
171
- roles: {
172
- restaurantId: string;
173
- roleId: string;
174
- }[];
175
- } | undefined;
176
- businessId: string;
177
- userId: string;
178
- permissions: {
179
- subject: string | string[];
180
- actions: string | string[];
181
- fields?: string[] | undefined;
182
- conditions?: Object | undefined;
183
- inverted?: boolean | undefined;
184
- reason?: string | undefined;
185
- }[];
186
- permissionSetIds: string[];
187
- };
188
- }[]>;
189
- isLoading: import("vue").Ref<boolean, boolean>;
190
- userIdToName: import("vue").ComputedRef<Record<string, string>>;
191
- readTeamMembers: () => Promise<void>;
192
- }, "userIdToName">, Pick<{
193
- members: import("vue").Ref<{
194
- id: string;
195
- name: string;
196
- phoneNumber: string;
197
- email: string;
198
- restaurants: string[];
199
- managableRestaurantIds: string[];
200
- permissions: {
201
- reason?: string | null | undefined | undefined;
202
- conditions?: any;
203
- fields?: string[] | null | undefined | undefined;
204
- inverted?: boolean | null | undefined | undefined;
205
- label: string;
206
- subject: string;
207
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
208
- }[];
209
- permissionLabels: string[];
210
- doc: {
211
- id: string;
212
- posUserId: string;
213
- isOwner: boolean;
214
- name: string;
215
- phoneNumber: string;
216
- email: string;
217
- posUser?: {
218
- code: string;
219
- name: string;
220
- passcode: string;
221
- roles: {
222
- restaurantId: string;
223
- roleId: string;
224
- }[];
225
- } | undefined;
226
- businessId: string;
227
- userId: string;
228
- permissions: {
229
- subject: string | string[];
230
- actions: string | string[];
231
- fields?: string[] | undefined;
232
- conditions?: Object | undefined;
233
- inverted?: boolean | undefined;
234
- reason?: string | undefined;
235
- }[];
236
- permissionSetIds: string[];
237
- };
238
- }[], FTeamMember[] | {
239
- id: string;
240
- name: string;
241
- phoneNumber: string;
242
- email: string;
243
- restaurants: string[];
244
- managableRestaurantIds: string[];
245
- permissions: {
246
- reason?: string | null | undefined | undefined;
247
- conditions?: any;
248
- fields?: string[] | null | undefined | undefined;
249
- inverted?: boolean | null | undefined | undefined;
250
- label: string;
251
- subject: string;
252
- actions: ("update" | "create" | "read" | "delete" | "manage")[];
253
- }[];
254
- permissionLabels: string[];
255
- doc: {
256
- id: string;
257
- posUserId: string;
258
- isOwner: boolean;
259
- name: string;
260
- phoneNumber: string;
261
- email: string;
262
- posUser?: {
263
- code: string;
264
- name: string;
265
- passcode: string;
266
- roles: {
267
- restaurantId: string;
268
- roleId: string;
269
- }[];
270
- } | undefined;
271
- businessId: string;
272
- userId: string;
273
- permissions: {
274
- subject: string | string[];
275
- actions: string | string[];
276
- fields?: string[] | undefined;
277
- conditions?: Object | undefined;
278
- inverted?: boolean | undefined;
279
- reason?: string | undefined;
280
- }[];
281
- permissionSetIds: string[];
282
- };
283
- }[]>;
284
- isLoading: import("vue").Ref<boolean, boolean>;
285
- userIdToName: import("vue").ComputedRef<Record<string, string>>;
286
- readTeamMembers: () => Promise<void>;
287
- }, "readTeamMembers">>;
288
- export { useTeamStore };
@@ -1,26 +0,0 @@
1
- import { defineStore as c } from "pinia";
2
- import { ref as t, computed as i } from "vue";
3
- import { t as u } from "./index-CicR1-Jp.js";
4
- const p = c("team", () => {
5
- const r = t([]), a = t(!1), m = i(
6
- () => Object.fromEntries(r.value.map((e) => [e.doc.userId, e.name]))
7
- );
8
- async function s() {
9
- try {
10
- a.value = !0;
11
- const e = await u.readTeamMembers();
12
- r.value = e.sort((o, n) => o.doc.isOwner ? -1 : o.name.localeCompare(n.name));
13
- } finally {
14
- a.value = !1;
15
- }
16
- }
17
- return {
18
- members: r,
19
- isLoading: a,
20
- userIdToName: m,
21
- readTeamMembers: s
22
- };
23
- });
24
- export {
25
- p as u
26
- };
@@ -1,19 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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,180 +0,0 @@
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
- };
@@ -1,99 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
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
- };