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