bj-web-components 0.2.33 → 0.2.35

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 (113) hide show
  1. package/README.md +10 -1
  2. package/dist/index.d.ts +160 -15
  3. package/dist/index.js +58 -1
  4. package/dist/index.mjs +15 -39
  5. package/dist/miniapp.js +1 -1
  6. package/dist/miniapp.mjs +0 -1
  7. package/dist/mobile.js +1 -1
  8. package/dist/mobile.mjs +0 -1
  9. package/dist/react.js +1 -1
  10. package/dist/react.mjs +0 -1
  11. package/dist/shared.js +1 -1
  12. package/dist/shared.mjs +0 -1
  13. package/dist/style.css +1 -1
  14. package/dist/web/BasicInput/BInput.js +278 -1
  15. package/dist/web/BasicInput/BInput.mjs +263 -164
  16. package/dist/web/BasicInput/utils.js +47 -1
  17. package/dist/web/BasicInput/utils.mjs +22 -20
  18. package/dist/web/CategoryDropdown/CategoryDropdown.js +376 -1
  19. package/dist/web/CategoryDropdown/CategoryDropdown.mjs +355 -235
  20. package/dist/web/CheckBox/BCheckBox.js +176 -1
  21. package/dist/web/CheckBox/BCheckBox.mjs +169 -96
  22. package/dist/web/CheckBox/Group.js +111 -1
  23. package/dist/web/CheckBox/Group.mjs +106 -64
  24. package/dist/web/CheckBox/context.js +8 -1
  25. package/dist/web/CheckBox/context.mjs +2 -4
  26. package/dist/web/CheckBox/index.js +11 -1
  27. package/dist/web/CheckBox/index.mjs +2 -4
  28. package/dist/web/Dropdown/BDropdown.js +265 -1
  29. package/dist/web/Dropdown/BDropdown.mjs +234 -134
  30. package/dist/web/EmptyInputBox/EmptyInputBox.js +89 -1
  31. package/dist/web/EmptyInputBox/EmptyInputBox.mjs +85 -72
  32. package/dist/web/FileCard/FileCard.js +414 -1
  33. package/dist/web/FileCard/FileCard.mjs +400 -116
  34. package/dist/web/Icon/Icon.js +82 -1
  35. package/dist/web/Icon/Icon.mjs +78 -8
  36. package/dist/web/Input/Input.js +230 -1
  37. package/dist/web/Input/Input.mjs +219 -164
  38. package/dist/web/InputNumber/BInputNumber.js +271 -1
  39. package/dist/web/InputNumber/BInputNumber.mjs +254 -189
  40. package/dist/web/InputNumber/StepHandler.js +112 -1
  41. package/dist/web/InputNumber/StepHandler.mjs +102 -50
  42. package/dist/web/InputNumber/hooks/useCursor.js +38 -1
  43. package/dist/web/InputNumber/hooks/useCursor.mjs +31 -34
  44. package/dist/web/InputNumber/hooks/useFrame.js +15 -1
  45. package/dist/web/InputNumber/hooks/useFrame.mjs +8 -5
  46. package/dist/web/InputNumber/utils/decimal.js +163 -1
  47. package/dist/web/InputNumber/utils/decimal.mjs +114 -79
  48. package/dist/web/MobileDrawer/BMobileDrawer.js +238 -0
  49. package/dist/web/MobileDrawer/BMobileDrawer.mjs +233 -0
  50. package/dist/web/Modal/Modal.js +148 -1
  51. package/dist/web/Modal/Modal.mjs +143 -79
  52. package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +273 -1
  53. package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +262 -143
  54. package/dist/web/Pagination/Pagination.js +352 -1
  55. package/dist/web/Pagination/Pagination.mjs +342 -247
  56. package/dist/web/ProductField/ProductField.js +443 -1
  57. package/dist/web/ProductField/ProductField.mjs +423 -208
  58. package/dist/web/ProductField/arrow-up.svg.js +4 -1
  59. package/dist/web/ProductField/arrow-up.svg.mjs +2 -4
  60. package/dist/web/ProductField/checkbox-no.svg.js +4 -1
  61. package/dist/web/ProductField/checkbox-no.svg.mjs +2 -4
  62. package/dist/web/ProductField/checkbox-ok.svg.js +4 -1
  63. package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -4
  64. package/dist/web/ProductField/no_data_light.svg.js +4 -1
  65. package/dist/web/ProductField/no_data_light.svg.mjs +2 -4
  66. package/dist/web/ProductField/search.svg.js +4 -1
  67. package/dist/web/ProductField/search.svg.mjs +2 -4
  68. package/dist/web/ProductField/sort.svg.js +4 -1
  69. package/dist/web/ProductField/sort.svg.mjs +2 -4
  70. package/dist/web/Radio/BRadio.js +151 -0
  71. package/dist/web/Radio/BRadio.mjs +151 -0
  72. package/dist/web/Radio/Button.js +54 -0
  73. package/dist/web/Radio/Button.mjs +52 -0
  74. package/dist/web/Radio/Group.js +97 -0
  75. package/dist/web/Radio/Group.mjs +96 -0
  76. package/dist/web/Radio/context.js +10 -0
  77. package/dist/web/Radio/context.mjs +4 -0
  78. package/dist/web/Radio/index.js +13 -0
  79. package/dist/web/Radio/index.mjs +8 -0
  80. package/dist/web/SkuInputCard/SkuInputCard.js +427 -1
  81. package/dist/web/SkuInputCard/SkuInputCard.mjs +414 -219
  82. package/dist/web/SkuInputCard/spin_loading_red.gif.js +4 -1
  83. package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -4
  84. package/dist/web/Switch/Switch.js +114 -1
  85. package/dist/web/Switch/Switch.mjs +109 -58
  86. package/dist/web/Table/BTable.js +1049 -1
  87. package/dist/web/Table/BTable.mjs +1011 -667
  88. package/dist/web/Table/Column.js +6 -1
  89. package/dist/web/Table/Column.mjs +1 -3
  90. package/dist/web/Table/ColumnGroup.js +6 -1
  91. package/dist/web/Table/ColumnGroup.mjs +1 -3
  92. package/dist/web/Table/utils/columns.js +116 -1
  93. package/dist/web/Table/utils/columns.mjs +103 -37
  94. package/dist/web/Table/utils/sortFilter.js +145 -1
  95. package/dist/web/Table/utils/sortFilter.mjs +129 -57
  96. package/dist/web/Tabs/BTabs.js +260 -1
  97. package/dist/web/Tabs/BTabs.mjs +239 -122
  98. package/dist/web/Tabs/TabPane.js +19 -1
  99. package/dist/web/Tabs/TabPane.mjs +1 -4
  100. package/dist/web/Tooltip/ConfirmTooltip.js +53 -1
  101. package/dist/web/Tooltip/ConfirmTooltip.mjs +47 -22
  102. package/dist/web/Tooltip/ContentTooltip.js +156 -1
  103. package/dist/web/Tooltip/ContentTooltip.mjs +145 -76
  104. package/dist/web/Tooltip/ProgressTooltip.js +56 -1
  105. package/dist/web/Tooltip/ProgressTooltip.mjs +50 -31
  106. package/dist/web/Tooltip/TooltipWrapper.js +19 -1
  107. package/dist/web/Tooltip/TooltipWrapper.mjs +13 -9
  108. package/dist/web/Tooltip/useAutoPlacement.js +65 -1
  109. package/dist/web/Tooltip/useAutoPlacement.mjs +52 -24
  110. package/dist/web.d.ts +160 -15
  111. package/dist/web.js +58 -1
  112. package/dist/web.mjs +15 -39
  113. package/package.json +97 -94
@@ -1,704 +1,1048 @@
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";
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ import { jsxs as E, jsx as u } from "react/jsx-runtime";
14
+ import { useRef as ve, useMemo as ee, useState as C, useEffect as te, createElement as Ae, isValidElement as Tl } from "react";
15
+ import { createPortal as Il } from "react-dom";
16
+ import Ll from "../Pagination/Pagination.mjs";
17
+ import Ge from "../Icon/Icon.mjs";
6
18
  /* empty css */
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";
19
+ import Vl from "../Tooltip/ContentTooltip.mjs";
20
+ import Al from "../Tooltip/TooltipWrapper.mjs";
21
+ import { BCheckBox as ql } from "../CheckBox/index.mjs";
22
+ import { BDropdown as Gl } from "../Dropdown/BDropdown.mjs";
23
+ import Hl from "../OverlayScrollbar/BOverlayScrollbar.mjs";
24
+ import Wl from "../SkuInputCard/spin_loading_red.gif.mjs";
25
+ import $l from "../ProductField/no_data_light.svg.mjs";
26
+ import Ul from "./Column.mjs";
27
+ import Jl from "./ColumnGroup.mjs";
28
+ import { getColumnKey as B, filterRecords as $t, sortRecords as Ut, renderColumnTitle as Jt, getNextSortOrder as Ql, getSorterResult as Zl } from "./utils/sortFilter.mjs";
29
+ import { convertChildrenToColumns as Xl, flattenColumns as Yl, buildHeaderRows as en } from "./utils/columns.mjs";
18
30
  /* empty css */
19
- const vr = 300, Te = 1;
20
- function L(...m) {
21
- return m.filter(Boolean).join(" ");
31
+ var tn = Object.defineProperty,
32
+ ln = Object.defineProperties,
33
+ nn = Object.getOwnPropertyDescriptors,
34
+ Qt = Object.getOwnPropertySymbols,
35
+ rn = Object.prototype.hasOwnProperty,
36
+ an = Object.prototype.propertyIsEnumerable,
37
+ Zt = function Zt(f, c, h) {
38
+ return c in f ? tn(f, c, {
39
+ enumerable: !0,
40
+ configurable: !0,
41
+ writable: !0,
42
+ value: h
43
+ }) : f[c] = h;
44
+ },
45
+ L = function L(f, c) {
46
+ for (var h in c || (c = {})) rn.call(c, h) && Zt(f, h, c[h]);
47
+ if (Qt) {
48
+ var _iterator = _createForOfIteratorHelper(Qt(c)),
49
+ _step;
50
+ try {
51
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
52
+ var h = _step.value;
53
+ an.call(c, h) && Zt(f, h, c[h]);
54
+ }
55
+ } catch (err) {
56
+ _iterator.e(err);
57
+ } finally {
58
+ _iterator.f();
59
+ }
60
+ }
61
+ return f;
62
+ },
63
+ de = function de(f, c) {
64
+ return ln(f, nn(c));
65
+ };
66
+ var on = 300,
67
+ qe = 1;
68
+ function V() {
69
+ for (var _len = arguments.length, f = new Array(_len), _key = 0; _key < _len; _key++) {
70
+ f[_key] = arguments[_key];
71
+ }
72
+ return f.filter(Boolean).join(" ");
22
73
  }
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);
74
+ function sn(f, c) {
75
+ return c === void 0 ? void 0 : (Array.isArray(c) ? c : [c]).reduce(function (O, o) {
76
+ if (!(O == null || _typeof(O) != "object")) return O[o];
77
+ }, f);
28
78
  }
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;
79
+ function H(f, c, h) {
80
+ if (typeof h == "function") return h(f, c);
81
+ if (h) {
82
+ var O = f[String(h)];
83
+ if (typeof O == "string" || typeof O == "number") return O;
36
84
  }
37
- return j;
85
+ return c;
38
86
  }
39
- function Nr(m, j) {
40
- return Math.max(1, Math.ceil(m / j));
87
+ function dn(f, c) {
88
+ return Math.max(1, Math.ceil(f / c));
41
89
  }
42
- function Rr(m) {
43
- return !!(m && typeof m == "object" && !ar(m) && "props" in m);
90
+ function cn(f) {
91
+ return !!(f && _typeof(f) == "object" && !Tl(f) && "props" in f);
44
92
  }
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());
93
+ function un(f, c) {
94
+ return (typeof c.text == "string" || typeof c.text == "number" ? String(c.text) : String(c.value)).toLocaleLowerCase().includes(f.toLocaleLowerCase());
47
95
  }
48
- function gt({
49
- checked: m,
50
- disabled: j,
51
- label: g,
52
- name: D,
53
- onChange: d,
54
- type: A = "checkbox"
55
- }) {
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(
69
- "input",
70
- {
71
- "aria-label": g,
72
- checked: m,
73
- className: "bj-table__selection-input",
74
- disabled: j,
75
- name: D,
76
- onChange: d,
77
- type: A
78
- }
79
- ),
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" }) })
81
- ] });
96
+ function Xt(_ref) {
97
+ var f = _ref.checked,
98
+ c = _ref.disabled,
99
+ h = _ref.label,
100
+ O = _ref.name,
101
+ o = _ref.onChange,
102
+ _ref$type = _ref.type,
103
+ W = _ref$type === void 0 ? "checkbox" : _ref$type;
104
+ return W === "checkbox" ? /* @__PURE__ */u(ql, {
105
+ "aria-label": h,
106
+ checked: f,
107
+ className: "bj-table__selection-checkbox",
108
+ disabled: c,
109
+ name: O,
110
+ onChange: o,
111
+ skipGroup: !0
112
+ }) : /* @__PURE__ */E("label", {
113
+ className: V("bj-table__selection-control", f && "bj-table__selection-control--checked", c && "bj-table__selection-control--disabled"),
114
+ children: [/* @__PURE__ */u("input", {
115
+ "aria-label": h,
116
+ checked: f,
117
+ className: "bj-table__selection-input",
118
+ disabled: c,
119
+ name: O,
120
+ onChange: o,
121
+ type: W
122
+ }), /* @__PURE__ */u("span", {
123
+ "aria-hidden": "true",
124
+ className: "bj-table__selection-box",
125
+ children: f && /* @__PURE__ */u(Ge, {
126
+ className: "bj-table__selection-check-icon",
127
+ type: "icon-a-dagouxi"
128
+ })
129
+ })]
130
+ });
82
131
  }
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
115
- }) {
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) => {
132
+ function fn(_ref2) {
133
+ var f = _ref2.columns,
134
+ _ref2$dataSource = _ref2.dataSource,
135
+ c = _ref2$dataSource === void 0 ? [] : _ref2$dataSource,
136
+ h = _ref2.rowKey,
137
+ _ref2$preserveSelecte = _ref2.preserveSelectedRowKeys,
138
+ O = _ref2$preserveSelecte === void 0 ? !1 : _ref2$preserveSelecte,
139
+ o = _ref2.rowSelection,
140
+ _ref2$pagination = _ref2.pagination,
141
+ W = _ref2$pagination === void 0 ? !1 : _ref2$pagination,
142
+ _ref2$loading = _ref2.loading,
143
+ Re = _ref2$loading === void 0 ? !1 : _ref2$loading,
144
+ _ref2$bordered = _ref2.bordered,
145
+ el = _ref2$bordered === void 0 ? !0 : _ref2$bordered,
146
+ _ref2$size = _ref2.size,
147
+ tl = _ref2$size === void 0 ? "middle" : _ref2$size,
148
+ _ref2$showHeader = _ref2.showHeader,
149
+ He = _ref2$showHeader === void 0 ? !0 : _ref2$showHeader,
150
+ ge = _ref2.emptyText,
151
+ _ref2$emptyImage = _ref2.emptyImage,
152
+ Oe = _ref2$emptyImage === void 0 ? $l : _ref2$emptyImage,
153
+ ll = _ref2.emptyHeight,
154
+ _ref2$t = _ref2.t,
155
+ le = _ref2$t === void 0 ? function (me) {
156
+ return me;
157
+ } : _ref2$t,
158
+ nl = _ref2.className,
159
+ il = _ref2.style,
160
+ De = _ref2.rowClassName,
161
+ _ref2$sortDirections = _ref2.sortDirections,
162
+ rl = _ref2$sortDirections === void 0 ? ["ascend", "descend", null] : _ref2$sortDirections,
163
+ We = _ref2.onChange,
164
+ $e = _ref2.children,
165
+ Ue = _ref2.title,
166
+ Je = _ref2.footer,
167
+ Qe = _ref2.summary,
168
+ ce = _ref2.tableLayout,
169
+ K = _ref2.components,
170
+ Ze = _ref2.onRow,
171
+ Xe = _ref2.onHeaderRow,
172
+ al = _ref2.id,
173
+ b = _ref2.scroll,
174
+ ye = _ref2.locale,
175
+ y = _ref2.groupCollapse;
176
+ var me, Ye, et, tt, lt, nt, it, rt, at, ot, st, dt, ct, ut, ft, bt, _t, ht, pt, vt, gt, yt;
177
+ var mt = ve(null),
178
+ Ee = ve(null),
179
+ je = ee(function () {
180
+ return f != null ? f : Xl($e);
181
+ }, [$e, f]),
182
+ ue = ee(function () {
183
+ return Yl(je);
184
+ }, [je]),
185
+ jt = ee(function () {
186
+ return en(je);
187
+ }, [je]),
188
+ _C = C((me = o == null ? void 0 : o.defaultSelectedRowKeys) != null ? me : []),
189
+ _C2 = _slicedToArray(_C, 2),
190
+ ol = _C2[0],
191
+ xt = _C2[1],
192
+ _C3 = C(W && (Ye = W.defaultCurrent) != null ? Ye : 1),
193
+ _C4 = _slicedToArray(_C3, 2),
194
+ Fe = _C4[0],
195
+ xe = _C4[1],
196
+ _C5 = C(W && (et = W.defaultPageSize) != null ? et : 10),
197
+ _C6 = _slicedToArray(_C5, 2),
198
+ sl = _C6[0],
199
+ dl = _C6[1],
200
+ _C7 = C(function () {
201
+ return new Map(ue.flatMap(function (e, t) {
202
+ return e.defaultSortOrder ? [[B(e, t), e.defaultSortOrder]] : [];
203
+ }));
204
+ }),
205
+ _C8 = _slicedToArray(_C7, 2),
206
+ cl = _C8[0],
207
+ ul = _C8[1],
208
+ _C9 = C(function () {
209
+ return new Map(ue.flatMap(function (e, t) {
210
+ return e.defaultFilteredValue === void 0 ? [] : [[B(e, t), e.defaultFilteredValue]];
211
+ }));
212
+ }),
213
+ _C0 = _slicedToArray(_C9, 2),
214
+ fl = _C0[0],
215
+ bl = _C0[1],
216
+ _C1 = C(y != null && y.defaultExpandedKeys ? _toConsumableArray(y.defaultExpandedKeys) : []),
217
+ _C10 = _slicedToArray(_C1, 2),
218
+ _l = _C10[0],
219
+ hl = _C10[1],
220
+ _C11 = C(null),
221
+ _C12 = _slicedToArray(_C11, 2),
222
+ A = _C12[0],
223
+ Z = _C12[1],
224
+ _C13 = C(/* @__PURE__ */new Map()),
225
+ _C14 = _slicedToArray(_C13, 2),
226
+ St = _C14[0],
227
+ fe = _C14[1],
228
+ _C15 = C(null),
229
+ _C16 = _slicedToArray(_C15, 2),
230
+ pl = _C16[0],
231
+ Se = _C16[1],
232
+ vl = ve("btable-".concat(Math.random().toString(36).slice(2, 10))).current,
233
+ _C17 = C(null),
234
+ _C18 = _slicedToArray(_C17, 2),
235
+ ne = _C18[0],
236
+ ke = _C18[1],
237
+ _C19 = C(null),
238
+ _C20 = _slicedToArray(_C19, 2),
239
+ Be = _C20[0],
240
+ wt = _C20[1],
241
+ _C21 = C(""),
242
+ _C22 = _slicedToArray(_C21, 2),
243
+ Ke = _C22[0],
244
+ Nt = _C22[1],
245
+ _C23 = C(""),
246
+ _C24 = _slicedToArray(_C23, 2),
247
+ be = _C24[0],
248
+ Ct = _C24[1],
249
+ _C25 = C(),
250
+ _C26 = _slicedToArray(_C25, 2),
251
+ Pt = _C26[0],
252
+ ze = _C26[1],
253
+ Me = ve(0),
254
+ Te = ve(!1),
255
+ _C27 = C({
256
+ start: 0,
257
+ end: 0
258
+ }),
259
+ _C28 = _slicedToArray(_C27, 2),
260
+ Rt = _C28[0],
261
+ Ot = _C28[1],
262
+ _C29 = C({
263
+ start: !1,
264
+ end: !1
265
+ }),
266
+ _C30 = _slicedToArray(_C29, 2),
267
+ Dt = _C30[0],
268
+ Et = _C30[1],
269
+ a = W || void 0,
270
+ $ = (tt = a == null ? void 0 : a.pageSize) != null ? tt : sl,
271
+ z = (lt = o == null ? void 0 : o.selectedRowKeys) != null ? lt : ol,
272
+ m = ue,
273
+ gl = "".concat(m.map(function (e) {
274
+ var t, l;
275
+ return "".concat(String((t = e.fixed) != null ? t : ""), ":").concat(String((l = e.width) != null ? l : ""));
276
+ }).join("|"), "|").concat(o ? String((nt = o.columnWidth) != null ? nt : "") : "-", "|").concat(String((it = b == null ? void 0 : b.x) != null ? it : ""), "|").concat(String(ce != null ? ce : "")),
277
+ U = function U(e) {
278
+ return !!(e && (e.fixed === "left" || e.fixed === !0));
279
+ },
280
+ ie = function ie(e) {
281
+ return !!(e && e.fixed === "right");
282
+ },
283
+ F = new Map(cl),
284
+ M = new Map(fl);
285
+ m.forEach(function (e, t) {
134
286
  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);
287
+ var l = B(e, t);
288
+ e.sortOrder !== void 0 && F.set(l, e.sortOrder), e.filteredValue !== void 0 && M.set(l, e.filteredValue);
137
289
  });
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);
148
- };
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);
290
+ var Ft = ee(function () {
291
+ return $t(c, m, M);
292
+ }, [m, M, c]),
293
+ T = ee(function () {
294
+ return Ut(Ft, m, F);
295
+ }, [m, Ft, F]),
296
+ kt = (rt = a == null ? void 0 : a.total) != null ? rt : T.length,
297
+ Bt = dn(kt, $),
298
+ J = Math.min((at = a == null ? void 0 : a.current) != null ? at : Fe, Bt),
299
+ X = (ot = y == null ? void 0 : y.expandedKeys) != null ? ot : _l,
300
+ _e = function _e(e, t) {
301
+ return y != null && y.isGroupRow ? y.isGroupRow(e, t) : !!e.isGroup;
302
+ },
303
+ we = function we(e, t) {
304
+ return y != null && y.groupKey ? y.groupKey(e, t) : e.groupId;
305
+ },
306
+ Kt = function Kt(e, t) {
307
+ var l;
308
+ return y != null && y.childrenKeys ? y.childrenKeys(e, t) : (l = e.childrenIds) != null ? l : [];
309
+ },
310
+ yl = function yl(e, t) {
311
+ var l;
312
+ var i = we(e, t),
313
+ r = X.includes(i),
314
+ n = r ? X.filter(function (_) {
315
+ return _ !== i;
316
+ }) : [].concat(_toConsumableArray(X), [i]);
317
+ (y == null ? void 0 : y.expandedKeys) === void 0 && hl(n), (l = y == null ? void 0 : y.onExpandedKeysChange) == null || l.call(y, n, e, !r);
318
+ };
319
+ te(function () {
320
+ J !== Fe && (a == null ? void 0 : a.current) === void 0 && xe(J);
321
+ }, [J, a == null ? void 0 : a.current, Fe]), te(function () {
322
+ if (!ne || A === null) {
323
+ wt(null);
154
324
  return;
155
325
  }
156
- const e = () => {
157
- const t = J.getBoundingClientRect();
158
- He({ left: t.left, top: t.bottom + 4 });
326
+ var e = function e() {
327
+ var t = ne.getBoundingClientRect();
328
+ wt({
329
+ left: t.left,
330
+ top: t.bottom + 4
331
+ });
159
332
  };
160
- return e(), document.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
333
+ return e(), document.addEventListener("scroll", e, !0), window.addEventListener("resize", e), function () {
161
334
  document.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
162
335
  };
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));
336
+ }, [ne, A]), te(function () {
337
+ if (A === null) return;
338
+ var e = function e(t) {
339
+ var l = t.target;
340
+ ne != null && ne.contains(l) || l.closest(".bj-table__filter-dropdown") || (Z(null), ke(null));
341
+ };
342
+ return document.addEventListener("mousedown", e), function () {
343
+ return document.removeEventListener("mousedown", e);
168
344
  };
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
174
- );
175
- return () => window.clearTimeout(e);
176
- }, [Pe]), Y(() => {
177
- if (I === null) return;
178
- const e = re.find((r, s) => O(r, s) === I);
345
+ }, [ne, A]), te(function () {
346
+ var e = window.setTimeout(function () {
347
+ return Ct(Ke.trim());
348
+ }, on);
349
+ return function () {
350
+ return window.clearTimeout(e);
351
+ };
352
+ }, [Ke]), te(function () {
353
+ if (A === null) return;
354
+ var e = ue.find(function (l, i) {
355
+ return B(l, i) === A;
356
+ });
179
357
  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);
184
- },
185
- () => {
186
- Oe.current === t && ke([]);
187
- }
188
- );
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)
197
- );
358
+ var t = ++Me.current;
359
+ Promise.resolve().then(function () {
360
+ return e.filterRequest(be);
361
+ }).then(function (l) {
362
+ Me.current === t && ze(l);
363
+ }, function () {
364
+ Me.current === t && ze([]);
365
+ });
366
+ }, [be, ue, A]);
367
+ var q = ee(function () {
368
+ if (!a || a.serverPagination) return T.map(function (t, l) {
369
+ return {
370
+ record: t,
371
+ index: l
372
+ };
373
+ }).filter(function (_ref3) {
374
+ var t = _ref3.record,
375
+ l = _ref3.index;
376
+ if (!y || _e(t, l)) return !0;
377
+ var i = H(t, l, h);
378
+ return T.some(function (r, n) {
379
+ return _e(r, n) && X.includes(we(r, n)) && Kt(r, n).includes(i);
380
+ });
198
381
  });
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)
208
- );
382
+ var e = (J - 1) * $;
383
+ return T.slice(e, e + $).map(function (t, l) {
384
+ return {
385
+ record: t,
386
+ index: e + l
387
+ };
388
+ }).filter(function (_ref4) {
389
+ var t = _ref4.record,
390
+ l = _ref4.index;
391
+ if (!y || _e(t, l)) return !0;
392
+ var i = H(t, l, h);
393
+ return T.some(function (r, n) {
394
+ return _e(r, n) && X.includes(we(r, n)) && Kt(r, n).includes(i);
395
+ });
396
+ });
397
+ }, [J, X, y, $, a, T, h]),
398
+ zt = ee(function () {
399
+ return q.map(function (_ref5) {
400
+ var e = _ref5.record,
401
+ t = _ref5.index;
402
+ return H(e, t, h);
403
+ });
404
+ }, [h, q]),
405
+ ml = z.map(String).join("|"),
406
+ jl = zt.map(String).join("|");
407
+ te(function () {
408
+ var e;
409
+ if (!o || O || z.length === 0) return;
410
+ var t = new Set(zt),
411
+ l = z.filter(function (n) {
412
+ return t.has(n);
413
+ });
414
+ if (l.length === z.length) return;
415
+ o.selectedRowKeys === void 0 && xt(l);
416
+ var i = new Set(l),
417
+ r = q.filter(function (_ref6) {
418
+ var n = _ref6.record,
419
+ _ = _ref6.index;
420
+ return i.has(H(n, _, h));
421
+ }).map(function (_ref7) {
422
+ var n = _ref7.record;
423
+ return n;
424
+ });
425
+ (e = o.onChange) == null || e.call(o, l, r, {
426
+ type: "multiple"
209
427
  });
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);
428
+ }, [O, o, h, ml, jl, q]), te(function () {
429
+ var e = Ee.current;
430
+ if (!e || !(b != null && b.x)) {
431
+ Ot(function (n) {
432
+ return n.start === 0 && n.end === 0 ? n : {
433
+ start: 0,
434
+ end: 0
435
+ };
436
+ }), Et(function (n) {
437
+ return n.start || n.end ? {
438
+ start: !1,
439
+ end: !1
440
+ } : n;
441
+ });
226
442
  return;
227
443
  }
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);
444
+ var t = function t() {
445
+ var n;
446
+ var _ = (n = e.querySelector(".bj-table__header .bj-table__header-row")) != null ? n : e.querySelector(".bj-table__body .bj-table__row");
447
+ var p = 0,
448
+ v = 0;
449
+ if (_) {
450
+ Array.from(_.children).forEach(function (s) {
451
+ var P = s.getBoundingClientRect().width;
452
+ s.classList.contains("bj-table__cell--fixed-right") ? v += P : (s.classList.contains("bj-table__cell--fixed-left") || s.classList.contains("bj-table__selection-cell--fixed")) && (p += P);
453
+ });
454
+ var w = e.clientLeft;
455
+ p > 0 && (p += w), v > 0 && (v = Math.max(v - w, 0));
456
+ }
457
+ Ot(function (w) {
458
+ return w.start === p && w.end === v ? w : {
459
+ start: p,
460
+ end: v
461
+ };
235
462
  });
236
- const o = e.clientLeft;
237
- i > 0 && (i += o), _ > 0 && (_ = Math.max(_ - o, 0));
238
- }
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
244
- };
245
- Ye((o) => o.start === _.start && o.end === _.end ? o : _);
246
- }, s = () => {
247
- t(), r();
248
- };
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();
253
- };
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: _ }
262
- );
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);
278
- return;
279
- }
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({
289
- prefixCls: "bj-table",
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);
294
463
  },
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);
464
+ l = function l() {
465
+ var n = e.scrollWidth - e.clientWidth,
466
+ _ = n > qe,
467
+ p = {
468
+ start: _ && e.scrollLeft > qe,
469
+ end: _ && e.scrollLeft < n - qe
470
+ };
471
+ Et(function (v) {
472
+ return v.start === p.start && v.end === p.end ? v : p;
473
+ });
298
474
  },
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(
304
- "span",
305
- {
306
- "aria-label": "表头提示",
307
- className: "bj-table__column-badge-trigger",
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),
315
- role: "button",
316
- tabIndex: 0,
317
- children: /* @__PURE__ */ b("span", { "aria-hidden": "true", className: "bj-table__column-badge-shape" })
318
- }
319
- ),
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 }) })
323
- ] }),
324
- (e.filters || e.filterDropdown) && /* @__PURE__ */ E("div", { className: "bj-table__filter", children: [
325
- /* @__PURE__ */ b(
326
- "button",
327
- {
328
- "aria-expanded": _,
329
- "aria-label": "筛选",
330
- className: L("bj-table__filter-trigger", o && "bj-table__filter-trigger--active"),
331
- onClick: (c) => {
332
- c.stopPropagation(), ue(e, t);
475
+ i = function i() {
476
+ t(), l();
477
+ };
478
+ i(), e.addEventListener("scroll", l, {
479
+ passive: !0
480
+ });
481
+ var r = new ResizeObserver(i);
482
+ return r.observe(e), e.firstElementChild && r.observe(e.firstElementChild), function () {
483
+ e.removeEventListener("scroll", l), r.disconnect();
484
+ };
485
+ }, [gl, b == null ? void 0 : b.x, He, q.length]);
486
+ var Ne = function Ne(e) {
487
+ var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : F;
488
+ var l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : M;
489
+ var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : J;
490
+ var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : $;
491
+ var n;
492
+ var _ = Object.fromEntries(l),
493
+ p = $t(c, m, l),
494
+ v = Ut(p, m, t);
495
+ We == null || We(de(L({}, a), {
496
+ current: i,
497
+ pageSize: r,
498
+ total: (n = a == null ? void 0 : a.total) != null ? n : v.length
499
+ }), _, Zl(m, t), {
500
+ action: e,
501
+ currentDataSource: v
502
+ });
503
+ },
504
+ xl = function xl(e, t) {
505
+ var l, i;
506
+ if (!e.sorter) return;
507
+ var r = B(e, t),
508
+ n = Ql((l = F.get(r)) != null ? l : null, (i = e.sortDirections) != null ? i : rl),
509
+ _ = /* @__PURE__ */new Map();
510
+ _.set(r, n), e.sortOrder === void 0 && ul(_), Ne("sort", _);
511
+ },
512
+ Ie = function Ie(e, t, l) {
513
+ var i = B(e, t),
514
+ r = new Map(M);
515
+ r.set(i, l), e.filteredValue === void 0 && bl(r), Z(null), (a == null ? void 0 : a.current) === void 0 && xe(1), Ne("filter", F, r, 1);
516
+ },
517
+ Sl = function Sl(e, t) {
518
+ var l;
519
+ var i = B(e, t),
520
+ r = e.filterResetToDefaultFilteredValue ? (l = e.defaultFilteredValue) != null ? l : [] : [];
521
+ fe(function (n) {
522
+ return new Map(n).set(i, r);
523
+ });
524
+ },
525
+ Ce = function Ce(e, t, l) {
526
+ var i, r, n, _;
527
+ var p = B(e, t);
528
+ if (A === p) {
529
+ Z(null), ke(null), (i = e.onFilterDropdownOpenChange) == null || i.call(e, !1), (r = e.onFilterDropdownVisibleChange) == null || r.call(e, !1);
530
+ return;
531
+ }
532
+ Nt(""), Ct(""), ze(void 0), fe(function (v) {
533
+ var w;
534
+ return new Map(v).set(p, (w = M.get(p)) != null ? w : []);
535
+ }), Z(p), l && ke(l), (n = e.onFilterDropdownOpenChange) == null || n.call(e, !0), (_ = e.onFilterDropdownVisibleChange) == null || _.call(e, !0);
536
+ },
537
+ wl = function wl(e, t) {
538
+ var l, i, r, n, _, p, v, w, s, P, S, I, G;
539
+ var j = B(e, t),
540
+ N = "bj-table-badge-".concat(vl, "-").concat(String(j).replace(/[^a-zA-Z0-9_-]/g, "-")),
541
+ R = (l = F.get(j)) != null ? l : null,
542
+ D = (i = M.get(j)) != null ? i : [],
543
+ g = (r = St.get(j)) != null ? r : D,
544
+ ae = (_ = (n = e.filterDropdownOpen) != null ? n : e.filterDropdownVisible) != null ? _ : A === j,
545
+ Y = e.filtered || D.length > 0,
546
+ oe = R === "ascend" ? "icon-a-zhengxumian" : R === "descend" ? "icon-a-daoxumian" : "icon-a-weipaixumian",
547
+ Q = Jt(e.title, {
548
+ sortOrder: R,
549
+ sortColumn: R ? e : void 0,
550
+ sortColumns: R ? [{
551
+ column: e,
552
+ order: R
553
+ }] : [],
554
+ filters: Object.fromEntries(M)
555
+ }),
556
+ se = typeof e.filterDropdown == "function" ? e.filterDropdown({
557
+ prefixCls: "bj-table",
558
+ selectedKeys: g.filter(function (d) {
559
+ return typeof d != "boolean";
560
+ }),
561
+ setSelectedKeys: function setSelectedKeys(d) {
562
+ return fe(function (x) {
563
+ return new Map(x).set(j, d);
564
+ });
565
+ },
566
+ confirm: function confirm(d) {
567
+ var x;
568
+ Ie(e, t, (x = St.get(j)) != null ? x : g), (d == null ? void 0 : d.closeDropdown) === !1 && Z(j);
569
+ },
570
+ clearFilters: function clearFilters(d) {
571
+ var x;
572
+ var k = e.filterResetToDefaultFilteredValue ? (x = e.defaultFilteredValue) != null ? x : [] : [];
573
+ fe(function (Pe) {
574
+ return new Map(Pe).set(j, k);
575
+ }), (d == null ? void 0 : d.confirm) === !0 && Ie(e, t, k), ((d == null ? void 0 : d.closeDropdown) === !1 || (d == null ? void 0 : d.confirm) !== !0) && Z(j);
576
+ },
577
+ filters: e.filters,
578
+ close: function close() {
579
+ return Z(null);
580
+ },
581
+ visible: ae
582
+ }) : e.filterDropdown,
583
+ Ht = e.filterRequest ? Pt != null ? Pt : [] : (p = e.filters) != null ? p : [],
584
+ Kl = be && !e.filterRequest ? Ht.filter(function (d) {
585
+ return typeof e.filterSearch == "function" ? e.filterSearch(be, d) : un(be, d);
586
+ }) : Ht,
587
+ zl = !!(e.filterSearch || e.filterRequest),
588
+ Wt = /* @__PURE__ */E("div", {
589
+ className: V("bj-table__column-header", e.sorter && "bj-table__column-header--sortable"),
590
+ children: [e.badge !== void 0 && /* @__PURE__ */u("span", {
591
+ "aria-label": "表头提示",
592
+ className: "bj-table__column-badge-trigger",
593
+ id: N,
594
+ onBlur: function onBlur() {
595
+ return Se(null);
596
+ },
597
+ onClick: function onClick(d) {
598
+ return d.stopPropagation();
599
+ },
600
+ onFocus: function onFocus() {
601
+ return Se(j);
602
+ },
603
+ onKeyDown: function onKeyDown(d) {
604
+ return d.stopPropagation();
605
+ },
606
+ onMouseEnter: function onMouseEnter() {
607
+ return Se(j);
608
+ },
609
+ onMouseLeave: function onMouseLeave() {
610
+ return Se(null);
333
611
  },
334
- type: "button",
335
- children: typeof e.filterIcon == "function" ? e.filterIcon(o) : e.filterIcon ?? /* @__PURE__ */ b(
336
- Le,
337
- {
612
+ role: "button",
613
+ tabIndex: 0,
614
+ children: /* @__PURE__ */u("span", {
615
+ "aria-hidden": "true",
616
+ className: "bj-table__column-badge-shape"
617
+ })
618
+ }), /* @__PURE__ */E("div", {
619
+ className: "bj-table__column-title",
620
+ children: [/* @__PURE__ */u("span", {
621
+ className: "bj-table__column-title-content",
622
+ children: Q
623
+ }), e.sorter && /* @__PURE__ */u("span", {
624
+ "aria-hidden": "true",
625
+ className: "bj-table__column-sorter",
626
+ children: /* @__PURE__ */u(Ge, {
627
+ className: "bj-table__column-sorter-icon",
628
+ type: oe
629
+ })
630
+ })]
631
+ }), (e.filters || e.filterDropdown) && /* @__PURE__ */E("div", {
632
+ className: "bj-table__filter",
633
+ children: [/* @__PURE__ */u("button", {
634
+ "aria-expanded": ae,
635
+ "aria-label": "筛选",
636
+ className: V("bj-table__filter-trigger", Y && "bj-table__filter-trigger--active"),
637
+ onClick: function onClick(d) {
638
+ d.stopPropagation(), Ce(e, t);
639
+ },
640
+ type: "button",
641
+ children: typeof e.filterIcon == "function" ? e.filterIcon(Y) : (v = e.filterIcon) != null ? v : /* @__PURE__ */u(Ge, {
338
642
  className: "bj-table__filter-icon",
339
- type: o ? "icon-shaixuan-daidian" : "icon-a-shaixuanxi"
340
- }
341
- )
342
- }
343
- ),
344
- _ && Ee && typeof document < "u" && nr(
345
- /* @__PURE__ */ b(
346
- "div",
347
- {
643
+ type: Y ? "icon-shaixuan-daidian" : "icon-a-shaixuanxi"
644
+ })
645
+ }), ae && Be && typeof document != "undefined" && Il(/* @__PURE__ */u("div", {
348
646
  className: "bj-table__filter-dropdown",
349
- onClick: (c) => c.stopPropagation(),
647
+ onClick: function onClick(d) {
648
+ return d.stopPropagation();
649
+ },
350
650
  role: "dialog",
351
- style: { left: Ee.left, top: Ee.top },
352
- children: Z ?? /* @__PURE__ */ b(
353
- cr,
354
- {
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);
361
- },
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);
365
- },
366
- onReset: () => {
367
- var c, x;
368
- $t(e, t), (x = (c = e.filterDropdownProps) == null ? void 0 : c.onReset) == null || x.call(c);
369
- },
370
- onSearch: (c) => {
371
- var x, k;
372
- Ue(c), (k = (x = e.filterDropdownProps) == null ? void 0 : x.onSearch) == null || k.call(x, c);
373
- },
374
- options: T.map((c) => ({
375
- label: c.text,
376
- description: c.description,
377
- value: c.value
378
- })),
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
384
- }
385
- )
386
- }
387
- ),
388
- document.body
389
- )
390
- ] })
391
- ] });
392
- return e.badge !== void 0 ? /* @__PURE__ */ E(
393
- dr,
394
- {
651
+ style: {
652
+ left: Be.left,
653
+ top: Be.top
654
+ },
655
+ children: se != null ? se : /* @__PURE__ */u(Gl, de(L({}, e.filterDropdownProps), {
656
+ emptyText: (w = ye == null ? void 0 : ye.filterEmptyText) != null ? w : le("暂无结果"),
657
+ multiple: e.filterMultiple !== !1,
658
+ onChange: function onChange(d, x) {
659
+ var k, Pe;
660
+ fe(function (Ml) {
661
+ return new Map(Ml).set(j, d);
662
+ }), (Pe = (k = e.filterDropdownProps) == null ? void 0 : k.onChange) == null || Pe.call(k, d, x);
663
+ },
664
+ onConfirm: function onConfirm(d) {
665
+ var x, k;
666
+ Ie(e, t, d), (k = (x = e.filterDropdownProps) == null ? void 0 : x.onConfirm) == null || k.call(x, d);
667
+ },
668
+ onReset: function onReset() {
669
+ var d, x;
670
+ Sl(e, t), (x = (d = e.filterDropdownProps) == null ? void 0 : d.onReset) == null || x.call(d);
671
+ },
672
+ onSearch: function onSearch(d) {
673
+ var x, k;
674
+ Nt(d), (k = (x = e.filterDropdownProps) == null ? void 0 : x.onSearch) == null || k.call(x, d);
675
+ },
676
+ options: Kl.map(function (d) {
677
+ return {
678
+ label: d.text,
679
+ description: d.description,
680
+ value: d.value
681
+ };
682
+ }),
683
+ searchable: (P = (s = e.filterDropdownProps) == null ? void 0 : s.searchable) != null ? P : zl,
684
+ searchPlaceholder: (G = (S = e.filterDropdownProps) == null ? void 0 : S.searchPlaceholder) != null ? G : e.filterRequest ? le("请输入搜索内容") : (I = ye == null ? void 0 : ye.filterSearchPlaceholder) != null ? I : le("搜索"),
685
+ searchValue: Ke,
686
+ t: le,
687
+ value: g
688
+ }))
689
+ }), document.body)]
690
+ })]
691
+ });
692
+ return e.badge !== void 0 ? /* @__PURE__ */E(Al, {
395
693
  className: "bj-table__column-tooltip-wrapper",
396
- children: [
397
- /* @__PURE__ */ b("div", { className: "bj-table__column-tooltip-trigger", children: z }),
398
- Lt === r && /* @__PURE__ */ b(
399
- lr,
400
- {
401
- className: "bj-table__column-tooltip",
402
- content: e.badge,
403
- getAnchorElement: () => document.getElementById(s),
404
- getPopupContainer: () => document.body,
405
- placement: "top"
406
- }
407
- )
408
- ]
409
- }
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))
416
- );
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)
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 }) => {
694
+ children: [/* @__PURE__ */u("div", {
695
+ className: "bj-table__column-tooltip-trigger",
696
+ children: Wt
697
+ }), pl === j && /* @__PURE__ */u(Vl, {
698
+ className: "bj-table__column-tooltip",
699
+ content: e.badge,
700
+ getAnchorElement: function getAnchorElement() {
701
+ return document.getElementById(N);
702
+ },
703
+ getPopupContainer: function getPopupContainer() {
704
+ return document.body;
705
+ },
706
+ placement: "top"
707
+ })]
708
+ }) : Wt;
709
+ },
710
+ Mt = function Mt(e, t, l) {
711
+ var i, r;
712
+ t.selectedRowKeys === void 0 && xt(e);
713
+ var n = new Set(e),
714
+ _ = c.filter(function (p, v) {
715
+ return n.has(H(p, v, h));
716
+ });
717
+ (i = t.onChange) == null || i.call(t, e, _), l && ((r = t.onSelect) == null || r.call(t, l, n.has(H(l, c.indexOf(l), h)), _));
718
+ },
719
+ Nl = function Nl(e, t) {
720
+ if (!o) return;
721
+ var l = H(e, t, h),
722
+ i = z.includes(l),
723
+ r = o.type === "radio" ? i ? [] : [l] : i ? z.filter(function (n) {
724
+ return n !== l;
725
+ }) : [].concat(_toConsumableArray(z), [l]);
726
+ Mt(r, o, e);
727
+ },
728
+ Tt = q.filter(function (_ref8) {
729
+ var e = _ref8.record;
430
730
  var t;
431
- return !((t = d == null ? void 0 : d.getCheckboxProps) != null && t.call(d, e).disabled);
432
- }
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")
438
- return;
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)
444
- );
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)
451
- return;
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,
459
- minWidth: "100%",
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(
463
- "div",
464
- {
465
- id: Et,
466
- ref: fe,
467
- className: L(
468
- "bj-table",
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
476
- ),
477
- style: Ft,
478
- children: [
479
- we && /* @__PURE__ */ b("div", { className: "bj-table__title", children: we(S) }),
480
- /* @__PURE__ */ E("div", { className: "bj-table__viewport", children: [
481
- /* @__PURE__ */ b(
482
- "div",
483
- {
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))
491
- ] }),
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,
495
- {
496
- className: L(
497
- "bj-table__header-cell",
498
- "bj-table__selection-cell",
499
- !!(f != null && f.x) && "bj-table__selection-cell--fixed",
500
- // 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
501
- !!(f != null && f.x) && !$(y[0]) && "bj-table__cell--fixed-left-last"
502
- ),
503
- rowSpan: Ae.length,
504
- scope: "col",
505
- style: { width: le },
506
- children: [
507
- d.type !== "radio" && /* @__PURE__ */ b(
508
- gt,
509
- {
510
- checked: Se,
511
- disabled: se.length === 0,
512
- onChange: Jt,
513
- label: "选择当前页所有行"
514
- }
515
- ),
516
- d.columnTitle
517
- ]
518
- }
519
- ),
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);
731
+ return !((t = o == null ? void 0 : o.getCheckboxProps) != null && t.call(o, e).disabled);
732
+ }),
733
+ he = Tt.map(function (_ref9) {
734
+ var e = _ref9.record,
735
+ t = _ref9.index;
736
+ return H(e, t, h);
737
+ }),
738
+ Le = he.length > 0 && he.every(function (e) {
739
+ return z.includes(e);
740
+ }),
741
+ Cl = function Cl() {
742
+ var e;
743
+ if (!o || o.type === "radio") return;
744
+ var t = new Set(he),
745
+ l = Le ? z.filter(function (i) {
746
+ return !t.has(i);
747
+ }) : Array.from(/* @__PURE__ */new Set([].concat(_toConsumableArray(z), _toConsumableArray(he))));
748
+ Mt(l, o), new Set(l), (e = o.onSelectAll) == null || e.call(o, !Le, Tt.map(function (_ref0) {
749
+ var i = _ref0.record;
750
+ return i;
751
+ }));
752
+ },
753
+ Pl = function Pl(e) {
754
+ var t;
755
+ !a || e < 1 || e > Bt || e === J || (a.current === void 0 && xe(e), (t = a.onChange) == null || t.call(a, e, $), Ne("paginate", F, M, e));
756
+ },
757
+ Rl = function Rl(e) {
758
+ var t, l;
759
+ if (!a || e === $) return;
760
+ var i = 1;
761
+ Te.current = !0, a.pageSize === void 0 && dl(e), a.current === void 0 && xe(i), (t = a.onShowSizeChange) == null || t.call(a, i, e), (l = a.onChange) == null || l.call(a, i, e), Ne("paginate", F, M, i, e);
762
+ },
763
+ It = m.length + (o ? 1 : 0),
764
+ pe = (st = o == null ? void 0 : o.columnWidth) != null ? st : 48,
765
+ Lt = function Lt(e) {
766
+ return typeof e.width == "number" ? e.width : 0;
767
+ },
768
+ Vt = function Vt(e, t) {
769
+ var l = e.fixed === !0 ? "left" : e.fixed;
770
+ return l === "left" ? {
771
+ position: "sticky",
772
+ left: m.slice(0, t).reduce(function (r, n) {
773
+ return r + Lt(n);
774
+ }, o && typeof pe == "number" ? pe : 0),
775
+ zIndex: 2
776
+ } : l === "right" ? {
777
+ position: "sticky",
778
+ right: m.slice(t + 1).reduce(function (r, n) {
779
+ return r + Lt(n);
780
+ }, 0),
781
+ zIndex: 2
782
+ } : {};
783
+ },
784
+ Ol = b != null && b.x ? {
785
+ width: b.x === !0 ? "max-content" : b.x,
786
+ minWidth: "100%",
787
+ tableLayout: ce != null ? ce : "fixed"
788
+ } : {
789
+ tableLayout: ce
790
+ },
791
+ Dl = (dt = K == null ? void 0 : K.table) != null ? dt : "table",
792
+ El = (ut = (ct = K == null ? void 0 : K.header) == null ? void 0 : ct.wrapper) != null ? ut : "thead",
793
+ Fl = (bt = (ft = K == null ? void 0 : K.header) == null ? void 0 : ft.row) != null ? bt : "tr",
794
+ At = (ht = (_t = K == null ? void 0 : K.header) == null ? void 0 : _t.cell) != null ? ht : "th",
795
+ re = _typeof(K == null ? void 0 : K.body) == "object" ? K.body : void 0,
796
+ kl = (pt = re == null ? void 0 : re.wrapper) != null ? pt : "tbody",
797
+ qt = (vt = re == null ? void 0 : re.row) != null ? vt : "tr",
798
+ Ve = (gt = re == null ? void 0 : re.cell) != null ? gt : "td",
799
+ Bl = typeof ge == "function" ? ge() : ge != null ? ge : le("暂无数据"),
800
+ Gt = typeof Oe == "string" ? /* @__PURE__ */u("img", {
801
+ alt: "",
802
+ className: "bj-table__empty-image",
803
+ src: Oe
804
+ }) : Oe;
805
+ return /* @__PURE__ */E("div", {
806
+ id: al,
807
+ ref: mt,
808
+ className: V("bj-table", el && "bj-table--bordered", "bj-table--".concat(tl), Re && "bj-table--loading", T.length === 0 && "bj-table--empty", Dt.start && "bj-table--ping-left", Dt.end && "bj-table--ping-right", nl),
809
+ style: il,
810
+ children: [Ue && /* @__PURE__ */u("div", {
811
+ className: "bj-table__title",
812
+ children: Ue(T)
813
+ }), /* @__PURE__ */E("div", {
814
+ className: "bj-table__viewport",
815
+ children: [/* @__PURE__ */u("div", {
816
+ className: V("bj-table__scroll", !!(b != null && b.x || b != null && b.y) && "bj-overlay-scrollbar-hidden"),
817
+ ref: Ee,
818
+ style: {
819
+ maxHeight: b == null ? void 0 : b.y
820
+ },
821
+ children: /* @__PURE__ */E(Dl, {
822
+ className: "bj-table__native-table",
823
+ style: Ol,
824
+ children: [m.some(function (e) {
825
+ return e.width;
826
+ }) && /* @__PURE__ */E("colgroup", {
827
+ children: [o && /* @__PURE__ */u("col", {
828
+ className: "bj-table__selection-col",
829
+ style: {
830
+ width: pe
831
+ }
832
+ }), m.map(function (e, t) {
833
+ var l;
834
+ return /* @__PURE__ */u("col", {
835
+ style: {
836
+ width: e.width
837
+ }
838
+ }, (l = e.key) != null ? l : t);
839
+ })]
840
+ }), He && /* @__PURE__ */u(El, {
841
+ className: "bj-table__header",
842
+ children: jt.map(function (e, t) {
843
+ return /* @__PURE__ */E(Fl, de(L({
844
+ className: "bj-table__header-row"
845
+ }, Xe == null ? void 0 : Xe(m, t)), {
846
+ children: [o && t === 0 && /* @__PURE__ */E(At, {
847
+ className: V("bj-table__header-cell", "bj-table__selection-cell", !!(b != null && b.x) && "bj-table__selection-cell--fixed",
848
+ // 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
849
+ !!(b != null && b.x) && !U(m[0]) && "bj-table__cell--fixed-left-last"),
850
+ rowSpan: jt.length,
851
+ scope: "col",
852
+ style: {
853
+ width: pe
854
+ },
855
+ children: [o.type !== "radio" && /* @__PURE__ */u(Xt, {
856
+ checked: Le,
857
+ disabled: he.length === 0,
858
+ onChange: Cl,
859
+ label: "选择当前页所有行"
860
+ }), o.columnTitle]
861
+ }), e.map(function (_ref1, n) {
862
+ var l = _ref1.column,
863
+ i = _ref1.colSpan,
864
+ r = _ref1.rowSpan;
865
+ var _, p, v, w;
866
+ var s = l,
867
+ P = m.indexOf(s),
868
+ S = P >= 0 ? P : n,
869
+ I = !("children" in l) && !!(s.filters || s.filterDropdown),
870
+ G = !("children" in l) && !!s.sorter,
871
+ j = function j() {
872
+ I ? Ce(s, S) : G && xl(s, S);
524
873
  };
525
- return /* @__PURE__ */ Me(
526
- ft,
527
- {
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(
532
- "bj-table__header-cell",
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
543
- ),
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());
549
- },
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());
553
- },
554
- rowSpan: l,
555
- scope: "col",
556
- style: { textAlign: i.align, ...dt(i, o) },
557
- tabIndex: p || u ? 0 : void 0
558
- },
559
- "children" in r ? mt(r.title, { filters: Object.fromEntries(K) }) : Ht(i, o)
560
- );
561
- })
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,
568
- {
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
874
+ return /* @__PURE__ */Ae(At, de(L({}, (_ = s.onHeaderCell) == null ? void 0 : _.call(s, l, n)), {
875
+ "aria-label": typeof s.title == "string" ? s.title : void 0,
876
+ "aria-sort": G ? F.get(B(s, S)) === "ascend" ? "ascending" : F.get(B(s, S)) === "descend" ? "descending" : "none" : void 0,
877
+ className: V("bj-table__header-cell", ((p = m[S + 1]) == null ? void 0 : p.fixed) === "right" && "bj-table__cell--before-fixed-right", s.fixed && "bj-table__cell--fixed", U(s) && "bj-table__cell--fixed-left", U(s) && !U(m[S + 1]) && "bj-table__cell--fixed-left-last", ie(s) && "bj-table__cell--fixed-right", ie(s) && !ie(m[S - 1]) && "bj-table__cell--fixed-right-first", s.sorter && "bj-table__header-cell--sortable", I && "bj-table__header-cell--filterable", F.get(B(s, S)) && "bj-table__header-cell--sorted", s.className),
878
+ colSpan: i,
879
+ key: (w = s.key) != null ? w : String((v = s.dataIndex) != null ? v : n),
880
+ onClick: function onClick(N) {
881
+ var R, D, g;
882
+ (g = (D = (R = s.onHeaderCell) == null ? void 0 : R.call(s, l, n)) == null ? void 0 : D.onClick) == null || g.call(D, N), !N.target.closest(".bj-table__filter-dropdown") && (I ? Ce(s, S, N.currentTarget) : j());
572
883
  },
573
- d && !s && /* @__PURE__ */ b(
574
- ze,
575
- {
576
- className: L(
577
- "bj-table__cell",
578
- "bj-table__selection-cell",
579
- !!(f != null && f.x) && "bj-table__selection-cell--fixed",
580
- // 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
581
- !!(f != null && f.x) && !$(y[0]) && "bj-table__cell--fixed-left-last"
582
- ),
583
- style: { width: le },
584
- children: /* @__PURE__ */ b(
585
- gt,
586
- {
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"
593
- }
594
- )
595
- }
596
- ),
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,
603
- {
604
- ...v,
605
- className: L(
606
- "bj-table__cell",
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
617
- ),
618
- key: u.key ?? String(u.dataIndex ?? p),
619
- colSpan: s ? st : v.colSpan,
620
- style: { textAlign: u.align, ...dt(u, p), ...v.style }
621
- },
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 ?? "" })
627
- );
628
- })
629
- );
630
- }) : /* @__PURE__ */ b(ct, { className: "bj-table__empty-row", children: /* @__PURE__ */ b(
631
- ze,
632
- {
633
- className: "bj-table__empty-cell",
634
- colSpan: Math.max(st, 1),
635
- style: { height: Nt }
884
+ onKeyDown: function onKeyDown(N) {
885
+ var R, D, g;
886
+ (g = (D = (R = s.onHeaderCell) == null ? void 0 : R.call(s, l, n)) == null ? void 0 : D.onKeyDown) == null || g.call(D, N), !N.target.closest(".bj-table__filter-dropdown") && (N.key === "Enter" || N.key === " ") && (N.preventDefault(), I ? Ce(s, S, N.currentTarget) : j());
887
+ },
888
+ rowSpan: r,
889
+ scope: "col",
890
+ style: L({
891
+ textAlign: s.align
892
+ }, Vt(s, S)),
893
+ tabIndex: I || G ? 0 : void 0
894
+ }), "children" in l ? Jt(l.title, {
895
+ filters: Object.fromEntries(M)
896
+ }) : wl(s, S));
897
+ })]
898
+ }), t);
899
+ })
900
+ }), /* @__PURE__ */u(kl, {
901
+ className: "bj-table__body",
902
+ children: q.length > 0 ? q.map(function (_ref10) {
903
+ var e = _ref10.record,
904
+ t = _ref10.index;
905
+ var l, i, r;
906
+ var n = H(e, t, h),
907
+ _ = _e(e, t),
908
+ p = (i = (l = o == null ? void 0 : o.getCheckboxProps) == null ? void 0 : l.call(o, e).disabled) != null ? i : !1,
909
+ v = z.includes(n),
910
+ w = typeof De == "function" ? De(e, t, 0) : De;
911
+ return /* @__PURE__ */Ae(qt, de(L({}, Ze == null ? void 0 : Ze(e, t)), {
912
+ className: V("bj-table__row", _ && "bj-table__row--group", v && "bj-table__row--selected", w),
913
+ key: n
914
+ }), o && !_ && /* @__PURE__ */u(Ve, {
915
+ className: V("bj-table__cell", "bj-table__selection-cell", !!(b != null && b.x) && "bj-table__selection-cell--fixed",
916
+ // 选择列就是最后一个左固定区域时,由它承担左侧渐变阴影
917
+ !!(b != null && b.x) && !U(m[0]) && "bj-table__cell--fixed-left-last"),
918
+ style: {
919
+ width: pe
920
+ },
921
+ children: /* @__PURE__ */u(Xt, {
922
+ checked: v,
923
+ disabled: p,
924
+ label: "\u9009\u62E9\u7B2C ".concat(t + 1, " \u884C"),
925
+ name: o.type === "radio" ? "bj-table-row-selection" : void 0,
926
+ onChange: function onChange() {
927
+ return Nl(e, t);
928
+ },
929
+ type: (r = o.type) != null ? r : "checkbox"
930
+ })
931
+ }), m.map(function (s, P) {
932
+ var S, I, G, j, N, R, D;
933
+ if (_ && P > 0) return null;
934
+ var g = s,
935
+ ae = sn(e, g.dataIndex),
936
+ Y = g.render ? g.render(ae, e, t) : ae,
937
+ oe = cn(Y) ? Y : void 0,
938
+ Q = L(L({}, (S = g.onCell) == null ? void 0 : S.call(g, e, t)), oe == null ? void 0 : oe.props),
939
+ se = oe ? oe.children : Y;
940
+ return Q.colSpan === 0 || Q.rowSpan === 0 ? null : /* @__PURE__ */Ae(Ve, de(L({}, Q), {
941
+ className: V("bj-table__cell", ((I = m[P + 1]) == null ? void 0 : I.fixed) === "right" && "bj-table__cell--before-fixed-right", _ && "bj-table__cell--group", g.fixed && "bj-table__cell--fixed", U(g) && "bj-table__cell--fixed-left", U(g) && !U(m[P + 1]) && "bj-table__cell--fixed-left-last", ie(g) && "bj-table__cell--fixed-right", ie(g) && !ie(m[P - 1]) && "bj-table__cell--fixed-right-first", g.ellipsis && "bj-table__cell--ellipsis", g.className, Q.className),
942
+ key: (j = g.key) != null ? j : String((G = g.dataIndex) != null ? G : P),
943
+ colSpan: _ ? It : Q.colSpan,
944
+ style: L(L({
945
+ textAlign: g.align
946
+ }, Vt(g, P)), Q.style)
947
+ }), _ ? (D = (R = (N = y == null ? void 0 : y.render) == null ? void 0 : N.call(y, {
948
+ record: e,
949
+ expanded: X.includes(we(e, t)),
950
+ onToggle: function onToggle() {
951
+ return yl(e, t);
636
952
  }
637
- ) }) }),
638
- qe && /* @__PURE__ */ b("tfoot", { className: "bj-table__summary", children: qe(S) })
639
- ] })
640
- }
641
- ),
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 })
645
- ] }) })
646
- ] }),
647
- ((f == null ? void 0 : f.x) || (f == null ? void 0 : f.y)) && /* @__PURE__ */ b(
648
- br,
649
- {
650
- containerRef: fe,
651
- direction: f != null && f.x && (f != null && f.y) ? "both" : f != null && f.x ? "horizontal" : "vertical",
652
- gap: 2,
653
- horizontalInsetEnd: Qe.end,
654
- horizontalInsetStart: Qe.start,
655
- size: 4,
656
- targetRef: Re
657
- }
658
- ),
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: "加载中..." })
663
- ] }),
664
- n && S.length > 0 && /* @__PURE__ */ b("div", { className: "bj-table__pagination", children: /* @__PURE__ */ b(
665
- sr,
666
- {
667
- align: "end",
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;
677
- return;
678
- }
679
- Qt(e);
680
- },
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
953
+ })) != null ? R : se) != null ? D : "" : /* @__PURE__ */u("div", {
954
+ className: "bj-table__cell-content",
955
+ children: se != null ? se : ""
956
+ }));
957
+ }));
958
+ }) : /* @__PURE__ */u(qt, {
959
+ className: "bj-table__empty-row",
960
+ children: /* @__PURE__ */u(Ve, {
961
+ className: "bj-table__empty-cell",
962
+ colSpan: Math.max(It, 1),
963
+ style: {
964
+ height: ll
965
+ }
966
+ })
967
+ })
968
+ }), Qe && /* @__PURE__ */u("tfoot", {
969
+ className: "bj-table__summary",
970
+ children: Qe(T)
971
+ })]
972
+ })
973
+ }), q.length === 0 && /* @__PURE__ */u("div", {
974
+ className: "bj-table__empty-overlay",
975
+ children: /* @__PURE__ */E("div", {
976
+ className: "bj-table__empty-content",
977
+ children: [Gt && /* @__PURE__ */u("div", {
978
+ className: "bj-table__empty-image-wrap",
979
+ children: Gt
980
+ }), /* @__PURE__ */u("div", {
981
+ className: "bj-table__empty-text",
982
+ children: Bl
983
+ })]
984
+ })
985
+ })]
986
+ }), ((b == null ? void 0 : b.x) || (b == null ? void 0 : b.y)) && /* @__PURE__ */u(Hl, {
987
+ containerRef: mt,
988
+ direction: b != null && b.x && b != null && b.y ? "both" : b != null && b.x ? "horizontal" : "vertical",
989
+ gap: 2,
990
+ horizontalInsetEnd: Rt.end,
991
+ horizontalInsetStart: Rt.start,
992
+ size: 4,
993
+ targetRef: Ee
994
+ }), Je && /* @__PURE__ */u("div", {
995
+ className: "bj-table__footer",
996
+ children: Je(T)
997
+ }), Re && /* @__PURE__ */E("div", {
998
+ "aria-live": "polite",
999
+ "aria-busy": "true",
1000
+ className: "bj-table__loading",
1001
+ role: "status",
1002
+ children: [/* @__PURE__ */u("img", {
1003
+ alt: "",
1004
+ className: "bj-table__loading-indicator",
1005
+ src: Wl
1006
+ }), /* @__PURE__ */u("span", {
1007
+ className: "bj-table__loading-text",
1008
+ children: "加载中..."
1009
+ })]
1010
+ }), a && T.length > 0 && /* @__PURE__ */u("div", {
1011
+ className: "bj-table__pagination",
1012
+ children: /* @__PURE__ */u(Ll, {
1013
+ align: "end",
1014
+ disabled: !!Re || a.disabled,
1015
+ current: J,
1016
+ defaultCurrent: a.defaultCurrent,
1017
+ defaultPageSize: a.defaultPageSize,
1018
+ dropdownClassName: a.dropdownClassName,
1019
+ hideOnSinglePage: a.hideOnSinglePage,
1020
+ onChange: function onChange(e) {
1021
+ if (Te.current) {
1022
+ Te.current = !1;
1023
+ return;
693
1024
  }
694
- ) })
695
- ]
696
- }
697
- );
1025
+ Pl(e);
1026
+ },
1027
+ onShowSizeChange: function onShowSizeChange(e, t) {
1028
+ return Rl(t);
1029
+ },
1030
+ pageSize: $,
1031
+ pageSizeOptions: a.pageSizeOptions,
1032
+ popupPlacement: a.popupPlacement,
1033
+ resolvePopupPlacement: a.resolvePopupPlacement,
1034
+ showQuickJumper: a.showQuickJumper,
1035
+ showSizeChanger: a.showSizeChanger,
1036
+ showTotal: a.showTotal,
1037
+ simple: a.simple,
1038
+ size: a.size,
1039
+ t: (yt = a.t) != null ? yt : le,
1040
+ total: kt
1041
+ })
1042
+ })]
1043
+ });
698
1044
  }
699
- const pt = Dr;
700
- pt.Column = _r;
701
- pt.ColumnGroup = ur;
702
- export {
703
- pt as BTable
704
- };
1045
+ var Yt = fn;
1046
+ Yt.Column = Ul;
1047
+ Yt.ColumnGroup = Jl;
1048
+ export { Yt as BTable };