@hkyhy/marsun-components-core 0.1.29 → 0.1.31

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 (63) hide show
  1. package/dist/components/Auth/UserProfileCard/UserProfileCard.d.ts +7 -1
  2. package/dist/components/Auth/UserProfileCard/UserProfileCard.js +59 -28
  3. package/dist/components/Auth/UserProfileCard/UserProfileCard.js.map +1 -1
  4. package/dist/components/Auth/UserProfileCard/style.module.scss.js +16 -10
  5. package/dist/components/Auth/UserProfileCard/style.module.scss.js.map +1 -1
  6. package/dist/components/Filter/CommonFilter/index.js +88 -53
  7. package/dist/components/Filter/CommonFilter/index.js.map +1 -1
  8. package/dist/components/Filter/FilterCascader/index.d.ts +40 -0
  9. package/dist/components/Filter/FilterCascader/index.js +318 -0
  10. package/dist/components/Filter/FilterCascader/index.js.map +1 -0
  11. package/dist/components/Filter/FilterCascader/style.module.scss.js +14 -0
  12. package/dist/components/Filter/FilterCascader/style.module.scss.js.map +1 -0
  13. package/dist/components/Filter/FilterDatePicker/index.js +102 -84
  14. package/dist/components/Filter/FilterDatePicker/index.js.map +1 -1
  15. package/dist/components/Filter/FilterDateRange/index.js +84 -66
  16. package/dist/components/Filter/FilterDateRange/index.js.map +1 -1
  17. package/dist/components/Filter/FilterInput/index.js +51 -33
  18. package/dist/components/Filter/FilterInput/index.js.map +1 -1
  19. package/dist/components/Filter/FilterNumberRange/index.js +87 -69
  20. package/dist/components/Filter/FilterNumberRange/index.js.map +1 -1
  21. package/dist/components/Filter/FilterPopover/index.d.ts +2 -0
  22. package/dist/components/Filter/FilterPopover/index.js +22 -21
  23. package/dist/components/Filter/FilterPopover/index.js.map +1 -1
  24. package/dist/components/Filter/FilterSelect/index.d.ts +20 -2
  25. package/dist/components/Filter/FilterSelect/index.js +237 -194
  26. package/dist/components/Filter/FilterSelect/index.js.map +1 -1
  27. package/dist/components/Filter/FilterSelect/style.module.scss.js +16 -14
  28. package/dist/components/Filter/FilterSelect/style.module.scss.js.map +1 -1
  29. package/dist/components/Filter/FilterTreeSelect/index.d.ts +18 -1
  30. package/dist/components/Filter/FilterTreeSelect/index.js +278 -218
  31. package/dist/components/Filter/FilterTreeSelect/index.js.map +1 -1
  32. package/dist/components/Filter/FilterTreeSelect/style.module.scss.js +15 -13
  33. package/dist/components/Filter/FilterTreeSelect/style.module.scss.js.map +1 -1
  34. package/dist/components/Filter/FilterTrigger/index.d.ts +3 -0
  35. package/dist/components/Filter/FilterTrigger/index.js +59 -26
  36. package/dist/components/Filter/FilterTrigger/index.js.map +1 -1
  37. package/dist/components/Filter/FilterTrigger/style.module.scss.js +5 -4
  38. package/dist/components/Filter/FilterTrigger/style.module.scss.js.map +1 -1
  39. package/dist/components/Filter/index.d.ts +7 -3
  40. package/dist/components/Filter/types.d.ts +27 -1
  41. package/dist/components/Filter/types.js +24 -7
  42. package/dist/components/Filter/types.js.map +1 -1
  43. package/dist/components/Filter/useFilterState.d.ts +37 -5
  44. package/dist/components/Filter/useFilterState.js +74 -23
  45. package/dist/components/Filter/useFilterState.js.map +1 -1
  46. package/dist/components/Table/ColumnConfigPanel.d.ts +13 -0
  47. package/dist/components/Table/ColumnConfigPanel.js +260 -0
  48. package/dist/components/Table/ColumnConfigPanel.js.map +1 -0
  49. package/dist/components/Table/Table.d.ts +16 -2
  50. package/dist/components/Table/Table.js +106 -28
  51. package/dist/components/Table/Table.js.map +1 -1
  52. package/dist/components/Table/columnConfig.module.scss.js +38 -0
  53. package/dist/components/Table/columnConfig.module.scss.js.map +1 -0
  54. package/dist/components/Table/columnConfigTypes.d.ts +22 -0
  55. package/dist/components/Table/columnConfigUtils.d.ts +25 -0
  56. package/dist/components/Table/columnConfigUtils.js +141 -0
  57. package/dist/components/Table/columnConfigUtils.js.map +1 -0
  58. package/dist/components/Table/index.d.ts +2 -1
  59. package/dist/index.js +289 -276
  60. package/dist/index.js.map +1 -1
  61. package/dist/marsun-components-core.css +1 -1
  62. package/dist/styles/global.css +1 -1
  63. package/package.json +1 -1
@@ -1,309 +1,369 @@
1
- import { jsxs as D, jsx as x } from "react/jsx-runtime";
2
- import { ChevronDown as oe, ChevronRight as ae, Check as fe, X as de } from "../../Icons/index.js";
3
- import { useFetchData as he } from "../../../hooks/useFetchData.js";
4
- import { Input as pe, Checkbox as ue, Space as me } from "antd";
5
- import Y from "classnames";
6
- import { useState as V, useEffect as Z, useMemo as L, useCallback as C } from "react";
7
- import ge from "../FilterPopover/index.js";
8
- import { resolveFilterVisible as O } from "../types.js";
9
- import { useFilterRegister as xe } from "../useFilterState.js";
1
+ import { jsxs as H, jsx as f } from "react/jsx-runtime";
2
+ import { ChevronDown as Te, ChevronRight as ye, Check as ze, X as Pe } from "../../Icons/index.js";
3
+ import { useFetchData as Re } from "../../../hooks/useFetchData.js";
4
+ import { Input as Ae, Spin as je, Checkbox as Ue, Space as Ve } from "antd";
5
+ import R from "classnames";
6
+ import { useRef as oe, useState as A, useEffect as W, useMemo as E, useCallback as X } from "react";
7
+ import Be from "../FilterPopover/index.js";
8
+ import { resolveFilterVisible as ae } from "../types.js";
9
+ import { useFilterFieldBridge as He, useFilterRegister as We } from "../useFilterState.js";
10
10
  import g from "./style.module.scss.js";
11
- import { useMarsunFetch as ve } from "../../../provider/context.js";
12
- const { Search: we } = pe;
13
- function ee(u, f = 0, v = null) {
11
+ import { useMarsunFetch as Xe } from "../../../provider/context.js";
12
+ import $e from "../../Empty/Empty.js";
13
+ const { Search: qe } = Ae;
14
+ function fe(u, v = 0, p = null) {
14
15
  var N;
15
- const h = [];
16
- for (const p of u)
17
- h.push({ id: p.id, name: p.name, depth: f, parentId: v }), (N = p.children) != null && N.length && h.push(...ee(p.children, f + 1, p.id));
18
- return h;
16
+ const d = [];
17
+ for (const m of u)
18
+ d.push({ id: m.id, name: m.name, depth: v, parentId: p }), (N = m.children) != null && N.length && d.push(...fe(m.children, v + 1, m.id));
19
+ return d;
19
20
  }
20
- function Me(u, f) {
21
- if (!f) return u;
22
- const v = f.toLowerCase();
23
- function h(N) {
24
- var P;
25
- const p = [];
26
- for (const d of N) {
27
- const l = (P = d.children) != null && P.length ? h(d.children) : [];
28
- (d.name.toLowerCase().includes(v) || l.length > 0) && p.push({ ...d, children: l.length > 0 ? l : void 0 });
21
+ function Ce(u, v) {
22
+ if (!v) return u;
23
+ const p = v.toLowerCase();
24
+ function d(N) {
25
+ var b;
26
+ const m = [];
27
+ for (const F of N) {
28
+ const h = (b = F.children) != null && b.length ? d(F.children) : [];
29
+ (F.name.toLowerCase().includes(p) || h.length > 0) && m.push({ ...F, children: h.length > 0 ? h : void 0 });
29
30
  }
30
- return p;
31
+ return m;
31
32
  }
32
- return h(u);
33
+ return d(u);
33
34
  }
34
- function te(u) {
35
- var v;
36
- const f = [];
37
- for (const h of u)
38
- (v = h.children) != null && v.length && (f.push(h.id), f.push(...te(h.children)));
39
- return f;
35
+ function de(u) {
36
+ var p;
37
+ const v = [];
38
+ for (const d of u)
39
+ (p = d.children) != null && p.length && (v.push(d.id), v.push(...de(d.children)));
40
+ return v;
40
41
  }
41
- function Se(u, f) {
42
- const v = /* @__PURE__ */ new Map(), h = (N) => {
43
- for (const p of N)
44
- v.set(p.id, f(p)), p.children && h(p.children);
42
+ function Ge(u, v) {
43
+ const p = /* @__PURE__ */ new Map(), d = (N) => {
44
+ for (const m of N)
45
+ p.set(m.id, v(m)), m.children && d(m.children);
45
46
  };
46
- return h(u), v;
47
+ return d(u), p;
47
48
  }
48
- const Re = ({
49
+ const rt = ({
49
50
  filterKey: u,
50
- label: f,
51
- treeData: v,
52
- fetchUrl: h,
51
+ label: v,
52
+ treeData: p,
53
+ fetchUrl: d,
53
54
  fetchOptions: N,
54
- transformData: p,
55
- enabled: P = !0,
56
- value: d,
57
- onChange: l,
58
- showSearch: E = !1,
59
- multiple: o = !1,
60
- leafOnly: k = !1,
61
- active: se,
62
- hidden: U,
63
- display: B,
64
- getNodeLabel: _ = (z) => z.name
55
+ transformData: m,
56
+ loadData: b,
57
+ enabled: F = !0,
58
+ value: h,
59
+ onChange: a,
60
+ showSearch: y = !1,
61
+ multiple: n = !1,
62
+ leafOnly: L = !1,
63
+ active: he,
64
+ hidden: $,
65
+ display: q,
66
+ dependsOn: ue,
67
+ clearOnDepsChange: pe = !0,
68
+ getNodeLabel: ee = (z) => z.name,
69
+ panelExtra: C,
70
+ panelWidth: me,
71
+ loading: ge = !1
65
72
  }) => {
66
- const z = ve(), { data: re } = he({
67
- data: v,
68
- fetchUrl: h,
73
+ const z = oe(a);
74
+ z.current = a;
75
+ const ve = me ?? (C ? 460 : void 0), { resolvedLabel: j, values: xe, depsKey: we } = He({
76
+ filterKey: u,
77
+ value: h,
78
+ label: v,
79
+ dependsOn: ue,
80
+ clearOnDepsChange: pe,
81
+ onDepsClear: () => {
82
+ var e;
83
+ return (e = z.current) == null ? void 0 : e.call(z, n ? [] : void 0);
84
+ }
85
+ }), G = Xe(), te = p != null || !b && !!d, { data: be, loading: Me } = Re({
86
+ data: p,
87
+ fetchUrl: te && !b ? d : void 0,
69
88
  fetchOptions: N,
70
- transformData: p,
71
- enabled: P,
72
- baseUrl: z.baseUrl,
73
- defaultHeaders: z.headers,
74
- timeoutMs: z.timeoutMs
75
- }), M = re ?? [], [ce, R] = V(!1), [m, w] = V(
76
- d ?? (o ? [] : void 0)
77
- ), [H, y] = V(/* @__PURE__ */ new Set()), [T, X] = V(""), A = xe(), $ = { filterKey: u, label: f, value: d };
78
- Z(() => {
79
- w(d ?? (o ? [] : void 0)), d == null && X("");
80
- }, [d, o]), Z(() => {
81
- M.length && y(new Set(te(M)));
89
+ transformData: m,
90
+ enabled: F && te && !b,
91
+ baseUrl: G.baseUrl,
92
+ defaultHeaders: G.headers,
93
+ timeoutMs: G.timeoutMs
94
+ }), [Se, se] = A([]), [Le, re] = A(!1), J = oe(b);
95
+ J.current = b, W(() => {
96
+ if (!J.current || p != null || !F) return;
97
+ let e = !1;
98
+ return re(!0), (async () => {
99
+ try {
100
+ const t = await J.current({ values: xe });
101
+ e || se(t ?? []);
102
+ } catch {
103
+ e || se([]);
104
+ } finally {
105
+ e || re(!1);
106
+ }
107
+ })(), () => {
108
+ e = !0;
109
+ };
110
+ }, [we, F, p, b]);
111
+ const M = p ?? (b ? Se : be ?? []), ce = ge || Me || Le, [ke, V] = A(!1), [x, w] = A(
112
+ h ?? (n ? [] : void 0)
113
+ ), [Q, ie] = A(/* @__PURE__ */ new Set()), [T, Y] = A(""), U = We(), Z = { filterKey: u, label: j, value: h };
114
+ W(() => {
115
+ w(h ?? (n ? [] : void 0)), h == null && Y("");
116
+ }, [h, n]), W(() => {
117
+ M.length && ie(new Set(de(M)));
82
118
  }, [M]);
83
- const j = L(
84
- () => Se(M, _),
85
- [M, _]
86
- ), q = L(() => {
87
- if (!M.length || d == null) return "";
88
- if (o) {
89
- const e = d;
90
- return e.length > 0 ? e.map((t) => j.get(t) ?? t).join("、") : "";
119
+ const B = E(
120
+ () => Ge(M, ee),
121
+ [M, ee]
122
+ ), _ = E(() => {
123
+ if (!M.length || h == null) return "";
124
+ if (n) {
125
+ const e = h;
126
+ return e.length > 0 ? e.map((t) => B.get(t) ?? t).join("、") : "";
91
127
  }
92
- return j.get(d) ?? "";
93
- }, [M, d, o, j]);
94
- Z(() => {
95
- if (A) {
96
- if (!O({ display: B, hidden: U }, $)) {
97
- A.unregister(u);
128
+ return B.get(h) ?? "";
129
+ }, [M, h, n, B]);
130
+ W(() => {
131
+ if (U) {
132
+ if (!ae({ display: q, hidden: $ }, Z)) {
133
+ U.unregister(u);
98
134
  return;
99
135
  }
100
- q ? A.register(u, {
101
- label: f,
102
- valueLabel: q,
103
- onRemove: () => l == null ? void 0 : l(o ? [] : void 0)
104
- }) : A.unregister(u);
136
+ _ ? U.register(u, {
137
+ label: j,
138
+ valueLabel: _,
139
+ onRemove: () => a == null ? void 0 : a(n ? [] : void 0)
140
+ }) : U.unregister(u);
105
141
  }
106
142
  }, [
107
- q,
143
+ _,
108
144
  u,
109
- f,
110
- B,
145
+ j,
146
+ q,
147
+ $,
111
148
  U,
112
- A,
113
- l,
114
- o,
115
- $
149
+ a,
150
+ n,
151
+ Z
116
152
  ]);
117
- const S = L(
118
- () => E && T ? Me(M, T) : M,
119
- [E, T, M]
120
- ), K = L(() => ee(S), [S]), F = L(() => {
121
- const e = /* @__PURE__ */ new Map(), t = (a) => {
153
+ const S = E(
154
+ () => y && T ? Ce(M, T) : M,
155
+ [y, T, M]
156
+ ), ne = E(() => fe(S), [S]), P = E(() => {
157
+ const e = /* @__PURE__ */ new Map(), t = (o) => {
122
158
  var r;
123
- for (const s of a)
159
+ for (const s of o)
124
160
  e.set(s.id, !!((r = s.children) != null && r.length)), s.children && t(s.children);
125
161
  };
126
162
  return t(S), e;
127
- }, [S]), G = L(() => {
128
- const e = /* @__PURE__ */ new Map(), t = (a) => {
163
+ }, [S]), K = E(() => {
164
+ const e = /* @__PURE__ */ new Map(), t = (o) => {
129
165
  var r;
130
- for (const s of a)
166
+ for (const s of o)
131
167
  if ((r = s.children) != null && r.length) {
132
- const c = [], i = (n) => {
133
- var b;
134
- c.push(n.id), (b = n.children) == null || b.forEach(i);
168
+ const c = [], l = (i) => {
169
+ var k;
170
+ c.push(i.id), (k = i.children) == null || k.forEach(l);
135
171
  };
136
- s.children.forEach(i), e.set(s.id, c), t(s.children);
172
+ s.children.forEach(l), e.set(s.id, c), t(s.children);
137
173
  }
138
174
  };
139
175
  return t(S), e;
140
- }, [S]), I = L(() => {
141
- const e = /* @__PURE__ */ new Map(), t = (a) => {
176
+ }, [S]), le = E(() => {
177
+ const e = /* @__PURE__ */ new Map(), t = (o) => {
142
178
  var r;
143
- for (const s of a)
179
+ for (const s of o)
144
180
  if ((r = s.children) != null && r.length) {
145
181
  for (const c of s.children) e.set(c.id, s.id);
146
182
  t(s.children);
147
183
  }
148
184
  };
149
185
  return t(S), e;
150
- }, [S]), J = L(() => {
151
- const e = /* @__PURE__ */ new Map(), t = (a) => {
186
+ }, [S]), D = E(() => {
187
+ const e = /* @__PURE__ */ new Map(), t = (o) => {
152
188
  var r;
153
- for (const s of a) {
189
+ for (const s of o) {
154
190
  if (!((r = s.children) != null && r.length)) continue;
155
- const c = [], i = (n) => {
156
- var b;
157
- if (!((b = n.children) != null && b.length)) {
158
- c.push(n.id);
191
+ const c = [], l = (i) => {
192
+ var k;
193
+ if (!((k = i.children) != null && k.length)) {
194
+ c.push(i.id);
159
195
  return;
160
196
  }
161
- n.children.forEach(i);
197
+ i.children.forEach(l);
162
198
  };
163
- s.children.forEach(i), e.set(s.id, c), t(s.children);
199
+ s.children.forEach(l), e.set(s.id, c), t(s.children);
164
200
  }
165
201
  };
166
202
  return t(S), e;
167
- }, [S]), Q = C((e) => {
168
- y((t) => {
169
- const a = new Set(t);
170
- return a.has(e) ? a.delete(e) : a.add(e), a;
203
+ }, [S]), I = X((e) => {
204
+ ie((t) => {
205
+ const o = new Set(t);
206
+ return o.has(e) ? o.delete(e) : o.add(e), o;
171
207
  });
172
- }, []), ne = C(
208
+ }, []), Ne = X(
173
209
  (e) => {
174
- if (k && F.get(e)) {
175
- Q(e);
210
+ if (L && P.get(e)) {
211
+ I(e);
176
212
  return;
177
213
  }
178
- const t = m === e ? void 0 : e;
179
- w(t), l == null || l(t), R(!1);
214
+ const t = x === e ? void 0 : e;
215
+ w(t), a == null || a(t), V(!1);
180
216
  },
181
- [m, l, k, F, Q]
182
- ), W = C(
217
+ [x, a, L, P, I]
218
+ ), O = X(
183
219
  (e) => {
184
- const t = (m || []).slice(), a = G.get(e), r = J.get(e), s = I.get(e);
185
- if (k && (r != null && r.length)) {
186
- if (r.every((i) => t.includes(i))) {
187
- const i = new Set(r);
188
- w(t.filter((n) => !i.has(n)));
220
+ const t = (x || []).slice(), o = K.get(e), r = D.get(e), s = le.get(e);
221
+ if (L && (r != null && r.length)) {
222
+ if (r.every((l) => t.includes(l))) {
223
+ const l = new Set(r);
224
+ w(t.filter((i) => !l.has(i)));
189
225
  } else
190
226
  w([.../* @__PURE__ */ new Set([...t, ...r])]);
191
227
  return;
192
228
  }
193
- if (a)
229
+ if (o)
194
230
  if (t.includes(e)) {
195
- const i = /* @__PURE__ */ new Set([e, ...a]);
196
- w(t.filter((n) => !i.has(n)));
231
+ const l = /* @__PURE__ */ new Set([e, ...o]);
232
+ w(t.filter((i) => !l.has(i)));
197
233
  } else
198
- w([.../* @__PURE__ */ new Set([...t, e, ...a])]);
234
+ w([.../* @__PURE__ */ new Set([...t, e, ...o])]);
199
235
  else if (t.includes(e)) {
200
- const c = t.filter((i) => i !== e);
236
+ const c = t.filter((l) => l !== e);
201
237
  w(
202
- s && c.includes(s) ? c.filter((i) => i !== s) : c
238
+ s && c.includes(s) ? c.filter((l) => l !== s) : c
203
239
  );
204
240
  } else {
205
241
  const c = [...t, e];
206
- s && !k && (G.get(s) || []).every((n) => c.includes(n)) ? w([.../* @__PURE__ */ new Set([...c, s])]) : w(c);
242
+ s && !L && (K.get(s) || []).every((i) => c.includes(i)) ? w([.../* @__PURE__ */ new Set([...c, s])]) : w(c);
207
243
  }
208
244
  },
209
- [m, G, I, k, J]
210
- ), ie = C(
211
- (e) => e.parentId === null || E && T ? !0 : H.has(e.parentId),
212
- [H, E, T]
245
+ [x, K, le, L, D]
246
+ ), Fe = X(
247
+ (e) => e.parentId === null || y && T ? !0 : Q.has(e.parentId),
248
+ [Q, y, T]
213
249
  );
214
- return O({ display: B, hidden: U }, $) ? /* @__PURE__ */ D(
215
- ge,
250
+ return ae({ display: q, hidden: $ }, Z) ? /* @__PURE__ */ H(
251
+ Be,
216
252
  {
217
- label: f,
218
- active: se || (o ? (m == null ? void 0 : m.length) > 0 : !!d),
219
- open: ce,
220
- onOpenChange: R,
221
- onConfirm: o ? () => {
222
- let e = m;
223
- k && Array.isArray(e) && (e = e.filter((t) => !F.get(t))), l == null || l(e), R(!1);
253
+ label: j,
254
+ active: he || (n ? (x == null ? void 0 : x.length) > 0 : !!h),
255
+ loading: ce,
256
+ open: ke,
257
+ onOpenChange: V,
258
+ width: ve,
259
+ onConfirm: n ? () => {
260
+ let e = x;
261
+ L && Array.isArray(e) && (e = e.filter((t) => !P.get(t))), a == null || a(e), V(!1);
224
262
  } : void 0,
225
263
  onReset: () => {
226
- const e = o ? [] : void 0;
227
- w(e), X(""), l == null || l(e), R(!1);
264
+ const e = n ? [] : void 0;
265
+ w(e), Y(""), a == null || a(e), V(!1);
228
266
  },
229
267
  children: [
230
- E && /* @__PURE__ */ x(
231
- we,
268
+ y && /* @__PURE__ */ f(
269
+ qe,
232
270
  {
233
- placeholder: `搜索${f}`,
271
+ placeholder: `搜索${j}`,
234
272
  allowClear: !0,
235
273
  size: "middle",
236
- className: Y("filter-tree-select-search", g["filter-tree-select-search"]),
274
+ className: R("filter-tree-select-search", g["filter-tree-select-search"]),
237
275
  value: T,
238
- onChange: (e) => X(e.target.value)
276
+ onChange: (e) => Y(e.target.value)
239
277
  }
240
278
  ),
241
- /* @__PURE__ */ D(
279
+ C ? /* @__PURE__ */ f(
242
280
  "div",
243
281
  {
244
- className: Y("filter-tree-select-options", g["filter-tree-select-options"]),
245
- children: [
246
- K.map((e) => {
247
- if (!ie(e)) return null;
248
- const t = !F.get(e.id), a = H.has(e.id), r = !o && m === e.id, s = o ? m || [] : [];
249
- let c = o && s.includes(e.id), i = !1;
250
- if (o && k && !t) {
251
- const n = J.get(e.id) || [], b = n.filter((le) => s.includes(le)).length;
252
- c = n.length > 0 && b === n.length, i = b > 0 && b < n.length;
253
- }
254
- return /* @__PURE__ */ D(
255
- "div",
256
- {
257
- className: Y(
258
- "filter-tree-select-option",
259
- g["filter-tree-select-option"],
260
- r && g["filter-tree-select-option-selected"]
282
+ className: R(
283
+ "filter-tree-select-panel-extra",
284
+ g["filter-tree-select-panel-extra"]
285
+ ),
286
+ children: C
287
+ }
288
+ ) : null,
289
+ /* @__PURE__ */ f(
290
+ "div",
291
+ {
292
+ className: R("filter-tree-select-options", g["filter-tree-select-options"]),
293
+ children: ce ? /* @__PURE__ */ f(
294
+ "div",
295
+ {
296
+ className: R(
297
+ "filter-tree-select-loading",
298
+ g["filter-tree-select-loading"]
299
+ ),
300
+ children: /* @__PURE__ */ f(je, { size: "small" })
301
+ }
302
+ ) : ne.length === 0 ? /* @__PURE__ */ f(
303
+ "div",
304
+ {
305
+ className: R("filter-tree-select-empty", g["filter-tree-select-empty"]),
306
+ children: /* @__PURE__ */ f($e, { iconType: "simple", description: "暂无数据" })
307
+ }
308
+ ) : ne.map((e) => {
309
+ if (!Fe(e)) return null;
310
+ const t = !P.get(e.id), o = Q.has(e.id), r = !n && x === e.id, s = n ? x || [] : [];
311
+ let c = n && s.includes(e.id), l = !1;
312
+ if (n && L && !t) {
313
+ const i = D.get(e.id) || [], k = i.filter((Ee) => s.includes(Ee)).length;
314
+ c = i.length > 0 && k === i.length, l = k > 0 && k < i.length;
315
+ }
316
+ return /* @__PURE__ */ H(
317
+ "div",
318
+ {
319
+ className: R(
320
+ "filter-tree-select-option",
321
+ g["filter-tree-select-option"],
322
+ r && g["filter-tree-select-option-selected"]
323
+ ),
324
+ style: { paddingLeft: 8 + e.depth * 20 },
325
+ onClick: () => n ? O(e.id) : Ne(e.id),
326
+ children: [
327
+ t ? /* @__PURE__ */ f("span", { className: g["filter-tree-select-expand-placeholder"] }) : /* @__PURE__ */ f(
328
+ "span",
329
+ {
330
+ className: g["filter-tree-select-expand-icon"],
331
+ onClick: (i) => {
332
+ i.stopPropagation(), I(e.id);
333
+ },
334
+ children: o || y && T ? /* @__PURE__ */ f(Te, { style: { fontSize: 10 } }) : /* @__PURE__ */ f(ye, { style: { fontSize: 10 } })
335
+ }
336
+ ),
337
+ n && /* @__PURE__ */ f(
338
+ Ue,
339
+ {
340
+ checked: c,
341
+ indeterminate: l,
342
+ onClick: (i) => i.stopPropagation(),
343
+ onChange: () => O(e.id)
344
+ }
261
345
  ),
262
- style: { paddingLeft: 8 + e.depth * 20 },
263
- onClick: () => o ? W(e.id) : ne(e.id),
264
- children: [
265
- t ? /* @__PURE__ */ x("span", { className: g["filter-tree-select-expand-placeholder"] }) : /* @__PURE__ */ x(
266
- "span",
267
- {
268
- className: g["filter-tree-select-expand-icon"],
269
- onClick: (n) => {
270
- n.stopPropagation(), Q(e.id);
271
- },
272
- children: a || E && T ? /* @__PURE__ */ x(oe, { style: { fontSize: 10 } }) : /* @__PURE__ */ x(ae, { style: { fontSize: 10 } })
273
- }
274
- ),
275
- o && /* @__PURE__ */ x(
276
- ue,
277
- {
278
- checked: c,
279
- indeterminate: i,
280
- onClick: (n) => n.stopPropagation(),
281
- onChange: () => W(e.id)
282
- }
283
- ),
284
- /* @__PURE__ */ x("span", { className: g["filter-tree-select-node-label"], children: e.name }),
285
- !o && r && /* @__PURE__ */ x(fe, { className: g["filter-tree-select-option-check"] })
286
- ]
287
- },
288
- e.id
289
- );
290
- }),
291
- K.length === 0 && /* @__PURE__ */ x("div", { className: g["filter-tree-select-empty"], children: "暂无数据" })
292
- ]
346
+ /* @__PURE__ */ f("span", { className: g["filter-tree-select-node-label"], children: e.name }),
347
+ !n && r && /* @__PURE__ */ f(ze, { className: g["filter-tree-select-option-check"] })
348
+ ]
349
+ },
350
+ e.id
351
+ );
352
+ })
293
353
  }
294
354
  ),
295
- o && (k ? (m || []).some((e) => !F.get(e)) : (m || []).length > 0) && /* @__PURE__ */ D("div", { className: g["filter-tree-select-selected-bar"], children: [
296
- /* @__PURE__ */ x("div", { className: g["filter-tree-select-selected-label"], children: "已选:" }),
297
- /* @__PURE__ */ x(me, { size: [4, 4], wrap: !0, children: (m || []).filter((e) => !(k && F.get(e))).map((e) => /* @__PURE__ */ D(
355
+ n && (L ? (x || []).some((e) => !P.get(e)) : (x || []).length > 0) && /* @__PURE__ */ H("div", { className: g["filter-tree-select-selected-bar"], children: [
356
+ /* @__PURE__ */ f("div", { className: g["filter-tree-select-selected-label"], children: "已选:" }),
357
+ /* @__PURE__ */ f(Ve, { size: [4, 4], wrap: !0, children: (x || []).filter((e) => !(L && P.get(e))).map((e) => /* @__PURE__ */ H(
298
358
  "span",
299
359
  {
300
360
  className: g["filter-tree-select-selected-tag"],
301
361
  onClick: (t) => {
302
- t.stopPropagation(), W(e);
362
+ t.stopPropagation(), O(e);
303
363
  },
304
364
  children: [
305
- j.get(e) ?? e,
306
- /* @__PURE__ */ x(de, { className: g["filter-tree-select-selected-remove"] })
365
+ B.get(e) ?? e,
366
+ /* @__PURE__ */ f(Pe, { className: g["filter-tree-select-selected-remove"] })
307
367
  ]
308
368
  },
309
369
  e
@@ -314,6 +374,6 @@ const Re = ({
314
374
  ) : null;
315
375
  };
316
376
  export {
317
- Re as default
377
+ rt as default
318
378
  };
319
379
  //# sourceMappingURL=index.js.map