bitz-react-admin-ui 2.5.6 → 2.5.7

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 (23) hide show
  1. package/dist/_virtual/index.mjs +2 -2
  2. package/dist/_virtual/index2.mjs +2 -2
  3. package/dist/components/BitzTable/Store/index.d.ts +14 -1
  4. package/dist/components/BitzTable/Store/index.mjs +64 -59
  5. package/dist/components/BitzTable/Table/index.d.ts +2 -5
  6. package/dist/components/BitzTable/Table/index.mjs +319 -319
  7. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +55 -63
  8. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +160 -162
  9. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.d.ts +1 -1
  10. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +78 -79
  11. package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.mjs +47 -47
  12. package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +6 -4
  13. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.d.ts +1 -1
  14. package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +40 -45
  15. package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +29 -34
  16. package/dist/components/BitzTable/ToolBar/Modal/index.d.ts +3 -2
  17. package/dist/components/BitzTable/ToolBar/Modal/index.mjs +38 -56
  18. package/dist/components/BitzTable/ToolBar/Modal/style.mjs +12 -8
  19. package/dist/components/BitzTable/ToolBar/index.d.ts +1 -1
  20. package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
  21. package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
  22. package/dist/style.css +1 -1
  23. package/package.json +1 -1
@@ -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,4 +1,4 @@
1
- var s = { exports: {} };
1
+ var p = { exports: {} };
2
2
  export {
3
- s as __module
3
+ p as __module
4
4
  };
@@ -4,6 +4,10 @@ import { BitzTableBorderedType, StylesConfigScopeType } from '../../BitzConfigPr
4
4
  export declare const SORTER_COLUMN: BitzTableColumnType;
5
5
  export declare const toolCols: {}[];
6
6
  export type DensitySize = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | undefined;
7
+ export interface BitzTablePaginationProps {
8
+ page: number;
9
+ size: number;
10
+ }
7
11
  export type ColumnStateType<TableKey extends string = any> = {
8
12
  /**
9
13
  * 持久化的类型,支持 localStorage 和 sessionStorage
@@ -41,7 +45,7 @@ export interface StylesStateType<TableKey = any> {
41
45
  onlineChange?: (key: TableKey, state: StylesConfigOnChangeValue) => void;
42
46
  onlineGet?: (key: TableKey) => Promise<StylesConfigProps | null | undefined>;
43
47
  }
44
- export interface ExportFieldsConfigProps extends Omit<ColumnsConfigProps, 'fixed' | 'order'> {
48
+ export interface ExportFieldsConfigProps extends Omit<ColumnsConfigProps, 'fixed' | 'order' | 'width'> {
45
49
  field: string;
46
50
  title: string;
47
51
  }
@@ -71,6 +75,9 @@ export interface ExportColumnStateType<TableKey = any> {
71
75
  }
72
76
  export type UseContainerProps<T = any> = {
73
77
  loading?: boolean;
78
+ dataSource?: T[];
79
+ total?: number;
80
+ pagination?: BitzTablePaginationProps;
74
81
  /** 列配置 */
75
82
  columnsStateMap?: Record<string, ColumnsConfigProps>;
76
83
  onColumnsStateChange?: (map: Record<string, ColumnsConfigProps>) => void;
@@ -96,6 +103,9 @@ export type UseContainerProps<T = any> = {
96
103
  };
97
104
  declare function useContainer(props: UseContainerProps): {
98
105
  loading: boolean;
106
+ dataSource: any[] | undefined;
107
+ pagination: BitzTablePaginationProps | undefined;
108
+ total: number | undefined;
99
109
  uuid: string;
100
110
  fullscreen: boolean;
101
111
  setFullscreen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -136,6 +146,9 @@ declare function useContainer(props: UseContainerProps): {
136
146
  };
137
147
  declare const BitzTableContext: import("react").Context<{
138
148
  loading: boolean;
149
+ dataSource: any[] | undefined;
150
+ pagination: BitzTablePaginationProps | undefined;
151
+ total: number | undefined;
139
152
  uuid: string;
140
153
  fullscreen: boolean;
141
154
  setFullscreen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -22,14 +22,14 @@ const Be = {
22
22
  fe.EXPAND_COLUMN
23
23
  ];
24
24
  function Me(e) {
25
- var H, R, L, P, U, D, _, F, G, W, Z, A, X, q, Q, Y, $, p, ee, te, ne, ie, ae, oe, ce;
25
+ var H, R, L, P, U, D, _, F, G, W, Z, A, X, q, Q, Y, $, p, ee, te, ne, ie, ae, oe, le;
26
26
  const T = Ne(Ie()), [re, se] = K(!1), [ue, de] = K(!1), [ye, Se] = K(0), s = Ee(Je).Table, Ce = s == null ? void 0 : s.defaultSize, I = e.size ?? e.defaultSize ?? Ce ?? "lg", ge = e.zebra ?? e.defaultZebra ?? (s == null ? void 0 : s.zebra) ?? !0, me = e.bordered ?? e.defaultBordered ?? (s == null ? void 0 : s.bordered) ?? "row-column", O = e.defaultStylesConfig || {
27
27
  size: I,
28
28
  zebra: ge,
29
29
  bordered: me
30
30
  }, [y, J] = z(
31
31
  () => {
32
- var n, c, l, a;
32
+ var n, l, c, a;
33
33
  const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.stylesConfigState || {};
34
34
  if (i && t && typeof window < "u" && t !== "online") {
35
35
  const f = window[t];
@@ -38,13 +38,13 @@ function Me(e) {
38
38
  if (r)
39
39
  return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? m(
40
40
  JSON.parse(r),
41
- (c = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : c.defaultValue
41
+ (l = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : l.defaultValue
42
42
  ) : JSON.parse(r);
43
43
  } catch (r) {
44
44
  console.warn(r);
45
45
  }
46
46
  }
47
- return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) || O;
47
+ return e.stylesConfig || ((c = e.stylesConfigState) == null ? void 0 : c.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) || O;
48
48
  },
49
49
  {
50
50
  value: ((H = e.stylesConfigState) == null ? void 0 : H.value) || e.stylesConfig,
@@ -61,11 +61,11 @@ function Me(e) {
61
61
  // onlineChange
62
62
  } = e.stylesConfigState;
63
63
  if (t !== "online") {
64
- const c = window[t];
64
+ const l = window[t];
65
65
  try {
66
- c == null || c.setItem(i, JSON.stringify(y));
67
- } catch (l) {
68
- console.warn(l), j();
66
+ l == null || l.setItem(i, JSON.stringify(y));
67
+ } catch (c) {
68
+ console.warn(c), j();
69
69
  }
70
70
  }
71
71
  }, [
@@ -75,21 +75,23 @@ function Me(e) {
75
75
  ]), d(() => {
76
76
  var t, i, o;
77
77
  if ((t = e.stylesConfigState) != null && t.persistenceKey && ((i = e.stylesConfigState) == null ? void 0 : i.persistenceType) === "online") {
78
- const { onlineGet: n, persistenceKey: c } = e.stylesConfigState;
78
+ const { onlineGet: n, persistenceKey: l } = e.stylesConfigState;
79
79
  try {
80
- (o = n == null ? void 0 : n(c)) == null || o.then((l) => {
80
+ (o = n == null ? void 0 : n(l)) == null || o.then((c) => {
81
81
  var f;
82
- const a = m(l ?? {}, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
82
+ const a = m(c ?? {}, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
83
83
  J(
84
84
  Object.keys(a).length ? a : O
85
85
  );
86
86
  });
87
- } catch (l) {
88
- console.warn(l);
87
+ } catch (c) {
88
+ console.warn(c);
89
89
  }
90
90
  }
91
91
  }, []);
92
- const u = g(() => (e.columns ?? []).filter((t) => !je.includes(t)), [e.columns]), h = g(() => {
92
+ const u = g(() => (e.columns ?? []).filter(
93
+ (t) => !je.includes(t) && t.title
94
+ ), [e.columns]), h = g(() => {
93
95
  var i;
94
96
  if ((i = e == null ? void 0 : e.exportConfigState) != null && i.defaultValue)
95
97
  return e.exportConfigState.defaultValue;
@@ -101,16 +103,16 @@ function Me(e) {
101
103
  }
102
104
  };
103
105
  return u.forEach((o, n) => {
104
- const { title: c, isOperationCol: l } = o, a = E(o, n);
105
- a && !l && t.fields.push({
106
+ const { title: l, isOperationCol: c } = o, a = E(o, n);
107
+ a && !c && t.fields.push({
106
108
  field: a,
107
- title: c,
109
+ title: l,
108
110
  show: !0
109
111
  });
110
112
  }), t;
111
113
  }, [u]), [V, x] = z(
112
114
  () => {
113
- var n, c, l, a;
115
+ var n, l, c, a;
114
116
  const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.exportConfigState || {};
115
117
  if (i && t && typeof window < "u" && t !== "online") {
116
118
  const f = window[t];
@@ -119,13 +121,13 @@ function Me(e) {
119
121
  if (r)
120
122
  return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? m(
121
123
  JSON.parse(r),
122
- (c = e == null ? void 0 : e.exportConfigState) == null ? void 0 : c.defaultValue
124
+ (l = e == null ? void 0 : e.exportConfigState) == null ? void 0 : l.defaultValue
123
125
  ) : JSON.parse(r);
124
126
  } catch (r) {
125
127
  console.warn(r);
126
128
  }
127
129
  }
128
- return e.exportConfig || ((l = e.exportConfigState) == null ? void 0 : l.value) || ((a = e.exportConfigState) == null ? void 0 : a.defaultValue) || h;
130
+ return e.exportConfig || ((c = e.exportConfigState) == null ? void 0 : c.value) || ((a = e.exportConfigState) == null ? void 0 : a.defaultValue) || h;
129
131
  },
130
132
  {
131
133
  value: ((U = e.exportConfigState) == null ? void 0 : U.value) || e.exportConfig,
@@ -133,16 +135,16 @@ function Me(e) {
133
135
  }
134
136
  );
135
137
  d(() => {
136
- var n, c;
138
+ var n, l;
137
139
  const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.exportConfigState || {};
138
140
  if (i && t && typeof window < "u" && t !== "online") {
139
- const l = window[t];
141
+ const c = window[t];
140
142
  try {
141
- const a = l == null ? void 0 : l.getItem(i);
143
+ const a = c == null ? void 0 : c.getItem(i);
142
144
  a ? (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? x(
143
145
  m(
144
146
  JSON.parse(a),
145
- (c = e == null ? void 0 : e.exportConfigState) == null ? void 0 : c.defaultValue
147
+ (l = e == null ? void 0 : e.exportConfigState) == null ? void 0 : l.defaultValue
146
148
  )
147
149
  ) : x(JSON.parse(a)) : x(h);
148
150
  } catch (a) {
@@ -163,11 +165,11 @@ function Me(e) {
163
165
  // onlineChange
164
166
  } = e.exportConfigState;
165
167
  if (t !== "online") {
166
- const c = window[t];
168
+ const l = window[t];
167
169
  try {
168
- c == null || c.setItem(i, JSON.stringify(V));
169
- } catch (l) {
170
- console.warn(l), M();
170
+ l == null || l.setItem(i, JSON.stringify(V));
171
+ } catch (c) {
172
+ console.warn(c), M();
171
173
  }
172
174
  }
173
175
  }, [
@@ -177,37 +179,37 @@ function Me(e) {
177
179
  ]), d(() => {
178
180
  var t, i, o;
179
181
  if ((t = e.exportConfigState) != null && t.persistenceKey && ((i = e.exportConfigState) == null ? void 0 : i.persistenceType) === "online") {
180
- const { onlineGet: n, persistenceKey: c } = e.exportConfigState;
182
+ const { onlineGet: n, persistenceKey: l } = e.exportConfigState;
181
183
  try {
182
- (o = n == null ? void 0 : n(c)) == null || o.then((l) => {
184
+ (o = n == null ? void 0 : n(l)) == null || o.then((c) => {
183
185
  var f;
184
- const a = m(l ?? {}, (f = e == null ? void 0 : e.exportConfigState) == null ? void 0 : f.value);
186
+ const a = m(c ?? {}, (f = e == null ? void 0 : e.exportConfigState) == null ? void 0 : f.value);
185
187
  x(
186
188
  Object.keys(a).length ? a : h
187
189
  );
188
190
  });
189
- } catch (l) {
190
- console.warn(l);
191
+ } catch (c) {
192
+ console.warn(c);
191
193
  }
192
194
  }
193
195
  }, []);
194
196
  const S = g(() => {
195
- var l;
196
- if ((l = e == null ? void 0 : e.columnsState) != null && l.defaultValue)
197
+ var c;
198
+ if ((c = e == null ? void 0 : e.columnsState) != null && c.defaultValue)
197
199
  return e.columnsState.defaultValue;
198
- const t = u.filter((a) => a.fixed === "left").map((a, f) => ({ ...a, order: f })), i = u.filter((a) => a.fixed === "right").map((a, f) => ({ ...a, order: f })), o = u.filter((a) => !["left", "right"].includes(a.fixed)).map((a, f) => ({ ...a, order: f })), n = [...t, ...o, ...i], c = {};
200
+ const t = u.filter((a) => a.fixed === "left").map((a, f) => ({ ...a, order: f })), i = u.filter((a) => a.fixed === "right").map((a, f) => ({ ...a, order: f })), o = u.filter((a) => !["left", "right"].includes(a.fixed)).map((a, f) => ({ ...a, order: f })), n = [...t, ...o, ...i], l = {};
199
201
  return n.forEach((a, f) => {
200
- const { order: r, width: le, fixed: Oe, disabled: Ve } = a, v = E(a, f);
201
- v && (c[v] = {
202
+ const { order: r, width: ce, fixed: Oe, disabled: Ve } = a, v = E(a, f);
203
+ v && (l[v] = {
202
204
  show: !0,
203
205
  order: r,
204
206
  fixed: Oe,
205
207
  disabled: Ve
206
- }, typeof le == "number" && (c[v].width = le));
207
- }), c;
208
+ }, typeof ce == "number" && (l[v].width = ce));
209
+ }), l;
208
210
  }, [u]), [we, he] = K(!1), [C, w] = z(
209
211
  () => {
210
- var n, c, l, a;
212
+ var n, l, c, a;
211
213
  const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.columnsState || {};
212
214
  if (i && t && typeof window < "u" && t !== "online") {
213
215
  const f = window[t];
@@ -216,13 +218,13 @@ function Me(e) {
216
218
  if (r)
217
219
  return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? m(
218
220
  JSON.parse(r),
219
- (c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
221
+ (l = e == null ? void 0 : e.columnsState) == null ? void 0 : l.defaultValue
220
222
  ) : JSON.parse(r);
221
223
  } catch (r) {
222
224
  console.warn(r);
223
225
  }
224
226
  }
225
- return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((a = e.columnsState) == null ? void 0 : a.defaultValue) || {};
227
+ return e.columnsStateMap || ((c = e.columnsState) == null ? void 0 : c.value) || ((a = e.columnsState) == null ? void 0 : a.defaultValue) || {};
226
228
  },
227
229
  {
228
230
  value: ((Z = e.columnsState) == null ? void 0 : Z.value) || e.columnsStateMap,
@@ -230,16 +232,16 @@ function Me(e) {
230
232
  }
231
233
  );
232
234
  d(() => {
233
- var n, c;
235
+ var n, l;
234
236
  const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.columnsState || {};
235
237
  if (i && t && typeof window < "u" && t !== "online") {
236
- const l = window[t];
238
+ const c = window[t];
237
239
  try {
238
- const a = l == null ? void 0 : l.getItem(i);
240
+ const a = c == null ? void 0 : c.getItem(i);
239
241
  a ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? w(
240
242
  m(
241
243
  JSON.parse(a),
242
- (c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
244
+ (l = e == null ? void 0 : e.columnsState) == null ? void 0 : l.defaultValue
243
245
  )
244
246
  ) : w(JSON.parse(a)) : w(S);
245
247
  } catch (a) {
@@ -292,11 +294,11 @@ function Me(e) {
292
294
  // onlineChange
293
295
  } = e.columnsState;
294
296
  if (t !== "online") {
295
- const c = window[t];
297
+ const l = window[t];
296
298
  try {
297
- c == null || c.setItem(i, JSON.stringify(C));
298
- } catch (l) {
299
- console.warn(l), B();
299
+ l == null || l.setItem(i, JSON.stringify(C));
300
+ } catch (c) {
301
+ console.warn(c), B();
300
302
  }
301
303
  }
302
304
  }, [
@@ -306,23 +308,23 @@ function Me(e) {
306
308
  ]), d(() => {
307
309
  var t, i, o;
308
310
  if ((t = e.columnsState) != null && t.persistenceKey && ((i = e.columnsState) == null ? void 0 : i.persistenceType) === "online") {
309
- const { onlineGet: n, persistenceKey: c } = e.columnsState;
311
+ const { onlineGet: n, persistenceKey: l } = e.columnsState;
310
312
  try {
311
- (o = n == null ? void 0 : n(c)) == null || o.then((l) => {
313
+ (o = n == null ? void 0 : n(l)) == null || o.then((c) => {
312
314
  var f;
313
- const a = m(l ?? {}, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
315
+ const a = m(c ?? {}, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
314
316
  w(a), he(!0);
315
317
  });
316
- } catch (l) {
317
- console.warn(l);
318
+ } catch (c) {
319
+ console.warn(c);
318
320
  }
319
321
  }
320
322
  }, []), d(() => {
321
323
  var i, o;
322
324
  const t = u.findIndex((n) => n == null ? void 0 : n.isOperationCol);
323
325
  if (t >= 0) {
324
- const n = u[t], c = E(n, t);
325
- !(((i = C == null ? void 0 : C[c]) == null ? void 0 : i.fixed) === ((o = S == null ? void 0 : S[c]) == null ? void 0 : o.fixed)) && Object.keys(C ?? {}).length === 0 && w(S);
326
+ const n = u[t], l = E(n, t);
327
+ !(((i = C == null ? void 0 : C[l]) == null ? void 0 : i.fixed) === ((o = S == null ? void 0 : S[l]) == null ? void 0 : o.fixed)) && Object.keys(C ?? {}).length === 0 && w(S);
326
328
  }
327
329
  }, [S, C]);
328
330
  const xe = g(() => (e == null ? void 0 : e.rowHoverable) ?? (s == null ? void 0 : s.rowHoverable) ?? !0, [e == null ? void 0 : e.rowHoverable, s == null ? void 0 : s.rowHoverable]), Te = g(() => e.zebra ?? y.zebra, [e.zebra, y.zebra]), b = g(() => e.bordered ?? y.bordered, [e.bordered, y.bordered]), be = g(() => ["column", "row-column"].includes(b), [b]), Ke = g(() => {
@@ -330,6 +332,9 @@ function Me(e) {
330
332
  return ["hide", "column"].includes(b) && (t = !0), t;
331
333
  }, [b]), k = {
332
334
  loading: e.loading ?? !1,
335
+ dataSource: e.dataSource,
336
+ pagination: e.pagination,
337
+ total: e.total,
333
338
  uuid: T.current,
334
339
  fullscreen: re,
335
340
  setFullscreen: se,
@@ -361,7 +366,7 @@ function Me(e) {
361
366
  defaultTableExportConfig: h,
362
367
  exportStorageType: (ae = e.exportConfigState) == null ? void 0 : ae.persistenceType,
363
368
  exportStorageKey: (oe = e.exportConfigState) == null ? void 0 : oe.persistenceKey,
364
- onlineExportConfigChange: (ce = e.exportConfigState) == null ? void 0 : ce.onlineChange,
369
+ onlineExportConfigChange: (le = e.exportConfigState) == null ? void 0 : le.onlineChange,
365
370
  clearExportConfigCache: M,
366
371
  zebra: Te,
367
372
  rowHoverable: xe,
@@ -3,7 +3,7 @@ import { TableProps } from 'antd';
3
3
  import { SkeletonParagraphProps } from 'antd/es/skeleton/Paragraph';
4
4
  import { AnyObject } from 'antd/es/_util/type';
5
5
  import type { RowClassName } from 'rc-table/es/interface';
6
- import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
6
+ import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType, BitzTablePaginationProps } from '../Store';
7
7
  import { ActionsFunType, BitzTableColumnsType, SelelctionAlertProps } from '..';
8
8
  import { BitzTableBorderedType } from '../../BitzConfigProvider/context';
9
9
  import './index.less';
@@ -52,10 +52,7 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
52
52
  /** 多选/单选 相关 */
53
53
  selectionAlert?: SelelctionAlertProps;
54
54
  /** 分页控件的分页属性 */
55
- pagination?: {
56
- page: number;
57
- size: number;
58
- };
55
+ pagination?: BitzTablePaginationProps;
59
56
  /** PC端:给父组件传值 page当前第几页 pageSize每页有多少 */
60
57
  paginationEmit?: (page: number, pageSize: number) => void;
61
58
  /** PC端:是否启用拖拽 */