bitz-react-admin-ui 2.4.3 → 2.4.5
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/BitzPagination/index.d.ts +1 -1
- package/dist/components/BitzTable/ActionCol/index.mjs +64 -64
- package/dist/components/BitzTable/Table/index.d.ts +1 -1
- package/dist/components/BitzTable/Table/index.mjs +259 -252
- package/dist/components/BitzTable/Table/utils.d.ts +2 -0
- package/dist/components/BitzTable/Table/utils.mjs +37 -28
- package/dist/components/BitzTable/index.d.ts +2 -0
- package/dist/components/BitzTableSelect/Select/index.d.ts +1 -1
- package/dist/components/BitzTableSelect/Select/index.mjs +58 -58
- package/dist/components/BitzTableSelect/SelectPopup/getData.mjs +1 -1
- package/dist/components/BitzTableSelect/SingleSelect/index.d.ts +1 -1
- package/dist/components/BitzTableSelect/SingleSelect/index.mjs +50 -50
- package/dist/components/BitzTableSelect/index.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BitzTableColumnsType } from '..';
|
|
2
2
|
/** build skeleton */
|
|
3
3
|
export declare function loopBuildSkeleton<T>(columns: BitzTableColumnsType<T>): BitzTableColumnsType<T>;
|
|
4
|
+
/** 重置 tbody 的滚动条位置 */
|
|
5
|
+
export declare const resetScroll: (ref: any) => void;
|
|
4
6
|
/** 设置复选框列、展开列的位置 */
|
|
5
7
|
export declare function getColumnsWithTool<T>(cols: any, sortCols: any, enabledRowDragSort: any, showRowSelection: any, showExpandable: any): BitzTableColumnsType<T>;
|
|
@@ -1,47 +1,56 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { Skeleton as
|
|
3
|
-
import { toolCols as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
...
|
|
1
|
+
import { j as a } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { Skeleton as p, Table as d } from "antd";
|
|
3
|
+
import { toolCols as u, SORTER_COLUMN as x } from "../Store/index.mjs";
|
|
4
|
+
function I(t) {
|
|
5
|
+
return t == null ? void 0 : t.map((e) => {
|
|
6
|
+
const o = { ...e };
|
|
7
|
+
return e != null && e.isOperationCol || e != null && e.isCheckboxCol || e != null && e.isExpandIconCol || u.includes(e) ? e : (o != null && o.children && (o.children = I(o == null ? void 0 : o.children)), {
|
|
8
|
+
...o,
|
|
9
9
|
sorter: !1,
|
|
10
|
-
render: (
|
|
11
|
-
|
|
10
|
+
render: (r, i, l) => /* @__PURE__ */ a.jsx(
|
|
11
|
+
p,
|
|
12
12
|
{
|
|
13
13
|
active: !0,
|
|
14
14
|
title: !1,
|
|
15
15
|
paragraph: {
|
|
16
16
|
rows: 1,
|
|
17
|
-
width: (
|
|
17
|
+
width: (l + 1) % 2 === 0 ? "100%" : "60%"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
)
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const L = (t) => {
|
|
25
|
+
var o, r, i, l;
|
|
26
|
+
let e = (r = (o = t.current) == null ? void 0 : o.nativeElement) == null ? void 0 : r.querySelector(".ant-table-content");
|
|
27
|
+
e || (e = (l = (i = t.current) == null ? void 0 : i.nativeElement) == null ? void 0 : l.querySelector(".ant-table-body")), e && e.scroll({
|
|
28
|
+
top: 0,
|
|
29
|
+
left: 0
|
|
30
|
+
// behavior: 'smooth'
|
|
31
|
+
});
|
|
32
|
+
}, E = 0, O = 1, h = 2;
|
|
33
|
+
function b(t, e, o, r, i) {
|
|
34
|
+
const l = [...t ?? []], c = [...e];
|
|
35
|
+
let f = E;
|
|
36
|
+
if (o) {
|
|
37
|
+
const n = l.indexOf(x);
|
|
38
|
+
n >= 0 && (f = n), c.splice(f, 0, x);
|
|
31
39
|
}
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
34
|
-
const n =
|
|
35
|
-
n >= 0 && (
|
|
40
|
+
let s = 0;
|
|
41
|
+
if (r) {
|
|
42
|
+
const n = l.indexOf(d.SELECTION_COLUMN);
|
|
43
|
+
n >= 0 && (s = n), o && f === 0 && n === -1 && (s = O), c.splice(s, 0, d.SELECTION_COLUMN);
|
|
36
44
|
}
|
|
37
|
-
if (
|
|
45
|
+
if (i) {
|
|
38
46
|
let n = 0;
|
|
39
|
-
const C =
|
|
40
|
-
C >= 0 && (n = C),
|
|
47
|
+
const C = l.indexOf(d.EXPAND_COLUMN);
|
|
48
|
+
C >= 0 && (n = C), o && f === 0 && C === -1 && (n = 1), r && s === 1 && C === -1 && (n = h), c.splice(n, 0, d.EXPAND_COLUMN);
|
|
41
49
|
}
|
|
42
|
-
return
|
|
50
|
+
return c;
|
|
43
51
|
}
|
|
44
52
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
b as getColumnsWithTool,
|
|
54
|
+
I as loopBuildSkeleton,
|
|
55
|
+
L as resetScroll
|
|
47
56
|
};
|
|
@@ -40,10 +40,12 @@ type ActionGroupFunType<T> = (record: T, index: number) => Action<T>[];
|
|
|
40
40
|
type CustomActionsProps<T> = {
|
|
41
41
|
custom: CustomActionsFunType<T>;
|
|
42
42
|
request?: (record: T, index: number) => Promise<CustomAction[]>;
|
|
43
|
+
onClick?: (key: any) => void;
|
|
43
44
|
};
|
|
44
45
|
type ActionsFunType<T> = ActionGroupFunType<T> | CustomActionsProps<T>;
|
|
45
46
|
/** ActionCol hook参数 */
|
|
46
47
|
interface BitzTableActionColProps<T> extends Pick<BitzTableActionProps<T>, 'loading'>, Omit<BitzTableColumnType<T>, 'width' | 'render'> {
|
|
48
|
+
defaultWidth?: number;
|
|
47
49
|
actionGroup?: ActionGroupFunType<T>;
|
|
48
50
|
customActions?: CustomActionsFunType<T>;
|
|
49
51
|
}
|
|
@@ -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,
|
|
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, onPopupVisibleChange, ...rest }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default TableSelect;
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as o, useEffect as
|
|
1
|
+
import { j as x } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useState as o, useEffect as b } from "react";
|
|
3
3
|
import { Select as M } from "antd";
|
|
4
4
|
import Q from "../SelectPopup/index.mjs";
|
|
5
5
|
function Z({
|
|
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:
|
|
6
|
+
value: l,
|
|
7
|
+
options: r,
|
|
8
|
+
columns: j,
|
|
9
|
+
tableData: w,
|
|
10
|
+
total: T,
|
|
11
|
+
loading: a,
|
|
12
|
+
loadingFailed: k,
|
|
13
|
+
loadAgain: y,
|
|
14
|
+
page: E,
|
|
15
|
+
onPageChange: A,
|
|
16
|
+
searchInput: B,
|
|
17
|
+
showToolTagSelect: D,
|
|
18
|
+
toolTags: V,
|
|
19
|
+
onToolTagChange: d,
|
|
20
|
+
lrLayout: v,
|
|
21
|
+
parentRender: F,
|
|
22
|
+
mode: N = "multiple",
|
|
23
|
+
placeholder: O = "请选择",
|
|
24
24
|
fieldNames: p,
|
|
25
25
|
onChange: e,
|
|
26
|
-
|
|
26
|
+
onPopupVisibleChange: f,
|
|
27
27
|
...$
|
|
28
28
|
}) {
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
}, I = (
|
|
32
|
-
L === "confirm" ? m(!1) : (
|
|
33
|
-
}, J = (
|
|
34
|
-
|
|
35
|
-
}, K = (
|
|
36
|
-
!
|
|
29
|
+
const [S, q] = o([]), [u, c] = o([]), [i, m] = o(!1), [z, G] = o(!1), H = () => {
|
|
30
|
+
c([]), e == null || e([], []);
|
|
31
|
+
}, I = (t, s, L) => {
|
|
32
|
+
L === "confirm" ? m(!1) : (c([...s]), e == null || e([...t], [...s]));
|
|
33
|
+
}, J = (t, s) => {
|
|
34
|
+
c(s), e == null || e(t, s);
|
|
35
|
+
}, K = (t) => {
|
|
36
|
+
!i && t && m(!0), !z && !t && i && m(!1), f == null || f(t);
|
|
37
37
|
};
|
|
38
|
-
return
|
|
39
|
-
if (
|
|
38
|
+
return b(() => {
|
|
39
|
+
if (l && !Array.isArray(l))
|
|
40
40
|
throw new Error(
|
|
41
|
-
`form表单在使用setFieldValue给TableSelect组件赋值时请确认值为数组类型, \`value\`: ${
|
|
41
|
+
`form表单在使用setFieldValue给TableSelect组件赋值时请确认值为数组类型, \`value\`: ${l}`
|
|
42
42
|
);
|
|
43
|
-
q(
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
}, [
|
|
43
|
+
q(l ?? []);
|
|
44
|
+
}, [l]), b(() => {
|
|
45
|
+
r != null && r.length && c(r);
|
|
46
|
+
}, [r]), /* @__PURE__ */ x.jsx(
|
|
47
47
|
M,
|
|
48
48
|
{
|
|
49
49
|
allowClear: !0,
|
|
50
50
|
className: "tableSelectBlock",
|
|
51
51
|
mode: "multiple",
|
|
52
52
|
maxTagCount: "responsive",
|
|
53
|
-
value:
|
|
54
|
-
options:
|
|
53
|
+
value: S,
|
|
54
|
+
options: u,
|
|
55
55
|
fieldNames: p,
|
|
56
56
|
showSearch: !1,
|
|
57
|
-
open:
|
|
58
|
-
placeholder:
|
|
57
|
+
open: i,
|
|
58
|
+
placeholder: O,
|
|
59
59
|
popupClassName: "tableSelectPopupBlock",
|
|
60
|
-
dropdownRender: () => /* @__PURE__ */
|
|
60
|
+
dropdownRender: () => /* @__PURE__ */ x.jsx(
|
|
61
61
|
Q,
|
|
62
62
|
{
|
|
63
|
-
columns:
|
|
64
|
-
tableData:
|
|
65
|
-
total:
|
|
66
|
-
page:
|
|
67
|
-
onPageChange:
|
|
68
|
-
searchInput:
|
|
69
|
-
loading:
|
|
70
|
-
loadingFailed:
|
|
71
|
-
loadAgain:
|
|
72
|
-
keys:
|
|
73
|
-
rows:
|
|
63
|
+
columns: j,
|
|
64
|
+
tableData: w,
|
|
65
|
+
total: T,
|
|
66
|
+
page: E,
|
|
67
|
+
onPageChange: A,
|
|
68
|
+
searchInput: B,
|
|
69
|
+
loading: a,
|
|
70
|
+
loadingFailed: k,
|
|
71
|
+
loadAgain: y,
|
|
72
|
+
keys: S,
|
|
73
|
+
rows: u,
|
|
74
74
|
fieldNames: p,
|
|
75
75
|
onChange: I,
|
|
76
76
|
onDropdownVisibleChange: G,
|
|
77
|
-
showToolTagSelect:
|
|
78
|
-
toolTags:
|
|
79
|
-
onToolTagChange:
|
|
80
|
-
lrLayout:
|
|
81
|
-
parentRender:
|
|
82
|
-
mode:
|
|
77
|
+
showToolTagSelect: D,
|
|
78
|
+
toolTags: V,
|
|
79
|
+
onToolTagChange: d,
|
|
80
|
+
lrLayout: v,
|
|
81
|
+
parentRender: F,
|
|
82
|
+
mode: N
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
onClear: H,
|
|
@@ -10,7 +10,7 @@ const R = (o, n, e) => {
|
|
|
10
10
|
const f = (n == null ? void 0 : n.length) === 1 ? !1 : g + 1 > ((n == null ? void 0 : n.length) || 0) / 2;
|
|
11
11
|
if (r != null && r.render) {
|
|
12
12
|
const s = r.render(t, c, g);
|
|
13
|
-
if (typeof s == "object")
|
|
13
|
+
if (typeof s == "object" && s !== null)
|
|
14
14
|
return s;
|
|
15
15
|
if (["boolean", "number", "bigint", "string"].includes(
|
|
16
16
|
typeof s
|
|
@@ -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,
|
|
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, onPopupVisibleChange, ...rest }: SingleSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default TableSingleSelect;
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as c, useEffect as
|
|
1
|
+
import { j as x } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useState as c, useEffect as b } from "react";
|
|
3
3
|
import { Select as W } from "antd";
|
|
4
4
|
import X from "../SelectPopup/index.mjs";
|
|
5
5
|
function a({
|
|
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:
|
|
6
|
+
value: S,
|
|
7
|
+
options: l,
|
|
8
|
+
columns: j,
|
|
9
|
+
tableData: k,
|
|
10
|
+
total: v,
|
|
11
|
+
loading: w,
|
|
12
|
+
loadingFailed: B,
|
|
13
|
+
loadAgain: D,
|
|
14
|
+
page: E,
|
|
15
|
+
onPageChange: T,
|
|
16
|
+
searchInput: y,
|
|
17
|
+
showToolTagSelect: N,
|
|
18
|
+
toolTags: O,
|
|
19
|
+
onToolTagChange: V,
|
|
20
20
|
lrLayout: q,
|
|
21
21
|
parentRender: z,
|
|
22
22
|
mode: A = "single",
|
|
23
23
|
placeholder: F = "请选择",
|
|
24
|
-
fieldNames:
|
|
25
|
-
onChange:
|
|
26
|
-
|
|
24
|
+
fieldNames: p,
|
|
25
|
+
onChange: e,
|
|
26
|
+
onPopupVisibleChange: f,
|
|
27
27
|
...G
|
|
28
28
|
}) {
|
|
29
|
-
const [o, H] = c(), [
|
|
30
|
-
r([]),
|
|
31
|
-
}, L = (
|
|
32
|
-
U === "confirm" ?
|
|
33
|
-
}, M = (
|
|
34
|
-
r(
|
|
35
|
-
}, Q = (
|
|
36
|
-
!
|
|
29
|
+
const [o, H] = c(), [u, r] = c(), [i, m] = c(!1), [I, J] = c(!1), K = () => {
|
|
30
|
+
r([]), e == null || e([], []);
|
|
31
|
+
}, L = (t, s, U) => {
|
|
32
|
+
U === "confirm" ? m(!1) : (r(s), e == null || e(t, s));
|
|
33
|
+
}, M = (t, s) => {
|
|
34
|
+
r(s), e == null || e(t, s);
|
|
35
|
+
}, Q = (t) => {
|
|
36
|
+
!i && t && m(!0), !I && !t && i && m(!1), f == null || f(t);
|
|
37
37
|
};
|
|
38
|
-
return
|
|
39
|
-
H(
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
}, [
|
|
38
|
+
return b(() => {
|
|
39
|
+
H(S);
|
|
40
|
+
}, [S]), b(() => {
|
|
41
|
+
l != null && l.length && r(l);
|
|
42
|
+
}, [l]), /* @__PURE__ */ x.jsx(
|
|
43
43
|
W,
|
|
44
44
|
{
|
|
45
45
|
allowClear: !0,
|
|
46
46
|
className: "tableSelectBlock",
|
|
47
47
|
value: o,
|
|
48
|
-
options:
|
|
49
|
-
fieldNames:
|
|
48
|
+
options: u,
|
|
49
|
+
fieldNames: p,
|
|
50
50
|
showSearch: !1,
|
|
51
|
-
open:
|
|
51
|
+
open: i,
|
|
52
52
|
placeholder: F,
|
|
53
53
|
popupClassName: "tableSelectPopupBlock",
|
|
54
|
-
dropdownRender: () => /* @__PURE__ */
|
|
54
|
+
dropdownRender: () => /* @__PURE__ */ x.jsx(
|
|
55
55
|
X,
|
|
56
56
|
{
|
|
57
|
-
columns:
|
|
58
|
-
tableData:
|
|
59
|
-
total:
|
|
60
|
-
page:
|
|
61
|
-
onPageChange:
|
|
62
|
-
searchInput:
|
|
63
|
-
loading:
|
|
64
|
-
loadingFailed:
|
|
65
|
-
loadAgain:
|
|
57
|
+
columns: j,
|
|
58
|
+
tableData: k,
|
|
59
|
+
total: v,
|
|
60
|
+
page: E,
|
|
61
|
+
onPageChange: T,
|
|
62
|
+
searchInput: y,
|
|
63
|
+
loading: w,
|
|
64
|
+
loadingFailed: B,
|
|
65
|
+
loadAgain: D,
|
|
66
66
|
keys: o ? [o] : [],
|
|
67
|
-
rows:
|
|
68
|
-
fieldNames:
|
|
67
|
+
rows: u,
|
|
68
|
+
fieldNames: p,
|
|
69
69
|
onChange: L,
|
|
70
70
|
onDropdownVisibleChange: J,
|
|
71
|
-
showToolTagSelect:
|
|
72
|
-
toolTags:
|
|
73
|
-
onToolTagChange:
|
|
71
|
+
showToolTagSelect: N,
|
|
72
|
+
toolTags: O,
|
|
73
|
+
onToolTagChange: V,
|
|
74
74
|
lrLayout: q,
|
|
75
75
|
parentRender: z,
|
|
76
76
|
mode: A
|
|
@@ -62,8 +62,8 @@ export interface BitzTableSelectProps<T extends BaseOptionType, ValueType extend
|
|
|
62
62
|
onChange?: (value: Key | Key[], options: T | T[]) => void;
|
|
63
63
|
/** 计算popup总宽度的追加值 */
|
|
64
64
|
popupAppendWidth?: number;
|
|
65
|
-
/** select
|
|
66
|
-
|
|
65
|
+
/** select 弹出层显隐切换的 callback */
|
|
66
|
+
onPopupVisibleChange?: (open: boolean) => void;
|
|
67
67
|
}
|
|
68
68
|
/** 下拉表格组件 */
|
|
69
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;
|