bitz-react-admin-ui 2.10.4 → 2.10.6

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