bj-web-components 0.2.28 → 0.2.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/index.js +1 -51
- package/dist/index.mjs +49 -49
- package/dist/style.css +1 -3744
- package/dist/web/BasicInput/BInput.js +1 -208
- package/dist/web/BasicInput/BInput.mjs +132 -164
- package/dist/web/BasicInput/utils.js +1 -47
- package/dist/web/BasicInput/utils.mjs +28 -38
- package/dist/web/CategoryDropdown/CategoryDropdown.js +1 -307
- package/dist/web/CategoryDropdown/CategoryDropdown.mjs +170 -218
- package/dist/web/CheckBox/BCheckBox.js +1 -116
- package/dist/web/CheckBox/BCheckBox.mjs +70 -86
- package/dist/web/CheckBox/Group.js +1 -73
- package/dist/web/CheckBox/Group.mjs +56 -63
- package/dist/web/CheckBox/context.js +1 -5
- package/dist/web/CheckBox/context.mjs +3 -3
- package/dist/web/CheckBox/index.js +1 -8
- package/dist/web/CheckBox/index.mjs +6 -6
- package/dist/web/Dropdown/BDropdown.js +1 -186
- package/dist/web/Dropdown/BDropdown.mjs +106 -132
- package/dist/web/EmptyInputBox/EmptyInputBox.js +1 -77
- package/dist/web/EmptyInputBox/EmptyInputBox.mjs +48 -52
- package/dist/web/FileCard/FileCard.js +1 -157
- package/dist/web/FileCard/FileCard.mjs +82 -112
- package/dist/web/Icon/Icon.js +1 -9
- package/dist/web/Icon/Icon.mjs +6 -6
- package/dist/web/Input/Input.js +1 -181
- package/dist/web/Input/Input.mjs +113 -122
- package/dist/web/InputNumber/BInputNumber.js +1 -311
- package/dist/web/InputNumber/BInputNumber.mjs +167 -275
- package/dist/web/InputNumber/StepHandler.js +1 -69
- package/dist/web/InputNumber/StepHandler.mjs +32 -38
- package/dist/web/InputNumber/hooks/useCursor.js +1 -40
- package/dist/web/InputNumber/hooks/useCursor.mjs +33 -35
- package/dist/web/InputNumber/hooks/useFrame.js +1 -12
- package/dist/web/InputNumber/hooks/useFrame.mjs +6 -9
- package/dist/web/InputNumber/utils/decimal.js +1 -147
- package/dist/web/InputNumber/utils/decimal.mjs +81 -109
- package/dist/web/Modal/Modal.js +1 -84
- package/dist/web/Modal/Modal.mjs +49 -52
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +1 -232
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +125 -206
- package/dist/web/Pagination/Pagination.js +1 -328
- package/dist/web/Pagination/Pagination.mjs +178 -254
- package/dist/web/ProductField/ProductField.js +1 -272
- package/dist/web/ProductField/ProductField.mjs +143 -190
- package/dist/web/ProductField/arrow-up.svg.js +1 -3
- package/dist/web/ProductField/arrow-up.svg.mjs +2 -2
- package/dist/web/ProductField/checkbox-no.svg.js +1 -3
- package/dist/web/ProductField/checkbox-no.svg.mjs +2 -2
- package/dist/web/ProductField/checkbox-ok.svg.js +1 -3
- package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -2
- package/dist/web/ProductField/no_data_light.svg.js +1 -3
- package/dist/web/ProductField/no_data_light.svg.mjs +2 -2
- package/dist/web/ProductField/search.svg.js +1 -3
- package/dist/web/ProductField/search.svg.mjs +2 -2
- package/dist/web/ProductField/sort.svg.js +1 -3
- package/dist/web/ProductField/sort.svg.mjs +2 -2
- package/dist/web/SkuInputCard/SkuInputCard.js +1 -276
- package/dist/web/SkuInputCard/SkuInputCard.mjs +149 -188
- package/dist/web/SkuInputCard/spin_loading_red.gif.js +1 -3
- package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -2
- package/dist/web/Switch/Switch.js +1 -70
- package/dist/web/Switch/Switch.mjs +37 -47
- package/dist/web/Table/BTable.js +1 -950
- package/dist/web/Table/BTable.mjs +521 -767
- package/dist/web/Table/Column.js +1 -5
- package/dist/web/Table/Column.mjs +2 -2
- package/dist/web/Table/ColumnGroup.js +1 -5
- package/dist/web/Table/ColumnGroup.mjs +2 -2
- package/dist/web/Table/utils/columns.js +1 -48
- package/dist/web/Table/utils/columns.mjs +30 -35
- package/dist/web/Table/utils/sortFilter.js +1 -84
- package/dist/web/Table/utils/sortFilter.mjs +52 -73
- package/dist/web/Tabs/BTabs.js +1 -150
- package/dist/web/Tabs/BTabs.mjs +98 -118
- package/dist/web/Tabs/TabPane.js +1 -8
- package/dist/web/Tabs/TabPane.mjs +4 -4
- package/dist/web/Tooltip/ConfirmTooltip.js +1 -26
- package/dist/web/Tooltip/ConfirmTooltip.mjs +19 -20
- package/dist/web/Tooltip/ContentTooltip.js +1 -94
- package/dist/web/Tooltip/ContentTooltip.mjs +62 -72
- package/dist/web/Tooltip/ProgressTooltip.js +1 -36
- package/dist/web/Tooltip/ProgressTooltip.mjs +20 -22
- package/dist/web/Tooltip/TooltipWrapper.js +1 -12
- package/dist/web/Tooltip/TooltipWrapper.mjs +8 -8
- package/dist/web/Tooltip/useAutoPlacement.js +1 -41
- package/dist/web/Tooltip/useAutoPlacement.mjs +25 -34
- package/dist/web.js +1 -51
- package/dist/web.mjs +49 -49
- package/package.json +1 -1
|
@@ -1,537 +1,386 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useMemo, useState, useEffect, createElement, isValidElement } from "react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as E, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as de, useMemo as X, useState as R, useEffect as Y, createElement as Me, isValidElement as ar } from "react";
|
|
3
|
+
import { createPortal as nr } from "react-dom";
|
|
4
|
+
import sr from "../Pagination/Pagination.mjs";
|
|
5
|
+
import Le from "../Icon/Icon.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { BCheckBox as
|
|
10
|
-
import { BDropdown } from "../Dropdown/BDropdown.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { getColumnKey, filterRecords, sortRecords, renderColumnTitle, getNextSortOrder, getSorterResult } from "./utils/sortFilter.mjs";
|
|
17
|
-
import { convertChildrenToColumns, flattenColumns, buildHeaderRows } from "./utils/columns.mjs";
|
|
7
|
+
import lr from "../Tooltip/ContentTooltip.mjs";
|
|
8
|
+
import dr from "../Tooltip/TooltipWrapper.mjs";
|
|
9
|
+
import { BCheckBox as fr } from "../CheckBox/index.mjs";
|
|
10
|
+
import { BDropdown as cr } from "../Dropdown/BDropdown.mjs";
|
|
11
|
+
import br from "../OverlayScrollbar/BOverlayScrollbar.mjs";
|
|
12
|
+
import hr from "../SkuInputCard/spin_loading_red.gif.mjs";
|
|
13
|
+
import or from "../ProductField/no_data_light.svg.mjs";
|
|
14
|
+
import _r from "./Column.mjs";
|
|
15
|
+
import ur from "./ColumnGroup.mjs";
|
|
16
|
+
import { getColumnKey as O, filterRecords as yt, sortRecords as jt, renderColumnTitle as mt, getNextSortOrder as yr, getSorterResult as jr } from "./utils/sortFilter.mjs";
|
|
17
|
+
import { convertChildrenToColumns as mr, flattenColumns as gr, buildHeaderRows as pr } from "./utils/columns.mjs";
|
|
18
18
|
/* empty css */
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return values.filter(Boolean).join(" ");
|
|
19
|
+
const vr = 300, Te = 1;
|
|
20
|
+
function L(...m) {
|
|
21
|
+
return m.filter(Boolean).join(" ");
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return path.reduce((value, key) => {
|
|
30
|
-
if (value === null || value === void 0 || typeof value !== "object") {
|
|
31
|
-
return void 0;
|
|
32
|
-
}
|
|
33
|
-
return value[key];
|
|
34
|
-
}, record);
|
|
23
|
+
function xr(m, j) {
|
|
24
|
+
return j === void 0 ? void 0 : (Array.isArray(j) ? j : [j]).reduce((D, d) => {
|
|
25
|
+
if (!(D == null || typeof D != "object"))
|
|
26
|
+
return D[d];
|
|
27
|
+
}, m);
|
|
35
28
|
}
|
|
36
|
-
function
|
|
37
|
-
if (typeof
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return value;
|
|
44
|
-
}
|
|
29
|
+
function q(m, j, g) {
|
|
30
|
+
if (typeof g == "function")
|
|
31
|
+
return g(m, j);
|
|
32
|
+
if (g) {
|
|
33
|
+
const D = m[String(g)];
|
|
34
|
+
if (typeof D == "string" || typeof D == "number")
|
|
35
|
+
return D;
|
|
45
36
|
}
|
|
46
|
-
return
|
|
37
|
+
return j;
|
|
47
38
|
}
|
|
48
|
-
function
|
|
49
|
-
return Math.max(1, Math.ceil(
|
|
39
|
+
function Nr(m, j) {
|
|
40
|
+
return Math.max(1, Math.ceil(m / j));
|
|
50
41
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
42
|
+
function Rr(m) {
|
|
43
|
+
return !!(m && typeof m == "object" && !ar(m) && "props" in m);
|
|
53
44
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
return searchableText.toLocaleLowerCase().includes(input.toLocaleLowerCase());
|
|
45
|
+
function Fr(m, j) {
|
|
46
|
+
return (typeof j.text == "string" || typeof j.text == "number" ? String(j.text) : String(j.value)).toLocaleLowerCase().includes(m.toLocaleLowerCase());
|
|
57
47
|
}
|
|
58
|
-
function
|
|
59
|
-
checked,
|
|
60
|
-
disabled,
|
|
61
|
-
label,
|
|
62
|
-
name,
|
|
63
|
-
onChange,
|
|
64
|
-
type = "checkbox"
|
|
48
|
+
function gt({
|
|
49
|
+
checked: m,
|
|
50
|
+
disabled: j,
|
|
51
|
+
label: g,
|
|
52
|
+
name: D,
|
|
53
|
+
onChange: d,
|
|
54
|
+
type: A = "checkbox"
|
|
65
55
|
}) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
return /* @__PURE__ */ jsxs("label", { className: classNames("bj-table__selection-control", checked && "bj-table__selection-control--checked", disabled && "bj-table__selection-control--disabled"), children: [
|
|
81
|
-
/* @__PURE__ */ jsx(
|
|
56
|
+
return A === "checkbox" ? /* @__PURE__ */ b(
|
|
57
|
+
fr,
|
|
58
|
+
{
|
|
59
|
+
"aria-label": g,
|
|
60
|
+
checked: m,
|
|
61
|
+
className: "bj-table__selection-checkbox",
|
|
62
|
+
disabled: j,
|
|
63
|
+
name: D,
|
|
64
|
+
onChange: d,
|
|
65
|
+
skipGroup: !0
|
|
66
|
+
}
|
|
67
|
+
) : /* @__PURE__ */ E("label", { className: L("bj-table__selection-control", m && "bj-table__selection-control--checked", j && "bj-table__selection-control--disabled"), children: [
|
|
68
|
+
/* @__PURE__ */ b(
|
|
82
69
|
"input",
|
|
83
70
|
{
|
|
84
|
-
"aria-label":
|
|
85
|
-
checked,
|
|
71
|
+
"aria-label": g,
|
|
72
|
+
checked: m,
|
|
86
73
|
className: "bj-table__selection-input",
|
|
87
|
-
disabled,
|
|
88
|
-
name,
|
|
89
|
-
onChange,
|
|
90
|
-
type
|
|
74
|
+
disabled: j,
|
|
75
|
+
name: D,
|
|
76
|
+
onChange: d,
|
|
77
|
+
type: A
|
|
91
78
|
}
|
|
92
79
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ b("span", { "aria-hidden": "true", className: "bj-table__selection-box", children: m && /* @__PURE__ */ b(Le, { className: "bj-table__selection-check-icon", type: "icon-a-dagouxi" }) })
|
|
94
81
|
] });
|
|
95
82
|
}
|
|
96
|
-
function
|
|
97
|
-
columns,
|
|
98
|
-
dataSource = [],
|
|
99
|
-
rowKey,
|
|
100
|
-
preserveSelectedRowKeys =
|
|
101
|
-
rowSelection,
|
|
102
|
-
pagination =
|
|
103
|
-
loading =
|
|
104
|
-
bordered =
|
|
105
|
-
size = "middle",
|
|
106
|
-
showHeader =
|
|
107
|
-
emptyText,
|
|
108
|
-
emptyImage =
|
|
109
|
-
emptyHeight,
|
|
110
|
-
t = (
|
|
111
|
-
className,
|
|
112
|
-
style,
|
|
113
|
-
rowClassName,
|
|
114
|
-
sortDirections = ["ascend", "descend", null],
|
|
115
|
-
onChange,
|
|
116
|
-
children,
|
|
117
|
-
title,
|
|
118
|
-
footer,
|
|
119
|
-
summary,
|
|
120
|
-
tableLayout,
|
|
121
|
-
components,
|
|
122
|
-
onRow,
|
|
123
|
-
onHeaderRow,
|
|
124
|
-
id,
|
|
125
|
-
scroll,
|
|
126
|
-
locale,
|
|
127
|
-
groupCollapse
|
|
83
|
+
function Dr({
|
|
84
|
+
columns: m,
|
|
85
|
+
dataSource: j = [],
|
|
86
|
+
rowKey: g,
|
|
87
|
+
preserveSelectedRowKeys: D = !1,
|
|
88
|
+
rowSelection: d,
|
|
89
|
+
pagination: A = !1,
|
|
90
|
+
loading: ye = !1,
|
|
91
|
+
bordered: vt = !0,
|
|
92
|
+
size: xt = "middle",
|
|
93
|
+
showHeader: Ie = !0,
|
|
94
|
+
emptyText: je,
|
|
95
|
+
emptyImage: me = or,
|
|
96
|
+
emptyHeight: Nt,
|
|
97
|
+
t: C = (fe) => fe,
|
|
98
|
+
className: Rt,
|
|
99
|
+
style: Ft,
|
|
100
|
+
rowClassName: ge,
|
|
101
|
+
sortDirections: Dt = ["ascend", "descend", null],
|
|
102
|
+
onChange: pe,
|
|
103
|
+
children: Ve,
|
|
104
|
+
title: we,
|
|
105
|
+
footer: Ge,
|
|
106
|
+
summary: qe,
|
|
107
|
+
tableLayout: ve,
|
|
108
|
+
components: N,
|
|
109
|
+
onRow: xe,
|
|
110
|
+
onHeaderRow: Ne,
|
|
111
|
+
id: Et,
|
|
112
|
+
scroll: f,
|
|
113
|
+
locale: ee,
|
|
114
|
+
groupCollapse: h
|
|
128
115
|
}) {
|
|
129
|
-
var
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return [[getColumnKey(column, index), column.defaultSortOrder]];
|
|
151
|
-
}))
|
|
152
|
-
);
|
|
153
|
-
const [uncontrolledFilters, setUncontrolledFilters] = useState(
|
|
154
|
-
() => new Map(leafColumns.flatMap((column, index) => {
|
|
155
|
-
if (column.defaultFilteredValue === void 0) return [];
|
|
156
|
-
return [[getColumnKey(column, index), column.defaultFilteredValue]];
|
|
157
|
-
}))
|
|
158
|
-
);
|
|
159
|
-
const [uncontrolledExpandedGroupKeys, setUncontrolledExpandedGroupKeys] = useState(
|
|
160
|
-
(groupCollapse == null ? void 0 : groupCollapse.defaultExpandedKeys) ? [...groupCollapse.defaultExpandedKeys] : []
|
|
161
|
-
);
|
|
162
|
-
const [openFilterKey, setOpenFilterKey] = useState(null);
|
|
163
|
-
const [draftFilters, setDraftFilters] = useState(/* @__PURE__ */ new Map());
|
|
164
|
-
const [hoveredBadgeKey, setHoveredBadgeKey] = useState(null);
|
|
165
|
-
const tableInstanceIdRef = useRef(`btable-${Math.random().toString(36).slice(2, 10)}`);
|
|
166
|
-
const tableInstanceId = tableInstanceIdRef.current;
|
|
167
|
-
const [filterAnchor, setFilterAnchor] = useState(null);
|
|
168
|
-
const [filterPopupPosition, setFilterPopupPosition] = useState(null);
|
|
169
|
-
const [filterSearchInput, setFilterSearchInput] = useState("");
|
|
170
|
-
const [debouncedFilterSearch, setDebouncedFilterSearch] = useState("");
|
|
171
|
-
const [requestedFilterOptions, setRequestedFilterOptions] = useState();
|
|
172
|
-
const filterRequestIdRef = useRef(0);
|
|
173
|
-
const ignoreNextPaginationChangeRef = useRef(false);
|
|
174
|
-
const [horizontalInsets, setHorizontalInsets] = useState({ start: 0, end: 0 });
|
|
175
|
-
const [scrollPing, setScrollPing] = useState({ start: false, end: false });
|
|
176
|
-
const paginationConfig = pagination || void 0;
|
|
177
|
-
const pageSize = (paginationConfig == null ? void 0 : paginationConfig.pageSize) ?? uncontrolledPageSize;
|
|
178
|
-
const selectedKeys = (rowSelection == null ? void 0 : rowSelection.selectedRowKeys) ?? uncontrolledSelectedKeys;
|
|
179
|
-
const activeColumns = leafColumns;
|
|
180
|
-
const fixedLayoutSignature = `${activeColumns.map((column) => `${String(column.fixed ?? "")}:${String(column.width ?? "")}`).join("|")}|${rowSelection ? String(rowSelection.columnWidth ?? "") : "-"}|${String((scroll == null ? void 0 : scroll.x) ?? "")}|${String(tableLayout ?? "")}`;
|
|
181
|
-
const isFixedLeftColumn = (column) => Boolean(column && (column.fixed === "left" || column.fixed === true));
|
|
182
|
-
const isFixedRightColumn = (column) => Boolean(column && column.fixed === "right");
|
|
183
|
-
const sortOrders = new Map(uncontrolledSortOrders);
|
|
184
|
-
const activeFilters = new Map(uncontrolledFilters);
|
|
185
|
-
activeColumns.forEach((rawColumn, index) => {
|
|
186
|
-
if ("children" in rawColumn) return;
|
|
187
|
-
const key = getColumnKey(rawColumn, index);
|
|
188
|
-
if (rawColumn.sortOrder !== void 0) sortOrders.set(key, rawColumn.sortOrder);
|
|
189
|
-
if (rawColumn.filteredValue !== void 0) activeFilters.set(key, rawColumn.filteredValue);
|
|
116
|
+
var ht, ot, _t;
|
|
117
|
+
const fe = de(null), Re = de(null), ce = X(
|
|
118
|
+
() => m ?? mr(Ve),
|
|
119
|
+
[Ve, m]
|
|
120
|
+
), re = X(() => gr(ce), [ce]), Ae = X(() => pr(ce), [ce]), [Pt, We] = R(
|
|
121
|
+
(d == null ? void 0 : d.defaultSelectedRowKeys) ?? []
|
|
122
|
+
), [Fe, be] = R(
|
|
123
|
+
A ? A.defaultCurrent ?? 1 : 1
|
|
124
|
+
), [kt, Ot] = R(
|
|
125
|
+
A ? A.defaultPageSize ?? 10 : 10
|
|
126
|
+
), [Bt, Kt] = R(
|
|
127
|
+
() => new Map(re.flatMap((e, t) => e.defaultSortOrder ? [[O(e, t), e.defaultSortOrder]] : []))
|
|
128
|
+
), [St, zt] = R(
|
|
129
|
+
() => new Map(re.flatMap((e, t) => e.defaultFilteredValue === void 0 ? [] : [[O(e, t), e.defaultFilteredValue]]))
|
|
130
|
+
), [Mt, Tt] = R(
|
|
131
|
+
h != null && h.defaultExpandedKeys ? [...h.defaultExpandedKeys] : []
|
|
132
|
+
), [I, U] = R(null), [$e, ie] = R(/* @__PURE__ */ new Map()), [Lt, he] = R(null), It = de(`btable-${Math.random().toString(36).slice(2, 10)}`).current, [J, De] = R(null), [Ee, He] = R(null), [Pe, Ue] = R(""), [ae, Je] = R(""), [Vt, ke] = R(), Oe = de(0), Be = de(!1), [Qe, Ze] = R({ start: 0, end: 0 }), [Xe, Ye] = R({ start: !1, end: !1 }), n = A || void 0, W = (n == null ? void 0 : n.pageSize) ?? kt, B = (d == null ? void 0 : d.selectedRowKeys) ?? Pt, y = re, wt = `${y.map((e) => `${String(e.fixed ?? "")}:${String(e.width ?? "")}`).join("|")}|${d ? String(d.columnWidth ?? "") : "-"}|${String((f == null ? void 0 : f.x) ?? "")}|${String(ve ?? "")}`, $ = (e) => !!(e && (e.fixed === "left" || e.fixed === !0)), te = (e) => !!(e && e.fixed === "right"), P = new Map(Bt), K = new Map(St);
|
|
133
|
+
y.forEach((e, t) => {
|
|
134
|
+
if ("children" in e) return;
|
|
135
|
+
const r = O(e, t);
|
|
136
|
+
e.sortOrder !== void 0 && P.set(r, e.sortOrder), e.filteredValue !== void 0 && K.set(r, e.filteredValue);
|
|
190
137
|
});
|
|
191
|
-
const
|
|
192
|
-
() =>
|
|
193
|
-
[
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const current = Math.min((paginationConfig == null ? void 0 : paginationConfig.current) ?? uncontrolledCurrent, pageCount);
|
|
202
|
-
const expandedGroupKeys = (groupCollapse == null ? void 0 : groupCollapse.expandedKeys) ?? uncontrolledExpandedGroupKeys;
|
|
203
|
-
const isGroupRow = (record, index) => (groupCollapse == null ? void 0 : groupCollapse.isGroupRow) ? groupCollapse.isGroupRow(record, index) : Boolean(record.isGroup);
|
|
204
|
-
const getGroupKey = (record, index) => (groupCollapse == null ? void 0 : groupCollapse.groupKey) ? groupCollapse.groupKey(record, index) : record.groupId;
|
|
205
|
-
const getChildrenKeys = (record, index) => (groupCollapse == null ? void 0 : groupCollapse.childrenKeys) ? groupCollapse.childrenKeys(record, index) : record.childrenIds ?? [];
|
|
206
|
-
const toggleGroup = (record, index) => {
|
|
207
|
-
var _a2;
|
|
208
|
-
const key = getGroupKey(record, index);
|
|
209
|
-
const expanded = expandedGroupKeys.includes(key);
|
|
210
|
-
const nextKeys = expanded ? expandedGroupKeys.filter((expandedKey) => expandedKey !== key) : [...expandedGroupKeys, key];
|
|
211
|
-
if ((groupCollapse == null ? void 0 : groupCollapse.expandedKeys) === void 0) setUncontrolledExpandedGroupKeys(nextKeys);
|
|
212
|
-
(_a2 = groupCollapse == null ? void 0 : groupCollapse.onExpandedKeysChange) == null ? void 0 : _a2.call(groupCollapse, nextKeys, record, !expanded);
|
|
138
|
+
const Ce = X(
|
|
139
|
+
() => yt(j, y, K),
|
|
140
|
+
[y, K, j]
|
|
141
|
+
), S = X(
|
|
142
|
+
() => jt(Ce, y, P),
|
|
143
|
+
[y, Ce, P]
|
|
144
|
+
), et = (n == null ? void 0 : n.total) ?? S.length, tt = Nr(et, W), H = Math.min((n == null ? void 0 : n.current) ?? Fe, tt), Q = (h == null ? void 0 : h.expandedKeys) ?? Mt, ne = (e, t) => h != null && h.isGroupRow ? h.isGroupRow(e, t) : !!e.isGroup, oe = (e, t) => h != null && h.groupKey ? h.groupKey(e, t) : e.groupId, rt = (e, t) => h != null && h.childrenKeys ? h.childrenKeys(e, t) : e.childrenIds ?? [], Gt = (e, t) => {
|
|
145
|
+
var a;
|
|
146
|
+
const r = oe(e, t), s = Q.includes(r), l = s ? Q.filter((i) => i !== r) : [...Q, r];
|
|
147
|
+
(h == null ? void 0 : h.expandedKeys) === void 0 && Tt(l), (a = h == null ? void 0 : h.onExpandedKeysChange) == null || a.call(h, l, e, !s);
|
|
213
148
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (!filterAnchor || openFilterKey === null) {
|
|
221
|
-
setFilterPopupPosition(null);
|
|
149
|
+
Y(() => {
|
|
150
|
+
H !== Fe && (n == null ? void 0 : n.current) === void 0 && be(H);
|
|
151
|
+
}, [H, n == null ? void 0 : n.current, Fe]), Y(() => {
|
|
152
|
+
if (!J || I === null) {
|
|
153
|
+
He(null);
|
|
222
154
|
return;
|
|
223
155
|
}
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
|
|
156
|
+
const e = () => {
|
|
157
|
+
const t = J.getBoundingClientRect();
|
|
158
|
+
He({ left: t.left, top: t.bottom + 4 });
|
|
227
159
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
window.addEventListener("resize", updatePosition);
|
|
231
|
-
return () => {
|
|
232
|
-
document.removeEventListener("scroll", updatePosition, true);
|
|
233
|
-
window.removeEventListener("resize", updatePosition);
|
|
160
|
+
return e(), document.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
161
|
+
document.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
234
162
|
};
|
|
235
|
-
}, [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if ((filterAnchor == null ? void 0 : filterAnchor.contains(target)) || target.closest(".bj-table__filter-dropdown")) return;
|
|
241
|
-
setOpenFilterKey(null);
|
|
242
|
-
setFilterAnchor(null);
|
|
163
|
+
}, [J, I]), Y(() => {
|
|
164
|
+
if (I === null) return;
|
|
165
|
+
const e = (t) => {
|
|
166
|
+
const r = t.target;
|
|
167
|
+
J != null && J.contains(r) || r.closest(".bj-table__filter-dropdown") || (U(null), De(null));
|
|
243
168
|
};
|
|
244
|
-
document.addEventListener("mousedown",
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
() => setDebouncedFilterSearch(filterSearchInput.trim()),
|
|
250
|
-
FILTER_SEARCH_DEBOUNCE_MS
|
|
169
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
170
|
+
}, [J, I]), Y(() => {
|
|
171
|
+
const e = window.setTimeout(
|
|
172
|
+
() => Je(Pe.trim()),
|
|
173
|
+
vr
|
|
251
174
|
);
|
|
252
|
-
return () => window.clearTimeout(
|
|
253
|
-
}, [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (filterRequestIdRef.current === requestId) setRequestedFilterOptions(options);
|
|
175
|
+
return () => window.clearTimeout(e);
|
|
176
|
+
}, [Pe]), Y(() => {
|
|
177
|
+
if (I === null) return;
|
|
178
|
+
const e = re.find((r, s) => O(r, s) === I);
|
|
179
|
+
if (!e || "children" in e || !e.filterRequest) return;
|
|
180
|
+
const t = ++Oe.current;
|
|
181
|
+
Promise.resolve().then(() => e.filterRequest(ae)).then(
|
|
182
|
+
(r) => {
|
|
183
|
+
Oe.current === t && ke(r);
|
|
262
184
|
},
|
|
263
185
|
() => {
|
|
264
|
-
|
|
186
|
+
Oe.current === t && ke([]);
|
|
265
187
|
}
|
|
266
188
|
);
|
|
267
|
-
}, [
|
|
268
|
-
const
|
|
269
|
-
if (!
|
|
270
|
-
return
|
|
271
|
-
if (!
|
|
272
|
-
const
|
|
273
|
-
return
|
|
274
|
-
(
|
|
189
|
+
}, [ae, re, I]);
|
|
190
|
+
const V = X(() => {
|
|
191
|
+
if (!n || n.serverPagination)
|
|
192
|
+
return S.map((t, r) => ({ record: t, index: r })).filter(({ record: t, index: r }) => {
|
|
193
|
+
if (!h || ne(t, r)) return !0;
|
|
194
|
+
const s = q(t, r, g);
|
|
195
|
+
return S.some(
|
|
196
|
+
(l, a) => ne(l, a) && Q.includes(oe(l, a)) && rt(l, a).includes(s)
|
|
275
197
|
);
|
|
276
198
|
});
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
(group, groupIndex) => isGroupRow(group, groupIndex) && expandedGroupKeys.includes(getGroupKey(group, groupIndex)) && getChildrenKeys(group, groupIndex).includes(childKey)
|
|
199
|
+
const e = (H - 1) * W;
|
|
200
|
+
return S.slice(e, e + W).map((t, r) => ({
|
|
201
|
+
record: t,
|
|
202
|
+
index: e + r
|
|
203
|
+
})).filter(({ record: t, index: r }) => {
|
|
204
|
+
if (!h || ne(t, r)) return !0;
|
|
205
|
+
const s = q(t, r, g);
|
|
206
|
+
return S.some(
|
|
207
|
+
(l, a) => ne(l, a) && Q.includes(oe(l, a)) && rt(l, a).includes(s)
|
|
287
208
|
);
|
|
288
209
|
});
|
|
289
|
-
}, [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const nextSelectedKeySet = new Set(nextSelectedKeys);
|
|
306
|
-
const nextSelectedRows = visibleRecords.filter(({ record, index }) => nextSelectedKeySet.has(getRowKey(record, index, rowKey))).map(({ record }) => record);
|
|
307
|
-
(_a2 = rowSelection.onChange) == null ? void 0 : _a2.call(rowSelection, nextSelectedKeys, nextSelectedRows, { type: "multiple" });
|
|
308
|
-
}, [preserveSelectedRowKeys, rowSelection, rowKey, selectedKeySignature, visibleKeySignature, visibleRecords]);
|
|
309
|
-
useEffect(() => {
|
|
310
|
-
const element = tableScrollRef.current;
|
|
311
|
-
if (!element || !(scroll == null ? void 0 : scroll.x)) {
|
|
312
|
-
setHorizontalInsets((previous) => previous.start === 0 && previous.end === 0 ? previous : { start: 0, end: 0 });
|
|
313
|
-
setScrollPing((previous) => previous.start || previous.end ? { start: false, end: false } : previous);
|
|
210
|
+
}, [H, Q, h, W, n, S, g]), it = X(
|
|
211
|
+
() => V.map(({ record: e, index: t }) => q(e, t, g)),
|
|
212
|
+
[g, V]
|
|
213
|
+
), qt = B.map(String).join("|"), At = it.map(String).join("|");
|
|
214
|
+
Y(() => {
|
|
215
|
+
var l;
|
|
216
|
+
if (!d || D || B.length === 0) return;
|
|
217
|
+
const e = new Set(it), t = B.filter((a) => e.has(a));
|
|
218
|
+
if (t.length === B.length) return;
|
|
219
|
+
d.selectedRowKeys === void 0 && We(t);
|
|
220
|
+
const r = new Set(t), s = V.filter(({ record: a, index: i }) => r.has(q(a, i, g))).map(({ record: a }) => a);
|
|
221
|
+
(l = d.onChange) == null || l.call(d, t, s, { type: "multiple" });
|
|
222
|
+
}, [D, d, g, qt, At, V]), Y(() => {
|
|
223
|
+
const e = Re.current;
|
|
224
|
+
if (!e || !(f != null && f.x)) {
|
|
225
|
+
Ze((a) => a.start === 0 && a.end === 0 ? a : { start: 0, end: 0 }), Ye((a) => a.start || a.end ? { start: !1, end: !1 } : a);
|
|
314
226
|
return;
|
|
315
227
|
}
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
let
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (cell.classList.contains("bj-table__cell--fixed-right")) {
|
|
324
|
-
end += width;
|
|
325
|
-
} else if (cell.classList.contains("bj-table__cell--fixed-left") || cell.classList.contains("bj-table__selection-cell--fixed")) {
|
|
326
|
-
start += width;
|
|
327
|
-
}
|
|
228
|
+
const t = () => {
|
|
229
|
+
const a = e.querySelector(".bj-table__header .bj-table__header-row") ?? e.querySelector(".bj-table__body .bj-table__row");
|
|
230
|
+
let i = 0, _ = 0;
|
|
231
|
+
if (a) {
|
|
232
|
+
Array.from(a.children).forEach((p) => {
|
|
233
|
+
const u = p.getBoundingClientRect().width;
|
|
234
|
+
p.classList.contains("bj-table__cell--fixed-right") ? _ += u : (p.classList.contains("bj-table__cell--fixed-left") || p.classList.contains("bj-table__selection-cell--fixed")) && (i += u);
|
|
328
235
|
});
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
if (end > 0) end = Math.max(end - borderWidth, 0);
|
|
236
|
+
const o = e.clientLeft;
|
|
237
|
+
i > 0 && (i += o), _ > 0 && (_ = Math.max(_ - o, 0));
|
|
332
238
|
}
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const next = {
|
|
339
|
-
start: scrollable && element.scrollLeft > SCROLL_EDGE_THRESHOLD,
|
|
340
|
-
end: scrollable && element.scrollLeft < maxScroll - SCROLL_EDGE_THRESHOLD
|
|
239
|
+
Ze((o) => o.start === i && o.end === _ ? o : { start: i, end: _ });
|
|
240
|
+
}, r = () => {
|
|
241
|
+
const a = e.scrollWidth - e.clientWidth, i = a > Te, _ = {
|
|
242
|
+
start: i && e.scrollLeft > Te,
|
|
243
|
+
end: i && e.scrollLeft < a - Te
|
|
341
244
|
};
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
measure();
|
|
346
|
-
syncPing();
|
|
245
|
+
Ye((o) => o.start === _.start && o.end === _.end ? o : _);
|
|
246
|
+
}, s = () => {
|
|
247
|
+
t(), r();
|
|
347
248
|
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if (element.firstElementChild) observer.observe(element.firstElementChild);
|
|
353
|
-
return () => {
|
|
354
|
-
element.removeEventListener("scroll", syncPing);
|
|
355
|
-
observer.disconnect();
|
|
249
|
+
s(), e.addEventListener("scroll", r, { passive: !0 });
|
|
250
|
+
const l = new ResizeObserver(s);
|
|
251
|
+
return l.observe(e), e.firstElementChild && l.observe(e.firstElementChild), () => {
|
|
252
|
+
e.removeEventListener("scroll", r), l.disconnect();
|
|
356
253
|
};
|
|
357
|
-
}, [
|
|
358
|
-
const
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
getSorterResult(activeColumns, nextSortOrders),
|
|
366
|
-
{ action, currentDataSource: nextProcessedData }
|
|
254
|
+
}, [wt, f == null ? void 0 : f.x, Ie, V.length]);
|
|
255
|
+
const _e = (e, t = P, r = K, s = H, l = W) => {
|
|
256
|
+
const a = Object.fromEntries(r), i = yt(j, y, r), _ = jt(i, y, t);
|
|
257
|
+
pe == null || pe(
|
|
258
|
+
{ ...n, current: s, pageSize: l, total: (n == null ? void 0 : n.total) ?? _.length },
|
|
259
|
+
a,
|
|
260
|
+
jr(y, t),
|
|
261
|
+
{ action: e, currentDataSource: _ }
|
|
367
262
|
);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
setOpenFilterKey(null);
|
|
384
|
-
if ((paginationConfig == null ? void 0 : paginationConfig.current) === void 0) setUncontrolledCurrent(1);
|
|
385
|
-
emitChange("filter", sortOrders, nextFilters, 1);
|
|
386
|
-
};
|
|
387
|
-
const resetFilter = (column, index) => {
|
|
388
|
-
const key = getColumnKey(column, index);
|
|
389
|
-
const nextKeys = column.filterResetToDefaultFilteredValue ? column.defaultFilteredValue ?? [] : [];
|
|
390
|
-
setDraftFilters((filters) => new Map(filters).set(key, nextKeys));
|
|
391
|
-
};
|
|
392
|
-
const toggleFilter = (column, index, anchor) => {
|
|
393
|
-
var _a2, _b2, _c2, _d;
|
|
394
|
-
const key = getColumnKey(column, index);
|
|
395
|
-
if (openFilterKey === key) {
|
|
396
|
-
setOpenFilterKey(null);
|
|
397
|
-
setFilterAnchor(null);
|
|
398
|
-
(_a2 = column.onFilterDropdownOpenChange) == null ? void 0 : _a2.call(column, false);
|
|
399
|
-
(_b2 = column.onFilterDropdownVisibleChange) == null ? void 0 : _b2.call(column, false);
|
|
263
|
+
}, Wt = (e, t) => {
|
|
264
|
+
if (!e.sorter) return;
|
|
265
|
+
const r = O(e, t), s = yr(P.get(r) ?? null, e.sortDirections ?? Dt), l = /* @__PURE__ */ new Map();
|
|
266
|
+
l.set(r, s), e.sortOrder === void 0 && Kt(l), _e("sort", l);
|
|
267
|
+
}, Ke = (e, t, r) => {
|
|
268
|
+
const s = O(e, t), l = new Map(K);
|
|
269
|
+
l.set(s, r), e.filteredValue === void 0 && zt(l), U(null), (n == null ? void 0 : n.current) === void 0 && be(1), _e("filter", P, l, 1);
|
|
270
|
+
}, $t = (e, t) => {
|
|
271
|
+
const r = O(e, t), s = e.filterResetToDefaultFilteredValue ? e.defaultFilteredValue ?? [] : [];
|
|
272
|
+
ie((l) => new Map(l).set(r, s));
|
|
273
|
+
}, ue = (e, t, r) => {
|
|
274
|
+
var l, a, i, _;
|
|
275
|
+
const s = O(e, t);
|
|
276
|
+
if (I === s) {
|
|
277
|
+
U(null), De(null), (l = e.onFilterDropdownOpenChange) == null || l.call(e, !1), (a = e.onFilterDropdownVisibleChange) == null || a.call(e, !1);
|
|
400
278
|
return;
|
|
401
279
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const renderHeaderCell = (column, index) => {
|
|
412
|
-
var _a2, _b2;
|
|
413
|
-
const key = getColumnKey(column, index);
|
|
414
|
-
const badgeId = `bj-table-badge-${tableInstanceId}-${String(key).replace(/[^a-zA-Z0-9_-]/g, "-")}`;
|
|
415
|
-
const sortOrder = sortOrders.get(key) ?? null;
|
|
416
|
-
const filteredKeys = activeFilters.get(key) ?? [];
|
|
417
|
-
const draftKeys = draftFilters.get(key) ?? filteredKeys;
|
|
418
|
-
const isFilterOpen = column.filterDropdownOpen ?? column.filterDropdownVisible ?? openFilterKey === key;
|
|
419
|
-
const isFiltered = column.filtered || filteredKeys.length > 0;
|
|
420
|
-
const sortIconType = sortOrder === "ascend" ? "icon-a-zhengxumian" : sortOrder === "descend" ? "icon-a-daoxumian" : "icon-a-weipaixumian";
|
|
421
|
-
const title2 = renderColumnTitle(column.title, {
|
|
422
|
-
sortOrder,
|
|
423
|
-
sortColumn: sortOrder ? column : void 0,
|
|
424
|
-
sortColumns: sortOrder ? [{ column, order: sortOrder }] : [],
|
|
425
|
-
filters: Object.fromEntries(activeFilters)
|
|
426
|
-
});
|
|
427
|
-
const customFilterContent = typeof column.filterDropdown === "function" ? column.filterDropdown({
|
|
280
|
+
Ue(""), Je(""), ke(void 0), ie((o) => new Map(o).set(s, K.get(s) ?? [])), U(s), r && De(r), (i = e.onFilterDropdownOpenChange) == null || i.call(e, !0), (_ = e.onFilterDropdownVisibleChange) == null || _.call(e, !0);
|
|
281
|
+
}, Ht = (e, t) => {
|
|
282
|
+
var F, M;
|
|
283
|
+
const r = O(e, t), s = `bj-table-badge-${It}-${String(r).replace(/[^a-zA-Z0-9_-]/g, "-")}`, l = P.get(r) ?? null, a = K.get(r) ?? [], i = $e.get(r) ?? a, _ = e.filterDropdownOpen ?? e.filterDropdownVisible ?? I === r, o = e.filtered || a.length > 0, p = l === "ascend" ? "icon-a-zhengxumian" : l === "descend" ? "icon-a-daoxumian" : "icon-a-weipaixumian", u = mt(e.title, {
|
|
284
|
+
sortOrder: l,
|
|
285
|
+
sortColumn: l ? e : void 0,
|
|
286
|
+
sortColumns: l ? [{ column: e, order: l }] : [],
|
|
287
|
+
filters: Object.fromEntries(K)
|
|
288
|
+
}), Z = typeof e.filterDropdown == "function" ? e.filterDropdown({
|
|
428
289
|
prefixCls: "bj-table",
|
|
429
|
-
selectedKeys:
|
|
430
|
-
setSelectedKeys: (
|
|
431
|
-
confirm: (
|
|
432
|
-
|
|
433
|
-
if ((options == null ? void 0 : options.closeDropdown) === false) setOpenFilterKey(key);
|
|
290
|
+
selectedKeys: i.filter((c) => typeof c != "boolean"),
|
|
291
|
+
setSelectedKeys: (c) => ie((x) => new Map(x).set(r, c)),
|
|
292
|
+
confirm: (c) => {
|
|
293
|
+
Ke(e, t, $e.get(r) ?? i), (c == null ? void 0 : c.closeDropdown) === !1 && U(r);
|
|
434
294
|
},
|
|
435
|
-
clearFilters: (
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
if ((options == null ? void 0 : options.confirm) === true) confirmFilter(column, index, nextKeys);
|
|
439
|
-
if ((options == null ? void 0 : options.closeDropdown) === false || (options == null ? void 0 : options.confirm) !== true) setOpenFilterKey(key);
|
|
295
|
+
clearFilters: (c) => {
|
|
296
|
+
const x = e.filterResetToDefaultFilteredValue ? e.defaultFilteredValue ?? [] : [];
|
|
297
|
+
ie((k) => new Map(k).set(r, x)), (c == null ? void 0 : c.confirm) === !0 && Ke(e, t, x), ((c == null ? void 0 : c.closeDropdown) === !1 || (c == null ? void 0 : c.confirm) !== !0) && U(r);
|
|
440
298
|
},
|
|
441
|
-
filters:
|
|
442
|
-
close: () =>
|
|
443
|
-
visible:
|
|
444
|
-
}) :
|
|
445
|
-
|
|
446
|
-
const visibleFilterOptions = debouncedFilterSearch && !column.filterRequest ? filterOptions.filter((option) => typeof column.filterSearch === "function" ? column.filterSearch(debouncedFilterSearch, option) : defaultFilterSearch(debouncedFilterSearch, option)) : filterOptions;
|
|
447
|
-
const showFilterSearch = Boolean(column.filterSearch || column.filterRequest);
|
|
448
|
-
const headerContent = /* @__PURE__ */ jsxs("div", { className: classNames("bj-table__column-header", column.sorter && "bj-table__column-header--sortable"), children: [
|
|
449
|
-
column.badge !== void 0 && /* @__PURE__ */ jsx(
|
|
299
|
+
filters: e.filters,
|
|
300
|
+
close: () => U(null),
|
|
301
|
+
visible: _
|
|
302
|
+
}) : e.filterDropdown, G = e.filterRequest ? Vt ?? [] : e.filters ?? [], T = ae && !e.filterRequest ? G.filter((c) => typeof e.filterSearch == "function" ? e.filterSearch(ae, c) : Fr(ae, c)) : G, v = !!(e.filterSearch || e.filterRequest), z = /* @__PURE__ */ E("div", { className: L("bj-table__column-header", e.sorter && "bj-table__column-header--sortable"), children: [
|
|
303
|
+
e.badge !== void 0 && /* @__PURE__ */ b(
|
|
450
304
|
"span",
|
|
451
305
|
{
|
|
452
306
|
"aria-label": "表头提示",
|
|
453
307
|
className: "bj-table__column-badge-trigger",
|
|
454
|
-
id:
|
|
455
|
-
onBlur: () =>
|
|
456
|
-
onClick: (
|
|
457
|
-
onFocus: () =>
|
|
458
|
-
onKeyDown: (
|
|
459
|
-
onMouseEnter: () =>
|
|
460
|
-
onMouseLeave: () =>
|
|
308
|
+
id: s,
|
|
309
|
+
onBlur: () => he(null),
|
|
310
|
+
onClick: (c) => c.stopPropagation(),
|
|
311
|
+
onFocus: () => he(r),
|
|
312
|
+
onKeyDown: (c) => c.stopPropagation(),
|
|
313
|
+
onMouseEnter: () => he(r),
|
|
314
|
+
onMouseLeave: () => he(null),
|
|
461
315
|
role: "button",
|
|
462
316
|
tabIndex: 0,
|
|
463
|
-
children: /* @__PURE__ */
|
|
317
|
+
children: /* @__PURE__ */ b("span", { "aria-hidden": "true", className: "bj-table__column-badge-shape" })
|
|
464
318
|
}
|
|
465
319
|
),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
|
|
320
|
+
/* @__PURE__ */ E("div", { className: "bj-table__column-title", children: [
|
|
321
|
+
/* @__PURE__ */ b("span", { className: "bj-table__column-title-content", children: u }),
|
|
322
|
+
e.sorter && /* @__PURE__ */ b("span", { "aria-hidden": "true", className: "bj-table__column-sorter", children: /* @__PURE__ */ b(Le, { className: "bj-table__column-sorter-icon", type: p }) })
|
|
469
323
|
] }),
|
|
470
|
-
(
|
|
471
|
-
/* @__PURE__ */
|
|
324
|
+
(e.filters || e.filterDropdown) && /* @__PURE__ */ E("div", { className: "bj-table__filter", children: [
|
|
325
|
+
/* @__PURE__ */ b(
|
|
472
326
|
"button",
|
|
473
327
|
{
|
|
474
|
-
"aria-expanded":
|
|
328
|
+
"aria-expanded": _,
|
|
475
329
|
"aria-label": "筛选",
|
|
476
|
-
className:
|
|
477
|
-
onClick: (
|
|
478
|
-
|
|
479
|
-
toggleFilter(column, index);
|
|
330
|
+
className: L("bj-table__filter-trigger", o && "bj-table__filter-trigger--active"),
|
|
331
|
+
onClick: (c) => {
|
|
332
|
+
c.stopPropagation(), ue(e, t);
|
|
480
333
|
},
|
|
481
334
|
type: "button",
|
|
482
|
-
children: typeof
|
|
483
|
-
|
|
335
|
+
children: typeof e.filterIcon == "function" ? e.filterIcon(o) : e.filterIcon ?? /* @__PURE__ */ b(
|
|
336
|
+
Le,
|
|
484
337
|
{
|
|
485
338
|
className: "bj-table__filter-icon",
|
|
486
|
-
type:
|
|
339
|
+
type: o ? "icon-shaixuan-daidian" : "icon-a-shaixuanxi"
|
|
487
340
|
}
|
|
488
341
|
)
|
|
489
342
|
}
|
|
490
343
|
),
|
|
491
|
-
|
|
492
|
-
/* @__PURE__ */
|
|
344
|
+
_ && Ee && typeof document < "u" && nr(
|
|
345
|
+
/* @__PURE__ */ b(
|
|
493
346
|
"div",
|
|
494
347
|
{
|
|
495
348
|
className: "bj-table__filter-dropdown",
|
|
496
|
-
onClick: (
|
|
349
|
+
onClick: (c) => c.stopPropagation(),
|
|
497
350
|
role: "dialog",
|
|
498
|
-
style: { left:
|
|
499
|
-
children:
|
|
500
|
-
|
|
351
|
+
style: { left: Ee.left, top: Ee.top },
|
|
352
|
+
children: Z ?? /* @__PURE__ */ b(
|
|
353
|
+
cr,
|
|
501
354
|
{
|
|
502
|
-
...
|
|
503
|
-
emptyText: (
|
|
504
|
-
multiple:
|
|
505
|
-
onChange: (
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
(_b3 = (_a3 = column.filterDropdownProps) == null ? void 0 : _a3.onChange) == null ? void 0 : _b3.call(_a3, nextKeys, option);
|
|
355
|
+
...e.filterDropdownProps,
|
|
356
|
+
emptyText: (ee == null ? void 0 : ee.filterEmptyText) ?? C("暂无结果"),
|
|
357
|
+
multiple: e.filterMultiple !== !1,
|
|
358
|
+
onChange: (c, x) => {
|
|
359
|
+
var k, ut;
|
|
360
|
+
ie((ir) => new Map(ir).set(r, c)), (ut = (k = e.filterDropdownProps) == null ? void 0 : k.onChange) == null || ut.call(k, c, x);
|
|
509
361
|
},
|
|
510
|
-
onConfirm: (
|
|
511
|
-
var
|
|
512
|
-
|
|
513
|
-
(_b3 = (_a3 = column.filterDropdownProps) == null ? void 0 : _a3.onConfirm) == null ? void 0 : _b3.call(_a3, nextKeys);
|
|
362
|
+
onConfirm: (c) => {
|
|
363
|
+
var x, k;
|
|
364
|
+
Ke(e, t, c), (k = (x = e.filterDropdownProps) == null ? void 0 : x.onConfirm) == null || k.call(x, c);
|
|
514
365
|
},
|
|
515
366
|
onReset: () => {
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
(_b3 = (_a3 = column.filterDropdownProps) == null ? void 0 : _a3.onReset) == null ? void 0 : _b3.call(_a3);
|
|
367
|
+
var c, x;
|
|
368
|
+
$t(e, t), (x = (c = e.filterDropdownProps) == null ? void 0 : c.onReset) == null || x.call(c);
|
|
519
369
|
},
|
|
520
|
-
onSearch: (
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
(_b3 = (_a3 = column.filterDropdownProps) == null ? void 0 : _a3.onSearch) == null ? void 0 : _b3.call(_a3, nextSearchValue);
|
|
370
|
+
onSearch: (c) => {
|
|
371
|
+
var x, k;
|
|
372
|
+
Ue(c), (k = (x = e.filterDropdownProps) == null ? void 0 : x.onSearch) == null || k.call(x, c);
|
|
524
373
|
},
|
|
525
|
-
options:
|
|
526
|
-
label:
|
|
527
|
-
description:
|
|
528
|
-
value:
|
|
374
|
+
options: T.map((c) => ({
|
|
375
|
+
label: c.text,
|
|
376
|
+
description: c.description,
|
|
377
|
+
value: c.value
|
|
529
378
|
})),
|
|
530
|
-
searchable: ((
|
|
531
|
-
searchPlaceholder: ((
|
|
532
|
-
searchValue:
|
|
533
|
-
t,
|
|
534
|
-
value:
|
|
379
|
+
searchable: ((F = e.filterDropdownProps) == null ? void 0 : F.searchable) ?? v,
|
|
380
|
+
searchPlaceholder: ((M = e.filterDropdownProps) == null ? void 0 : M.searchPlaceholder) ?? (e.filterRequest ? C("请输入搜索内容") : (ee == null ? void 0 : ee.filterSearchPlaceholder) ?? C("搜索")),
|
|
381
|
+
searchValue: Pe,
|
|
382
|
+
t: C,
|
|
383
|
+
value: i
|
|
535
384
|
}
|
|
536
385
|
)
|
|
537
386
|
}
|
|
@@ -540,411 +389,316 @@ function BTable({
|
|
|
540
389
|
)
|
|
541
390
|
] })
|
|
542
391
|
] });
|
|
543
|
-
return
|
|
544
|
-
|
|
392
|
+
return e.badge !== void 0 ? /* @__PURE__ */ E(
|
|
393
|
+
dr,
|
|
545
394
|
{
|
|
546
395
|
className: "bj-table__column-tooltip-wrapper",
|
|
547
396
|
children: [
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
550
|
-
|
|
397
|
+
/* @__PURE__ */ b("div", { className: "bj-table__column-tooltip-trigger", children: z }),
|
|
398
|
+
Lt === r && /* @__PURE__ */ b(
|
|
399
|
+
lr,
|
|
551
400
|
{
|
|
552
401
|
className: "bj-table__column-tooltip",
|
|
553
|
-
content:
|
|
554
|
-
getAnchorElement: () => document.getElementById(
|
|
402
|
+
content: e.badge,
|
|
403
|
+
getAnchorElement: () => document.getElementById(s),
|
|
555
404
|
getPopupContainer: () => document.body,
|
|
556
405
|
placement: "top"
|
|
557
406
|
}
|
|
558
407
|
)
|
|
559
408
|
]
|
|
560
409
|
}
|
|
561
|
-
) :
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
const selectedKeySet = new Set(nextSelectedKeys);
|
|
569
|
-
const selectedRows = dataSource.filter(
|
|
570
|
-
(record, index) => selectedKeySet.has(getRowKey(record, index, rowKey))
|
|
410
|
+
) : z;
|
|
411
|
+
}, at = (e, t, r) => {
|
|
412
|
+
var a, i;
|
|
413
|
+
t.selectedRowKeys === void 0 && We(e);
|
|
414
|
+
const s = new Set(e), l = j.filter(
|
|
415
|
+
(_, o) => s.has(q(_, o, g))
|
|
571
416
|
);
|
|
572
|
-
(
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
const toggleRow = (record, index) => {
|
|
583
|
-
if (!rowSelection) {
|
|
417
|
+
(a = t.onChange) == null || a.call(t, e, l), r && ((i = t.onSelect) == null || i.call(
|
|
418
|
+
t,
|
|
419
|
+
r,
|
|
420
|
+
s.has(q(r, j.indexOf(r), g)),
|
|
421
|
+
l
|
|
422
|
+
));
|
|
423
|
+
}, Ut = (e, t) => {
|
|
424
|
+
if (!d)
|
|
584
425
|
return;
|
|
426
|
+
const r = q(e, t, g), s = B.includes(r), l = d.type === "radio" ? s ? [] : [r] : s ? B.filter((a) => a !== r) : [...B, r];
|
|
427
|
+
at(l, d, e);
|
|
428
|
+
}, nt = V.filter(
|
|
429
|
+
({ record: e }) => {
|
|
430
|
+
var t;
|
|
431
|
+
return !((t = d == null ? void 0 : d.getCheckboxProps) != null && t.call(d, e).disabled);
|
|
585
432
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
const selectableVisibleRecords = visibleRecords.filter(
|
|
592
|
-
({ record }) => {
|
|
593
|
-
var _a2;
|
|
594
|
-
return !((_a2 = rowSelection == null ? void 0 : rowSelection.getCheckboxProps) == null ? void 0 : _a2.call(rowSelection, record).disabled);
|
|
595
|
-
}
|
|
596
|
-
);
|
|
597
|
-
const selectableVisibleKeys = selectableVisibleRecords.map(
|
|
598
|
-
({ record, index }) => getRowKey(record, index, rowKey)
|
|
599
|
-
);
|
|
600
|
-
const allVisibleSelected = selectableVisibleKeys.length > 0 && selectableVisibleKeys.every((key) => selectedKeys.includes(key));
|
|
601
|
-
const toggleAll = () => {
|
|
602
|
-
var _a2;
|
|
603
|
-
if (!rowSelection || rowSelection.type === "radio") {
|
|
433
|
+
), se = nt.map(
|
|
434
|
+
({ record: e, index: t }) => q(e, t, g)
|
|
435
|
+
), Se = se.length > 0 && se.every((e) => B.includes(e)), Jt = () => {
|
|
436
|
+
var r;
|
|
437
|
+
if (!d || d.type === "radio")
|
|
604
438
|
return;
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
(_a2 = rowSelection.onSelectAll) == null ? void 0 : _a2.call(
|
|
611
|
-
rowSelection,
|
|
612
|
-
!allVisibleSelected,
|
|
613
|
-
selectableVisibleRecords.map(({ record }) => record)
|
|
439
|
+
const e = new Set(se), t = Se ? B.filter((s) => !e.has(s)) : Array.from(/* @__PURE__ */ new Set([...B, ...se]));
|
|
440
|
+
at(t, d), new Set(t), (r = d.onSelectAll) == null || r.call(
|
|
441
|
+
d,
|
|
442
|
+
!Se,
|
|
443
|
+
nt.map(({ record: s }) => s)
|
|
614
444
|
);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
445
|
+
}, Qt = (e) => {
|
|
446
|
+
var t;
|
|
447
|
+
!n || e < 1 || e > tt || e === H || (n.current === void 0 && be(e), (t = n.onChange) == null || t.call(n, e, W), _e("paginate", P, K, e));
|
|
448
|
+
}, Zt = (e) => {
|
|
449
|
+
var r, s;
|
|
450
|
+
if (!n || e === W)
|
|
619
451
|
return;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
const changePageSize = (nextPageSize) => {
|
|
628
|
-
var _a2, _b2;
|
|
629
|
-
if (!paginationConfig || nextPageSize === pageSize) {
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
const nextCurrent = 1;
|
|
633
|
-
ignoreNextPaginationChangeRef.current = true;
|
|
634
|
-
if (paginationConfig.pageSize === void 0) {
|
|
635
|
-
setUncontrolledPageSize(nextPageSize);
|
|
636
|
-
}
|
|
637
|
-
if (paginationConfig.current === void 0) {
|
|
638
|
-
setUncontrolledCurrent(nextCurrent);
|
|
639
|
-
}
|
|
640
|
-
(_a2 = paginationConfig.onShowSizeChange) == null ? void 0 : _a2.call(paginationConfig, nextCurrent, nextPageSize);
|
|
641
|
-
(_b2 = paginationConfig.onChange) == null ? void 0 : _b2.call(paginationConfig, nextCurrent, nextPageSize);
|
|
642
|
-
emitChange("paginate", sortOrders, activeFilters, nextCurrent, nextPageSize);
|
|
643
|
-
};
|
|
644
|
-
const columnCount = activeColumns.length + (rowSelection ? 1 : 0);
|
|
645
|
-
const selectionColumnWidth = (rowSelection == null ? void 0 : rowSelection.columnWidth) ?? 48;
|
|
646
|
-
const getColumnWidth = (column) => typeof column.width === "number" ? column.width : 0;
|
|
647
|
-
const getFixedStyle = (column, columnIndex) => {
|
|
648
|
-
const fixed = column.fixed === true ? "left" : column.fixed;
|
|
649
|
-
if (fixed === "left") {
|
|
650
|
-
const left = activeColumns.slice(0, columnIndex).reduce((offset, current2) => offset + getColumnWidth(current2), rowSelection && typeof selectionColumnWidth === "number" ? selectionColumnWidth : 0);
|
|
651
|
-
return { position: "sticky", left, zIndex: 2 };
|
|
652
|
-
}
|
|
653
|
-
if (fixed === "right") {
|
|
654
|
-
const right = activeColumns.slice(columnIndex + 1).reduce((offset, current2) => offset + getColumnWidth(current2), 0);
|
|
655
|
-
return { position: "sticky", right, zIndex: 2 };
|
|
656
|
-
}
|
|
657
|
-
return {};
|
|
658
|
-
};
|
|
659
|
-
const scrollTableStyle = (scroll == null ? void 0 : scroll.x) ? {
|
|
660
|
-
width: scroll.x === true ? "max-content" : scroll.x,
|
|
452
|
+
const t = 1;
|
|
453
|
+
Be.current = !0, n.pageSize === void 0 && Ot(e), n.current === void 0 && be(t), (r = n.onShowSizeChange) == null || r.call(n, t, e), (s = n.onChange) == null || s.call(n, t, e), _e("paginate", P, K, t, e);
|
|
454
|
+
}, st = y.length + (d ? 1 : 0), le = (d == null ? void 0 : d.columnWidth) ?? 48, lt = (e) => typeof e.width == "number" ? e.width : 0, dt = (e, t) => {
|
|
455
|
+
const r = e.fixed === !0 ? "left" : e.fixed;
|
|
456
|
+
return r === "left" ? { position: "sticky", left: y.slice(0, t).reduce((l, a) => l + lt(a), d && typeof le == "number" ? le : 0), zIndex: 2 } : r === "right" ? { position: "sticky", right: y.slice(t + 1).reduce((l, a) => l + lt(a), 0), zIndex: 2 } : {};
|
|
457
|
+
}, Xt = f != null && f.x ? {
|
|
458
|
+
width: f.x === !0 ? "max-content" : f.x,
|
|
661
459
|
minWidth: "100%",
|
|
662
|
-
tableLayout:
|
|
663
|
-
} : { tableLayout };
|
|
664
|
-
|
|
665
|
-
const HeaderWrapper = ((_a = components == null ? void 0 : components.header) == null ? void 0 : _a.wrapper) ?? "thead";
|
|
666
|
-
const HeaderRow = ((_b = components == null ? void 0 : components.header) == null ? void 0 : _b.row) ?? "tr";
|
|
667
|
-
const HeaderCell = ((_c = components == null ? void 0 : components.header) == null ? void 0 : _c.cell) ?? "th";
|
|
668
|
-
const bodyComponents = typeof (components == null ? void 0 : components.body) === "object" ? components.body : void 0;
|
|
669
|
-
const BodyWrapper = (bodyComponents == null ? void 0 : bodyComponents.wrapper) ?? "tbody";
|
|
670
|
-
const BodyRow = (bodyComponents == null ? void 0 : bodyComponents.row) ?? "tr";
|
|
671
|
-
const BodyCell = (bodyComponents == null ? void 0 : bodyComponents.cell) ?? "td";
|
|
672
|
-
const resolvedEmptyText = typeof emptyText === "function" ? emptyText() : emptyText ?? t("暂无数据");
|
|
673
|
-
const resolvedEmptyImage = typeof emptyImage === "string" ? /* @__PURE__ */ jsx("img", { alt: "", className: "bj-table__empty-image", src: emptyImage }) : emptyImage;
|
|
674
|
-
return /* @__PURE__ */ jsxs(
|
|
460
|
+
tableLayout: ve ?? "fixed"
|
|
461
|
+
} : { tableLayout: ve }, Yt = (N == null ? void 0 : N.table) ?? "table", Ct = ((ht = N == null ? void 0 : N.header) == null ? void 0 : ht.wrapper) ?? "thead", er = ((ot = N == null ? void 0 : N.header) == null ? void 0 : ot.row) ?? "tr", ft = ((_t = N == null ? void 0 : N.header) == null ? void 0 : _t.cell) ?? "th", w = typeof (N == null ? void 0 : N.body) == "object" ? N.body : void 0, tr = (w == null ? void 0 : w.wrapper) ?? "tbody", ct = (w == null ? void 0 : w.row) ?? "tr", ze = (w == null ? void 0 : w.cell) ?? "td", rr = typeof je == "function" ? je() : je ?? C("暂无数据"), bt = typeof me == "string" ? /* @__PURE__ */ b("img", { alt: "", className: "bj-table__empty-image", src: me }) : me;
|
|
462
|
+
return /* @__PURE__ */ E(
|
|
675
463
|
"div",
|
|
676
464
|
{
|
|
677
|
-
id,
|
|
678
|
-
ref:
|
|
679
|
-
className:
|
|
465
|
+
id: Et,
|
|
466
|
+
ref: fe,
|
|
467
|
+
className: L(
|
|
680
468
|
"bj-table",
|
|
681
|
-
|
|
682
|
-
`bj-table--${
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
469
|
+
vt && "bj-table--bordered",
|
|
470
|
+
`bj-table--${xt}`,
|
|
471
|
+
ye && "bj-table--loading",
|
|
472
|
+
S.length === 0 && "bj-table--empty",
|
|
473
|
+
Xe.start && "bj-table--ping-left",
|
|
474
|
+
Xe.end && "bj-table--ping-right",
|
|
475
|
+
Rt
|
|
688
476
|
),
|
|
689
|
-
style,
|
|
477
|
+
style: Ft,
|
|
690
478
|
children: [
|
|
691
|
-
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
479
|
+
we && /* @__PURE__ */ b("div", { className: "bj-table__title", children: we(S) }),
|
|
480
|
+
/* @__PURE__ */ E("div", { className: "bj-table__viewport", children: [
|
|
481
|
+
/* @__PURE__ */ b(
|
|
694
482
|
"div",
|
|
695
483
|
{
|
|
696
|
-
className:
|
|
697
|
-
ref:
|
|
698
|
-
style: { maxHeight:
|
|
699
|
-
children: /* @__PURE__ */
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
484
|
+
className: L("bj-table__scroll", !!(f != null && f.x || f != null && f.y) && "bj-overlay-scrollbar-hidden"),
|
|
485
|
+
ref: Re,
|
|
486
|
+
style: { maxHeight: f == null ? void 0 : f.y },
|
|
487
|
+
children: /* @__PURE__ */ E(Yt, { className: "bj-table__native-table", style: Xt, children: [
|
|
488
|
+
y.some((e) => e.width) && /* @__PURE__ */ E("colgroup", { children: [
|
|
489
|
+
d && /* @__PURE__ */ b("col", { className: "bj-table__selection-col", style: { width: le } }),
|
|
490
|
+
y.map((e, t) => /* @__PURE__ */ b("col", { style: { width: e.width } }, e.key ?? t))
|
|
703
491
|
] }),
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
492
|
+
Ie && /* @__PURE__ */ b(Ct, { className: "bj-table__header", children: Ae.map((e, t) => /* @__PURE__ */ E(er, { className: "bj-table__header-row", ...Ne == null ? void 0 : Ne(y, t), children: [
|
|
493
|
+
d && t === 0 && /* @__PURE__ */ E(
|
|
494
|
+
ft,
|
|
707
495
|
{
|
|
708
|
-
className:
|
|
496
|
+
className: L(
|
|
709
497
|
"bj-table__header-cell",
|
|
710
498
|
"bj-table__selection-cell",
|
|
711
|
-
|
|
499
|
+
!!(f != null && f.x) && "bj-table__selection-cell--fixed",
|
|
712
500
|
// 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
|
|
713
|
-
|
|
501
|
+
!!(f != null && f.x) && !$(y[0]) && "bj-table__cell--fixed-left-last"
|
|
714
502
|
),
|
|
715
|
-
rowSpan:
|
|
503
|
+
rowSpan: Ae.length,
|
|
716
504
|
scope: "col",
|
|
717
|
-
style: { width:
|
|
505
|
+
style: { width: le },
|
|
718
506
|
children: [
|
|
719
|
-
|
|
720
|
-
|
|
507
|
+
d.type !== "radio" && /* @__PURE__ */ b(
|
|
508
|
+
gt,
|
|
721
509
|
{
|
|
722
|
-
checked:
|
|
723
|
-
disabled:
|
|
724
|
-
onChange:
|
|
510
|
+
checked: Se,
|
|
511
|
+
disabled: se.length === 0,
|
|
512
|
+
onChange: Jt,
|
|
725
513
|
label: "选择当前页所有行"
|
|
726
514
|
}
|
|
727
515
|
),
|
|
728
|
-
|
|
516
|
+
d.columnTitle
|
|
729
517
|
]
|
|
730
518
|
}
|
|
731
519
|
),
|
|
732
|
-
|
|
733
|
-
var
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
const interactionIndex = leafIndex >= 0 ? leafIndex : index;
|
|
737
|
-
const isFilterable = !("children" in rawColumn) && Boolean(column.filters || column.filterDropdown);
|
|
738
|
-
const isSortable = !("children" in rawColumn) && Boolean(column.sorter);
|
|
739
|
-
const triggerHeaderAction = () => {
|
|
740
|
-
if (isFilterable) {
|
|
741
|
-
toggleFilter(column, interactionIndex);
|
|
742
|
-
} else if (isSortable) {
|
|
743
|
-
changeSorter(column, interactionIndex);
|
|
744
|
-
}
|
|
520
|
+
e.map(({ column: r, colSpan: s, rowSpan: l }, a) => {
|
|
521
|
+
var G, T;
|
|
522
|
+
const i = r, _ = y.indexOf(i), o = _ >= 0 ? _ : a, p = !("children" in r) && !!(i.filters || i.filterDropdown), u = !("children" in r) && !!i.sorter, Z = () => {
|
|
523
|
+
p ? ue(i, o) : u && Wt(i, o);
|
|
745
524
|
};
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
|
|
525
|
+
return /* @__PURE__ */ Me(
|
|
526
|
+
ft,
|
|
748
527
|
{
|
|
749
|
-
...(
|
|
750
|
-
"aria-label": typeof
|
|
751
|
-
"aria-sort":
|
|
752
|
-
className:
|
|
528
|
+
...(G = i.onHeaderCell) == null ? void 0 : G.call(i, r, a),
|
|
529
|
+
"aria-label": typeof i.title == "string" ? i.title : void 0,
|
|
530
|
+
"aria-sort": u ? P.get(O(i, o)) === "ascend" ? "ascending" : P.get(O(i, o)) === "descend" ? "descending" : "none" : void 0,
|
|
531
|
+
className: L(
|
|
753
532
|
"bj-table__header-cell",
|
|
754
|
-
((
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
533
|
+
((T = y[o + 1]) == null ? void 0 : T.fixed) === "right" && "bj-table__cell--before-fixed-right",
|
|
534
|
+
i.fixed && "bj-table__cell--fixed",
|
|
535
|
+
$(i) && "bj-table__cell--fixed-left",
|
|
536
|
+
$(i) && !$(y[o + 1]) && "bj-table__cell--fixed-left-last",
|
|
537
|
+
te(i) && "bj-table__cell--fixed-right",
|
|
538
|
+
te(i) && !te(y[o - 1]) && "bj-table__cell--fixed-right-first",
|
|
539
|
+
i.sorter && "bj-table__header-cell--sortable",
|
|
540
|
+
p && "bj-table__header-cell--filterable",
|
|
541
|
+
P.get(O(i, o)) && "bj-table__header-cell--sorted",
|
|
542
|
+
i.className
|
|
764
543
|
),
|
|
765
|
-
colSpan,
|
|
766
|
-
key:
|
|
767
|
-
onClick: (
|
|
768
|
-
var
|
|
769
|
-
(
|
|
770
|
-
if (event.target.closest(".bj-table__filter-dropdown")) return;
|
|
771
|
-
if (isFilterable) {
|
|
772
|
-
toggleFilter(column, interactionIndex, event.currentTarget);
|
|
773
|
-
} else {
|
|
774
|
-
triggerHeaderAction();
|
|
775
|
-
}
|
|
544
|
+
colSpan: s,
|
|
545
|
+
key: i.key ?? String(i.dataIndex ?? a),
|
|
546
|
+
onClick: (v) => {
|
|
547
|
+
var z, F, M;
|
|
548
|
+
(M = (F = (z = i.onHeaderCell) == null ? void 0 : z.call(i, r, a)) == null ? void 0 : F.onClick) == null || M.call(F, v), !v.target.closest(".bj-table__filter-dropdown") && (p ? ue(i, o, v.currentTarget) : Z());
|
|
776
549
|
},
|
|
777
|
-
onKeyDown: (
|
|
778
|
-
var
|
|
779
|
-
(
|
|
780
|
-
if (event.target.closest(".bj-table__filter-dropdown")) return;
|
|
781
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
782
|
-
event.preventDefault();
|
|
783
|
-
if (isFilterable) {
|
|
784
|
-
toggleFilter(column, interactionIndex, event.currentTarget);
|
|
785
|
-
} else {
|
|
786
|
-
triggerHeaderAction();
|
|
787
|
-
}
|
|
788
|
-
}
|
|
550
|
+
onKeyDown: (v) => {
|
|
551
|
+
var z, F, M;
|
|
552
|
+
(M = (F = (z = i.onHeaderCell) == null ? void 0 : z.call(i, r, a)) == null ? void 0 : F.onKeyDown) == null || M.call(F, v), !v.target.closest(".bj-table__filter-dropdown") && (v.key === "Enter" || v.key === " ") && (v.preventDefault(), p ? ue(i, o, v.currentTarget) : Z());
|
|
789
553
|
},
|
|
790
|
-
rowSpan,
|
|
554
|
+
rowSpan: l,
|
|
791
555
|
scope: "col",
|
|
792
|
-
style: { textAlign:
|
|
793
|
-
tabIndex:
|
|
556
|
+
style: { textAlign: i.align, ...dt(i, o) },
|
|
557
|
+
tabIndex: p || u ? 0 : void 0
|
|
794
558
|
},
|
|
795
|
-
"children" in
|
|
559
|
+
"children" in r ? mt(r.title, { filters: Object.fromEntries(K) }) : Ht(i, o)
|
|
796
560
|
);
|
|
797
561
|
})
|
|
798
|
-
] },
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
var
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
const isSelected = selectedKeys.includes(key);
|
|
805
|
-
const resolvedRowClassName = typeof rowClassName === "function" ? rowClassName(record, index, 0) : rowClassName;
|
|
806
|
-
return /* @__PURE__ */ createElement(
|
|
807
|
-
BodyRow,
|
|
562
|
+
] }, t)) }),
|
|
563
|
+
/* @__PURE__ */ b(tr, { className: "bj-table__body", children: V.length > 0 ? V.map(({ record: e, index: t }) => {
|
|
564
|
+
var _;
|
|
565
|
+
const r = q(e, t, g), s = ne(e, t), l = ((_ = d == null ? void 0 : d.getCheckboxProps) == null ? void 0 : _.call(d, e).disabled) ?? !1, a = B.includes(r), i = typeof ge == "function" ? ge(e, t, 0) : ge;
|
|
566
|
+
return /* @__PURE__ */ Me(
|
|
567
|
+
ct,
|
|
808
568
|
{
|
|
809
|
-
...
|
|
810
|
-
className:
|
|
811
|
-
key
|
|
569
|
+
...xe == null ? void 0 : xe(e, t),
|
|
570
|
+
className: L("bj-table__row", s && "bj-table__row--group", a && "bj-table__row--selected", i),
|
|
571
|
+
key: r
|
|
812
572
|
},
|
|
813
|
-
|
|
814
|
-
|
|
573
|
+
d && !s && /* @__PURE__ */ b(
|
|
574
|
+
ze,
|
|
815
575
|
{
|
|
816
|
-
className:
|
|
576
|
+
className: L(
|
|
817
577
|
"bj-table__cell",
|
|
818
578
|
"bj-table__selection-cell",
|
|
819
|
-
|
|
579
|
+
!!(f != null && f.x) && "bj-table__selection-cell--fixed",
|
|
820
580
|
// 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
|
|
821
|
-
|
|
581
|
+
!!(f != null && f.x) && !$(y[0]) && "bj-table__cell--fixed-left-last"
|
|
822
582
|
),
|
|
823
|
-
style: { width:
|
|
824
|
-
children: /* @__PURE__ */
|
|
825
|
-
|
|
583
|
+
style: { width: le },
|
|
584
|
+
children: /* @__PURE__ */ b(
|
|
585
|
+
gt,
|
|
826
586
|
{
|
|
827
|
-
checked:
|
|
828
|
-
disabled:
|
|
829
|
-
label: `选择第 ${
|
|
830
|
-
name:
|
|
831
|
-
onChange: () =>
|
|
832
|
-
type:
|
|
587
|
+
checked: a,
|
|
588
|
+
disabled: l,
|
|
589
|
+
label: `选择第 ${t + 1} 行`,
|
|
590
|
+
name: d.type === "radio" ? "bj-table-row-selection" : void 0,
|
|
591
|
+
onChange: () => Ut(e, t),
|
|
592
|
+
type: d.type ?? "checkbox"
|
|
833
593
|
}
|
|
834
594
|
)
|
|
835
595
|
}
|
|
836
596
|
),
|
|
837
|
-
|
|
838
|
-
var
|
|
839
|
-
if (
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
const renderedCell = isRenderedCell(rendered) ? rendered : void 0;
|
|
844
|
-
const cellProps = { ...(_a3 = column.onCell) == null ? void 0 : _a3.call(column, record, index), ...renderedCell == null ? void 0 : renderedCell.props };
|
|
845
|
-
const content = renderedCell ? renderedCell.children : rendered;
|
|
846
|
-
if (cellProps.colSpan === 0 || cellProps.rowSpan === 0) return null;
|
|
847
|
-
return /* @__PURE__ */ createElement(
|
|
848
|
-
BodyCell,
|
|
597
|
+
y.map((o, p) => {
|
|
598
|
+
var F, M, c;
|
|
599
|
+
if (s && p > 0) return null;
|
|
600
|
+
const u = o, Z = xr(e, u.dataIndex), G = u.render ? u.render(Z, e, t) : Z, T = Rr(G) ? G : void 0, v = { ...(F = u.onCell) == null ? void 0 : F.call(u, e, t), ...T == null ? void 0 : T.props }, z = T ? T.children : G;
|
|
601
|
+
return v.colSpan === 0 || v.rowSpan === 0 ? null : /* @__PURE__ */ Me(
|
|
602
|
+
ze,
|
|
849
603
|
{
|
|
850
|
-
...
|
|
851
|
-
className:
|
|
604
|
+
...v,
|
|
605
|
+
className: L(
|
|
852
606
|
"bj-table__cell",
|
|
853
|
-
((
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
607
|
+
((M = y[p + 1]) == null ? void 0 : M.fixed) === "right" && "bj-table__cell--before-fixed-right",
|
|
608
|
+
s && "bj-table__cell--group",
|
|
609
|
+
u.fixed && "bj-table__cell--fixed",
|
|
610
|
+
$(u) && "bj-table__cell--fixed-left",
|
|
611
|
+
$(u) && !$(y[p + 1]) && "bj-table__cell--fixed-left-last",
|
|
612
|
+
te(u) && "bj-table__cell--fixed-right",
|
|
613
|
+
te(u) && !te(y[p - 1]) && "bj-table__cell--fixed-right-first",
|
|
614
|
+
u.ellipsis && "bj-table__cell--ellipsis",
|
|
615
|
+
u.className,
|
|
616
|
+
v.className
|
|
863
617
|
),
|
|
864
|
-
key:
|
|
865
|
-
colSpan:
|
|
866
|
-
style: { textAlign:
|
|
618
|
+
key: u.key ?? String(u.dataIndex ?? p),
|
|
619
|
+
colSpan: s ? st : v.colSpan,
|
|
620
|
+
style: { textAlign: u.align, ...dt(u, p), ...v.style }
|
|
867
621
|
},
|
|
868
|
-
|
|
869
|
-
record,
|
|
870
|
-
expanded:
|
|
871
|
-
onToggle: () =>
|
|
872
|
-
})) ??
|
|
622
|
+
s ? ((c = h == null ? void 0 : h.render) == null ? void 0 : c.call(h, {
|
|
623
|
+
record: e,
|
|
624
|
+
expanded: Q.includes(oe(e, t)),
|
|
625
|
+
onToggle: () => Gt(e, t)
|
|
626
|
+
})) ?? z ?? "" : /* @__PURE__ */ b("div", { className: "bj-table__cell-content", children: z ?? "" })
|
|
873
627
|
);
|
|
874
628
|
})
|
|
875
629
|
);
|
|
876
|
-
}) : /* @__PURE__ */
|
|
877
|
-
|
|
630
|
+
}) : /* @__PURE__ */ b(ct, { className: "bj-table__empty-row", children: /* @__PURE__ */ b(
|
|
631
|
+
ze,
|
|
878
632
|
{
|
|
879
633
|
className: "bj-table__empty-cell",
|
|
880
|
-
colSpan: Math.max(
|
|
881
|
-
style: { height:
|
|
634
|
+
colSpan: Math.max(st, 1),
|
|
635
|
+
style: { height: Nt }
|
|
882
636
|
}
|
|
883
637
|
) }) }),
|
|
884
|
-
|
|
638
|
+
qe && /* @__PURE__ */ b("tfoot", { className: "bj-table__summary", children: qe(S) })
|
|
885
639
|
] })
|
|
886
640
|
}
|
|
887
641
|
),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
/* @__PURE__ */
|
|
642
|
+
V.length === 0 && /* @__PURE__ */ b("div", { className: "bj-table__empty-overlay", children: /* @__PURE__ */ E("div", { className: "bj-table__empty-content", children: [
|
|
643
|
+
bt && /* @__PURE__ */ b("div", { className: "bj-table__empty-image-wrap", children: bt }),
|
|
644
|
+
/* @__PURE__ */ b("div", { className: "bj-table__empty-text", children: rr })
|
|
891
645
|
] }) })
|
|
892
646
|
] }),
|
|
893
|
-
((
|
|
894
|
-
|
|
647
|
+
((f == null ? void 0 : f.x) || (f == null ? void 0 : f.y)) && /* @__PURE__ */ b(
|
|
648
|
+
br,
|
|
895
649
|
{
|
|
896
|
-
containerRef:
|
|
897
|
-
direction:
|
|
650
|
+
containerRef: fe,
|
|
651
|
+
direction: f != null && f.x && (f != null && f.y) ? "both" : f != null && f.x ? "horizontal" : "vertical",
|
|
898
652
|
gap: 2,
|
|
899
|
-
horizontalInsetEnd:
|
|
900
|
-
horizontalInsetStart:
|
|
653
|
+
horizontalInsetEnd: Qe.end,
|
|
654
|
+
horizontalInsetStart: Qe.start,
|
|
901
655
|
size: 4,
|
|
902
|
-
targetRef:
|
|
656
|
+
targetRef: Re
|
|
903
657
|
}
|
|
904
658
|
),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
659
|
+
Ge && /* @__PURE__ */ b("div", { className: "bj-table__footer", children: Ge(S) }),
|
|
660
|
+
ye && /* @__PURE__ */ E("div", { "aria-live": "polite", "aria-busy": "true", className: "bj-table__loading", role: "status", children: [
|
|
661
|
+
/* @__PURE__ */ b("img", { alt: "", className: "bj-table__loading-indicator", src: hr }),
|
|
662
|
+
/* @__PURE__ */ b("span", { className: "bj-table__loading-text", children: "加载中..." })
|
|
909
663
|
] }),
|
|
910
|
-
|
|
911
|
-
|
|
664
|
+
n && S.length > 0 && /* @__PURE__ */ b("div", { className: "bj-table__pagination", children: /* @__PURE__ */ b(
|
|
665
|
+
sr,
|
|
912
666
|
{
|
|
913
667
|
align: "end",
|
|
914
|
-
disabled:
|
|
915
|
-
current,
|
|
916
|
-
defaultCurrent:
|
|
917
|
-
defaultPageSize:
|
|
918
|
-
dropdownClassName:
|
|
919
|
-
hideOnSinglePage:
|
|
920
|
-
onChange: (
|
|
921
|
-
if (
|
|
922
|
-
|
|
668
|
+
disabled: ye || n.disabled,
|
|
669
|
+
current: H,
|
|
670
|
+
defaultCurrent: n.defaultCurrent,
|
|
671
|
+
defaultPageSize: n.defaultPageSize,
|
|
672
|
+
dropdownClassName: n.dropdownClassName,
|
|
673
|
+
hideOnSinglePage: n.hideOnSinglePage,
|
|
674
|
+
onChange: (e) => {
|
|
675
|
+
if (Be.current) {
|
|
676
|
+
Be.current = !1;
|
|
923
677
|
return;
|
|
924
678
|
}
|
|
925
|
-
|
|
679
|
+
Qt(e);
|
|
926
680
|
},
|
|
927
|
-
onShowSizeChange: (
|
|
928
|
-
pageSize,
|
|
929
|
-
pageSizeOptions:
|
|
930
|
-
popupPlacement:
|
|
931
|
-
resolvePopupPlacement:
|
|
932
|
-
showQuickJumper:
|
|
933
|
-
showSizeChanger:
|
|
934
|
-
showTotal:
|
|
935
|
-
simple:
|
|
936
|
-
size:
|
|
937
|
-
t:
|
|
938
|
-
total
|
|
681
|
+
onShowSizeChange: (e, t) => Zt(t),
|
|
682
|
+
pageSize: W,
|
|
683
|
+
pageSizeOptions: n.pageSizeOptions,
|
|
684
|
+
popupPlacement: n.popupPlacement,
|
|
685
|
+
resolvePopupPlacement: n.resolvePopupPlacement,
|
|
686
|
+
showQuickJumper: n.showQuickJumper,
|
|
687
|
+
showSizeChanger: n.showSizeChanger,
|
|
688
|
+
showTotal: n.showTotal,
|
|
689
|
+
simple: n.simple,
|
|
690
|
+
size: n.size,
|
|
691
|
+
t: n.t ?? C,
|
|
692
|
+
total: et
|
|
939
693
|
}
|
|
940
694
|
) })
|
|
941
695
|
]
|
|
942
696
|
}
|
|
943
697
|
);
|
|
944
698
|
}
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
|
|
699
|
+
const pt = Dr;
|
|
700
|
+
pt.Column = _r;
|
|
701
|
+
pt.ColumnGroup = ur;
|
|
948
702
|
export {
|
|
949
|
-
|
|
703
|
+
pt as BTable
|
|
950
704
|
};
|