bitz-react-admin-ui 1.7.4 → 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.
Files changed (25) hide show
  1. package/dist/components/BitzConfigProvider/context.d.ts +1 -1
  2. package/dist/components/BitzConfigProvider/index.d.ts +3 -0
  3. package/dist/components/BitzConfirmModal/index.d.ts +6 -5
  4. package/dist/components/BitzConfirmModal/index.mjs +33 -65
  5. package/dist/components/BitzFullScreen/index.d.ts +6 -1
  6. package/dist/components/BitzFullScreen/index.mjs +22 -14
  7. package/dist/components/BitzTable/Store/index.d.ts +20 -29
  8. package/dist/components/BitzTable/Store/utils/index.d.ts +2 -2
  9. package/dist/components/BitzTable/Table/index.mjs +255 -238
  10. package/dist/components/BitzTable/TableSkeleton/index.mjs +20 -19
  11. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.d.ts +3 -2
  12. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +21 -21
  13. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.module.less.mjs +29 -29
  14. package/dist/components/BitzTable/ToolBar/DensityIcon/index.d.ts +3 -2
  15. package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +14 -14
  16. package/dist/components/BitzTable/ToolBar/ExportIcon/index.d.ts +1 -1
  17. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.d.ts +2 -1
  18. package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +37 -34
  19. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.d.ts +3 -2
  20. package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +19 -13
  21. package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +67 -43
  22. package/dist/components/BitzTable/ToolBar/index.d.ts +1 -1
  23. package/dist/components/BitzTable/index.d.ts +12 -3
  24. package/dist/style.css +1 -1
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ToolEnum } from '../BitzTable/ToolBar';
2
+ export type ToolEnum = 'export' | 'refresh' | 'size' | 'fullscreen' | 'colConfig';
3
3
  export interface TableComponentContextProps {
4
4
  toolbar?: ToolEnum[];
5
5
  }
@@ -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
- onOk?: (...args: any[]) => any;
10
- onCancel?: (...args: any[]) => any;
11
- warnText1?: string;
12
- warnText2?: string;
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 { useRef as C, useState as M } from "react";
3
- import { theme as B, Modal as v } from "antd";
4
- import { create as O, useModal as y, antdModalV5 as z } from "@ebay/nice-modal-react";
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 F from "../../assets/iconfont/IconJinggao.mjs";
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 I } from "../../node_modules/.store/react-i18next@13.5.0/node_modules/react-i18next/dist/es/useTranslation.mjs";
598
- import R from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/CloseOutlined.mjs";
599
- function u(m) {
600
- return !!(m && m.then);
601
- }
602
- const S = (m) => {
603
- var f;
604
- const {
605
- onOk: p,
606
- onCancel: n,
607
- title: h = "提示",
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
- v,
610
+ g,
638
611
  {
639
- ...z(x),
612
+ open: e.open,
613
+ afterClose: e.afterClose,
640
614
  className: "bitzConfirmModalBlock",
641
- title: h,
615
+ title: f || i("System_Tip", "提示"),
642
616
  width: 400,
643
- closeIcon: /* @__PURE__ */ t.jsx(R, {}),
644
- onOk: g,
645
- confirmLoading: N,
646
- onCancel: e,
647
- okText: d("System_Deter", "确定"),
648
- cancelText: d("System_Cancel", "取消"),
649
- ...j,
650
- style: { "--modalContent-colorBg": (f = w.Modal) == null ? void 0 : f.headerBg },
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.jsxs("div", { className: "warnIcon", children: [
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
- }, Jl = O(S);
633
+ }, Ol = j(_);
666
634
  export {
667
- Jl as default
635
+ Ol as default
668
636
  };
@@ -1,3 +1,8 @@
1
+ import { CSSProperties, FC } from 'react';
1
2
  import './index.less';
2
- declare const BitzFullScreen: () => import("react/jsx-runtime").JSX.Element;
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 l } from "../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { useState as o, useEffect as i } from "react";
3
- import { message as c } from "antd";
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 u from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenExitOutlined.mjs";
7
- import f from "../../node_modules/.store/@ant-design_icons@5.3.3/node_modules/@ant-design/icons/es/icons/FullscreenOutlined.mjs";
8
- const g = () => {
9
- const [s, r] = o(e.isFullscreen);
10
- i(() => {
11
- e.on("change", () => (e.isFullscreen ? r(!0) : r(!1), () => e.off("change", () => {
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 t = () => {
15
- e.isEnabled || c.warning("当前您的浏览器不支持全屏"), e.toggle();
16
- }, n = { fontSize: 22 };
17
- return /* @__PURE__ */ l.jsx("div", { className: "fullScreenBlock", onClick: t, children: s ? /* @__PURE__ */ l.jsx(u, { style: n }) : /* @__PURE__ */ l.jsx(f, { style: n }) });
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
- g as default
28
+ v as default
21
29
  };
@@ -1,14 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { TableColumnType } from 'antd';
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,56 +12,55 @@ export type ColumnStateType = {
20
12
  /** 持久化的key,用于存储到 storage 中 */
21
13
  persistenceKey?: string;
22
14
  /** ColumnsState 的值,columnsStateMap将会废弃 */
23
- defaultValue?: Record<string, ColumnsState>;
15
+ defaultValue?: Record<string, ColumnsConfigProps>;
24
16
  /** ColumnsState 的值,columnsStateMap将会废弃 */
25
- value?: Record<string, ColumnsState>;
26
- onChange?: (map: Record<string, ColumnsState>) => void;
17
+ value?: Record<string, ColumnsConfigProps>;
18
+ onChange?: (map: Record<string, ColumnsConfigProps>) => void;
27
19
  /** 仅在 persistenceType=online 有效 用于数据修改后数据上报 */
28
- onlineChange?: (key: string, ColumnsState: Record<string, ColumnsState>) => void;
20
+ onlineChange?: (key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void;
29
21
  /** 仅在 persistenceType=online 有效 用于获取网络数据 */
30
- onlineGet?: (key: string) => Promise<Record<string, ColumnsState> | null | undefined>;
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, ColumnsState>;
35
- onColumnsStateChange?: (map: Record<string, ColumnsState>) => void;
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?: ProTableColumn<T>[];
30
+ columns?: BitzTableColumnsType<T>;
40
31
  columnsState?: ColumnStateType;
41
32
  /** 仅在 persistenceType=online 有效 用于数据修改后数据上报 */
42
- onlineChange?: (key: string, ColumnsState: ColumnsState) => void;
33
+ onlineChange?: (key: string, ColumnsState: ColumnsConfigProps) => void;
43
34
  /** 持久化的key,用于存储到 storage 中 */
44
35
  persistenceKey?: string;
45
36
  };
46
37
  declare function useContainer(props?: UseContainerProps): {
47
38
  uuid: string;
48
- persistenceType: "localStorage" | "sessionStorage" | "online" | undefined;
39
+ persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
49
40
  persistenceKey: string | undefined;
50
- onlineChange: ((key: string, ColumnsState: Record<string, ColumnsState>) => void) | undefined;
41
+ onlineChange: ((key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
51
42
  sortKeyColumns: string[];
52
43
  setSortKeyColumns: (keys: string[]) => void;
53
- columnsMap: Record<string, ColumnsState>;
54
- setColumnsMap: (updater: Record<string, ColumnsState> | ((origin: Record<string, ColumnsState>) => Record<string, ColumnsState>), ignoreDestroy?: boolean | undefined) => void;
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: ProTableColumn<any>[] | undefined;
48
+ columns: BitzTableColumnsType<any> | undefined;
58
49
  clearPersistenceStorage: () => void;
59
50
  defaultColumnKeyMap: Record<string, any>;
60
51
  };
61
52
  declare const TableContext: import("react").Context<{
62
53
  uuid: string;
63
- persistenceType: "localStorage" | "sessionStorage" | "online" | undefined;
54
+ persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
64
55
  persistenceKey: string | undefined;
65
- onlineChange: ((key: string, ColumnsState: Record<string, ColumnsState>) => void) | undefined;
56
+ onlineChange: ((key: string, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
66
57
  sortKeyColumns: string[];
67
58
  setSortKeyColumns: (keys: string[]) => void;
68
- columnsMap: Record<string, ColumnsState>;
69
- setColumnsMap: (updater: Record<string, ColumnsState> | ((origin: Record<string, ColumnsState>) => Record<string, ColumnsState>), ignoreDestroy?: boolean | undefined) => void;
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: ProTableColumn<any>[] | undefined;
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 { ColumnsState } from '..';
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, ColumnsState>) => (a: any, b: any) => number;
10
+ export declare const columnSort: (columnsMap: Record<string, ColumnsConfigProps>) => (a: any, b: any) => number;