@baishuyun/ui-business 2.0.6 → 3.0.3
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/README.md +188 -1
- package/dist/DeptsMember/DeptsMember-CzJqr_LX.js +721 -0
- package/dist/DeptsMember/ExtraConcactPanel-BI9emYpp.js +674 -0
- package/dist/DeptsMember/OrganizationPanel-DcwvZ6X4.js +254 -0
- package/dist/DeptsMember/TabGroup-wNM86-Zq.js +141 -0
- package/dist/DeptsMember/index.js +2 -2
- package/dist/DeptsMember/subcomponents/Entity/Department/index.js +79 -304
- package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.d.ts +2 -0
- package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +38 -0
- package/dist/DeptsMember/subcomponents/Entity/Member/index.js +27 -672
- package/dist/components/DeptsMember/DeptsMember.type.d.ts +5 -1
- package/dist/components/DeptsMember/hooks/useDeptsMemberSelector.d.ts +1 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Department/index.d.ts +1 -1
- package/dist/components/DeptsMember/subcomponents/Entity/DeptsUser/index.d.ts +6 -0
- package/dist/components/DeptsMember/subcomponents/Entity/Member/index.d.ts +1 -1
- package/dist/components/DeptsMember/subcomponents/SelectionTabs/SelectionTabList/SelectionTabList.d.ts +2 -2
- package/dist/components/DeptsMember/subcomponents/SelectionTabs/useSelectorType.d.ts +16 -0
- package/dist/components/DeptsMember/utils/constants.d.ts +8 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -7
- package/dist/lang/en-US.json.d.ts +2 -1
- package/dist/lang/zh-CN.json.d.ts +2 -1
- package/dist/services/apiService.d.ts +16 -11
- package/dist/vendors/services/apiService.js +11 -86
- package/dist/vendors/services/corp/outsider.service.js +4 -4
- package/dist/vendors/services/data/department.service.js +2 -2
- package/dist/vendors/services/data/member.service.js +6 -6
- package/dist/vendors/services/data/member_limit.service.js +3 -3
- package/dist/vendors/services/data/outsider.service.js +4 -4
- package/package.json +2 -2
- package/dist/DeptsMember/DeptsMember-pFjdAocd.js +0 -702
- package/dist/DeptsMember/TabGroup-CznMwTOD.js +0 -137
- package/dist/vendors/axios.js +0 -1720
- package/dist/vendors/services/team/team.services.js +0 -5
- /package/dist/components/DeptsMember/subcomponents/Entity/Member/{MemberEntity/MemerList → MemerList}/MemberList.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Department/CurrentDepartmentEntity/CurrentDepartmentEntity.d.ts → Panels/CurrentUserDeptsPanel/CurrentUserDeptsPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/CurrentEntity/CurrentEntity.d.ts → Panels/CurrentUserPanel/CurrentUserPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Department/ExternalContactEntity/ExternalContactEntity.d.ts → Panels/ExtraConcactPanel/ExtraConcactPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/ExternalContactEntity/ExternalContactEntity.d.ts → Panels/ExtraContactGroupPanel/ExtraContactGroupPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/MemberEntity → Panels/MemberPanel}/AllMemeberCheck/AllMemeberCheck.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/MemberEntity → Panels/MemberPanel}/ExternalMember/ExternalMember.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/MemberEntity → Panels/MemberPanel}/InternalMemeber/InternalMemeber.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/MemberEntity/MemberEntity.d.ts → Panels/MemberPanel/MemberPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Department/OrganizationalEntity → Panels/OrganizationPanel}/ExternalOrganization/ExternalOrganization.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Department/OrganizationalEntity → Panels/OrganizationPanel}/InternalOrganization/InternalOrganization.d.ts +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Department/OrganizationalEntity/OrganizationalEntity.d.ts → Panels/OrganizationPanel/OrganizationPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/MajorEntity/MajorEntity.d.ts → Panels/PositionPanel/PositionPanel.d.ts} +0 -0
- /package/dist/components/DeptsMember/subcomponents/{Entity/Member/RoleEntity/RoleEntity.d.ts → Panels/RolePanel/RolePanel.d.ts} +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { g as K } from "../vendors/services/data/member.service.js";
|
|
3
|
+
import { useRequest as w } from "ahooks";
|
|
4
|
+
import { Spin as F } from "antd";
|
|
5
|
+
import { c as k } from "../vendors/clsx.js";
|
|
6
|
+
import { useState as N, useMemo as T, useCallback as C } from "react";
|
|
7
|
+
import { a as E, u as I, E as S, d as M, b as R } from "./TabGroup-wNM86-Zq.js";
|
|
8
|
+
import { buildDeptTree as j, buildTree as H, findNodeInTree as L } from "./utils/index.js";
|
|
9
|
+
import { S as z } from "../vendors/simplebar-react.js";
|
|
10
|
+
import { Tree as A, Icon as _ } from "bsy-react-ui";
|
|
11
|
+
const P = (a) => {
|
|
12
|
+
const { type: o, containerHeight: u, value: x } = E(), { t: n } = I(), f = x?.map((s) => s._id) || [], l = a.data?.map((s) => s._id);
|
|
13
|
+
return /* @__PURE__ */ y(
|
|
14
|
+
z,
|
|
15
|
+
{
|
|
16
|
+
style: { height: u - 8, padding: "4px" },
|
|
17
|
+
className: "internal-container",
|
|
18
|
+
classNames: {
|
|
19
|
+
contentEl: "internal-container-content-el"
|
|
20
|
+
},
|
|
21
|
+
children: [
|
|
22
|
+
a.data.length > 0 && /* @__PURE__ */ t(
|
|
23
|
+
A,
|
|
24
|
+
{
|
|
25
|
+
parentCheckable: !0,
|
|
26
|
+
checkType: o === S.DEPARMENT ? "radio" : "checkbox",
|
|
27
|
+
data: a.data,
|
|
28
|
+
fieldNames: {
|
|
29
|
+
title: "name",
|
|
30
|
+
value: "_id",
|
|
31
|
+
children: "children"
|
|
32
|
+
},
|
|
33
|
+
selectedKeys: f,
|
|
34
|
+
onSelect: a.onSelect,
|
|
35
|
+
onDeSelect: a.onDeselect,
|
|
36
|
+
defaultExpandedKeys: l,
|
|
37
|
+
icon: () => /* @__PURE__ */ t(_, { name: "dept-one", className: "internal-container__icon" }),
|
|
38
|
+
switcherIcon: (s) => /* @__PURE__ */ t(
|
|
39
|
+
_,
|
|
40
|
+
{
|
|
41
|
+
name: "xiangxiazhankai-11",
|
|
42
|
+
className: k("internal-container__arrow-icon", {
|
|
43
|
+
"rotate-90": s
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
a.data.length === 0 && !a.loading && /* @__PURE__ */ t("div", { className: "internal-container__empty", children: /* @__PURE__ */ t("span", { children: n("department.noAvailable") }) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}, B = (a) => {
|
|
54
|
+
const { type: o, containerHeight: u, value: x } = E(), { t: n } = I(), [f, l] = N(
|
|
55
|
+
"dockcorp"
|
|
56
|
+
/* DOCK_PERSON_GROUP */
|
|
57
|
+
), s = x?.map((d) => d._id) || [], v = [
|
|
58
|
+
{
|
|
59
|
+
label: n("department.externalContactGroup"),
|
|
60
|
+
value: "dockcorp"
|
|
61
|
+
/* DOCK_PERSON_GROUP */
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: n("department.externalContactDepartment"),
|
|
65
|
+
value: "dockcorpdept"
|
|
66
|
+
/* DOCK_DEPARTMENT */
|
|
67
|
+
}
|
|
68
|
+
], b = (d, h) => {
|
|
69
|
+
const m = [];
|
|
70
|
+
for (const r of d)
|
|
71
|
+
if (r.type === h)
|
|
72
|
+
if (h === "dockcorpdept")
|
|
73
|
+
m.push({
|
|
74
|
+
...r,
|
|
75
|
+
children: r.children
|
|
76
|
+
});
|
|
77
|
+
else {
|
|
78
|
+
const e = r.children ? b(r.children, h) : [];
|
|
79
|
+
m.push({
|
|
80
|
+
...r,
|
|
81
|
+
children: e.length > 0 ? e : void 0
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const e = r.children ? b(r.children, h) : [];
|
|
86
|
+
e.length > 0 && m.push({
|
|
87
|
+
...r,
|
|
88
|
+
children: e
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return m;
|
|
92
|
+
}, p = b(a.data, f), D = p?.map((d) => d._id);
|
|
93
|
+
return /* @__PURE__ */ y("div", { className: "external-container", children: [
|
|
94
|
+
/* @__PURE__ */ t(M, { tabs: v, value: f, onChange: l }),
|
|
95
|
+
/* @__PURE__ */ t("div", { className: "external-container__content", children: /* @__PURE__ */ y(
|
|
96
|
+
z,
|
|
97
|
+
{
|
|
98
|
+
style: { height: u - 42, padding: "4px" },
|
|
99
|
+
classNames: {
|
|
100
|
+
contentEl: "external-container-content-el"
|
|
101
|
+
},
|
|
102
|
+
children: [
|
|
103
|
+
p.length > 0 && /* @__PURE__ */ t(
|
|
104
|
+
A,
|
|
105
|
+
{
|
|
106
|
+
parentCheckable: !0,
|
|
107
|
+
checkType: o === S.DEPARMENT ? "radio" : "checkbox",
|
|
108
|
+
data: p,
|
|
109
|
+
fieldNames: {
|
|
110
|
+
title: "name",
|
|
111
|
+
value: "_id",
|
|
112
|
+
children: "children"
|
|
113
|
+
},
|
|
114
|
+
selectedKeys: s,
|
|
115
|
+
onSelect: a.onSelect,
|
|
116
|
+
onDeSelect: a.onDeselect,
|
|
117
|
+
defaultExpandedKeys: D,
|
|
118
|
+
icon: () => /* @__PURE__ */ t(_, { name: "dept-one", className: "text-[#0265ff]", size: 16 }),
|
|
119
|
+
switcherIcon: (d) => /* @__PURE__ */ t(
|
|
120
|
+
_,
|
|
121
|
+
{
|
|
122
|
+
name: "xiangxiazhankai-11",
|
|
123
|
+
className: k(
|
|
124
|
+
"transition-transform text-base duration-300 ease-in-out text-[#666]",
|
|
125
|
+
{
|
|
126
|
+
"rotate-90": d
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
p.length === 0 && !a.loading && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t("span", { className: "text-[#999]", children: n("department.noAvailable") }) })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
) })
|
|
137
|
+
] });
|
|
138
|
+
}, $ = () => {
|
|
139
|
+
const { type: a, dispatch: o } = E(), { t: u } = I(), [x] = N([
|
|
140
|
+
{ key: 0, label: u("department.internal"), visible: !0 },
|
|
141
|
+
{ key: 1, label: u("department.external"), visible: !0 }
|
|
142
|
+
]), [n, f] = N(
|
|
143
|
+
0
|
|
144
|
+
/* INTERNAL */
|
|
145
|
+
), { data: l, loading: s } = w(
|
|
146
|
+
() => K({
|
|
147
|
+
departmentLimit: [],
|
|
148
|
+
hasDeptDock: n === 1
|
|
149
|
+
/* EXTERNAL */
|
|
150
|
+
}),
|
|
151
|
+
{
|
|
152
|
+
refreshDeps: [n]
|
|
153
|
+
}
|
|
154
|
+
), v = T(() => {
|
|
155
|
+
const e = l?.departments || [];
|
|
156
|
+
return e.length > 0 ? j(e) : [];
|
|
157
|
+
}, [l]), b = T(() => {
|
|
158
|
+
const e = l?.label_corp_list || [];
|
|
159
|
+
if (!e.length)
|
|
160
|
+
return [];
|
|
161
|
+
const i = e.filter((c) => c.type === "dockcorp" || c.type === "dockdept" ? !0 : c.parentId === 0 ? !1 : e.some((O) => O.parentId === c.departmentId)), g = i.map((c) => ({
|
|
162
|
+
...c,
|
|
163
|
+
checkable: c.type !== "dockcorpdept" && c.type !== "label",
|
|
164
|
+
icon: /* @__PURE__ */ t(R, { type: c.type, size: 16 })
|
|
165
|
+
}));
|
|
166
|
+
return i.length > 0 ? H(g, {
|
|
167
|
+
parentId: "parentId",
|
|
168
|
+
children: "children",
|
|
169
|
+
value: "_id",
|
|
170
|
+
title: "name"
|
|
171
|
+
}) : [];
|
|
172
|
+
}, [l]), p = {
|
|
173
|
+
0: v,
|
|
174
|
+
1: b
|
|
175
|
+
}, D = C(
|
|
176
|
+
(e) => {
|
|
177
|
+
const i = n === 1 ? l?.label_corp_list : l?.departments;
|
|
178
|
+
if (!i)
|
|
179
|
+
return;
|
|
180
|
+
const g = i.find((c) => c._id === e);
|
|
181
|
+
g && o({
|
|
182
|
+
type: "insertOnly",
|
|
183
|
+
payload: {
|
|
184
|
+
...g
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
[o, l, n]
|
|
189
|
+
), d = C(
|
|
190
|
+
(e, i) => {
|
|
191
|
+
o({
|
|
192
|
+
type: "addOne",
|
|
193
|
+
payload: {
|
|
194
|
+
...i
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
[o]
|
|
199
|
+
), h = (e) => {
|
|
200
|
+
const i = L(e, p[n], {
|
|
201
|
+
children: "children",
|
|
202
|
+
value: "_id"
|
|
203
|
+
});
|
|
204
|
+
i && o({
|
|
205
|
+
type: "deleteOne",
|
|
206
|
+
payload: i._id
|
|
207
|
+
});
|
|
208
|
+
}, m = S.DEPARMENT === a ? D : d, r = l?.label_corp_count || 0;
|
|
209
|
+
return /* @__PURE__ */ y("div", { className: "flex line-height-normal h-full", children: [
|
|
210
|
+
r > 0 && /* @__PURE__ */ t("aside", { className: "basis-[200px] p-1 shrink-0", children: /* @__PURE__ */ t("ul", { className: "flex flex-col", children: x.filter((e) => e.visible).map((e) => /* @__PURE__ */ t(
|
|
211
|
+
"li",
|
|
212
|
+
{
|
|
213
|
+
onClick: () => f(e.key),
|
|
214
|
+
className: k("px-[10px] py-[7px] rounded cursor-pointer text-sm", {
|
|
215
|
+
"bg-[#F0F6FF] text-[#0265ff]": n === e.key,
|
|
216
|
+
"text-black hover:bg-[#f3f3f3]": n !== e.key
|
|
217
|
+
}),
|
|
218
|
+
children: e.label
|
|
219
|
+
},
|
|
220
|
+
e.key
|
|
221
|
+
)) }) }),
|
|
222
|
+
/* @__PURE__ */ t(
|
|
223
|
+
"section",
|
|
224
|
+
{
|
|
225
|
+
className: k("flex-1 border-[#E0E0E0] overflow-hidden", {
|
|
226
|
+
"border-l": r > 0
|
|
227
|
+
}),
|
|
228
|
+
children: /* @__PURE__ */ y(F, { spinning: s, children: [
|
|
229
|
+
n === 0 && /* @__PURE__ */ t(
|
|
230
|
+
P,
|
|
231
|
+
{
|
|
232
|
+
onSelect: m,
|
|
233
|
+
onDeselect: h,
|
|
234
|
+
loading: !0,
|
|
235
|
+
data: p[n]
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
n === 1 && /* @__PURE__ */ t(
|
|
239
|
+
B,
|
|
240
|
+
{
|
|
241
|
+
data: p[n],
|
|
242
|
+
onSelect: m,
|
|
243
|
+
onDeselect: h,
|
|
244
|
+
loading: !0
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
] });
|
|
251
|
+
};
|
|
252
|
+
export {
|
|
253
|
+
$ as O
|
|
254
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { createContext as v, useContext as f, useMemo as p, useCallback as h, useRef as E, useState as A, useEffect as D } from "react";
|
|
2
|
+
import { n as d } from "../vendors/lodash-es.js";
|
|
3
|
+
import { C as S } from "../ConfigProvider/configContext-lDqg07Z3.js";
|
|
4
|
+
import { jsx as o, jsxs as G } from "react/jsx-runtime";
|
|
5
|
+
import { Icon as l } from "bsy-react-ui";
|
|
6
|
+
import { c as N } from "../vendors/clsx.js";
|
|
7
|
+
const I = v({
|
|
8
|
+
type: "user",
|
|
9
|
+
setValue: d,
|
|
10
|
+
dispatch: d,
|
|
11
|
+
containerHeight: 0
|
|
12
|
+
}), tt = () => f(I), et = {
|
|
13
|
+
/**
|
|
14
|
+
* @description 成员单选类型
|
|
15
|
+
*/
|
|
16
|
+
USER: "user",
|
|
17
|
+
/**
|
|
18
|
+
* @description 成员多选类型
|
|
19
|
+
*/
|
|
20
|
+
USER_GROUP: "usergroup",
|
|
21
|
+
/**
|
|
22
|
+
* @description 部门单选类型
|
|
23
|
+
*/
|
|
24
|
+
DEPARMENT: "dept",
|
|
25
|
+
/**
|
|
26
|
+
* @description 部门多选类型
|
|
27
|
+
*/
|
|
28
|
+
DEPARMENT_GROUP: "deptgroup",
|
|
29
|
+
/**
|
|
30
|
+
* @description 部门成员类型
|
|
31
|
+
*/
|
|
32
|
+
DEPT_USERS: "deptusers"
|
|
33
|
+
}, at = 110, nt = 68, rt = 30, ot = 8, ct = 90, M = { loading: "加载中...", cancel: "取消", confirm: "确认", clearAll: "清空所选项", viewAll: "查看全部{count}个", selected: "已选 {selected}/{total}", collapseAll: "收起全部", noAvailable: "没有可选成员", searchPlaceholder: "搜索" }, R = { title: "部门", search: "搜索部门", noAvailable: "没有可选部门", contact: "对接部门", organizationalStructure: "组织架构", currentUserDepartment: "当前用户所处部门", internal: "内部组织", external: "外部组织", externalContactGroup: "对接人小组", externalContactDepartment: "对接部门" }, U = { title: "成员", search: "搜索成员", contact: "对接人", all: "全部成员", allContact: "全部对接人", internal: "内部成员", external: "外部成员", noAvailable: "没有可选成员" }, y = { title: "角色", internal: "内部角色", external: "互联角色" }, P = { title: "职位" }, T = { title: "当前用户" }, $ = { title: "外部联系人", defaultGroup: "默认分组", customGroup: "自定义分组", group: "外部联系人分组", noAvailableGroup: "没有可选分组" }, H = { searchMember: "搜索成员", searchDepartment: "搜索部门" }, b = {
|
|
34
|
+
common: M,
|
|
35
|
+
department: R,
|
|
36
|
+
member: U,
|
|
37
|
+
role: y,
|
|
38
|
+
position: P,
|
|
39
|
+
currentUser: T,
|
|
40
|
+
externalContact: $,
|
|
41
|
+
tabs: H
|
|
42
|
+
}, L = { loading: "Loading...", cancel: "Cancel", confirm: "Confirm", clearAll: "Clear All", viewAll: "View All {count}", selected: "Selected {selected}/{total}", collapseAll: "Collapse All", noAvailable: "No available members", searchPlaceholder: "Search" }, O = { title: "Department", search: "Search Department", noAvailable: "No available departments", contact: "Contact Department", organizationalStructure: "Organizational Structure", currentUserDepartment: "Current User Department", internal: "Internal Organization", external: "External Organization", externalContactGroup: "External Contact Group", externalContactDepartment: "External Contact Department" }, w = { title: "Member", search: "Search Member", contact: "Contact Person", allContact: "All Contact Persons", all: "All Members", internal: "Internal Members", external: "External Members", noAvailable: "No available members" }, k = { title: "Role", internal: "Internal Role", external: "Interconnected Role" }, z = { title: "Position" }, B = { title: "Current User" }, W = { title: "External Contact", defaultGroup: "Default Group", customGroup: "Custom Group", group: "External Contact Group", noAvailableGroup: "No available groups" }, j = { searchMember: "Search Member", searchDepartment: "Search Department" }, V = {
|
|
43
|
+
common: L,
|
|
44
|
+
department: O,
|
|
45
|
+
member: w,
|
|
46
|
+
role: k,
|
|
47
|
+
position: z,
|
|
48
|
+
currentUser: B,
|
|
49
|
+
externalContact: W,
|
|
50
|
+
tabs: j
|
|
51
|
+
}, X = (n, t, e) => {
|
|
52
|
+
const s = t.split(".");
|
|
53
|
+
let a = n;
|
|
54
|
+
try {
|
|
55
|
+
for (const r of s)
|
|
56
|
+
a = a[r];
|
|
57
|
+
return typeof a == "string" ? e ? a.replace(/\{(\w+)\}/g, (r, i) => e[i] !== void 0 ? String(e[i]) : r) : a : t;
|
|
58
|
+
} catch {
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
}, lt = () => {
|
|
62
|
+
const n = f(S), t = p(() => ({ "zh-CN": b, "en-US": V }), []), e = p(() => t[n.locale] || b, [n.locale, t]);
|
|
63
|
+
return {
|
|
64
|
+
t: h(
|
|
65
|
+
(a, r) => X(e, a, r),
|
|
66
|
+
[e]
|
|
67
|
+
)
|
|
68
|
+
};
|
|
69
|
+
}, st = ({ type: n, size: t }) => {
|
|
70
|
+
switch (n) {
|
|
71
|
+
case "label":
|
|
72
|
+
return /* @__PURE__ */ o(l, { name: "Enterpriselabel", className: "text-[#0265ff]", size: t });
|
|
73
|
+
case "dockcorp":
|
|
74
|
+
case "dockcorpdept":
|
|
75
|
+
return /* @__PURE__ */ o(l, { name: "company", className: "text-[#0265ff]", size: t });
|
|
76
|
+
case "dockdept":
|
|
77
|
+
case "member":
|
|
78
|
+
return /* @__PURE__ */ o(l, { name: "dept-one", className: "text-[#0265ff]", size: t });
|
|
79
|
+
case "group":
|
|
80
|
+
return /* @__PURE__ */ o(l, { name: "Outreach", className: "text-[#70c911]", size: t });
|
|
81
|
+
default:
|
|
82
|
+
return /* @__PURE__ */ o(l, { name: "dept-one", className: "text-[#0265ff]", size: t });
|
|
83
|
+
}
|
|
84
|
+
}, q = "_active_1vd3c_15", u = {
|
|
85
|
+
"tabgroup-container": "_tabgroup-container_1vd3c_1",
|
|
86
|
+
"tabgroup-container__tab-item": "_tabgroup-container__tab-item_1vd3c_7",
|
|
87
|
+
active: q,
|
|
88
|
+
"tabgroup-container__indicator": "_tabgroup-container__indicator_1vd3c_18"
|
|
89
|
+
}, it = (n) => {
|
|
90
|
+
const { tabs: t, value: e, onChange: s } = n, a = E(null), [r, i] = A({
|
|
91
|
+
width: 0,
|
|
92
|
+
transform: "translateX(0)"
|
|
93
|
+
}), C = (c) => {
|
|
94
|
+
const m = a.current?.querySelector(`[data-key="${c}"]`);
|
|
95
|
+
if (m) {
|
|
96
|
+
const { width: g, left: x } = m.getBoundingClientRect(), _ = m.parentElement?.parentElement?.getBoundingClientRect().left || 0;
|
|
97
|
+
i({
|
|
98
|
+
width: g,
|
|
99
|
+
transform: `translateX(${x - _}px)`
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return D(() => {
|
|
104
|
+
C(e);
|
|
105
|
+
}, [e]), /* @__PURE__ */ G("div", { className: u["tabgroup-container"], ref: a, children: [
|
|
106
|
+
/* @__PURE__ */ o(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: u["tabgroup-container__indicator"],
|
|
110
|
+
style: {
|
|
111
|
+
width: `${r.width}px`,
|
|
112
|
+
transform: r.transform
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
t.map((c) => /* @__PURE__ */ o(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: N(u["tabgroup-container__tab-item"], {
|
|
120
|
+
[u.active]: e === c.value
|
|
121
|
+
}),
|
|
122
|
+
onClick: () => s(c.value),
|
|
123
|
+
children: /* @__PURE__ */ o("span", { "data-key": c.value, children: c.label })
|
|
124
|
+
},
|
|
125
|
+
c.value
|
|
126
|
+
))
|
|
127
|
+
] });
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
I as D,
|
|
131
|
+
et as E,
|
|
132
|
+
ot as G,
|
|
133
|
+
rt as M,
|
|
134
|
+
ct as P,
|
|
135
|
+
nt as T,
|
|
136
|
+
tt as a,
|
|
137
|
+
st as b,
|
|
138
|
+
at as c,
|
|
139
|
+
it as d,
|
|
140
|
+
lt as u
|
|
141
|
+
};
|