bitz-react-admin-ui 2.5.1 → 2.5.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.
|
@@ -1,132 +1,82 @@
|
|
|
1
1
|
import { j as n } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { Space as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "../index.mjs";
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
paragraph: {
|
|
23
|
-
rows: 1,
|
|
24
|
-
width: "100%"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
] }), _ = E(
|
|
29
|
-
({ loading: m, actionGroup: l, customActions: r }, p) => {
|
|
30
|
-
const { loading: f, fullscreen: y } = L(W), a = C(() => m ?? f, [m, f]), {
|
|
31
|
-
primaryBtnClassName: d,
|
|
32
|
-
dangerBtnClassName: o,
|
|
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
|
-
t.push(
|
|
41
|
-
a ? /* @__PURE__ */ n.jsx(
|
|
42
|
-
b,
|
|
43
|
-
{
|
|
44
|
-
className: h,
|
|
45
|
-
skeletonCls: g,
|
|
46
|
-
children: e == null ? void 0 : e.label
|
|
47
|
-
},
|
|
48
|
-
s
|
|
49
|
-
) : e.children ? /* @__PURE__ */ n.jsx(w, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
|
|
50
|
-
x,
|
|
2
|
+
import B from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
|
|
3
|
+
import { Space as w, theme as z } from "antd";
|
|
4
|
+
import { forwardRef as I, useMemo as x, Fragment as R, useRef as T } from "react";
|
|
5
|
+
import p from "../../BitzButton/index.mjs";
|
|
6
|
+
import P, { actionColBtnGap as S } from "./style.mjs";
|
|
7
|
+
import N from "../Dropdown/index.mjs";
|
|
8
|
+
import { tablePaddingInline as E } from "../../BitzConfigProvider/context.mjs";
|
|
9
|
+
const M = I(
|
|
10
|
+
({ actionGroup: s, customActions: l }, b) => {
|
|
11
|
+
const {
|
|
12
|
+
primaryBtnClassName: a,
|
|
13
|
+
dangerBtnClassName: c,
|
|
14
|
+
secondaryBtnClassName: h,
|
|
15
|
+
maskClassName: f
|
|
16
|
+
} = P(), m = x(() => {
|
|
17
|
+
const i = s.length >= 4 ? 2 : s.length, t = s.slice(0, i), r = [];
|
|
18
|
+
if (t != null && t.length && t.forEach((e, o) => {
|
|
19
|
+
r.push(
|
|
20
|
+
e.children ? /* @__PURE__ */ n.jsx(N, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
|
|
21
|
+
p,
|
|
51
22
|
{
|
|
52
23
|
type: "text",
|
|
53
|
-
className: e.danger ?
|
|
24
|
+
className: e.danger ? c : a,
|
|
54
25
|
children: e == null ? void 0 : e.label
|
|
55
26
|
}
|
|
56
|
-
) },
|
|
57
|
-
|
|
27
|
+
) }, o) : /* @__PURE__ */ n.jsx(
|
|
28
|
+
p,
|
|
58
29
|
{
|
|
59
30
|
type: "text",
|
|
60
|
-
className: e.danger ?
|
|
31
|
+
className: e.danger ? c : a,
|
|
61
32
|
onClick: e == null ? void 0 : e.onClick,
|
|
62
33
|
children: e == null ? void 0 : e.label
|
|
63
34
|
},
|
|
64
|
-
|
|
35
|
+
o
|
|
65
36
|
)
|
|
66
37
|
);
|
|
67
|
-
}), i === 2 &&
|
|
68
|
-
const e =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
b,
|
|
72
|
-
{
|
|
73
|
-
className: h,
|
|
74
|
-
skeletonCls: g,
|
|
75
|
-
children: "更多"
|
|
76
|
-
},
|
|
77
|
-
5
|
|
78
|
-
) : /* @__PURE__ */ n.jsx(w, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(x, { type: "text", className: u, children: "更多" }) }, 5)
|
|
38
|
+
}), i === 2 && s.length >= 4) {
|
|
39
|
+
const e = s.slice(2, s.length);
|
|
40
|
+
r.push(
|
|
41
|
+
/* @__PURE__ */ n.jsx(N, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(p, { type: "text", className: h, children: "更多" }) }, 5)
|
|
79
42
|
);
|
|
80
43
|
}
|
|
81
|
-
return
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
|
|
86
|
-
b,
|
|
44
|
+
return r;
|
|
45
|
+
}, [s]), d = x(() => l != null && l.length ? l.map((t, r) => {
|
|
46
|
+
let e = /* @__PURE__ */ n.jsx(
|
|
47
|
+
p,
|
|
87
48
|
{
|
|
49
|
+
type: "text",
|
|
50
|
+
className: t.danger ? c : a,
|
|
51
|
+
onClick: t.onClick,
|
|
52
|
+
children: t == null ? void 0 : t.label
|
|
53
|
+
},
|
|
54
|
+
r
|
|
55
|
+
);
|
|
56
|
+
t.type === "secondary" && (e = /* @__PURE__ */ n.jsx(
|
|
57
|
+
p,
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
88
60
|
className: h,
|
|
89
|
-
|
|
61
|
+
onClick: t.onClick,
|
|
90
62
|
children: t == null ? void 0 : t.label
|
|
91
63
|
},
|
|
92
|
-
|
|
93
|
-
))
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
type: "text",
|
|
98
|
-
className: t.danger ? o : d,
|
|
99
|
-
onClick: t.onClick,
|
|
100
|
-
children: t == null ? void 0 : t.label
|
|
101
|
-
},
|
|
102
|
-
e
|
|
103
|
-
);
|
|
104
|
-
t.type === "secondary" && (s = /* @__PURE__ */ n.jsx(
|
|
105
|
-
x,
|
|
106
|
-
{
|
|
107
|
-
type: "text",
|
|
108
|
-
className: u,
|
|
109
|
-
onClick: t.onClick,
|
|
110
|
-
children: t == null ? void 0 : t.label
|
|
111
|
-
},
|
|
112
|
-
e
|
|
113
|
-
));
|
|
114
|
-
const N = t.render ?? ((z, S) => /* @__PURE__ */ n.jsx(M, { children: z }, S));
|
|
115
|
-
return N == null ? void 0 : N(s, e);
|
|
116
|
-
});
|
|
117
|
-
return a ? i : c;
|
|
118
|
-
}, [a, r]);
|
|
64
|
+
r
|
|
65
|
+
));
|
|
66
|
+
const o = t.render ?? ((u, g) => /* @__PURE__ */ n.jsx(R, { children: u }, g));
|
|
67
|
+
return o == null ? void 0 : o(e, r);
|
|
68
|
+
}) : void 0, [l]);
|
|
119
69
|
return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), style: { overflow: "hidden" }, children: [
|
|
120
|
-
/* @__PURE__ */ n.jsx(
|
|
121
|
-
/* @__PURE__ */ n.jsx("div", { className:
|
|
70
|
+
/* @__PURE__ */ n.jsx(w, { size: S, ref: b, className: "actionGroup", children: d ?? m }),
|
|
71
|
+
/* @__PURE__ */ n.jsx("div", { className: f })
|
|
122
72
|
] });
|
|
123
73
|
}
|
|
124
74
|
);
|
|
125
|
-
function
|
|
126
|
-
var
|
|
127
|
-
const { actionGroup: l, loading:
|
|
128
|
-
return
|
|
129
|
-
width: Math.floor(
|
|
75
|
+
function J(s) {
|
|
76
|
+
var r;
|
|
77
|
+
const { actionGroup: l, loading: b, customActions: a, defaultWidth: c, ...h } = s, f = ((r = z.useToken().token.Table) == null ? void 0 : r.cellPaddingInline) ?? E, m = T(null), d = B(m), i = x(() => d != null && d.width ? d.width + f * 2 + 1 : c ?? 141, [d, f, c]);
|
|
78
|
+
return x(() => ({
|
|
79
|
+
width: Math.floor(i),
|
|
130
80
|
mobileHide: !0,
|
|
131
81
|
isOperationCol: !0,
|
|
132
82
|
title: "操作",
|
|
@@ -135,23 +85,22 @@ function $(m) {
|
|
|
135
85
|
dataIndex: "operationCol",
|
|
136
86
|
className: "operationCol",
|
|
137
87
|
disabled: !0,
|
|
138
|
-
render: (
|
|
139
|
-
var
|
|
140
|
-
const
|
|
88
|
+
render: (e, o, u) => {
|
|
89
|
+
var j, y;
|
|
90
|
+
const g = ((j = a == null ? void 0 : a(o, u)) == null ? void 0 : j.filter((C) => C.type != "detail")) ?? [], k = ((y = l == null ? void 0 : l(o, u)) == null ? void 0 : y.filter((C) => C.type != "detail")) ?? [];
|
|
141
91
|
return /* @__PURE__ */ n.jsx(
|
|
142
|
-
|
|
92
|
+
M,
|
|
143
93
|
{
|
|
144
|
-
actionGroup:
|
|
145
|
-
customActions:
|
|
146
|
-
|
|
147
|
-
ref: d
|
|
94
|
+
actionGroup: k,
|
|
95
|
+
customActions: g,
|
|
96
|
+
ref: m
|
|
148
97
|
}
|
|
149
98
|
);
|
|
150
99
|
},
|
|
151
|
-
...
|
|
152
|
-
}), [
|
|
100
|
+
...h
|
|
101
|
+
}), [i, m, l, a]);
|
|
153
102
|
}
|
|
154
103
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
104
|
+
M as BitzTableAction,
|
|
105
|
+
J as default
|
|
157
106
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { TableProps } from 'antd';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
interface SortTableContextProps {
|
|
3
4
|
children?: ReactNode;
|
|
4
5
|
enabledRowDragSort?: boolean;
|
|
5
6
|
dataSource: any[];
|
|
6
|
-
mergeRowKey:
|
|
7
|
+
mergeRowKey: TableProps['rowKey'];
|
|
7
8
|
onDragEnd: (newCols: any[]) => void;
|
|
8
9
|
}
|
|
9
10
|
declare function SortTableContext({ children, enabledRowDragSort, dataSource, mergeRowKey, onDragEnd: dragEndEmit, }: SortTableContextProps): import("react/jsx-runtime").JSX.Element;
|