@feedmepos/mf-hrm-portal 1.1.2-dev → 1.1.4-dev.1
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/{EmployeeList-CKHgrdAO.js → EmployeeList-D3a7ngdE.js} +16 -18
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js → PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js} +2 -2
- package/dist/{RoleList-Bef-7IhW.js → RoleList-CsxyMZW0.js} +53 -57
- package/dist/TeamMemberList-ZkrdrTlL.js +1508 -0
- package/dist/{TimesheetList-DVIk0Tis.js → TimesheetList-BwiUzcJ-.js} +41 -42
- package/dist/api/team/index.d.ts +1 -5
- package/dist/app-CrML_LtM.js +1202 -0
- package/dist/app.js +4 -4
- package/dist/components/AppForm.vue.d.ts +2 -3
- package/dist/components/CheckboxInput.vue.d.ts +4 -10
- package/dist/components/CollapsibleWrapper.vue.d.ts +2 -3
- package/dist/components/form/SelectFilter.vue.d.ts +2 -3
- package/dist/components/layout/FormColumn.vue.d.ts +3 -6
- package/dist/components/layout/FormItem.vue.d.ts +1 -2
- package/dist/components/layout/FormSection.vue.d.ts +1 -2
- package/dist/components/layout/FullWrapper.vue.d.ts +3 -6
- package/dist/components/layout/PageLayout.vue.d.ts +1 -2
- package/dist/components/menu/BottomSheetMenu.vue.d.ts +1 -2
- package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +3 -6
- package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +3 -6
- package/dist/composables/useAppStore.d.ts +6 -6
- package/dist/composables/useDateRange.d.ts +1 -1
- package/dist/composables/useRestaurantMap.d.ts +8 -4
- package/dist/composables/useSheet.d.ts +1 -1
- package/dist/employee-DSGaYrd4.js +449 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js → empty-placeholder-ey8LJtN1.js} +2 -43
- package/dist/helpers/rule.d.ts +3 -4
- package/dist/index-CIaav54n.js +57 -0
- package/dist/{lodash-DpoPPi_j.js → lodash-dGfuW9fw.js} +343 -326
- package/dist/{Main-YQ5f-v03.js → main-CUI7RdvY.js} +1531 -1501
- package/dist/router/shared.d.ts +1 -4
- package/dist/{index-CicR1-Jp.js → rule-BLgeh_ly.js} +2672 -2721
- package/dist/stores/employee.d.ts +4 -4
- package/dist/stores/role.d.ts +4 -4
- package/dist/stores/timesheet.d.ts +19 -19
- package/dist/{timesheet-BRQvljNj.js → timesheet-BFrZzS2q.js} +14 -14
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/permission.d.ts +4 -1
- package/dist/types/team.d.ts +3 -13
- package/dist/useAppStore-DViQe2C8.js +93 -0
- package/dist/useLoading-DAoKseT-.js +141 -0
- package/dist/{useRestaurantMap-D5BNPLKh.js → useRestaurantMap-CpS9-OSq.js} +7 -7
- package/dist/{SelectFilter-NbXrJ4iH.js → useSearch-C25VELOk.js} +101 -90
- package/dist/views/hr/employee/{EmployeeForm.vue.d.ts → components/EmployeeForm.vue.d.ts} +7 -10
- package/dist/views/team/{member → components}/AddMemberForm.vue.d.ts +0 -1
- package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +28 -68
- package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +36 -0
- package/dist/views/team/components/{ConditionPermission.vue.d.ts → TeamMemberConditionPermission.vue.d.ts} +1 -14
- package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +718 -0
- package/dist/views/team/components/{PosRolePermission.vue.d.ts → TeamMemberRolePermission.vue.d.ts} +1 -14
- package/dist/views/team/locales/index.d.ts +4 -176
- package/package.json +8 -13
- package/dist/AuditLogList-CjrocQS2.js +0 -316
- package/dist/Main-HzplGv-e.js +0 -85
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-xQ4fjIxa.js +0 -3050
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +0 -38
- package/dist/RolePermissionList-BzwpQFeO.js +0 -285
- package/dist/TeamMemberList-D2Xey_w9.js +0 -949
- package/dist/api/audit-log/index.d.ts +0 -10
- package/dist/api/permission-assignment/index.d.ts +0 -10
- package/dist/api/permission-set/index.d.ts +0 -8
- package/dist/app-DUs516v0.js +0 -2592
- package/dist/dayjs.min-DVb8OkTL.js +0 -282
- package/dist/employee-jH7EJnhi.js +0 -172
- package/dist/helpers/permission-set.d.ts +0 -32
- package/dist/helpers/portal-user.d.ts +0 -8
- package/dist/stores/permission-assignment.d.ts +0 -277
- package/dist/stores/permission-set.d.ts +0 -250
- package/dist/stores/team.d.ts +0 -288
- package/dist/team-CiZSNUQW.js +0 -26
- package/dist/types/audit-log.d.ts +0 -19
- package/dist/types/permission-assignment.d.ts +0 -20
- package/dist/types/permission-set.d.ts +0 -20
- package/dist/useAppStore-RzLLN5d9.js +0 -180
- package/dist/useLoading-1OqFn86y.js +0 -99
- package/dist/useSearch-B6WK1LBB.js +0 -15
- package/dist/views/audit-log/locales/index.d.ts +0 -211
- package/dist/views/team/Main.vue.d.ts +0 -2
- package/dist/views/team/components/BasePermission.vue.d.ts +0 -64
- package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +0 -14
- package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +0 -14
- package/dist/views/team/member/TeamMemberList.vue.d.ts +0 -4
- package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +0 -55
- package/dist/views/team/role/RolePermissionForm.vue.d.ts +0 -19
- package/dist/views/team/role/RolePermissionList.vue.d.ts +0 -5
- /package/dist/views/{audit-log/AuditLogList.vue.d.ts → hr/main.vue.d.ts} +0 -0
- /package/dist/views/{hr/Main.vue.d.ts → team/TeamMemberList.vue.d.ts} +0 -0
- /package/dist/views/team/{member → components}/MemberInfo.vue.d.ts +0 -0
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export { Permission,
|
|
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[];
|
package/dist/types/team.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { RawRule } from '@casl/ability';
|
|
2
|
-
import type { FdoPermissionRule } from '@feedmepos/core/entity';
|
|
3
2
|
export interface IPermissionUser {
|
|
4
3
|
businessId: string;
|
|
5
4
|
userId: string;
|
|
@@ -8,7 +7,6 @@ export interface IPermissionUser {
|
|
|
8
7
|
/** @deprecated */
|
|
9
8
|
phoneNumber?: string;
|
|
10
9
|
permissions: RawRule[];
|
|
11
|
-
permissionSetIds: string[];
|
|
12
10
|
}
|
|
13
11
|
export interface IFdtoPortalUser extends IPermissionUser {
|
|
14
12
|
id: string;
|
|
@@ -30,20 +28,13 @@ export interface IFdtoPermissionPosUserRole {
|
|
|
30
28
|
roleId: string;
|
|
31
29
|
}
|
|
32
30
|
export interface IFdtoUpdatePortalUserReq {
|
|
33
|
-
|
|
34
|
-
permissions?: FdoPermissionRule[];
|
|
31
|
+
permissions?: RawRule[];
|
|
35
32
|
posUser?: IFdtoPermissionPosUser;
|
|
36
|
-
permissionSetIds?: string[];
|
|
37
|
-
customPermissions?: FdoPermissionRule[];
|
|
38
33
|
}
|
|
39
34
|
export interface IFdtoCreatePortalUserReq {
|
|
40
35
|
phoneNumber?: string;
|
|
41
36
|
email?: string;
|
|
42
|
-
|
|
43
|
-
permissions?: FdoPermissionRule[];
|
|
44
|
-
permissionSetIds?: string[];
|
|
45
|
-
customPermissions: FdoPermissionRule[];
|
|
46
|
-
name?: string;
|
|
37
|
+
permissions: RawRule[];
|
|
47
38
|
posUser?: IFdtoPermissionPosUser;
|
|
48
39
|
}
|
|
49
40
|
export interface FTeamMember {
|
|
@@ -53,7 +44,6 @@ export interface FTeamMember {
|
|
|
53
44
|
email: string;
|
|
54
45
|
restaurants: string[];
|
|
55
46
|
managableRestaurantIds: string[];
|
|
56
|
-
permissions:
|
|
57
|
-
permissionLabels: string[];
|
|
47
|
+
permissions: string[];
|
|
58
48
|
doc: IFdtoPortalUser;
|
|
59
49
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineStore as p } from "pinia";
|
|
2
|
+
import { g as s } from "./rule-BLgeh_ly.js";
|
|
3
|
+
import { baseClientInstance as d } from "@feedmepos/mf-common";
|
|
4
|
+
var n = [];
|
|
5
|
+
for (var r = 0; r < 256; ++r)
|
|
6
|
+
n.push((r + 256).toString(16).slice(1));
|
|
7
|
+
function l(e, t = 0) {
|
|
8
|
+
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();
|
|
9
|
+
}
|
|
10
|
+
var u, g = new Uint8Array(16);
|
|
11
|
+
function y() {
|
|
12
|
+
if (!u && (u = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !u))
|
|
13
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
14
|
+
return u(g);
|
|
15
|
+
}
|
|
16
|
+
var m = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
17
|
+
const o = {
|
|
18
|
+
randomUUID: m
|
|
19
|
+
};
|
|
20
|
+
function b(e, t, a) {
|
|
21
|
+
if (o.randomUUID && !e)
|
|
22
|
+
return o.randomUUID();
|
|
23
|
+
e = e || {};
|
|
24
|
+
var i = e.random || (e.rng || y)();
|
|
25
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, l(i);
|
|
26
|
+
}
|
|
27
|
+
const c = {
|
|
28
|
+
async read() {
|
|
29
|
+
return s(await d("/").get("/public-setting"));
|
|
30
|
+
},
|
|
31
|
+
async update(e) {
|
|
32
|
+
return s(await d("/").put("/public-setting", e));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function h() {
|
|
36
|
+
return {
|
|
37
|
+
loadingQueue: [],
|
|
38
|
+
publicSetting: {
|
|
39
|
+
delivery: {
|
|
40
|
+
feedMe: {
|
|
41
|
+
areas: [],
|
|
42
|
+
enable: !1,
|
|
43
|
+
maxDistance: 0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
sms: {
|
|
47
|
+
firebase: !1
|
|
48
|
+
},
|
|
49
|
+
assets: {
|
|
50
|
+
groups: []
|
|
51
|
+
},
|
|
52
|
+
aiSettings: {
|
|
53
|
+
remy: { enable: !1 }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const U = p("portal-app-store", {
|
|
59
|
+
state: () => h(),
|
|
60
|
+
actions: {
|
|
61
|
+
addLoadingQueues(e) {
|
|
62
|
+
this.loadingQueue = [...this.loadingQueue, ...e];
|
|
63
|
+
},
|
|
64
|
+
clearLoadingQueue() {
|
|
65
|
+
this.loadingQueue = [];
|
|
66
|
+
},
|
|
67
|
+
resolveQueues(e) {
|
|
68
|
+
this.loadingQueue = this.loadingQueue.filter((t) => !e.includes(t.id));
|
|
69
|
+
},
|
|
70
|
+
async promise(e, t = !0) {
|
|
71
|
+
const a = b();
|
|
72
|
+
try {
|
|
73
|
+
const i = [{ id: a, isGlobal: t }];
|
|
74
|
+
return this.addLoadingQueues(i), await e();
|
|
75
|
+
} finally {
|
|
76
|
+
this.resolveQueues([a]);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
async getPublicSetting() {
|
|
80
|
+
return this.publicSetting = await c.read(), this.publicSetting;
|
|
81
|
+
},
|
|
82
|
+
async updatePublicSetting(e) {
|
|
83
|
+
return this.publicSetting = await c.update({
|
|
84
|
+
...this.publicSetting,
|
|
85
|
+
...e
|
|
86
|
+
}), this.publicSetting;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
U as u,
|
|
92
|
+
b as v
|
|
93
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { defineComponent as x, openBlock as _, createElementBlock as L, unref as i, resolveComponent as c, createVNode as h, normalizeClass as v, withCtx as I, createElementVNode as n, toDisplayString as w, renderSlot as M, createBlock as C, withModifiers as E, createCommentVNode as b, computed as O, isRef as T, watch as $ } from "vue";
|
|
2
|
+
import { E as B } from "./empty-placeholder-ey8LJtN1.js";
|
|
3
|
+
import { SnackbarPosition as y } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as S, v as Q } from "./useAppStore-DViQe2C8.js";
|
|
5
|
+
const k = ["src"], D = /* @__PURE__ */ x({
|
|
6
|
+
__name: "Icon",
|
|
7
|
+
setup(s) {
|
|
8
|
+
return (o, d) => (_(), L("img", { src: i(B) }, null, 8, k));
|
|
9
|
+
}
|
|
10
|
+
}), G = { class: "xs:px-16" }, N = { class: "flex flex-col gap-4 items-center" }, P = { class: "fm-typo-en-title-sm-600" }, V = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400 max-w-[800px]" }, z = /* @__PURE__ */ x({
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
title: {},
|
|
14
|
+
subtitle: {},
|
|
15
|
+
action: {}
|
|
16
|
+
},
|
|
17
|
+
setup(s) {
|
|
18
|
+
return (o, d) => {
|
|
19
|
+
const a = c("fm-button"), e = c("fm-card");
|
|
20
|
+
return _(), L("div", G, [
|
|
21
|
+
h(e, {
|
|
22
|
+
class: v(["flex flex-col items-center justify-center", "p-24 space-y-24"]),
|
|
23
|
+
variant: "outlined"
|
|
24
|
+
}, {
|
|
25
|
+
default: I(() => [
|
|
26
|
+
h(D),
|
|
27
|
+
n("div", N, [
|
|
28
|
+
n("p", P, w(s.title), 1),
|
|
29
|
+
n("p", V, w(s.subtitle), 1)
|
|
30
|
+
]),
|
|
31
|
+
M(o.$slots, "action", {}, () => [
|
|
32
|
+
s.action ? (_(), C(a, {
|
|
33
|
+
key: 0,
|
|
34
|
+
label: s.action.text,
|
|
35
|
+
"prepend-icon": s.action.icon ?? "add",
|
|
36
|
+
onClick: E(s.action.callback, ["stop"])
|
|
37
|
+
}, null, 8, ["label", "prepend-icon", "onClick"])) : b("", !0)
|
|
38
|
+
])
|
|
39
|
+
]),
|
|
40
|
+
_: 3
|
|
41
|
+
})
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}), H = (s) => {
|
|
46
|
+
async function o(a, e) {
|
|
47
|
+
var m, l;
|
|
48
|
+
let r = [];
|
|
49
|
+
!e || !e.customId ? r.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${Q().split("-")[0]}`) : typeof e.customId == "string" ? r.push(e.customId) : r = e.customId;
|
|
50
|
+
const u = S();
|
|
51
|
+
u.addLoadingQueues(
|
|
52
|
+
r.map((t) => ({
|
|
53
|
+
id: t,
|
|
54
|
+
isGlobal: (e == null ? void 0 : e.isGlobal) || !1
|
|
55
|
+
}))
|
|
56
|
+
);
|
|
57
|
+
try {
|
|
58
|
+
const t = await a();
|
|
59
|
+
return await ((m = e == null ? void 0 : e.onSuccess) == null ? void 0 : m.call(e, t)), t;
|
|
60
|
+
} catch (t) {
|
|
61
|
+
const p = t instanceof Error ? t.message : `${t}`;
|
|
62
|
+
throw e != null && e.onError ? await e.onError(p) : s.open({
|
|
63
|
+
type: "error",
|
|
64
|
+
message: p
|
|
65
|
+
}), t;
|
|
66
|
+
} finally {
|
|
67
|
+
u.resolveQueues(r), (l = e == null ? void 0 : e.onComplete) == null || l.call(e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const d = S();
|
|
71
|
+
return {
|
|
72
|
+
queue: O(() => d.loadingQueue),
|
|
73
|
+
checkIsLoading: (a) => d.loadingQueue.some((e) => e.id === a),
|
|
74
|
+
global: async (a, e) => await o(a, {
|
|
75
|
+
isGlobal: !0,
|
|
76
|
+
onSuccess: async (r) => {
|
|
77
|
+
var u;
|
|
78
|
+
await ((u = e == null ? void 0 : e.onSuccess) == null ? void 0 : u.call(e, r)), e != null && e.successMessage && s.open({
|
|
79
|
+
type: "success",
|
|
80
|
+
message: e.successMessage,
|
|
81
|
+
position: y.BOTTOM
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
minor: async (a, e) => {
|
|
86
|
+
const r = s.open({
|
|
87
|
+
type: "info",
|
|
88
|
+
message: "Loading",
|
|
89
|
+
spinner: !0,
|
|
90
|
+
persistent: !0
|
|
91
|
+
}), u = (m, l) => {
|
|
92
|
+
if (!l) return;
|
|
93
|
+
const t = (p) => {
|
|
94
|
+
s.updateSnackbar(r, { [m]: p });
|
|
95
|
+
};
|
|
96
|
+
T(l) ? (t(l.value), $(l, (p) => t(p))) : t(l);
|
|
97
|
+
};
|
|
98
|
+
return u("title", e == null ? void 0 : e.message), u("message", e == null ? void 0 : e.caption), await o(
|
|
99
|
+
async () => (e != null && e.isLoading && (e.isLoading.value = !0), await a()),
|
|
100
|
+
{
|
|
101
|
+
onSuccess: () => {
|
|
102
|
+
const m = (e == null ? void 0 : e.successMessage) || "Completed";
|
|
103
|
+
s.close(r), s.open({
|
|
104
|
+
type: "success",
|
|
105
|
+
title: m,
|
|
106
|
+
position: y.BOTTOM
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
onError: (m) => {
|
|
110
|
+
const l = `${m}` || "Error";
|
|
111
|
+
s.close(r), s.open({
|
|
112
|
+
type: "error",
|
|
113
|
+
title: l,
|
|
114
|
+
position: y.BOTTOM
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
onComplete: () => {
|
|
118
|
+
e != null && e.isLoading && (e.isLoading.value = !1);
|
|
119
|
+
},
|
|
120
|
+
customId: e == null ? void 0 : e.customId
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
custom: async (a, e) => await o(
|
|
125
|
+
async () => (e != null && e.isLoading && (e.isLoading.value = !0), await a()),
|
|
126
|
+
{
|
|
127
|
+
onSuccess: async () => {
|
|
128
|
+
e != null && e.successMessage && s.open({ message: e.successMessage });
|
|
129
|
+
},
|
|
130
|
+
onComplete: () => {
|
|
131
|
+
e && e.isLoading && (e.isLoading.value = !1);
|
|
132
|
+
},
|
|
133
|
+
customId: e == null ? void 0 : e.customId
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export {
|
|
139
|
+
z as _,
|
|
140
|
+
H as u
|
|
141
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as m,
|
|
1
|
+
import { defineComponent as m, openBlock as n, createElementBlock as a, createElementVNode as i, toDisplayString as c, createCommentVNode as l, renderSlot as r, normalizeClass as d, createVNode as p, withCtx as f, computed as y } from "vue";
|
|
2
2
|
import { useI18n as h, useCoreStore as _ } from "@feedmepos/mf-common";
|
|
3
3
|
import { useDialog as b } from "@feedmepos/ui-library";
|
|
4
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 = {
|
|
@@ -11,11 +11,11 @@ const x = { class: "space-y-8" }, k = { class: "flex items-center justify-betwee
|
|
|
11
11
|
description: {}
|
|
12
12
|
},
|
|
13
13
|
setup(e) {
|
|
14
|
-
return (t, s) => (
|
|
14
|
+
return (t, s) => (n(), a("div", x, [
|
|
15
15
|
i("div", k, [
|
|
16
16
|
i("div", $, [
|
|
17
17
|
i("p", v, c(e.label), 1),
|
|
18
|
-
e.description ? (
|
|
18
|
+
e.description ? (n(), a("p", C, c(e.description), 1)) : l("", !0)
|
|
19
19
|
]),
|
|
20
20
|
r(t.$slots, "append")
|
|
21
21
|
]),
|
|
@@ -28,7 +28,7 @@ const x = { class: "space-y-8" }, k = { class: "flex items-center justify-betwee
|
|
|
28
28
|
shrinkable: { type: Boolean }
|
|
29
29
|
},
|
|
30
30
|
setup(e) {
|
|
31
|
-
return (t, s) => (
|
|
31
|
+
return (t, s) => (n(), a("div", {
|
|
32
32
|
class: d(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
|
|
33
33
|
}, [
|
|
34
34
|
r(t.$slots, "default")
|
|
@@ -48,13 +48,13 @@ const x = { class: "space-y-8" }, k = { class: "flex items-center justify-betwee
|
|
|
48
48
|
shrinkable: { type: Boolean }
|
|
49
49
|
},
|
|
50
50
|
setup(e) {
|
|
51
|
-
return (t, s) => (
|
|
51
|
+
return (t, s) => (n(), a("div", {
|
|
52
52
|
class: d(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
|
|
53
53
|
}, [
|
|
54
|
-
e.title ? (
|
|
54
|
+
e.title ? (n(), a("div", S, [
|
|
55
55
|
i("div", w, [
|
|
56
56
|
i("p", B, c(e.title), 1),
|
|
57
|
-
e.subTitle ? (
|
|
57
|
+
e.subTitle ? (n(), a("p", D, c(e.subTitle), 1)) : l("", !0)
|
|
58
58
|
]),
|
|
59
59
|
r(t.$slots, "append-title")
|
|
60
60
|
])) : l("", !0),
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as F, computed as c, defineComponent as G, watch as J, nextTick as Q, resolveComponent as w, openBlock as i, createElementBlock as h, createElementVNode as A, createVNode as S, withCtx as L, createCommentVNode as C, normalizeStyle as W, Fragment as V, createBlock as P, unref as x, renderList as K, renderSlot as B, normalizeClass as X, toDisplayString as Y, withModifiers as Z } from "vue";
|
|
2
2
|
import "@feedmepos/ui-library";
|
|
3
3
|
/* empty css */
|
|
4
|
-
function ee(
|
|
5
|
-
const l =
|
|
6
|
-
if (!l.value && !
|
|
4
|
+
function ee(u, t, v = u) {
|
|
5
|
+
const l = F(!0), d = c(() => {
|
|
6
|
+
if (!l.value && !t.value)
|
|
7
7
|
return !0;
|
|
8
|
-
if (
|
|
9
|
-
const r =
|
|
10
|
-
return
|
|
8
|
+
if (t.value && t.value.length > 0) {
|
|
9
|
+
const r = v.value.map((o) => o.value);
|
|
10
|
+
return t.value.length === r.length && t.value.every((o) => r.includes(o));
|
|
11
11
|
}
|
|
12
12
|
return !1;
|
|
13
13
|
}), e = c(() => {
|
|
14
|
-
var r, o,
|
|
15
|
-
return !!((r =
|
|
14
|
+
var r, o, b, f;
|
|
15
|
+
return !!((r = t.value) != null && r.length && ((o = t.value) == null ? void 0 : o.length) > 0 && ((b = t.value) == null ? void 0 : b.length) < ((f = u.value) == null ? void 0 : f.length));
|
|
16
16
|
});
|
|
17
|
-
return { allCleared: l, allSelected:
|
|
18
|
-
if (
|
|
19
|
-
|
|
17
|
+
return { allCleared: l, allSelected: d, indeterminate: e, toggleAll: () => {
|
|
18
|
+
if (d.value) {
|
|
19
|
+
t.value = void 0, l.value = !0;
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
const r =
|
|
23
|
-
r.length ===
|
|
22
|
+
const r = v.value.map((o) => o.value);
|
|
23
|
+
r.length === u.value.length ? (t.value = void 0, l.value = !1) : (t.value = r, l.value = !1);
|
|
24
24
|
}, toggleOption: (r) => {
|
|
25
|
-
var
|
|
25
|
+
var b, f, k;
|
|
26
26
|
let o;
|
|
27
|
-
|
|
27
|
+
t.value === void 0 && l.value ? o = [r] : t.value === void 0 && !l.value ? o = (b = u.value.map((p) => p.value)) == null ? void 0 : b.filter((p) => p !== r) : (f = t.value) != null && f.includes(r) ? o = (k = t.value) == null ? void 0 : k.filter((p) => p !== r) : o = [...t.value || [], r], o.length === 0 ? (t.value = void 0, l.value = !0) : o.length === u.value.length ? (t.value = void 0, l.value = !1) : t.value = o;
|
|
28
28
|
} };
|
|
29
29
|
}
|
|
30
30
|
const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-center gap-8" }, te = { class: "inline-flex items-center" }, ue = { class: "flex flex-col w-[360px] min-h-0 gap-8" }, ne = {
|
|
@@ -49,47 +49,47 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
49
49
|
selectedPrefix: { default: "Selected: " }
|
|
50
50
|
},
|
|
51
51
|
emits: ["update:modelValue", "change"],
|
|
52
|
-
setup(
|
|
53
|
-
const l =
|
|
52
|
+
setup(u, { expose: t, emit: v }) {
|
|
53
|
+
const l = u, d = v, e = c({
|
|
54
54
|
get: () => l.modelValue,
|
|
55
55
|
set: (a) => {
|
|
56
|
-
|
|
56
|
+
d("update:modelValue", a), d("change", a);
|
|
57
57
|
}
|
|
58
|
-
}),
|
|
59
|
-
if (!l.searchable || !
|
|
60
|
-
const a =
|
|
61
|
-
return
|
|
58
|
+
}), g = F(""), y = c(() => l.items), r = c(() => {
|
|
59
|
+
if (!l.searchable || !g.value.trim()) return y.value;
|
|
60
|
+
const a = g.value.toLowerCase();
|
|
61
|
+
return y.value.filter((n) => n.label.toLowerCase().includes(a));
|
|
62
62
|
}), o = c(() => {
|
|
63
63
|
if (!e.value || Array.isArray(e.value) && e.value.length === 0)
|
|
64
64
|
return l.placeholder;
|
|
65
65
|
if (Array.isArray(e.value) && e.value.length === 1) {
|
|
66
|
-
const n =
|
|
66
|
+
const n = y.value.find((m) => m.value === e.value[0]);
|
|
67
67
|
return (n == null ? void 0 : n.label) || l.placeholder;
|
|
68
68
|
}
|
|
69
69
|
const a = Array.isArray(e.value) ? e.value.length : 0;
|
|
70
70
|
return `${l.selectedPrefix}${a}`;
|
|
71
|
-
}),
|
|
71
|
+
}), b = c(() => {
|
|
72
72
|
if (e.value === void 0 || e.value === null || e.value === "")
|
|
73
73
|
return l.placeholder;
|
|
74
|
-
const a =
|
|
74
|
+
const a = y.value.find((n) => n.value === e.value);
|
|
75
75
|
return (a == null ? void 0 : a.label) || l.placeholder;
|
|
76
|
-
}),
|
|
77
|
-
() => l.multiple ? o.value :
|
|
78
|
-
),
|
|
76
|
+
}), f = c(
|
|
77
|
+
() => l.multiple ? o.value : b.value
|
|
78
|
+
), k = c(() => l.disabled ? "neutral-gray-200" : l.variant === "dark" ? "neutral-black" : "neutral-gray-400"), p = c(() => l.disabled ? "text-fm-color-neutral-gray-200" : l.variant === "dark" ? "text-fm-color-neutral-black" : "text-fm-color-neutral-gray-400"), M = F(void 0), N = new Proxy(M, {
|
|
79
79
|
get(a, n) {
|
|
80
80
|
return n === "value" ? Array.isArray(e.value) ? e.value : e.value === void 0 ? void 0 : [e.value] : M[n];
|
|
81
81
|
},
|
|
82
|
-
set(a, n,
|
|
83
|
-
return n === "value" ? (e.value =
|
|
82
|
+
set(a, n, m) {
|
|
83
|
+
return n === "value" ? (e.value = m, !0) : (M[n] = m, !0);
|
|
84
84
|
}
|
|
85
|
-
}), { allSelected: $, toggleAll:
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
}), { allSelected: $, toggleAll: E, toggleOption: H, indeterminate: D } = ee(
|
|
86
|
+
y,
|
|
87
|
+
N,
|
|
88
88
|
r
|
|
89
89
|
);
|
|
90
90
|
function O(a) {
|
|
91
91
|
var n;
|
|
92
|
-
l.multiple || (e.value = a, (n =
|
|
92
|
+
l.multiple || (e.value = a, (n = _.value) == null || n.toggleMenu(!1));
|
|
93
93
|
}
|
|
94
94
|
function T(a) {
|
|
95
95
|
a.stopPropagation(), !l.disabled && (e.value = null);
|
|
@@ -99,70 +99,70 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
99
99
|
async (a) => {
|
|
100
100
|
if (a && !l.multiple && (e.value === void 0 || e.value === null)) {
|
|
101
101
|
await Q();
|
|
102
|
-
const n =
|
|
102
|
+
const n = y.value[0];
|
|
103
103
|
n && (e.value = n.value);
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
{ immediate: !0 }
|
|
107
107
|
);
|
|
108
|
-
const
|
|
109
|
-
return
|
|
108
|
+
const _ = F(null);
|
|
109
|
+
return t({
|
|
110
110
|
open: () => {
|
|
111
111
|
var a;
|
|
112
|
-
return (a =
|
|
112
|
+
return (a = _.value) == null ? void 0 : a.toggleMenu(!0);
|
|
113
113
|
},
|
|
114
114
|
close: () => {
|
|
115
115
|
var a;
|
|
116
|
-
return (a =
|
|
116
|
+
return (a = _.value) == null ? void 0 : a.toggleMenu(!1);
|
|
117
117
|
}
|
|
118
118
|
}), (a, n) => {
|
|
119
|
-
const
|
|
120
|
-
return i(),
|
|
119
|
+
const m = w("FmIcon"), U = w("FmChip"), j = w("FmSearch"), z = w("FmMenuItem"), q = w("FmMenu");
|
|
120
|
+
return i(), h("div", le, [
|
|
121
121
|
A("div", ae, [
|
|
122
|
-
|
|
122
|
+
S(q, {
|
|
123
123
|
ref_key: "menuRef",
|
|
124
|
-
ref:
|
|
124
|
+
ref: _,
|
|
125
125
|
"close-on-click": !1,
|
|
126
|
-
disabled:
|
|
126
|
+
disabled: u.disabled,
|
|
127
127
|
"z-index": 50,
|
|
128
128
|
"selector-for-dismiss-away-event-exclusion": ".fm-dialog, .fm-select__menu__wrapper"
|
|
129
129
|
}, {
|
|
130
130
|
"menu-button": L(() => [
|
|
131
|
-
|
|
131
|
+
B(a.$slots, "menu-button", {}, () => [
|
|
132
132
|
A("div", te, [
|
|
133
|
-
|
|
133
|
+
S(U, { disabled: u.disabled }, {
|
|
134
134
|
default: L(() => [
|
|
135
|
-
|
|
136
|
-
color:
|
|
137
|
-
name:
|
|
135
|
+
S(m, {
|
|
136
|
+
color: k.value,
|
|
137
|
+
name: u.chipIcon,
|
|
138
138
|
outline: "",
|
|
139
139
|
size: "sm"
|
|
140
140
|
}, null, 8, ["color", "name"]),
|
|
141
|
-
|
|
141
|
+
f.value ? (i(), h("div", {
|
|
142
142
|
key: 0,
|
|
143
143
|
class: X([
|
|
144
144
|
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
|
145
|
-
|
|
145
|
+
p.value
|
|
146
146
|
])
|
|
147
|
-
}, Y(
|
|
148
|
-
|
|
149
|
-
color:
|
|
147
|
+
}, Y(f.value), 3)) : C("", !0),
|
|
148
|
+
S(m, {
|
|
149
|
+
color: k.value,
|
|
150
150
|
name: "keyboard_arrow_down",
|
|
151
151
|
size: "sm"
|
|
152
152
|
}, null, 8, ["color"]),
|
|
153
|
-
|
|
153
|
+
u.clearable && !u.multiple && e.value != null && e.value !== "" && !u.disabled ? (i(), h("button", {
|
|
154
154
|
key: 1,
|
|
155
155
|
class: "ml-4 focus:outline-none",
|
|
156
156
|
type: "button",
|
|
157
157
|
"aria-label": "Clear selection",
|
|
158
158
|
onClick: Z(T, ["stop"])
|
|
159
159
|
}, [
|
|
160
|
-
|
|
160
|
+
S(m, {
|
|
161
161
|
name: "close",
|
|
162
162
|
size: "sm",
|
|
163
|
-
color:
|
|
163
|
+
color: k.value
|
|
164
164
|
}, null, 8, ["color"])
|
|
165
|
-
])) :
|
|
165
|
+
])) : C("", !0)
|
|
166
166
|
]),
|
|
167
167
|
_: 1
|
|
168
168
|
}, 8, ["disabled"])
|
|
@@ -171,34 +171,34 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
171
171
|
]),
|
|
172
172
|
default: L(() => [
|
|
173
173
|
A("div", ue, [
|
|
174
|
-
|
|
174
|
+
u.searchable ? (i(), h("div", ne, [
|
|
175
175
|
A("div", re, [
|
|
176
|
-
|
|
177
|
-
modelValue:
|
|
178
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) =>
|
|
179
|
-
placeholder:
|
|
176
|
+
S(j, {
|
|
177
|
+
modelValue: g.value,
|
|
178
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => g.value = s),
|
|
179
|
+
placeholder: u.searchPlaceholder
|
|
180
180
|
}, null, 8, ["modelValue", "placeholder"])
|
|
181
181
|
])
|
|
182
|
-
])) :
|
|
182
|
+
])) : C("", !0),
|
|
183
183
|
A("div", {
|
|
184
184
|
class: "flex-1 overflow-y-auto min-h-0",
|
|
185
|
-
style: W({ maxHeight: typeof
|
|
185
|
+
style: W({ maxHeight: typeof u.maxHeight == "number" ? u.maxHeight + "px" : u.maxHeight })
|
|
186
186
|
}, [
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
u.multiple ? (i(), h(V, { key: 0 }, [
|
|
188
|
+
u.showSelectAll ? (i(), P(z, {
|
|
189
189
|
key: 0,
|
|
190
190
|
label: "All",
|
|
191
191
|
"has-checkbox": "",
|
|
192
|
-
"model-value":
|
|
193
|
-
indeterminate:
|
|
194
|
-
onClick:
|
|
195
|
-
}, null, 8, ["model-value", "indeterminate", "onClick"])) :
|
|
196
|
-
r.value.length ? (i(!0),
|
|
192
|
+
"model-value": x($),
|
|
193
|
+
indeterminate: x(D),
|
|
194
|
+
onClick: x(E)
|
|
195
|
+
}, null, 8, ["model-value", "indeterminate", "onClick"])) : C("", !0),
|
|
196
|
+
r.value.length ? (i(!0), h(V, { key: 1 }, K(r.value, (s) => {
|
|
197
197
|
var I;
|
|
198
|
-
return
|
|
198
|
+
return B(a.$slots, "option", {
|
|
199
199
|
option: s,
|
|
200
|
-
selected:
|
|
201
|
-
toggle: () =>
|
|
200
|
+
selected: x($) || Array.isArray(e.value) && ((I = e.value) == null ? void 0 : I.includes(s.value)),
|
|
201
|
+
toggle: () => x(H)(s.value)
|
|
202
202
|
}, () => {
|
|
203
203
|
var R;
|
|
204
204
|
return [
|
|
@@ -206,14 +206,14 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
206
206
|
key: s.value,
|
|
207
207
|
label: s.label,
|
|
208
208
|
"has-checkbox": "",
|
|
209
|
-
"model-value":
|
|
210
|
-
onClick: (ie) =>
|
|
209
|
+
"model-value": x($) || Array.isArray(e.value) && ((R = e.value) == null ? void 0 : R.includes(s.value)),
|
|
210
|
+
onClick: (ie) => x(H)(s.value)
|
|
211
211
|
}, null, 8, ["label", "model-value", "onClick"]))
|
|
212
212
|
];
|
|
213
213
|
}, !0);
|
|
214
|
-
}), 256)) :
|
|
215
|
-
], 64)) : (i(),
|
|
216
|
-
r.value.length ? (i(!0),
|
|
214
|
+
}), 256)) : C("", !0)
|
|
215
|
+
], 64)) : (i(), h(V, { key: 1 }, [
|
|
216
|
+
r.value.length ? (i(!0), h(V, { key: 0 }, K(r.value, (s) => B(a.$slots, "option", {
|
|
217
217
|
option: s,
|
|
218
218
|
selected: e.value === s.value,
|
|
219
219
|
toggle: () => O(s.value)
|
|
@@ -223,25 +223,36 @@ const le = { class: "w-full flex flex-col gap-8" }, ae = { class: "flex items-ce
|
|
|
223
223
|
label: s.label,
|
|
224
224
|
onClick: (I) => O(s.value)
|
|
225
225
|
}, null, 8, ["label", "onClick"]))
|
|
226
|
-
], !0)), 256)) :
|
|
226
|
+
], !0)), 256)) : C("", !0)
|
|
227
227
|
], 64))
|
|
228
228
|
], 4)
|
|
229
229
|
])
|
|
230
230
|
]),
|
|
231
231
|
_: 3
|
|
232
232
|
}, 8, ["disabled"]),
|
|
233
|
-
|
|
233
|
+
B(a.$slots, "append-right", {}, void 0, !0)
|
|
234
234
|
])
|
|
235
235
|
]);
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
}), se = (
|
|
239
|
-
const
|
|
240
|
-
for (const [l,
|
|
241
|
-
|
|
242
|
-
return
|
|
243
|
-
}, fe = /* @__PURE__ */ se(oe, [["__scopeId", "data-v-6634d154"]])
|
|
238
|
+
}), se = (u, t) => {
|
|
239
|
+
const v = u.__vccOpts || u;
|
|
240
|
+
for (const [l, d] of t)
|
|
241
|
+
v[l] = d;
|
|
242
|
+
return v;
|
|
243
|
+
}, fe = /* @__PURE__ */ se(oe, [["__scopeId", "data-v-6634d154"]]), me = (u) => {
|
|
244
|
+
const t = F(u || "");
|
|
245
|
+
function v(e) {
|
|
246
|
+
return `${e}`.trim().toLowerCase();
|
|
247
|
+
}
|
|
248
|
+
const l = c(() => v(t.value));
|
|
249
|
+
function d(e) {
|
|
250
|
+
return l.value ? e.some((g) => v(g).includes(l.value)) : !0;
|
|
251
|
+
}
|
|
252
|
+
return { searchKey: t, filter: d };
|
|
253
|
+
};
|
|
244
254
|
export {
|
|
245
255
|
fe as S,
|
|
246
|
-
se as _
|
|
256
|
+
se as _,
|
|
257
|
+
me as u
|
|
247
258
|
};
|