bitz-react-admin-ui 2.1.7 → 2.1.9
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 +6 -0
- package/dist/components/BitzConfigProvider/index.d.ts +2 -0
- package/dist/components/BitzTable/SubTable/index.d.ts +21 -0
- package/dist/components/BitzTable/SubTable/index.mjs +165 -0
- package/dist/components/BitzTable/Table/index.mjs +135 -134
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +5 -5
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +18 -10
- package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.mjs +57 -76
- package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +41 -55
- package/dist/components/BitzTable/ToolBar/ExportIcon/styles.d.ts +3 -0
- package/dist/components/BitzTable/ToolBar/ExportIcon/styles.mjs +47 -0
- package/dist/components/BitzTable/ToolBar/index.d.ts +1 -1
- package/dist/components/BitzTable/index.d.ts +2 -0
- package/dist/components/BitzTable/index.mjs +13 -11
- package/dist/components/BitzTableSelect/SelectPopup/getData.mjs +15 -14
- package/dist/components/BitzTableSelect/SelectPopup/index.mjs +82 -80
- package/dist/components/BitzTableSelect/TableCell/index.mjs +25 -23
- package/dist/components/BitzTableSelect/TextBlock/index.mjs +17 -16
- package/dist/components/BitzTableSelect/index.d.ts +1 -0
- package/dist/components/BitzTableSelect/index.mjs +33 -31
- package/dist/style.css +1 -1
- package/dist/utils/WithFluent.mjs +16 -12
- package/package.json +1 -1
|
@@ -1,97 +1,78 @@
|
|
|
1
1
|
import { j as e } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const { Option:
|
|
7
|
-
onClick:
|
|
2
|
+
import { Tooltip as h, Flex as y, Typography as i, InputNumber as S, Select as g } from "antd";
|
|
3
|
+
import { useState as s } from "react";
|
|
4
|
+
import j from "../../Select/index.mjs";
|
|
5
|
+
import { selectStyles as b, inputNumberStyles as T } from "./styles.mjs";
|
|
6
|
+
const { Option: r } = g, V = ({
|
|
7
|
+
onClick: p,
|
|
8
8
|
onClose: c
|
|
9
9
|
}) => {
|
|
10
|
-
const [
|
|
11
|
-
if (!
|
|
10
|
+
const [u, a] = s(!1), [f, l] = s(!1), [o, m] = s("page"), [t, d] = s(1), x = () => {
|
|
11
|
+
if (!f) {
|
|
12
12
|
if (!t && typeof t != "number" || t <= 0) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
l(!0), a(!0), setTimeout(() => {
|
|
14
|
+
a(!1), l(!1);
|
|
15
15
|
}, 2e3);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
l(!0), p("any", { value: t, type: o }), c();
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
return /* @__PURE__ */ e.jsx(
|
|
22
|
-
|
|
22
|
+
h,
|
|
23
23
|
{
|
|
24
|
-
open:
|
|
24
|
+
open: u,
|
|
25
25
|
title: "数字必须大于等于1",
|
|
26
26
|
getTooltipContainer: (n) => n.parentElement.parentElement.parentElement,
|
|
27
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
addonAfter: /* @__PURE__ */ e.jsxs(
|
|
39
|
-
y,
|
|
27
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
28
|
+
y,
|
|
29
|
+
{
|
|
30
|
+
align: "center",
|
|
31
|
+
gap: 8,
|
|
32
|
+
onClick: (n) => n.stopPropagation(),
|
|
33
|
+
style: { padding: "5px 12px" },
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ e.jsx(i.Text, { style: { fontSize: "var(--fontSize)" }, children: "导出" }),
|
|
36
|
+
/* @__PURE__ */ e.jsx(
|
|
37
|
+
S,
|
|
40
38
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
controls: !1,
|
|
40
|
+
min: 1,
|
|
41
|
+
value: t,
|
|
42
|
+
onChange: (n) => d(n),
|
|
43
|
+
style: { width: 100 },
|
|
44
|
+
size: "small",
|
|
45
|
+
addonAfter: /* @__PURE__ */ e.jsxs(
|
|
46
|
+
j,
|
|
47
|
+
{
|
|
48
|
+
value: o,
|
|
49
|
+
onChange: m,
|
|
50
|
+
className: b,
|
|
51
|
+
popupMatchSelectWidth: !1,
|
|
52
|
+
suffixIcon: !1,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ e.jsx(r, { value: "page", children: "页" }),
|
|
55
|
+
/* @__PURE__ */ e.jsx(r, { value: "pieces", children: "条" })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
className: T
|
|
62
60
|
}
|
|
63
61
|
),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
box-shadow: none;
|
|
76
|
-
}
|
|
77
|
-
.ant-input-number-group-addon {
|
|
78
|
-
width: auto;
|
|
79
|
-
}
|
|
80
|
-
`
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ e.jsx(
|
|
84
|
-
l.Link,
|
|
85
|
-
{
|
|
86
|
-
style: { userSelect: "none", fontSize: "var(--fontSize)" },
|
|
87
|
-
onClick: x,
|
|
88
|
-
children: "下载"
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
] })
|
|
62
|
+
/* @__PURE__ */ e.jsx(
|
|
63
|
+
i.Link,
|
|
64
|
+
{
|
|
65
|
+
style: { userSelect: "none", fontSize: "var(--fontSize)" },
|
|
66
|
+
onClick: x,
|
|
67
|
+
children: "下载"
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
92
73
|
}
|
|
93
74
|
);
|
|
94
75
|
};
|
|
95
76
|
export {
|
|
96
|
-
|
|
77
|
+
V as default
|
|
97
78
|
};
|
|
@@ -1,76 +1,62 @@
|
|
|
1
1
|
import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { memo as x, useState as y, useContext as d } from "react";
|
|
3
|
+
import c from "../style.mjs";
|
|
4
|
+
import b from "../../../BitzButton/index.mjs";
|
|
5
|
+
import g from "../../Dropdown/index.mjs";
|
|
6
|
+
import j from "./AnyDataTotalLabel.mjs";
|
|
7
|
+
import { BitzTableContext as E } from "../../Store/index.mjs";
|
|
8
|
+
import { overlayStyles as N } from "./styles.mjs";
|
|
9
|
+
import O from "../../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/DownloadOutlined.mjs";
|
|
10
|
+
const h = ({
|
|
11
|
+
show: n = !0,
|
|
12
|
+
order: s,
|
|
12
13
|
loading: m,
|
|
13
14
|
onClick: e,
|
|
14
|
-
icon: l = /* @__PURE__ */ o.jsx(
|
|
15
|
+
icon: l = /* @__PURE__ */ o.jsx(O, {})
|
|
15
16
|
}) => {
|
|
16
|
-
const { toolbarItemClassName:
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const { toolbarItemClassName: p } = c(), [i, r] = y(!1), a = d(E).exportConfig, u = [
|
|
18
|
+
{ key: "current", label: "仅导出当前页" },
|
|
19
|
+
{ key: "all", label: "导出全部数据" },
|
|
20
|
+
{ type: "divider" },
|
|
19
21
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{ type: "divider" },
|
|
27
|
-
{
|
|
28
|
-
key: "any",
|
|
29
|
-
label: /* @__PURE__ */ o.jsx(
|
|
30
|
-
c,
|
|
31
|
-
{
|
|
32
|
-
onClick: (t, i) => e == null ? void 0 : e(t, i),
|
|
33
|
-
onClose: () => r(!1)
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
className: "anyTotal"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
onClick: ({ key: t }) => e == null ? void 0 : e(t)
|
|
40
|
-
},
|
|
41
|
-
overlayClassName: b`
|
|
42
|
-
.ant-dropdown-menu.ant-dropdown-menu-root {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
|
|
46
|
-
.anyTotal {
|
|
47
|
-
cursor: default !important;
|
|
48
|
-
margin: 5px 12px;
|
|
49
|
-
padding: 0;
|
|
50
|
-
|
|
51
|
-
&:hover {
|
|
52
|
-
background-color: inherit !important;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
22
|
+
key: "any",
|
|
23
|
+
label: /* @__PURE__ */ o.jsx(
|
|
24
|
+
j,
|
|
25
|
+
{
|
|
26
|
+
onClick: (t, f) => e == null ? void 0 : e(t, a, f),
|
|
27
|
+
onClose: () => r(!1)
|
|
55
28
|
}
|
|
56
|
-
|
|
29
|
+
),
|
|
30
|
+
className: "anyTotal"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
return n ? /* @__PURE__ */ o.jsx(
|
|
34
|
+
g,
|
|
35
|
+
{
|
|
36
|
+
open: i,
|
|
37
|
+
onOpenChange: r,
|
|
38
|
+
overlayClassName: N,
|
|
57
39
|
trigger: ["click"],
|
|
58
40
|
disabled: m,
|
|
59
41
|
destroyPopupOnHide: !0,
|
|
60
42
|
getPopupContainer: (t) => t.parentElement.parentElement.parentElement,
|
|
43
|
+
menu: {
|
|
44
|
+
items: u,
|
|
45
|
+
onClick: ({ key: t }) => e == null ? void 0 : e(t, a)
|
|
46
|
+
},
|
|
61
47
|
children: /* @__PURE__ */ o.jsx(
|
|
62
|
-
|
|
48
|
+
b,
|
|
63
49
|
{
|
|
64
50
|
type: "text",
|
|
65
|
-
className:
|
|
51
|
+
className: p,
|
|
66
52
|
icon: l,
|
|
67
|
-
style: { order:
|
|
53
|
+
style: { order: s },
|
|
68
54
|
children: "下载"
|
|
69
55
|
}
|
|
70
56
|
)
|
|
71
57
|
}
|
|
72
58
|
) : null;
|
|
73
|
-
},
|
|
59
|
+
}, P = x(h);
|
|
74
60
|
export {
|
|
75
|
-
|
|
61
|
+
P as default
|
|
76
62
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css as t } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
|
|
2
|
+
const a = t`
|
|
3
|
+
.anyTotal {
|
|
4
|
+
cursor: default !important;
|
|
5
|
+
padding: 0 !important;
|
|
6
|
+
|
|
7
|
+
&:hover {
|
|
8
|
+
background-color: inherit !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`, e = t`
|
|
12
|
+
width: auto;
|
|
13
|
+
height: calc(var(--fontSize) + 12px);
|
|
14
|
+
|
|
15
|
+
.ant-select-selection-item {
|
|
16
|
+
padding-right: 0 !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ant-select-selector {
|
|
20
|
+
width: auto !important;
|
|
21
|
+
padding-inline: 8px !important;
|
|
22
|
+
}
|
|
23
|
+
`, i = t`
|
|
24
|
+
.ant-input-number-group-wrapper {
|
|
25
|
+
height: calc(var(--fontSize) + 12px);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ant-input-number-wrapper,
|
|
29
|
+
.ant-input-number,
|
|
30
|
+
.ant-input-number-input-wrap,
|
|
31
|
+
.ant-input-number-input {
|
|
32
|
+
height: 100% !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ant-input-number {
|
|
36
|
+
box-shadow: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ant-input-number-group-addon {
|
|
40
|
+
width: auto;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
export {
|
|
44
|
+
i as inputNumberStyles,
|
|
45
|
+
a as overlayStyles,
|
|
46
|
+
e as selectStyles
|
|
47
|
+
};
|
|
@@ -3,7 +3,7 @@ import { MouseEventHandler } from 'react';
|
|
|
3
3
|
import { ToolEnum } from '../../../components/BitzConfigProvider/context';
|
|
4
4
|
import { ColumnsConfigProps } from '..';
|
|
5
5
|
export type MenuKeysType = 'current' | 'all' | 'any';
|
|
6
|
-
export type ExportEvent = (key: MenuKeysType, info?: {
|
|
6
|
+
export type ExportEvent = (key: MenuKeysType, exportConfig: ExportConfigProps[], info?: {
|
|
7
7
|
value: number;
|
|
8
8
|
type: 'page' | 'pieces';
|
|
9
9
|
}) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BitzTableProps } from './Table';
|
|
2
2
|
import BitzTableProvider, { BitzTableContext, DensitySize as BitzTableSizeType, StylesStateType, ColumnStateType, ExportColumnStateType } from './Store';
|
|
3
|
+
import SubTable from './SubTable';
|
|
3
4
|
import ActionBar from './ActionBar';
|
|
4
5
|
import ToolBar from './ToolBar/Wrapper';
|
|
5
6
|
import ActionCol from './ActionCol';
|
|
@@ -60,6 +61,7 @@ interface BitzTableColumnGroupType<RecordType> extends Omit<BitzTableColumnType<
|
|
|
60
61
|
}
|
|
61
62
|
type BitzTableColumnsType<RecordType> = (BitzTableColumnType<RecordType> | BitzTableColumnGroupType<RecordType>)[];
|
|
62
63
|
type CompoundedComponent = React.ForwardRefExoticComponent<BitzTableProps> & {
|
|
64
|
+
SubTable: typeof SubTable;
|
|
63
65
|
ActionBar: typeof ActionBar;
|
|
64
66
|
ToolBar: typeof ToolBar;
|
|
65
67
|
SelectionBar: typeof SelectionBar;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import t from "./Table/index.mjs";
|
|
2
|
-
import { BitzTableContext as
|
|
3
|
-
import r from "./
|
|
4
|
-
import i from "./
|
|
5
|
-
import e from "./
|
|
6
|
-
import a from "./
|
|
2
|
+
import { BitzTableContext as z, default as d } from "./Store/index.mjs";
|
|
3
|
+
import r from "./SubTable/index.mjs";
|
|
4
|
+
import i from "./ActionBar/index.mjs";
|
|
5
|
+
import e from "./ToolBar/Wrapper/index.mjs";
|
|
6
|
+
import a from "./ActionCol/index.mjs";
|
|
7
|
+
import l from "./SelectionBar/index.mjs";
|
|
7
8
|
const o = t;
|
|
8
9
|
process.env.NODE_ENV !== "production" && (o.displayName = "BitzTable");
|
|
9
|
-
o.
|
|
10
|
-
o.
|
|
11
|
-
o.
|
|
12
|
-
o.
|
|
10
|
+
o.SubTable = r;
|
|
11
|
+
o.ActionBar = i;
|
|
12
|
+
o.ToolBar = e;
|
|
13
|
+
o.SelectionBar = l;
|
|
14
|
+
o.ActionCol = a;
|
|
13
15
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
z as BitzTableContext,
|
|
17
|
+
d as BitzTableProvider,
|
|
16
18
|
o as default
|
|
17
19
|
};
|
|
@@ -2,12 +2,13 @@ import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/r
|
|
|
2
2
|
import p from "../../BitzDescriptions/index.mjs";
|
|
3
3
|
import m from "../TableCell/index.mjs";
|
|
4
4
|
import u from "../TextBlock/index.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { defaultValue as a } from "../index.mjs";
|
|
6
|
+
const w = (n, o, e) => {
|
|
7
|
+
const l = n.map((r) => (typeof r.title == "string" && (r.title = /* @__PURE__ */ i.jsx(u, { value: r.title, bold: 600 })), {
|
|
7
8
|
...r,
|
|
8
9
|
width: "auto",
|
|
9
10
|
render: (t, c, g) => {
|
|
10
|
-
const f = (
|
|
11
|
+
const f = (o == null ? void 0 : o.length) === 1 ? !1 : g + 1 > ((o == null ? void 0 : o.length) || 0) / 2;
|
|
11
12
|
if (r != null && r.render) {
|
|
12
13
|
const s = r.render(t, c, g);
|
|
13
14
|
if (typeof s == "object")
|
|
@@ -17,7 +18,7 @@ const b = (o, n, e) => {
|
|
|
17
18
|
))
|
|
18
19
|
return /* @__PURE__ */ i.jsx(m, { value: `${s}`, isLatterHalf: f });
|
|
19
20
|
}
|
|
20
|
-
return !t && !["boolean", "number", "bigint"].includes(typeof t) ? /* @__PURE__ */ i.jsx(u, { value:
|
|
21
|
+
return !t && !["boolean", "number", "bigint"].includes(typeof t) ? /* @__PURE__ */ i.jsx(u, { value: a }) : /* @__PURE__ */ i.jsx(m, { value: t, isLatterHalf: f });
|
|
21
22
|
}
|
|
22
23
|
}));
|
|
23
24
|
return [
|
|
@@ -30,15 +31,15 @@ const b = (o, n, e) => {
|
|
|
30
31
|
},
|
|
31
32
|
...l
|
|
32
33
|
];
|
|
33
|
-
},
|
|
34
|
+
}, R = (n, o) => n ? {
|
|
34
35
|
expandable: {
|
|
35
36
|
rowExpandable: (e) => {
|
|
36
37
|
var l;
|
|
37
|
-
return
|
|
38
|
+
return o ? !0 : (l = e[n]) == null ? void 0 : l.length;
|
|
38
39
|
},
|
|
39
40
|
expandedRowRender: (e) => {
|
|
40
41
|
var r;
|
|
41
|
-
const l = (r = e[
|
|
42
|
+
const l = (r = e[n]) == null ? void 0 : r.map((t) => (typeof t.label == "string" && (t.label = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.label })), typeof t.children == "string" && (t.children = /* @__PURE__ */ i.jsx(u, { minRows: 1, maxRows: 5, value: t.children })), t));
|
|
42
43
|
return /* @__PURE__ */ i.jsx(
|
|
43
44
|
p,
|
|
44
45
|
{
|
|
@@ -50,8 +51,8 @@ const b = (o, n, e) => {
|
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
} : null,
|
|
54
|
-
if (
|
|
54
|
+
} : null, S = (n, o) => {
|
|
55
|
+
if (n) {
|
|
55
56
|
const e = {
|
|
56
57
|
gutter: 20,
|
|
57
58
|
left: {
|
|
@@ -66,7 +67,7 @@ const b = (o, n, e) => {
|
|
|
66
67
|
button: 4
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
|
-
return
|
|
70
|
+
return o || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11, e.right.button = void 0), e;
|
|
70
71
|
} else {
|
|
71
72
|
const e = {
|
|
72
73
|
gutter: 0,
|
|
@@ -82,11 +83,11 @@ const b = (o, n, e) => {
|
|
|
82
83
|
button: void 0
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
|
-
return
|
|
86
|
+
return o || (e.right.search = 11, e.right.operation = 13, e.right.toolTagSelect = 0, e.right.totalSelect = 11), e;
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
w as getColumns,
|
|
91
|
+
R as getExpandable,
|
|
92
|
+
S as getLayoutConfig
|
|
92
93
|
};
|