bitz-react-admin-ui 1.7.5 → 1.7.6
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/index.d.ts +3 -0
- package/dist/components/BitzConfirmModal/index.d.ts +6 -5
- package/dist/components/BitzConfirmModal/index.mjs +33 -65
- package/dist/components/BitzFullScreen/index.d.ts +6 -1
- package/dist/components/BitzFullScreen/index.mjs +22 -14
- package/dist/components/BitzTable/Store/index.d.ts +18 -27
- package/dist/components/BitzTable/Store/utils/index.d.ts +2 -2
- package/dist/components/BitzTable/Table/index.mjs +255 -238
- package/dist/components/BitzTable/TableSkeleton/index.mjs +20 -19
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.module.less.mjs +29 -29
- package/dist/components/BitzTable/index.d.ts +12 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -33,8 +33,11 @@ type ComponentsConfig = {
|
|
|
33
33
|
};
|
|
34
34
|
/** 给ant添加全局design token */
|
|
35
35
|
export interface BitzAliasToken extends AliasToken {
|
|
36
|
+
/** 普通文本悬浮态颜色 */
|
|
36
37
|
colorTextHover: string;
|
|
38
|
+
/** 普通文本激活颜色 */
|
|
37
39
|
colorTextActive: string;
|
|
40
|
+
/** 次要高亮文本 */
|
|
38
41
|
colorSecondaryHighlightText: string;
|
|
39
42
|
mode: 'light' | 'dark';
|
|
40
43
|
}
|
|
@@ -2,15 +2,16 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import { ModalProps } from 'antd';
|
|
3
3
|
import './index.less';
|
|
4
4
|
export interface BitzConfirmModalProps extends Omit<ModalProps, 'onOk' | 'onCancel'> {
|
|
5
|
+
okButtonProps: any;
|
|
6
|
+
okType: any;
|
|
5
7
|
/**
|
|
6
8
|
* 内容文字
|
|
7
9
|
*/
|
|
8
10
|
modalText?: ReactNode;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
warnText3?: string;
|
|
11
|
+
/** 点击ok按钮,返回'yes' */
|
|
12
|
+
onOk?: () => Promise<any>;
|
|
13
|
+
/** 点击cancel按钮,返回'cancel' */
|
|
14
|
+
onCancel?: () => any;
|
|
14
15
|
}
|
|
15
16
|
declare const _default: FC<BitzConfirmModalProps & import("@ebay/nice-modal-react").NiceModalHocProps>;
|
|
16
17
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { theme as
|
|
4
|
-
import { create as
|
|
2
|
+
import { useState as C } from "react";
|
|
3
|
+
import { theme as T, Modal as g } from "antd";
|
|
4
|
+
import { create as j, useModal as B, antdModalV5 as v } from "@ebay/nice-modal-react";
|
|
5
5
|
import "../../assets/iconfont/IconShanchu1.mjs";
|
|
6
6
|
import "../../assets/iconfont/IconTuodong.mjs";
|
|
7
7
|
import "../../assets/iconfont/IconYunweiguanliLinear.mjs";
|
|
@@ -57,7 +57,7 @@ import "../../assets/iconfont/IconABook.mjs";
|
|
|
57
57
|
import "../../assets/iconfont/IconXinxitishi.mjs";
|
|
58
58
|
import "../../assets/iconfont/IconDuigoux.mjs";
|
|
59
59
|
import "../../assets/iconfont/IconCuowu.mjs";
|
|
60
|
-
import
|
|
60
|
+
import M from "../../assets/iconfont/IconJinggao.mjs";
|
|
61
61
|
import "../../assets/iconfont/IconIcon21.mjs";
|
|
62
62
|
import "../../assets/iconfont/IconChenggong.mjs";
|
|
63
63
|
import "../../assets/iconfont/IconTishi1.mjs";
|
|
@@ -594,75 +594,43 @@ import "../../assets/iconfont/IconGongnengfull.mjs";
|
|
|
594
594
|
import "../../assets/iconfont/IconWode.mjs";
|
|
595
595
|
import "../../assets/iconfont/IconWodefull.mjs";
|
|
596
596
|
import "./index.less.mjs";
|
|
597
|
-
import { useTranslation as
|
|
598
|
-
import
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
modalText: T = "",
|
|
609
|
-
warnText1: s = "",
|
|
610
|
-
warnText2: a = "",
|
|
611
|
-
warnText3: l = "",
|
|
612
|
-
...j
|
|
613
|
-
} = m, { t: d } = I(), { token: w } = B.useToken(), i = C(!1), x = y(), [N, c] = M(!1), k = (r) => {
|
|
614
|
-
u(r) && (c(!0), r.then(
|
|
615
|
-
(...o) => {
|
|
616
|
-
c(!1, !0), e(o), i.current = !1;
|
|
617
|
-
},
|
|
618
|
-
(o) => (c(!1, !0), i.current = !1, Promise.reject(o))
|
|
619
|
-
));
|
|
620
|
-
}, g = (r) => {
|
|
621
|
-
if (i.current)
|
|
622
|
-
return;
|
|
623
|
-
if (i.current = !0, !p) {
|
|
624
|
-
e(r);
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
let o;
|
|
628
|
-
if (o = p == null ? void 0 : p(r), !u(o)) {
|
|
629
|
-
i.current = !1, e(r);
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
k(o);
|
|
633
|
-
}, e = (r) => {
|
|
634
|
-
n == null || n(r), x.hide();
|
|
597
|
+
import { useTranslation as S } from "../../node_modules/.store/react-i18next@13.5.0/node_modules/react-i18next/dist/es/useTranslation.mjs";
|
|
598
|
+
import N from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/CloseOutlined.mjs";
|
|
599
|
+
const _ = (l) => {
|
|
600
|
+
var n;
|
|
601
|
+
const { okButtonProps: c, okType: d, onOk: r, onCancel: m, title: f, modalText: x, ...u } = l, { t: i } = S(), { token: p } = T.useToken(), o = B(), e = v(o), [h, s] = C(!1), k = async () => {
|
|
602
|
+
var a;
|
|
603
|
+
r ? (s(!0), (a = r == null ? void 0 : r()) == null || a.finally(() => {
|
|
604
|
+
s(!1), o.resolve("ok"), o.hide();
|
|
605
|
+
})) : (o.resolve("ok"), o.hide());
|
|
606
|
+
}, y = () => {
|
|
607
|
+
m == null || m(), o.resolve("cancel"), o.hide();
|
|
635
608
|
};
|
|
636
609
|
return /* @__PURE__ */ t.jsx(
|
|
637
|
-
|
|
610
|
+
g,
|
|
638
611
|
{
|
|
639
|
-
|
|
612
|
+
open: e.open,
|
|
613
|
+
afterClose: e.afterClose,
|
|
640
614
|
className: "bitzConfirmModalBlock",
|
|
641
|
-
title:
|
|
615
|
+
title: f || i("System_Tip", "提示"),
|
|
642
616
|
width: 400,
|
|
643
|
-
closeIcon: /* @__PURE__ */ t.jsx(
|
|
644
|
-
onOk:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
okText:
|
|
648
|
-
|
|
649
|
-
...
|
|
650
|
-
|
|
617
|
+
closeIcon: /* @__PURE__ */ t.jsx(N, {}),
|
|
618
|
+
onOk: k,
|
|
619
|
+
onCancel: y,
|
|
620
|
+
confirmLoading: h,
|
|
621
|
+
okText: i("System_Deter", "确定"),
|
|
622
|
+
okType: d || "primary",
|
|
623
|
+
okButtonProps: { danger: !0, ...c },
|
|
624
|
+
cancelText: i("System_Cancel", "取消"),
|
|
625
|
+
...u,
|
|
626
|
+
style: { "--modalContent-colorBg": (n = p.Modal) == null ? void 0 : n.headerBg },
|
|
651
627
|
children: /* @__PURE__ */ t.jsxs("div", { className: "textBox", children: [
|
|
652
|
-
/* @__PURE__ */ t.
|
|
653
|
-
|
|
654
|
-
/* @__PURE__ */ t.jsx(F, { className: "icon", color: "#FF4D4F", size: 20 })
|
|
655
|
-
] }),
|
|
656
|
-
s && a && l && /* @__PURE__ */ t.jsxs("div", { className: "warnText", children: [
|
|
657
|
-
/* @__PURE__ */ t.jsx("span", { className: "warnText1", children: s }),
|
|
658
|
-
/* @__PURE__ */ t.jsx("span", { className: "warnText2", children: a }),
|
|
659
|
-
/* @__PURE__ */ t.jsx("span", { className: "warnText3", children: l })
|
|
660
|
-
] }),
|
|
661
|
-
!(s && a && l) && /* @__PURE__ */ t.jsx("div", { className: "modalText", children: T || "您确定要删除吗?" })
|
|
628
|
+
/* @__PURE__ */ t.jsx("div", { className: "warnIcon", children: /* @__PURE__ */ t.jsx(M, { className: "icon", color: p.colorError, size: 20 }) }),
|
|
629
|
+
/* @__PURE__ */ t.jsx("div", { className: "modalText", children: x || i("System_CanUSure", "您确定要删除吗?") })
|
|
662
630
|
] })
|
|
663
631
|
}
|
|
664
632
|
);
|
|
665
|
-
},
|
|
633
|
+
}, Ol = j(_);
|
|
666
634
|
export {
|
|
667
|
-
|
|
635
|
+
Ol as default
|
|
668
636
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
1
2
|
import './index.less';
|
|
2
|
-
|
|
3
|
+
interface BitzFullScreenProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
declare const BitzFullScreen: FC<BitzFullScreenProps>;
|
|
3
8
|
export default BitzFullScreen;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { message as
|
|
1
|
+
import { j as s } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useState as u, useEffect as f, useMemo as a } from "react";
|
|
3
|
+
import { theme as p, Tooltip as x, message as d } from "antd";
|
|
4
4
|
import e from "../../node_modules/.store/screenfull@6.0.2/node_modules/screenfull/index.mjs";
|
|
5
5
|
import "./index.less.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import F from "../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
7
|
+
import { css as g } from "../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
|
|
8
|
+
import h from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
|
|
9
|
+
import j from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
|
|
10
|
+
const v = ({ className: n, style: l }) => {
|
|
11
|
+
const { token: c } = p.useToken(), [r, o] = u(e.isFullscreen);
|
|
12
|
+
f(() => {
|
|
13
|
+
e.on("change", () => (e.isFullscreen ? o(!0) : o(!1), () => e.off("change", () => {
|
|
12
14
|
})));
|
|
13
15
|
}, []);
|
|
14
|
-
const
|
|
15
|
-
e.isEnabled ||
|
|
16
|
-
},
|
|
17
|
-
|
|
16
|
+
const i = () => {
|
|
17
|
+
e.isEnabled || d.warning("当前您的浏览器不支持全屏"), e.toggle();
|
|
18
|
+
}, m = a(() => r ? "退出全屏" : "全屏", [r]), t = F(
|
|
19
|
+
g`
|
|
20
|
+
font-size: 22px;
|
|
21
|
+
color: ${c.colorText};
|
|
22
|
+
`,
|
|
23
|
+
n
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ s.jsx(x, { title: m, children: /* @__PURE__ */ s.jsx("div", { className: "fullScreenBlock", onClick: i, children: r ? /* @__PURE__ */ s.jsx(h, { className: t, style: l }) : /* @__PURE__ */ s.jsx(j, { className: t, style: l }) }) });
|
|
18
26
|
};
|
|
19
27
|
export {
|
|
20
|
-
|
|
28
|
+
v as default
|
|
21
29
|
};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ColumnsConfigProps, BitzTableColumnsType } from '..';
|
|
3
3
|
export type DensitySize = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | undefined;
|
|
4
|
-
export type ColumnsState = {
|
|
5
|
-
show?: boolean;
|
|
6
|
-
fixed?: 'right' | 'left' | undefined;
|
|
7
|
-
order?: number;
|
|
8
|
-
disable?: boolean | {
|
|
9
|
-
checkbox: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
4
|
export type ColumnStateType = {
|
|
13
5
|
/**
|
|
14
6
|
* 持久化的类型,支持 localStorage 和 sessionStorage
|
|
@@ -20,26 +12,25 @@ export type ColumnStateType = {
|
|
|
20
12
|
/** 持久化的key,用于存储到 storage 中 */
|
|
21
13
|
persistenceKey?: string;
|
|
22
14
|
/** ColumnsState 的值,columnsStateMap将会废弃 */
|
|
23
|
-
defaultValue?: Record<string,
|
|
15
|
+
defaultValue?: Record<string, ColumnsConfigProps>;
|
|
24
16
|
/** ColumnsState 的值,columnsStateMap将会废弃 */
|
|
25
|
-
value?: Record<string,
|
|
26
|
-
onChange?: (map: Record<string,
|
|
17
|
+
value?: Record<string, ColumnsConfigProps>;
|
|
18
|
+
onChange?: (map: Record<string, ColumnsConfigProps>) => void;
|
|
27
19
|
/** 仅在 persistenceType=online 有效 用于数据修改后数据上报 */
|
|
28
|
-
onlineChange?: (key: string, ColumnsState: Record<string,
|
|
20
|
+
onlineChange?: (key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void;
|
|
29
21
|
/** 仅在 persistenceType=online 有效 用于获取网络数据 */
|
|
30
|
-
onlineGet?: (key: string) => Promise<Record<string,
|
|
22
|
+
onlineGet?: (key: string) => Promise<Record<string, ColumnsConfigProps> | null | undefined>;
|
|
31
23
|
};
|
|
32
|
-
export type ProTableColumn<T> = ColumnsState & TableColumnType<T>;
|
|
33
24
|
export type UseContainerProps<T = any> = {
|
|
34
|
-
columnsStateMap?: Record<string,
|
|
35
|
-
onColumnsStateChange?: (map: Record<string,
|
|
25
|
+
columnsStateMap?: Record<string, ColumnsConfigProps>;
|
|
26
|
+
onColumnsStateChange?: (map: Record<string, ColumnsConfigProps>) => void;
|
|
36
27
|
size?: DensitySize;
|
|
37
28
|
defaultSize?: DensitySize;
|
|
38
29
|
onSizeChange?: (size: DensitySize) => void;
|
|
39
|
-
columns?:
|
|
30
|
+
columns?: BitzTableColumnsType<T>;
|
|
40
31
|
columnsState?: ColumnStateType;
|
|
41
32
|
/** 仅在 persistenceType=online 有效 用于数据修改后数据上报 */
|
|
42
|
-
onlineChange?: (key: string, ColumnsState:
|
|
33
|
+
onlineChange?: (key: string, ColumnsState: ColumnsConfigProps) => void;
|
|
43
34
|
/** 持久化的key,用于存储到 storage 中 */
|
|
44
35
|
persistenceKey?: string;
|
|
45
36
|
};
|
|
@@ -47,14 +38,14 @@ declare function useContainer(props?: UseContainerProps): {
|
|
|
47
38
|
uuid: string;
|
|
48
39
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
49
40
|
persistenceKey: string | undefined;
|
|
50
|
-
onlineChange: ((key: string, ColumnsState: Record<string,
|
|
41
|
+
onlineChange: ((key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
51
42
|
sortKeyColumns: string[];
|
|
52
43
|
setSortKeyColumns: (keys: string[]) => void;
|
|
53
|
-
columnsMap: Record<string,
|
|
54
|
-
setColumnsMap: (updater: Record<string,
|
|
44
|
+
columnsMap: Record<string, ColumnsConfigProps>;
|
|
45
|
+
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
55
46
|
setTableSize: (updater: DensitySize | ((origin: DensitySize) => DensitySize), ignoreDestroy?: boolean | undefined) => void;
|
|
56
47
|
tableSize: DensitySize;
|
|
57
|
-
columns:
|
|
48
|
+
columns: BitzTableColumnsType<any> | undefined;
|
|
58
49
|
clearPersistenceStorage: () => void;
|
|
59
50
|
defaultColumnKeyMap: Record<string, any>;
|
|
60
51
|
};
|
|
@@ -62,14 +53,14 @@ declare const TableContext: import("react").Context<{
|
|
|
62
53
|
uuid: string;
|
|
63
54
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
64
55
|
persistenceKey: string | undefined;
|
|
65
|
-
onlineChange: ((key: string, ColumnsState: Record<string,
|
|
56
|
+
onlineChange: ((key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
66
57
|
sortKeyColumns: string[];
|
|
67
58
|
setSortKeyColumns: (keys: string[]) => void;
|
|
68
|
-
columnsMap: Record<string,
|
|
69
|
-
setColumnsMap: (updater: Record<string,
|
|
59
|
+
columnsMap: Record<string, ColumnsConfigProps>;
|
|
60
|
+
setColumnsMap: (updater: Record<string, ColumnsConfigProps> | ((origin: Record<string, ColumnsConfigProps>) => Record<string, ColumnsConfigProps>), ignoreDestroy?: boolean | undefined) => void;
|
|
70
61
|
setTableSize: (updater: DensitySize | ((origin: DensitySize) => DensitySize), ignoreDestroy?: boolean | undefined) => void;
|
|
71
62
|
tableSize: DensitySize;
|
|
72
|
-
columns:
|
|
63
|
+
columns: BitzTableColumnsType<any> | undefined;
|
|
73
64
|
clearPersistenceStorage: () => void;
|
|
74
65
|
defaultColumnKeyMap: Record<string, any>;
|
|
75
66
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Key } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ColumnsConfigProps } from '../../';
|
|
3
3
|
/**
|
|
4
4
|
* 根据 key 和 dataIndex 生成唯一 id
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import { ColumnsState } from '..';
|
|
|
7
7
|
* @param index 序列号,理论上唯一
|
|
8
8
|
*/
|
|
9
9
|
export declare const genColumnKey: (key?: string | number | Key, index?: number | string) => string;
|
|
10
|
-
export declare const columnSort: (columnsMap: Record<string,
|
|
10
|
+
export declare const columnSort: (columnsMap: Record<string, ColumnsConfigProps>) => (a: any, b: any) => number;
|