bitz-react-admin-ui 2.4.2 → 2.4.3
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/BitzConfigProvider/index.d.ts +2 -0
- package/dist/components/BitzTable/ActionCol/index.d.ts +2 -1
- package/dist/components/BitzTable/ActionCol/index.mjs +127 -94
- package/dist/components/BitzTable/ActionCol/style.d.ts +1 -1
- package/dist/components/BitzTable/ActionCol/style.mjs +14 -14
- package/dist/components/BitzTable/Table/index.d.ts +3 -1
- package/dist/components/BitzTable/Table/index.mjs +339 -320
- package/dist/components/BitzTable/index.d.ts +21 -6
- package/dist/components/BitzTableSelect/Select/index.d.ts +1 -1
- package/dist/components/BitzTableSelect/Select/index.mjs +70 -69
- package/dist/components/BitzTableSelect/SingleSelect/index.d.ts +1 -1
- package/dist/components/BitzTableSelect/SingleSelect/index.mjs +73 -72
- package/dist/components/BitzTableSelect/index.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -5,8 +5,9 @@ import ActionBar from './ActionBar';
|
|
|
5
5
|
import ToolBar from './ToolBar/Wrapper';
|
|
6
6
|
import ActionCol from './ActionCol';
|
|
7
7
|
import SelectionBar from './SelectionBar';
|
|
8
|
-
import {
|
|
8
|
+
import { Key, ReactNode } from 'react';
|
|
9
9
|
import { TableColumnType } from 'antd';
|
|
10
|
+
import { ButtonProps } from 'antd/lib';
|
|
10
11
|
/** 操作按钮属性 */
|
|
11
12
|
interface Action<T> {
|
|
12
13
|
key?: string;
|
|
@@ -17,20 +18,34 @@ interface Action<T> {
|
|
|
17
18
|
onClick?: () => void;
|
|
18
19
|
children?: Action<T>[];
|
|
19
20
|
}
|
|
21
|
+
interface CustomAction extends Omit<ButtonProps, 'type' | 'children' | 'className'> {
|
|
22
|
+
label: string;
|
|
23
|
+
key?: Key;
|
|
24
|
+
type?: 'primary' | 'secondary' | 'detail';
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
render?: (button: ReactNode, index: number) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
type CustomActionsFunType<T> = (record: T, index: number) => CustomAction[];
|
|
20
29
|
/** 按钮操作列属性 */
|
|
21
|
-
interface BitzTableActionProps<T> {
|
|
30
|
+
interface BitzTableActionProps<T = any> {
|
|
22
31
|
loading?: boolean;
|
|
23
32
|
/**
|
|
24
33
|
* 操作按钮组,主要操作、次要操作、下拉列表(含危险操作)
|
|
25
34
|
* @次要操作 次要操作以下拉菜单显示,如果actionGroup的长度大于3,从第4个开始直到最后的所有按钮都为次要操作按钮
|
|
26
35
|
*/
|
|
27
36
|
actionGroup: Action<T>[];
|
|
28
|
-
|
|
37
|
+
customActions: CustomAction[];
|
|
29
38
|
}
|
|
30
|
-
type
|
|
39
|
+
type ActionGroupFunType<T> = (record: T, index: number) => Action<T>[];
|
|
40
|
+
type CustomActionsProps<T> = {
|
|
41
|
+
custom: CustomActionsFunType<T>;
|
|
42
|
+
request?: (record: T, index: number) => Promise<CustomAction[]>;
|
|
43
|
+
};
|
|
44
|
+
type ActionsFunType<T> = ActionGroupFunType<T> | CustomActionsProps<T>;
|
|
31
45
|
/** ActionCol hook参数 */
|
|
32
46
|
interface BitzTableActionColProps<T> extends Pick<BitzTableActionProps<T>, 'loading'>, Omit<BitzTableColumnType<T>, 'width' | 'render'> {
|
|
33
|
-
actionGroup
|
|
47
|
+
actionGroup?: ActionGroupFunType<T>;
|
|
48
|
+
customActions?: CustomActionsFunType<T>;
|
|
34
49
|
}
|
|
35
50
|
/** 列的排序和显隐控制 */
|
|
36
51
|
interface ColumnsConfigProps {
|
|
@@ -75,6 +90,6 @@ type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
|
|
|
75
90
|
SORTER_COLUMN: typeof SORTER_COLUMN;
|
|
76
91
|
};
|
|
77
92
|
declare const BitzTable: CompoundedComponent;
|
|
78
|
-
export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, StylesStateType, ColumnStateType, ExportColumnStateType, BitzTableColumnType, BitzTableColumnGroupType, BitzTableColumnsType, SelelctionAlertProps, ActionsFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
|
|
93
|
+
export type { BitzTableProps, BitzTableSizeType, ColumnsConfigProps, StylesStateType, ColumnStateType, ExportColumnStateType, BitzTableColumnType, BitzTableColumnGroupType, BitzTableColumnsType, SelelctionAlertProps, ActionsFunType, CustomAction, CustomActionsFunType, ActionGroupFunType, Action, BitzTableActionProps, BitzTableActionColProps, };
|
|
79
94
|
export { BitzTableProvider, BitzTableContext };
|
|
80
95
|
export default BitzTable;
|
|
@@ -5,5 +5,5 @@ export interface SelectProps<T extends BaseOptionType> extends Omit<BitzTableSel
|
|
|
5
5
|
onChange?: (value: Key[], options: T[]) => void;
|
|
6
6
|
}
|
|
7
7
|
/** 下拉表格组件 */
|
|
8
|
-
declare function TableSelect<T extends BaseOptionType>({ value, options: dataRows, columns, tableData, total, loading, loadingFailed, loadAgain, page, onPageChange, searchInput, showToolTagSelect, toolTags, onToolTagChange, lrLayout, parentRender, mode, placeholder, fieldNames, onChange, ...rest }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableSelect<T extends BaseOptionType>({ value, options: dataRows, columns, tableData, total, loading, loadingFailed, loadAgain, page, onPageChange, searchInput, showToolTagSelect, toolTags, onToolTagChange, lrLayout, parentRender, mode, placeholder, fieldNames, onChange, onOpenChange, ...rest }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default TableSelect;
|
|
@@ -1,93 +1,94 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Select as
|
|
4
|
-
import
|
|
5
|
-
function
|
|
1
|
+
import { j as b } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useState as o, useEffect as x } from "react";
|
|
3
|
+
import { Select as M } from "antd";
|
|
4
|
+
import Q from "../SelectPopup/index.mjs";
|
|
5
|
+
function Z({
|
|
6
6
|
value: s,
|
|
7
7
|
options: t,
|
|
8
|
-
columns:
|
|
9
|
-
tableData:
|
|
10
|
-
total:
|
|
11
|
-
loading:
|
|
12
|
-
loadingFailed:
|
|
13
|
-
loadAgain:
|
|
14
|
-
page:
|
|
15
|
-
onPageChange:
|
|
16
|
-
searchInput:
|
|
17
|
-
showToolTagSelect:
|
|
18
|
-
toolTags:
|
|
19
|
-
onToolTagChange:
|
|
20
|
-
lrLayout:
|
|
21
|
-
parentRender:
|
|
22
|
-
mode:
|
|
23
|
-
placeholder:
|
|
24
|
-
fieldNames:
|
|
8
|
+
columns: V,
|
|
9
|
+
tableData: j,
|
|
10
|
+
total: w,
|
|
11
|
+
loading: T,
|
|
12
|
+
loadingFailed: a,
|
|
13
|
+
loadAgain: k,
|
|
14
|
+
page: y,
|
|
15
|
+
onPageChange: E,
|
|
16
|
+
searchInput: A,
|
|
17
|
+
showToolTagSelect: B,
|
|
18
|
+
toolTags: D,
|
|
19
|
+
onToolTagChange: P,
|
|
20
|
+
lrLayout: d,
|
|
21
|
+
parentRender: v,
|
|
22
|
+
mode: F = "multiple",
|
|
23
|
+
placeholder: N = "请选择",
|
|
24
|
+
fieldNames: p,
|
|
25
25
|
onChange: e,
|
|
26
|
-
|
|
26
|
+
onOpenChange: c,
|
|
27
|
+
...$
|
|
27
28
|
}) {
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
!
|
|
29
|
+
const [u, q] = o([]), [S, i] = o([]), [f, m] = o(!1), [z, G] = o(!1), H = () => {
|
|
30
|
+
i([]), e == null || e([], []);
|
|
31
|
+
}, I = (l, r, L) => {
|
|
32
|
+
L === "confirm" ? m(!1) : (i([...r]), e == null || e([...l], [...r]));
|
|
33
|
+
}, J = (l, r) => {
|
|
34
|
+
i(r), e == null || e(l, r);
|
|
35
|
+
}, K = (l) => {
|
|
36
|
+
!f && l && m(!0), !z && !l && f && m(!1), c == null || c(l);
|
|
36
37
|
};
|
|
37
|
-
return
|
|
38
|
+
return x(() => {
|
|
38
39
|
if (s && !Array.isArray(s))
|
|
39
40
|
throw new Error(
|
|
40
41
|
`form表单在使用setFieldValue给TableSelect组件赋值时请确认值为数组类型, \`value\`: ${s}`
|
|
41
42
|
);
|
|
42
|
-
|
|
43
|
-
}, [s]),
|
|
44
|
-
t != null && t.length &&
|
|
45
|
-
}, [t]), /* @__PURE__ */
|
|
46
|
-
|
|
43
|
+
q(s ?? []);
|
|
44
|
+
}, [s]), x(() => {
|
|
45
|
+
t != null && t.length && i(t);
|
|
46
|
+
}, [t]), /* @__PURE__ */ b.jsx(
|
|
47
|
+
M,
|
|
47
48
|
{
|
|
48
49
|
allowClear: !0,
|
|
49
50
|
className: "tableSelectBlock",
|
|
50
51
|
mode: "multiple",
|
|
51
52
|
maxTagCount: "responsive",
|
|
52
|
-
value:
|
|
53
|
-
options:
|
|
54
|
-
fieldNames:
|
|
53
|
+
value: u,
|
|
54
|
+
options: S,
|
|
55
|
+
fieldNames: p,
|
|
55
56
|
showSearch: !1,
|
|
56
|
-
open:
|
|
57
|
-
placeholder:
|
|
57
|
+
open: f,
|
|
58
|
+
placeholder: N,
|
|
58
59
|
popupClassName: "tableSelectPopupBlock",
|
|
59
|
-
dropdownRender: () => /* @__PURE__ */
|
|
60
|
-
|
|
60
|
+
dropdownRender: () => /* @__PURE__ */ b.jsx(
|
|
61
|
+
Q,
|
|
61
62
|
{
|
|
62
|
-
columns:
|
|
63
|
-
tableData:
|
|
64
|
-
total:
|
|
65
|
-
page:
|
|
66
|
-
onPageChange:
|
|
67
|
-
searchInput:
|
|
68
|
-
loading:
|
|
69
|
-
loadingFailed:
|
|
70
|
-
loadAgain:
|
|
71
|
-
keys:
|
|
72
|
-
rows:
|
|
73
|
-
fieldNames:
|
|
74
|
-
onChange:
|
|
75
|
-
onDropdownVisibleChange:
|
|
76
|
-
showToolTagSelect:
|
|
77
|
-
toolTags:
|
|
78
|
-
onToolTagChange:
|
|
79
|
-
lrLayout:
|
|
80
|
-
parentRender:
|
|
81
|
-
mode:
|
|
63
|
+
columns: V,
|
|
64
|
+
tableData: j,
|
|
65
|
+
total: w,
|
|
66
|
+
page: y,
|
|
67
|
+
onPageChange: E,
|
|
68
|
+
searchInput: A,
|
|
69
|
+
loading: T,
|
|
70
|
+
loadingFailed: a,
|
|
71
|
+
loadAgain: k,
|
|
72
|
+
keys: u,
|
|
73
|
+
rows: S,
|
|
74
|
+
fieldNames: p,
|
|
75
|
+
onChange: I,
|
|
76
|
+
onDropdownVisibleChange: G,
|
|
77
|
+
showToolTagSelect: B,
|
|
78
|
+
toolTags: D,
|
|
79
|
+
onToolTagChange: P,
|
|
80
|
+
lrLayout: d,
|
|
81
|
+
parentRender: v,
|
|
82
|
+
mode: F
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
onClear:
|
|
85
|
-
onDropdownVisibleChange:
|
|
86
|
-
onChange:
|
|
87
|
-
|
|
85
|
+
onClear: H,
|
|
86
|
+
onDropdownVisibleChange: K,
|
|
87
|
+
onChange: J,
|
|
88
|
+
...$
|
|
88
89
|
}
|
|
89
90
|
);
|
|
90
91
|
}
|
|
91
92
|
export {
|
|
92
|
-
|
|
93
|
+
Z as default
|
|
93
94
|
};
|
|
@@ -3,5 +3,5 @@ import { BaseOptionType } from 'antd/es/select';
|
|
|
3
3
|
export interface SingleSelectProps<T extends BaseOptionType> extends Omit<BitzTableSelectProps<T, any>, 'offsetWidth'> {
|
|
4
4
|
}
|
|
5
5
|
/** 下拉表格组件 */
|
|
6
|
-
declare function TableSingleSelect<T extends BaseOptionType>({ value, options: dataRows, columns, tableData, total, loading, loadingFailed, loadAgain, page, onPageChange, searchInput, showToolTagSelect, toolTags, onToolTagChange, lrLayout, parentRender, mode, placeholder, fieldNames, onChange, ...rest }: SingleSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableSingleSelect<T extends BaseOptionType>({ value, options: dataRows, columns, tableData, total, loading, loadingFailed, loadAgain, page, onPageChange, searchInput, showToolTagSelect, toolTags, onToolTagChange, lrLayout, parentRender, mode, placeholder, fieldNames, onChange, onOpenChange, ...rest }: SingleSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default TableSingleSelect;
|
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Select as
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
value:
|
|
7
|
-
options:
|
|
8
|
-
columns:
|
|
9
|
-
tableData:
|
|
10
|
-
total:
|
|
11
|
-
loading:
|
|
12
|
-
loadingFailed:
|
|
13
|
-
loadAgain:
|
|
14
|
-
page:
|
|
15
|
-
onPageChange:
|
|
16
|
-
searchInput:
|
|
17
|
-
showToolTagSelect:
|
|
18
|
-
toolTags:
|
|
19
|
-
onToolTagChange:
|
|
20
|
-
lrLayout:
|
|
21
|
-
parentRender:
|
|
22
|
-
mode:
|
|
23
|
-
placeholder:
|
|
24
|
-
fieldNames:
|
|
25
|
-
onChange:
|
|
26
|
-
|
|
1
|
+
import { j as b } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useState as c, useEffect as x } from "react";
|
|
3
|
+
import { Select as W } from "antd";
|
|
4
|
+
import X from "../SelectPopup/index.mjs";
|
|
5
|
+
function a({
|
|
6
|
+
value: m,
|
|
7
|
+
options: e,
|
|
8
|
+
columns: V,
|
|
9
|
+
tableData: j,
|
|
10
|
+
total: k,
|
|
11
|
+
loading: v,
|
|
12
|
+
loadingFailed: w,
|
|
13
|
+
loadAgain: B,
|
|
14
|
+
page: D,
|
|
15
|
+
onPageChange: E,
|
|
16
|
+
searchInput: P,
|
|
17
|
+
showToolTagSelect: T,
|
|
18
|
+
toolTags: y,
|
|
19
|
+
onToolTagChange: N,
|
|
20
|
+
lrLayout: q,
|
|
21
|
+
parentRender: z,
|
|
22
|
+
mode: A = "single",
|
|
23
|
+
placeholder: F = "请选择",
|
|
24
|
+
fieldNames: u,
|
|
25
|
+
onChange: l,
|
|
26
|
+
onOpenChange: i,
|
|
27
|
+
...G
|
|
27
28
|
}) {
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
!
|
|
29
|
+
const [o, H] = c(), [S, r] = c(), [f, p] = c(!1), [I, J] = c(!1), K = () => {
|
|
30
|
+
r([]), l == null || l([], []);
|
|
31
|
+
}, L = (s, t, U) => {
|
|
32
|
+
U === "confirm" ? p(!1) : (r(t), l == null || l(s, t));
|
|
33
|
+
}, M = (s, t) => {
|
|
34
|
+
r(t), l == null || l(s, t);
|
|
35
|
+
}, Q = (s) => {
|
|
36
|
+
!f && s && p(!0), !I && !s && f && p(!1), i == null || i(s);
|
|
36
37
|
};
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
38
|
+
return x(() => {
|
|
39
|
+
H(m);
|
|
40
|
+
}, [m]), x(() => {
|
|
41
|
+
e != null && e.length && r(e);
|
|
42
|
+
}, [e]), /* @__PURE__ */ b.jsx(
|
|
43
|
+
W,
|
|
43
44
|
{
|
|
44
45
|
allowClear: !0,
|
|
45
46
|
className: "tableSelectBlock",
|
|
46
|
-
value:
|
|
47
|
-
options:
|
|
48
|
-
fieldNames:
|
|
47
|
+
value: o,
|
|
48
|
+
options: S,
|
|
49
|
+
fieldNames: u,
|
|
49
50
|
showSearch: !1,
|
|
50
|
-
open:
|
|
51
|
-
placeholder:
|
|
51
|
+
open: f,
|
|
52
|
+
placeholder: F,
|
|
52
53
|
popupClassName: "tableSelectPopupBlock",
|
|
53
|
-
dropdownRender: () => /* @__PURE__ */
|
|
54
|
-
|
|
54
|
+
dropdownRender: () => /* @__PURE__ */ b.jsx(
|
|
55
|
+
X,
|
|
55
56
|
{
|
|
56
|
-
columns:
|
|
57
|
-
tableData:
|
|
58
|
-
total:
|
|
59
|
-
page:
|
|
60
|
-
onPageChange:
|
|
61
|
-
searchInput:
|
|
62
|
-
loading:
|
|
63
|
-
loadingFailed:
|
|
64
|
-
loadAgain:
|
|
65
|
-
keys:
|
|
66
|
-
rows:
|
|
67
|
-
fieldNames:
|
|
68
|
-
onChange:
|
|
69
|
-
onDropdownVisibleChange:
|
|
70
|
-
showToolTagSelect:
|
|
71
|
-
toolTags:
|
|
72
|
-
onToolTagChange:
|
|
73
|
-
lrLayout:
|
|
74
|
-
parentRender:
|
|
75
|
-
mode:
|
|
57
|
+
columns: V,
|
|
58
|
+
tableData: j,
|
|
59
|
+
total: k,
|
|
60
|
+
page: D,
|
|
61
|
+
onPageChange: E,
|
|
62
|
+
searchInput: P,
|
|
63
|
+
loading: v,
|
|
64
|
+
loadingFailed: w,
|
|
65
|
+
loadAgain: B,
|
|
66
|
+
keys: o ? [o] : [],
|
|
67
|
+
rows: S,
|
|
68
|
+
fieldNames: u,
|
|
69
|
+
onChange: L,
|
|
70
|
+
onDropdownVisibleChange: J,
|
|
71
|
+
showToolTagSelect: T,
|
|
72
|
+
toolTags: y,
|
|
73
|
+
onToolTagChange: N,
|
|
74
|
+
lrLayout: q,
|
|
75
|
+
parentRender: z,
|
|
76
|
+
mode: A
|
|
76
77
|
}
|
|
77
78
|
),
|
|
78
|
-
onClear:
|
|
79
|
-
onDropdownVisibleChange:
|
|
80
|
-
onChange:
|
|
81
|
-
...
|
|
79
|
+
onClear: K,
|
|
80
|
+
onDropdownVisibleChange: Q,
|
|
81
|
+
onChange: M,
|
|
82
|
+
...G
|
|
82
83
|
}
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
a as default
|
|
87
88
|
};
|
|
@@ -58,10 +58,12 @@ export interface BitzTableSelectProps<T extends BaseOptionType, ValueType extend
|
|
|
58
58
|
fieldNames: FieldNames;
|
|
59
59
|
/** 下拉框 placeholder */
|
|
60
60
|
placeholder?: string;
|
|
61
|
-
/**
|
|
61
|
+
/** 向父组件传递数据的事件 */
|
|
62
62
|
onChange?: (value: Key | Key[], options: T | T[]) => void;
|
|
63
63
|
/** 计算popup总宽度的追加值 */
|
|
64
64
|
popupAppendWidth?: number;
|
|
65
|
+
/** select dropdown 显隐切换的 callback */
|
|
66
|
+
onOpenChange?: (open: boolean) => void;
|
|
65
67
|
}
|
|
66
68
|
/** 下拉表格组件 */
|
|
67
69
|
declare function BitzTableSelect<T extends BaseOptionType>({ columns, tableData, loading, loadingFailed, loadAgain, total, page, onPageChange, onSearch, showToolTagSelect, placeholder, mode, fieldNames, onChange, popupAppendWidth: w, ...rest }: BitzTableSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|