bitz-react-admin-ui 2.5.1 → 2.5.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.
@@ -1,4 +1,4 @@
1
- var s = { exports: {} };
1
+ var p = { exports: {} };
2
2
  export {
3
- s as __module
3
+ p as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var p = { exports: {} };
1
+ var s = { exports: {} };
2
2
  export {
3
- p as __module
3
+ s as __module
4
4
  };
@@ -1,132 +1,82 @@
1
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
- import "../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
- const b = ({
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
- {
19
- active: !0,
20
- title: !1,
21
- className: m,
22
- paragraph: {
23
- rows: 1,
24
- width: "100%"
25
- }
26
- }
27
- )
28
- ] }), _ = E(
29
- ({ loading: m, actionGroup: l, customActions: r }, p) => {
30
- const { loading: f, fullscreen: y } = L(W), a = C(() => m ?? f, [m, f]), {
31
- primaryBtnClassName: d,
32
- dangerBtnClassName: o,
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
- a ? /* @__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,
2
+ import B from "../../../node_modules/.store/ahooks@3.7.11/node_modules/ahooks/es/useSize/index.mjs";
3
+ import { Space as w, theme as z } from "antd";
4
+ import { forwardRef as I, useMemo as x, Fragment as R, useRef as T } from "react";
5
+ import p from "../../BitzButton/index.mjs";
6
+ import P, { actionColBtnGap as S } from "./style.mjs";
7
+ import N from "../Dropdown/index.mjs";
8
+ import { tablePaddingInline as E } from "../../BitzConfigProvider/context.mjs";
9
+ const M = I(
10
+ ({ actionGroup: s, customActions: l }, b) => {
11
+ const {
12
+ primaryBtnClassName: a,
13
+ dangerBtnClassName: c,
14
+ secondaryBtnClassName: h,
15
+ maskClassName: f
16
+ } = P(), m = x(() => {
17
+ const i = s.length >= 4 ? 2 : s.length, t = s.slice(0, i), r = [];
18
+ if (t != null && t.length && t.forEach((e, o) => {
19
+ r.push(
20
+ e.children ? /* @__PURE__ */ n.jsx(N, { menu: { items: e.children }, children: /* @__PURE__ */ n.jsx(
21
+ p,
51
22
  {
52
23
  type: "text",
53
- className: e.danger ? o : d,
24
+ className: e.danger ? c : a,
54
25
  children: e == null ? void 0 : e.label
55
26
  }
56
- ) }, s) : /* @__PURE__ */ n.jsx(
57
- x,
27
+ ) }, o) : /* @__PURE__ */ n.jsx(
28
+ p,
58
29
  {
59
30
  type: "text",
60
- className: e.danger ? o : d,
31
+ className: e.danger ? c : a,
61
32
  onClick: e == null ? void 0 : e.onClick,
62
33
  children: e == null ? void 0 : e.label
63
34
  },
64
- s
35
+ o
65
36
  )
66
37
  );
67
- }), i === 2 && l.length >= 4) {
68
- const e = l.slice(2, l.length);
69
- t.push(
70
- a ? /* @__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)
38
+ }), i === 2 && s.length >= 4) {
39
+ const e = s.slice(2, s.length);
40
+ r.push(
41
+ /* @__PURE__ */ n.jsx(N, { menu: { items: e }, children: /* @__PURE__ */ n.jsx(p, { type: "text", className: h, children: "更多" }) }, 5)
79
42
  );
80
43
  }
81
- return t;
82
- }, [a, l]), k = C(() => {
83
- if (!(r != null && r.length))
84
- return;
85
- const i = r.map((t, e) => /* @__PURE__ */ n.jsx(
86
- b,
44
+ return r;
45
+ }, [s]), d = x(() => l != null && l.length ? l.map((t, r) => {
46
+ let e = /* @__PURE__ */ n.jsx(
47
+ p,
87
48
  {
49
+ type: "text",
50
+ className: t.danger ? c : a,
51
+ onClick: t.onClick,
52
+ children: t == null ? void 0 : t.label
53
+ },
54
+ r
55
+ );
56
+ t.type === "secondary" && (e = /* @__PURE__ */ n.jsx(
57
+ p,
58
+ {
59
+ type: "text",
88
60
  className: h,
89
- skeletonCls: g,
61
+ onClick: t.onClick,
90
62
  children: t == null ? void 0 : t.label
91
63
  },
92
- e
93
- )), c = r.map((t, e) => {
94
- let s = /* @__PURE__ */ n.jsx(
95
- x,
96
- {
97
- type: "text",
98
- className: t.danger ? o : d,
99
- onClick: t.onClick,
100
- children: t == null ? void 0 : t.label
101
- },
102
- e
103
- );
104
- t.type === "secondary" && (s = /* @__PURE__ */ n.jsx(
105
- x,
106
- {
107
- type: "text",
108
- className: u,
109
- onClick: t.onClick,
110
- children: t == null ? void 0 : t.label
111
- },
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 a ? i : c;
118
- }, [a, r]);
64
+ r
65
+ ));
66
+ const o = t.render ?? ((u, g) => /* @__PURE__ */ n.jsx(R, { children: u }, g));
67
+ return o == null ? void 0 : o(e, r);
68
+ }) : void 0, [l]);
119
69
  return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), style: { overflow: "hidden" }, children: [
120
- /* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
121
- /* @__PURE__ */ n.jsx("div", { className: B })
70
+ /* @__PURE__ */ n.jsx(w, { size: S, ref: b, className: "actionGroup", children: d ?? m }),
71
+ /* @__PURE__ */ n.jsx("div", { className: f })
122
72
  ] });
123
73
  }
124
74
  );
125
- function $(m) {
126
- var h;
127
- const { actionGroup: l, loading: r, customActions: p, defaultWidth: f, ...y } = m, a = ((h = P.useToken().token.Table) == null ? void 0 : h.cellPaddingInline) ?? O, d = D(null), o = T(d), u = C(() => o != null && o.width ? o.width + a * 2 + 1 : f ?? 141, [o, a, f]);
128
- return C(() => ({
129
- width: Math.floor(u),
75
+ function J(s) {
76
+ var r;
77
+ const { actionGroup: l, loading: b, customActions: a, defaultWidth: c, ...h } = s, f = ((r = z.useToken().token.Table) == null ? void 0 : r.cellPaddingInline) ?? E, m = T(null), d = B(m), i = x(() => d != null && d.width ? d.width + f * 2 + 1 : c ?? 141, [d, f, c]);
78
+ return x(() => ({
79
+ width: Math.floor(i),
130
80
  mobileHide: !0,
131
81
  isOperationCol: !0,
132
82
  title: "操作",
@@ -135,23 +85,22 @@ function $(m) {
135
85
  dataIndex: "operationCol",
136
86
  className: "operationCol",
137
87
  disabled: !0,
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")) ?? [];
88
+ render: (e, o, u) => {
89
+ var j, y;
90
+ const g = ((j = a == null ? void 0 : a(o, u)) == null ? void 0 : j.filter((C) => C.type != "detail")) ?? [], k = ((y = l == null ? void 0 : l(o, u)) == null ? void 0 : y.filter((C) => C.type != "detail")) ?? [];
141
91
  return /* @__PURE__ */ n.jsx(
142
- _,
92
+ M,
143
93
  {
144
- actionGroup: c,
145
- customActions: i,
146
- loading: r,
147
- ref: d
94
+ actionGroup: k,
95
+ customActions: g,
96
+ ref: m
148
97
  }
149
98
  );
150
99
  },
151
- ...y
152
- }), [u, d, r, l, p]);
100
+ ...h
101
+ }), [i, m, l, a]);
153
102
  }
154
103
  export {
155
- _ as BitzTableAction,
156
- $ as default
104
+ M as BitzTableAction,
105
+ J as default
157
106
  };
@@ -1,9 +1,10 @@
1
+ import { TableProps } from 'antd';
1
2
  import { ReactNode } from 'react';
2
3
  interface SortTableContextProps {
3
4
  children?: ReactNode;
4
5
  enabledRowDragSort?: boolean;
5
6
  dataSource: any[];
6
- mergeRowKey: string;
7
+ mergeRowKey: TableProps['rowKey'];
7
8
  onDragEnd: (newCols: any[]) => void;
8
9
  }
9
10
  declare function SortTableContext({ children, enabledRowDragSort, dataSource, mergeRowKey, onDragEnd: dragEndEmit, }: SortTableContextProps): import("react/jsx-runtime").JSX.Element;