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