@baishuyun/ui-business 6.1.1 → 6.2.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.
Files changed (74) hide show
  1. package/dist/BubbleChart/{AutoGridEChart-VA8BTIj4.js → AutoGridEChart-C8txdGdG.js} +17 -17
  2. package/dist/BubbleChart/{BubbleChart-CGLJJHYy.js → BubbleChart-rOdQW7mB.js} +54 -16
  3. package/dist/BubbleChart/index.js +2 -2
  4. package/dist/DeptsMemberSelector/{CorpDeptTree-Bd9vQiyE.js → CorpDeptTree-B4EEUTqQ.js} +1 -1
  5. package/dist/DeptsMemberSelector/{CorpFlatList-AoU46OJa.js → CorpFlatList-Cn8-KRFi.js} +2 -2
  6. package/dist/DeptsMemberSelector/CorpLabelTree-iQ_7Ux_J.js +212 -0
  7. package/dist/DeptsMemberSelector/{Department-Buo6RYwS.js → Department-DXD3xoiS.js} +4 -4
  8. package/dist/DeptsMemberSelector/DeptsMemberSelector-DXpd9aCn.js +1935 -0
  9. package/dist/DeptsMemberSelector/{DeptsUser-0XtIImLw.js → DeptsUser-DO-SQexg.js} +146 -126
  10. package/dist/DeptsMemberSelector/{EnterpriseLabelList-Dik3GxJY.js → EnterpriseLabelList-BtB8AjXO.js} +2 -2
  11. package/dist/DeptsMemberSelector/{Member-B0yVNXTb.js → Member-BrNFIHZy.js} +22 -22
  12. package/dist/DeptsMemberSelector/OrganizationPanel-hray3UWA.js +671 -0
  13. package/dist/DeptsMemberSelector/{RelationShipList-CpNKR298.js → RelationShipList-DcgaMOyr.js} +1 -1
  14. package/dist/DeptsMemberSelector/{TagIcon-CgEG5XAx.js → TagIcon-CYklI9Ar.js} +40 -40
  15. package/dist/DeptsMemberSelector/{filterLabelCorpFlatNodes-COzZgZE5.js → filterLabelCorpFlatNodes-BrRZqDkm.js} +1 -1
  16. package/dist/DeptsMemberSelector/index.js +15 -15
  17. package/dist/DeptsMemberSelector/services/contact/{selector.service-dmS_qeZo.js → selector.service-CQopqiTw.js} +3 -1
  18. package/dist/DeptsMemberSelector/subcomponents/Entity/Department/index.js +6 -6
  19. package/dist/DeptsMemberSelector/subcomponents/Entity/DeptsUser/index.js +12 -12
  20. package/dist/DeptsMemberSelector/subcomponents/Entity/Member/index.js +5 -5
  21. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpDeptPanel/CorpDeptTree/index.js +2 -2
  22. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/CorpFlatList/index.js +3 -3
  23. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/CorpLabelTree/index.js +5 -5
  24. package/dist/DeptsMemberSelector/subcomponents/Panels/DeptUsersEnterpriseLabelPanel/EnterpriseLabelList/index.js +3 -3
  25. package/dist/DeptsMemberSelector/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +2 -2
  26. package/dist/DeptsMemberSelector/{useDeptsMemberSelector-CiImbq5E.js → useDeptsMemberSelector-B6XZHqd5.js} +2 -3
  27. package/dist/DeptsMemberSelector/useFilteredMemberList-BE7jRCME.js +807 -0
  28. package/dist/DeptsMemberSelector/{useTreeExpandedKeys-BlOuNYZ2.js → useTreeExpandedKeys-oLUTUYkP.js} +13 -13
  29. package/dist/Scatterplot/{Scatterplot-R66_f3TZ.js → Scatterplot-NVg5vMAZ.js} +57 -15
  30. package/dist/Scatterplot/index.js +2 -2
  31. package/dist/components/BubbleChart/AutoGridEChart.d.ts +1 -0
  32. package/dist/components/BubbleChart/BubbleChart.type.d.ts +1 -0
  33. package/dist/components/DeptsMemberSelector/context/DeptsMemberContext.d.ts +3 -5
  34. package/dist/components/DeptsMemberSelector/hooks/useDeptsMemberSelector.d.ts +1 -2
  35. package/dist/components/DeptsMemberSelector/hooks/useFilteredMemberList.d.ts +2 -2
  36. package/dist/components/DeptsMemberSelector/subcomponents/Entity/DeptsUser/DeptUsersSearch/DeptUsersSearch.d.ts +5 -0
  37. package/dist/components/DeptsMemberSelector/subcomponents/Entity/DeptsUser/DeptUsersSearch/useDeptUsersSearchData.d.ts +19 -0
  38. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/alignDockCorpSelectedKeys.d.ts +27 -0
  39. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/buildCorpLabelTreeData.d.ts +2 -0
  40. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/useCorpLabelTreePanelData.d.ts +1 -1
  41. package/dist/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersRolePanel/useDeptUsersRolePanelData.d.ts +1 -15
  42. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/useMemberPagedList.d.ts +40 -0
  43. package/dist/components/DeptsMemberSelector/subcomponents/Panels/MemberPanel/useMemberPanelData.d.ts +88 -3
  44. package/dist/components/DeptsMemberSelector/types/selector.d.ts +5 -6
  45. package/dist/components/DeptsMemberSelector/utils/deptUsersCorpDeptSearchGroup.d.ts +3 -16
  46. package/dist/components/DeptsMemberSelector/utils/deptUsersCorpSearchGroup.d.ts +9 -18
  47. package/dist/components/DeptsMemberSelector/utils/deptUsersDockCacheKeys.d.ts +13 -1
  48. package/dist/components/DeptsMemberSelector/utils/deptUsersEnterpriseLabelSearchGroup.d.ts +3 -15
  49. package/dist/components/DeptsMemberSelector/utils/deptUsersOrgDepartmentsData.d.ts +30 -0
  50. package/dist/components/DeptsMemberSelector/utils/deptUsersOrganizationSearchGroup.d.ts +25 -0
  51. package/dist/components/DeptsMemberSelector/utils/deptUsersRelationSearchGroup.d.ts +4 -16
  52. package/dist/components/DeptsMemberSelector/utils/deptUsersRoleModel.d.ts +43 -0
  53. package/dist/components/DeptsMemberSelector/utils/deptUsersRoleSearchGroup.d.ts +24 -0
  54. package/dist/components/DeptsMemberSelector/utils/deptUsersSearchDimensions.d.ts +30 -0
  55. package/dist/components/DeptsMemberSelector/utils/entityItemType.d.ts +5 -2
  56. package/dist/components/DeptsMemberSelector/utils/flattenDockUserList.d.ts +7 -0
  57. package/dist/components/DeptsMemberSelector/utils/flowCreator.d.ts +12 -3
  58. package/dist/components/DeptsMemberSelector/utils/resolveDeptUsersExternalMembers.d.ts +7 -0
  59. package/dist/components/DeptsMemberSelector/utils/resolveDeptUsersOrganizationEntryVisibility.d.ts +1 -1
  60. package/dist/components/DeptsMemberSelector/utils/resolveDockCorpId.d.ts +15 -0
  61. package/dist/components/DeptsMemberSelector/utils/useDeptUsersOrgDepartmentsPrefetch.d.ts +16 -0
  62. package/dist/components/Scatterplot/Scatterplot.type.d.ts +1 -0
  63. package/dist/index.css +1 -1
  64. package/dist/index.js +18 -18
  65. package/dist/lang/en-US.json.d.ts +2 -1
  66. package/dist/lang/zh-CN.json.d.ts +2 -1
  67. package/dist/lang/zh-TW.json.d.ts +2 -1
  68. package/dist/vendors/useLocale.js +12 -3
  69. package/package.json +3 -3
  70. package/dist/DeptsMemberSelector/CorpLabelTree-CNPD4B-g.js +0 -105
  71. package/dist/DeptsMemberSelector/DeptsMemberSelector-DxrheJ9Y.js +0 -1757
  72. package/dist/DeptsMemberSelector/OrganizationPanel-Bcgs46Oo.js +0 -604
  73. package/dist/DeptsMemberSelector/memberStatus-C9tTnu8V.js +0 -717
  74. package/dist/components/DeptsMemberSelector/utils/deptUsersSearchVisibility.d.ts +0 -36
@@ -88,22 +88,22 @@ function l(e, t, n, r) {
88
88
  //#endregion
89
89
  //#region src/components/BubbleChart/BubbleChart.module.scss
90
90
  var u = {
91
- "auto-grid-echart": "_auto-grid-echart_11e81_1",
92
- "xAxis-title": "_xAxis-title_11e81_6",
93
- "yAxis-title": "_yAxis-title_11e81_11",
94
- "legend-position-right": "_legend-position-right_11e81_20",
95
- "legend-position-top": "_legend-position-top_11e81_23",
96
- "t-dash-g2-legend": "_t-dash-g2-legend_11e81_27",
97
- "bsy-chart-body": "_bsy-chart-body_11e81_30",
98
- "legend-position-left": "_legend-position-left_11e81_33",
99
- "t-dash-g2-legend-left": "_t-dash-g2-legend-left_11e81_59",
100
- "legend-label": "_legend-label_11e81_77",
101
- "legend-item": "_legend-item_11e81_89",
102
- "legend-color": "_legend-color_11e81_97",
103
- "t-dash-g2-legend-right": "_t-dash-g2-legend-right_11e81_106",
104
- "t-dash-g2-legend-bottom": "_t-dash-g2-legend-bottom_11e81_153",
105
- "t-dash-g2-legend-top": "_t-dash-g2-legend-top_11e81_193",
106
- "legend-hidden": "_legend-hidden_11e81_233"
91
+ "auto-grid-echart": "_auto-grid-echart_2e70y_1",
92
+ "xAxis-title": "_xAxis-title_2e70y_6",
93
+ "yAxis-title": "_yAxis-title_2e70y_11",
94
+ "legend-position-right": "_legend-position-right_2e70y_20",
95
+ "legend-position-top": "_legend-position-top_2e70y_23",
96
+ "t-dash-g2-legend": "_t-dash-g2-legend_2e70y_27",
97
+ "bsy-chart-body": "_bsy-chart-body_2e70y_30",
98
+ "legend-position-left": "_legend-position-left_2e70y_33",
99
+ "t-dash-g2-legend-left": "_t-dash-g2-legend-left_2e70y_59",
100
+ "legend-label": "_legend-label_2e70y_77",
101
+ "legend-item": "_legend-item_2e70y_89",
102
+ "legend-color": "_legend-color_2e70y_97",
103
+ "t-dash-g2-legend-right": "_t-dash-g2-legend-right_2e70y_106",
104
+ "t-dash-g2-legend-bottom": "_t-dash-g2-legend-bottom_2e70y_153",
105
+ "t-dash-g2-legend-top": "_t-dash-g2-legend-top_2e70y_193",
106
+ "legend-hidden": "_legend-hidden_2e70y_233"
107
107
  }, d = n((n, d) => {
108
108
  let f = a(null), p = a(null), m = a(null), h = a(null), g = n.dataList.map((e) => e.name), [_, v] = o(0), [y, b] = o(0), [x, S] = o(n.option), [C, w] = o([]), T = () => f.current ? (v(p.current?.offsetHeight || 0), b(p.current?.offsetWidth || 0), {
109
109
  ...n.option,
@@ -159,7 +159,7 @@ var u = {
159
159
  n.options.legend?.enable && /* @__PURE__ */ s("div", {
160
160
  className: e(u["t-dash-g2-legend"], n.options.legend?.position === "top" && u["t-dash-g2-legend-top"], n.options.legend?.position === "bottom" && u["t-dash-g2-legend-bottom"], n.options.legend?.position === "left" && u["t-dash-g2-legend-left"], n.options.legend?.position === "right" && u["t-dash-g2-legend-right"]),
161
161
  ref: p,
162
- children: n.dataList.map((t, r) => /* @__PURE__ */ c("div", {
162
+ children: (n.legendList || n.dataList).map((t, r) => /* @__PURE__ */ c("div", {
163
163
  className: e(u["legend-item"], C.includes(t + r) ? "legend-hidden" : ""),
164
164
  onClick: () => E(t.name, r),
165
165
  children: [/* @__PURE__ */ s("span", {
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "../vendors/echarts.js";
2
- import { t } from "./AutoGridEChart-VA8BTIj4.js";
2
+ import { t } from "./AutoGridEChart-C8txdGdG.js";
3
3
  import { forwardRef as n, useImperativeHandle as r, useRef as i } from "react";
4
4
  import { jsx as a } from "react/jsx-runtime";
5
5
  var o = n((n, o) => {
@@ -18,11 +18,19 @@ var o = n((n, o) => {
18
18
  min: n,
19
19
  avg: Number(r)
20
20
  };
21
- }, d = c(n.dataList), f = u(d.index0), p = u(d.index1), m = {};
21
+ }, d = c(n.dataList), f = u(d.index0), p = u(d.index1), m = (() => {
22
+ let e = [], t = [];
23
+ return n.options.guideline?.forEach((r) => {
24
+ r.type === "fixed" ? (r.field === n.options.xFields[0].tag && e.push(r.value || 0), (r.field === n.options.yFields[0].tag || r.field === "") && t.push(r.value || 0)) : r.type === "dynamic" && (r.field === n.options.xFields[0].tag && (r.aggregate === "max" ? e.push(f.max) : r.aggregate === "min" ? e.push(f.min) : r.aggregate === "avg" && e.push(f.avg)), r.field === n.options.yFields[0].tag && (r.aggregate === "max" ? t.push(p.max) : r.aggregate === "min" ? t.push(p.min) : r.aggregate === "avg" && t.push(p.avg)));
25
+ }), {
26
+ xValues: e,
27
+ yValues: t
28
+ };
29
+ })(), h = {};
22
30
  n.dataList.forEach((e) => {
23
- m[e.name] = !0;
31
+ h[e.name] = !0;
24
32
  });
25
- let h = {
33
+ let g = {
26
34
  xAxis: {
27
35
  axisLabel: {
28
36
  color: l,
@@ -31,8 +39,8 @@ var o = n((n, o) => {
31
39
  hideOverlap: !n.options.xAxis?.label?.step,
32
40
  rotate: n.options.xAxis?.label?.rotation?.toString() || "45"
33
41
  },
34
- min: n.options.xAxis?.min || void 0,
35
- max: n.options.xAxis?.max || void 0,
42
+ min: n.options.xAxis?.min === void 0 ? m.xValues.length > 0 ? Math.min(f.min, ...m.xValues) : void 0 : n.options.xAxis.min,
43
+ max: n.options.xAxis?.max === void 0 ? m.xValues.length > 0 ? Math.max(f.max, ...m.xValues) : void 0 : n.options.xAxis.max,
36
44
  title: n.options.xAxis?.title?.text || "",
37
45
  position: n.options.xAxis?.position,
38
46
  axisLine: {
@@ -56,8 +64,8 @@ var o = n((n, o) => {
56
64
  hideOverlap: !n.options.yAxis?.label?.step,
57
65
  rotate: n.options.yAxis?.label?.rotation + " " || 45
58
66
  },
59
- min: n.options.yAxis?.min || void 0,
60
- max: n.options.yAxis?.max || void 0,
67
+ min: n.options.yAxis?.min === void 0 ? m.yValues.length > 0 ? Math.min(p.min, ...m.yValues) : void 0 : n.options.yAxis.min,
68
+ max: n.options.yAxis?.max === void 0 ? m.yValues.length > 0 ? Math.max(p.max, ...m.yValues) : void 0 : n.options.yAxis.max,
61
69
  title: n.options.yAxis?.title?.text,
62
70
  position: n.options.yAxis?.position,
63
71
  axisLine: {
@@ -92,8 +100,16 @@ var o = n((n, o) => {
92
100
  padding: 10,
93
101
  borderRadius: 4,
94
102
  formatter: (e) => {
95
- let t = `<div>${e.seriesName}</div>`;
96
- return t += `<div><span>${n.options.xFields[0].title}:</span><span>${e.value[0]}</span></div>`, t += `<div><span>${n.options.yFields[0].title}:</span><span>${e.value[1]}</span></div>`, e.componentType === "series" ? t : "";
103
+ console.info(3434, e);
104
+ let t = `<div style="max-width: 240px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${e.seriesName}</div>`;
105
+ return t += `<div style="display: flex;align-items: center;margin-top:10px;">
106
+ <span style="background-color: ${e.color.colorStops[0].color || e.color};width: 6px;height: 6px;display: inline-block;border-radius: 50%;margin-right: 6px;"></span>
107
+ <span style="max-width: 200px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${n.options.xFields[0].title}</span>
108
+ <span style='margin-left: 8px;'>${e.value[0]}</span>
109
+ </div>`, t += `<div style="display: flex;align-items: center;">
110
+ <span style="background-color: ${e.color.colorStops[0].color || e.color};width: 6px;height: 6px;display: inline-block;border-radius: 50%;margin-right: 6px;"></span>
111
+ <span style="max-width: 200px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${n.options.yFields[0].title}</span>
112
+ <span style='margin-left: 8px;>${e.value[1]}</span></div>`, e.componentType === "series" ? t : "";
97
113
  },
98
114
  triggerOn: "mousemove",
99
115
  showDelay: 0,
@@ -102,7 +118,7 @@ var o = n((n, o) => {
102
118
  },
103
119
  legend: {
104
120
  show: !1,
105
- selected: m
121
+ selected: h
106
122
  },
107
123
  graphic: n.options.guideline?.map((e) => ({
108
124
  type: "line",
@@ -143,12 +159,33 @@ var o = n((n, o) => {
143
159
  if (e.is_value_visible) return t.value;
144
160
  },
145
161
  fontSize: 12,
146
- color: e.color,
147
- distance: 5
162
+ color: e.color
148
163
  }
149
164
  };
150
- return e.type === "fixed" && (e.field === n.options.xFields[0].tag && (t.xAxis = e.value || 0), (e.field === n.options.yFields[0].tag || e.field === "") && (t.yAxis = e.value || 0)), e.type === "dynamic" && (e.field === n.options.xFields[0].tag && (e.aggregate === "max" && (t.xAxis = f.max), e.aggregate === "min" && (t.xAxis = f.min), e.aggregate === "avg" && (t.xAxis = f.avg)), e.field === n.options.yFields[0].tag && (e.aggregate === "max" && (t.yAxis = p.max), e.aggregate === "min" && (t.yAxis = p.min), e.aggregate === "avg" && (t.yAxis = p.avg)), t.type = e.aggregate), t;
151
- })
165
+ if (e.type === "fixed") {
166
+ if (e.field === n.options.xFields[0].tag) {
167
+ let r = e.value || 0, i = n.options.xAxis?.min, a = n.options.xAxis?.max;
168
+ i !== void 0 && r < i ? t.xAxis = i : a !== void 0 && r > a ? t.xAxis = a : t.xAxis = r;
169
+ }
170
+ if (e.field === n.options.yFields[0].tag || e.field === "") {
171
+ let r = e.value || 0, i = n.options.yAxis?.min, a = n.options.yAxis?.max;
172
+ i !== void 0 && r < i ? t.yAxis = i : a !== void 0 && r > a ? t.yAxis = a : t.yAxis = r;
173
+ }
174
+ }
175
+ if (e.type === "dynamic") {
176
+ if (e.field === n.options.xFields[0].tag) {
177
+ let r = n.options.xAxis?.min, i = n.options.xAxis?.max, a = f.avg;
178
+ e.aggregate === "max" ? a = f.max : e.aggregate === "min" && (a = f.min), r !== void 0 && a < r ? t.xAxis = r : i !== void 0 && a > i ? t.xAxis = i : t.xAxis = a;
179
+ }
180
+ if (e.field === n.options.yFields[0].tag) {
181
+ let r = n.options.yAxis?.min, i = n.options.yAxis?.max, a = p.avg;
182
+ e.aggregate === "max" ? a = p.max : e.aggregate === "min" && (a = p.min), r !== void 0 && a < r ? t.yAxis = r : i !== void 0 && a > i ? t.yAxis = i : t.yAxis = a;
183
+ }
184
+ t.type = e.aggregate;
185
+ }
186
+ return console.info(2323, t), t;
187
+ }),
188
+ emphasis: { disabled: !0 }
152
189
  },
153
190
  color: (t.color, void 0),
154
191
  label: {
@@ -194,8 +231,9 @@ var o = n((n, o) => {
194
231
  s.current.resizeEchart();
195
232
  } })), /* @__PURE__ */ a(t, {
196
233
  ref: s,
197
- option: h,
234
+ option: g,
198
235
  options: n.options,
236
+ legendList: n.legendList,
199
237
  dataList: n.dataList,
200
238
  onChartReady: n.onChartReady,
201
239
  onChartClick: n.onChartClick
@@ -1,6 +1,6 @@
1
1
  import "../vendors/echarts.js";
2
- import "./AutoGridEChart-VA8BTIj4.js";
3
- import { t as e } from "./BubbleChart-CGLJJHYy.js";
2
+ import "./AutoGridEChart-C8txdGdG.js";
3
+ import { t as e } from "./BubbleChart-rOdQW7mB.js";
4
4
  //#region src/components/BubbleChart/index.ts
5
5
  var t = e;
6
6
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../vendors/simplebar-react.js";
2
2
  import { t } from "../vendors/clsx.js";
3
- import { t as n } from "./TagIcon-CgEG5XAx.js";
3
+ import { t as n } from "./TagIcon-CYklI9Ar.js";
4
4
  import { t as r } from "../vendors/useLocale.js";
5
5
  import { useState as i } from "react";
6
6
  import { Spin as a } from "antd";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../vendors/simplebar-react.js";
2
2
  import { t } from "../vendors/clsx.js";
3
- import { t as n } from "./useDeptsMemberSelector-CiImbq5E.js";
4
- import { n as r, t as i } from "./TagIcon-CgEG5XAx.js";
3
+ import { t as n } from "./useDeptsMemberSelector-B6XZHqd5.js";
4
+ import { n as r, t as i } from "./TagIcon-CYklI9Ar.js";
5
5
  import { Radio as a, Spin as o } from "antd";
6
6
  import { Checkbox as s } from "@baishuyun/ui-base";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -0,0 +1,212 @@
1
+ import { t as e } from "../vendors/simplebar-react.js";
2
+ import { t } from "../vendors/clsx.js";
3
+ import { t as n } from "./useDeptsMemberSelector-B6XZHqd5.js";
4
+ import { t as r } from "./services/contact/selector.service-CQopqiTw.js";
5
+ import { n as i, r as a, t as o } from "./TagIcon-CYklI9Ar.js";
6
+ import { t as s } from "../vendors/useLocale.js";
7
+ import { i as c, r as l } from "./utils-Bb473LZ3.js";
8
+ import { n as u, o as d, r as f } from "./filterLabelCorpFlatNodes-BrRZqDkm.js";
9
+ import { i as p, r as m, s as h, t as g } from "./useTreeExpandedKeys-oLUTUYkP.js";
10
+ import { useCallback as _, useEffect as v, useMemo as y, useRef as b } from "react";
11
+ import { Spin as x } from "antd";
12
+ import { Icon as S, Tree as C } from "@baishuyun/ui-base";
13
+ import { useRequest as w } from "ahooks";
14
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
15
+ //#region src/components/DeptsMemberSelector/subcomponents/Panels/DeptUsersCorpPanel/buildCorpLabelTreeData.ts
16
+ var D = (e = []) => {
17
+ let t = f(d(e.filter((e) => e.type === i.LABEL || e.type === i.DOCKCORP)), u.corpLabelTree);
18
+ return t.length === 0 ? [] : l(t.map((e) => ({
19
+ ...e,
20
+ checkable: e.type === i.DOCKCORP
21
+ })), {
22
+ parentId: "parentId",
23
+ children: "children",
24
+ value: "departmentId",
25
+ title: "name"
26
+ });
27
+ }, O = /_(host|guest)$/, k = /^([a-f0-9]{24})-/i, A = (e) => e == null || e === "", j = (e) => {
28
+ if (A(e)) return "";
29
+ let t = String(e).replace(O, ""), n = t.match(k);
30
+ return n && (t = n[1]), t;
31
+ }, M = (e, t) => {
32
+ e.forEach((e) => {
33
+ String(e?.type) === "dockcorp" && t(e), Array.isArray(e.children) && e.children.length && M(e.children, t);
34
+ });
35
+ }, N = (e = []) => {
36
+ let t = /* @__PURE__ */ new Map();
37
+ return M(e, (e) => {
38
+ let n = e._id;
39
+ if (A(n)) return;
40
+ let r = j(n);
41
+ r && t.set(r, e);
42
+ }), t;
43
+ }, P = (e, t = []) => {
44
+ if (!e.length || !t.length) return e;
45
+ let n = N(t);
46
+ return e.map((e) => {
47
+ let t = j(e);
48
+ return n.get(t)?._id ?? e;
49
+ });
50
+ }, F = (e = [], t = []) => {
51
+ if (!Array.isArray(e) || e.length === 0 || !t.length) return {
52
+ nextItems: e || [],
53
+ changed: !1
54
+ };
55
+ let n = N(t), r = !1, i = [];
56
+ return e.forEach((e) => {
57
+ if (!e || e.type !== "dockcorp") {
58
+ i.push(e);
59
+ return;
60
+ }
61
+ let t = e._id ?? e.id;
62
+ if (A(t)) {
63
+ r = !0;
64
+ return;
65
+ }
66
+ let a = j(t), o = a ? n.get(a) : void 0;
67
+ if (!o || A(o._id)) {
68
+ r = !0;
69
+ return;
70
+ }
71
+ let s = o._id, c = o.name || o.dock_corpname || "", l = e.name || e.nickname || e.dock_corpname || "", u = l || c;
72
+ if (!u) {
73
+ r = !0;
74
+ return;
75
+ }
76
+ if (String(s) !== String(t) || !l && c) {
77
+ r = !0, i.push({
78
+ ...e,
79
+ _id: s,
80
+ id: e.id ?? t,
81
+ name: u,
82
+ dock_corpname: u,
83
+ type: "dockcorp"
84
+ });
85
+ return;
86
+ }
87
+ i.push(e);
88
+ }), {
89
+ nextItems: i,
90
+ changed: r
91
+ };
92
+ }, I = () => {
93
+ let { value: e, dispatch: t, containerHeight: o, isSingleSelect: s } = n(), { data: l, loading: u } = w(() => r(), { cacheKey: h }), d = l?.list, f = y(() => D(d ?? []), [d]), p = b("");
94
+ v(() => {
95
+ if (u || !f.length || !e?.length) return;
96
+ let { nextItems: n, changed: r } = F(e, f);
97
+ if (!r) return;
98
+ let o = e.filter((e) => e.type === i.DOCKCORP).map((e) => e._id).filter((e) => e != null && e !== ""), s = n.filter((e) => e.type === i.DOCKCORP), c = `${o.join(",")}|${s.map((e) => `${e._id}:${e.name || ""}`).join(",")}`;
99
+ p.current !== c && (p.current = c, t({
100
+ type: "deleteAndInsert",
101
+ payload: {
102
+ oldIds: o,
103
+ newItems: s.map((e) => a({
104
+ ...e,
105
+ type: i.DOCKCORP
106
+ }))
107
+ }
108
+ }));
109
+ }, [
110
+ u,
111
+ f,
112
+ e,
113
+ t
114
+ ]);
115
+ let g = y(() => P((e || []).filter((e) => e.type === i.DOCKCORP).map((e) => e._id).filter((e) => e != null && e !== ""), f), [e, f]);
116
+ return {
117
+ treeData: f,
118
+ loading: u,
119
+ selectedCorpIds: g,
120
+ selectionExpandKeys: y(() => m(f, g), [f, g]),
121
+ containerHeight: o,
122
+ isSingleSelect: s,
123
+ handleSelect: _((e, n) => {
124
+ if (!n || n.type !== i.DOCKCORP) return;
125
+ let r = n._id;
126
+ if (r == null) return;
127
+ let o = a({
128
+ ...n,
129
+ _id: r,
130
+ type: i.DOCKCORP
131
+ });
132
+ t(s ? {
133
+ type: "insertOnly",
134
+ payload: o
135
+ } : {
136
+ type: "addOne",
137
+ payload: o
138
+ });
139
+ }, [t, s]),
140
+ handleDeselect: _((e) => {
141
+ let n = c(e, f, {
142
+ children: "children",
143
+ value: "_id"
144
+ });
145
+ if (n) {
146
+ t({
147
+ type: "deleteOne",
148
+ payload: n._id
149
+ });
150
+ return;
151
+ }
152
+ t({
153
+ type: "deleteOne",
154
+ payload: e
155
+ });
156
+ }, [t, f])
157
+ };
158
+ }, L = {
159
+ "corp-label-tree": "_corp-label-tree_1lic4_1",
160
+ "corp-label-tree__switcher-icon": "_corp-label-tree__switcher-icon_1lic4_5",
161
+ "corp-label-tree__switcher-icon--expanded": "_corp-label-tree__switcher-icon--expanded_1lic4_10",
162
+ "corp-label-tree__empty": "_corp-label-tree__empty_1lic4_13",
163
+ "corp-label-tree__empty-text": "_corp-label-tree__empty-text_1lic4_21"
164
+ }, R = () => {
165
+ let { t: n } = s(), r = I(), { expandedKeys: a, onExpand: c } = g(y(() => p(r.treeData, {
166
+ baselineMode: "all-roots",
167
+ selectionExpandKeys: r.selectionExpandKeys
168
+ }), [r.treeData, r.selectionExpandKeys])), l = r.treeData.length === 0 && !r.loading;
169
+ return /* @__PURE__ */ E("div", {
170
+ className: L["corp-label-tree"],
171
+ children: [/* @__PURE__ */ T(x, {
172
+ spinning: r.loading,
173
+ children: /* @__PURE__ */ T(e, {
174
+ style: {
175
+ height: r.containerHeight,
176
+ padding: "4px"
177
+ },
178
+ children: r.treeData.length > 0 ? /* @__PURE__ */ T(C, {
179
+ parentCheckable: !0,
180
+ checkType: r.isSingleSelect ? "radio" : "checkbox",
181
+ data: r.treeData,
182
+ fieldNames: {
183
+ title: "name",
184
+ value: "_id",
185
+ children: "children"
186
+ },
187
+ selectedKeys: r.selectedCorpIds,
188
+ onSelect: r.handleSelect,
189
+ onDeSelect: r.handleDeselect,
190
+ expandedKeys: a,
191
+ onExpand: c,
192
+ icon: (e) => /* @__PURE__ */ T(o, {
193
+ type: e.type === i.LABEL ? i.LABEL : i.DOCKCORP,
194
+ size: 16
195
+ }),
196
+ switcherIcon: (e) => /* @__PURE__ */ T(S, {
197
+ name: "xiangxiazhankai-11",
198
+ className: t(L["corp-label-tree__switcher-icon"], { [L["corp-label-tree__switcher-icon--expanded"]]: e })
199
+ })
200
+ }) : null
201
+ })
202
+ }), l ? /* @__PURE__ */ T("div", {
203
+ className: L["corp-label-tree__empty"],
204
+ children: /* @__PURE__ */ T("span", {
205
+ className: L["corp-label-tree__empty-text"],
206
+ children: n("corp.noAvailable")
207
+ })
208
+ }) : null]
209
+ });
210
+ };
211
+ //#endregion
212
+ export { R as t };
@@ -1,11 +1,11 @@
1
1
  import { t as e } from "../vendors/simplebar-react.js";
2
2
  import { t } from "../vendors/clsx.js";
3
- import { i as n, t as r } from "./useDeptsMemberSelector-CiImbq5E.js";
4
- import { _ as i } from "./services/contact/selector.service-dmS_qeZo.js";
5
- import { a, t as o } from "./TagIcon-CgEG5XAx.js";
3
+ import { i as n, t as r } from "./useDeptsMemberSelector-B6XZHqd5.js";
4
+ import { _ as i } from "./services/contact/selector.service-CQopqiTw.js";
5
+ import { a, t as o } from "./TagIcon-CYklI9Ar.js";
6
6
  import { t as s } from "../vendors/useLocale.js";
7
7
  import { t as c } from "./useOutsiderGroupPanelState-BULTXv3n.js";
8
- import { t as l } from "./OrganizationPanel-Bcgs46Oo.js";
8
+ import { t as l } from "./OrganizationPanel-hray3UWA.js";
9
9
  import { useMemo as u } from "react";
10
10
  import { Radio as d, Spin as f } from "antd";
11
11
  import { Checkbox as p } from "@baishuyun/ui-base";