bitz-react-admin-ui 2.1.9 → 2.2.0
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.
- package/dist/_virtual/index.mjs +2 -2
- package/dist/_virtual/index2.mjs +2 -2
- package/dist/components/BitzTable/ActionBar/ActionBar.mjs +26 -22
- package/dist/components/BitzTable/ActionCol/index.d.ts +1 -1
- package/dist/components/BitzTable/ActionCol/index.mjs +61 -61
- package/dist/components/BitzTable/SelectionBar/Button.d.ts +2 -3
- package/dist/components/BitzTable/SelectionBar/Button.mjs +19 -25
- package/dist/components/BitzTable/SelectionBar/SelectionBar.mjs +24 -21
- package/dist/components/BitzTable/Store/index.d.ts +43 -22
- package/dist/components/BitzTable/Store/index.mjs +128 -125
- package/dist/components/BitzTable/Store/utils/index.d.ts +4 -5
- package/dist/components/BitzTable/Store/utils/index.mjs +31 -31
- package/dist/components/BitzTable/SubTable/index.mjs +90 -106
- package/dist/components/BitzTable/Table/SortTableContext.d.ts +12 -0
- package/dist/components/BitzTable/Table/SortTableContext.mjs +25 -0
- package/dist/components/BitzTable/Table/SortableRow.d.ts +7 -0
- package/dist/components/BitzTable/Table/SortableRow.mjs +54 -0
- package/dist/components/BitzTable/Table/index.d.ts +5 -0
- package/dist/components/BitzTable/Table/index.mjs +265 -244
- package/dist/components/BitzTable/Table/utils.mjs +17 -16
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.d.ts +1 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +84 -97
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.d.ts +5 -4
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.mjs +66 -60
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndList.mjs +78 -72
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +1 -3
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +190 -189
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.d.ts +8 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.mjs +94 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.d.ts +10 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.mjs +58 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.d.ts +13 -7
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +119 -80
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.d.ts +2 -2
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +26 -29
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.d.ts +3 -1
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +53 -77
- package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.d.ts +2 -2
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.d.ts +12 -0
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +61 -0
- package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +50 -59
- package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +27 -32
- package/dist/components/BitzTable/ToolBar/Modal/index.d.ts +18 -0
- package/dist/components/BitzTable/ToolBar/Modal/index.mjs +50 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +2 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.mjs +58 -0
- package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +20 -20
- package/dist/components/BitzTable/ToolBar/index.d.ts +12 -11
- package/dist/components/BitzTable/index.d.ts +2 -0
- package/dist/node_modules/.store/@ant-design_icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.mjs +5 -0
- package/dist/node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs +15 -0
- package/dist/node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1098 -753
- package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
- package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/findNode.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/BitzTable/Select/index.mjs +0 -11
- package/dist/components/BitzTable/Select/style.mjs +0 -66
- package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.mjs +0 -78
- package/dist/components/BitzTable/ToolBar/ExportIcon/styles.mjs +0 -47
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { genColumnKey as
|
|
5
|
-
import { getUuid as
|
|
6
|
-
import { BitzConfigContext as
|
|
1
|
+
import { j as Oe } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import O from "../../../hooks/useMergedState.mjs";
|
|
3
|
+
import { createContext as ze, useRef as Je, useState as ue, useContext as Ne, useEffect as y, useMemo as C, useCallback as z } from "react";
|
|
4
|
+
import { genColumnKey as re } from "./utils/index.mjs";
|
|
5
|
+
import { getUuid as Ie } from "../../../utils/uuid.mjs";
|
|
6
|
+
import { BitzConfigContext as Ee } from "../../BitzConfigProvider/context.mjs";
|
|
7
7
|
import S from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
8
|
-
function
|
|
9
|
-
var H,
|
|
10
|
-
const
|
|
11
|
-
size:
|
|
12
|
-
zebra:
|
|
13
|
-
bordered:
|
|
14
|
-
}, [
|
|
8
|
+
function Be(e) {
|
|
9
|
+
var j, k, H, D, P, R, G, Z, F, U, q, A, L, Q, W, X, Y, _, $, p, ee, te, ne, ie, ae;
|
|
10
|
+
const T = Je(Ie()), [se, de] = ue(!1), [ye, Se] = ue(!1), r = Ne(Ee).Table, ge = r == null ? void 0 : r.defaultSize, J = e.defaultSize ?? ge ?? "lg", Ce = e.defaultZebra ?? (r == null ? void 0 : r.zebra) ?? !0, me = e.defaultBordered ?? (r == null ? void 0 : r.bordered) ?? "row-column", b = e.defaultStylesConfig || {
|
|
11
|
+
size: J,
|
|
12
|
+
zebra: Ce,
|
|
13
|
+
bordered: me
|
|
14
|
+
}, [d, N] = O(
|
|
15
15
|
() => {
|
|
16
16
|
var n, o, c, l;
|
|
17
17
|
const { persistenceType: t, persistenceKey: i, onlineGet: a } = e.stylesConfigState || {};
|
|
@@ -28,14 +28,14 @@ function Je(e) {
|
|
|
28
28
|
console.warn(u);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return e.stylesConfig || ((c = e.stylesConfigState) == null ? void 0 : c.value) || ((l = e.stylesConfigState) == null ? void 0 : l.defaultValue) ||
|
|
31
|
+
return e.stylesConfig || ((c = e.stylesConfigState) == null ? void 0 : c.value) || ((l = e.stylesConfigState) == null ? void 0 : l.defaultValue) || b;
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
value: ((
|
|
35
|
-
onChange: ((
|
|
34
|
+
value: ((j = e.stylesConfigState) == null ? void 0 : j.value) || e.stylesConfig,
|
|
35
|
+
onChange: ((k = e.stylesConfigState) == null ? void 0 : k.onChange) || e.onStylesConfigChange
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
|
|
38
|
+
y(() => {
|
|
39
39
|
var a, n;
|
|
40
40
|
if (!((a = e.stylesConfigState) != null && a.persistenceKey) || !((n = e.stylesConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
41
41
|
return;
|
|
@@ -47,25 +47,25 @@ function Je(e) {
|
|
|
47
47
|
if (t !== "online") {
|
|
48
48
|
const o = window[t];
|
|
49
49
|
try {
|
|
50
|
-
o == null || o.setItem(i, JSON.stringify(
|
|
50
|
+
o == null || o.setItem(i, JSON.stringify(d));
|
|
51
51
|
} catch (c) {
|
|
52
|
-
console.warn(c),
|
|
52
|
+
console.warn(c), E();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}, [
|
|
56
|
-
(
|
|
57
|
-
|
|
58
|
-
(
|
|
59
|
-
]),
|
|
56
|
+
(H = e.stylesConfigState) == null ? void 0 : H.persistenceKey,
|
|
57
|
+
d,
|
|
58
|
+
(D = e.stylesConfigState) == null ? void 0 : D.persistenceType
|
|
59
|
+
]), y(() => {
|
|
60
60
|
var t, i, a;
|
|
61
61
|
if ((t = e.stylesConfigState) != null && t.persistenceKey && ((i = e.stylesConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
62
62
|
const { onlineGet: n, persistenceKey: o } = e.stylesConfigState;
|
|
63
63
|
try {
|
|
64
64
|
(a = n == null ? void 0 : n(o)) == null || a.then((c) => {
|
|
65
|
-
var f
|
|
66
|
-
const l = S(c, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
var f;
|
|
66
|
+
const l = S(c ?? {}, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
|
|
67
|
+
N(
|
|
68
|
+
Object.keys(l).length ? l : b
|
|
69
69
|
);
|
|
70
70
|
});
|
|
71
71
|
} catch (c) {
|
|
@@ -77,18 +77,22 @@ function Je(e) {
|
|
|
77
77
|
var i, a;
|
|
78
78
|
if ((i = e == null ? void 0 : e.exportConfigState) != null && i.defaultValue)
|
|
79
79
|
return e.exportConfigState.defaultValue;
|
|
80
|
-
const t =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
field: u,
|
|
86
|
-
title: c,
|
|
87
|
-
show: !0
|
|
88
|
-
});
|
|
80
|
+
const t = {
|
|
81
|
+
fields: [],
|
|
82
|
+
config: {
|
|
83
|
+
key: "current",
|
|
84
|
+
info: void 0
|
|
89
85
|
}
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
};
|
|
87
|
+
return (a = e.columns) == null || a.forEach((n, o) => {
|
|
88
|
+
const { title: c, isOperationCol: l, isDragSortCol: f } = n, u = re(n, o);
|
|
89
|
+
u && !l && !f && t.fields.push({
|
|
90
|
+
field: u,
|
|
91
|
+
title: c,
|
|
92
|
+
show: !0
|
|
93
|
+
});
|
|
94
|
+
}), t;
|
|
95
|
+
}, [e.columns]), [V, w] = O(
|
|
92
96
|
() => {
|
|
93
97
|
var n, o, c, l;
|
|
94
98
|
const { persistenceType: t, persistenceKey: i, onlineGet: a } = e.exportConfigState || {};
|
|
@@ -108,11 +112,11 @@ function Je(e) {
|
|
|
108
112
|
return e.exportConfig || ((c = e.exportConfigState) == null ? void 0 : c.value) || ((l = e.exportConfigState) == null ? void 0 : l.defaultValue) || m;
|
|
109
113
|
},
|
|
110
114
|
{
|
|
111
|
-
value: ((
|
|
112
|
-
onChange: ((
|
|
115
|
+
value: ((P = e.exportConfigState) == null ? void 0 : P.value) || e.exportConfig,
|
|
116
|
+
onChange: ((R = e.exportConfigState) == null ? void 0 : R.onChange) || e.onExportConfigChange
|
|
113
117
|
}
|
|
114
118
|
);
|
|
115
|
-
|
|
119
|
+
y(() => {
|
|
116
120
|
var n, o;
|
|
117
121
|
const { persistenceType: t, persistenceKey: i, onlineGet: a } = e.exportConfigState || {};
|
|
118
122
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
@@ -130,10 +134,10 @@ function Je(e) {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
}, [
|
|
133
|
-
(
|
|
134
|
-
(
|
|
137
|
+
(G = e.exportConfigState) == null ? void 0 : G.persistenceKey,
|
|
138
|
+
(Z = e.exportConfigState) == null ? void 0 : Z.persistenceType,
|
|
135
139
|
m
|
|
136
|
-
]),
|
|
140
|
+
]), y(() => {
|
|
137
141
|
var a, n;
|
|
138
142
|
if (!((a = e.exportConfigState) != null && a.persistenceKey) || !((n = e.exportConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
139
143
|
return;
|
|
@@ -145,24 +149,26 @@ function Je(e) {
|
|
|
145
149
|
if (t !== "online") {
|
|
146
150
|
const o = window[t];
|
|
147
151
|
try {
|
|
148
|
-
o == null || o.setItem(i, JSON.stringify(
|
|
152
|
+
o == null || o.setItem(i, JSON.stringify(V));
|
|
149
153
|
} catch (c) {
|
|
150
|
-
console.warn(c),
|
|
154
|
+
console.warn(c), B();
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
}, [
|
|
154
|
-
(
|
|
155
|
-
|
|
156
|
-
(
|
|
157
|
-
]),
|
|
158
|
+
(F = e.exportConfigState) == null ? void 0 : F.persistenceKey,
|
|
159
|
+
V,
|
|
160
|
+
(U = e.exportConfigState) == null ? void 0 : U.persistenceType
|
|
161
|
+
]), y(() => {
|
|
158
162
|
var t, i, a;
|
|
159
163
|
if ((t = e.exportConfigState) != null && t.persistenceKey && ((i = e.exportConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
160
164
|
const { onlineGet: n, persistenceKey: o } = e.exportConfigState;
|
|
161
165
|
try {
|
|
162
166
|
(a = n == null ? void 0 : n(o)) == null || a.then((c) => {
|
|
163
167
|
var f;
|
|
164
|
-
const l = S(c ??
|
|
165
|
-
w(
|
|
168
|
+
const l = S(c ?? {}, (f = e == null ? void 0 : e.exportConfigState) == null ? void 0 : f.value);
|
|
169
|
+
w(
|
|
170
|
+
Object.keys(l).length ? l : m
|
|
171
|
+
);
|
|
166
172
|
});
|
|
167
173
|
} catch (c) {
|
|
168
174
|
console.warn(c);
|
|
@@ -170,22 +176,20 @@ function Je(e) {
|
|
|
170
176
|
}
|
|
171
177
|
}, []);
|
|
172
178
|
const x = C(() => {
|
|
173
|
-
var c, l, f, u, oe, le
|
|
179
|
+
var c, l, f, u, ce, oe, le;
|
|
174
180
|
if ((c = e == null ? void 0 : e.columnsState) != null && c.defaultValue)
|
|
175
181
|
return e.columnsState.defaultValue;
|
|
176
|
-
const t = ((f = (l = e.columns) == null ? void 0 : l.filter((s) => s.fixed === "left")) == null ? void 0 : f.map((s, g) => ({ ...s, order: g }))) ?? [], i = ((
|
|
177
|
-
return n == null || n.forEach(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
), o;
|
|
188
|
-
}, [e.columns]), [z, h] = J(
|
|
182
|
+
const t = ((f = (l = e.columns) == null ? void 0 : l.filter((s) => s.fixed === "left")) == null ? void 0 : f.map((s, g) => ({ ...s, order: g }))) ?? [], i = ((ce = (u = e.columns) == null ? void 0 : u.filter((s) => s.fixed === "right")) == null ? void 0 : ce.map((s, g) => ({ ...s, order: g }))) ?? [], a = ((le = (oe = e.columns) == null ? void 0 : oe.filter((s) => !["left", "right"].includes(s.fixed))) == null ? void 0 : le.map((s, g) => ({ ...s, order: g }))) ?? [], n = [...t, ...a, ...i], o = {};
|
|
183
|
+
return n == null || n.forEach((s, g) => {
|
|
184
|
+
const { order: Ke, fixed: be, disabled: Ve, isDragSortCol: ve } = s, fe = re(s, g);
|
|
185
|
+
fe && !ve && (o[fe] = {
|
|
186
|
+
show: !0,
|
|
187
|
+
order: Ke,
|
|
188
|
+
fixed: be,
|
|
189
|
+
disabled: Ve
|
|
190
|
+
});
|
|
191
|
+
}), o;
|
|
192
|
+
}, [e.columns]), [v, h] = O(
|
|
189
193
|
() => {
|
|
190
194
|
var n, o, c, l;
|
|
191
195
|
const { persistenceType: t, persistenceKey: i, onlineGet: a } = e.columnsState || {};
|
|
@@ -205,11 +209,11 @@ function Je(e) {
|
|
|
205
209
|
return e.columnsStateMap || ((c = e.columnsState) == null ? void 0 : c.value) || ((l = e.columnsState) == null ? void 0 : l.defaultValue) || x;
|
|
206
210
|
},
|
|
207
211
|
{
|
|
208
|
-
value: ((
|
|
209
|
-
onChange: ((
|
|
212
|
+
value: ((q = e.columnsState) == null ? void 0 : q.value) || e.columnsStateMap,
|
|
213
|
+
onChange: ((A = e.columnsState) == null ? void 0 : A.onChange) || e.onColumnsStateChange
|
|
210
214
|
}
|
|
211
215
|
);
|
|
212
|
-
|
|
216
|
+
y(() => {
|
|
213
217
|
var n, o;
|
|
214
218
|
const { persistenceType: t, persistenceKey: i, onlineGet: a } = e.columnsState || {};
|
|
215
219
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
@@ -227,11 +231,11 @@ function Je(e) {
|
|
|
227
231
|
}
|
|
228
232
|
}
|
|
229
233
|
}, [
|
|
230
|
-
(
|
|
231
|
-
(
|
|
234
|
+
(L = e.columnsState) == null ? void 0 : L.persistenceKey,
|
|
235
|
+
(Q = e.columnsState) == null ? void 0 : Q.persistenceType,
|
|
232
236
|
x
|
|
233
237
|
]);
|
|
234
|
-
const
|
|
238
|
+
const I = z(() => {
|
|
235
239
|
const { persistenceType: t, persistenceKey: i } = e.columnsState || {};
|
|
236
240
|
if (!i || !t || typeof window > "u")
|
|
237
241
|
return;
|
|
@@ -241,7 +245,7 @@ function Je(e) {
|
|
|
241
245
|
} catch (n) {
|
|
242
246
|
console.warn(n);
|
|
243
247
|
}
|
|
244
|
-
}, [e.columnsState]),
|
|
248
|
+
}, [e.columnsState]), E = z(() => {
|
|
245
249
|
const { persistenceType: t, persistenceKey: i } = e.stylesConfigState || {};
|
|
246
250
|
if (!i || !t || typeof window > "u")
|
|
247
251
|
return;
|
|
@@ -251,7 +255,7 @@ function Je(e) {
|
|
|
251
255
|
} catch (n) {
|
|
252
256
|
console.warn(n);
|
|
253
257
|
}
|
|
254
|
-
}, [e.stylesConfigState]),
|
|
258
|
+
}, [e.stylesConfigState]), B = z(() => {
|
|
255
259
|
const { persistenceType: t, persistenceKey: i } = e.exportConfigState || {};
|
|
256
260
|
if (!i || !t || typeof window > "u")
|
|
257
261
|
return;
|
|
@@ -262,7 +266,7 @@ function Je(e) {
|
|
|
262
266
|
console.warn(n);
|
|
263
267
|
}
|
|
264
268
|
}, [e.exportConfigState]);
|
|
265
|
-
|
|
269
|
+
y(() => {
|
|
266
270
|
var a, n;
|
|
267
271
|
if (!((a = e.columnsState) != null && a.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
|
|
268
272
|
return;
|
|
@@ -274,25 +278,25 @@ function Je(e) {
|
|
|
274
278
|
if (t !== "online") {
|
|
275
279
|
const o = window[t];
|
|
276
280
|
try {
|
|
277
|
-
o == null || o.setItem(i, JSON.stringify(
|
|
281
|
+
o == null || o.setItem(i, JSON.stringify(v));
|
|
278
282
|
} catch (c) {
|
|
279
|
-
console.warn(c),
|
|
283
|
+
console.warn(c), I();
|
|
280
284
|
}
|
|
281
285
|
}
|
|
282
286
|
}, [
|
|
283
|
-
(
|
|
284
|
-
|
|
285
|
-
(
|
|
286
|
-
]),
|
|
287
|
+
(W = e.columnsState) == null ? void 0 : W.persistenceKey,
|
|
288
|
+
v,
|
|
289
|
+
(X = e.columnsState) == null ? void 0 : X.persistenceType
|
|
290
|
+
]), y(() => {
|
|
287
291
|
var t, i, a;
|
|
288
292
|
if ((t = e.columnsState) != null && t.persistenceKey && ((i = e.columnsState) == null ? void 0 : i.persistenceType) === "online") {
|
|
289
293
|
const { onlineGet: n, persistenceKey: o } = e.columnsState;
|
|
290
294
|
try {
|
|
291
295
|
(a = n == null ? void 0 : n(o)) == null || a.then((c) => {
|
|
292
|
-
var f
|
|
293
|
-
const l = S(c, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
|
|
296
|
+
var f;
|
|
297
|
+
const l = S(c ?? {}, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
|
|
294
298
|
h(
|
|
295
|
-
|
|
299
|
+
Object.keys(l).length ? l : x
|
|
296
300
|
);
|
|
297
301
|
});
|
|
298
302
|
} catch (c) {
|
|
@@ -300,55 +304,54 @@ function Je(e) {
|
|
|
300
304
|
}
|
|
301
305
|
}
|
|
302
306
|
}, []);
|
|
303
|
-
const
|
|
307
|
+
const we = C(() => (e == null ? void 0 : e.rowHoverable) ?? (r == null ? void 0 : r.rowHoverable) ?? !0, [e == null ? void 0 : e.rowHoverable, r == null ? void 0 : r.rowHoverable]), xe = C(() => e.zebra ?? d.zebra, [e.zebra, d.zebra]), K = C(() => e.bordered ?? d.bordered, [e.bordered, d.bordered]), he = C(() => ["column", "row-column"].includes(K), [K]), Te = C(() => {
|
|
304
308
|
let t = !1;
|
|
305
|
-
return ["hide", "column"].includes(
|
|
306
|
-
}, [
|
|
307
|
-
|
|
309
|
+
return ["hide", "column"].includes(K) && (t = !0), t;
|
|
310
|
+
}, [K]), M = {
|
|
311
|
+
loading: e.loading ?? !1,
|
|
312
|
+
uuid: T.current,
|
|
313
|
+
fullscreen: se,
|
|
314
|
+
setFullscreen: de,
|
|
315
|
+
selected: ye,
|
|
316
|
+
setSelected: Se,
|
|
308
317
|
columns: e.columns,
|
|
309
|
-
persistenceType: (
|
|
310
|
-
persistenceKey: (
|
|
311
|
-
onlineChange: (
|
|
312
|
-
|
|
313
|
-
setSortKeyColumns: (t) => {
|
|
314
|
-
b.current = t;
|
|
315
|
-
},
|
|
316
|
-
columnsMap: z,
|
|
318
|
+
persistenceType: (Y = e.columnsState) == null ? void 0 : Y.persistenceType,
|
|
319
|
+
persistenceKey: (_ = e.columnsState) == null ? void 0 : _.persistenceKey,
|
|
320
|
+
onlineChange: ($ = e.columnsState) == null ? void 0 : $.onlineChange,
|
|
321
|
+
columnsMap: v,
|
|
317
322
|
setColumnsMap: h,
|
|
318
323
|
defaultColumnKeyMap: x,
|
|
319
|
-
clearPersistenceStorage:
|
|
320
|
-
stylesConfig:
|
|
321
|
-
setTableStylesConfig:
|
|
322
|
-
defaultTableSize:
|
|
323
|
-
tableSize:
|
|
324
|
-
stylesStorageType: (
|
|
325
|
-
stylesStorageKey: (
|
|
326
|
-
onlineStylesConfigChange: (
|
|
327
|
-
clearStylesConfigCache:
|
|
328
|
-
defaultTableStylesConfig:
|
|
329
|
-
exportConfig:
|
|
324
|
+
clearPersistenceStorage: I,
|
|
325
|
+
stylesConfig: d,
|
|
326
|
+
setTableStylesConfig: N,
|
|
327
|
+
defaultTableSize: J,
|
|
328
|
+
tableSize: d.size,
|
|
329
|
+
stylesStorageType: (p = e.stylesConfigState) == null ? void 0 : p.persistenceType,
|
|
330
|
+
stylesStorageKey: (ee = e.stylesConfigState) == null ? void 0 : ee.persistenceKey,
|
|
331
|
+
onlineStylesConfigChange: (te = e.stylesConfigState) == null ? void 0 : te.onlineChange,
|
|
332
|
+
clearStylesConfigCache: E,
|
|
333
|
+
defaultTableStylesConfig: b,
|
|
334
|
+
exportConfig: V,
|
|
330
335
|
setTableExportConfig: w,
|
|
331
336
|
defaultTableExportConfig: m,
|
|
332
|
-
exportStorageType: (
|
|
333
|
-
exportStorageKey: (
|
|
334
|
-
onlineExportConfigChange: (
|
|
335
|
-
clearExportConfigCache:
|
|
336
|
-
zebra:
|
|
337
|
-
rowHoverable:
|
|
338
|
-
showColumnBorder:
|
|
339
|
-
hideRowBorder:
|
|
337
|
+
exportStorageType: (ne = e.exportConfigState) == null ? void 0 : ne.persistenceType,
|
|
338
|
+
exportStorageKey: (ie = e.exportConfigState) == null ? void 0 : ie.persistenceKey,
|
|
339
|
+
onlineExportConfigChange: (ae = e.exportConfigState) == null ? void 0 : ae.onlineChange,
|
|
340
|
+
clearExportConfigCache: B,
|
|
341
|
+
zebra: xe,
|
|
342
|
+
rowHoverable: we,
|
|
343
|
+
showColumnBorder: he,
|
|
344
|
+
hideRowBorder: Te
|
|
340
345
|
};
|
|
341
|
-
return Object.defineProperty(
|
|
342
|
-
get: () =>
|
|
343
|
-
}),
|
|
344
|
-
get: () => K.current
|
|
345
|
-
}), O;
|
|
346
|
+
return Object.defineProperty(M, "uuid", {
|
|
347
|
+
get: () => T.current
|
|
348
|
+
}), M;
|
|
346
349
|
}
|
|
347
|
-
const
|
|
348
|
-
const
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
+
const Me = ze({}), Ze = (e) => {
|
|
351
|
+
const T = Be(e.initValue);
|
|
352
|
+
return /* @__PURE__ */ Oe.jsx(Me.Provider, { value: T, children: e.children });
|
|
350
353
|
};
|
|
351
354
|
export {
|
|
352
|
-
|
|
353
|
-
|
|
355
|
+
Me as BitzTableContext,
|
|
356
|
+
Ze as default
|
|
354
357
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Key } from 'react';
|
|
2
1
|
import { ColumnsConfigProps } from '../../';
|
|
3
2
|
/** 删掉不应该显示的 */
|
|
4
3
|
export declare const loopFilter: (columns: any[], columnsMap: any) => {
|
|
@@ -7,11 +6,11 @@ export declare const loopFilter: (columns: any[], columnsMap: any) => {
|
|
|
7
6
|
autoWidthColLength: number;
|
|
8
7
|
};
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* 生成列唯一key
|
|
11
10
|
*
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
11
|
+
* @param column 列
|
|
12
|
+
* @param defaultKey 序列号,理论上唯一
|
|
14
13
|
*/
|
|
15
|
-
export declare const genColumnKey: (
|
|
14
|
+
export declare const genColumnKey: (column: any, defaultKey?: any) => any;
|
|
16
15
|
export declare const columnSort: (columnsMap: Record<string, ColumnsConfigProps>) => (a: any, b: any) => number;
|
|
17
16
|
export declare function updateNestedObject(obj: any, prop: any, val: any): {};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const c = (e, d) => {
|
|
2
|
+
let o = 0, r = 0;
|
|
3
3
|
return {
|
|
4
|
-
filterColumns: ((
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
}))(
|
|
8
|
-
width:
|
|
9
|
-
autoWidthColLength:
|
|
4
|
+
filterColumns: ((i, s) => i.map((n) => {
|
|
5
|
+
const t = u(n, n.index), l = s[t];
|
|
6
|
+
return l && l.show === !1 ? (typeof n.width == "number" ? o += n.width : r += 1, !1) : { ...n, ...l };
|
|
7
|
+
}))(e, d).filter(Boolean),
|
|
8
|
+
width: o,
|
|
9
|
+
autoWidthColLength: r
|
|
10
10
|
};
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const { fixed:
|
|
14
|
-
if (
|
|
11
|
+
}, u = (e, d) => "key" in e && e.key !== void 0 && e.key !== null ? e.key : e.dataIndex ? Array.isArray(e.dataIndex) ? e.dataIndex.join("-") : e.dataIndex : `${d}`, h = (e) => (d, o) => {
|
|
12
|
+
var t, l, y, a;
|
|
13
|
+
const { fixed: r, index: x } = d, { fixed: f, index: i } = o;
|
|
14
|
+
if (r === "left" && f !== "left" || f === "right" && r !== "right")
|
|
15
15
|
return -2;
|
|
16
|
-
if (
|
|
16
|
+
if (f === "left" && r !== "left" || r === "right" && f !== "right")
|
|
17
17
|
return 2;
|
|
18
|
-
const
|
|
19
|
-
return (
|
|
18
|
+
const s = d.key || `${x}`, n = o.key || `${i}`;
|
|
19
|
+
return (t = e[s]) != null && t.order || (l = e[n]) != null && l.order ? (((y = e[s]) == null ? void 0 : y.order) || 0) - (((a = e[n]) == null ? void 0 : a.order) || 0) : (d.index || 0) - (o.index || 0);
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
for (const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
[
|
|
21
|
+
function k(e, d, o) {
|
|
22
|
+
const r = {};
|
|
23
|
+
let x = "";
|
|
24
|
+
const f = (i, s, n) => {
|
|
25
|
+
for (const t in i)
|
|
26
|
+
if (i.hasOwnProperty(t) && (typeof i[t] == "object" && i[t] !== null && (x = t, r[t] = { ...i[t] }, f(i[t], s, n)), t === s)) {
|
|
27
|
+
const l = r[x];
|
|
28
|
+
r[x] = {
|
|
29
|
+
...l,
|
|
30
|
+
[s]: n
|
|
31
31
|
// [prop]: current.disabled || current.fixed ? true : val,
|
|
32
|
-
},
|
|
32
|
+
}, x = "";
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return
|
|
35
|
+
return f(e, d, o), r;
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
h as columnSort,
|
|
39
|
+
u as genColumnKey,
|
|
40
|
+
c as loopFilter,
|
|
41
|
+
k as updateNestedObject
|
|
42
42
|
};
|