bitz-react-admin-ui 2.2.5 → 2.2.7
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.
- package/dist/_virtual/index.mjs +2 -2
- package/dist/_virtual/index2.mjs +2 -2
- package/dist/_virtual/isoWeek.mjs +4 -0
- package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +25 -25
- package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +10 -9
- package/dist/components/BitzFuiCalendar/CalendarBody.mjs +16 -13
- package/dist/components/BitzFuiCalendar/CalendarHead.mjs +22 -18
- package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +8 -8
- package/dist/components/BitzFuiCalendar/ColumnData.mjs +43 -44
- package/dist/components/BitzTable/Store/index.d.ts +5 -1
- package/dist/components/BitzTable/Store/index.mjs +159 -137
- package/dist/components/BitzTable/SubTable/index.mjs +86 -87
- package/dist/components/BitzTable/Table/SortableRow.mjs +2 -2
- package/dist/components/BitzTable/Table/index.d.ts +4 -10
- package/dist/components/BitzTable/Table/index.mjs +281 -282
- package/dist/components/BitzTable/Table/utils.d.ts +2 -2
- package/dist/components/BitzTable/Table/utils.mjs +29 -23
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +107 -107
- package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +5 -5
- package/dist/components/BitzTable/index.d.ts +9 -4
- package/dist/components/BitzTable/index.mjs +17 -15
- package/dist/components/BitzTable2/index.d.ts +2 -0
- package/dist/components/BitzTable2/index.mjs +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +34 -32
- package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
- package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/plugin/isoWeek.mjs +34 -0
- package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useContext as D, useRef as
|
|
3
|
-
import { Table as
|
|
4
|
-
import
|
|
5
|
-
import { BitzTableContext as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { j as y } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useContext as D, useRef as Z, useMemo as o, useCallback as I } from "react";
|
|
3
|
+
import { Table as ee } from "antd";
|
|
4
|
+
import te from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
|
+
import { BitzTableContext as re, toolCols as ne } from "../Store/index.mjs";
|
|
6
|
+
import oe from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
|
|
7
|
+
import se from "../ActionCol/style.mjs";
|
|
8
|
+
import ae from "../../BitzTheme/index.mjs";
|
|
9
|
+
import le from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/table/ExpandIcon.mjs";
|
|
10
10
|
import "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/index.mjs";
|
|
11
|
-
import
|
|
12
|
-
import { getColumnsWithTool as
|
|
13
|
-
import { ConfigContext as
|
|
14
|
-
|
|
15
|
-
function Bt({
|
|
11
|
+
import ce from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/locale/en_US.mjs";
|
|
12
|
+
import { getColumnsWithTool as ie, loopBuildSkeleton as ue } from "../Table/utils.mjs";
|
|
13
|
+
import { ConfigContext as me } from "../../../node_modules/.store/antd@5.16.2/node_modules/antd/es/config-provider/context.mjs";
|
|
14
|
+
function Be({
|
|
16
15
|
dataSource: u = [],
|
|
17
|
-
columns:
|
|
16
|
+
columns: g,
|
|
18
17
|
loading: l = !1,
|
|
19
18
|
scroll: s,
|
|
20
19
|
components: f,
|
|
@@ -22,128 +21,128 @@ function Bt({
|
|
|
22
21
|
rowSelection: m,
|
|
23
22
|
...a
|
|
24
23
|
}) {
|
|
25
|
-
var T,
|
|
26
|
-
const { token:
|
|
27
|
-
let
|
|
28
|
-
return s != null && s.x ? { x:
|
|
29
|
-
}, [s]),
|
|
30
|
-
var
|
|
31
|
-
const
|
|
24
|
+
var T, p;
|
|
25
|
+
const { token: L } = ae.useToken(), { gap: j } = se(), { showColumnBorder: K, rowHoverable: M } = D(re), h = Z(null), C = oe((T = h.current) == null ? void 0 : T.nativeElement), q = o(() => {
|
|
26
|
+
let e = (s == null ? void 0 : s.x) ?? 1e3;
|
|
27
|
+
return s != null && s.x ? { x: e, y: s.y || 400 } : s != null && s.y ? { x: e, y: s.y } : { x: e, y: 400 };
|
|
28
|
+
}, [s]), P = () => {
|
|
29
|
+
var n, r;
|
|
30
|
+
const e = (r = (n = h.current) == null ? void 0 : n.nativeElement) == null ? void 0 : r.querySelectorAll(
|
|
32
31
|
"& > .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)"
|
|
33
|
-
),
|
|
34
|
-
if (
|
|
32
|
+
), t = [];
|
|
33
|
+
if (e == null || e.forEach((i) => {
|
|
35
34
|
var b;
|
|
36
|
-
|
|
35
|
+
t.push(
|
|
37
36
|
((b = i.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
|
|
38
37
|
);
|
|
39
|
-
}),
|
|
40
|
-
return Math.ceil(Math.max(...
|
|
41
|
-
},
|
|
42
|
-
var b,
|
|
43
|
-
const
|
|
38
|
+
}), t.length)
|
|
39
|
+
return Math.ceil(Math.max(...t)) + j * 2;
|
|
40
|
+
}, A = () => {
|
|
41
|
+
var b, W, E, v, N;
|
|
42
|
+
const e = (W = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : W.querySelector(
|
|
44
43
|
".ant-table-body"
|
|
45
|
-
),
|
|
44
|
+
), t = e == null ? void 0 : e.clientWidth, r = ((e == null ? void 0 : e.offsetWidth) || 0) - t > 0, i = (N = (v = (E = h.current) == null ? void 0 : E.nativeElement) == null ? void 0 : v.querySelector(
|
|
46
45
|
".ant-table-cell-scrollbar"
|
|
47
|
-
)) == null ? void 0 :
|
|
48
|
-
return { tbodyWidth:
|
|
49
|
-
}, { hasScrollBar:
|
|
50
|
-
const { hasScrollBar:
|
|
46
|
+
)) == null ? void 0 : N.offsetWidth;
|
|
47
|
+
return { tbodyWidth: t, scrollbarSize: i, hasScrollBar: r };
|
|
48
|
+
}, { hasScrollBar: x, scrollbarSize: R } = o(() => {
|
|
49
|
+
const { hasScrollBar: e, scrollbarSize: t } = A();
|
|
51
50
|
return {
|
|
52
|
-
hasScrollBar:
|
|
53
|
-
scrollbarSize:
|
|
51
|
+
hasScrollBar: e,
|
|
52
|
+
scrollbarSize: t
|
|
54
53
|
};
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
57
|
-
...
|
|
58
|
-
width:
|
|
54
|
+
}, [C == null ? void 0 : C.height]), d = o(() => {
|
|
55
|
+
const e = g ?? [], n = e.filter((r) => !ne.includes(r)).map((r) => ({
|
|
56
|
+
...r,
|
|
57
|
+
width: r.useMaxWidth ? P() ?? r.width : r.width
|
|
59
58
|
}));
|
|
60
|
-
return
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
63
|
-
return Array.from({ length:
|
|
59
|
+
return ie(e, n, !1, !!m, !!c);
|
|
60
|
+
}, [g]), k = o(() => ue(d), [d]), G = o(() => l ? k : d, [l, d, k]), S = o(() => {
|
|
61
|
+
const e = u == null ? void 0 : u.length, t = e > 4 ? e >= 8 ? 8 : e : 4;
|
|
62
|
+
return Array.from({ length: t }).map((r, i) => ({
|
|
64
63
|
key: `${Date.now()}${i}`
|
|
65
64
|
}));
|
|
66
|
-
}, [u]),
|
|
65
|
+
}, [u]), $ = o(() => l ? S : u, [l, u, S]), { table: w, locale: F = ce } = D(me), H = { ...F.Table }, _ = ((p = w == null ? void 0 : w.expandable) == null ? void 0 : p.expandIcon) || (c == null ? void 0 : c.expandIcon) || le(H), z = o(() => {
|
|
67
66
|
if (c)
|
|
68
67
|
return {
|
|
69
68
|
...c,
|
|
70
|
-
expandedRowRender: () => /* @__PURE__ */
|
|
71
|
-
expandIcon: (
|
|
72
|
-
const
|
|
69
|
+
expandedRowRender: () => /* @__PURE__ */ y.jsx(y.Fragment, {}),
|
|
70
|
+
expandIcon: (e) => {
|
|
71
|
+
const t = _(e);
|
|
73
72
|
return {
|
|
74
|
-
...
|
|
73
|
+
...t,
|
|
75
74
|
props: {
|
|
76
|
-
...
|
|
75
|
+
...t.props,
|
|
77
76
|
disabled: !0,
|
|
78
77
|
style: {
|
|
79
|
-
...
|
|
80
|
-
backgroundColor:
|
|
78
|
+
...t.props.style,
|
|
79
|
+
backgroundColor: L.colorBgContainerDisabled
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
|
-
}, [c]),
|
|
85
|
+
}, [c]), J = o(() => l ? z : c, [l, c, z]), B = o(() => {
|
|
87
86
|
if (m)
|
|
88
87
|
return {
|
|
89
88
|
...m,
|
|
90
89
|
selectedRowKeys: [],
|
|
91
90
|
getCheckboxProps: () => ({ disabled: !0 })
|
|
92
91
|
};
|
|
93
|
-
}, [m]),
|
|
94
|
-
(
|
|
95
|
-
var
|
|
92
|
+
}, [m]), O = o(() => l ? B : m, [l, m, B]), Q = o(() => l ? void 0 : a.rowKey, [l, a.rowKey]), U = I(
|
|
93
|
+
(e, t) => {
|
|
94
|
+
var r;
|
|
96
95
|
if (!a.onRow)
|
|
97
96
|
return {};
|
|
98
|
-
const
|
|
99
|
-
return
|
|
97
|
+
const n = (r = a.onRow) == null ? void 0 : r.call(a, e, t);
|
|
98
|
+
return n.onClick && (n.className = "rowPointerCursor"), n;
|
|
100
99
|
},
|
|
101
100
|
[a.onRow]
|
|
102
|
-
),
|
|
103
|
-
(
|
|
104
|
-
const
|
|
101
|
+
), V = I(
|
|
102
|
+
(e, t, n) => {
|
|
103
|
+
const r = t % 2 === 0 ? "oddRow" : "evenRow";
|
|
105
104
|
if (a.rowClassName) {
|
|
106
|
-
const i = a.rowClassName(
|
|
107
|
-
return
|
|
105
|
+
const i = a.rowClassName(e, t, n);
|
|
106
|
+
return te(r, i);
|
|
108
107
|
}
|
|
109
|
-
return
|
|
108
|
+
return r;
|
|
110
109
|
},
|
|
111
110
|
[a.rowClassName]
|
|
112
|
-
),
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
...
|
|
117
|
-
right:
|
|
118
|
-
}), /* @__PURE__ */
|
|
119
|
-
},
|
|
111
|
+
), X = (e) => {
|
|
112
|
+
var n;
|
|
113
|
+
const t = { ...e };
|
|
114
|
+
return t.className.includes("ant-table-cell-fix-right") && !x && ((n = t.style) != null && n.right) && (t.style = {
|
|
115
|
+
...t.style,
|
|
116
|
+
right: t.style.right - (R || 0)
|
|
117
|
+
}), /* @__PURE__ */ y.jsx("th", { ...t });
|
|
118
|
+
}, Y = o(() => ({
|
|
120
119
|
...f,
|
|
121
120
|
header: {
|
|
122
121
|
...f == null ? void 0 : f.header,
|
|
123
|
-
cell:
|
|
122
|
+
cell: X
|
|
124
123
|
}
|
|
125
|
-
}), [f,
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
|
|
124
|
+
}), [f, x, R]);
|
|
125
|
+
return /* @__PURE__ */ y.jsx(
|
|
126
|
+
ee,
|
|
128
127
|
{
|
|
129
128
|
...a,
|
|
130
|
-
bordered:
|
|
129
|
+
bordered: K,
|
|
131
130
|
columns: G,
|
|
132
|
-
dataSource:
|
|
131
|
+
dataSource: $,
|
|
133
132
|
loading: !1,
|
|
134
133
|
pagination: !1,
|
|
135
|
-
scroll:
|
|
136
|
-
expandable:
|
|
137
|
-
rowSelection:
|
|
138
|
-
onRow:
|
|
139
|
-
rowClassName:
|
|
140
|
-
components:
|
|
134
|
+
scroll: q,
|
|
135
|
+
expandable: J,
|
|
136
|
+
rowSelection: O,
|
|
137
|
+
onRow: U,
|
|
138
|
+
rowClassName: V,
|
|
139
|
+
components: Y,
|
|
141
140
|
rowKey: Q,
|
|
142
|
-
rowHoverable:
|
|
141
|
+
rowHoverable: M,
|
|
143
142
|
ref: h
|
|
144
143
|
}
|
|
145
144
|
);
|
|
146
145
|
}
|
|
147
146
|
export {
|
|
148
|
-
|
|
147
|
+
Be as default
|
|
149
148
|
};
|
|
@@ -30,7 +30,7 @@ const T = ({ children: m, loading: t, ...e }) => {
|
|
|
30
30
|
},
|
|
31
31
|
children: a.Children.map(m, (r) => {
|
|
32
32
|
var n, s;
|
|
33
|
-
return ((s = (n = r.props) == null ? void 0 : n.additionalProps) == null ? void 0 : s["data-column-name"]) === "
|
|
33
|
+
return ((s = (n = r.props) == null ? void 0 : n.additionalProps) == null ? void 0 : s["data-column-name"]) === "dragSorterCell" ? a.cloneElement(r, {
|
|
34
34
|
children: /* @__PURE__ */ i.jsx(
|
|
35
35
|
j,
|
|
36
36
|
{
|
|
@@ -38,7 +38,7 @@ const T = ({ children: m, loading: t, ...e }) => {
|
|
|
38
38
|
style: {
|
|
39
39
|
touchAction: "none",
|
|
40
40
|
cursor: t === "true" ? "default" : "move",
|
|
41
|
-
fontSize: "calc(var(--fontSize) +
|
|
41
|
+
fontSize: "calc(var(--fontSize) + 2px)",
|
|
42
42
|
color: t === "true" ? l.colorTextDisabled : "inherit"
|
|
43
43
|
},
|
|
44
44
|
...u
|
|
@@ -4,15 +4,11 @@ import { SkeletonParagraphProps } from 'antd/es/skeleton/Paragraph';
|
|
|
4
4
|
import { AnyObject } from 'antd/es/_util/type';
|
|
5
5
|
import type { RowClassName } from 'rc-table/es/interface';
|
|
6
6
|
import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
|
|
7
|
-
import { ActionsFunType, BitzTableColumnsType } from '..';
|
|
7
|
+
import { ActionsFunType, BitzTableColumnsType, SelelctionAlertProps } from '..';
|
|
8
8
|
import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
|
|
9
|
-
import { TableRowSelection } from 'antd/es/table/interface';
|
|
10
9
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
11
10
|
import './index.less';
|
|
12
|
-
export interface
|
|
13
|
-
onClear?: () => void;
|
|
14
|
-
}
|
|
15
|
-
export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered' | 'rowSelection'> {
|
|
11
|
+
export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
|
|
16
12
|
/** 是否开启rowHover样式 */
|
|
17
13
|
rowHoverable?: boolean;
|
|
18
14
|
/** 是否开启斑马纹样式 */
|
|
@@ -21,8 +17,6 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
21
17
|
bordered?: BitzTableBorderedType;
|
|
22
18
|
/** PC端:是否显示分页 */
|
|
23
19
|
showPagination?: boolean;
|
|
24
|
-
/** PC端:是否显示分页选中条数据 */
|
|
25
|
-
showSelected?: boolean;
|
|
26
20
|
/** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
|
|
27
21
|
height?: number;
|
|
28
22
|
/** table可滚动区域的最大宽高的值 */
|
|
@@ -40,8 +34,6 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
40
34
|
operationFilter?: ActionsFunType<RecordType>;
|
|
41
35
|
/** PC&移动端:请求加载状态 */
|
|
42
36
|
loading?: boolean;
|
|
43
|
-
/** 多选/单选 */
|
|
44
|
-
rowSelection?: BitzTableRowSelectionProps<RecordType>;
|
|
45
37
|
/** 骨架屏列表个数 */
|
|
46
38
|
skeletonNum?: {
|
|
47
39
|
pc?: number;
|
|
@@ -57,6 +49,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
57
49
|
size?: DensitySize;
|
|
58
50
|
/** 是否启用分页组件的受控属性 */
|
|
59
51
|
enableControlPage?: boolean;
|
|
52
|
+
/** 多选/单选操作 */
|
|
53
|
+
selelctionAlert?: SelelctionAlertProps;
|
|
60
54
|
/** 分页控件的分页属性 */
|
|
61
55
|
pagination?: {
|
|
62
56
|
page: number;
|