bitz-react-admin-ui 2.4.7 → 2.4.8
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/components/BitzTable/Table/ResizableTitle copy.mjs +24 -24
- package/dist/components/BitzTable/Table/index.d.ts +26 -26
- package/dist/components/BitzTable/Table/index.mjs +206 -199
- package/dist/components/BitzTable/index.d.ts +3 -0
- package/dist/components/BitzTableSelect/SelectPopup/getData.mjs +1 -1
- package/dist/components/BitzTableSelect/SingleSelect/index.mjs +50 -49
- package/dist/components/BitzTableSelect/TextBlock/index.mjs +4 -4
- package/dist/components/BitzTableSelect/index.d.ts +0 -1
- package/dist/components/BitzTableSelect/index.mjs +17 -19
- package/dist/components/BitzTableSelect/utils.d.ts +4 -0
- package/dist/components/BitzTableSelect/utils.mjs +5 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import { Resizable as E } from "../../../node_modules/.store/react-resizable@3.0.5/node_modules/react-resizable/index.mjs";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as b, useMemo as y, useRef as i } from "react";
|
|
4
4
|
import $ from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
|
-
const W = (
|
|
6
|
-
const { hasScrollBar:
|
|
5
|
+
const W = (p) => {
|
|
6
|
+
const { hasScrollBar: z, scrollbarSize: g, onResize: S, width: r, datagridref: w, stretchref: a, ...L } = p, [P, d] = b(!1), m = y(() => {
|
|
7
7
|
var t, n;
|
|
8
8
|
const e = { ...L };
|
|
9
|
-
return ((t = e.className) == null ? void 0 : t.includes("ant-table-cell-fix-right")) && !
|
|
10
|
-
}, [
|
|
9
|
+
return ((t = e.className) == null ? void 0 : t.includes("ant-table-cell-fix-right")) && !z && ((n = e.style) != null && n.right) && (e.style = { ...e.style ?? {} }, e.style.right = Number(e.style.right ?? 0) - (g || 0)), e;
|
|
10
|
+
}, [p]), [x, R] = b(0), l = i(0), f = i(0), c = i(0), u = i(!1), h = y(() => l.current - r + 48, [l.current, r]);
|
|
11
|
+
if (!r)
|
|
12
|
+
return /* @__PURE__ */ o.jsx("th", { ...m });
|
|
13
|
+
const j = (e) => {
|
|
11
14
|
let s = e.offsetLeft, t = e.offsetParent;
|
|
12
15
|
for (; t !== null; )
|
|
13
16
|
s += t.offsetLeft, t = t.offsetParent;
|
|
14
17
|
return { x: s };
|
|
15
|
-
},
|
|
16
|
-
if (!r)
|
|
17
|
-
return /* @__PURE__ */ c.jsx("th", { ...x });
|
|
18
|
-
const D = (e, { size: s }) => {
|
|
18
|
+
}, D = (e, { size: s }) => {
|
|
19
19
|
let t = s.width - r, n = l.current + t;
|
|
20
|
-
if (
|
|
21
|
-
|
|
20
|
+
if (c.current = e.clientX - f.current, r + n - l.current <= 48 || c.current < h) {
|
|
21
|
+
u.current = !0;
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
const v = a.current;
|
|
25
|
-
|
|
25
|
+
c.current >= h && u.current && (n = h, t = 48 - r, u.current = !1), v.style.left = `${n}px`, R(t);
|
|
26
26
|
}, N = (e) => {
|
|
27
|
-
|
|
27
|
+
d(!0);
|
|
28
28
|
const s = a.current;
|
|
29
|
-
s.style.opacity = 1, s.style.pointerEvents = "auto";
|
|
30
|
-
const t = e.clientX -
|
|
31
|
-
s.style.left = `${t}px`, l.current = t,
|
|
29
|
+
s.style.opacity = 1, s.style.pointerEvents = "auto", f.current = j(w.current).x;
|
|
30
|
+
const t = e.clientX - f.current;
|
|
31
|
+
s.style.left = `${t}px`, l.current = t, c.current = t;
|
|
32
32
|
}, O = (...e) => {
|
|
33
|
-
|
|
33
|
+
R(0), d(!1);
|
|
34
34
|
const s = a.current;
|
|
35
35
|
s.style.opacity = 0, s.style.pointerEvents = "none", setTimeout(() => {
|
|
36
36
|
s.style.left = "0px";
|
|
37
|
-
}, 200),
|
|
38
|
-
}, X = /* @__PURE__ */
|
|
37
|
+
}, 200), S(...e);
|
|
38
|
+
}, X = /* @__PURE__ */ o.jsx(
|
|
39
39
|
"span",
|
|
40
40
|
{
|
|
41
41
|
className: "bitzResizableHandle",
|
|
42
|
-
style: { transform: `translateX(${
|
|
42
|
+
style: { transform: `translateX(${x}px)` },
|
|
43
43
|
onClick: (e) => {
|
|
44
44
|
e.stopPropagation(), e.preventDefault();
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ o.jsx(
|
|
49
49
|
E,
|
|
50
50
|
{
|
|
51
|
-
width: r +
|
|
51
|
+
width: r + x,
|
|
52
52
|
height: 0,
|
|
53
53
|
handle: X,
|
|
54
54
|
className: $("bitzResizable", {
|
|
@@ -58,7 +58,7 @@ const W = (d) => {
|
|
|
58
58
|
onResizeStart: N,
|
|
59
59
|
onResizeStop: O,
|
|
60
60
|
draggableOpts: { enableUserSelectHack: !1 },
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ o.jsx("th", { ...m })
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
};
|
|
@@ -8,11 +8,11 @@ import { ActionsFunType, BitzTableColumnsType, SelelctionAlertProps } from '..';
|
|
|
8
8
|
import { BitzTableBorderedType } from '../../BitzConfigProvider/context';
|
|
9
9
|
import './index.less';
|
|
10
10
|
export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
|
|
11
|
-
/**
|
|
11
|
+
/** PC端:是否开启rowHover样式 */
|
|
12
12
|
rowHoverable?: boolean;
|
|
13
|
-
/**
|
|
13
|
+
/** PC端:是否开启斑马纹样式 */
|
|
14
14
|
zebra?: boolean;
|
|
15
|
-
/** border */
|
|
15
|
+
/** PC端:border样式 */
|
|
16
16
|
bordered?: BitzTableBorderedType;
|
|
17
17
|
/** PC端:是否显示分页 */
|
|
18
18
|
showPagination?: boolean;
|
|
@@ -20,38 +20,36 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
20
20
|
height?: number;
|
|
21
21
|
/** PC端:当height小于minHeight时使用minHeight替代height */
|
|
22
22
|
minHeight?: number;
|
|
23
|
-
/**
|
|
23
|
+
/** PC端:滚动条 */
|
|
24
24
|
scroll?: {
|
|
25
25
|
x?: number;
|
|
26
26
|
y?: number;
|
|
27
27
|
auto?: boolean;
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
29
|
+
/** table数据源 */
|
|
30
30
|
dataSource?: RecordType[];
|
|
31
|
-
/**
|
|
31
|
+
/** 分页总数 */
|
|
32
32
|
total?: number;
|
|
33
|
-
/**
|
|
33
|
+
/** 自定义的列表参数 */
|
|
34
34
|
columns?: BitzTableColumnsType<RecordType>;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
/**
|
|
35
|
+
/** table布局size */
|
|
36
|
+
size?: DensitySize;
|
|
37
|
+
/** 请求加载状态 */
|
|
38
38
|
loading?: boolean;
|
|
39
39
|
/** 骨架屏列表个数 */
|
|
40
40
|
skeletonNum?: {
|
|
41
41
|
pc?: number;
|
|
42
42
|
mobile?: number;
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
44
|
+
/** 移动端:骨架屏段落行数 */
|
|
45
45
|
skeletonRowNum?: SkeletonParagraphProps['rows'];
|
|
46
|
-
/**
|
|
46
|
+
/** 移动端:骨架屏行宽度 */
|
|
47
47
|
skeletonRowsWidth?: SkeletonParagraphProps['width'];
|
|
48
|
-
/**
|
|
48
|
+
/** 移动端:自定义骨架屏 */
|
|
49
49
|
skeletonRender?: () => ReactNode;
|
|
50
|
-
/** table布局size */
|
|
51
|
-
size?: DensitySize;
|
|
52
50
|
/** 是否启用分页组件的受控属性 */
|
|
53
51
|
enableControlPage?: boolean;
|
|
54
|
-
/**
|
|
52
|
+
/** 多选/单选 相关 */
|
|
55
53
|
selectionAlert?: SelelctionAlertProps;
|
|
56
54
|
/** 分页控件的分页属性 */
|
|
57
55
|
pagination?: {
|
|
@@ -60,10 +58,12 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
60
58
|
};
|
|
61
59
|
/** PC端:给父组件传值 page当前第几页 pageSize每页有多少 */
|
|
62
60
|
paginationEmit?: (page: number, pageSize: number) => void;
|
|
63
|
-
/**
|
|
61
|
+
/** PC端:是否启用拖拽 */
|
|
64
62
|
enabledRowDragSort?: boolean;
|
|
65
|
-
/**
|
|
63
|
+
/** PC端:拖拽结束 */
|
|
66
64
|
onRowDragEnd?: (newCols: RecordType[]) => void;
|
|
65
|
+
/** 移动端:操作按钮 */
|
|
66
|
+
operationFilter?: ActionsFunType<RecordType>;
|
|
67
67
|
/** 移动端:加载更多返回函数 */
|
|
68
68
|
/** 移动端:下拉刷新 */
|
|
69
69
|
mobileRefreshEmit?: () => Promise<unknown> | void;
|
|
@@ -77,21 +77,21 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
77
77
|
noDataImg?: any;
|
|
78
78
|
/** 移动端:下拉刷新的颜色定义 */
|
|
79
79
|
color?: string;
|
|
80
|
-
/**
|
|
80
|
+
/** PC端:操作栏-左侧 */
|
|
81
81
|
tableAction?: ReactNode;
|
|
82
|
-
/**
|
|
82
|
+
/** PC端:操作栏-右侧 */
|
|
83
83
|
tableToolbar?: ReactNode;
|
|
84
|
-
/**
|
|
84
|
+
/** PC端:浮动的选择操作栏 */
|
|
85
85
|
selectionBar?: ReactNode;
|
|
86
|
-
/**
|
|
86
|
+
/** PC端:是否展示工具栏 默认为 true */
|
|
87
87
|
showTableTool?: boolean;
|
|
88
|
-
/**
|
|
88
|
+
/** PC端:用于配置和存储表格外观,不传则不存储 */
|
|
89
89
|
stylesConfigState?: StylesStateType;
|
|
90
|
-
/**
|
|
90
|
+
/** PC端:用于配置和存储列配置,不传则不存储 */
|
|
91
91
|
columnsState?: ColumnStateType;
|
|
92
|
-
/**
|
|
92
|
+
/** PC端:用于配置和存储导出列配置,不传则不存储 */
|
|
93
93
|
exportConfigState?: ExportColumnStateType;
|
|
94
|
-
/**
|
|
94
|
+
/** PC端:自定义行类名 */
|
|
95
95
|
rowClassName?: RowClassName<RecordType>;
|
|
96
96
|
/** 重置分页的page为1 */
|
|
97
97
|
resetPage?: number;
|