bitz-react-admin-ui 2.4.2 → 2.4.4

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.
@@ -33,6 +33,8 @@ export interface BitzTableComponentToken extends TableComponentToken {
33
33
  expandIconBorderColor?: string;
34
34
  /** table与分页组件的纵向间隙距离 */
35
35
  tableSpaceBetweenPage?: number;
36
+ /** minHeight */
37
+ minHeight?: number;
36
38
  /** xl */
37
39
  xlTable?: TableConfigBySize;
38
40
  /** lg */
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { BitzTableActionProps, BitzTableColumnType, BitzTableActionColProps } from '..';
2
- export declare function BitzTableAction<T>({ loading, actionGroup, refInstance, }: BitzTableActionProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ export declare const BitzTableAction: import("react").ForwardRefExoticComponent<BitzTableActionProps<any> & import("react").RefAttributes<HTMLDivElement>>;
3
4
  /** 表格操作列 */
4
5
  declare function BitzTableActionCol<T>(props: BitzTableActionColProps<T>): BitzTableColumnType<T>;
5
6
  export default BitzTableActionCol;
@@ -1,99 +1,132 @@
1
- import { j as t } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
- import B from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
3
- import { theme as w, Space as y, Skeleton as z } from "antd";
4
- import { useRef as I, useMemo as u, useContext as S } from "react";
5
- import h from "../../BitzButton/index.mjs";
6
- import T, { actionColBtnGap as P } from "./style.mjs";
1
+ import { j as n } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
+ import T from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
3
+ import { Space as I, Skeleton as R, theme as P } from "antd";
4
+ import { forwardRef as E, useContext as L, useMemo as C, Fragment as M, useRef as D } from "react";
5
+ import x from "../../BitzButton/index.mjs";
6
+ import F, { actionColBtnGap as H } from "./style.mjs";
7
7
  import "../index.mjs";
8
- import k from "../Dropdown/index.mjs";
9
- import { tablePaddingInline as R } from "../../BitzConfigProvider/context.mjs";
10
- import { BitzTableContext as A } from "../Store/index.mjs";
8
+ import w from "../Dropdown/index.mjs";
9
+ import { tablePaddingInline as O } from "../../BitzConfigProvider/context.mjs";
10
+ import { BitzTableContext as W } from "../Store/index.mjs";
11
11
  const b = ({
12
- skeletonCls: l,
13
- ...n
14
- }) => /* @__PURE__ */ t.jsxs(h, { type: "text", ...n, children: [
15
- /* @__PURE__ */ t.jsx("span", { children: n.children }),
16
- /* @__PURE__ */ t.jsx(
17
- z,
12
+ skeletonCls: m,
13
+ ...l
14
+ }) => /* @__PURE__ */ n.jsxs(x, { type: "text", ...l, children: [
15
+ /* @__PURE__ */ n.jsx("span", { children: l.children }),
16
+ /* @__PURE__ */ n.jsx(
17
+ R,
18
18
  {
19
19
  active: !0,
20
20
  title: !1,
21
- className: l,
21
+ className: m,
22
22
  paragraph: {
23
23
  rows: 1,
24
24
  width: "100%"
25
25
  }
26
26
  }
27
27
  )
28
- ] });
29
- function E({
30
- loading: l,
31
- actionGroup: n,
32
- refInstance: c
33
- }) {
34
- const { loading: d, fullscreen: x } = S(A), o = u(() => l ?? d, [l, d]), {
35
- primaryBtnClassName: s,
36
- dangerBtnClassName: i,
37
- dropdownBtnClassName: N,
38
- maskClassName: m,
39
- skeletonBtnClassName: f,
40
- skeletonClassName: p
41
- } = T(), g = u(() => {
42
- const r = n.length >= 4 ? 2 : n.length, a = n.slice(0, r), C = [];
43
- if (a != null && a.length && a.forEach((e, j) => {
44
- C.push(
45
- o ? /* @__PURE__ */ t.jsx(
46
- b,
47
- {
48
- className: f,
49
- skeletonCls: p,
50
- children: e == null ? void 0 : e.label
51
- },
52
- j
53
- ) : e.children ? /* @__PURE__ */ t.jsx(k, { menu: { items: e.children }, children: /* @__PURE__ */ t.jsx(
54
- h,
55
- {
56
- type: "text",
57
- className: e.danger ? i : s,
58
- children: e == null ? void 0 : e.label
59
- }
60
- ) }, j) : /* @__PURE__ */ t.jsx(
61
- h,
28
+ ] }), _ = E(
29
+ ({ loading: m, actionGroup: l, customActions: r }, p) => {
30
+ const { loading: f, fullscreen: y } = L(W), o = C(() => m ?? f, [m, f]), {
31
+ primaryBtnClassName: d,
32
+ dangerBtnClassName: a,
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
+ o ? /* @__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,
51
+ {
52
+ type: "text",
53
+ className: e.danger ? a : d,
54
+ children: e == null ? void 0 : e.label
55
+ }
56
+ ) }, s) : /* @__PURE__ */ n.jsx(
57
+ x,
58
+ {
59
+ type: "text",
60
+ className: e.danger ? a : d,
61
+ onClick: e == null ? void 0 : e.onClick,
62
+ children: e == null ? void 0 : e.label
63
+ },
64
+ s
65
+ )
66
+ );
67
+ }), i === 2 && l.length >= 4) {
68
+ const e = l.slice(2, l.length);
69
+ t.push(
70
+ o ? /* @__PURE__ */ n.jsx(
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)
79
+ );
80
+ }
81
+ return t;
82
+ }, [o, l]), k = C(() => {
83
+ if (!(r != null && r.length))
84
+ return;
85
+ const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
86
+ b,
87
+ {
88
+ className: h,
89
+ skeletonCls: g,
90
+ children: t == null ? void 0 : t.label
91
+ },
92
+ e
93
+ )), c = r.map((t, e) => {
94
+ let s = /* @__PURE__ */ n.jsx(
95
+ x,
62
96
  {
63
97
  type: "text",
64
- className: e.danger ? i : s,
65
- onClick: e == null ? void 0 : e.onClick,
66
- children: e == null ? void 0 : e.label
98
+ className: t.danger ? a : d,
99
+ onClick: t.onClick,
100
+ children: t == null ? void 0 : t.label
67
101
  },
68
- j
69
- )
70
- );
71
- }), r === 2 && n.length >= 4) {
72
- const e = n.slice(2, n.length);
73
- C.push(
74
- o ? /* @__PURE__ */ t.jsx(
75
- b,
102
+ e
103
+ );
104
+ t.type === "secondary" && (s = /* @__PURE__ */ n.jsx(
105
+ x,
76
106
  {
77
- className: f,
78
- skeletonCls: p,
79
- children: "更多"
107
+ type: "text",
108
+ className: u,
109
+ onClick: t.onClick,
110
+ children: t == null ? void 0 : t.label
80
111
  },
81
- 5
82
- ) : /* @__PURE__ */ t.jsx(k, { menu: { items: e }, children: /* @__PURE__ */ t.jsx(h, { type: "text", className: N, children: "更多" }) }, 5)
83
- );
84
- }
85
- return C;
86
- }, [o, n]);
87
- return /* @__PURE__ */ t.jsxs("div", { onClick: (r) => r.stopPropagation(), children: [
88
- /* @__PURE__ */ t.jsx(y, { size: P, ref: c, className: "actionGroup", children: g }),
89
- /* @__PURE__ */ t.jsx("div", { className: m })
90
- ] });
91
- }
92
- function K(l) {
93
- var m;
94
- const { actionGroup: n, loading: c, ...d } = l, x = ((m = w.useToken().token.Table) == null ? void 0 : m.cellPaddingInline) ?? R, o = I(null), s = B(o), i = u(() => s != null && s.width ? s.width + x * 2 + 1 : 141, [s, x]);
95
- return u(() => ({
96
- width: Math.floor(i),
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 o ? i : c;
118
+ }, [o, r]);
119
+ return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), children: [
120
+ /* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
121
+ /* @__PURE__ */ n.jsx("div", { className: B })
122
+ ] });
123
+ }
124
+ );
125
+ function $(m) {
126
+ var h;
127
+ const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m, o = ((h = P.useToken().token.Table) == null ? void 0 : h.cellPaddingInline) ?? O, d = D(null), a = T(d), u = C(() => a != null && a.width ? a.width + o * 2 + 1 : f ?? 141, [a, o, f]);
128
+ return C(() => ({
129
+ width: Math.floor(u),
97
130
  mobileHide: !0,
98
131
  isOperationCol: !0,
99
132
  title: "操作",
@@ -102,23 +135,23 @@ function K(l) {
102
135
  dataIndex: "operationCol",
103
136
  className: "operationCol",
104
137
  disabled: !0,
105
- render: (f, p, g) => {
106
- const r = n(p, g).filter(
107
- (a) => a.type != "detail"
108
- );
109
- return /* @__PURE__ */ t.jsx(
110
- E,
138
+ render: (g, j, k) => {
139
+ var t, e;
140
+ const i = ((t = p == null ? void 0 : p(j, k)) == null ? void 0 : t.filter((s) => s.type != "detail")) ?? [], c = ((e = l == null ? void 0 : l(j, k)) == null ? void 0 : e.filter((s) => s.type != "detail")) ?? [];
141
+ return /* @__PURE__ */ n.jsx(
142
+ _,
111
143
  {
112
- actionGroup: r,
113
- loading: c,
114
- refInstance: o
144
+ actionGroup: c,
145
+ customActions: i,
146
+ loading: r,
147
+ ref: d
115
148
  }
116
149
  );
117
150
  },
118
- ...d
119
- }), [i, o, c, n]);
151
+ ...y
152
+ }), [u, d, r, l, p]);
120
153
  }
121
154
  export {
122
- E as BitzTableAction,
123
- K as default
155
+ _ as BitzTableAction,
156
+ $ as default
124
157
  };
@@ -2,7 +2,7 @@ declare const useGenStyle: () => {
2
2
  defaultCls: string;
3
3
  primaryBtnClassName: string;
4
4
  dangerBtnClassName: string;
5
- dropdownBtnClassName: string;
5
+ secondaryBtnClassName: string;
6
6
  skeletonBtnClassName: string;
7
7
  skeletonClassName: string;
8
8
  maskClassName: string;
@@ -14,9 +14,9 @@ import { BitzTableContext as T } from "../Store/index.mjs";
14
14
  import n from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
15
15
  import E from "../../BitzTheme/index.mjs";
16
16
  const O = () => {
17
- const { tableSize: i } = z(T);
18
- H(() => i ?? "lg", [i]);
19
- const { theme: B, hashId: r, token: s } = E.useToken(), e = "actionTextBtn", a = "primaryBtn", l = "delBtn", c = "dropdownBtn", m = "skeletonBtn", p = "skeleton", d = "actionColMask", h = (t, o) => [
17
+ const { tableSize: a } = z(T);
18
+ H(() => a ?? "lg", [a]);
19
+ const { theme: h, hashId: r, token: s } = E.useToken(), e = "actionTextBtn", i = "primaryBtn", l = "dangerBtn", c = "secondaryBtn", m = "skeletonBtn", p = "skeleton", B = "actionColMask", u = (t, o) => [
20
20
  {
21
21
  [`.${t}`]: {
22
22
  fontSize: "inherit",
@@ -43,7 +43,7 @@ const O = () => {
43
43
  zIndex: 1
44
44
  }
45
45
  }
46
- ], u = (t, o) => [
46
+ ], d = (t, o) => [
47
47
  {
48
48
  [`.${t}`]: {
49
49
  color: o.colorPrimary,
@@ -67,7 +67,7 @@ const O = () => {
67
67
  }
68
68
  }
69
69
  }
70
- ], C = (t, o) => [
70
+ ], y = (t, o) => [
71
71
  {
72
72
  [`.${t}`]: {
73
73
  color: o.colorText,
@@ -79,7 +79,7 @@ const O = () => {
79
79
  }
80
80
  }
81
81
  }
82
- ], v = (t, o) => [
82
+ ], C = (t, o) => [
83
83
  {
84
84
  [`.${t}`]: {
85
85
  fontSize: "inherit",
@@ -101,25 +101,25 @@ const O = () => {
101
101
  ];
102
102
  N(
103
103
  {
104
- theme: B,
104
+ theme: h,
105
105
  token: s,
106
106
  hashId: r,
107
107
  path: [e]
108
108
  },
109
109
  () => [
110
- h(e, d),
111
- u(a, s),
110
+ u(e, B),
111
+ d(i, s),
112
112
  g(l, s),
113
- C(c, s),
114
- v(m, p)
113
+ y(c, s),
114
+ C(m, p)
115
115
  ]
116
116
  );
117
- const y = n(e, a, r), $ = n(e, l, r), f = n(e, c, r), S = n(e, m, r), x = n(p, r), b = n(d, r);
117
+ const v = n(e, i, r), $ = n(e, l, r), f = n(e, c, r), S = n(e, m, r), x = n(p, r), b = n(B, r);
118
118
  return {
119
119
  defaultCls: e,
120
- primaryBtnClassName: y,
120
+ primaryBtnClassName: v,
121
121
  dangerBtnClassName: $,
122
- dropdownBtnClassName: f,
122
+ secondaryBtnClassName: f,
123
123
  skeletonBtnClassName: S,
124
124
  skeletonClassName: x,
125
125
  maskClassName: b
@@ -5,7 +5,7 @@ import { AnyObject } from 'antd/es/_util/type';
5
5
  import type { RowClassName } from 'rc-table/es/interface';
6
6
  import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
7
7
  import { ActionsFunType, BitzTableColumnsType, SelelctionAlertProps } from '..';
8
- import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
8
+ import { BitzTableBorderedType } from '../../BitzConfigProvider/context';
9
9
  import './index.less';
10
10
  export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered'> {
11
11
  /** 是否开启rowHover样式 */
@@ -18,6 +18,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
18
18
  showPagination?: boolean;
19
19
  /** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
20
20
  height?: number;
21
+ /** PC端:当height小于minHeight时使用minHeight替代height */
22
+ minHeight?: number;
21
23
  /** table可滚动区域的最大宽高的值 */
22
24
  scroll?: {
23
25
  x?: number;