bitz-react-admin-ui 2.6.1 → 2.6.2
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/context.d.ts +7 -1
- package/dist/components/BitzTable/ActionCol/index.mjs +73 -73
- package/dist/components/BitzTable/Store/index.d.ts +30 -0
- package/dist/components/BitzTable/Store/index.mjs +246 -217
- package/dist/components/BitzTable/Store/utils/index.d.ts +1 -1
- package/dist/components/BitzTable/Store/utils/index.mjs +12 -12
- package/dist/components/BitzTable/Table/index.d.ts +9 -1
- package/dist/components/BitzTable/Table/index.mjs +429 -398
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +103 -95
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +2 -1
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +243 -197
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +141 -105
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.d.ts +8 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.mjs +23 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +127 -74
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +76 -25
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +151 -96
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +29 -27
- package/dist/components/BitzTable/ToolBar/Modal/index.mjs +19 -9
- package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +4 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.mjs +42 -14
- package/dist/components/BitzTable/index.d.ts +2 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/debounce.mjs +34 -37
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useDebounceFn/index.mjs +0 -29
- package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/utils/lodash-polyfill.mjs +0 -7
|
@@ -1,138 +1,146 @@
|
|
|
1
1
|
import { j as t } from "../../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import { Card as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { BitzTableContext as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { BitzConfigContext as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { Card as ue, Flex as G, Segmented as ge, message as I } from "antd";
|
|
3
|
+
import { useState as f, useContext as W, useRef as l, useMemo as pe, useEffect as $ } from "react";
|
|
4
|
+
import { BitzTableContext as de } from "../../Store/index.mjs";
|
|
5
|
+
import q from "../../../BitzButton/index.mjs";
|
|
6
|
+
import he from "../../../BitzTheme/index.mjs";
|
|
7
|
+
import xe from "./StylesConfig/index.mjs";
|
|
8
|
+
import ye from "./ColumnsSort/index.mjs";
|
|
9
|
+
import Ce from "./ExportConfig/index.mjs";
|
|
10
|
+
import { BitzConfigContext as Se } from "../../../BitzConfigProvider/context.mjs";
|
|
11
|
+
import He from "../Modal/index.mjs";
|
|
12
|
+
import { blockGap as J, modalHeaderHeight as P, modalFooterHeight as Q } from "../Modal/style.mjs";
|
|
13
|
+
import je from "../../../../node_modules/.store/@ant-design_icons@5.3.7/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
|
|
14
|
+
import Ee from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
|
|
15
|
+
const Te = "导出设置", Ae = ({
|
|
16
|
+
open: p,
|
|
17
|
+
title: U,
|
|
18
|
+
onChange: u,
|
|
19
|
+
close: g,
|
|
20
|
+
getContainer: X
|
|
20
21
|
}) => {
|
|
21
|
-
const { token:
|
|
22
|
-
|
|
23
|
-
const [
|
|
24
|
-
persistenceType:
|
|
25
|
-
persistenceKey:
|
|
26
|
-
onlineChange:
|
|
27
|
-
setColumnsMap:
|
|
28
|
-
stylesStorageType:
|
|
29
|
-
stylesStorageKey:
|
|
30
|
-
setTableStylesConfig:
|
|
31
|
-
onlineStylesConfigChange:
|
|
32
|
-
defaultTableExportConfig:
|
|
33
|
-
exportStorageType:
|
|
34
|
-
exportStorageKey:
|
|
35
|
-
setTableExportConfig:
|
|
22
|
+
const { token: b } = he.useToken(), [n, i] = f(-1), [Y, d] = f(!1);
|
|
23
|
+
f(!1);
|
|
24
|
+
const [Z, c] = f(!1), {
|
|
25
|
+
persistenceType: _,
|
|
26
|
+
persistenceKey: k,
|
|
27
|
+
onlineChange: h,
|
|
28
|
+
setColumnsMap: ee,
|
|
29
|
+
stylesStorageType: te,
|
|
30
|
+
stylesStorageKey: v,
|
|
31
|
+
setTableStylesConfig: x,
|
|
32
|
+
onlineStylesConfigChange: y,
|
|
33
|
+
defaultTableExportConfig: oe,
|
|
34
|
+
exportStorageType: re,
|
|
35
|
+
exportStorageKey: w,
|
|
36
|
+
setTableExportConfig: se,
|
|
36
37
|
onlineExportConfigChange: C
|
|
37
|
-
} =
|
|
38
|
-
var K, M, O, V,
|
|
39
|
-
if (
|
|
38
|
+
} = W(de), a = W(Se).Table, m = l(null), B = l(null), S = l(null), ne = async () => {
|
|
39
|
+
var F, K, M, O, V, N, L, A, D;
|
|
40
|
+
if (Z)
|
|
40
41
|
return;
|
|
41
|
-
|
|
42
|
-
const e = (
|
|
42
|
+
c(!0);
|
|
43
|
+
const e = (F = m.current) == null ? void 0 : F.getCheckedKeys();
|
|
43
44
|
if (!(e != null && e.length)) {
|
|
44
|
-
|
|
45
|
+
i(2), I.error("表格至少需要显示一列"), c(!1);
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
if (!((
|
|
48
|
-
|
|
48
|
+
if (!((K = S.current) == null ? void 0 : K.hasOne())) {
|
|
49
|
+
i(3), I.error("导出设置至少需要一个字段"), c(!1);
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
...(
|
|
53
|
-
...(
|
|
54
|
-
...(
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})) :
|
|
52
|
+
const o = (M = B.current) == null ? void 0 : M.getFormInstance(), s = await (o == null ? void 0 : o.getFieldsValue()), fe = Ee(s, "stylesScope"), T = {
|
|
53
|
+
...(O = m.current) == null ? void 0 : O.getLeftSortColumns(),
|
|
54
|
+
...(V = m.current) == null ? void 0 : V.getCenterSortColumns(),
|
|
55
|
+
...(N = m.current) == null ? void 0 : N.getRightSortColumns()
|
|
56
|
+
}, R = ((L = S.current) == null ? void 0 : L.getExportConfig()) ?? oe;
|
|
57
|
+
x == null || x(fe), (A = a == null ? void 0 : a.setStylesScope) == null || A.call(a, s.stylesScope ? "global" : "current"), ee(T), se(R), te === "online" && v && (y == null || y(v, s)), _ === "online" && k && (h == null || h(k, T)), re === "online" && w && (C == null || C(w, R)), c(!1), u ? (d(!0), (D = u == null ? void 0 : u(s, T, R)) == null || D.finally(() => {
|
|
58
|
+
d(!1), g();
|
|
59
|
+
})) : g();
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
},
|
|
61
|
+
pe(() => b.mode === "dark", [b.mode]);
|
|
62
|
+
const le = () => {
|
|
63
|
+
i(-1), d(!1), c(!1);
|
|
64
|
+
}, ie = (e) => {
|
|
65
|
+
i(e), H.current.parentElement.scrollTop = 0;
|
|
66
|
+
}, H = l(null), j = l(null), [ce, ae] = f("auto"), E = l({
|
|
64
67
|
1: 0,
|
|
65
68
|
2: 0,
|
|
66
69
|
3: 0
|
|
67
|
-
}),
|
|
68
|
-
|
|
70
|
+
}), me = () => {
|
|
71
|
+
var o;
|
|
72
|
+
const e = (o = j.current) == null ? void 0 : o.clientHeight, r = window.innerHeight - J - P - Q - 48 - e - 32;
|
|
73
|
+
E.current[2] = window.innerHeight - J, ae(r);
|
|
74
|
+
}, z = (e, r) => {
|
|
75
|
+
var s;
|
|
76
|
+
const o = (s = j.current) == null ? void 0 : s.clientHeight;
|
|
77
|
+
E.current[r] = P + Q + 48 + 32 + o + e;
|
|
69
78
|
};
|
|
70
|
-
return
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
|
|
78
|
-
}, [d]), /* @__PURE__ */ t.jsx(
|
|
79
|
-
de,
|
|
79
|
+
return $(() => {
|
|
80
|
+
var r, o;
|
|
81
|
+
const e = (o = (r = H.current) == null ? void 0 : r.parentElement) == null ? void 0 : o.parentElement;
|
|
82
|
+
e && (e.style.height = `${E.current[n]}px`);
|
|
83
|
+
}, [n]), $(() => {
|
|
84
|
+
p && i(1);
|
|
85
|
+
}, [p]), /* @__PURE__ */ t.jsx(
|
|
86
|
+
He,
|
|
80
87
|
{
|
|
81
|
-
open:
|
|
82
|
-
title:
|
|
83
|
-
close:
|
|
84
|
-
closeAfter:
|
|
85
|
-
getContainer:
|
|
88
|
+
open: p,
|
|
89
|
+
title: U,
|
|
90
|
+
close: g,
|
|
91
|
+
closeAfter: le,
|
|
92
|
+
getContainer: X,
|
|
86
93
|
footer: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
87
94
|
/* @__PURE__ */ t.jsx(
|
|
88
|
-
|
|
95
|
+
q,
|
|
89
96
|
{
|
|
90
97
|
type: "primary",
|
|
91
|
-
icon: /* @__PURE__ */ t.jsx(
|
|
92
|
-
onClick:
|
|
93
|
-
loading:
|
|
98
|
+
icon: /* @__PURE__ */ t.jsx(je, {}),
|
|
99
|
+
onClick: ne,
|
|
100
|
+
loading: Y,
|
|
94
101
|
children: "保存"
|
|
95
102
|
}
|
|
96
103
|
),
|
|
97
|
-
/* @__PURE__ */ t.jsx(
|
|
104
|
+
/* @__PURE__ */ t.jsx(q, { onClick: g, children: "取消" })
|
|
98
105
|
] }),
|
|
99
|
-
children: /* @__PURE__ */ t.jsx(
|
|
100
|
-
/* @__PURE__ */ t.jsx("div", { ref:
|
|
101
|
-
|
|
106
|
+
children: /* @__PURE__ */ t.jsx(ue, { className: "container", bordered: !1, ref: H, children: /* @__PURE__ */ t.jsxs(G, { vertical: !0, align: "center", children: [
|
|
107
|
+
/* @__PURE__ */ t.jsx("div", { className: "segmentedWrapper", ref: j, children: /* @__PURE__ */ t.jsx(
|
|
108
|
+
ge,
|
|
102
109
|
{
|
|
103
110
|
size: "large",
|
|
104
111
|
options: [
|
|
105
112
|
{ label: "外观设置", value: 1 },
|
|
106
113
|
{ label: "列设置", value: 2 },
|
|
107
|
-
{ label:
|
|
114
|
+
{ label: Te, value: 3 }
|
|
108
115
|
],
|
|
109
|
-
value:
|
|
110
|
-
onChange:
|
|
116
|
+
value: n,
|
|
117
|
+
onChange: ie
|
|
111
118
|
}
|
|
112
119
|
) }),
|
|
113
|
-
/* @__PURE__ */ t.jsxs(
|
|
120
|
+
/* @__PURE__ */ t.jsxs(G, { className: "containerBody", children: [
|
|
114
121
|
/* @__PURE__ */ t.jsx(
|
|
115
|
-
|
|
122
|
+
xe,
|
|
116
123
|
{
|
|
117
|
-
ref:
|
|
118
|
-
postHeight: (e) =>
|
|
119
|
-
display:
|
|
124
|
+
ref: B,
|
|
125
|
+
postHeight: (e) => z(e, 1),
|
|
126
|
+
display: n === 1
|
|
120
127
|
}
|
|
121
128
|
),
|
|
122
129
|
/* @__PURE__ */ t.jsx(
|
|
123
|
-
|
|
130
|
+
ye,
|
|
124
131
|
{
|
|
125
|
-
ref:
|
|
126
|
-
postHeight:
|
|
127
|
-
|
|
132
|
+
ref: m,
|
|
133
|
+
postHeight: me,
|
|
134
|
+
height: ce,
|
|
135
|
+
display: n === 2
|
|
128
136
|
}
|
|
129
137
|
),
|
|
130
138
|
/* @__PURE__ */ t.jsx(
|
|
131
|
-
|
|
139
|
+
Ce,
|
|
132
140
|
{
|
|
133
141
|
refInstance: S,
|
|
134
|
-
postHeight: (e) =>
|
|
135
|
-
display:
|
|
142
|
+
postHeight: (e) => z(e, 3),
|
|
143
|
+
display: n === 3,
|
|
136
144
|
showSelectRadio: !1
|
|
137
145
|
}
|
|
138
146
|
)
|
|
@@ -142,6 +150,6 @@ const ye = "导出设置", Fe = ({
|
|
|
142
150
|
);
|
|
143
151
|
};
|
|
144
152
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
153
|
+
Ae as default,
|
|
154
|
+
Te as exportConfigTitle
|
|
147
155
|
};
|