@baishuyun/ui-business 5.1.6 → 5.2.0

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 (28) hide show
  1. package/dist/DeptsMemberSelector/{Department-12ftZfXD.js → Department-H6zGUr4c.js} +5 -5
  2. package/dist/DeptsMemberSelector/{DeptsMemberSelector-BXWGwgUq.js → DeptsMemberSelector-DD3yoWYQ.js} +236 -236
  3. package/dist/DeptsMemberSelector/DeptsUser-41XeJOIY.js +981 -0
  4. package/dist/DeptsMemberSelector/Member-Bit-zWOE.js +517 -0
  5. package/dist/DeptsMemberSelector/MemberPanel-BhuVgJdO.js +510 -0
  6. package/dist/DeptsMemberSelector/OrganizationPanel-CT3v_KVr.js +374 -0
  7. package/dist/DeptsMemberSelector/{TabGroup-Ds7bTbKL.js → TabGroup-Dht9ylk4.js} +13 -13
  8. package/dist/DeptsMemberSelector/index.js +7 -7
  9. package/dist/DeptsMemberSelector/subcomponents/Entity/Department/index.js +3 -3
  10. package/dist/DeptsMemberSelector/subcomponents/Entity/DeptsUser/index.js +4 -4
  11. package/dist/DeptsMemberSelector/subcomponents/Entity/Member/index.js +3 -3
  12. package/dist/DeptsMemberSelector/utils/index.js +11 -2
  13. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +1 -1
  14. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersExtraContactPanel/DeptUsersExtraContactPanel.d.ts +2 -0
  15. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersExtraContactPanel/useDeptUsersExtraContactPanelData.d.ts +40 -0
  16. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/useDeptUsersRolePanelData.d.ts +1 -1
  17. package/dist/components/DeptsMemberSelector/utils/departmentStatus.d.ts +3 -0
  18. package/dist/index.css +1 -1
  19. package/dist/index.js +7 -7
  20. package/dist/lang/en-US.json.d.ts +2 -0
  21. package/dist/lang/zh-CN.json.d.ts +2 -0
  22. package/dist/lang/zh-TW.json.d.ts +71 -0
  23. package/dist/vendors/useLocale.js +75 -7
  24. package/package.json +3 -3
  25. package/dist/DeptsMemberSelector/DeptsUser-C8hYQ6z-.js +0 -790
  26. package/dist/DeptsMemberSelector/ExtraConcactPanel-BDNrz5rV.js +0 -647
  27. package/dist/DeptsMemberSelector/Member-B4tEHksu.js +0 -375
  28. package/dist/DeptsMemberSelector/OrganizationPanel-DoM4UNxv.js +0 -374
@@ -1,647 +0,0 @@
1
- import { t as e } from "../vendors/simplebar-react.js";
2
- import { t } from "../vendors/clsx.js";
3
- import { c as n, o as r, t as i } from "./useDeptsMemberSelector-t7b8yu-A.js";
4
- import { a, g as o, h as s, i as c, m as l, n as u, p as d, r as f, t as p } from "./services/contact/selector.service-CY5vQea8.js";
5
- import { n as m, r as h, t as g } from "./TabGroup-Ds7bTbKL.js";
6
- import { t as _ } from "../vendors/useLocale.js";
7
- import { buildDeptTree as v, buildTree as y, findNodeInTree as b, getColorByName as x, getMemberDisplayName as S } from "./utils/index.js";
8
- import { useMemo as C, useRef as w, useState as T } from "react";
9
- import { Avatar as E, Radio as D, Spin as O } from "antd";
10
- import { Checkbox as k, Icon as A, Tree as j } from "@baishuyun/ui-base";
11
- import { useRequest as M } from "ahooks";
12
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
13
- import { produce as I } from "immer";
14
- //#region src/components/DeptsMemberSelector/subcomponents/Entity/Member/MemerList/MemerList.module.scss
15
- var L = {
16
- "memer-list__option": "_memer-list__option_1txby_1",
17
- "memer-list__option--checkbox": "_memer-list__option--checkbox_1txby_9",
18
- "memer-list__option-inner": "_memer-list__option-inner_1txby_12",
19
- "memer-list__row": "_memer-list__row_1txby_15",
20
- "memer-list__name": "_memer-list__name_1txby_20",
21
- "memer-list__checkbox-row": "_memer-list__checkbox-row_1txby_27",
22
- "memer-list__selected-summary": "_memer-list__selected-summary_1txby_35",
23
- "memer-list__radio": "_memer-list__radio_1txby_40",
24
- "memer-list__checkbox": "_memer-list__checkbox_1txby_27",
25
- "memer-list__group": "_memer-list__group_1txby_46",
26
- "memer-list": "_memer-list_1txby_1"
27
- }, R = (e) => {
28
- let { list: n, showCheckAll: r = !0 } = e, { t: a } = _(), { value: o, type: s, dispatch: c } = i(), l = s === h.USER, u = s === h.USER_GROUP || s === h.DEPT_USERS, d = o?.[0]?._id, f = (e) => {
29
- let t = n?.find((t) => t._id === e.target.value);
30
- t && c({
31
- type: "insertOnly",
32
- payload: { ...t }
33
- });
34
- }, p = (e) => {
35
- c({
36
- type: "deleteOne",
37
- payload: e
38
- });
39
- }, m = o?.map((e) => e._id) || [], g = n.filter((e) => m.includes(e._id)).length;
40
- return /* @__PURE__ */ P("div", {
41
- className: L["memer-list"],
42
- children: /* @__PURE__ */ F("ul", {
43
- className: L["memer-list__list"],
44
- children: [l && /* @__PURE__ */ P(D.Group, {
45
- value: d,
46
- onChange: f,
47
- className: L["memer-list__group"],
48
- prefixCls: "ant-radio",
49
- children: n.map((t) => {
50
- let n = S(t), r = x(n);
51
- return /* @__PURE__ */ P("li", {
52
- className: L["memer-list__option"],
53
- children: /* @__PURE__ */ P(D, {
54
- value: t._id,
55
- className: L["memer-list__radio"],
56
- onClick: (e) => {
57
- p(e.target?.value);
58
- },
59
- children: /* @__PURE__ */ F("div", {
60
- className: L["memer-list__row"],
61
- children: [
62
- t.avatarurl ? /* @__PURE__ */ P(E, {
63
- src: t.avatarurl,
64
- size: 20,
65
- style: { flexShrink: 0 }
66
- }) : /* @__PURE__ */ P(E, {
67
- style: {
68
- backgroundColor: r,
69
- fontSize: "12px",
70
- lineHeight: "13px",
71
- width: "20px",
72
- height: "20px",
73
- flexShrink: 0
74
- },
75
- children: n.charAt(0)
76
- }),
77
- /* @__PURE__ */ P("span", {
78
- className: L["memer-list__name"],
79
- children: n
80
- }),
81
- e.badge && e.badge(t)
82
- ]
83
- })
84
- })
85
- }, t._id);
86
- })
87
- }), u && /* @__PURE__ */ F(N, { children: [r && /* @__PURE__ */ P("li", {
88
- className: t(L["memer-list__option"], L["memer-list__option--checkbox"]),
89
- children: /* @__PURE__ */ P(k, {
90
- labelPosition: "left",
91
- checked: g === n.length,
92
- indeterminate: g > 0 && g < n.length,
93
- className: L["memer-list__checkbox"],
94
- onChange: () => {
95
- g === n.length ? c({
96
- type: "removeMany",
97
- payload: n.map((e) => e._id)
98
- }) : c({
99
- type: "addMany",
100
- payload: n.map((e) => ({ ...e }))
101
- });
102
- },
103
- children: /* @__PURE__ */ P("div", {
104
- className: L["memer-list__selected-summary"],
105
- children: /* @__PURE__ */ P("span", { children: a("common.selected", {
106
- selected: g,
107
- total: n.length
108
- }) })
109
- })
110
- })
111
- }), /* @__PURE__ */ P(k.Group, {
112
- value: m,
113
- onChange: (e) => {
114
- let t = [], r = [];
115
- for (let i = 0; i < n.length; i++) {
116
- let a = n[i];
117
- e.includes(a._id) ? t.push(a) : r.push(a);
118
- }
119
- c({
120
- type: "deleteAndInsert",
121
- payload: {
122
- oldIds: r.map((e) => e._id),
123
- newItems: t
124
- }
125
- });
126
- },
127
- className: L["memer-list__group"],
128
- children: n.map((n) => {
129
- let r = S(n), i = x(r);
130
- return /* @__PURE__ */ P("li", {
131
- className: t(L["memer-list__option"], L["memer-list__option--checkbox"]),
132
- children: /* @__PURE__ */ P(k, {
133
- labelPosition: "left",
134
- value: n._id,
135
- className: L["memer-list__checkbox"],
136
- children: /* @__PURE__ */ F("div", {
137
- className: L["memer-list__checkbox-row"],
138
- children: [
139
- n.avatarurl ? /* @__PURE__ */ P(E, {
140
- src: n.avatarurl,
141
- size: 20,
142
- style: { flexShrink: 0 }
143
- }) : /* @__PURE__ */ P(E, {
144
- style: {
145
- backgroundColor: i,
146
- fontSize: "12px",
147
- lineHeight: "13px",
148
- width: "20px",
149
- height: "20px",
150
- flexShrink: 0
151
- },
152
- children: r.charAt(0)
153
- }),
154
- /* @__PURE__ */ P("span", {
155
- className: L["memer-list__name"],
156
- children: r
157
- }),
158
- e.badge && e.badge(n)
159
- ]
160
- })
161
- })
162
- }, n._id);
163
- })
164
- })] })]
165
- })
166
- });
167
- }, z = {
168
- "bsy-external-member__all-option": "_bsy-external-member__all-option_1jd7j_1",
169
- "bsy-external-member__all-option--selected": "_bsy-external-member__all-option--selected_1jd7j_13",
170
- "bsy-external-member__icon": "_bsy-external-member__icon_1jd7j_20",
171
- "bsy-external-member__switcher-icon": "_bsy-external-member__switcher-icon_1jd7j_24",
172
- "bsy-external-member__switcher-icon--expanded": "_bsy-external-member__switcher-icon--expanded_1jd7j_29",
173
- "bsy-external-member__content": "_bsy-external-member__content_1jd7j_32"
174
- }, B = {
175
- "bsy-all-member__all-option": "_bsy-all-member__all-option_8jfkj_1",
176
- "bsy-all-member__all-option--selected": "_bsy-all-member__all-option--selected_8jfkj_14"
177
- }, V = (e) => {
178
- let { t: n } = _();
179
- return /* @__PURE__ */ F("div", {
180
- className: t(B["bsy-all-member__all-option"], { [B["bsy-all-member__all-option--selected"]]: e.selected }),
181
- onClick: () => e.onSelect(!e.selected),
182
- children: [/* @__PURE__ */ P("div", {
183
- className: B["bsy-all-member__all-option-icon"],
184
- children: e.icon ? e.icon : /* @__PURE__ */ P("svg", {
185
- width: "20",
186
- height: "20",
187
- viewBox: "0 0 20 20",
188
- fill: "none",
189
- xmlns: "http://www.w3.org/2000/svg",
190
- children: /* @__PURE__ */ P("path", {
191
- d: "M10 1.25C12.3206 1.25 14.5462 2.17187 16.1872 3.81282C17.8281 5.45376 18.75 7.67936 18.75 10C18.75 12.3206 17.8281 14.5462 16.1872 16.1872C14.5462 17.8281 12.3206 18.75 10 18.75C7.67936 18.75 5.45376 17.8281 3.81282 16.1872C2.17187 14.5462 1.25 12.3206 1.25 10C1.25 7.67936 2.17187 5.45376 3.81282 3.81282C5.45376 2.17187 7.67936 1.25 10 1.25ZM9.4325 5H9.325L9.1125 5.00875C7.60875 5.13 7.165 6.5525 7.165 7.37875C7.13187 7.91241 7.22744 8.44621 7.44367 8.93523C7.6599 9.42424 7.99045 9.85415 8.4075 10.1888C8.52 10.3263 8.57625 10.4987 8.5675 10.675C8.53114 10.7896 8.45307 10.8864 8.34875 10.9462C7.645 11.48 5.14875 12.0837 4.99875 13.2712C4.8925 13.7575 4.13625 14.5675 6.59875 14.8713C7.54875 14.9963 8.50625 15.0487 9.4625 15.0325C15.1913 15.0325 14.0013 13.895 13.8412 13.2512L13.7887 13.0675C13.385 12.0588 11.2987 11.505 10.5062 11.0112L10.3837 10.9275L10.39 10.94L10.35 10.86C10.3352 10.8247 10.3231 10.7884 10.3138 10.7512L10.295 10.6375C10.284 10.4912 10.3023 10.3442 10.3488 10.205C10.3488 10.205 11.5912 9.5125 11.5912 7.37875C11.5375 6.515 11.0588 5 9.4325 5ZM12.9838 6.13125H12.785C12.5898 6.14356 12.3995 6.19815 12.2275 6.29125C12.4987 7.26125 12.8775 8.995 11.4163 10.125C10.8825 10.9363 12.7125 11.475 12.4462 11.315C14.1213 12.0725 14.6062 12.665 14.7175 13.2613C14.8238 13.7463 14.8775 14.0725 14.8775 14.0725C15.4241 13.9831 15.9602 13.8382 16.4775 13.64C16.512 13.3512 16.4937 13.0585 16.4237 12.7762L16.44 12.7863L16.4025 12.6213C16.11 11.765 14.355 11.355 13.8488 10.8938C13.7898 10.8138 13.7528 10.7199 13.7413 10.6213C13.7413 10.3488 13.795 10.2963 13.795 10.2963C14.1359 10.0305 14.4038 9.68268 14.5737 9.28524C14.7435 8.8878 14.8098 8.45377 14.7662 8.02375C14.7125 7.32 14.3337 6.13125 12.9838 6.13125ZM5.9225 6.14125H5.87L5.69 6.155C5.24076 6.2117 4.83017 6.43794 4.54227 6.78743C4.25436 7.13691 4.1109 7.58321 4.14125 8.035C4.08125 8.90375 4.44125 9.75 5.1125 10.3062C5.15324 10.4096 5.17156 10.5203 5.16625 10.6313C5.15471 10.7299 5.11766 10.8238 5.05875 10.9037C4.52625 11.3362 2.68 11.8212 2.52125 12.7975C2.49421 13.0668 2.49421 13.3382 2.52125 13.6075C2.93375 13.8025 3.36875 13.9475 3.81625 14.04C3.81625 14.04 3.87 13.7675 3.97625 13.39C4.03 12.8562 4.84 11.875 6.84 11.1125L6.97 11.0675C7.05625 11.035 7.13875 10.9963 7.22 10.9525C7.4375 10.7925 7.65125 10.52 7.22 10.1412C5.81625 8.0875 6.30125 6.73875 6.515 6.2475C6.32423 6.18149 6.12432 6.14564 5.9225 6.14125Z",
192
- fill: "#0265FF"
193
- })
194
- })
195
- }), /* @__PURE__ */ P("span", { children: e.title || n("member.all") })]
196
- });
197
- }, H = /* @__PURE__ */ function(e) {
198
- return e.DOCK_PERSON_GROUP = "dockcorp", e.DOCK_DEPARTMENT = "dockcorpdept", e;
199
- }(H || {}), U = (n) => {
200
- let { loading: r = !1 } = n, { containerHeight: a } = i(), { t: o } = _(), s = [{
201
- label: o("member.contact"),
202
- value: H.DOCK_PERSON_GROUP
203
- }, {
204
- label: o("department.title"),
205
- value: H.DOCK_DEPARTMENT
206
- }], [c, l] = T(H.DOCK_PERSON_GROUP), u = (e, t) => {
207
- let n = [];
208
- for (let r of e) if (r.type === t) if (t === "dockcorpdept") n.push({
209
- ...r,
210
- children: r.children
211
- });
212
- else {
213
- let e = r.children ? u(r.children, t) : [];
214
- n.push({
215
- ...r,
216
- children: e.length > 0 ? e : void 0
217
- });
218
- }
219
- else {
220
- let e = r.children ? u(r.children, t) : [];
221
- e.length > 0 && n.push({
222
- ...r,
223
- children: e
224
- });
225
- }
226
- return n;
227
- }, d = u(n.data, c), f = d?.map((e) => e.departmentId);
228
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
229
- tabs: s,
230
- value: c,
231
- onChange: l
232
- }), /* @__PURE__ */ P(e, {
233
- style: { height: a - 34 },
234
- classNames: { contentEl: z["bsy-external-member__content"] },
235
- children: /* @__PURE__ */ F("div", {
236
- className: z["bsy-external-member__content"],
237
- children: [/* @__PURE__ */ P(V, {
238
- title: c === H.DOCK_PERSON_GROUP ? o("member.allContact") : void 0,
239
- selected: n.selectLevel === n.unique_all,
240
- onSelect: () => n.onSelect(n.unique_all),
241
- icon: /* @__PURE__ */ P(A, {
242
- name: "contactperson",
243
- size: 20,
244
- color: "#6f829e"
245
- })
246
- }), d.length > 0 && !r && /* @__PURE__ */ P(j, {
247
- data: d,
248
- fieldNames: {
249
- title: "name",
250
- value: "departmentId",
251
- children: "children"
252
- },
253
- selectedKeys: n.selectLevel ? [n.selectLevel] : [],
254
- onSelect: (e) => n.onSelect(e),
255
- parentCheckable: !0,
256
- defaultExpandedKeys: f.length === 1 ? f : [],
257
- icon: () => /* @__PURE__ */ P(A, {
258
- name: "dept-one",
259
- className: z["bsy-external-member__icon"]
260
- }),
261
- switcherIcon: (e) => /* @__PURE__ */ P(A, {
262
- name: "xiangxiazhankai-11",
263
- className: t(z["bsy-external-member__switcher-icon"], { [z["bsy-external-member__switcher-icon--expanded"]]: e })
264
- })
265
- })]
266
- })
267
- }, d.length)] });
268
- }, W = {
269
- "internal-member__content": "_internal-member__content_1aszs_1",
270
- "internal-member__icon": "_internal-member__icon_1aszs_4",
271
- "internal-member__switcher": "_internal-member__switcher_1aszs_8",
272
- "internal-member__switcher--expanded": "_internal-member__switcher--expanded_1aszs_13"
273
- }, G = (n) => {
274
- let { loading: r, onSelect: a, unique_all: o, selectLevel: s } = n, { containerHeight: c } = i(), l = n.data?.map((e) => e.departmentId);
275
- return /* @__PURE__ */ F(e, {
276
- style: {
277
- height: c - 8,
278
- padding: "4px"
279
- },
280
- classNames: { contentEl: W["internal-member__content"] },
281
- children: [/* @__PURE__ */ P(V, {
282
- selected: s === o,
283
- onSelect: () => a(o)
284
- }), n.data.length > 0 && !r && /* @__PURE__ */ P(j, {
285
- data: n.data,
286
- fieldNames: {
287
- title: "name",
288
- value: "departmentId",
289
- children: "children"
290
- },
291
- selectedKeys: n.selectLevel ? [n.selectLevel] : [],
292
- onSelect: (e) => n.onSelect(e),
293
- parentCheckable: !0,
294
- defaultExpandedKeys: l.length === 1 ? l : [],
295
- icon: () => /* @__PURE__ */ P(A, {
296
- name: "dept-one",
297
- className: W["internal-member__icon"],
298
- size: 16
299
- }),
300
- switcherIcon: (e) => /* @__PURE__ */ P(A, {
301
- name: "xiangxiazhankai-11",
302
- className: t(W["internal-member__switcher"], { [W["internal-member__switcher--expanded"]]: e })
303
- })
304
- })]
305
- });
306
- }, K = {
307
- "member-panel": "_member-panel_1lhyj_1",
308
- "member-panel__overlay-empty": "_member-panel__overlay-empty_1lhyj_6",
309
- "member-panel__sidebar": "_member-panel__sidebar_1lhyj_13",
310
- "member-panel__menu": "_member-panel__menu_1lhyj_18",
311
- "member-panel__menu-item": "_member-panel__menu-item_1lhyj_23",
312
- "member-panel__menu-item--active": "_member-panel__menu-item--active_1lhyj_34",
313
- "member-panel__panel": "_member-panel__panel_1lhyj_38",
314
- "member-panel__panel--list": "_member-panel__panel--list_1lhyj_42",
315
- "member-panel__list-wrapper": "_member-panel__list-wrapper_1lhyj_45",
316
- "member-panel__empty": "_member-panel__empty_1lhyj_48",
317
- "member-panel__empty-text": "_member-panel__empty-text_1lhyj_55"
318
- }, q = Symbol("all key"), J = () => {
319
- let e = i(), { containerHeight: t, type: a, requestContext: o, limits: s } = e, c = e.memberPanelRequestGuard ?? r, { t: h } = _(), [g, x] = T([{
320
- key: "internal",
321
- label: h("member.internal"),
322
- visible: !1
323
- }, {
324
- key: "external",
325
- label: h("member.external"),
326
- visible: !1
327
- }]), S = w(!0), E = w({
328
- internal: !1,
329
- external: !1
330
- }), D = w(), [O, k] = T("internal"), [A, j] = T(q), N = JSON.stringify({
331
- type: a,
332
- requestContext: o,
333
- limits: s,
334
- memberPanelRequestGuardEnabled: c.enabled
335
- });
336
- D.current !== N && (D.current = N, S.current = !0, E.current = {
337
- internal: !1,
338
- external: !1
339
- });
340
- let F = (e) => {
341
- k(e), j(q);
342
- }, { data: L, loading: R } = M(async () => a !== "deptusers" && !c.enabled ? {
343
- departments: [],
344
- departments_count: 0,
345
- label_corp_list: [],
346
- label_corp_count: 0
347
- } : a === "deptusers" ? u({
348
- requestContext: o,
349
- hasDeptDock: O === "external"
350
- }) : d({
351
- requestContext: o,
352
- limits: s,
353
- hasDeptDock: O === "external"
354
- }), {
355
- refreshDeps: [
356
- O,
357
- a,
358
- o,
359
- s,
360
- c.enabled
361
- ],
362
- onSuccess: (e) => {
363
- if (!e) return;
364
- let t = e.departments_count > 0, n = e.label_corp_count > 0, r = {
365
- internal: E.current.internal || t,
366
- external: E.current.external || n
367
- };
368
- E.current = r, x(I((e) => {
369
- e[0].visible = r.internal, e[1].visible = r.external;
370
- })), S.current && (S.current = !1, (t || n) && k(t ? "internal" : "external"));
371
- }
372
- }), z = C(() => {
373
- if (!L) return {
374
- internal: [],
375
- external: []
376
- };
377
- let e = v(L.departments || []), t = (e) => e.filter((e) => (e.children &&= t(e.children), !((e.type === "label" || e.type === "dockcorpdept") && (!e.children || e.children.length === 0)))).map((e) => ({
378
- ...e,
379
- checkable: e.type !== "label" && e.type !== "dockcorpdept",
380
- icon: /* @__PURE__ */ P(m, {
381
- type: e.type,
382
- size: 16
383
- })
384
- })), n = L.label_corp_list || [], r = n.length ? y(n, {
385
- value: "departmentId",
386
- children: "children",
387
- parentId: "parentId"
388
- }) : [];
389
- return {
390
- internal: e,
391
- external: t(r.length === 1 && r[0]?.type === "label" ? r[0].children || [] : r)
392
- };
393
- }, [L]), B = O === "internal" ? z.internal : z.external, V = C(() => {
394
- if (!(O !== "external" || A === q)) return b(A, z.external, {
395
- title: "name",
396
- parentId: "parentId",
397
- value: "_id",
398
- children: "children"
399
- })?.owner_corpid;
400
- }, [
401
- O,
402
- A,
403
- z.external
404
- ]), { data: H, loading: U } = M(async () => {
405
- if (!O || a !== "deptusers" && !c.enabled) return [];
406
- if (a === "deptusers") return (await f({
407
- requestContext: o,
408
- deptId: A === q ? "" : A,
409
- limit: 1e4
410
- })).users || [];
411
- let e = await l({
412
- requestContext: o,
413
- limits: s,
414
- departmentId: A === q ? null : A,
415
- limit: p,
416
- hasDeptDock: O === "external",
417
- currentCorpId: V
418
- });
419
- return O === "external" ? e.dock_user_list || [] : e.users || [];
420
- }, { refreshDeps: [[
421
- a,
422
- O,
423
- String(A),
424
- V || "",
425
- o?.appId || "",
426
- o?.entryId || ""
427
- ].join(":"), c.enabled] });
428
- return {
429
- containerHeight: t,
430
- menuItems: g,
431
- activeKey: O,
432
- setActiveKey: F,
433
- selectKey: A,
434
- setSelectKey: j,
435
- uniqueAllKey: q,
436
- treeData: z,
437
- currentTreeData: B,
438
- userList: H || [],
439
- loading: R,
440
- memberLoading: U,
441
- showUnavailableOverlay: c.reason === n.LIMIT_WIDGET_EMPTY_ARRAY
442
- };
443
- }, Y = () => {
444
- let { t: n } = _(), r = J(), i = r.userList;
445
- return r.showUnavailableOverlay ? /* @__PURE__ */ P("div", {
446
- className: K["member-panel"],
447
- children: /* @__PURE__ */ P("div", {
448
- className: K["member-panel__overlay-empty"],
449
- children: /* @__PURE__ */ P("span", {
450
- className: K["member-panel__empty-text"],
451
- children: n("member.noAvailable")
452
- })
453
- })
454
- }) : /* @__PURE__ */ F("div", {
455
- className: K["member-panel"],
456
- children: [
457
- /* @__PURE__ */ P("aside", {
458
- className: K["member-panel__sidebar"],
459
- children: /* @__PURE__ */ P("ul", {
460
- className: K["member-panel__menu"],
461
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ P("li", {
462
- onClick: () => {
463
- r.setActiveKey(e.key);
464
- },
465
- className: t(K["member-panel__menu-item"], { [K["member-panel__menu-item--active"]]: r.activeKey === e.key }),
466
- children: e.label
467
- }, e.key))
468
- })
469
- }),
470
- /* @__PURE__ */ P("section", {
471
- className: K["member-panel__panel"],
472
- children: /* @__PURE__ */ F(O, {
473
- spinning: r.loading,
474
- children: [r.activeKey === "internal" && /* @__PURE__ */ P(G, {
475
- unique_all: r.uniqueAllKey,
476
- selectLevel: r.selectKey,
477
- onSelect: r.setSelectKey,
478
- data: r.currentTreeData
479
- }), r.activeKey === "external" && /* @__PURE__ */ P(U, {
480
- unique_all: r.uniqueAllKey,
481
- selectLevel: r.selectKey,
482
- onSelect: r.setSelectKey,
483
- data: r.currentTreeData
484
- })]
485
- })
486
- }),
487
- /* @__PURE__ */ F("section", {
488
- className: t(K["member-panel__panel"], K["member-panel__panel--list"]),
489
- children: [/* @__PURE__ */ P(O, {
490
- spinning: r.memberLoading,
491
- children: /* @__PURE__ */ P(e, {
492
- style: { height: r.containerHeight - 8 },
493
- children: i.length > 0 && /* @__PURE__ */ P("div", {
494
- className: K["member-panel__list-wrapper"],
495
- children: /* @__PURE__ */ P(R, { list: i })
496
- })
497
- })
498
- }), i.length === 0 && !r.memberLoading && /* @__PURE__ */ P("div", {
499
- className: K["member-panel__empty"],
500
- children: /* @__PURE__ */ P("span", {
501
- className: K["member-panel__empty-text"],
502
- children: n("member.noAvailable")
503
- })
504
- })]
505
- })
506
- ]
507
- });
508
- }, X = {
509
- "extra-contact-panel": "_extra-contact-panel_4tyr0_1",
510
- "extra-contact-panel__menu": "_extra-contact-panel__menu_4tyr0_6",
511
- "extra-contact-panel__menu-list": "_extra-contact-panel__menu-list_4tyr0_10",
512
- "extra-contact-panel__menu-item": "_extra-contact-panel__menu-item_4tyr0_14",
513
- "extra-contact-panel__menu-item--active": "_extra-contact-panel__menu-item--active_4tyr0_26",
514
- "extra-contact-panel__groups": "_extra-contact-panel__groups_4tyr0_33",
515
- "extra-contact-panel__groups--expanded": "_extra-contact-panel__groups--expanded_4tyr0_37",
516
- "extra-contact-panel__groups--collapsed": "_extra-contact-panel__groups--collapsed_4tyr0_42",
517
- "extra-contact-panel__group-list": "_extra-contact-panel__group-list_4tyr0_46",
518
- "extra-contact-panel__group-item": "_extra-contact-panel__group-item_4tyr0_50",
519
- "extra-contact-panel__group-item--active": "_extra-contact-panel__group-item--active_4tyr0_61",
520
- "extra-contact-panel__members": "_extra-contact-panel__members_4tyr0_68",
521
- "extra-contact-panel__empty": "_extra-contact-panel__empty_4tyr0_74",
522
- "extra-contact-panel__empty-text": "_extra-contact-panel__empty-text_4tyr0_83"
523
- }, Z = () => {
524
- let { containerHeight: e, type: t, requestContext: n, limits: r } = i(), { t: l } = _(), [u] = T([{
525
- key: "default",
526
- label: l("externalContact.defaultGroup"),
527
- visible: !0
528
- }, {
529
- key: "custom",
530
- label: l("externalContact.customGroup"),
531
- visible: !0
532
- }]), [d, f] = T("default"), [p, m] = T(), g = (e) => {
533
- f(e), e === "default" && m(void 0);
534
- }, { data: v, loading: y } = M(() => t === h.DEPT_USERS ? c({ requestContext: n }) : s({
535
- requestContext: n,
536
- limits: r
537
- }), {
538
- refreshDeps: [
539
- d,
540
- t,
541
- n,
542
- r
543
- ],
544
- onSuccess: (e) => {
545
- e && (d === "custom" && m(e.list.filter((e) => e.type !== "1")[0]?._id), d === "default" && m(e.list.filter((e) => e.type === "1")[0]?._id));
546
- }
547
- }), { data: b, loading: x } = M(async () => p ? t === h.DEPT_USERS ? (await a({
548
- requestContext: n,
549
- groupId: p,
550
- limit: 1e4
551
- })).list || [] : (await o({
552
- requestContext: n,
553
- groupId: p,
554
- groupLimit: r?.groupLimit || [],
555
- memberLimit: r?.memberLimit || [],
556
- limit: 1e4
557
- })).list || [] : [], { refreshDeps: [
558
- t,
559
- d,
560
- p,
561
- n
562
- ] });
563
- return {
564
- containerHeight: e,
565
- menuItems: u,
566
- activeKey: d,
567
- setActiveKey: g,
568
- groupId: p,
569
- setGroupId: m,
570
- groupList: d === "custom" && v?.list?.filter((e) => e.type !== "1") || [],
571
- memberList: b || [],
572
- groupListLoading: y,
573
- memberLoading: x
574
- };
575
- }, Q = () => {
576
- let { t: n } = _(), r = Z(), i = r.memberList;
577
- return /* @__PURE__ */ F("div", {
578
- className: X["extra-contact-panel"],
579
- children: [
580
- /* @__PURE__ */ P("aside", {
581
- className: X["extra-contact-panel__menu"],
582
- children: /* @__PURE__ */ P("ul", {
583
- className: X["extra-contact-panel__menu-list"],
584
- children: r.menuItems.filter((e) => e.visible).map((e) => /* @__PURE__ */ P("li", {
585
- onClick: () => {
586
- e.key !== r.activeKey && r.setActiveKey(e.key);
587
- },
588
- className: t(X["extra-contact-panel__menu-item"], { [X["extra-contact-panel__menu-item--active"]]: r.activeKey === e.key }),
589
- children: e.label
590
- }, e.key))
591
- })
592
- }),
593
- /* @__PURE__ */ P("section", {
594
- className: t(X["extra-contact-panel__groups"], {
595
- [X["extra-contact-panel__groups--expanded"]]: r.activeKey === "custom",
596
- [X["extra-contact-panel__groups--collapsed"]]: r.activeKey === "default"
597
- }),
598
- children: /* @__PURE__ */ P(O, {
599
- spinning: r.groupListLoading && r.activeKey === "custom",
600
- tip: n("common.loading"),
601
- children: /* @__PURE__ */ P(e, {
602
- style: {
603
- height: r.containerHeight - 8,
604
- padding: "4px"
605
- },
606
- children: /* @__PURE__ */ F("ul", {
607
- className: X["extra-contact-panel__group-list"],
608
- children: [r.groupList.map((e) => /* @__PURE__ */ P("li", {
609
- onClick: () => r.setGroupId(e._id),
610
- className: t(X["extra-contact-panel__group-item"], { [X["extra-contact-panel__group-item--active"]]: r.groupId === e._id }),
611
- children: e.name
612
- }, e._id)), r.groupList.length === 0 && !r.groupListLoading && /* @__PURE__ */ P("div", {
613
- className: X["extra-contact-panel__empty"],
614
- children: /* @__PURE__ */ P("span", {
615
- className: X["extra-contact-panel__empty-text"],
616
- children: n("externalContact.noAvailableGroup")
617
- })
618
- })]
619
- })
620
- })
621
- })
622
- }),
623
- /* @__PURE__ */ F("section", {
624
- className: X["extra-contact-panel__members"],
625
- children: [/* @__PURE__ */ P(O, {
626
- spinning: r.memberLoading || r.groupListLoading,
627
- tip: n("common.loading"),
628
- children: /* @__PURE__ */ P(e, {
629
- style: {
630
- height: r.containerHeight - 8,
631
- padding: "4px"
632
- },
633
- children: i.length > 0 && /* @__PURE__ */ P(R, { list: i })
634
- })
635
- }), i.length === 0 && !r.memberLoading && !r.groupListLoading && /* @__PURE__ */ P("div", {
636
- className: X["extra-contact-panel__empty"],
637
- children: /* @__PURE__ */ P("span", {
638
- className: X["extra-contact-panel__empty-text"],
639
- children: n("member.noAvailable")
640
- })
641
- })]
642
- })
643
- ]
644
- });
645
- };
646
- //#endregion
647
- export { Y as n, R as r, Q as t };