bitz-react-admin-ui 2.6.1 → 2.6.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.
Files changed (27) hide show
  1. package/dist/components/BitzConfigProvider/context.d.ts +7 -1
  2. package/dist/components/BitzTable/ActionCol/index.mjs +73 -73
  3. package/dist/components/BitzTable/Store/index.d.ts +30 -0
  4. package/dist/components/BitzTable/Store/index.mjs +246 -217
  5. package/dist/components/BitzTable/Store/utils/index.d.ts +1 -1
  6. package/dist/components/BitzTable/Store/utils/index.mjs +12 -12
  7. package/dist/components/BitzTable/Table/index.d.ts +9 -1
  8. package/dist/components/BitzTable/Table/index.mjs +429 -398
  9. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +103 -95
  10. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +2 -1
  11. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +243 -197
  12. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +141 -105
  13. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.d.ts +8 -0
  14. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.mjs +23 -0
  15. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +127 -74
  16. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +76 -25
  17. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +151 -96
  18. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +29 -27
  19. package/dist/components/BitzTable/ToolBar/Modal/index.mjs +19 -9
  20. package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +4 -0
  21. package/dist/components/BitzTable/ToolBar/Modal/style.mjs +42 -14
  22. package/dist/components/BitzTable/index.d.ts +2 -0
  23. package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/debounce.mjs +34 -37
  24. package/dist/style.css +1 -1
  25. package/package.json +1 -1
  26. package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useDebounceFn/index.mjs +0 -29
  27. package/dist/node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/utils/lodash-polyfill.mjs +0 -7
@@ -1,138 +1,146 @@
1
1
  import { j as t } from "../../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
2
- import { Card as ne, Flex as I, Segmented as le, message as $ } from "antd";
3
- import { useState as p, useContext as q, useRef as s, useMemo as ie, useEffect as G } from "react";
4
- import { BitzTableContext as ce } from "../../Store/index.mjs";
5
- import J from "../../../BitzButton/index.mjs";
6
- import ae from "../../../BitzTheme/index.mjs";
7
- import fe from "./StylesConfig/index.mjs";
8
- import me from "./ColumnsSort/index.mjs";
9
- import ue from "./ExportConfig/index.mjs";
10
- import { BitzConfigContext as pe } from "../../../BitzConfigProvider/context.mjs";
11
- import de from "../Modal/index.mjs";
12
- import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.7/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
13
- import xe from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
14
- const ye = "导出设置", Fe = ({
15
- open: d,
16
- title: P,
17
- onChange: a,
18
- close: f,
19
- getContainer: Q
2
+ import { Card as ue, Flex as G, Segmented as ge, message as I } from "antd";
3
+ import { useState as f, useContext as W, useRef as l, useMemo as pe, useEffect as $ } from "react";
4
+ import { BitzTableContext as de } from "../../Store/index.mjs";
5
+ import q from "../../../BitzButton/index.mjs";
6
+ import he from "../../../BitzTheme/index.mjs";
7
+ import xe from "./StylesConfig/index.mjs";
8
+ import ye from "./ColumnsSort/index.mjs";
9
+ import Ce from "./ExportConfig/index.mjs";
10
+ import { BitzConfigContext as Se } from "../../../BitzConfigProvider/context.mjs";
11
+ import He from "../Modal/index.mjs";
12
+ import { blockGap as J, modalHeaderHeight as P, modalFooterHeight as Q } from "../Modal/style.mjs";
13
+ import je from "../../../../node_modules/.store/@ant-design_icons@5.3.7/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
14
+ import Ee from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
15
+ const Te = "导出设置", Ae = ({
16
+ open: p,
17
+ title: U,
18
+ onChange: u,
19
+ close: g,
20
+ getContainer: X
20
21
  }) => {
21
- const { token: v } = ae.useToken(), [r, o] = p(-1), [U, g] = p(!1);
22
- p(!1);
23
- const [W, n] = p(!1), {
24
- persistenceType: X,
25
- persistenceKey: H,
26
- onlineChange: x,
27
- setColumnsMap: Y,
28
- stylesStorageType: Z,
29
- stylesStorageKey: k,
30
- setTableStylesConfig: y,
31
- onlineStylesConfigChange: h,
32
- defaultTableExportConfig: _,
33
- exportStorageType: ee,
34
- exportStorageKey: B,
35
- setTableExportConfig: te,
22
+ const { token: b } = he.useToken(), [n, i] = f(-1), [Y, d] = f(!1);
23
+ f(!1);
24
+ const [Z, c] = f(!1), {
25
+ persistenceType: _,
26
+ persistenceKey: k,
27
+ onlineChange: h,
28
+ setColumnsMap: ee,
29
+ stylesStorageType: te,
30
+ stylesStorageKey: v,
31
+ setTableStylesConfig: x,
32
+ onlineStylesConfigChange: y,
33
+ defaultTableExportConfig: oe,
34
+ exportStorageType: re,
35
+ exportStorageKey: w,
36
+ setTableExportConfig: se,
36
37
  onlineExportConfigChange: C
37
- } = q(ce), l = q(pe).Table, i = s(null), E = s(null), S = s(null), re = async () => {
38
- var K, M, O, V, w, L, N, A, D;
39
- if (W)
38
+ } = W(de), a = W(Se).Table, m = l(null), B = l(null), S = l(null), ne = async () => {
39
+ var F, K, M, O, V, N, L, A, D;
40
+ if (Z)
40
41
  return;
41
- n(!0);
42
- const e = (K = i.current) == null ? void 0 : K.getCheckedKeys();
42
+ c(!0);
43
+ const e = (F = m.current) == null ? void 0 : F.getCheckedKeys();
43
44
  if (!(e != null && e.length)) {
44
- o(2), $.error("表格至少需要显示一列"), n(!1);
45
+ i(2), I.error("表格至少需要显示一列"), c(!1);
45
46
  return;
46
47
  }
47
- if (!((M = S.current) == null ? void 0 : M.hasOne())) {
48
- o(3), $.error("导出设置至少需要一个字段"), n(!1);
48
+ if (!((K = S.current) == null ? void 0 : K.hasOne())) {
49
+ i(3), I.error("导出设置至少需要一个字段"), c(!1);
49
50
  return;
50
51
  }
51
- const c = (O = E.current) == null ? void 0 : O.getFormInstance(), u = await (c == null ? void 0 : c.getFieldsValue()), oe = xe(u, "stylesScope"), T = {
52
- ...(V = i.current) == null ? void 0 : V.getLeftSortColumns(),
53
- ...(w = i.current) == null ? void 0 : w.getCenterSortColumns(),
54
- ...(L = i.current) == null ? void 0 : L.getRightSortColumns()
55
- }, b = ((N = S.current) == null ? void 0 : N.getExportConfig()) ?? _;
56
- y == null || y(oe), (A = l == null ? void 0 : l.setStylesScope) == null || A.call(l, u.stylesScope ? "global" : "current"), Y(T), te(b), Z === "online" && k && (h == null || h(k, u)), X === "online" && H && (x == null || x(H, T)), ee === "online" && B && (C == null || C(B, b)), n(!1), a ? (g(!0), (D = a == null ? void 0 : a(u, T, b)) == null || D.finally(() => {
57
- g(!1), f();
58
- })) : f();
52
+ const o = (M = B.current) == null ? void 0 : M.getFormInstance(), s = await (o == null ? void 0 : o.getFieldsValue()), fe = Ee(s, "stylesScope"), T = {
53
+ ...(O = m.current) == null ? void 0 : O.getLeftSortColumns(),
54
+ ...(V = m.current) == null ? void 0 : V.getCenterSortColumns(),
55
+ ...(N = m.current) == null ? void 0 : N.getRightSortColumns()
56
+ }, R = ((L = S.current) == null ? void 0 : L.getExportConfig()) ?? oe;
57
+ x == null || x(fe), (A = a == null ? void 0 : a.setStylesScope) == null || A.call(a, s.stylesScope ? "global" : "current"), ee(T), se(R), te === "online" && v && (y == null || y(v, s)), _ === "online" && k && (h == null || h(k, T)), re === "online" && w && (C == null || C(w, R)), c(!1), u ? (d(!0), (D = u == null ? void 0 : u(s, T, R)) == null || D.finally(() => {
58
+ d(!1), g();
59
+ })) : g();
59
60
  };
60
- ie(() => v.mode === "dark", [v.mode]);
61
- const se = () => {
62
- o(-1), g(!1), n(!1);
63
- }, j = s(null), z = s(null), F = s({
61
+ pe(() => b.mode === "dark", [b.mode]);
62
+ const le = () => {
63
+ i(-1), d(!1), c(!1);
64
+ }, ie = (e) => {
65
+ i(e), H.current.parentElement.scrollTop = 0;
66
+ }, H = l(null), j = l(null), [ce, ae] = f("auto"), E = l({
64
67
  1: 0,
65
68
  2: 0,
66
69
  3: 0
67
- }), R = (e, m) => {
68
- F.current[m] = e;
70
+ }), me = () => {
71
+ var o;
72
+ const e = (o = j.current) == null ? void 0 : o.clientHeight, r = window.innerHeight - J - P - Q - 48 - e - 32;
73
+ E.current[2] = window.innerHeight - J, ae(r);
74
+ }, z = (e, r) => {
75
+ var s;
76
+ const o = (s = j.current) == null ? void 0 : s.clientHeight;
77
+ E.current[r] = P + Q + 48 + 32 + o + e;
69
78
  };
70
- return G(() => {
71
- var e;
72
- if (j.current) {
73
- const m = (e = z.current) == null ? void 0 : e.clientHeight, c = F.current[r] + m + 24 + 48;
74
- j.current.style.height = `${c}px`;
75
- }
76
- }, [r]), G(() => {
77
- d && o(1);
78
- }, [d]), /* @__PURE__ */ t.jsx(
79
- de,
79
+ return $(() => {
80
+ var r, o;
81
+ const e = (o = (r = H.current) == null ? void 0 : r.parentElement) == null ? void 0 : o.parentElement;
82
+ e && (e.style.height = `${E.current[n]}px`);
83
+ }, [n]), $(() => {
84
+ p && i(1);
85
+ }, [p]), /* @__PURE__ */ t.jsx(
86
+ He,
80
87
  {
81
- open: d,
82
- title: P,
83
- close: f,
84
- closeAfter: se,
85
- getContainer: Q,
88
+ open: p,
89
+ title: U,
90
+ close: g,
91
+ closeAfter: le,
92
+ getContainer: X,
86
93
  footer: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
87
94
  /* @__PURE__ */ t.jsx(
88
- J,
95
+ q,
89
96
  {
90
97
  type: "primary",
91
- icon: /* @__PURE__ */ t.jsx(ge, {}),
92
- onClick: re,
93
- loading: U,
98
+ icon: /* @__PURE__ */ t.jsx(je, {}),
99
+ onClick: ne,
100
+ loading: Y,
94
101
  children: "保存"
95
102
  }
96
103
  ),
97
- /* @__PURE__ */ t.jsx(J, { onClick: f, children: "取消" })
104
+ /* @__PURE__ */ t.jsx(q, { onClick: g, children: "取消" })
98
105
  ] }),
99
- children: /* @__PURE__ */ t.jsx(ne, { className: "container", bordered: !1, ref: j, children: /* @__PURE__ */ t.jsxs(I, { vertical: !0, align: "center", gap: 24, children: [
100
- /* @__PURE__ */ t.jsx("div", { ref: z, children: /* @__PURE__ */ t.jsx(
101
- le,
106
+ children: /* @__PURE__ */ t.jsx(ue, { className: "container", bordered: !1, ref: H, children: /* @__PURE__ */ t.jsxs(G, { vertical: !0, align: "center", children: [
107
+ /* @__PURE__ */ t.jsx("div", { className: "segmentedWrapper", ref: j, children: /* @__PURE__ */ t.jsx(
108
+ ge,
102
109
  {
103
110
  size: "large",
104
111
  options: [
105
112
  { label: "外观设置", value: 1 },
106
113
  { label: "列设置", value: 2 },
107
- { label: ye, value: 3 }
114
+ { label: Te, value: 3 }
108
115
  ],
109
- value: r,
110
- onChange: o
116
+ value: n,
117
+ onChange: ie
111
118
  }
112
119
  ) }),
113
- /* @__PURE__ */ t.jsxs(I, { className: "containerBody", children: [
120
+ /* @__PURE__ */ t.jsxs(G, { className: "containerBody", children: [
114
121
  /* @__PURE__ */ t.jsx(
115
- fe,
122
+ xe,
116
123
  {
117
- ref: E,
118
- postHeight: (e) => R(e, 1),
119
- display: r === 1
124
+ ref: B,
125
+ postHeight: (e) => z(e, 1),
126
+ display: n === 1
120
127
  }
121
128
  ),
122
129
  /* @__PURE__ */ t.jsx(
123
- me,
130
+ ye,
124
131
  {
125
- ref: i,
126
- postHeight: (e) => R(e, 2),
127
- display: r === 2
132
+ ref: m,
133
+ postHeight: me,
134
+ height: ce,
135
+ display: n === 2
128
136
  }
129
137
  ),
130
138
  /* @__PURE__ */ t.jsx(
131
- ue,
139
+ Ce,
132
140
  {
133
141
  refInstance: S,
134
- postHeight: (e) => R(e, 3),
135
- display: r === 3,
142
+ postHeight: (e) => z(e, 3),
143
+ display: n === 3,
136
144
  showSelectRadio: !1
137
145
  }
138
146
  )
@@ -142,6 +150,6 @@ const ye = "导出设置", Fe = ({
142
150
  );
143
151
  };
144
152
  export {
145
- Fe as default,
146
- ye as exportConfigTitle
153
+ Ae as default,
154
+ Te as exportConfigTitle
147
155
  };
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface ColumnsSortProps {
3
3
  display: boolean;
4
- postHeight: (number: any) => void;
4
+ height: number | 'auto';
5
+ postHeight: () => void;
5
6
  parentHeight?: any;
6
7
  }
7
8
  export interface ColumnsSortImperativeProps {