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