bj-web-components 0.2.17 → 0.2.19
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/index.d.ts +23 -2
- package/dist/miniapp.d.ts +1 -1
- package/dist/mobile.d.ts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/web/Dropdown/BDropdown.js +1 -1
- package/dist/web/Dropdown/BDropdown.mjs +38 -38
- package/dist/web/Table/BTable.js +1 -1
- package/dist/web/Table/BTable.mjs +447 -419
- package/dist/web.d.ts +1138 -2
- package/package.json +1 -1
- package/dist/miniapp/index.d.ts +0 -0
- package/dist/mobile/index.d.ts +0 -0
- package/dist/react/index.d.ts +0 -0
- package/dist/shared/index.d.ts +0 -0
- package/dist/web/BasicInput/BInput.d.ts +0 -3
- package/dist/web/BasicInput/index.d.ts +0 -2
- package/dist/web/BasicInput/types.d.ts +0 -32
- package/dist/web/BasicInput/utils.d.ts +0 -13
- package/dist/web/CategoryDropdown/CategoryDropdown.d.ts +0 -2
- package/dist/web/CategoryDropdown/index.d.ts +0 -2
- package/dist/web/CategoryDropdown/types.d.ts +0 -31
- package/dist/web/CheckBox/BCheckBox.d.ts +0 -3
- package/dist/web/CheckBox/Group.d.ts +0 -3
- package/dist/web/CheckBox/context.d.ts +0 -11
- package/dist/web/CheckBox/index.d.ts +0 -9
- package/dist/web/CheckBox/types.d.ts +0 -54
- package/dist/web/Dropdown/BDropdown.d.ts +0 -2
- package/dist/web/Dropdown/index.d.ts +0 -2
- package/dist/web/Dropdown/types.d.ts +0 -41
- package/dist/web/EmptyInputBox/EmptyInputBox.d.ts +0 -3
- package/dist/web/EmptyInputBox/index.d.ts +0 -2
- package/dist/web/EmptyInputBox/types.d.ts +0 -28
- package/dist/web/FileCard/FileCard.d.ts +0 -2
- package/dist/web/FileCard/index.d.ts +0 -2
- package/dist/web/FileCard/types.d.ts +0 -20
- package/dist/web/Icon/Icon.d.ts +0 -6
- package/dist/web/Icon/index.d.ts +0 -2
- package/dist/web/Icon/types.d.ts +0 -11
- package/dist/web/Input/Input.d.ts +0 -3
- package/dist/web/Input/index.d.ts +0 -2
- package/dist/web/Input/types.d.ts +0 -55
- package/dist/web/InputNumber/BInputNumber.d.ts +0 -3
- package/dist/web/InputNumber/StepHandler.d.ts +0 -10
- package/dist/web/InputNumber/hooks/useCursor.d.ts +0 -2
- package/dist/web/InputNumber/hooks/useFrame.d.ts +0 -2
- package/dist/web/InputNumber/index.d.ts +0 -2
- package/dist/web/InputNumber/types.d.ts +0 -60
- package/dist/web/InputNumber/utils/decimal.d.ts +0 -46
- package/dist/web/Modal/Modal.d.ts +0 -2
- package/dist/web/Modal/index.d.ts +0 -2
- package/dist/web/Modal/types.d.ts +0 -42
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.d.ts +0 -2
- package/dist/web/OverlayScrollbar/index.d.ts +0 -2
- package/dist/web/OverlayScrollbar/types.d.ts +0 -18
- package/dist/web/Pagination/Pagination.d.ts +0 -3
- package/dist/web/Pagination/index.d.ts +0 -2
- package/dist/web/Pagination/types.d.ts +0 -44
- package/dist/web/ProductField/ProductField.d.ts +0 -2
- package/dist/web/ProductField/index.d.ts +0 -2
- package/dist/web/ProductField/types.d.ts +0 -48
- package/dist/web/SkuInputCard/SkuInputCard.d.ts +0 -2
- package/dist/web/SkuInputCard/index.d.ts +0 -2
- package/dist/web/SkuInputCard/types.d.ts +0 -63
- package/dist/web/Switch/Switch.d.ts +0 -6
- package/dist/web/Switch/index.d.ts +0 -2
- package/dist/web/Switch/types.d.ts +0 -29
- package/dist/web/Table/BTable.d.ts +0 -10
- package/dist/web/Table/Column.d.ts +0 -3
- package/dist/web/Table/ColumnGroup.d.ts +0 -3
- package/dist/web/Table/index.d.ts +0 -4
- package/dist/web/Table/types.d.ts +0 -299
- package/dist/web/Table/utils/columns.d.ts +0 -11
- package/dist/web/Table/utils/sortFilter.d.ts +0 -7
- package/dist/web/Tabs/BTabs.d.ts +0 -8
- package/dist/web/Tabs/TabPane.d.ts +0 -7
- package/dist/web/Tabs/index.d.ts +0 -3
- package/dist/web/Tabs/types.d.ts +0 -32
- package/dist/web/Tooltip/ConfirmTooltip.d.ts +0 -2
- package/dist/web/Tooltip/ContentTooltip.d.ts +0 -2
- package/dist/web/Tooltip/ProgressTooltip.d.ts +0 -2
- package/dist/web/Tooltip/TooltipWrapper.d.ts +0 -3
- package/dist/web/Tooltip/index.d.ts +0 -6
- package/dist/web/Tooltip/types.d.ts +0 -36
- package/dist/web/Tooltip/useAutoPlacement.d.ts +0 -7
- package/dist/web/index.d.ts +0 -18
|
@@ -1,327 +1,348 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as P, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as ne, useMemo as Q, useState as k, useEffect as Y, createElement as Ke, isValidElement as Zt } from "react";
|
|
3
|
+
import { createPortal as Xt } from "react-dom";
|
|
4
|
+
import Yt from "../Pagination/Pagination.mjs";
|
|
5
|
+
import Be from "../Icon/Icon.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { BCheckBox as
|
|
10
|
-
import { BDropdown as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { getColumnKey as
|
|
17
|
-
import { convertChildrenToColumns as
|
|
7
|
+
import Ct from "../Tooltip/ContentTooltip.mjs";
|
|
8
|
+
import er from "../Tooltip/TooltipWrapper.mjs";
|
|
9
|
+
import { BCheckBox as tr } from "../CheckBox/index.mjs";
|
|
10
|
+
import { BDropdown as rr } from "../Dropdown/BDropdown.mjs";
|
|
11
|
+
import ar from "../OverlayScrollbar/BOverlayScrollbar.mjs";
|
|
12
|
+
import ir from "../SkuInputCard/spin_loading_red.gif.mjs";
|
|
13
|
+
import sr from "../ProductField/no_data_light.png.mjs";
|
|
14
|
+
import nr from "./Column.mjs";
|
|
15
|
+
import lr from "./ColumnGroup.mjs";
|
|
16
|
+
import { getColumnKey as E, filterRecords as dt, sortRecords as ct, renderColumnTitle as ft, getNextSortOrder as dr, getSorterResult as cr } from "./utils/sortFilter.mjs";
|
|
17
|
+
import { convertChildrenToColumns as fr, flattenColumns as br, buildHeaderRows as hr } from "./utils/columns.mjs";
|
|
18
18
|
/* empty css */
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
return
|
|
19
|
+
const or = 300;
|
|
20
|
+
function I(...u) {
|
|
21
|
+
return u.filter(Boolean).join(" ");
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
25
|
-
if (!(
|
|
26
|
-
return
|
|
27
|
-
},
|
|
23
|
+
function ur(u, o) {
|
|
24
|
+
return o === void 0 ? void 0 : (Array.isArray(o) ? o : [o]).reduce((F, n) => {
|
|
25
|
+
if (!(F == null || typeof F != "object"))
|
|
26
|
+
return F[n];
|
|
27
|
+
}, u);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
if (typeof
|
|
31
|
-
return
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
if (typeof
|
|
35
|
-
return
|
|
29
|
+
function G(u, o, _) {
|
|
30
|
+
if (typeof _ == "function")
|
|
31
|
+
return _(u, o);
|
|
32
|
+
if (_) {
|
|
33
|
+
const F = u[String(_)];
|
|
34
|
+
if (typeof F == "string" || typeof F == "number")
|
|
35
|
+
return F;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return o;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return Math.max(1, Math.ceil(
|
|
39
|
+
function _r(u, o) {
|
|
40
|
+
return Math.max(1, Math.ceil(u / o));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return !!(
|
|
42
|
+
function yr(u) {
|
|
43
|
+
return !!(u && typeof u == "object" && !Zt(u) && "props" in u);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return (typeof
|
|
45
|
+
function jr(u, o) {
|
|
46
|
+
return (typeof o.text == "string" || typeof o.text == "number" ? String(o.text) : String(o.value)).toLocaleLowerCase().includes(u.toLocaleLowerCase());
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
checked:
|
|
50
|
-
disabled:
|
|
51
|
-
label:
|
|
52
|
-
name:
|
|
53
|
-
onChange:
|
|
54
|
-
type:
|
|
48
|
+
function bt({
|
|
49
|
+
checked: u,
|
|
50
|
+
disabled: o,
|
|
51
|
+
label: _,
|
|
52
|
+
name: F,
|
|
53
|
+
onChange: n,
|
|
54
|
+
type: L = "checkbox"
|
|
55
55
|
}) {
|
|
56
|
-
return
|
|
57
|
-
|
|
56
|
+
return L === "checkbox" ? /* @__PURE__ */ f(
|
|
57
|
+
tr,
|
|
58
58
|
{
|
|
59
|
-
"aria-label":
|
|
60
|
-
checked:
|
|
59
|
+
"aria-label": _,
|
|
60
|
+
checked: u,
|
|
61
61
|
className: "bj-table__selection-checkbox",
|
|
62
|
-
disabled:
|
|
63
|
-
name:
|
|
64
|
-
onChange:
|
|
62
|
+
disabled: o,
|
|
63
|
+
name: F,
|
|
64
|
+
onChange: n,
|
|
65
65
|
skipGroup: !0
|
|
66
66
|
}
|
|
67
|
-
) : /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
67
|
+
) : /* @__PURE__ */ P("label", { className: I("bj-table__selection-control", u && "bj-table__selection-control--checked", o && "bj-table__selection-control--disabled"), children: [
|
|
68
|
+
/* @__PURE__ */ f(
|
|
69
69
|
"input",
|
|
70
70
|
{
|
|
71
|
-
"aria-label":
|
|
72
|
-
checked:
|
|
71
|
+
"aria-label": _,
|
|
72
|
+
checked: u,
|
|
73
73
|
className: "bj-table__selection-input",
|
|
74
|
-
disabled:
|
|
75
|
-
name:
|
|
76
|
-
onChange:
|
|
77
|
-
type:
|
|
74
|
+
disabled: o,
|
|
75
|
+
name: F,
|
|
76
|
+
onChange: n,
|
|
77
|
+
type: L
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: "bj-table__selection-box", children: u && /* @__PURE__ */ f(Be, { className: "bj-table__selection-check-icon", type: "icon-a-dagouxi" }) })
|
|
81
81
|
] });
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
columns:
|
|
85
|
-
dataSource:
|
|
86
|
-
rowKey:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
83
|
+
function pr({
|
|
84
|
+
columns: u,
|
|
85
|
+
dataSource: o = [],
|
|
86
|
+
rowKey: _,
|
|
87
|
+
preserveSelectedRowKeys: F = !1,
|
|
88
|
+
rowSelection: n,
|
|
89
|
+
pagination: L = !1,
|
|
90
|
+
loading: ue = !1,
|
|
91
|
+
bordered: ot = !0,
|
|
92
|
+
size: ut = "middle",
|
|
93
|
+
showHeader: _t = !0,
|
|
94
|
+
emptyText: _e,
|
|
95
|
+
emptyImage: ye = sr,
|
|
96
|
+
emptyHeight: yt,
|
|
97
|
+
t: Z = (le) => le,
|
|
98
|
+
className: jt,
|
|
99
|
+
style: pt,
|
|
100
|
+
rowClassName: je,
|
|
101
|
+
sortDirections: mt = ["ascend", "descend", null],
|
|
102
|
+
onChange: pe,
|
|
103
|
+
children: ze,
|
|
104
|
+
title: Me,
|
|
105
|
+
footer: Te,
|
|
106
|
+
summary: Ie,
|
|
107
|
+
tableLayout: Se,
|
|
108
|
+
components: g,
|
|
109
|
+
onRow: me,
|
|
110
|
+
onHeaderRow: ve,
|
|
111
|
+
id: vt,
|
|
112
|
+
scroll: b,
|
|
113
|
+
locale: X,
|
|
114
|
+
groupCollapse: h
|
|
113
115
|
}) {
|
|
114
|
-
var
|
|
115
|
-
const
|
|
116
|
-
() =>
|
|
117
|
-
[
|
|
118
|
-
),
|
|
119
|
-
(
|
|
120
|
-
), [
|
|
121
|
-
|
|
122
|
-
), [
|
|
123
|
-
|
|
124
|
-
), [
|
|
125
|
-
() => new Map(
|
|
126
|
-
), [
|
|
127
|
-
() => new Map(
|
|
128
|
-
), [
|
|
129
|
-
|
|
116
|
+
var it, st, nt;
|
|
117
|
+
const le = ne(null), Ve = ne(null), de = Q(
|
|
118
|
+
() => u ?? fr(ze),
|
|
119
|
+
[ze, u]
|
|
120
|
+
), C = Q(() => br(de), [de]), we = Q(() => hr(de), [de]), [gt, Ge] = k(
|
|
121
|
+
(n == null ? void 0 : n.defaultSelectedRowKeys) ?? []
|
|
122
|
+
), [ge, ce] = k(
|
|
123
|
+
L ? L.defaultCurrent ?? 1 : 1
|
|
124
|
+
), [Nt, xt] = k(
|
|
125
|
+
L ? L.defaultPageSize ?? 10 : 10
|
|
126
|
+
), [Ft, Dt] = k(
|
|
127
|
+
() => new Map(C.flatMap((e, t) => e.defaultSortOrder ? [[E(e, t), e.defaultSortOrder]] : []))
|
|
128
|
+
), [kt, Pt] = k(
|
|
129
|
+
() => new Map(C.flatMap((e, t) => e.defaultFilteredValue === void 0 ? [] : [[E(e, t), e.defaultFilteredValue]]))
|
|
130
|
+
), [Rt, Ot] = k(
|
|
131
|
+
h != null && h.defaultExpandedKeys ? [...h.defaultExpandedKeys] : []
|
|
132
|
+
), [S, U] = k(null), [Le, ee] = k(/* @__PURE__ */ new Map()), [Et, fe] = k(null), Kt = ne(`btable-${Math.random().toString(36).slice(2, 10)}`).current, [W, Ne] = k(null), [xe, Ae] = k(null), [Fe, qe] = k(""), [te, He] = k(""), [Bt, De] = k(), ke = ne(0), Pe = ne(!1), a = L || void 0, A = (a == null ? void 0 : a.pageSize) ?? Nt, K = (n == null ? void 0 : n.selectedRowKeys) ?? gt, N = C, R = new Map(Ft), B = new Map(kt);
|
|
133
|
+
N.forEach((e, t) => {
|
|
130
134
|
if ("children" in e) return;
|
|
131
|
-
const r =
|
|
132
|
-
e.sortOrder !== void 0 &&
|
|
135
|
+
const r = E(e, t);
|
|
136
|
+
e.sortOrder !== void 0 && R.set(r, e.sortOrder), e.filteredValue !== void 0 && B.set(r, e.filteredValue);
|
|
133
137
|
});
|
|
134
|
-
const
|
|
135
|
-
() =>
|
|
136
|
-
[
|
|
137
|
-
),
|
|
138
|
-
() =>
|
|
139
|
-
[
|
|
140
|
-
),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
const Ue = Q(
|
|
139
|
+
() => dt(o, N, B),
|
|
140
|
+
[N, B, o]
|
|
141
|
+
), z = Q(
|
|
142
|
+
() => ct(Ue, N, R),
|
|
143
|
+
[N, Ue, R]
|
|
144
|
+
), We = (a == null ? void 0 : a.total) ?? z.length, $e = _r(We, A), q = Math.min((a == null ? void 0 : a.current) ?? ge, $e), $ = (h == null ? void 0 : h.expandedKeys) ?? Rt, re = (e, t) => h != null && h.isGroupRow ? h.isGroupRow(e, t) : !!e.isGroup, be = (e, t) => h != null && h.groupKey ? h.groupKey(e, t) : e.groupId, Je = (e, t) => h != null && h.childrenKeys ? h.childrenKeys(e, t) : e.childrenIds ?? [], zt = (e, t) => {
|
|
145
|
+
var c;
|
|
146
|
+
const r = be(e, t), s = $.includes(r), l = s ? $.filter((i) => i !== r) : [...$, r];
|
|
147
|
+
(h == null ? void 0 : h.expandedKeys) === void 0 && Ot(l), (c = h == null ? void 0 : h.onExpandedKeysChange) == null || c.call(h, l, e, !s);
|
|
148
|
+
};
|
|
149
|
+
Y(() => {
|
|
150
|
+
q !== ge && (a == null ? void 0 : a.current) === void 0 && ce(q);
|
|
151
|
+
}, [q, a == null ? void 0 : a.current, ge]), Y(() => {
|
|
152
|
+
if (!W || S === null) {
|
|
153
|
+
Ae(null);
|
|
146
154
|
return;
|
|
147
155
|
}
|
|
148
156
|
const e = () => {
|
|
149
|
-
const t =
|
|
150
|
-
|
|
157
|
+
const t = W.getBoundingClientRect();
|
|
158
|
+
Ae({ left: t.left, top: t.bottom + 8 });
|
|
151
159
|
};
|
|
152
160
|
return e(), document.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
153
161
|
document.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
154
162
|
};
|
|
155
|
-
}, [
|
|
156
|
-
if (
|
|
163
|
+
}, [W, S]), Y(() => {
|
|
164
|
+
if (S === null) return;
|
|
157
165
|
const e = (t) => {
|
|
158
166
|
const r = t.target;
|
|
159
|
-
|
|
167
|
+
W != null && W.contains(r) || r.closest(".bj-table__filter-dropdown") || (U(null), Ne(null));
|
|
160
168
|
};
|
|
161
169
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
162
|
-
}, [
|
|
170
|
+
}, [W, S]), Y(() => {
|
|
163
171
|
const e = window.setTimeout(
|
|
164
|
-
() =>
|
|
165
|
-
|
|
172
|
+
() => He(Fe.trim()),
|
|
173
|
+
or
|
|
166
174
|
);
|
|
167
175
|
return () => window.clearTimeout(e);
|
|
168
|
-
}, [
|
|
169
|
-
if (
|
|
170
|
-
const e =
|
|
176
|
+
}, [Fe]), Y(() => {
|
|
177
|
+
if (S === null) return;
|
|
178
|
+
const e = C.find((r, s) => E(r, s) === S);
|
|
171
179
|
if (!e || "children" in e || !e.filterRequest) return;
|
|
172
|
-
const t = ++
|
|
173
|
-
Promise.resolve().then(() => e.filterRequest(
|
|
180
|
+
const t = ++ke.current;
|
|
181
|
+
Promise.resolve().then(() => e.filterRequest(te)).then(
|
|
174
182
|
(r) => {
|
|
175
|
-
|
|
183
|
+
ke.current === t && De(r);
|
|
176
184
|
},
|
|
177
185
|
() => {
|
|
178
|
-
|
|
186
|
+
ke.current === t && De([]);
|
|
179
187
|
}
|
|
180
188
|
);
|
|
181
|
-
}, [
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
}, [te, C, S]);
|
|
190
|
+
const H = Q(() => {
|
|
191
|
+
if (!a || a.serverPagination)
|
|
192
|
+
return z.map((t, r) => ({ record: t, index: r })).filter(({ record: t, index: r }) => {
|
|
193
|
+
if (!h || re(t, r)) return !0;
|
|
194
|
+
const s = G(t, r, _);
|
|
195
|
+
return z.some(
|
|
196
|
+
(l, c) => re(l, c) && $.includes(be(l, c)) && Je(l, c).includes(s)
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
const e = (q - 1) * A;
|
|
200
|
+
return z.slice(e, e + A).map((t, r) => ({
|
|
187
201
|
record: t,
|
|
188
202
|
index: e + r
|
|
189
|
-
}))
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
})).filter(({ record: t, index: r }) => {
|
|
204
|
+
if (!h || re(t, r)) return !0;
|
|
205
|
+
const s = G(t, r, _);
|
|
206
|
+
return z.some(
|
|
207
|
+
(l, c) => re(l, c) && $.includes(be(l, c)) && Je(l, c).includes(s)
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
}, [q, $, h, A, a, z, _]), Qe = Q(
|
|
211
|
+
() => H.map(({ record: e, index: t }) => G(e, t, _)),
|
|
212
|
+
[_, H]
|
|
213
|
+
), Mt = K.map(String).join("|"), Tt = Qe.map(String).join("|");
|
|
214
|
+
Y(() => {
|
|
215
|
+
var l;
|
|
216
|
+
if (!n || F || K.length === 0) return;
|
|
217
|
+
const e = new Set(Qe), t = K.filter((c) => e.has(c));
|
|
218
|
+
if (t.length === K.length) return;
|
|
219
|
+
n.selectedRowKeys === void 0 && Ge(t);
|
|
220
|
+
const r = new Set(t), s = H.filter(({ record: c, index: i }) => r.has(G(c, i, _))).map(({ record: c }) => c);
|
|
221
|
+
(l = n.onChange) == null || l.call(n, t, s, { type: "multiple" });
|
|
222
|
+
}, [F, n, _, Mt, Tt, H]);
|
|
223
|
+
const he = (e, t = R, r = B, s = q, l = A) => {
|
|
224
|
+
const c = Object.fromEntries(r), i = dt(o, N, r), v = ct(i, N, t);
|
|
225
|
+
pe == null || pe(
|
|
226
|
+
{ ...a, current: s, pageSize: l, total: (a == null ? void 0 : a.total) ?? v.length },
|
|
227
|
+
c,
|
|
228
|
+
cr(N, t),
|
|
209
229
|
{ action: e, currentDataSource: v }
|
|
210
230
|
);
|
|
211
|
-
},
|
|
231
|
+
}, It = (e, t) => {
|
|
212
232
|
if (!e.sorter) return;
|
|
213
|
-
const r =
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
const r =
|
|
220
|
-
|
|
221
|
-
},
|
|
222
|
-
var
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
|
|
233
|
+
const r = E(e, t), s = dr(R.get(r) ?? null, e.sortDirections ?? mt), l = /* @__PURE__ */ new Map();
|
|
234
|
+
l.set(r, s), e.sortOrder === void 0 && Dt(l), he("sort", l);
|
|
235
|
+
}, Re = (e, t, r) => {
|
|
236
|
+
const s = E(e, t), l = new Map(B);
|
|
237
|
+
l.set(s, r), e.filteredValue === void 0 && Pt(l), U(null), (a == null ? void 0 : a.current) === void 0 && ce(1), he("filter", R, l, 1);
|
|
238
|
+
}, St = (e, t) => {
|
|
239
|
+
const r = E(e, t), s = e.filterResetToDefaultFilteredValue ? e.defaultFilteredValue ?? [] : [];
|
|
240
|
+
ee((l) => new Map(l).set(r, s));
|
|
241
|
+
}, oe = (e, t, r) => {
|
|
242
|
+
var l, c, i, v;
|
|
243
|
+
const s = E(e, t);
|
|
244
|
+
if (S === s) {
|
|
245
|
+
U(null), Ne(null), (l = e.onFilterDropdownOpenChange) == null || l.call(e, !1), (c = e.onFilterDropdownVisibleChange) == null || c.call(e, !1);
|
|
226
246
|
return;
|
|
227
247
|
}
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
var
|
|
231
|
-
const r =
|
|
232
|
-
sortOrder:
|
|
233
|
-
sortColumn:
|
|
234
|
-
sortColumns:
|
|
235
|
-
filters: Object.fromEntries(
|
|
236
|
-
}),
|
|
248
|
+
qe(""), He(""), De(void 0), ee((p) => new Map(p).set(s, B.get(s) ?? [])), U(s), r && Ne(r), (i = e.onFilterDropdownOpenChange) == null || i.call(e, !0), (v = e.onFilterDropdownVisibleChange) == null || v.call(e, !0);
|
|
249
|
+
}, Vt = (e, t) => {
|
|
250
|
+
var T, se;
|
|
251
|
+
const r = E(e, t), s = `bj-table-badge-${Kt}-${String(r).replace(/[^a-zA-Z0-9_-]/g, "-")}`, l = R.get(r) ?? null, c = B.get(r) ?? [], i = Le.get(r) ?? c, v = e.filterDropdownOpen ?? e.filterDropdownVisible ?? S === r, p = e.filtered || c.length > 0, M = l === "ascend" ? "icon-a-zhengxumian" : l === "descend" ? "icon-a-daoxumian" : "icon-a-weipaixumian", y = ft(e.title, {
|
|
252
|
+
sortOrder: l,
|
|
253
|
+
sortColumn: l ? e : void 0,
|
|
254
|
+
sortColumns: l ? [{ column: e, order: l }] : [],
|
|
255
|
+
filters: Object.fromEntries(B)
|
|
256
|
+
}), J = typeof e.filterDropdown == "function" ? e.filterDropdown({
|
|
237
257
|
prefixCls: "bj-table",
|
|
238
|
-
selectedKeys:
|
|
239
|
-
setSelectedKeys: (
|
|
240
|
-
confirm: (
|
|
241
|
-
|
|
258
|
+
selectedKeys: i.filter((d) => typeof d != "boolean"),
|
|
259
|
+
setSelectedKeys: (d) => ee((j) => new Map(j).set(r, d)),
|
|
260
|
+
confirm: (d) => {
|
|
261
|
+
Re(e, t, Le.get(r) ?? i), (d == null ? void 0 : d.closeDropdown) === !1 && U(r);
|
|
242
262
|
},
|
|
243
|
-
clearFilters: (
|
|
244
|
-
const
|
|
245
|
-
|
|
263
|
+
clearFilters: (d) => {
|
|
264
|
+
const j = e.filterResetToDefaultFilteredValue ? e.defaultFilteredValue ?? [] : [];
|
|
265
|
+
ee((O) => new Map(O).set(r, j)), (d == null ? void 0 : d.confirm) === !0 && Re(e, t, j), ((d == null ? void 0 : d.closeDropdown) === !1 || (d == null ? void 0 : d.confirm) !== !0) && U(r);
|
|
246
266
|
},
|
|
247
267
|
filters: e.filters,
|
|
248
|
-
close: () =>
|
|
268
|
+
close: () => U(null),
|
|
249
269
|
visible: v
|
|
250
|
-
}) : e.filterDropdown,
|
|
251
|
-
e.badge !== void 0 && /* @__PURE__ */
|
|
270
|
+
}) : e.filterDropdown, w = e.filterRequest ? Bt ?? [] : e.filters ?? [], m = te && !e.filterRequest ? w.filter((d) => typeof e.filterSearch == "function" ? e.filterSearch(te, d) : jr(te, d)) : w, D = !!(e.filterSearch || e.filterRequest), x = /* @__PURE__ */ P("div", { className: I("bj-table__column-header", e.sorter && "bj-table__column-header--sortable"), children: [
|
|
271
|
+
e.badge !== void 0 && /* @__PURE__ */ f(
|
|
252
272
|
"span",
|
|
253
273
|
{
|
|
254
274
|
"aria-label": "表头提示",
|
|
255
275
|
className: "bj-table__column-badge-trigger",
|
|
256
|
-
id:
|
|
257
|
-
onBlur: () =>
|
|
258
|
-
onClick: (
|
|
259
|
-
onFocus: () =>
|
|
260
|
-
onKeyDown: (
|
|
261
|
-
onMouseEnter: () =>
|
|
262
|
-
onMouseLeave: () =>
|
|
276
|
+
id: s,
|
|
277
|
+
onBlur: () => fe(null),
|
|
278
|
+
onClick: (d) => d.stopPropagation(),
|
|
279
|
+
onFocus: () => fe(r),
|
|
280
|
+
onKeyDown: (d) => d.stopPropagation(),
|
|
281
|
+
onMouseEnter: () => fe(r),
|
|
282
|
+
onMouseLeave: () => fe(null),
|
|
263
283
|
role: "button",
|
|
264
284
|
tabIndex: 0,
|
|
265
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ f("span", { "aria-hidden": "true", className: "bj-table__column-badge-shape" })
|
|
266
286
|
}
|
|
267
287
|
),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
e.sorter && /* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ P("div", { className: "bj-table__column-title", children: [
|
|
289
|
+
/* @__PURE__ */ f("span", { className: "bj-table__column-title-content", children: y }),
|
|
290
|
+
e.sorter && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: "bj-table__column-sorter", children: /* @__PURE__ */ f(Be, { className: "bj-table__column-sorter-icon", type: M }) })
|
|
271
291
|
] }),
|
|
272
|
-
(e.filters || e.filterDropdown) && /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
292
|
+
(e.filters || e.filterDropdown) && /* @__PURE__ */ P("div", { className: "bj-table__filter", children: [
|
|
293
|
+
/* @__PURE__ */ f(
|
|
274
294
|
"button",
|
|
275
295
|
{
|
|
276
296
|
"aria-expanded": v,
|
|
277
297
|
"aria-label": "筛选",
|
|
278
|
-
className:
|
|
279
|
-
onClick: (
|
|
280
|
-
|
|
298
|
+
className: I("bj-table__filter-trigger", p && "bj-table__filter-trigger--active"),
|
|
299
|
+
onClick: (d) => {
|
|
300
|
+
d.stopPropagation(), oe(e, t);
|
|
281
301
|
},
|
|
282
302
|
type: "button",
|
|
283
|
-
children: typeof e.filterIcon == "function" ? e.filterIcon(
|
|
303
|
+
children: typeof e.filterIcon == "function" ? e.filterIcon(p) : e.filterIcon ?? /* @__PURE__ */ f(Be, { className: "bj-table__filter-icon", type: "icon-a-shaixuanxi" })
|
|
284
304
|
}
|
|
285
305
|
),
|
|
286
|
-
v &&
|
|
287
|
-
/* @__PURE__ */
|
|
306
|
+
v && xe && typeof document < "u" && Xt(
|
|
307
|
+
/* @__PURE__ */ f(
|
|
288
308
|
"div",
|
|
289
309
|
{
|
|
290
310
|
className: "bj-table__filter-dropdown",
|
|
291
|
-
onClick: (
|
|
311
|
+
onClick: (d) => d.stopPropagation(),
|
|
292
312
|
role: "dialog",
|
|
293
|
-
style: { left:
|
|
294
|
-
children:
|
|
295
|
-
|
|
313
|
+
style: { left: xe.left, top: xe.top },
|
|
314
|
+
children: J ?? /* @__PURE__ */ f(
|
|
315
|
+
rr,
|
|
296
316
|
{
|
|
297
317
|
...e.filterDropdownProps,
|
|
298
|
-
emptyText: (
|
|
318
|
+
emptyText: (X == null ? void 0 : X.filterEmptyText) ?? Z("暂无结果"),
|
|
299
319
|
multiple: e.filterMultiple !== !1,
|
|
300
|
-
onChange: (
|
|
301
|
-
var
|
|
302
|
-
|
|
320
|
+
onChange: (d, j) => {
|
|
321
|
+
var O, lt;
|
|
322
|
+
ee((Qt) => new Map(Qt).set(r, d)), (lt = (O = e.filterDropdownProps) == null ? void 0 : O.onChange) == null || lt.call(O, d, j);
|
|
303
323
|
},
|
|
304
|
-
onConfirm: (
|
|
305
|
-
var
|
|
306
|
-
|
|
324
|
+
onConfirm: (d) => {
|
|
325
|
+
var j, O;
|
|
326
|
+
Re(e, t, d), (O = (j = e.filterDropdownProps) == null ? void 0 : j.onConfirm) == null || O.call(j, d);
|
|
307
327
|
},
|
|
308
328
|
onReset: () => {
|
|
309
|
-
var
|
|
310
|
-
|
|
329
|
+
var d, j;
|
|
330
|
+
St(e, t), (j = (d = e.filterDropdownProps) == null ? void 0 : d.onReset) == null || j.call(d);
|
|
311
331
|
},
|
|
312
|
-
onSearch: (
|
|
313
|
-
var
|
|
314
|
-
|
|
332
|
+
onSearch: (d) => {
|
|
333
|
+
var j, O;
|
|
334
|
+
qe(d), (O = (j = e.filterDropdownProps) == null ? void 0 : j.onSearch) == null || O.call(j, d);
|
|
315
335
|
},
|
|
316
|
-
options:
|
|
317
|
-
label:
|
|
318
|
-
description:
|
|
319
|
-
value:
|
|
336
|
+
options: m.map((d) => ({
|
|
337
|
+
label: d.text,
|
|
338
|
+
description: d.description,
|
|
339
|
+
value: d.value
|
|
320
340
|
})),
|
|
321
|
-
searchable: ((
|
|
322
|
-
searchPlaceholder: ((
|
|
323
|
-
searchValue:
|
|
324
|
-
|
|
341
|
+
searchable: ((T = e.filterDropdownProps) == null ? void 0 : T.searchable) ?? D,
|
|
342
|
+
searchPlaceholder: ((se = e.filterDropdownProps) == null ? void 0 : se.searchPlaceholder) ?? (e.filterRequest ? Z("请输入搜索内容") : (X == null ? void 0 : X.filterSearchPlaceholder) ?? Z("搜索")),
|
|
343
|
+
searchValue: Fe,
|
|
344
|
+
t: Z,
|
|
345
|
+
value: i
|
|
325
346
|
}
|
|
326
347
|
)
|
|
327
348
|
}
|
|
@@ -330,289 +351,296 @@ function or({
|
|
|
330
351
|
)
|
|
331
352
|
] })
|
|
332
353
|
] });
|
|
333
|
-
return e.badge !== void 0 ? /* @__PURE__ */
|
|
334
|
-
|
|
354
|
+
return e.badge !== void 0 ? /* @__PURE__ */ P(
|
|
355
|
+
er,
|
|
335
356
|
{
|
|
336
357
|
className: "bj-table__column-tooltip-wrapper",
|
|
337
358
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
|
|
340
|
-
|
|
359
|
+
/* @__PURE__ */ f("div", { className: "bj-table__column-tooltip-trigger", children: x }),
|
|
360
|
+
Et === r && /* @__PURE__ */ f(
|
|
361
|
+
Ct,
|
|
341
362
|
{
|
|
342
363
|
className: "bj-table__column-tooltip",
|
|
343
364
|
content: e.badge,
|
|
344
|
-
getAnchorElement: () => document.getElementById(
|
|
365
|
+
getAnchorElement: () => document.getElementById(s),
|
|
345
366
|
getPopupContainer: () => document.body,
|
|
346
367
|
placement: "top"
|
|
347
368
|
}
|
|
348
369
|
)
|
|
349
370
|
]
|
|
350
371
|
}
|
|
351
|
-
) :
|
|
352
|
-
},
|
|
353
|
-
var
|
|
354
|
-
t.selectedRowKeys === void 0 &&
|
|
355
|
-
const
|
|
356
|
-
(v,
|
|
372
|
+
) : x;
|
|
373
|
+
}, Ze = (e, t, r) => {
|
|
374
|
+
var c, i;
|
|
375
|
+
t.selectedRowKeys === void 0 && Ge(e);
|
|
376
|
+
const s = new Set(e), l = o.filter(
|
|
377
|
+
(v, p) => s.has(G(v, p, _))
|
|
357
378
|
);
|
|
358
|
-
(
|
|
379
|
+
(c = t.onChange) == null || c.call(t, e, l), r && ((i = t.onSelect) == null || i.call(
|
|
359
380
|
t,
|
|
360
381
|
r,
|
|
361
|
-
|
|
362
|
-
|
|
382
|
+
s.has(G(r, o.indexOf(r), _)),
|
|
383
|
+
l
|
|
363
384
|
));
|
|
364
|
-
},
|
|
365
|
-
if (!
|
|
385
|
+
}, wt = (e, t) => {
|
|
386
|
+
if (!n)
|
|
366
387
|
return;
|
|
367
|
-
const r =
|
|
368
|
-
|
|
369
|
-
},
|
|
388
|
+
const r = G(e, t, _), s = K.includes(r), l = n.type === "radio" ? s ? [] : [r] : s ? K.filter((c) => c !== r) : [...K, r];
|
|
389
|
+
Ze(l, n, e);
|
|
390
|
+
}, Xe = H.filter(
|
|
370
391
|
({ record: e }) => {
|
|
371
392
|
var t;
|
|
372
|
-
return !((t =
|
|
393
|
+
return !((t = n == null ? void 0 : n.getCheckboxProps) != null && t.call(n, e).disabled);
|
|
373
394
|
}
|
|
374
|
-
),
|
|
375
|
-
({ record: e, index: t }) =>
|
|
376
|
-
),
|
|
395
|
+
), ae = Xe.map(
|
|
396
|
+
({ record: e, index: t }) => G(e, t, _)
|
|
397
|
+
), Oe = ae.length > 0 && ae.every((e) => K.includes(e)), Gt = () => {
|
|
377
398
|
var r;
|
|
378
|
-
if (!
|
|
399
|
+
if (!n || n.type === "radio")
|
|
379
400
|
return;
|
|
380
|
-
const e = new Set(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
!
|
|
384
|
-
|
|
401
|
+
const e = new Set(ae), t = Oe ? K.filter((s) => !e.has(s)) : Array.from(/* @__PURE__ */ new Set([...K, ...ae]));
|
|
402
|
+
Ze(t, n), new Set(t), (r = n.onSelectAll) == null || r.call(
|
|
403
|
+
n,
|
|
404
|
+
!Oe,
|
|
405
|
+
Xe.map(({ record: s }) => s)
|
|
385
406
|
);
|
|
386
|
-
},
|
|
407
|
+
}, Lt = (e) => {
|
|
387
408
|
var t;
|
|
388
|
-
!
|
|
389
|
-
},
|
|
390
|
-
var r,
|
|
391
|
-
if (!
|
|
409
|
+
!a || e < 1 || e > $e || e === q || (a.current === void 0 && ce(e), (t = a.onChange) == null || t.call(a, e, A), he("paginate", R, B, e));
|
|
410
|
+
}, At = (e) => {
|
|
411
|
+
var r, s;
|
|
412
|
+
if (!a || e === A)
|
|
392
413
|
return;
|
|
393
414
|
const t = 1;
|
|
394
|
-
|
|
395
|
-
},
|
|
415
|
+
Pe.current = !0, a.pageSize === void 0 && xt(e), a.current === void 0 && ce(t), (r = a.onShowSizeChange) == null || r.call(a, t, e), (s = a.onChange) == null || s.call(a, t, e), he("paginate", R, B, t, e);
|
|
416
|
+
}, Ye = N.length + (n ? 1 : 0), ie = (n == null ? void 0 : n.columnWidth) ?? 48, Ce = (e) => typeof e.width == "number" ? e.width : 0, et = (e, t) => {
|
|
396
417
|
const r = e.fixed === !0 ? "left" : e.fixed;
|
|
397
|
-
return r === "left" ? { position: "sticky", left:
|
|
398
|
-
},
|
|
399
|
-
width:
|
|
418
|
+
return r === "left" ? { position: "sticky", left: N.slice(0, t).reduce((l, c) => l + Ce(c), n && typeof ie == "number" ? ie : 0), zIndex: 2 } : r === "right" ? { position: "sticky", right: N.slice(t + 1).reduce((l, c) => l + Ce(c), 0), zIndex: 2 } : {};
|
|
419
|
+
}, qt = b != null && b.x ? {
|
|
420
|
+
width: b.x === !0 ? "max-content" : b.x,
|
|
400
421
|
minWidth: "100%",
|
|
401
|
-
tableLayout:
|
|
402
|
-
} : { tableLayout:
|
|
403
|
-
return /* @__PURE__ */
|
|
422
|
+
tableLayout: Se ?? "fixed"
|
|
423
|
+
} : { tableLayout: Se }, Ht = (g == null ? void 0 : g.table) ?? "table", Ut = ((it = g == null ? void 0 : g.header) == null ? void 0 : it.wrapper) ?? "thead", Wt = ((st = g == null ? void 0 : g.header) == null ? void 0 : st.row) ?? "tr", tt = ((nt = g == null ? void 0 : g.header) == null ? void 0 : nt.cell) ?? "th", V = typeof (g == null ? void 0 : g.body) == "object" ? g.body : void 0, $t = (V == null ? void 0 : V.wrapper) ?? "tbody", rt = (V == null ? void 0 : V.row) ?? "tr", Ee = (V == null ? void 0 : V.cell) ?? "td", Jt = typeof _e == "function" ? _e() : _e ?? Z("暂无数据"), at = typeof ye == "string" ? /* @__PURE__ */ f("img", { alt: "", className: "bj-table__empty-image", src: ye }) : ye;
|
|
424
|
+
return /* @__PURE__ */ P(
|
|
404
425
|
"div",
|
|
405
426
|
{
|
|
406
|
-
id:
|
|
407
|
-
ref:
|
|
408
|
-
className:
|
|
427
|
+
id: vt,
|
|
428
|
+
ref: le,
|
|
429
|
+
className: I(
|
|
409
430
|
"bj-table",
|
|
410
|
-
|
|
411
|
-
`bj-table--${
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
431
|
+
ot && "bj-table--bordered",
|
|
432
|
+
`bj-table--${ut}`,
|
|
433
|
+
ue && "bj-table--loading",
|
|
434
|
+
z.length === 0 && "bj-table--empty",
|
|
435
|
+
jt
|
|
415
436
|
),
|
|
416
|
-
style:
|
|
437
|
+
style: pt,
|
|
417
438
|
children: [
|
|
418
|
-
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
439
|
+
Me && /* @__PURE__ */ f("div", { className: "bj-table__title", children: Me(z) }),
|
|
440
|
+
/* @__PURE__ */ P("div", { className: "bj-table__viewport", children: [
|
|
441
|
+
/* @__PURE__ */ f(
|
|
421
442
|
"div",
|
|
422
443
|
{
|
|
423
|
-
className:
|
|
424
|
-
ref:
|
|
425
|
-
style: { maxHeight:
|
|
426
|
-
children: /* @__PURE__ */
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
444
|
+
className: I("bj-table__scroll", !!(b != null && b.x || b != null && b.y) && "bj-overlay-scrollbar-hidden"),
|
|
445
|
+
ref: Ve,
|
|
446
|
+
style: { maxHeight: b == null ? void 0 : b.y },
|
|
447
|
+
children: /* @__PURE__ */ P(Ht, { className: "bj-table__native-table", style: qt, children: [
|
|
448
|
+
N.some((e) => e.width) && /* @__PURE__ */ P("colgroup", { children: [
|
|
449
|
+
n && /* @__PURE__ */ f("col", { className: "bj-table__selection-col", style: { width: ie } }),
|
|
450
|
+
N.map((e, t) => /* @__PURE__ */ f("col", { style: { width: e.width } }, e.key ?? t))
|
|
430
451
|
] }),
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
452
|
+
_t && /* @__PURE__ */ f(Ut, { className: "bj-table__header", children: we.map((e, t) => /* @__PURE__ */ P(Wt, { className: "bj-table__header-row", ...ve == null ? void 0 : ve(N, t), children: [
|
|
453
|
+
n && t === 0 && /* @__PURE__ */ P(
|
|
454
|
+
tt,
|
|
434
455
|
{
|
|
435
|
-
className:
|
|
436
|
-
rowSpan:
|
|
456
|
+
className: I("bj-table__header-cell", "bj-table__selection-cell", !!(b != null && b.x) && "bj-table__selection-cell--fixed"),
|
|
457
|
+
rowSpan: we.length,
|
|
437
458
|
scope: "col",
|
|
438
|
-
style: { width:
|
|
459
|
+
style: { width: ie },
|
|
439
460
|
children: [
|
|
440
|
-
|
|
441
|
-
|
|
461
|
+
n.type !== "radio" && /* @__PURE__ */ f(
|
|
462
|
+
bt,
|
|
442
463
|
{
|
|
443
|
-
checked:
|
|
444
|
-
disabled:
|
|
445
|
-
onChange:
|
|
464
|
+
checked: Oe,
|
|
465
|
+
disabled: ae.length === 0,
|
|
466
|
+
onChange: Gt,
|
|
446
467
|
label: "选择当前页所有行"
|
|
447
468
|
}
|
|
448
469
|
),
|
|
449
|
-
|
|
470
|
+
n.columnTitle
|
|
450
471
|
]
|
|
451
472
|
}
|
|
452
473
|
),
|
|
453
|
-
e.map(({ column: r, colSpan:
|
|
454
|
-
var
|
|
455
|
-
const
|
|
456
|
-
|
|
474
|
+
e.map(({ column: r, colSpan: s, rowSpan: l }, c) => {
|
|
475
|
+
var w;
|
|
476
|
+
const i = r, v = N.indexOf(i), p = v >= 0 ? v : c, M = !("children" in r) && !!(i.filters || i.filterDropdown), y = !("children" in r) && !!i.sorter, J = () => {
|
|
477
|
+
M ? oe(i, p) : y && It(i, p);
|
|
457
478
|
};
|
|
458
|
-
return /* @__PURE__ */
|
|
459
|
-
|
|
479
|
+
return /* @__PURE__ */ Ke(
|
|
480
|
+
tt,
|
|
460
481
|
{
|
|
461
|
-
...(
|
|
462
|
-
"aria-label": typeof
|
|
463
|
-
"aria-sort":
|
|
464
|
-
className:
|
|
482
|
+
...(w = i.onHeaderCell) == null ? void 0 : w.call(i, r, c),
|
|
483
|
+
"aria-label": typeof i.title == "string" ? i.title : void 0,
|
|
484
|
+
"aria-sort": y ? R.get(E(i, p)) === "ascend" ? "ascending" : R.get(E(i, p)) === "descend" ? "descending" : "none" : void 0,
|
|
485
|
+
className: I(
|
|
465
486
|
"bj-table__header-cell",
|
|
466
|
-
|
|
467
|
-
(
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
487
|
+
i.fixed && "bj-table__cell--fixed",
|
|
488
|
+
(i.fixed === "left" || i.fixed === !0) && "bj-table__cell--fixed-left",
|
|
489
|
+
i.fixed === "right" && "bj-table__cell--fixed-right",
|
|
490
|
+
i.sorter && "bj-table__header-cell--sortable",
|
|
491
|
+
M && "bj-table__header-cell--filterable",
|
|
492
|
+
R.get(E(i, p)) && "bj-table__header-cell--sorted",
|
|
493
|
+
i.className
|
|
473
494
|
),
|
|
474
|
-
colSpan:
|
|
475
|
-
key:
|
|
476
|
-
onClick: (
|
|
477
|
-
var
|
|
478
|
-
(
|
|
495
|
+
colSpan: s,
|
|
496
|
+
key: i.key ?? String(i.dataIndex ?? c),
|
|
497
|
+
onClick: (m) => {
|
|
498
|
+
var D, x, T;
|
|
499
|
+
(T = (x = (D = i.onHeaderCell) == null ? void 0 : D.call(i, r, c)) == null ? void 0 : x.onClick) == null || T.call(x, m), !m.target.closest(".bj-table__filter-dropdown") && (M ? oe(i, p, m.currentTarget) : J());
|
|
479
500
|
},
|
|
480
|
-
onKeyDown: (
|
|
481
|
-
var
|
|
482
|
-
(
|
|
501
|
+
onKeyDown: (m) => {
|
|
502
|
+
var D, x, T;
|
|
503
|
+
(T = (x = (D = i.onHeaderCell) == null ? void 0 : D.call(i, r, c)) == null ? void 0 : x.onKeyDown) == null || T.call(x, m), !m.target.closest(".bj-table__filter-dropdown") && (m.key === "Enter" || m.key === " ") && (m.preventDefault(), M ? oe(i, p, m.currentTarget) : J());
|
|
483
504
|
},
|
|
484
|
-
rowSpan:
|
|
505
|
+
rowSpan: l,
|
|
485
506
|
scope: "col",
|
|
486
|
-
style: { textAlign:
|
|
487
|
-
tabIndex:
|
|
507
|
+
style: { textAlign: i.align, ...et(i, p) },
|
|
508
|
+
tabIndex: M || y ? 0 : void 0
|
|
488
509
|
},
|
|
489
|
-
"children" in r ?
|
|
510
|
+
"children" in r ? ft(r.title, { filters: Object.fromEntries(B) }) : Vt(i, p)
|
|
490
511
|
);
|
|
491
512
|
})
|
|
492
513
|
] }, t)) }),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
var
|
|
495
|
-
const r =
|
|
496
|
-
return /* @__PURE__ */
|
|
497
|
-
|
|
514
|
+
/* @__PURE__ */ f($t, { className: "bj-table__body", children: H.length > 0 ? H.map(({ record: e, index: t }) => {
|
|
515
|
+
var v;
|
|
516
|
+
const r = G(e, t, _), s = re(e, t), l = ((v = n == null ? void 0 : n.getCheckboxProps) == null ? void 0 : v.call(n, e).disabled) ?? !1, c = K.includes(r), i = typeof je == "function" ? je(e, t, 0) : je;
|
|
517
|
+
return /* @__PURE__ */ Ke(
|
|
518
|
+
rt,
|
|
498
519
|
{
|
|
499
|
-
...
|
|
500
|
-
className:
|
|
520
|
+
...me == null ? void 0 : me(e, t),
|
|
521
|
+
className: I("bj-table__row", s && "bj-table__row--group", c && "bj-table__row--selected", i),
|
|
501
522
|
key: r
|
|
502
523
|
},
|
|
503
|
-
|
|
504
|
-
|
|
524
|
+
n && !s && /* @__PURE__ */ f(
|
|
525
|
+
Ee,
|
|
505
526
|
{
|
|
506
|
-
className:
|
|
507
|
-
style: { width:
|
|
508
|
-
children: /* @__PURE__ */
|
|
509
|
-
|
|
527
|
+
className: I("bj-table__cell", "bj-table__selection-cell", !!(b != null && b.x) && "bj-table__selection-cell--fixed"),
|
|
528
|
+
style: { width: ie },
|
|
529
|
+
children: /* @__PURE__ */ f(
|
|
530
|
+
bt,
|
|
510
531
|
{
|
|
511
|
-
checked:
|
|
512
|
-
disabled:
|
|
532
|
+
checked: c,
|
|
533
|
+
disabled: l,
|
|
513
534
|
label: `选择第 ${t + 1} 行`,
|
|
514
|
-
name:
|
|
515
|
-
onChange: () =>
|
|
516
|
-
type:
|
|
535
|
+
name: n.type === "radio" ? "bj-table-row-selection" : void 0,
|
|
536
|
+
onChange: () => wt(e, t),
|
|
537
|
+
type: n.type ?? "checkbox"
|
|
517
538
|
}
|
|
518
539
|
)
|
|
519
540
|
}
|
|
520
541
|
),
|
|
521
|
-
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
542
|
+
N.map((p, M) => {
|
|
543
|
+
var T, se;
|
|
544
|
+
if (s && M > 0) return null;
|
|
545
|
+
const y = p, J = ur(e, y.dataIndex), w = y.render ? y.render(J, e, t) : J, m = yr(w) ? w : void 0, D = { ...(T = y.onCell) == null ? void 0 : T.call(y, e, t), ...m == null ? void 0 : m.props }, x = m ? m.children : w;
|
|
546
|
+
return D.colSpan === 0 || D.rowSpan === 0 ? null : /* @__PURE__ */ Ke(
|
|
547
|
+
Ee,
|
|
526
548
|
{
|
|
527
|
-
...
|
|
528
|
-
className:
|
|
549
|
+
...D,
|
|
550
|
+
className: I(
|
|
529
551
|
"bj-table__cell",
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
y.className
|
|
552
|
+
s && "bj-table__cell--group",
|
|
553
|
+
y.fixed && "bj-table__cell--fixed",
|
|
554
|
+
(y.fixed === "left" || y.fixed === !0) && "bj-table__cell--fixed-left",
|
|
555
|
+
y.fixed === "right" && "bj-table__cell--fixed-right",
|
|
556
|
+
y.ellipsis && "bj-table__cell--ellipsis",
|
|
557
|
+
y.className,
|
|
558
|
+
D.className
|
|
536
559
|
),
|
|
537
|
-
key:
|
|
538
|
-
|
|
560
|
+
key: y.key ?? String(y.dataIndex ?? M),
|
|
561
|
+
colSpan: s ? Ye : D.colSpan,
|
|
562
|
+
style: { textAlign: y.align, ...et(y, M), ...D.style }
|
|
539
563
|
},
|
|
540
|
-
|
|
564
|
+
s ? ((se = h == null ? void 0 : h.render) == null ? void 0 : se.call(h, {
|
|
565
|
+
record: e,
|
|
566
|
+
expanded: $.includes(be(e, t)),
|
|
567
|
+
onToggle: () => zt(e, t)
|
|
568
|
+
})) ?? x ?? "" : /* @__PURE__ */ f("div", { className: "bj-table__cell-content", children: x ?? "" })
|
|
541
569
|
);
|
|
542
570
|
})
|
|
543
571
|
);
|
|
544
|
-
}) : /* @__PURE__ */
|
|
545
|
-
|
|
572
|
+
}) : /* @__PURE__ */ f(rt, { className: "bj-table__empty-row", children: /* @__PURE__ */ f(
|
|
573
|
+
Ee,
|
|
546
574
|
{
|
|
547
575
|
className: "bj-table__empty-cell",
|
|
548
|
-
colSpan: Math.max(
|
|
549
|
-
style: { height:
|
|
576
|
+
colSpan: Math.max(Ye, 1),
|
|
577
|
+
style: { height: yt }
|
|
550
578
|
}
|
|
551
579
|
) }) }),
|
|
552
|
-
|
|
580
|
+
Ie && /* @__PURE__ */ f("tfoot", { className: "bj-table__summary", children: Ie(z) })
|
|
553
581
|
] })
|
|
554
582
|
}
|
|
555
583
|
),
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
/* @__PURE__ */
|
|
584
|
+
H.length === 0 && /* @__PURE__ */ f("div", { className: "bj-table__empty-overlay", children: /* @__PURE__ */ P("div", { className: "bj-table__empty-content", children: [
|
|
585
|
+
at && /* @__PURE__ */ f("div", { className: "bj-table__empty-image-wrap", children: at }),
|
|
586
|
+
/* @__PURE__ */ f("div", { className: "bj-table__empty-text", children: Jt })
|
|
559
587
|
] }) })
|
|
560
588
|
] }),
|
|
561
|
-
((
|
|
562
|
-
|
|
589
|
+
((b == null ? void 0 : b.x) || (b == null ? void 0 : b.y)) && /* @__PURE__ */ f(
|
|
590
|
+
ar,
|
|
563
591
|
{
|
|
564
|
-
containerRef:
|
|
565
|
-
direction:
|
|
592
|
+
containerRef: le,
|
|
593
|
+
direction: b != null && b.x && (b != null && b.y) ? "both" : b != null && b.x ? "horizontal" : "vertical",
|
|
566
594
|
gap: 2,
|
|
567
595
|
horizontalInsetEnd: 0,
|
|
568
596
|
horizontalInsetStart: 0,
|
|
569
597
|
size: 4,
|
|
570
|
-
targetRef:
|
|
598
|
+
targetRef: Ve
|
|
571
599
|
}
|
|
572
600
|
),
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
601
|
+
Te && /* @__PURE__ */ f("div", { className: "bj-table__footer", children: Te(z) }),
|
|
602
|
+
ue && /* @__PURE__ */ P("div", { "aria-live": "polite", "aria-busy": "true", className: "bj-table__loading", role: "status", children: [
|
|
603
|
+
/* @__PURE__ */ f("img", { alt: "", className: "bj-table__loading-indicator", src: ir }),
|
|
604
|
+
/* @__PURE__ */ f("span", { className: "bj-table__loading-text", children: "加载中..." })
|
|
577
605
|
] }),
|
|
578
|
-
|
|
579
|
-
|
|
606
|
+
a && z.length > 0 && /* @__PURE__ */ f("div", { className: "bj-table__pagination", children: /* @__PURE__ */ f(
|
|
607
|
+
Yt,
|
|
580
608
|
{
|
|
581
609
|
align: "end",
|
|
582
|
-
disabled:
|
|
583
|
-
current:
|
|
584
|
-
defaultCurrent:
|
|
585
|
-
defaultPageSize:
|
|
586
|
-
dropdownClassName:
|
|
587
|
-
hideOnSinglePage:
|
|
610
|
+
disabled: ue || a.disabled,
|
|
611
|
+
current: q,
|
|
612
|
+
defaultCurrent: a.defaultCurrent,
|
|
613
|
+
defaultPageSize: a.defaultPageSize,
|
|
614
|
+
dropdownClassName: a.dropdownClassName,
|
|
615
|
+
hideOnSinglePage: a.hideOnSinglePage,
|
|
588
616
|
onChange: (e) => {
|
|
589
|
-
if (
|
|
590
|
-
|
|
617
|
+
if (Pe.current) {
|
|
618
|
+
Pe.current = !1;
|
|
591
619
|
return;
|
|
592
620
|
}
|
|
593
|
-
|
|
621
|
+
Lt(e);
|
|
594
622
|
},
|
|
595
|
-
onShowSizeChange: (e, t) =>
|
|
596
|
-
pageSize:
|
|
597
|
-
pageSizeOptions:
|
|
598
|
-
popupPlacement:
|
|
599
|
-
resolvePopupPlacement:
|
|
600
|
-
showQuickJumper:
|
|
601
|
-
showSizeChanger:
|
|
602
|
-
showTotal:
|
|
603
|
-
simple:
|
|
604
|
-
size:
|
|
605
|
-
t:
|
|
606
|
-
total:
|
|
623
|
+
onShowSizeChange: (e, t) => At(t),
|
|
624
|
+
pageSize: A,
|
|
625
|
+
pageSizeOptions: a.pageSizeOptions,
|
|
626
|
+
popupPlacement: a.popupPlacement,
|
|
627
|
+
resolvePopupPlacement: a.resolvePopupPlacement,
|
|
628
|
+
showQuickJumper: a.showQuickJumper,
|
|
629
|
+
showSizeChanger: a.showSizeChanger,
|
|
630
|
+
showTotal: a.showTotal,
|
|
631
|
+
simple: a.simple,
|
|
632
|
+
size: a.size,
|
|
633
|
+
t: a.t ?? Z,
|
|
634
|
+
total: We
|
|
607
635
|
}
|
|
608
636
|
) })
|
|
609
637
|
]
|
|
610
638
|
}
|
|
611
639
|
);
|
|
612
640
|
}
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
641
|
+
const ht = pr;
|
|
642
|
+
ht.Column = nr;
|
|
643
|
+
ht.ColumnGroup = lr;
|
|
616
644
|
export {
|
|
617
|
-
|
|
645
|
+
ht as BTable
|
|
618
646
|
};
|