bitz-react-admin-ui 2.1.9 → 2.2.0

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 (61) hide show
  1. package/dist/_virtual/index.mjs +2 -2
  2. package/dist/_virtual/index2.mjs +2 -2
  3. package/dist/components/BitzTable/ActionBar/ActionBar.mjs +26 -22
  4. package/dist/components/BitzTable/ActionCol/index.d.ts +1 -1
  5. package/dist/components/BitzTable/ActionCol/index.mjs +61 -61
  6. package/dist/components/BitzTable/SelectionBar/Button.d.ts +2 -3
  7. package/dist/components/BitzTable/SelectionBar/Button.mjs +19 -25
  8. package/dist/components/BitzTable/SelectionBar/SelectionBar.mjs +24 -21
  9. package/dist/components/BitzTable/Store/index.d.ts +43 -22
  10. package/dist/components/BitzTable/Store/index.mjs +128 -125
  11. package/dist/components/BitzTable/Store/utils/index.d.ts +4 -5
  12. package/dist/components/BitzTable/Store/utils/index.mjs +31 -31
  13. package/dist/components/BitzTable/SubTable/index.mjs +90 -106
  14. package/dist/components/BitzTable/Table/SortTableContext.d.ts +12 -0
  15. package/dist/components/BitzTable/Table/SortTableContext.mjs +25 -0
  16. package/dist/components/BitzTable/Table/SortableRow.d.ts +7 -0
  17. package/dist/components/BitzTable/Table/SortableRow.mjs +54 -0
  18. package/dist/components/BitzTable/Table/index.d.ts +5 -0
  19. package/dist/components/BitzTable/Table/index.mjs +265 -244
  20. package/dist/components/BitzTable/Table/utils.mjs +17 -16
  21. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.d.ts +1 -0
  22. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +84 -97
  23. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.d.ts +5 -4
  24. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.mjs +66 -60
  25. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndList.mjs +78 -72
  26. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +1 -3
  27. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +190 -189
  28. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.d.ts +8 -0
  29. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.mjs +94 -0
  30. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.d.ts +10 -0
  31. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.mjs +58 -0
  32. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.d.ts +13 -7
  33. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +119 -80
  34. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.d.ts +2 -2
  35. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +26 -29
  36. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.d.ts +3 -1
  37. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +53 -77
  38. package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.d.ts +2 -2
  39. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.d.ts +12 -0
  40. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +61 -0
  41. package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +50 -59
  42. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +27 -32
  43. package/dist/components/BitzTable/ToolBar/Modal/index.d.ts +18 -0
  44. package/dist/components/BitzTable/ToolBar/Modal/index.mjs +50 -0
  45. package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +2 -0
  46. package/dist/components/BitzTable/ToolBar/Modal/style.mjs +58 -0
  47. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +20 -20
  48. package/dist/components/BitzTable/ToolBar/index.d.ts +12 -11
  49. package/dist/components/BitzTable/index.d.ts +2 -0
  50. package/dist/node_modules/.store/@ant-design_icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.mjs +5 -0
  51. package/dist/node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs +15 -0
  52. package/dist/node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1098 -753
  53. package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
  54. package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
  55. package/dist/style.css +1 -1
  56. package/dist/utils/findNode.d.ts +2 -2
  57. package/package.json +1 -1
  58. package/dist/components/BitzTable/Select/index.mjs +0 -11
  59. package/dist/components/BitzTable/Select/style.mjs +0 -66
  60. package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.mjs +0 -78
  61. package/dist/components/BitzTable/ToolBar/ExportIcon/styles.mjs +0 -47
@@ -1,192 +1,195 @@
1
1
  import { j as o } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { useContext as ge, useState as H, useRef as T, useEffect as J, useMemo as c, useCallback as we } from "react";
3
- import { isMobile as Q } from "../../../node_modules/.store/react-device-detect@2.2.3/node_modules/react-device-detect/dist/lib.mjs";
4
- import { Table as ee, Skeleton as lt } from "antd";
5
- import Y from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
6
- import ct from "../../BitzDrawer/index.mjs";
7
- import it from "../../BitzPagination/index.mjs";
8
- import at from "../../BitzNoData/index.mjs";
2
+ import { useContext as ze, useRef as S, useState as H, useEffect as je, useMemo as i, useCallback as Z } from "react";
3
+ import { isMobile as A } from "../../../node_modules/.store/react-device-detect@2.2.3/node_modules/react-device-detect/dist/lib.mjs";
4
+ import { Table as re, Skeleton as ht } from "antd";
5
+ import ee from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
6
+ import ut from "../../BitzDrawer/index.mjs";
7
+ import ft from "../../BitzPagination/index.mjs";
8
+ import mt from "../../BitzNoData/index.mjs";
9
9
  import "../../BitzList/index.less.mjs";
10
- import dt from "../../BitzList/List.mjs";
10
+ import bt from "../../BitzList/List.mjs";
11
11
  import "../../BitzPullRefresh/style/index.less.mjs";
12
- import ht from "../../BitzPullRefresh/PullRefresh.mjs";
13
- import ut, { BitzTableContext as ft } from "../Store/index.mjs";
14
- import { loopFilter as bt, columnSort as mt, genColumnKey as yt } from "../Store/utils/index.mjs";
15
- import Z from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
16
- import Ct from "../ActionCol/style.mjs";
17
- import xt from "../../BitzTheme/index.mjs";
18
- import gt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
12
+ import Ct from "../../BitzPullRefresh/PullRefresh.mjs";
13
+ import yt, { BitzTableContext as xt } from "../Store/index.mjs";
14
+ import { loopFilter as gt, columnSort as wt } from "../Store/utils/index.mjs";
15
+ import te from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
16
+ import Bt from "../ActionCol/style.mjs";
17
+ import zt from "../../BitzTheme/index.mjs";
18
+ import jt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
19
19
  import "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/index.mjs";
20
- import wt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
21
- import { getColumnsWithTool as Bt, loopBuildSkeleton as zt } from "./utils.mjs";
22
- import { getCssVar as jt } from "./style.mjs";
20
+ import Nt from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
21
+ import { getColumnsWithTool as kt, loopBuildSkeleton as Tt } from "./utils.mjs";
22
+ import { getCssVar as Wt } from "./style.mjs";
23
+ import St from "./SortableRow.mjs";
24
+ import pt from "./SortTableContext.mjs";
23
25
  import "./index.less.mjs";
24
- import { ConfigContext as vt } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
25
- import Nt from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/at.mjs";
26
- const Be = [ee.SELECTION_COLUMN, ee.EXPAND_COLUMN];
27
- function kt({
28
- showPagination: M = !0,
29
- height: p,
30
- dataSource: d = [],
31
- total: A = 0,
32
- columns: N,
33
- loading: i = !1,
34
- skeletonNum: E = {
26
+ import { ConfigContext as Lt } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
27
+ import vt from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/at.mjs";
28
+ const Ne = [re.SELECTION_COLUMN, re.EXPAND_COLUMN];
29
+ function Mt({
30
+ showPagination: p = !0,
31
+ height: k,
32
+ dataSource: u = [],
33
+ total: D = 0,
34
+ columns: V,
35
+ loading: n = !1,
36
+ skeletonNum: $ = {
35
37
  pc: 10,
36
38
  mobile: 10
37
39
  },
38
- skeletonRender: te,
39
- skeletonRowNum: ze = 4,
40
- skeletonRowsWidth: je = ["35%", "100%", "100%", "60%"],
40
+ skeletonRender: oe,
41
+ skeletonRowNum: ke = 4,
42
+ skeletonRowsWidth: Te = ["35%", "100%", "100%", "60%"],
41
43
  // mobileLoadEmit,
42
- mobileRefreshEmit: re,
43
- operationFilter: K,
44
- enableControlPage: ve,
45
- pagination: y,
46
- paginationEmit: R = () => {
44
+ mobileRefreshEmit: se,
45
+ operationFilter: E,
46
+ enableControlPage: We,
47
+ pagination: C,
48
+ paginationEmit: L = () => {
47
49
  },
48
- mobilePageHeight: Wt = 500,
49
- mobileCancelText: Ne = "取消",
50
- noDataTitle: ke,
51
- noDataImg: We,
52
- color: Tt,
53
- size: oe,
54
- showTableTool: Te = !0,
55
- tableAction: pe,
56
- tableToolbar: Se,
57
- selectionBar: Le,
58
- scroll: u,
59
- components: S,
60
- expandable: C,
50
+ enabledRowDragSort: v,
51
+ onRowDragEnd: O,
52
+ mobilePageHeight: Pt = 500,
53
+ mobileCancelText: Se = "取消",
54
+ noDataTitle: pe,
55
+ noDataImg: Le,
56
+ color: Rt,
57
+ size: ne,
58
+ showTableTool: ve = !0,
59
+ tableAction: Me,
60
+ tableToolbar: Pe,
61
+ selectionBar: Re,
62
+ scroll: d,
63
+ components: w,
64
+ expandable: y,
61
65
  rowSelection: z,
62
- resetPage: Me,
63
- ...a
66
+ resetPage: He,
67
+ ...h
64
68
  }) {
65
- var xe;
66
- const { token: x } = xt.useToken(), { Table: l } = x, { tableSpaceBetweenPage: ne = 10 } = l, { gap: Re } = Ct(), { showColumnBorder: Pe, hideRowBorder: se, rowHoverable: De, ...f } = ge(ft), [k, le] = H(!1), V = T(void 0), $ = T(0), O = T(0), [He, _] = H(!1), [b, Ae] = H([]);
67
- J(() => {
68
- let e = [...d];
69
- (y == null ? void 0 : y.page) !== 1 && (e = [...b, ...e]), Ae(e);
70
- }, [d]);
71
- const Ee = c(() => !!(b != null && b.length) && (b == null ? void 0 : b.length) >= A, [b, A]), [Ke, Ve] = H([]), $e = (e, t) => {
72
- var n;
73
- const r = (n = K == null ? void 0 : K(e, t)) == null ? void 0 : n.filter(
74
- (s) => s.type !== "divider"
69
+ var Be;
70
+ const { token: x } = zt.useToken(), { Table: c } = x, { tableSpaceBetweenPage: le = 10 } = c, { gap: Ae } = Bt(), { showColumnBorder: De, hideRowBorder: ie, rowHoverable: Ve, ...a } = ze(xt), M = S(void 0), K = S(0), [_, $e] = H(0), [Ee, q] = H(!1), [m, Oe] = H([]);
71
+ je(() => {
72
+ let e = [...u];
73
+ (C == null ? void 0 : C.page) !== 1 && (e = [...m, ...e]), Oe(e);
74
+ }, [u]);
75
+ const Ke = i(() => !!(m != null && m.length) && (m == null ? void 0 : m.length) >= D, [m, D]), [_e, qe] = H([]), Fe = (e, t) => {
76
+ var s;
77
+ const r = (s = E == null ? void 0 : E(e, t)) == null ? void 0 : s.filter(
78
+ (l) => l.type !== "divider"
75
79
  );
76
- r != null && r.length && (Ve(r), _(!0));
80
+ r != null && r.length && (qe(r), q(!0));
77
81
  }, ce = () => {
78
- _(!1);
79
- }, Oe = (e) => {
82
+ q(!1);
83
+ }, Ge = (e) => {
80
84
  var t;
81
- _(!1), (t = e.onClick) == null || t.call(e);
85
+ q(!1), (t = e.onClick) == null || t.call(e);
82
86
  };
83
- J(() => (document == null || document.addEventListener("fullscreenchange", (e) => {
84
- var t, r, n;
85
- (t = e.target) != null && t.classList.contains("bitzTableBlock") && (le(!!document.fullscreenElement), (n = (r = document.fullscreenElement) == null ? void 0 : r.classList) != null && n.contains("bitzTableBlock") || le(!1));
87
+ je(() => (document == null || document.addEventListener("fullscreenchange", (e) => {
88
+ var t, r, s;
89
+ (t = e.target) != null && t.classList.contains("bitzTableBlock") && (a.setFullscreen(!!document.fullscreenElement), (s = (r = document.fullscreenElement) == null ? void 0 : r.classList) != null && s.contains("bitzTableBlock") || a.setFullscreen(!1));
86
90
  }), document == null ? void 0 : document.removeEventListener("fullscreenchange", () => {
87
91
  })), []);
88
- const g = T(null), q = Z(g), ie = T(null), F = Z(ie), ae = T(null), W = Z(ae), _e = () => {
92
+ const g = S(null), F = te(g), ae = S(null), G = te(ae), de = S(null), N = te(de), Ue = () => {
89
93
  var r;
90
94
  const e = (r = g.current) == null ? void 0 : r.querySelectorAll(
91
95
  "& > .bitzTableContainerBody > .ant-table-wrapper.bitzTable > .ant-spin-nested-loading > .ant-spin-container > .ant-table > .ant-table-container > .ant-table-body > table > .ant-table-tbody > tr:not(.ant-table-measure-row, .ant-table-expanded-row)"
92
96
  ), t = [];
93
- if (e == null || e.forEach((n) => {
94
- var s;
97
+ if (e == null || e.forEach((s) => {
98
+ var l;
95
99
  t.push(
96
- ((s = n.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : s.clientWidth) || 0
100
+ ((l = s.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : l.clientWidth) || 0
97
101
  );
98
102
  }), t.length)
99
- return Math.ceil(Math.max(...t)) + Re * 2;
100
- }, de = () => {
101
- var h, m, v;
102
- const e = (h = g.current) == null ? void 0 : h.querySelector(
103
+ return Math.ceil(Math.max(...t)) + Ae * 2;
104
+ }, he = () => {
105
+ var b, f, W;
106
+ const e = (b = g.current) == null ? void 0 : b.querySelector(
103
107
  ".ant-table-body"
104
- ), t = e == null ? void 0 : e.clientWidth, n = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, s = (v = (m = g.current) == null ? void 0 : m.querySelector(
108
+ ), t = e == null ? void 0 : e.clientWidth, s = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, l = (W = (f = g.current) == null ? void 0 : f.querySelector(
105
109
  ".ant-table-cell-scrollbar"
106
- )) == null ? void 0 : v.offsetWidth;
107
- return { tbodyWidth: t, hasScrollBar: n, scrollbarSize: s };
108
- }, { y: G, tbodyWidth: pt, hasScrollBar: P, scrollbarSize: L } = c(() => {
109
- const { tbodyWidth: e, hasScrollBar: t, scrollbarSize: r } = de();
110
- if (typeof p > "u")
110
+ )) == null ? void 0 : W.offsetWidth;
111
+ return { tbodyWidth: t, hasScrollBar: s, scrollbarSize: l };
112
+ }, { y: U, tbodyWidth: X, hasScrollBar: P, scrollbarSize: T } = i(() => {
113
+ const { tbodyWidth: e, hasScrollBar: t, scrollbarSize: r } = he();
114
+ if (typeof k > "u")
111
115
  return {
112
116
  tbodyWidth: e,
113
117
  hasScrollBar: t,
114
118
  scrollbarSize: r
115
119
  };
116
- let n = 40, s = 40;
120
+ let s = 40, l = 40;
117
121
  if (g.current) {
118
- const D = window.getComputedStyle(g.current);
119
- n = parseInt(D.getPropertyValue("--cell-height")), s = parseInt(D.getPropertyValue("--toolbar-height"));
122
+ const R = window.getComputedStyle(g.current);
123
+ s = parseInt(R.getPropertyValue("--cell-height")), l = parseInt(R.getPropertyValue("--toolbar-height"));
120
124
  }
121
- const h = (W == null ? void 0 : W.height) || 0, m = h ? ne : 0;
122
- return { y: (k ? window.innerHeight : p) - h - m - s - n, tbodyWidth: e, hasScrollBar: t, scrollbarSize: r };
125
+ const b = (N == null ? void 0 : N.height) || 0, f = b ? le : 0;
126
+ return { y: (a.fullscreen ? window.innerHeight : k) - b - f - l - s, tbodyWidth: e, hasScrollBar: t, scrollbarSize: r };
123
127
  }, [
128
+ a.fullscreen,
124
129
  k,
125
- p,
126
- W == null ? void 0 : W.height,
127
- q == null ? void 0 : q.height,
128
- F == null ? void 0 : F.height
129
- ]), he = c(() => {
130
- let e = (u == null ? void 0 : u.x) ?? 1e3;
131
- return $.current && (e -= $.current), O.current && (e -= O.current * (V.current || 0)), u != null && u.x ? { x: e, y: u.y || G } : u != null && u.y ? { x: e, y: u.y } : { x: e, y: G };
132
- }, [u, G, V.current]), qe = (e) => {
133
- const t = e.length, r = e.filter((B) => B.width), s = r.map((B) => B.width).reduce((B, X) => B + X, 0);
134
- let h = 0;
130
+ N == null ? void 0 : N.height,
131
+ F == null ? void 0 : F.height,
132
+ G == null ? void 0 : G.height
133
+ ]), Xe = i(() => {
134
+ let e = (d == null ? void 0 : d.x) ?? 1e3;
135
+ return K.current && (e -= K.current), _ && M.current && (e -= _ * M.current), X && (e = Math.max(e, X)), d != null && d.x ? { x: e, y: d.y || U } : d != null && d.y ? { x: e, y: d.y } : { x: e, y: U };
136
+ }, [d, U, X, _]), Ie = (e) => {
137
+ const t = e.length, r = e.filter((B) => B.width), l = r.map((B) => B.width).reduce((B, Y) => B + Y, 0);
138
+ let b = 0;
135
139
  if (g.current) {
136
- const B = window.getComputedStyle(g.current), X = parseInt(
140
+ const B = window.getComputedStyle(g.current), Y = parseInt(
137
141
  B.getPropertyValue("--toolCell-paddingInline")
138
142
  );
139
- h = parseInt(B.getPropertyValue("--fontSize")) + 4 + 2 * X;
143
+ b = parseInt(B.getPropertyValue("--fontSize")) + 4 + 2 * Y;
140
144
  }
141
- let m = 0;
142
- z && (m += h), C && (m += h);
143
- const { tbodyWidth: v } = de(), U = Math.max(he.x, v ?? 0) - s - m, D = t - r.length;
144
- return U >= 0 ? U / D : void 0;
145
- }, j = c(() => {
146
- const e = N ?? [], t = e.filter((w) => !Be.includes(w)), { filterColumns: r, width: n, autoWidthColLength: s } = bt(
145
+ let f = 0;
146
+ z && (f += b), y && (f += b);
147
+ const { tbodyWidth: W } = he(), Q = Math.max((d == null ? void 0 : d.x) ?? 0, W ?? 0) - l - f, R = t - r.length;
148
+ return Q >= 0 ? Q / R : void 0;
149
+ }, I = i(() => {
150
+ const t = (V ?? []).filter((f) => !Ne.includes(f)), { filterColumns: r, width: s, autoWidthColLength: l } = gt(
147
151
  t,
148
- f.columnsMap
149
- );
150
- $.current = Math.ceil(n), O.current = s;
151
- const h = r.sort(mt(f.columnsMap));
152
- if (Q)
153
- return h;
154
- const m = qe(h);
155
- V.current = Math.ceil(m ?? 0);
156
- const v = h.map((w) => ({
157
- ...w,
158
- ...w.width ? {
159
- width: w.useMaxWidth ? _e() ?? w.width : w.width
152
+ a.columnsMap
153
+ ), b = r.sort(wt(a.columnsMap));
154
+ if (!A) {
155
+ const f = Ie(t);
156
+ M.current = Math.ceil(f ?? 0), K.current = Math.ceil(s), $e(l);
157
+ }
158
+ return b;
159
+ }, [a.columnsMap]), j = i(() => {
160
+ if (A)
161
+ return I;
162
+ const e = I.map((t) => ({
163
+ ...t,
164
+ ...t.isDragSortCol ? {
165
+ onCell: (...r) => {
166
+ var s;
167
+ return {
168
+ ...(s = t == null ? void 0 : t.onCell) == null ? void 0 : s.call(t, r),
169
+ "data-column-name": "dragSortCell"
170
+ };
171
+ }
172
+ } : {},
173
+ ...t.width ? {
174
+ width: t.useMaxWidth ? Ue() ?? t.width : t.width
160
175
  } : {
161
176
  // 给未设置width的列设置平均数
162
- width: m
177
+ width: M
163
178
  }
164
179
  }));
165
- return Bt(e, v, z, C);
166
- }, [N, f.columnsMap, f.sortKeyColumns]);
167
- J(() => {
168
- if (N && N.length > 0) {
169
- const e = N.map(
170
- (t) => (
171
- // @ts-ignore
172
- yt((t == null ? void 0 : t.key) ?? (t == null ? void 0 : t.dataIndex), t == null ? void 0 : t.dataIndex)
173
- )
174
- );
175
- f.setSortKeyColumns(e);
176
- }
177
- }, [N]);
178
- const ue = c(() => zt(j, Be), [j]), Fe = c(() => i ? ue : j, [i, j, ue]), fe = c(() => {
179
- const e = d == null ? void 0 : d.length, t = e > (E.pc ?? 10) ? e >= 20 ? 20 : e : E.pc ?? 10;
180
- return Array.from({ length: t }).map((n, s) => ({
181
- key: `${Date.now()}${s}`
180
+ return kt(V, e, z, y);
181
+ }, [V, I]), ue = i(() => Tt(j, Ne), [j]), Je = i(() => n ? ue : j, [n, j, ue]), fe = i(() => {
182
+ const e = u == null ? void 0 : u.length, t = e > ($.pc ?? 10) ? e >= 20 ? 20 : e : $.pc ?? 10;
183
+ return Array.from({ length: t }).map((s, l) => ({
184
+ key: `${Date.now()}${l}`
182
185
  }));
183
- }, [d]), Ge = c(() => i ? fe : d, [i, d, fe]), { table: I, locale: Ie = wt } = ge(vt), Ue = { ...Ie.Table }, Xe = ((xe = I == null ? void 0 : I.expandable) == null ? void 0 : xe.expandIcon) || (C == null ? void 0 : C.expandIcon) || gt(Ue), be = c(() => {
184
- if (C)
186
+ }, [u]), me = i(() => n ? fe : u, [n, u, fe]), { table: J, locale: Qe = Nt } = ze(Lt), Ye = { ...Qe.Table }, Ze = ((Be = J == null ? void 0 : J.expandable) == null ? void 0 : Be.expandIcon) || (y == null ? void 0 : y.expandIcon) || jt(Ye), be = i(() => {
187
+ if (y)
185
188
  return {
186
- ...C,
189
+ ...y,
187
190
  expandedRowRender: () => /* @__PURE__ */ o.jsx(o.Fragment, {}),
188
191
  expandIcon: (e) => {
189
- const t = Xe(e);
192
+ const t = Ze(e);
190
193
  return {
191
194
  ...t,
192
195
  props: {
@@ -200,66 +203,66 @@ function kt({
200
203
  };
201
204
  }
202
205
  };
203
- }, [C]), Je = c(() => i ? be : C, [i, C, be]), me = c(() => {
206
+ }, [y]), et = i(() => n ? be : y, [n, y, be]), Ce = i(() => {
204
207
  if (z)
205
208
  return {
206
209
  ...z,
207
210
  selectedRowKeys: [],
208
211
  getCheckboxProps: () => ({ disabled: !0 })
209
212
  };
210
- }, [z]), Qe = c(() => i ? me : z, [i, z, me]), Ye = c(() => i ? void 0 : a.rowKey, [i, a.rowKey]), ye = c(() => `${oe ?? f.stylesConfig.size}BitzTable`, [oe, f.stylesConfig.size]), Ze = we(
213
+ }, [z]), tt = i(() => n ? Ce : z, [n, z, Ce]), ye = i(() => n ? "key" : h.rowKey, [n, h.rowKey]), xe = i(() => `${ne ?? a.stylesConfig.size}BitzTable`, [ne, a.stylesConfig.size]), rt = Z(
211
214
  (e, t) => {
212
- var n;
213
- if (!a.onRow)
215
+ var s;
216
+ if (!h.onRow || n)
214
217
  return {};
215
- const r = (n = a.onRow) == null ? void 0 : n.call(a, e, t);
218
+ const r = (s = h.onRow) == null ? void 0 : s.call(h, e, t);
216
219
  return r.onClick && (r.className = "rowPointerCursor"), r;
217
220
  },
218
- [a.onRow]
219
- ), et = c(() => Y(
221
+ [h.onRow, n]
222
+ ), ot = i(() => ee(
220
223
  "bitzTableContainer",
221
- { hideBorder: se },
224
+ { hideBorder: ie },
222
225
  { hasScrollBar: P },
223
- ye,
224
- a.className
226
+ xe,
227
+ h.className
225
228
  ), [
226
- a.className,
227
- ye,
229
+ h.className,
230
+ xe,
228
231
  P,
229
- k,
230
- se
231
- ]), tt = c(() => ({
232
+ a.fullscreen,
233
+ ie
234
+ ]), st = i(() => ({
232
235
  "--container-bgColor": x.colorBgContainer
233
- }), [x.colorBgContainer]), rt = c(() => {
234
- const e = k ? "100%" : p;
236
+ }), [x.colorBgContainer]), nt = i(() => {
237
+ const e = a.fullscreen ? "100%" : k;
235
238
  let t;
236
- return (L ?? 0) > 0 && (t = L), jt({
239
+ return (T ?? 0) > 0 && (t = T), Wt({
237
240
  height: e,
238
- evenRowBgColor: f.zebra ? l == null ? void 0 : l.evenRowBgColor : x.colorBgContainer,
241
+ evenRowBgColor: a.zebra ? c == null ? void 0 : c.evenRowBgColor : x.colorBgContainer,
239
242
  colorBgContainer: x.colorBgContainer,
240
- table: l,
241
- gap: ne,
242
- borderColor: (l == null ? void 0 : l.borderColor) || x.colorBorderSecondary,
243
+ table: c,
244
+ gap: le,
245
+ borderColor: (c == null ? void 0 : c.borderColor) || x.colorBorderSecondary,
243
246
  scrollbarWidth: t,
244
- other: a.style
247
+ other: h.style
245
248
  });
246
- }, [a.style, k, p, l, f == null ? void 0 : f.zebra, L]), ot = we(
249
+ }, [h.style, a.fullscreen, k, c, a == null ? void 0 : a.zebra, T]), lt = Z(
247
250
  (e, t, r) => {
248
- const n = t % 2 === 0 ? "oddRow" : "evenRow";
249
- if (a.rowClassName) {
250
- const s = a.rowClassName(e, t, r);
251
- return Y(n, s);
251
+ const s = t % 2 === 0 ? "oddRow" : "evenRow";
252
+ if (h.rowClassName) {
253
+ const l = h.rowClassName(e, t, r);
254
+ return ee(s, l);
252
255
  }
253
- return n;
256
+ return s;
254
257
  },
255
- [a.rowClassName]
256
- ), Ce = /* @__PURE__ */ o.jsx(
257
- dt,
258
+ [h.rowClassName]
259
+ ), ge = /* @__PURE__ */ o.jsx(
260
+ bt,
258
261
  {
259
- finished: Ee,
262
+ finished: Ke,
260
263
  onLoad: async () => (
261
264
  // @ts-ignore
262
- !i && (R == null ? void 0 : R((y == null ? void 0 : y.page) + 1, y == null ? void 0 : y.size))
265
+ !n && (L == null ? void 0 : L((C == null ? void 0 : C.page) + 1, C == null ? void 0 : C.size))
263
266
  ),
264
267
  loadingText: "加载中...",
265
268
  finishedText: "没有更多了",
@@ -268,16 +271,16 @@ function kt({
268
271
  "div",
269
272
  {
270
273
  className: "mobileList",
271
- style: { backgroundColor: l == null ? void 0 : l.mobileListBgColor },
274
+ style: { backgroundColor: c == null ? void 0 : c.mobileListBgColor },
272
275
  children: [
273
- b == null ? void 0 : b.map((e, t) => /* @__PURE__ */ o.jsx(
276
+ m == null ? void 0 : m.map((e, t) => /* @__PURE__ */ o.jsx(
274
277
  "div",
275
278
  {
276
279
  className: "listItem",
277
- style: { backgroundColor: l == null ? void 0 : l.listItemBgColor },
278
- onClick: () => $e(e, t),
279
- children: j == null ? void 0 : j.map((r, n) => {
280
- var s;
280
+ style: { backgroundColor: c == null ? void 0 : c.listItemBgColor },
281
+ onClick: () => Fe(e, t),
282
+ children: j == null ? void 0 : j.map((r, s) => {
283
+ var l;
281
284
  return !(r != null && r.mobileHide) && /* @__PURE__ */ o.jsxs(
282
285
  "div",
283
286
  {
@@ -288,35 +291,35 @@ function kt({
288
291
  `${r.title}`,
289
292
  ":"
290
293
  ] }),
291
- /* @__PURE__ */ o.jsx("div", { className: "value", children: ((s = r == null ? void 0 : r.render) == null ? void 0 : s.call(
294
+ /* @__PURE__ */ o.jsx("div", { className: "value", children: ((l = r == null ? void 0 : r.render) == null ? void 0 : l.call(
292
295
  r,
293
- Nt(e, (r == null ? void 0 : r.dataIndex) || ""),
296
+ vt(e, (r == null ? void 0 : r.dataIndex) || ""),
294
297
  e,
295
298
  t
296
299
  )) || (e == null ? void 0 : e[r.dataIndex]) })
297
300
  ]
298
301
  },
299
- n
302
+ s
300
303
  );
301
304
  })
302
305
  },
303
306
  t
304
307
  )),
305
- Array.from({ length: E.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ o.jsx(
308
+ Array.from({ length: $.mobile ?? 2 }).map((e, t) => /* @__PURE__ */ o.jsx(
306
309
  "div",
307
310
  {
308
311
  className: "listItem",
309
312
  style: {
310
- display: i ? "block" : "none",
311
- backgroundColor: l == null ? void 0 : l.listItemBgColor
313
+ display: n ? "block" : "none",
314
+ backgroundColor: c == null ? void 0 : c.listItemBgColor
312
315
  },
313
- children: /* @__PURE__ */ o.jsx("div", { className: "row", children: te ? te() : /* @__PURE__ */ o.jsx(
314
- lt,
316
+ children: /* @__PURE__ */ o.jsx("div", { className: "row", children: oe ? oe() : /* @__PURE__ */ o.jsx(
317
+ ht,
315
318
  {
316
319
  title: !1,
317
320
  paragraph: {
318
- rows: ze,
319
- width: je
321
+ rows: ke,
322
+ width: Te
320
323
  },
321
324
  active: !0
322
325
  }
@@ -328,95 +331,113 @@ function kt({
328
331
  }
329
332
  )
330
333
  }
331
- ), nt = (e) => {
334
+ ), it = (e) => {
332
335
  var r;
333
336
  const t = { ...e };
334
337
  return t.className.includes("ant-table-cell-fix-right") && !P && ((r = t.style) != null && r.right) && (t.style = {
335
338
  ...t.style,
336
- right: t.style.right - (L || 0)
339
+ right: t.style.right - (T || 0)
337
340
  }), /* @__PURE__ */ o.jsx("th", { ...t });
338
- }, st = c(() => ({
339
- ...S,
341
+ }, ct = (e) => {
342
+ var t;
343
+ n || e.active.id !== ((t = e.over) == null ? void 0 : t.id) && (O == null || O(e));
344
+ }, we = Z(() => v ? {
345
+ row: (e) => St({ ...e, loading: n.toString() })
346
+ } : {}, [v, v ? n : !1]), at = i(() => ({
347
+ ...w,
340
348
  header: {
341
- ...S == null ? void 0 : S.header,
342
- cell: nt
349
+ ...w == null ? void 0 : w.header,
350
+ cell: it
351
+ },
352
+ body: {
353
+ ...w == null ? void 0 : w.body,
354
+ ...we()
343
355
  }
344
- }), [S, P, L]);
356
+ }), [w, P, T, we]);
345
357
  return /* @__PURE__ */ o.jsxs(
346
358
  "div",
347
359
  {
348
- className: Y("bitzTableBlock", { fullscreen: k }),
349
- style: tt,
360
+ className: ee("bitzTableBlock", { fullscreen: a.fullscreen }),
361
+ style: st,
350
362
  children: [
351
- !Q && /* @__PURE__ */ o.jsxs("div", { ref: g, className: et, style: rt, children: [
352
- /* @__PURE__ */ o.jsxs("div", { className: "bitzTableContainerBody", ref: ie, children: [
353
- Te && /* @__PURE__ */ o.jsxs("div", { className: "bitzTableToolbarBlock", children: [
354
- pe || /* @__PURE__ */ o.jsx("div", {}),
355
- Se,
356
- Le
363
+ !A && /* @__PURE__ */ o.jsxs("div", { ref: g, className: ot, style: nt, children: [
364
+ /* @__PURE__ */ o.jsxs("div", { className: "bitzTableContainerBody", ref: ae, children: [
365
+ ve && /* @__PURE__ */ o.jsxs("div", { className: "bitzTableToolbarBlock", children: [
366
+ Me || /* @__PURE__ */ o.jsx("div", {}),
367
+ Pe,
368
+ Re
357
369
  ] }),
358
370
  /* @__PURE__ */ o.jsx(
359
- ee,
371
+ pt,
360
372
  {
361
- ...a,
362
- bordered: Pe,
363
- columns: Fe,
364
- dataSource: Ge,
365
- loading: !1,
366
- pagination: !1,
367
- scroll: he,
368
- expandable: Je,
369
- rowSelection: Qe,
370
- onRow: Ze,
371
- rowHoverable: De,
372
- rowClassName: ot,
373
- className: "bitzTable",
374
- components: st,
375
- rowKey: Ye
373
+ enabledRowDragSort: v,
374
+ dataSource: me,
375
+ mergeRowKey: ye,
376
+ onDragEnd: ct,
377
+ children: /* @__PURE__ */ o.jsx(
378
+ re,
379
+ {
380
+ ...h,
381
+ bordered: De,
382
+ columns: Je,
383
+ dataSource: me,
384
+ loading: !1,
385
+ pagination: !1,
386
+ scroll: Xe,
387
+ expandable: et,
388
+ rowSelection: tt,
389
+ onRow: rt,
390
+ rowHoverable: Ve,
391
+ rowClassName: lt,
392
+ className: "bitzTable",
393
+ components: at,
394
+ rowKey: ye
395
+ }
396
+ )
376
397
  }
377
398
  )
378
399
  ] }),
379
- M && /* @__PURE__ */ o.jsx(
380
- it,
400
+ p && /* @__PURE__ */ o.jsx(
401
+ ft,
381
402
  {
382
403
  size: "small",
383
- elRefInstance: ae,
384
- enableControl: ve,
385
- pagination: y,
386
- total: A,
387
- dataSource: d,
388
- resetPage: Me,
389
- paginationEmit: R
404
+ elRefInstance: de,
405
+ enableControl: We,
406
+ pagination: C,
407
+ total: D,
408
+ dataSource: u,
409
+ resetPage: He,
410
+ paginationEmit: L
390
411
  }
391
412
  )
392
413
  ] }),
393
- Q && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
394
- (i || (d == null ? void 0 : d.length) > 0) && /* @__PURE__ */ o.jsx(o.Fragment, { children: re ? (
414
+ A && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
415
+ (n || (u == null ? void 0 : u.length) > 0) && /* @__PURE__ */ o.jsx(o.Fragment, { children: se ? (
395
416
  // @ts-ignore
396
417
  /* @__PURE__ */ o.jsx(
397
- ht,
418
+ Ct,
398
419
  {
399
- onRefresh: async () => !i && re(),
400
- children: Ce
420
+ onRefresh: async () => !n && se(),
421
+ children: ge
401
422
  }
402
423
  )
403
- ) : Ce }),
404
- !i && /* @__PURE__ */ o.jsx(at, { data: d, title: ke, img: We }),
424
+ ) : ge }),
425
+ !n && /* @__PURE__ */ o.jsx(mt, { data: u, title: pe, img: Le }),
405
426
  /* @__PURE__ */ o.jsx(
406
- ct,
427
+ ut,
407
428
  {
408
429
  className: "tableMobileDrawer",
409
- open: He,
430
+ open: Ee,
410
431
  placement: "bottom",
411
432
  height: "auto",
412
433
  closable: !1,
413
434
  onClose: ce,
414
435
  children: /* @__PURE__ */ o.jsxs("div", { className: "drawerBox", children: [
415
- /* @__PURE__ */ o.jsx("div", { className: "boxBody", children: Ke.map((e, t) => /* @__PURE__ */ o.jsx(
436
+ /* @__PURE__ */ o.jsx("div", { className: "boxBody", children: _e.map((e, t) => /* @__PURE__ */ o.jsx(
416
437
  "div",
417
438
  {
418
439
  className: "operaList",
419
- onClick: () => Oe(e),
440
+ onClick: () => Ge(e),
420
441
  ...e.danger && {
421
442
  style: { color: x.colorError }
422
443
  },
@@ -425,7 +446,7 @@ function kt({
425
446
  t
426
447
  )) }),
427
448
  /* @__PURE__ */ o.jsx("div", { className: "boxLine" }),
428
- /* @__PURE__ */ o.jsx("div", { className: "boxFooter", onClick: ce, children: Ne })
449
+ /* @__PURE__ */ o.jsx("div", { className: "boxFooter", onClick: ce, children: Se })
429
450
  ] })
430
451
  }
431
452
  )
@@ -434,7 +455,7 @@ function kt({
434
455
  }
435
456
  );
436
457
  }
437
- const rr = (M) => /* @__PURE__ */ o.jsx(ut, { initValue: M, children: /* @__PURE__ */ o.jsx(kt, { ...M }) });
458
+ const ar = (p) => /* @__PURE__ */ o.jsx(yt, { initValue: p, children: /* @__PURE__ */ o.jsx(Mt, { ...p }) });
438
459
  export {
439
- rr as default
460
+ ar as default
440
461
  };