bitz-react-admin-ui 2.1.9 → 2.2.1

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