@baishuyun/ui-business 5.0.3 → 5.0.4

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 (53) hide show
  1. package/dist/BubbleChart/AutoGridEChart-uinZMdOR.js +185 -0
  2. package/dist/BubbleChart/BubbleChart-CPhXmstL.js +174 -0
  3. package/dist/BubbleChart/index.js +7 -4
  4. package/dist/ConfigProvider/ConfigProvider-CISBH3A8.js +22 -0
  5. package/dist/ConfigProvider/configContext-B0kvcW4s.js +9 -0
  6. package/dist/ConfigProvider/index.js +6 -4
  7. package/dist/DeptsMember/Department-BYVAaPYd.js +186 -0
  8. package/dist/DeptsMember/DeptsMember-D_xv-Zy7.js +801 -0
  9. package/dist/DeptsMember/DeptsUser-CQrRRJxk.js +277 -0
  10. package/dist/DeptsMember/ExtraConcactPanel-Cioew3V3.js +736 -0
  11. package/dist/DeptsMember/Member-BIBX5jKD.js +47 -0
  12. package/dist/DeptsMember/OrganizationPanel-BLIXOm6z.js +235 -0
  13. package/dist/DeptsMember/RelationShipDepts-wcYjFbhx.js +78 -0
  14. package/dist/DeptsMember/RelationShipList-CRdCr4NL.js +73 -0
  15. package/dist/DeptsMember/TabGroup-B_VIf1lS.js +98 -0
  16. package/dist/DeptsMember/index.js +18 -8
  17. package/dist/DeptsMember/subcomponents/Entity/Department/index.js +8 -166
  18. package/dist/DeptsMember/subcomponents/Entity/DeptsUser/index.js +11 -267
  19. package/dist/DeptsMember/subcomponents/Entity/Member/index.js +8 -46
  20. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipDepts/index.js +4 -13
  21. package/dist/DeptsMember/subcomponents/Panels/MemberRelationShipPanel/RelationShipList/index.js +4 -67
  22. package/dist/DeptsMember/useDeptsMemberSelector-DP5L8bhi.js +15 -0
  23. package/dist/DeptsMember/utils/index.js +65 -77
  24. package/dist/Scatterplot/Scatterplot-DTKhmdTE.js +150 -0
  25. package/dist/Scatterplot/index.js +7 -4
  26. package/dist/index.css +2 -1
  27. package/dist/index.js +164 -200
  28. package/dist/vendors/clsx.js +14 -14
  29. package/dist/vendors/echarts.js +41454 -44148
  30. package/dist/vendors/lodash-es.js +127 -117
  31. package/dist/vendors/rolldown-runtime.js +11 -0
  32. package/dist/vendors/services/apiService.js +15 -19
  33. package/dist/vendors/services/corp/outsider.service.js +5 -6
  34. package/dist/vendors/services/data/department.service.js +5 -6
  35. package/dist/vendors/services/data/member.service.js +5 -9
  36. package/dist/vendors/services/data/member_limit.service.js +5 -5
  37. package/dist/vendors/services/data/outsider.service.js +5 -6
  38. package/dist/vendors/services/ncorp/department.service.js +5 -6
  39. package/dist/vendors/services/ncorp/relation.service.js +5 -5
  40. package/dist/vendors/simplebar-react.js +358 -396
  41. package/dist/vendors/useLocale.js +132 -41
  42. package/package.json +5 -5
  43. package/dist/BubbleChart/AutoGridEChart-BlLcIZ_T.js +0 -209
  44. package/dist/BubbleChart/BubbleChart-BPGhlxCM.js +0 -237
  45. package/dist/ConfigProvider/ConfigProvider-CAq3dN6-.js +0 -15
  46. package/dist/ConfigProvider/configContext-_BAslzM-.js +0 -9
  47. package/dist/DeptsMember/DeptsMember-BNuoQ8y4.js +0 -865
  48. package/dist/DeptsMember/ExtraConcactPanel-BoSCI3s5.js +0 -738
  49. package/dist/DeptsMember/OrganizationPanel-ByWU1PWX.js +0 -275
  50. package/dist/DeptsMember/TabGroup-DZC7i-Yr.js +0 -104
  51. package/dist/DeptsMember/index-BRIA1uOQ.js +0 -88
  52. package/dist/DeptsMember/useDeptsMemberSelector-D3rvDuVf.js +0 -13
  53. package/dist/Scatterplot/Scatterplot-BL66B_Zm.js +0 -202
@@ -0,0 +1,185 @@
1
+ import { t as e } from "../vendors/clsx.js";
2
+ import { t } from "../vendors/echarts.js";
3
+ import { forwardRef as n, useEffect as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
4
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
+ //#region src/utils/getLegendHeight.ts
6
+ function l(e, t, n, r, i) {
7
+ let a = 0, o = 0, s = parseInt(r.fontSize) || 10, c = e.series.map((e) => e.data[0][0].toString()), l = e.series.map((e) => e.data[0][1].toString()), u = e.series.map((e) => e.name);
8
+ function d(e) {
9
+ let t = "";
10
+ if (e.fontSize || e.fontFamily || e.fontWeight) {
11
+ let n = "";
12
+ n = typeof e.fontSize == "string" && (e.fontSize.indexOf("px") !== -1 || e.fontSize.indexOf("rem") !== -1 || e.fontSize.indexOf("em") !== -1) ? e.fontSize : isNaN(+e.fontSize) ? "12px" : e.fontSize + "px", t = [
13
+ e.fontStyle,
14
+ e.fontWeight,
15
+ n,
16
+ e.fontFamily || "sans-serif"
17
+ ].join(" ");
18
+ }
19
+ return t && t.trim() || e.textFont || e.font;
20
+ }
21
+ function f(e, t) {
22
+ t.fontSize = parseInt(t.fontSize), t.fontFamily = t.fontFamily || "verdana";
23
+ let n = d(t), r = document.createElement("canvas").getContext("2d") || {};
24
+ return r.font = n, r?.measureText(e)?.width || 0;
25
+ }
26
+ function p(e, t) {
27
+ if (Array.isArray(e)) for (let n = 0, r = e.length; n < r && t.apply(e[n], [n, e[n]]) !== !1; n++);
28
+ else if (e && typeof e == "object") {
29
+ for (let n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t.apply(e[n], [n, e[n]]) === !1) break;
30
+ }
31
+ }
32
+ function m() {
33
+ let t = 0;
34
+ if (e.xAxis && e.xAxis.axisLabel) {
35
+ let n = e.xAxis.axisLabel.rotate;
36
+ if (n && n !== 0) {
37
+ let r = 0, i = "";
38
+ if (c && Array.isArray(c) && c.forEach((e) => {
39
+ let t = e;
40
+ t.length > r && (r = t.length, i = t);
41
+ }), r > 0) {
42
+ let r = f(i, e.xAxis.axisLabel), a = Math.abs(n) * Math.PI / 180;
43
+ t = r * Math.sin(a);
44
+ }
45
+ }
46
+ }
47
+ return t;
48
+ }
49
+ function h() {
50
+ let t = 0;
51
+ if (e.yAxis && e.yAxis.axisLabel) {
52
+ let n = e.yAxis.axisLabel.rotate;
53
+ if (n && n !== 0) {
54
+ let r = 0, i = "";
55
+ if (l && Array.isArray(l) && l.forEach((e) => {
56
+ let t = e;
57
+ t.length > r && (r = t.length, i = t);
58
+ }), r > 0) {
59
+ let r = f(i, e.yAxis.axisLabel);
60
+ if (n === 0) t = r;
61
+ else if (n === 90) t = parseInt(e.yAxis.axisLabel.fontSize) || 12;
62
+ else {
63
+ let e = Math.abs(n) * Math.PI / 180;
64
+ t = r * Math.cos(e);
65
+ }
66
+ t += 10;
67
+ }
68
+ }
69
+ }
70
+ return t;
71
+ }
72
+ function g() {
73
+ let e = 0, n = Array.isArray(t) ? t.length : Object.keys(t || {}).length;
74
+ return n > 10 ? e = 20 : n > 5 && (e = 10), e;
75
+ }
76
+ if (e.legend.type === "scroll") return s + 10 + m() + h() + g();
77
+ p(t, (e, t) => {
78
+ let i = f(t, r || {
79
+ fontFamily: "verdana",
80
+ fontSize: 10,
81
+ fontStyle: "normal",
82
+ fontWeight: "normal"
83
+ });
84
+ o += i + 10 + 14 + 5, o > n && (a++, o = i + 10 + 14 + 5);
85
+ });
86
+ function _(e, t, n, r) {
87
+ let i = r.legend;
88
+ if (!i.show) return 0;
89
+ let a = n.itemHeight + n.padding, o = i.itemWidth || 12, s = e.map((e) => e.name || e), c = (e) => {
90
+ let t = (e.match(/[\u4e00-\u9fa5]/g) || []).length, n = e.length - t;
91
+ return t * 12 + n * 7;
92
+ };
93
+ if (r.legend.left === "left" || r.legend.right === "right") {
94
+ let n = Math.max(...s.map((e) => c(e))), r = o + 5 + n;
95
+ return Math.ceil(a * e.length / t) * (r + 10) + 20;
96
+ }
97
+ return 0;
98
+ }
99
+ let v = _(u, i, e.legend, e), y = (a + 1) * (s + 10), b = m(), x = h(), S = -5, C = -5, w = -5, T = -5;
100
+ return {
101
+ grid: {
102
+ top: (() => {
103
+ let t = 20;
104
+ return e.xAxis.position === "top" && (t += b + 10), e.legend.show && e.legend.top === "top" && (C += y, t += y), e.xAxis.title !== "" && e.xAxis.position === "top" && (t += 30), t;
105
+ })(),
106
+ bottom: (() => {
107
+ let t = 20;
108
+ return e.xAxis.position === "bottom" && (t += b + 10), e.legend.show && (e.legend.top === "bottom" || e.legend.top === "") && (S += y, t += y), e.xAxis.title !== "" && e.xAxis.position === "bottom" && (t += 30), t;
109
+ })(),
110
+ left: (() => {
111
+ let t = 20;
112
+ return e.yAxis.position === "left" && (t += x), e.legend.show && e.legend.left === "left" && (w += v, t += v), e.yAxis.title !== "" && e.yAxis.position === "left" && (t += 10), t;
113
+ })(),
114
+ right: (() => {
115
+ let t = 20 + x;
116
+ return e.yAxis.position === "right" && (t += 10), e.legend.show && e.legend.left === "right" && (T += v, t += v), e.yAxis.title !== "" && e.yAxis.position === "right" && (t += 30), t;
117
+ })()
118
+ },
119
+ titleBottomHeight: S,
120
+ titleTopHeight: C,
121
+ titleLeftHeight: w,
122
+ titleRightHeight: T
123
+ };
124
+ }
125
+ //#endregion
126
+ //#region src/components/BubbleChart/BubbleChart.module.scss
127
+ var u = {
128
+ "auto-grid-echart": "_auto-grid-echart_w04s7_1",
129
+ "xAxis-title": "_xAxis-title_w04s7_6",
130
+ "yAxis-title": "_yAxis-title_w04s7_11"
131
+ }, d = n((n, d) => {
132
+ let f = a(null), p = a(null), m = a(null), [h, g] = o({}), _ = n.dataList.map((e) => e.name), v = () => f.current ? (g(l(n.option, _, f.current.offsetWidth, n.option.legend.textStyle, f.current.offsetHeight)), {
133
+ ...n.option,
134
+ grid: l(n.option, _, f.current.offsetWidth, n.option.legend.textStyle, f.current.offsetHeight).grid
135
+ }) : { ...n.option };
136
+ return i(d, () => ({ resizeEchart: () => {
137
+ p.current?.resize();
138
+ } })), r(() => {
139
+ if (!f.current) return;
140
+ p.current = t(f.current);
141
+ let e = v();
142
+ p.current.setOption(e, !0), p.current.on("click", function(e) {
143
+ n.onChartClick && n.onChartClick(e, n.options, n.dataList);
144
+ });
145
+ let r = () => {
146
+ if (p.current) {
147
+ let e = v();
148
+ p.current.setOption(e, !1);
149
+ }
150
+ };
151
+ return setTimeout(r, 100), n.onChartReady && n.onChartReady(p.current), m.current = new ResizeObserver(() => {
152
+ p.current?.resize(), setTimeout(r, 50);
153
+ }), f.current && m.current.observe(f.current), () => {
154
+ m.current?.disconnect(), p.current?.dispose();
155
+ };
156
+ }, []), r(() => {
157
+ if (!p.current) return;
158
+ let e = v();
159
+ p.current.setOption(e, !0);
160
+ }, [n.option]), /* @__PURE__ */ c("div", {
161
+ className: e(n.className, u["auto-grid-echart"]),
162
+ children: [
163
+ /* @__PURE__ */ s("div", {
164
+ ref: f,
165
+ style: {
166
+ width: "100%",
167
+ height: "100%",
168
+ ...n.style
169
+ }
170
+ }),
171
+ /* @__PURE__ */ s("div", {
172
+ className: e(u["xAxis-title"]),
173
+ style: n.option.xAxis?.position === "bottom" ? { bottom: h.titleBottomHeight + 20 } : n.option.xAxis?.position === "top" ? { top: h.titleTopHeight + 20 } : void 0,
174
+ children: /* @__PURE__ */ s("span", { children: n.option.xAxis?.title })
175
+ }),
176
+ /* @__PURE__ */ s("div", {
177
+ className: e(u["yAxis-title"]),
178
+ style: n.option.yAxis?.position === "left" ? { left: h.titleLeftHeight } : n.option.yAxis?.position === "right" ? { right: h.titleRightHeight + 20 } : void 0,
179
+ children: /* @__PURE__ */ s("span", { children: n.option.yAxis?.title })
180
+ })
181
+ ]
182
+ });
183
+ });
184
+ //#endregion
185
+ export { d as t };
@@ -0,0 +1,174 @@
1
+ import { n as e } from "../vendors/echarts.js";
2
+ import { t } from "./AutoGridEChart-uinZMdOR.js";
3
+ import { forwardRef as n, useImperativeHandle as r, useRef as i } from "react";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ var o = n((n, o) => {
6
+ let s = i(null), c = (e) => {
7
+ let t = {
8
+ index0: [],
9
+ index1: []
10
+ };
11
+ return e.forEach((e) => {
12
+ t.index0.push(e.data[0]), t.index1.push(e.data[1]);
13
+ }), t;
14
+ }, l = (e) => {
15
+ let t = Math.max(...e), n = Math.min(...e), r = (e.reduce((e, t) => e + t, 0) / e.length).toFixed(2);
16
+ return {
17
+ max: t,
18
+ min: n,
19
+ avg: Number(r)
20
+ };
21
+ }, u = c(n.dataList), d = l(u.index0), f = l(u.index1), p = n.options.xFields[n.options.xFields.length - 1].colors || [], m = {
22
+ xAxis: {
23
+ axisLabel: {
24
+ color: "#666666",
25
+ fontSize: 10,
26
+ show: !0,
27
+ rotate: n.options.xAxis?.label?.rotation?.toString() || "45"
28
+ },
29
+ min: n.options.xAxis?.min || void 0,
30
+ max: n.options.xAxis?.max || void 0,
31
+ title: n.options.xAxis?.title?.text || "",
32
+ position: n.options.xAxis?.position
33
+ },
34
+ yAxis: {
35
+ axisLabel: {
36
+ color: "#666666",
37
+ fontSize: 10,
38
+ show: !0,
39
+ rotate: n.options.yAxis?.label?.rotation + " " || 45
40
+ },
41
+ min: n.options.yAxis?.min || void 0,
42
+ max: n.options.yAxis?.max || void 0,
43
+ title: n.options.yAxis?.title?.text,
44
+ position: n.options.yAxis?.position
45
+ },
46
+ grid: {
47
+ top: 20,
48
+ bottom: 20,
49
+ left: 20,
50
+ right: 30
51
+ },
52
+ tooltip: {
53
+ trigger: "item",
54
+ axisPointer: { type: "shadow" },
55
+ textStyle: {
56
+ fontSize: 14,
57
+ color: "#333"
58
+ },
59
+ backgroundColor: "#fff",
60
+ borderColor: "#fff",
61
+ borderWidth: 1,
62
+ padding: 10,
63
+ borderRadius: 4,
64
+ formatter: (e) => {
65
+ let t = `<div>${e.seriesName}</div>`;
66
+ 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 : "";
67
+ },
68
+ triggerOn: "mousemove",
69
+ showDelay: 0,
70
+ hideDelay: 100,
71
+ enterable: !1
72
+ },
73
+ legend: {
74
+ show: n.options.legend.enable,
75
+ orient: ["left", "right"].includes(n.options.legend.position) ? "vertical" : "horizontal",
76
+ left: ["left", "right"].includes(n.options.legend.position) && n.options.legend.position || "center",
77
+ top: ["top", "bottom"].includes(n.options.legend.position) && n.options.legend.position || "middle",
78
+ itemGap: 10,
79
+ bottom: 0,
80
+ padding: 10,
81
+ itemWidth: 12,
82
+ itemHeight: 14,
83
+ textStyle: { fontStyle: "normal" }
84
+ },
85
+ graphic: n.options.guideline?.map((e) => ({
86
+ type: "line",
87
+ shape: {
88
+ x1: 1,
89
+ y1: 8,
90
+ x2: 2,
91
+ y2: 8
92
+ },
93
+ style: {
94
+ stroke: e.color,
95
+ lineWidth: 2
96
+ }
97
+ })),
98
+ series: n.dataList.map((t, r) => ({
99
+ symbolSize: () => (t.data[2] || 0) >= n.options.bubbleOptions.maxSize ? n.options.bubbleOptions.maxSize : (t.data[2] || 0) <= n.options.bubbleOptions.minSize ? n.options.bubbleOptions.minSize : t.data[2] || 10,
100
+ data: [t.data],
101
+ name: t.name,
102
+ markLine: {
103
+ symbol: ["none", "none"],
104
+ lineStyle: {
105
+ width: 1,
106
+ type: "dashed"
107
+ },
108
+ data: r === 0 && n.options.guideline?.map((e) => {
109
+ let t = {
110
+ lineStyle: {
111
+ color: e.color,
112
+ width: 1,
113
+ type: "dashed"
114
+ },
115
+ label: {
116
+ show: !0,
117
+ position: "insideEndTop",
118
+ formatter: (t) => {
119
+ if (e.is_label_visible && e.is_value_visible) return e.label + ":" + t.value;
120
+ if (e.is_label_visible) return e.label;
121
+ if (e.is_value_visible) return t.value;
122
+ },
123
+ fontSize: 12,
124
+ color: e.color,
125
+ distance: 5
126
+ }
127
+ };
128
+ return e.type === "fixed" && (e.field === n.options.xFields[0].tag && (t.xAxis = e.value || 0), e.field === n.options.yFields[0].tag && (t.yAxis = e.value || 0)), e.type === "dynamic" && (e.field === n.options.xFields[0].tag && (e.aggregate === "max" && (t.xAxis = d.max), e.aggregate === "min" && (t.xAxis = d.min), e.aggregate === "avg" && (t.xAxis = d.avg)), e.field === n.options.yFields[0].tag && (e.aggregate === "max" && (t.yAxis = f.max), e.aggregate === "min" && (t.yAxis = f.min), e.aggregate === "avg" && (t.yAxis = f.avg)), t.type = e.aggregate), t;
129
+ })
130
+ },
131
+ color: p.find((e) => e.title === t.name) ? p.find((e) => e.title === t.name).color : "",
132
+ label: {
133
+ show: n.options.chart_label.enable,
134
+ distance: 5,
135
+ position: "top",
136
+ formatter: () => `${n.options.chart_label.dimension?.enable ? t.name : ""} ${n.options.chart_label.value?.enable ? "(" + t.data[0] + "," + t.data[1] + ")" : ""}`,
137
+ textStyle: {
138
+ fontSize: 11,
139
+ color: "#666",
140
+ fontWeight: 500
141
+ }
142
+ },
143
+ itemStyle: {
144
+ borderColor: "#666",
145
+ borderWidth: 1,
146
+ shadowColor: "rgba(0, 0, 0, 0.2)",
147
+ shadowBlur: 10,
148
+ shadowOffsetX: 3,
149
+ shadowOffsetY: 5,
150
+ shadowOpacity: .8,
151
+ color: new e(.4, .3, 1, [{
152
+ offset: 0,
153
+ color: t.color && t.color[0] || "rgb(129, 227, 238)"
154
+ }, {
155
+ offset: 1,
156
+ color: t.color && t.color[1] || "rgb(25, 183, 207)"
157
+ }])
158
+ },
159
+ type: "scatter"
160
+ }))
161
+ };
162
+ return r(o, () => ({ resizeEchart: () => {
163
+ s.current.resizeEchart();
164
+ } })), /* @__PURE__ */ a(t, {
165
+ ref: s,
166
+ option: m,
167
+ options: n.options,
168
+ dataList: n.dataList,
169
+ onChartReady: n.onChartReady,
170
+ onChartClick: n.onChartClick
171
+ });
172
+ });
173
+ //#endregion
174
+ export { o as t };
@@ -1,4 +1,7 @@
1
- import { B as r } from "./BubbleChart-BPGhlxCM.js";
2
- export {
3
- r as default
4
- };
1
+ import "../vendors/echarts.js";
2
+ import "./AutoGridEChart-uinZMdOR.js";
3
+ import { t as e } from "./BubbleChart-CPhXmstL.js";
4
+ //#region src/components/BubbleChart/index.ts
5
+ var t = e;
6
+ //#endregion
7
+ export { t as default };
@@ -0,0 +1,22 @@
1
+ import { t as e } from "./configContext-B0kvcW4s.js";
2
+ import { r as t } from "../vendors/services/apiService.js";
3
+ import { useEffect as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region src/components/ConfigProvider/ConfigProvider.tsx
6
+ var i = (i) => {
7
+ let { locale: a, axiosInstance: o, preFetchedNodes: s } = i;
8
+ return n(() => {
9
+ o && t({ axiosInstance: o });
10
+ }, [o]), n(() => {
11
+ s && s.length > 0 && sessionStorage.setItem("preset_bsy_dept_member", JSON.stringify(s));
12
+ }, [s]), /* @__PURE__ */ r(e.Provider, {
13
+ value: {
14
+ locale: a,
15
+ axiosInstance: o,
16
+ preFetchedNodes: s
17
+ },
18
+ children: i.children
19
+ });
20
+ };
21
+ //#endregion
22
+ export { i as t };
@@ -0,0 +1,9 @@
1
+ import { createContext as e } from "react";
2
+ //#region src/components/ConfigProvider/context/configContext.ts
3
+ var t = e({
4
+ locale: "zh-CN",
5
+ axiosInstance: void 0,
6
+ preFetchedNodes: void 0
7
+ });
8
+ //#endregion
9
+ export { t };
@@ -1,4 +1,6 @@
1
- import { C as r } from "./ConfigProvider-CAq3dN6-.js";
2
- export {
3
- r as default
4
- };
1
+ import "./configContext-B0kvcW4s.js";
2
+ import { t as e } from "./ConfigProvider-CISBH3A8.js";
3
+ //#region src/components/ConfigProvider/index.ts
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,186 @@
1
+ import { t as e } from "../vendors/simplebar-react.js";
2
+ import { t } from "../vendors/clsx.js";
3
+ import { t as n } from "./useDeptsMemberSelector-DP5L8bhi.js";
4
+ import { r } from "./TabGroup-B_VIf1lS.js";
5
+ import { t as i } from "../vendors/useLocale.js";
6
+ import { r as a } from "../vendors/services/data/member.service.js";
7
+ import { t as o } from "./OrganizationPanel-BLIXOm6z.js";
8
+ import { t as s } from "../vendors/services/corp/outsider.service.js";
9
+ import { useMemo as c, useState as l } from "react";
10
+ import { Radio as u, Spin as d } from "antd";
11
+ import { Checkbox as f } from "@baishuyun/ui-base";
12
+ import { useRequest as p } from "ahooks";
13
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ //#region src/components/DeptsMember/subcomponents/Entity/Department/GroupList/GroupList.module.scss
15
+ var _ = {
16
+ "group-list__list": "_group-list__list_1ncb5_1",
17
+ "group-list__option": "_group-list__option_1ncb5_4",
18
+ "group-list__option--checkbox": "_group-list__option--checkbox_1ncb5_13",
19
+ "group-list__radio": "_group-list__radio_1ncb5_16",
20
+ "group-list__row": "_group-list__row_1ncb5_19",
21
+ "group-list__name": "_group-list__name_1ncb5_24",
22
+ "group-list__checkbox-row": "_group-list__checkbox-row_1ncb5_28",
23
+ "group-list__checkbox": "_group-list__checkbox_1ncb5_28",
24
+ "group-list__group": "_group-list__group_1ncb5_38",
25
+ "group-list": "_group-list_1ncb5_1"
26
+ }, v = (e) => {
27
+ let { list: i } = e, { value: a, type: o, dispatch: s } = n(), c = o === r.DEPARMENT, l = o === r.DEPARMENT_GROUP, d = a?.[0]?._id, p = (t) => {
28
+ let n = i?.find((e) => e._id === t.target.value);
29
+ n && s({
30
+ type: "insertOnly",
31
+ payload: Object.assign({}, n, { type: e.type || n.type })
32
+ });
33
+ }, v = (e) => {
34
+ s({
35
+ type: "deleteOne",
36
+ payload: e
37
+ });
38
+ }, y = a?.map((e) => e._id) || [];
39
+ return /* @__PURE__ */ h("div", {
40
+ className: _["group-list"],
41
+ children: /* @__PURE__ */ g("ul", {
42
+ className: _["group-list__list"],
43
+ children: [c && /* @__PURE__ */ h(u.Group, {
44
+ value: d,
45
+ onChange: p,
46
+ className: _["group-list__group"],
47
+ children: i.map((e) => /* @__PURE__ */ h("li", {
48
+ className: _["group-list__option"],
49
+ children: /* @__PURE__ */ h(u, {
50
+ value: e._id,
51
+ className: _["group-list__radio"],
52
+ onClick: () => {
53
+ v(e._id);
54
+ },
55
+ children: /* @__PURE__ */ h("div", {
56
+ className: _["group-list__row"],
57
+ children: /* @__PURE__ */ h("span", {
58
+ className: _["group-list__name"],
59
+ children: e.name
60
+ })
61
+ })
62
+ })
63
+ }, e._id))
64
+ }), l && /* @__PURE__ */ h(m, { children: /* @__PURE__ */ h(f.Group, {
65
+ value: y,
66
+ onChange: (t) => {
67
+ let n = i.filter((e) => !t.includes(e._id)), r = i.filter((e) => t.includes(e._id));
68
+ s({
69
+ type: "deleteAndInsert",
70
+ payload: {
71
+ oldIds: n.map((e) => e._id),
72
+ newItems: r.map((t) => Object.assign({}, t, { type: e.type || t.type }))
73
+ }
74
+ });
75
+ },
76
+ className: _["group-list__group"],
77
+ children: i.map((e) => /* @__PURE__ */ h("li", {
78
+ className: t(_["group-list__option"], _["group-list__option--checkbox"]),
79
+ children: /* @__PURE__ */ h(f, {
80
+ labelPosition: "left",
81
+ value: e._id,
82
+ className: _["group-list__checkbox"],
83
+ children: /* @__PURE__ */ h("div", {
84
+ className: _["group-list__checkbox-row"],
85
+ children: /* @__PURE__ */ h("span", {
86
+ className: _["group-list__name"],
87
+ children: e.name
88
+ })
89
+ })
90
+ })
91
+ }, e._id))
92
+ }) })]
93
+ })
94
+ });
95
+ }, y = {
96
+ "current-user-depts-panel": "_current-user-depts-panel_cjkm1_1",
97
+ "current-user-depts-panel__empty": "_current-user-depts-panel__empty_cjkm1_5"
98
+ }, b = () => {
99
+ let { containerHeight: t } = n(), { t: r } = i(), { data: o, loading: s } = p(() => a({ departmentLimit: [] })), c = o?.departmentList || [];
100
+ return /* @__PURE__ */ h("div", {
101
+ className: y["current-user-depts-panel"],
102
+ children: /* @__PURE__ */ h(d, {
103
+ spinning: s,
104
+ tip: r("common.loading"),
105
+ children: /* @__PURE__ */ g(e, {
106
+ style: { height: t - 8 },
107
+ children: [/* @__PURE__ */ h(v, { list: c }), c.length === 0 && !s && /* @__PURE__ */ h("div", {
108
+ className: y["current-user-depts-panel__empty"],
109
+ children: /* @__PURE__ */ h("span", { children: r("department.noAvailable") })
110
+ })]
111
+ })
112
+ })
113
+ });
114
+ }, x = {
115
+ "extra-contact-group-panel": "_extra-contact-group-panel_jf0qd_1",
116
+ "extra-contact-group-panel__menu": "_extra-contact-group-panel__menu_jf0qd_6",
117
+ "extra-contact-group-panel__menu-list": "_extra-contact-group-panel__menu-list_jf0qd_10",
118
+ "extra-contact-group-panel__menu-item": "_extra-contact-group-panel__menu-item_jf0qd_14",
119
+ "extra-contact-group-panel__menu-item--active": "_extra-contact-group-panel__menu-item--active_jf0qd_25",
120
+ "extra-contact-group-panel__content": "_extra-contact-group-panel__content_jf0qd_32",
121
+ "extra-contact-group-panel__empty": "_extra-contact-group-panel__empty_jf0qd_37"
122
+ }, S = () => {
123
+ let { containerHeight: r } = n(), { t: a } = i(), [o] = l([{
124
+ key: "default",
125
+ label: a("externalContact.defaultGroup")
126
+ }, {
127
+ key: "custom",
128
+ label: a("externalContact.customGroup")
129
+ }]), [c, u] = l("default"), { data: f, loading: m } = p(() => s()), _ = f?.list || [], y = c === "default" ? _.filter((e) => e.type === "1") : _.filter((e) => e.type !== "1");
130
+ return /* @__PURE__ */ g("div", {
131
+ className: x["extra-contact-group-panel"],
132
+ children: [/* @__PURE__ */ h("aside", {
133
+ className: x["extra-contact-group-panel__menu"],
134
+ children: /* @__PURE__ */ h("ul", {
135
+ className: x["extra-contact-group-panel__menu-list"],
136
+ children: o.map((e) => /* @__PURE__ */ h("li", {
137
+ onClick: () => {
138
+ u(e.key);
139
+ },
140
+ className: t(x["extra-contact-group-panel__menu-item"], { [x["extra-contact-group-panel__menu-item--active"]]: c === e.key }),
141
+ children: e.label
142
+ }, e.key))
143
+ })
144
+ }), /* @__PURE__ */ h("div", {
145
+ className: x["extra-contact-group-panel__content"],
146
+ children: /* @__PURE__ */ h(d, {
147
+ spinning: m,
148
+ tip: a("common.loading"),
149
+ children: /* @__PURE__ */ g(e, {
150
+ style: {
151
+ height: r - 8,
152
+ padding: "4px"
153
+ },
154
+ children: [y.length > 0 && /* @__PURE__ */ h(v, {
155
+ list: y,
156
+ type: "group"
157
+ }), y.length === 0 && !m && /* @__PURE__ */ h("div", {
158
+ className: x["extra-contact-group-panel__empty"],
159
+ children: /* @__PURE__ */ h("span", { children: a("externalContact.noAvailableGroup") })
160
+ })]
161
+ })
162
+ })
163
+ })]
164
+ });
165
+ }, C = () => {
166
+ let { t: e } = i();
167
+ return c(() => [
168
+ {
169
+ label: e("department.organizationalStructure"),
170
+ key: "organizational",
171
+ view: /* @__PURE__ */ h(o, {})
172
+ },
173
+ {
174
+ label: e("externalContact.group"),
175
+ key: "externalContactGroup",
176
+ view: /* @__PURE__ */ h(S, {})
177
+ },
178
+ {
179
+ label: e("department.currentUserDepartment"),
180
+ key: "currentDepartment",
181
+ view: /* @__PURE__ */ h(b, {})
182
+ }
183
+ ], [e]);
184
+ };
185
+ //#endregion
186
+ export { C as t };