bitz-react-admin-ui 2.2.9 → 2.3.1
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.
|
@@ -102,7 +102,7 @@ declare function useContainer(props: UseContainerProps): {
|
|
|
102
102
|
selected: boolean;
|
|
103
103
|
setSelected: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
104
104
|
columns: BitzTableColumnsType<any> | undefined;
|
|
105
|
-
baseColumns: (BitzTableColumnType<any> | import("..").BitzTableColumnGroupType<any>)[]
|
|
105
|
+
baseColumns: (BitzTableColumnType<any> | import("..").BitzTableColumnGroupType<any>)[];
|
|
106
106
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
107
107
|
persistenceKey: any;
|
|
108
108
|
onlineChange: ((key: any, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
@@ -139,7 +139,7 @@ declare const BitzTableContext: import("react").Context<{
|
|
|
139
139
|
selected: boolean;
|
|
140
140
|
setSelected: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
141
141
|
columns: BitzTableColumnsType<any> | undefined;
|
|
142
|
-
baseColumns: (BitzTableColumnType<any> | import("..").BitzTableColumnGroupType<any>)[]
|
|
142
|
+
baseColumns: (BitzTableColumnType<any> | import("..").BitzTableColumnGroupType<any>)[];
|
|
143
143
|
persistenceType: "online" | "localStorage" | "sessionStorage" | undefined;
|
|
144
144
|
persistenceKey: any;
|
|
145
145
|
onlineChange: ((key: any, ColumnsState: Record<string, ColumnsConfigProps>) => void) | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { Table as
|
|
3
|
-
import
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { genColumnKey as
|
|
6
|
-
import { getUuid as
|
|
7
|
-
import { BitzConfigContext as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { j as Te } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { Table as ce } from "antd";
|
|
3
|
+
import V from "../../../hooks/useMergedState.mjs";
|
|
4
|
+
import { createContext as Ke, useRef as be, useState as le, useContext as Oe, useEffect as d, useMemo as C, useCallback as v } from "react";
|
|
5
|
+
import { genColumnKey as N } from "./utils/index.mjs";
|
|
6
|
+
import { getUuid as Ve } from "../../../utils/uuid.mjs";
|
|
7
|
+
import { BitzConfigContext as ve } from "../../BitzConfigProvider/context.mjs";
|
|
8
|
+
import g from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/merge.mjs";
|
|
9
|
+
const Ne = {
|
|
10
10
|
fixed: "left",
|
|
11
11
|
className: "sorterCol",
|
|
12
12
|
isDragSorterCol: !0,
|
|
@@ -16,44 +16,44 @@ const Je = {
|
|
|
16
16
|
onCell: () => ({
|
|
17
17
|
"data-column-name": "dragSorterCell"
|
|
18
18
|
})
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
}, ze = [
|
|
20
|
+
Ne,
|
|
21
|
+
ce.SELECTION_COLUMN,
|
|
22
|
+
ce.EXPAND_COLUMN
|
|
23
23
|
];
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
size:
|
|
28
|
-
zebra:
|
|
29
|
-
bordered:
|
|
30
|
-
}, [y,
|
|
24
|
+
function Ee(e) {
|
|
25
|
+
var M, k, H, R, L, P, U, D, _, G, Z, A, F, X, q, Q, W, Y, $, p, ee, te, ne, ie, ae;
|
|
26
|
+
const T = be(Ve()), [fe, re] = le(!1), [se, ue] = le(!1), s = Oe(ve).Table, de = s == null ? void 0 : s.defaultSize, z = e.defaultSize ?? de ?? "lg", ye = e.defaultZebra ?? (s == null ? void 0 : s.zebra) ?? !0, Se = e.defaultBordered ?? (s == null ? void 0 : s.bordered) ?? "row-column", b = e.defaultStylesConfig || {
|
|
27
|
+
size: z,
|
|
28
|
+
zebra: ye,
|
|
29
|
+
bordered: Se
|
|
30
|
+
}, [y, E] = V(
|
|
31
31
|
() => {
|
|
32
|
-
var n,
|
|
33
|
-
const { persistenceType: t, persistenceKey: i, onlineGet:
|
|
32
|
+
var n, c, l, a;
|
|
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];
|
|
36
36
|
try {
|
|
37
37
|
const r = f == null ? void 0 : f.getItem(i);
|
|
38
38
|
if (r)
|
|
39
|
-
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ?
|
|
39
|
+
return (n = e == null ? void 0 : e.stylesConfigState) != null && n.defaultValue ? g(
|
|
40
40
|
JSON.parse(r),
|
|
41
|
-
(
|
|
41
|
+
(c = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : c.defaultValue
|
|
42
42
|
) : JSON.parse(r);
|
|
43
43
|
} catch (r) {
|
|
44
44
|
console.warn(r);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return e.stylesConfig || ((
|
|
47
|
+
return e.stylesConfig || ((l = e.stylesConfigState) == null ? void 0 : l.value) || ((a = e.stylesConfigState) == null ? void 0 : a.defaultValue) || b;
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
value: ((
|
|
50
|
+
value: ((M = e.stylesConfigState) == null ? void 0 : M.value) || e.stylesConfig,
|
|
51
51
|
onChange: ((k = e.stylesConfigState) == null ? void 0 : k.onChange) || e.onStylesConfigChange
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
if (!((
|
|
54
|
+
d(() => {
|
|
55
|
+
var o, n;
|
|
56
|
+
if (!((o = e.stylesConfigState) != null && o.persistenceKey) || !((n = e.stylesConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
57
57
|
return;
|
|
58
58
|
const {
|
|
59
59
|
persistenceType: t,
|
|
@@ -61,38 +61,35 @@ function Me(e) {
|
|
|
61
61
|
// onlineChange
|
|
62
62
|
} = e.stylesConfigState;
|
|
63
63
|
if (t !== "online") {
|
|
64
|
-
const
|
|
64
|
+
const c = window[t];
|
|
65
65
|
try {
|
|
66
|
-
|
|
67
|
-
} catch (
|
|
68
|
-
console.warn(
|
|
66
|
+
c == null || c.setItem(i, JSON.stringify(y));
|
|
67
|
+
} catch (l) {
|
|
68
|
+
console.warn(l), J();
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}, [
|
|
72
|
-
(
|
|
72
|
+
(H = e.stylesConfigState) == null ? void 0 : H.persistenceKey,
|
|
73
73
|
y,
|
|
74
|
-
(
|
|
75
|
-
]),
|
|
76
|
-
var t, i,
|
|
74
|
+
(R = e.stylesConfigState) == null ? void 0 : R.persistenceType
|
|
75
|
+
]), d(() => {
|
|
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:
|
|
78
|
+
const { onlineGet: n, persistenceKey: c } = e.stylesConfigState;
|
|
79
79
|
try {
|
|
80
|
-
(
|
|
80
|
+
(o = n == null ? void 0 : n(c)) == null || o.then((l) => {
|
|
81
81
|
var f;
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
Object.keys(
|
|
82
|
+
const a = g(l ?? {}, (f = e == null ? void 0 : e.stylesConfigState) == null ? void 0 : f.value);
|
|
83
|
+
E(
|
|
84
|
+
Object.keys(a).length ? a : b
|
|
85
85
|
);
|
|
86
86
|
});
|
|
87
|
-
} catch (
|
|
88
|
-
console.warn(
|
|
87
|
+
} catch (l) {
|
|
88
|
+
console.warn(l);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}, []);
|
|
92
|
-
const
|
|
93
|
-
var t;
|
|
94
|
-
return (t = e.columns) == null ? void 0 : t.filter((i) => !Ie.includes(i));
|
|
95
|
-
}, [e.columns]), w = g(() => {
|
|
92
|
+
const u = C(() => (e.columns ?? []).filter((t) => !ze.includes(t)), [e.columns]), x = C(() => {
|
|
96
93
|
var i;
|
|
97
94
|
if ((i = e == null ? void 0 : e.exportConfigState) != null && i.defaultValue)
|
|
98
95
|
return e.exportConfigState.defaultValue;
|
|
@@ -103,62 +100,62 @@ function Me(e) {
|
|
|
103
100
|
info: void 0
|
|
104
101
|
}
|
|
105
102
|
};
|
|
106
|
-
return
|
|
107
|
-
const { title:
|
|
108
|
-
|
|
109
|
-
field:
|
|
110
|
-
title:
|
|
103
|
+
return u.forEach((o, n) => {
|
|
104
|
+
const { title: c, isOperationCol: l } = o, a = N(o, n);
|
|
105
|
+
a && !l && t.fields.push({
|
|
106
|
+
field: a,
|
|
107
|
+
title: c,
|
|
111
108
|
show: !0
|
|
112
109
|
});
|
|
113
110
|
}), t;
|
|
114
|
-
}, [
|
|
111
|
+
}, [u]), [O, h] = V(
|
|
115
112
|
() => {
|
|
116
|
-
var n,
|
|
117
|
-
const { persistenceType: t, persistenceKey: i, onlineGet:
|
|
113
|
+
var n, c, l, a;
|
|
114
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.exportConfigState || {};
|
|
118
115
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
119
116
|
const f = window[t];
|
|
120
117
|
try {
|
|
121
118
|
const r = f == null ? void 0 : f.getItem(i);
|
|
122
119
|
if (r)
|
|
123
|
-
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ?
|
|
120
|
+
return (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? g(
|
|
124
121
|
JSON.parse(r),
|
|
125
|
-
(
|
|
122
|
+
(c = e == null ? void 0 : e.exportConfigState) == null ? void 0 : c.defaultValue
|
|
126
123
|
) : JSON.parse(r);
|
|
127
124
|
} catch (r) {
|
|
128
125
|
console.warn(r);
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
|
-
return e.exportConfig || ((
|
|
128
|
+
return e.exportConfig || ((l = e.exportConfigState) == null ? void 0 : l.value) || ((a = e.exportConfigState) == null ? void 0 : a.defaultValue) || x;
|
|
132
129
|
},
|
|
133
130
|
{
|
|
134
|
-
value: ((
|
|
135
|
-
onChange: ((
|
|
131
|
+
value: ((L = e.exportConfigState) == null ? void 0 : L.value) || e.exportConfig,
|
|
132
|
+
onChange: ((P = e.exportConfigState) == null ? void 0 : P.onChange) || e.onExportConfigChange
|
|
136
133
|
}
|
|
137
134
|
);
|
|
138
|
-
|
|
139
|
-
var n,
|
|
140
|
-
const { persistenceType: t, persistenceKey: i, onlineGet:
|
|
135
|
+
d(() => {
|
|
136
|
+
var n, c;
|
|
137
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.exportConfigState || {};
|
|
141
138
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
142
|
-
const
|
|
139
|
+
const l = window[t];
|
|
143
140
|
try {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
JSON.parse(
|
|
148
|
-
(
|
|
141
|
+
const a = l == null ? void 0 : l.getItem(i);
|
|
142
|
+
a ? (n = e == null ? void 0 : e.exportConfigState) != null && n.defaultValue ? h(
|
|
143
|
+
g(
|
|
144
|
+
JSON.parse(a),
|
|
145
|
+
(c = e == null ? void 0 : e.exportConfigState) == null ? void 0 : c.defaultValue
|
|
149
146
|
)
|
|
150
|
-
) :
|
|
151
|
-
} catch (
|
|
152
|
-
console.warn(
|
|
147
|
+
) : h(JSON.parse(a)) : h(x);
|
|
148
|
+
} catch (a) {
|
|
149
|
+
console.warn(a);
|
|
153
150
|
}
|
|
154
151
|
}
|
|
155
152
|
}, [
|
|
156
|
-
(
|
|
157
|
-
(
|
|
158
|
-
|
|
159
|
-
]),
|
|
160
|
-
var
|
|
161
|
-
if (!((
|
|
153
|
+
(U = e.exportConfigState) == null ? void 0 : U.persistenceKey,
|
|
154
|
+
(D = e.exportConfigState) == null ? void 0 : D.persistenceType,
|
|
155
|
+
x
|
|
156
|
+
]), d(() => {
|
|
157
|
+
var o, n;
|
|
158
|
+
if (!((o = e.exportConfigState) != null && o.persistenceKey) || !((n = e.exportConfigState) != null && n.persistenceType) || typeof window > "u")
|
|
162
159
|
return;
|
|
163
160
|
const {
|
|
164
161
|
persistenceType: t,
|
|
@@ -166,128 +163,128 @@ function Me(e) {
|
|
|
166
163
|
// onlineChange
|
|
167
164
|
} = e.exportConfigState;
|
|
168
165
|
if (t !== "online") {
|
|
169
|
-
const
|
|
166
|
+
const c = window[t];
|
|
170
167
|
try {
|
|
171
|
-
|
|
172
|
-
} catch (
|
|
173
|
-
console.warn(
|
|
168
|
+
c == null || c.setItem(i, JSON.stringify(O));
|
|
169
|
+
} catch (l) {
|
|
170
|
+
console.warn(l), B();
|
|
174
171
|
}
|
|
175
172
|
}
|
|
176
173
|
}, [
|
|
177
|
-
(
|
|
178
|
-
|
|
179
|
-
(
|
|
180
|
-
]),
|
|
181
|
-
var t, i,
|
|
174
|
+
(_ = e.exportConfigState) == null ? void 0 : _.persistenceKey,
|
|
175
|
+
O,
|
|
176
|
+
(G = e.exportConfigState) == null ? void 0 : G.persistenceType
|
|
177
|
+
]), d(() => {
|
|
178
|
+
var t, i, o;
|
|
182
179
|
if ((t = e.exportConfigState) != null && t.persistenceKey && ((i = e.exportConfigState) == null ? void 0 : i.persistenceType) === "online") {
|
|
183
|
-
const { onlineGet: n, persistenceKey:
|
|
180
|
+
const { onlineGet: n, persistenceKey: c } = e.exportConfigState;
|
|
184
181
|
try {
|
|
185
|
-
(
|
|
182
|
+
(o = n == null ? void 0 : n(c)) == null || o.then((l) => {
|
|
186
183
|
var f;
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
Object.keys(
|
|
184
|
+
const a = g(l ?? {}, (f = e == null ? void 0 : e.exportConfigState) == null ? void 0 : f.value);
|
|
185
|
+
h(
|
|
186
|
+
Object.keys(a).length ? a : x
|
|
190
187
|
);
|
|
191
188
|
});
|
|
192
|
-
} catch (
|
|
193
|
-
console.warn(
|
|
189
|
+
} catch (l) {
|
|
190
|
+
console.warn(l);
|
|
194
191
|
}
|
|
195
192
|
}
|
|
196
193
|
}, []);
|
|
197
|
-
const
|
|
198
|
-
var
|
|
199
|
-
if ((
|
|
194
|
+
const S = C(() => {
|
|
195
|
+
var l;
|
|
196
|
+
if ((l = e == null ? void 0 : e.columnsState) != null && l.defaultValue)
|
|
200
197
|
return e.columnsState.defaultValue;
|
|
201
|
-
const t =
|
|
202
|
-
return n
|
|
203
|
-
const { order:
|
|
204
|
-
oe && (
|
|
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 = {};
|
|
199
|
+
return n.forEach((a, f) => {
|
|
200
|
+
const { order: r, fixed: xe, disabled: he } = a, oe = N(a, f);
|
|
201
|
+
oe && (c[oe] = {
|
|
205
202
|
show: !0,
|
|
206
|
-
order:
|
|
207
|
-
fixed:
|
|
208
|
-
disabled:
|
|
203
|
+
order: r,
|
|
204
|
+
fixed: xe,
|
|
205
|
+
disabled: he
|
|
209
206
|
});
|
|
210
|
-
}),
|
|
211
|
-
}, [
|
|
207
|
+
}), c;
|
|
208
|
+
}, [u]), [m, w] = V(
|
|
212
209
|
() => {
|
|
213
|
-
var n,
|
|
214
|
-
const { persistenceType: t, persistenceKey: i, onlineGet:
|
|
210
|
+
var n, c, l, a;
|
|
211
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.columnsState || {};
|
|
215
212
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
216
213
|
const f = window[t];
|
|
217
214
|
try {
|
|
218
215
|
const r = f == null ? void 0 : f.getItem(i);
|
|
219
216
|
if (r)
|
|
220
|
-
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ?
|
|
217
|
+
return (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? g(
|
|
221
218
|
JSON.parse(r),
|
|
222
|
-
(
|
|
219
|
+
(c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
|
|
223
220
|
) : JSON.parse(r);
|
|
224
221
|
} catch (r) {
|
|
225
222
|
console.warn(r);
|
|
226
223
|
}
|
|
227
224
|
}
|
|
228
|
-
return e.columnsStateMap || ((
|
|
225
|
+
return e.columnsStateMap || ((l = e.columnsState) == null ? void 0 : l.value) || ((a = e.columnsState) == null ? void 0 : a.defaultValue) || {};
|
|
229
226
|
},
|
|
230
227
|
{
|
|
231
|
-
value: ((
|
|
232
|
-
onChange: ((
|
|
228
|
+
value: ((Z = e.columnsState) == null ? void 0 : Z.value) || e.columnsStateMap,
|
|
229
|
+
onChange: ((A = e.columnsState) == null ? void 0 : A.onChange) || e.onColumnsStateChange
|
|
233
230
|
}
|
|
234
231
|
);
|
|
235
|
-
|
|
236
|
-
var n,
|
|
237
|
-
const { persistenceType: t, persistenceKey: i, onlineGet:
|
|
232
|
+
d(() => {
|
|
233
|
+
var n, c;
|
|
234
|
+
const { persistenceType: t, persistenceKey: i, onlineGet: o } = e.columnsState || {};
|
|
238
235
|
if (i && t && typeof window < "u" && t !== "online") {
|
|
239
|
-
const
|
|
236
|
+
const l = window[t];
|
|
240
237
|
try {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
JSON.parse(
|
|
245
|
-
(
|
|
238
|
+
const a = l == null ? void 0 : l.getItem(i);
|
|
239
|
+
a ? (n = e == null ? void 0 : e.columnsState) != null && n.defaultValue ? w(
|
|
240
|
+
g(
|
|
241
|
+
JSON.parse(a),
|
|
242
|
+
(c = e == null ? void 0 : e.columnsState) == null ? void 0 : c.defaultValue
|
|
246
243
|
)
|
|
247
|
-
) :
|
|
248
|
-
} catch (
|
|
249
|
-
console.warn(
|
|
244
|
+
) : w(JSON.parse(a)) : w(S);
|
|
245
|
+
} catch (a) {
|
|
246
|
+
console.warn(a);
|
|
250
247
|
}
|
|
251
248
|
}
|
|
252
249
|
}, [
|
|
253
|
-
(
|
|
254
|
-
(
|
|
255
|
-
|
|
250
|
+
(F = e.columnsState) == null ? void 0 : F.persistenceKey,
|
|
251
|
+
(X = e.columnsState) == null ? void 0 : X.persistenceType,
|
|
252
|
+
S
|
|
256
253
|
]);
|
|
257
|
-
const I =
|
|
254
|
+
const I = v(() => {
|
|
258
255
|
const { persistenceType: t, persistenceKey: i } = e.columnsState || {};
|
|
259
256
|
if (!i || !t || typeof window > "u")
|
|
260
257
|
return;
|
|
261
|
-
const
|
|
258
|
+
const o = window[t];
|
|
262
259
|
try {
|
|
263
|
-
|
|
260
|
+
o == null || o.removeItem(i);
|
|
264
261
|
} catch (n) {
|
|
265
262
|
console.warn(n);
|
|
266
263
|
}
|
|
267
|
-
}, [e.columnsState]),
|
|
264
|
+
}, [e.columnsState]), J = v(() => {
|
|
268
265
|
const { persistenceType: t, persistenceKey: i } = e.stylesConfigState || {};
|
|
269
266
|
if (!i || !t || typeof window > "u")
|
|
270
267
|
return;
|
|
271
|
-
const
|
|
268
|
+
const o = window[t];
|
|
272
269
|
try {
|
|
273
|
-
|
|
270
|
+
o == null || o.removeItem(i);
|
|
274
271
|
} catch (n) {
|
|
275
272
|
console.warn(n);
|
|
276
273
|
}
|
|
277
|
-
}, [e.stylesConfigState]), B =
|
|
274
|
+
}, [e.stylesConfigState]), B = v(() => {
|
|
278
275
|
const { persistenceType: t, persistenceKey: i } = e.exportConfigState || {};
|
|
279
276
|
if (!i || !t || typeof window > "u")
|
|
280
277
|
return;
|
|
281
|
-
const
|
|
278
|
+
const o = window[t];
|
|
282
279
|
try {
|
|
283
|
-
|
|
280
|
+
o == null || o.removeItem(i);
|
|
284
281
|
} catch (n) {
|
|
285
282
|
console.warn(n);
|
|
286
283
|
}
|
|
287
284
|
}, [e.exportConfigState]);
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
if (!((
|
|
285
|
+
d(() => {
|
|
286
|
+
var o, n;
|
|
287
|
+
if (!((o = e.columnsState) != null && o.persistenceKey) || !((n = e.columnsState) != null && n.persistenceType) || typeof window > "u")
|
|
291
288
|
return;
|
|
292
289
|
const {
|
|
293
290
|
persistenceType: t,
|
|
@@ -295,83 +292,90 @@ function Me(e) {
|
|
|
295
292
|
// onlineChange
|
|
296
293
|
} = e.columnsState;
|
|
297
294
|
if (t !== "online") {
|
|
298
|
-
const
|
|
295
|
+
const c = window[t];
|
|
299
296
|
try {
|
|
300
|
-
|
|
301
|
-
} catch (
|
|
302
|
-
console.warn(
|
|
297
|
+
c == null || c.setItem(i, JSON.stringify(m));
|
|
298
|
+
} catch (l) {
|
|
299
|
+
console.warn(l), I();
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
}, [
|
|
306
|
-
(
|
|
307
|
-
|
|
308
|
-
(
|
|
309
|
-
]),
|
|
310
|
-
var t, i,
|
|
303
|
+
(q = e.columnsState) == null ? void 0 : q.persistenceKey,
|
|
304
|
+
m,
|
|
305
|
+
(Q = e.columnsState) == null ? void 0 : Q.persistenceType
|
|
306
|
+
]), d(() => {
|
|
307
|
+
var t, i, o;
|
|
311
308
|
if ((t = e.columnsState) != null && t.persistenceKey && ((i = e.columnsState) == null ? void 0 : i.persistenceType) === "online") {
|
|
312
|
-
const { onlineGet: n, persistenceKey:
|
|
309
|
+
const { onlineGet: n, persistenceKey: c } = e.columnsState;
|
|
313
310
|
try {
|
|
314
|
-
(
|
|
311
|
+
(o = n == null ? void 0 : n(c)) == null || o.then((l) => {
|
|
315
312
|
var f;
|
|
316
|
-
const
|
|
317
|
-
|
|
313
|
+
const a = g(l ?? {}, (f = e == null ? void 0 : e.columnsState) == null ? void 0 : f.value);
|
|
314
|
+
w(a);
|
|
318
315
|
});
|
|
319
|
-
} catch (
|
|
320
|
-
console.warn(
|
|
316
|
+
} catch (l) {
|
|
317
|
+
console.warn(l);
|
|
321
318
|
}
|
|
322
319
|
}
|
|
323
|
-
}, [])
|
|
324
|
-
|
|
320
|
+
}, []), d(() => {
|
|
321
|
+
var i, o;
|
|
322
|
+
const t = u.findIndex((n) => n == null ? void 0 : n.isOperationCol);
|
|
323
|
+
if (t >= 0) {
|
|
324
|
+
const n = u[t], c = N(n, t);
|
|
325
|
+
!(((i = m == null ? void 0 : m[c]) == null ? void 0 : i.fixed) === ((o = S == null ? void 0 : S[c]) == null ? void 0 : o.fixed)) && Object.keys(m ?? {}).length === 0 && w(S);
|
|
326
|
+
}
|
|
327
|
+
}, [S]);
|
|
328
|
+
const Ce = C(() => (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]), ge = C(() => e.zebra ?? y.zebra, [e.zebra, y.zebra]), K = C(() => e.bordered ?? y.bordered, [e.bordered, y.bordered]), me = C(() => ["column", "row-column"].includes(K), [K]), we = C(() => {
|
|
325
329
|
let t = !1;
|
|
326
|
-
return ["hide", "column"].includes(
|
|
327
|
-
}, [
|
|
330
|
+
return ["hide", "column"].includes(K) && (t = !0), t;
|
|
331
|
+
}, [K]), j = {
|
|
328
332
|
loading: e.loading ?? !1,
|
|
329
|
-
uuid:
|
|
330
|
-
fullscreen:
|
|
331
|
-
setFullscreen:
|
|
332
|
-
selected:
|
|
333
|
-
setSelected:
|
|
333
|
+
uuid: T.current,
|
|
334
|
+
fullscreen: fe,
|
|
335
|
+
setFullscreen: re,
|
|
336
|
+
selected: se,
|
|
337
|
+
setSelected: ue,
|
|
334
338
|
columns: e.columns,
|
|
335
|
-
baseColumns:
|
|
336
|
-
persistenceType: (
|
|
337
|
-
persistenceKey: (
|
|
338
|
-
onlineChange: (
|
|
339
|
-
columnsMap:
|
|
340
|
-
setColumnsMap:
|
|
341
|
-
defaultColumnKeyMap:
|
|
339
|
+
baseColumns: u,
|
|
340
|
+
persistenceType: (W = e.columnsState) == null ? void 0 : W.persistenceType,
|
|
341
|
+
persistenceKey: (Y = e.columnsState) == null ? void 0 : Y.persistenceKey,
|
|
342
|
+
onlineChange: ($ = e.columnsState) == null ? void 0 : $.onlineChange,
|
|
343
|
+
columnsMap: m,
|
|
344
|
+
setColumnsMap: w,
|
|
345
|
+
defaultColumnKeyMap: S,
|
|
342
346
|
clearPersistenceStorage: I,
|
|
343
347
|
stylesConfig: y,
|
|
344
|
-
setTableStylesConfig:
|
|
345
|
-
defaultTableSize:
|
|
348
|
+
setTableStylesConfig: E,
|
|
349
|
+
defaultTableSize: z,
|
|
346
350
|
tableSize: y.size,
|
|
347
|
-
stylesStorageType: (
|
|
348
|
-
stylesStorageKey: (
|
|
349
|
-
onlineStylesConfigChange: (
|
|
350
|
-
clearStylesConfigCache:
|
|
351
|
-
defaultTableStylesConfig:
|
|
352
|
-
exportConfig:
|
|
353
|
-
setTableExportConfig:
|
|
354
|
-
defaultTableExportConfig:
|
|
355
|
-
exportStorageType: (
|
|
356
|
-
exportStorageKey: (
|
|
357
|
-
onlineExportConfigChange: (
|
|
351
|
+
stylesStorageType: (p = e.stylesConfigState) == null ? void 0 : p.persistenceType,
|
|
352
|
+
stylesStorageKey: (ee = e.stylesConfigState) == null ? void 0 : ee.persistenceKey,
|
|
353
|
+
onlineStylesConfigChange: (te = e.stylesConfigState) == null ? void 0 : te.onlineChange,
|
|
354
|
+
clearStylesConfigCache: J,
|
|
355
|
+
defaultTableStylesConfig: b,
|
|
356
|
+
exportConfig: O,
|
|
357
|
+
setTableExportConfig: h,
|
|
358
|
+
defaultTableExportConfig: x,
|
|
359
|
+
exportStorageType: (ne = e.exportConfigState) == null ? void 0 : ne.persistenceType,
|
|
360
|
+
exportStorageKey: (ie = e.exportConfigState) == null ? void 0 : ie.persistenceKey,
|
|
361
|
+
onlineExportConfigChange: (ae = e.exportConfigState) == null ? void 0 : ae.onlineChange,
|
|
358
362
|
clearExportConfigCache: B,
|
|
359
|
-
zebra:
|
|
360
|
-
rowHoverable:
|
|
361
|
-
showColumnBorder:
|
|
362
|
-
hideRowBorder:
|
|
363
|
+
zebra: ge,
|
|
364
|
+
rowHoverable: Ce,
|
|
365
|
+
showColumnBorder: me,
|
|
366
|
+
hideRowBorder: we
|
|
363
367
|
};
|
|
364
368
|
return Object.defineProperty(j, "uuid", {
|
|
365
|
-
get: () =>
|
|
369
|
+
get: () => T.current
|
|
366
370
|
}), j;
|
|
367
371
|
}
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
return /* @__PURE__ */
|
|
372
|
+
const Ie = Ke({}), Pe = (e) => {
|
|
373
|
+
const T = Ee(e.initValue);
|
|
374
|
+
return /* @__PURE__ */ Te.jsx(Ie.Provider, { value: T, children: e.children });
|
|
371
375
|
};
|
|
372
376
|
export {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
+
Ie as BitzTableContext,
|
|
378
|
+
Ne as SORTER_COLUMN,
|
|
379
|
+
Pe as default,
|
|
380
|
+
ze as toolCols
|
|
377
381
|
};
|