bitz-react-admin-ui 2.5.3 → 2.5.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.
@@ -1,82 +1,132 @@
1
1
  import { j as n } 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 { 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,
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,
22
51
  {
23
52
  type: "text",
24
- className: e.danger ? c : a,
53
+ className: e.danger ? o : d,
25
54
  children: e == null ? void 0 : e.label
26
55
  }
27
- ) }, o) : /* @__PURE__ */ n.jsx(
28
- p,
56
+ ) }, s) : /* @__PURE__ */ n.jsx(
57
+ x,
29
58
  {
30
59
  type: "text",
31
- className: e.danger ? c : a,
60
+ className: e.danger ? o : d,
32
61
  onClick: e == null ? void 0 : e.onClick,
33
62
  children: e == null ? void 0 : e.label
34
63
  },
35
- o
64
+ s
36
65
  )
37
66
  );
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)
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)
42
79
  );
43
80
  }
44
- return r;
45
- }, [s]), d = x(() => l != null && l.length ? l.map((t, r) => {
46
- let e = /* @__PURE__ */ n.jsx(
47
- p,
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,
48
87
  {
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",
60
88
  className: h,
61
- onClick: t.onClick,
89
+ skeletonCls: g,
62
90
  children: t == null ? void 0 : t.label
63
91
  },
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]);
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]);
69
119
  return /* @__PURE__ */ n.jsxs("div", { onClick: (i) => i.stopPropagation(), style: { overflow: "hidden" }, children: [
70
- /* @__PURE__ */ n.jsx(w, { size: S, ref: b, className: "actionGroup", children: d ?? m }),
71
- /* @__PURE__ */ n.jsx("div", { className: f })
120
+ /* @__PURE__ */ n.jsx(I, { size: H, ref: p, className: "actionGroup", children: k ?? j }),
121
+ /* @__PURE__ */ n.jsx("div", { className: B })
72
122
  ] });
73
123
  }
74
124
  );
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),
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),
80
130
  mobileHide: !0,
81
131
  isOperationCol: !0,
82
132
  title: "操作",
@@ -85,22 +135,23 @@ function J(s) {
85
135
  dataIndex: "operationCol",
86
136
  className: "operationCol",
87
137
  disabled: !0,
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")) ?? [];
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")) ?? [];
91
141
  return /* @__PURE__ */ n.jsx(
92
- M,
142
+ _,
93
143
  {
94
- actionGroup: k,
95
- customActions: g,
96
- ref: m
144
+ actionGroup: c,
145
+ customActions: i,
146
+ loading: r,
147
+ ref: d
97
148
  }
98
149
  );
99
150
  },
100
- ...h
101
- }), [i, m, l, a]);
151
+ ...y
152
+ }), [u, d, r, l, p]);
102
153
  }
103
154
  export {
104
- M as BitzTableAction,
105
- J as default
155
+ _ as BitzTableAction,
156
+ $ as default
106
157
  };
@@ -1,10 +1,9 @@
1
- import { TableProps } from 'antd';
2
1
  import { ReactNode } from 'react';
3
2
  interface SortTableContextProps {
4
3
  children?: ReactNode;
5
4
  enabledRowDragSort?: boolean;
6
5
  dataSource: any[];
7
- mergeRowKey: TableProps['rowKey'];
6
+ mergeRowKey: string;
8
7
  onDragEnd: (newCols: any[]) => void;
9
8
  }
10
9
  declare function SortTableContext({ children, enabledRowDragSort, dataSource, mergeRowKey, onDragEnd: dragEndEmit, }: SortTableContextProps): import("react/jsx-runtime").JSX.Element;