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