bitz-react-admin-ui 2.4.3 → 2.4.4
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/ActionCol/index.mjs +64 -64
- package/dist/components/BitzTable/Table/index.d.ts +1 -1
- package/dist/components/BitzTable/Table/index.mjs +215 -215
- 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/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,15 +1,15 @@
|
|
|
1
1
|
import { j as n } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import T from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
|
|
3
3
|
import { Space as I, Skeleton as R, theme as P } from "antd";
|
|
4
|
-
import { forwardRef as E, useContext as L, useMemo as
|
|
4
|
+
import { forwardRef as E, useContext as L, useMemo as C, Fragment as M, useRef as D } from "react";
|
|
5
5
|
import x from "../../BitzButton/index.mjs";
|
|
6
6
|
import F, { actionColBtnGap as H } from "./style.mjs";
|
|
7
7
|
import "../index.mjs";
|
|
8
8
|
import w from "../Dropdown/index.mjs";
|
|
9
9
|
import { tablePaddingInline as O } from "../../BitzConfigProvider/context.mjs";
|
|
10
|
-
import { BitzTableContext as
|
|
11
|
-
const
|
|
12
|
-
skeletonCls:
|
|
10
|
+
import { BitzTableContext as W } from "../Store/index.mjs";
|
|
11
|
+
const b = ({
|
|
12
|
+
skeletonCls: m,
|
|
13
13
|
...l
|
|
14
14
|
}) => /* @__PURE__ */ n.jsxs(x, { type: "text", ...l, children: [
|
|
15
15
|
/* @__PURE__ */ n.jsx("span", { children: l.children }),
|
|
@@ -18,115 +18,115 @@ const B = ({
|
|
|
18
18
|
{
|
|
19
19
|
active: !0,
|
|
20
20
|
title: !1,
|
|
21
|
-
className:
|
|
21
|
+
className: m,
|
|
22
22
|
paragraph: {
|
|
23
23
|
rows: 1,
|
|
24
24
|
width: "100%"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
)
|
|
28
|
-
] }),
|
|
29
|
-
({ loading:
|
|
30
|
-
const { loading:
|
|
31
|
-
primaryBtnClassName:
|
|
32
|
-
dangerBtnClassName:
|
|
33
|
-
secondaryBtnClassName:
|
|
34
|
-
maskClassName:
|
|
35
|
-
skeletonBtnClassName:
|
|
36
|
-
skeletonClassName:
|
|
37
|
-
} = F(), j =
|
|
38
|
-
const i = l.length >= 4 ? 2 : l.length,
|
|
39
|
-
if (
|
|
28
|
+
] }), _ = E(
|
|
29
|
+
({ loading: m, actionGroup: l, customActions: r }, p) => {
|
|
30
|
+
const { loading: f, fullscreen: y } = L(W), o = C(() => m ?? f, [m, f]), {
|
|
31
|
+
primaryBtnClassName: d,
|
|
32
|
+
dangerBtnClassName: a,
|
|
33
|
+
secondaryBtnClassName: u,
|
|
34
|
+
maskClassName: B,
|
|
35
|
+
skeletonBtnClassName: h,
|
|
36
|
+
skeletonClassName: g
|
|
37
|
+
} = F(), j = C(() => {
|
|
38
|
+
const i = l.length >= 4 ? 2 : l.length, c = l.slice(0, i), t = [];
|
|
39
|
+
if (c != null && c.length && c.forEach((e, s) => {
|
|
40
40
|
t.push(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
o ? /* @__PURE__ */ n.jsx(
|
|
42
|
+
b,
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
45
|
-
skeletonCls:
|
|
44
|
+
className: h,
|
|
45
|
+
skeletonCls: g,
|
|
46
46
|
children: e == null ? void 0 : e.label
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
s
|
|
49
49
|
) : e.children ? /* @__PURE__ */ n.jsx(w, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
|
|
50
50
|
x,
|
|
51
51
|
{
|
|
52
52
|
type: "text",
|
|
53
|
-
className: e.danger ?
|
|
53
|
+
className: e.danger ? a : d,
|
|
54
54
|
children: e == null ? void 0 : e.label
|
|
55
55
|
}
|
|
56
|
-
) },
|
|
56
|
+
) }, s) : /* @__PURE__ */ n.jsx(
|
|
57
57
|
x,
|
|
58
58
|
{
|
|
59
59
|
type: "text",
|
|
60
|
-
className: e.danger ?
|
|
60
|
+
className: e.danger ? a : d,
|
|
61
61
|
onClick: e == null ? void 0 : e.onClick,
|
|
62
62
|
children: e == null ? void 0 : e.label
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
s
|
|
65
65
|
)
|
|
66
66
|
);
|
|
67
67
|
}), i === 2 && l.length >= 4) {
|
|
68
68
|
const e = l.slice(2, l.length);
|
|
69
69
|
t.push(
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
o ? /* @__PURE__ */ n.jsx(
|
|
71
|
+
b,
|
|
72
72
|
{
|
|
73
|
-
className:
|
|
74
|
-
skeletonCls:
|
|
73
|
+
className: h,
|
|
74
|
+
skeletonCls: g,
|
|
75
75
|
children: "更多"
|
|
76
76
|
},
|
|
77
77
|
5
|
|
78
|
-
) : /* @__PURE__ */ n.jsx(w, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className:
|
|
78
|
+
) : /* @__PURE__ */ n.jsx(w, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className: u, children: "更多" }) }, 5)
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return t;
|
|
82
|
-
}, [
|
|
83
|
-
if (!(
|
|
82
|
+
}, [o, l]), k = C(() => {
|
|
83
|
+
if (!(r != null && r.length))
|
|
84
84
|
return;
|
|
85
|
-
const i =
|
|
86
|
-
|
|
85
|
+
const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
|
|
86
|
+
b,
|
|
87
87
|
{
|
|
88
|
-
className:
|
|
89
|
-
skeletonCls:
|
|
88
|
+
className: h,
|
|
89
|
+
skeletonCls: g,
|
|
90
90
|
children: t == null ? void 0 : t.label
|
|
91
91
|
},
|
|
92
92
|
e
|
|
93
|
-
)),
|
|
94
|
-
let
|
|
93
|
+
)), c = r.map((t, e) => {
|
|
94
|
+
let s = /* @__PURE__ */ n.jsx(
|
|
95
95
|
x,
|
|
96
96
|
{
|
|
97
97
|
type: "text",
|
|
98
|
-
className: t.danger ?
|
|
98
|
+
className: t.danger ? a : d,
|
|
99
99
|
onClick: t.onClick,
|
|
100
100
|
children: t == null ? void 0 : t.label
|
|
101
101
|
},
|
|
102
102
|
e
|
|
103
103
|
);
|
|
104
|
-
t.type === "secondary" && (
|
|
104
|
+
t.type === "secondary" && (s = /* @__PURE__ */ n.jsx(
|
|
105
105
|
x,
|
|
106
106
|
{
|
|
107
107
|
type: "text",
|
|
108
|
-
className:
|
|
108
|
+
className: u,
|
|
109
109
|
onClick: t.onClick,
|
|
110
110
|
children: t == null ? void 0 : t.label
|
|
111
111
|
},
|
|
112
112
|
e
|
|
113
113
|
));
|
|
114
|
-
const
|
|
115
|
-
return
|
|
114
|
+
const N = t.render ?? ((z, S) => /* @__PURE__ */ n.jsx(M, { children: z }, S));
|
|
115
|
+
return N == null ? void 0 : N(s, e);
|
|
116
116
|
});
|
|
117
|
-
return
|
|
118
|
-
}, [
|
|
117
|
+
return o ? i : c;
|
|
118
|
+
}, [o, r]);
|
|
119
119
|
return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), children: [
|
|
120
|
-
/* @__PURE__ */ n.jsx(I, { size: H, ref:
|
|
121
|
-
/* @__PURE__ */ n.jsx("div", { className:
|
|
120
|
+
/* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
|
|
121
|
+
/* @__PURE__ */ n.jsx("div", { className: B })
|
|
122
122
|
] });
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
|
-
function $(
|
|
126
|
-
var
|
|
127
|
-
const { actionGroup: l, loading:
|
|
128
|
-
return
|
|
129
|
-
width: Math.floor(
|
|
125
|
+
function $(m) {
|
|
126
|
+
var h;
|
|
127
|
+
const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m, o = ((h = P.useToken().token.Table) == null ? void 0 : h.cellPaddingInline) ?? O, d = D(null), a = T(d), u = C(() => a != null && a.width ? a.width + o * 2 + 1 : f ?? 141, [a, o, f]);
|
|
128
|
+
return C(() => ({
|
|
129
|
+
width: Math.floor(u),
|
|
130
130
|
mobileHide: !0,
|
|
131
131
|
isOperationCol: !0,
|
|
132
132
|
title: "操作",
|
|
@@ -135,23 +135,23 @@ function $(c) {
|
|
|
135
135
|
dataIndex: "operationCol",
|
|
136
136
|
className: "operationCol",
|
|
137
137
|
disabled: !0,
|
|
138
|
-
render: (g,
|
|
139
|
-
var
|
|
140
|
-
const
|
|
138
|
+
render: (g, j, k) => {
|
|
139
|
+
var t, e;
|
|
140
|
+
const i = ((t = p == null ? void 0 : p(j, k)) == null ? void 0 : t.filter((s) => s.type != "detail")) ?? [], c = ((e = l == null ? void 0 : l(j, k)) == null ? void 0 : e.filter((s) => s.type != "detail")) ?? [];
|
|
141
141
|
return /* @__PURE__ */ n.jsx(
|
|
142
|
-
|
|
142
|
+
_,
|
|
143
143
|
{
|
|
144
|
-
actionGroup:
|
|
145
|
-
customActions:
|
|
146
|
-
loading:
|
|
147
|
-
ref:
|
|
144
|
+
actionGroup: c,
|
|
145
|
+
customActions: i,
|
|
146
|
+
loading: r,
|
|
147
|
+
ref: d
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
|
-
...
|
|
152
|
-
}), [
|
|
151
|
+
...y
|
|
152
|
+
}), [u, d, r, l, p]);
|
|
153
153
|
}
|
|
154
154
|
export {
|
|
155
|
-
|
|
155
|
+
_ as BitzTableAction,
|
|
156
156
|
$ as default
|
|
157
157
|
};
|
|
@@ -18,7 +18,7 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
18
18
|
showPagination?: boolean;
|
|
19
19
|
/** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
|
|
20
20
|
height?: number;
|
|
21
|
-
/** PC端:当height小于minHeight时使用minHeight */
|
|
21
|
+
/** PC端:当height小于minHeight时使用minHeight替代height */
|
|
22
22
|
minHeight?: number;
|
|
23
23
|
/** table可滚动区域的最大宽高的值 */
|
|
24
24
|
scroll?: {
|