@espresso-lab/mantine-data-table 2.2.9 → 2.2.10
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/index.es.js +351 -353
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +13 -13
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,70 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import t, { Fragment as n, createContext as r, createElement as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
-
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, HoverCard as E, Indicator as D, Loader as O, Menu as k, MenuDropdown as A, MenuItem as j, MenuTarget as M, Modal as N, NumberInput as P, Pagination as ee, Popover as F, PopoverDropdown as te, PopoverTarget as I, ScrollArea as L, Select as ne, Skeleton as R, Stack as re, Stepper as ie, Table as z, TableTd as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, HoverCard as E, Indicator as D, Loader as O, Menu as k, MenuDropdown as A, MenuItem as j, MenuTarget as M, Modal as N, NumberInput as P, Pagination as ee, Popover as F, PopoverDropdown as te, PopoverTarget as I, ScrollArea as L, Select as ne, Skeleton as R, Stack as re, Stepper as ie, Table as z, TableTd as B, TableTfoot as ae, TableTh as oe, TableThead as se, TableTr as ce, Tabs as le, Text as V, TextInput as ue, Textarea as de, Title as fe, createSafeContext as pe, parseThemeColor as me, rem as H, useDirection as he, useMantineTheme as ge } from "@mantine/core";
|
|
5
5
|
import { DateInput as _e } from "@mantine/dates";
|
|
6
6
|
import { useForm as ve } from "@mantine/form";
|
|
7
7
|
import { IconCaretDownFilled as ye, IconChevronRight as be, IconDotsVertical as xe, IconFilter as Se, IconInfoCircle as Ce, IconPencil as we, IconRefresh as Te, IconSortAscending as Ee, IconSortDescending as De, IconTrash as Oe } from "@tabler/icons-react";
|
|
8
8
|
import { useClickOutside as ke, useDisclosure as Ae, useLocalStorage as je, useMediaQuery as Me, useMergedRef as Ne, useTimeout as Pe } from "@mantine/hooks";
|
|
9
|
-
//#region node_modules/@tanstack/query-core/build/modern/
|
|
10
|
-
var Fe = {
|
|
9
|
+
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
+
var Fe = class {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
|
+
}
|
|
14
|
+
subscribe(e) {
|
|
15
|
+
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
16
|
+
this.listeners.delete(e), this.onUnsubscribe();
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
hasListeners() {
|
|
20
|
+
return this.listeners.size > 0;
|
|
21
|
+
}
|
|
22
|
+
onSubscribe() {}
|
|
23
|
+
onUnsubscribe() {}
|
|
24
|
+
}, Ie = new class extends Fe {
|
|
25
|
+
#e;
|
|
26
|
+
#t;
|
|
27
|
+
#n;
|
|
28
|
+
constructor() {
|
|
29
|
+
super(), this.#n = (e) => {
|
|
30
|
+
if (typeof window < "u" && window.addEventListener) {
|
|
31
|
+
let t = () => e();
|
|
32
|
+
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
33
|
+
window.removeEventListener("visibilitychange", t);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
onSubscribe() {
|
|
39
|
+
this.#t || this.setEventListener(this.#n);
|
|
40
|
+
}
|
|
41
|
+
onUnsubscribe() {
|
|
42
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
43
|
+
}
|
|
44
|
+
setEventListener(e) {
|
|
45
|
+
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
46
|
+
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
setFocused(e) {
|
|
50
|
+
this.#e !== e && (this.#e = e, this.onFocus());
|
|
51
|
+
}
|
|
52
|
+
onFocus() {
|
|
53
|
+
let e = this.isFocused();
|
|
54
|
+
this.listeners.forEach((t) => {
|
|
55
|
+
t(e);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
isFocused() {
|
|
59
|
+
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
|
+
}
|
|
61
|
+
}(), Le = {
|
|
11
62
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
12
63
|
clearTimeout: (e) => clearTimeout(e),
|
|
13
64
|
setInterval: (e, t) => setInterval(e, t),
|
|
14
65
|
clearInterval: (e) => clearInterval(e)
|
|
15
|
-
},
|
|
16
|
-
#e =
|
|
66
|
+
}, Re = new class {
|
|
67
|
+
#e = Le;
|
|
17
68
|
#t = !1;
|
|
18
69
|
setTimeoutProvider(e) {
|
|
19
70
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
|
|
@@ -34,87 +85,87 @@ var Fe = {
|
|
|
34
85
|
this.#e.clearInterval(e);
|
|
35
86
|
}
|
|
36
87
|
}();
|
|
37
|
-
function
|
|
88
|
+
function ze(e) {
|
|
38
89
|
setTimeout(e, 0);
|
|
39
90
|
}
|
|
40
91
|
//#endregion
|
|
41
92
|
//#region node_modules/@tanstack/query-core/build/modern/utils.js
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
function
|
|
93
|
+
var Be = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function Ve() {}
|
|
95
|
+
function He(e) {
|
|
45
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
46
97
|
}
|
|
47
|
-
function
|
|
98
|
+
function Ue(e, t) {
|
|
48
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
49
100
|
}
|
|
50
|
-
function
|
|
101
|
+
function We(e, t) {
|
|
51
102
|
return typeof e == "function" ? e(t) : e;
|
|
52
103
|
}
|
|
53
|
-
function
|
|
104
|
+
function U(e, t) {
|
|
54
105
|
return typeof e == "function" ? e(t) : e;
|
|
55
106
|
}
|
|
56
|
-
function
|
|
57
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function Ge(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Ye(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
58
109
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
110
|
+
var Ke = Object.prototype.hasOwnProperty;
|
|
111
|
+
function W(e, t, n = 0) {
|
|
61
112
|
if (e === t) return e;
|
|
62
113
|
if (n > 500) return t;
|
|
63
|
-
let r =
|
|
64
|
-
if (!r && !(
|
|
114
|
+
let r = Je(e) && Je(t);
|
|
115
|
+
if (!r && !(Ye(e) && Ye(t))) return t;
|
|
65
116
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
66
117
|
for (let l = 0; l < o; l++) {
|
|
67
118
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
68
119
|
if (u === d) {
|
|
69
|
-
s[o] = u, (r ? l < i :
|
|
120
|
+
s[o] = u, (r ? l < i : Ke.call(e, o)) && c++;
|
|
70
121
|
continue;
|
|
71
122
|
}
|
|
72
123
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
73
124
|
s[o] = d;
|
|
74
125
|
continue;
|
|
75
126
|
}
|
|
76
|
-
let f =
|
|
127
|
+
let f = W(u, d, n + 1);
|
|
77
128
|
s[o] = f, f === u && c++;
|
|
78
129
|
}
|
|
79
130
|
return i === o && c === i ? e : s;
|
|
80
131
|
}
|
|
81
|
-
function
|
|
132
|
+
function qe(e, t) {
|
|
82
133
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
83
134
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
84
135
|
return !0;
|
|
85
136
|
}
|
|
86
|
-
function
|
|
137
|
+
function Je(e) {
|
|
87
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
88
139
|
}
|
|
89
|
-
function
|
|
90
|
-
if (!
|
|
140
|
+
function Ye(e) {
|
|
141
|
+
if (!Xe(e)) return !1;
|
|
91
142
|
let t = e.constructor;
|
|
92
143
|
if (t === void 0) return !0;
|
|
93
144
|
let n = t.prototype;
|
|
94
|
-
return !(!
|
|
145
|
+
return !(!Xe(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
95
146
|
}
|
|
96
|
-
function
|
|
147
|
+
function Xe(e) {
|
|
97
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
98
149
|
}
|
|
99
|
-
function
|
|
150
|
+
function G(e, t, n) {
|
|
100
151
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
101
152
|
if (n.structuralSharing !== !1) {
|
|
102
153
|
if (process.env.NODE_ENV !== "production") try {
|
|
103
|
-
return
|
|
154
|
+
return W(e, t);
|
|
104
155
|
} catch (e) {
|
|
105
156
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
106
157
|
}
|
|
107
|
-
return
|
|
158
|
+
return W(e, t);
|
|
108
159
|
}
|
|
109
160
|
return t;
|
|
110
161
|
}
|
|
111
|
-
function
|
|
162
|
+
function K(e, t) {
|
|
112
163
|
return typeof e == "function" ? e(...t) : !!e;
|
|
113
164
|
}
|
|
114
165
|
//#endregion
|
|
115
166
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
116
|
-
var
|
|
117
|
-
let e = () =>
|
|
167
|
+
var Ze = /* @__PURE__ */ (() => {
|
|
168
|
+
let e = () => Be;
|
|
118
169
|
return {
|
|
119
170
|
isServer() {
|
|
120
171
|
return e();
|
|
@@ -123,13 +174,38 @@ var G = /* @__PURE__ */ (() => {
|
|
|
123
174
|
e = t;
|
|
124
175
|
}
|
|
125
176
|
};
|
|
126
|
-
})()
|
|
127
|
-
|
|
177
|
+
})();
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
+
function Qe() {
|
|
181
|
+
let e, t, n = new Promise((n, r) => {
|
|
182
|
+
e = n, t = r;
|
|
183
|
+
});
|
|
184
|
+
n.status = "pending", n.catch(() => {});
|
|
185
|
+
function r(e) {
|
|
186
|
+
Object.assign(n, e), delete n.resolve, delete n.reject;
|
|
187
|
+
}
|
|
188
|
+
return n.resolve = (t) => {
|
|
189
|
+
r({
|
|
190
|
+
status: "fulfilled",
|
|
191
|
+
value: t
|
|
192
|
+
}), e(t);
|
|
193
|
+
}, n.reject = (e) => {
|
|
194
|
+
r({
|
|
195
|
+
status: "rejected",
|
|
196
|
+
reason: e
|
|
197
|
+
}), t(e);
|
|
198
|
+
}, n;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
202
|
+
var $e = ze;
|
|
203
|
+
function et() {
|
|
128
204
|
let e = [], t = 0, n = (e) => {
|
|
129
205
|
e();
|
|
130
206
|
}, r = (e) => {
|
|
131
207
|
e();
|
|
132
|
-
}, i =
|
|
208
|
+
}, i = $e, a = (r) => {
|
|
133
209
|
t ? e.push(r) : i(() => {
|
|
134
210
|
n(r);
|
|
135
211
|
});
|
|
@@ -171,58 +247,7 @@ function Ze() {
|
|
|
171
247
|
}
|
|
172
248
|
};
|
|
173
249
|
}
|
|
174
|
-
var
|
|
175
|
-
constructor() {
|
|
176
|
-
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
177
|
-
}
|
|
178
|
-
subscribe(e) {
|
|
179
|
-
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
180
|
-
this.listeners.delete(e), this.onUnsubscribe();
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
hasListeners() {
|
|
184
|
-
return this.listeners.size > 0;
|
|
185
|
-
}
|
|
186
|
-
onSubscribe() {}
|
|
187
|
-
onUnsubscribe() {}
|
|
188
|
-
}, et = new class extends $e {
|
|
189
|
-
#e;
|
|
190
|
-
#t;
|
|
191
|
-
#n;
|
|
192
|
-
constructor() {
|
|
193
|
-
super(), this.#n = (e) => {
|
|
194
|
-
if (typeof window < "u" && window.addEventListener) {
|
|
195
|
-
let t = () => e();
|
|
196
|
-
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
197
|
-
window.removeEventListener("visibilitychange", t);
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
onSubscribe() {
|
|
203
|
-
this.#t || this.setEventListener(this.#n);
|
|
204
|
-
}
|
|
205
|
-
onUnsubscribe() {
|
|
206
|
-
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
207
|
-
}
|
|
208
|
-
setEventListener(e) {
|
|
209
|
-
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
210
|
-
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
setFocused(e) {
|
|
214
|
-
this.#e !== e && (this.#e = e, this.onFocus());
|
|
215
|
-
}
|
|
216
|
-
onFocus() {
|
|
217
|
-
let e = this.isFocused();
|
|
218
|
-
this.listeners.forEach((t) => {
|
|
219
|
-
t(e);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
isFocused() {
|
|
223
|
-
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
224
|
-
}
|
|
225
|
-
}(), tt = new class extends $e {
|
|
250
|
+
var tt = et(), nt = new class extends Fe {
|
|
226
251
|
#e = !0;
|
|
227
252
|
#t;
|
|
228
253
|
#n;
|
|
@@ -255,136 +280,13 @@ var Qe = Ze(), $e = class {
|
|
|
255
280
|
}
|
|
256
281
|
}();
|
|
257
282
|
//#endregion
|
|
258
|
-
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
259
|
-
function nt() {
|
|
260
|
-
let e, t, n = new Promise((n, r) => {
|
|
261
|
-
e = n, t = r;
|
|
262
|
-
});
|
|
263
|
-
n.status = "pending", n.catch(() => {});
|
|
264
|
-
function r(e) {
|
|
265
|
-
Object.assign(n, e), delete n.resolve, delete n.reject;
|
|
266
|
-
}
|
|
267
|
-
return n.resolve = (t) => {
|
|
268
|
-
r({
|
|
269
|
-
status: "fulfilled",
|
|
270
|
-
value: t
|
|
271
|
-
}), e(t);
|
|
272
|
-
}, n.reject = (e) => {
|
|
273
|
-
r({
|
|
274
|
-
status: "rejected",
|
|
275
|
-
reason: e
|
|
276
|
-
}), t(e);
|
|
277
|
-
}, n;
|
|
278
|
-
}
|
|
279
|
-
//#endregion
|
|
280
283
|
//#region node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
281
284
|
function rt(e) {
|
|
282
|
-
return (e ?? "online")
|
|
285
|
+
return (e ?? "online") !== "online" || nt.isOnline();
|
|
283
286
|
}
|
|
284
287
|
//#endregion
|
|
285
|
-
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
286
|
-
function it() {
|
|
287
|
-
return {
|
|
288
|
-
context: void 0,
|
|
289
|
-
data: void 0,
|
|
290
|
-
error: null,
|
|
291
|
-
failureCount: 0,
|
|
292
|
-
failureReason: null,
|
|
293
|
-
isPaused: !1,
|
|
294
|
-
status: "idle",
|
|
295
|
-
variables: void 0,
|
|
296
|
-
submittedAt: 0
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
301
|
-
var at = class extends $e {
|
|
302
|
-
#e;
|
|
303
|
-
#t = void 0;
|
|
304
|
-
#n;
|
|
305
|
-
#r;
|
|
306
|
-
constructor(e, t) {
|
|
307
|
-
super(), this.#e = e, this.setOptions(t), this.bindMethods(), this.#i();
|
|
308
|
-
}
|
|
309
|
-
bindMethods() {
|
|
310
|
-
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
311
|
-
}
|
|
312
|
-
setOptions(e) {
|
|
313
|
-
let t = this.options;
|
|
314
|
-
this.options = this.#e.defaultMutationOptions(e), Ge(this.options, t) || this.#e.getMutationCache().notify({
|
|
315
|
-
type: "observerOptionsUpdated",
|
|
316
|
-
mutation: this.#n,
|
|
317
|
-
observer: this
|
|
318
|
-
}), t?.mutationKey && this.options.mutationKey && He(t.mutationKey) !== He(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
319
|
-
}
|
|
320
|
-
onUnsubscribe() {
|
|
321
|
-
this.hasListeners() || this.#n?.removeObserver(this);
|
|
322
|
-
}
|
|
323
|
-
onMutationUpdate(e) {
|
|
324
|
-
this.#i(), this.#a(e);
|
|
325
|
-
}
|
|
326
|
-
getCurrentResult() {
|
|
327
|
-
return this.#t;
|
|
328
|
-
}
|
|
329
|
-
reset() {
|
|
330
|
-
this.#n?.removeObserver(this), this.#n = void 0, this.#i(), this.#a();
|
|
331
|
-
}
|
|
332
|
-
mutate(e, t) {
|
|
333
|
-
return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
334
|
-
}
|
|
335
|
-
#i() {
|
|
336
|
-
let e = this.#n?.state ?? it();
|
|
337
|
-
this.#t = {
|
|
338
|
-
...e,
|
|
339
|
-
isPending: e.status === "pending",
|
|
340
|
-
isSuccess: e.status === "success",
|
|
341
|
-
isError: e.status === "error",
|
|
342
|
-
isIdle: e.status === "idle",
|
|
343
|
-
mutate: this.mutate,
|
|
344
|
-
reset: this.reset
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
#a(e) {
|
|
348
|
-
Qe.batch(() => {
|
|
349
|
-
if (this.#r && this.hasListeners()) {
|
|
350
|
-
let t = this.#t.variables, n = this.#t.context, r = {
|
|
351
|
-
client: this.#e,
|
|
352
|
-
meta: this.options.meta,
|
|
353
|
-
mutationKey: this.options.mutationKey
|
|
354
|
-
};
|
|
355
|
-
if (e?.type === "success") {
|
|
356
|
-
try {
|
|
357
|
-
this.#r.onSuccess?.(e.data, t, n, r);
|
|
358
|
-
} catch (e) {
|
|
359
|
-
Promise.reject(e);
|
|
360
|
-
}
|
|
361
|
-
try {
|
|
362
|
-
this.#r.onSettled?.(e.data, null, t, n, r);
|
|
363
|
-
} catch (e) {
|
|
364
|
-
Promise.reject(e);
|
|
365
|
-
}
|
|
366
|
-
} else if (e?.type === "error") {
|
|
367
|
-
try {
|
|
368
|
-
this.#r.onError?.(e.error, t, n, r);
|
|
369
|
-
} catch (e) {
|
|
370
|
-
Promise.reject(e);
|
|
371
|
-
}
|
|
372
|
-
try {
|
|
373
|
-
this.#r.onSettled?.(void 0, e.error, t, n, r);
|
|
374
|
-
} catch (e) {
|
|
375
|
-
Promise.reject(e);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
this.listeners.forEach((e) => {
|
|
380
|
-
e(this.#t);
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
//#endregion
|
|
386
288
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
387
|
-
function
|
|
289
|
+
function it(e, t) {
|
|
388
290
|
return {
|
|
389
291
|
fetchFailureCount: 0,
|
|
390
292
|
fetchFailureReason: null,
|
|
@@ -397,9 +299,9 @@ function q(e, t) {
|
|
|
397
299
|
}
|
|
398
300
|
//#endregion
|
|
399
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
400
|
-
var
|
|
302
|
+
var at = class extends Fe {
|
|
401
303
|
constructor(e, t) {
|
|
402
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
304
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Qe(), this.bindMethods(), this.setOptions(t);
|
|
403
305
|
}
|
|
404
306
|
#e;
|
|
405
307
|
#t = void 0;
|
|
@@ -420,36 +322,36 @@ var ot = class extends $e {
|
|
|
420
322
|
this.refetch = this.refetch.bind(this);
|
|
421
323
|
}
|
|
422
324
|
onSubscribe() {
|
|
423
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
325
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), ot(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
424
326
|
}
|
|
425
327
|
onUnsubscribe() {
|
|
426
328
|
this.hasListeners() || this.destroy();
|
|
427
329
|
}
|
|
428
330
|
shouldFetchOnReconnect() {
|
|
429
|
-
return
|
|
331
|
+
return st(this.#t, this.options, this.options.refetchOnReconnect);
|
|
430
332
|
}
|
|
431
333
|
shouldFetchOnWindowFocus() {
|
|
432
|
-
return
|
|
334
|
+
return st(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
433
335
|
}
|
|
434
336
|
destroy() {
|
|
435
337
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
436
338
|
}
|
|
437
339
|
setOptions(e) {
|
|
438
340
|
let t = this.options, n = this.#t;
|
|
439
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
440
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
341
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof U(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !qe(this.options, t) && this.#e.getQueryCache().notify({
|
|
441
343
|
type: "observerOptionsUpdated",
|
|
442
344
|
query: this.#t,
|
|
443
345
|
observer: this
|
|
444
346
|
});
|
|
445
347
|
let r = this.hasListeners();
|
|
446
|
-
r &&
|
|
348
|
+
r && ct(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || We(this.options.staleTime, this.#t) !== We(t.staleTime, this.#t)) && this.#g();
|
|
447
349
|
let i = this.#_();
|
|
448
|
-
r && (this.#t !== n ||
|
|
350
|
+
r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
449
351
|
}
|
|
450
352
|
getOptimisticResult(e) {
|
|
451
353
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
452
|
-
return
|
|
354
|
+
return J(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
|
|
453
355
|
}
|
|
454
356
|
getCurrentResult() {
|
|
455
357
|
return this.#r;
|
|
@@ -479,14 +381,14 @@ var ot = class extends $e {
|
|
|
479
381
|
#h(e) {
|
|
480
382
|
this.#S();
|
|
481
383
|
let t = this.#t.fetch(this.options, e);
|
|
482
|
-
return e?.throwOnError || (t = t.catch(
|
|
384
|
+
return e?.throwOnError || (t = t.catch(Ve)), t;
|
|
483
385
|
}
|
|
484
386
|
#g() {
|
|
485
387
|
this.#b();
|
|
486
|
-
let e =
|
|
487
|
-
if (
|
|
488
|
-
let t =
|
|
489
|
-
this.#d =
|
|
388
|
+
let e = We(this.options.staleTime, this.#t);
|
|
389
|
+
if (Ze.isServer() || this.#r.isStale || !He(e)) return;
|
|
390
|
+
let t = Ue(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = Re.setTimeout(() => {
|
|
490
392
|
this.#r.isStale || this.updateResult();
|
|
491
393
|
}, t);
|
|
492
394
|
}
|
|
@@ -494,26 +396,26 @@ var ot = class extends $e {
|
|
|
494
396
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
495
397
|
}
|
|
496
398
|
#v(e) {
|
|
497
|
-
this.#x(), this.#p = e, !(
|
|
498
|
-
(this.options.refetchIntervalInBackground ||
|
|
399
|
+
this.#x(), this.#p = e, !(Ze.isServer() || U(this.options.enabled, this.#t) === !1 || !He(this.#p) || this.#p === 0) && (this.#f = Re.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Ie.isFocused()) && this.#h();
|
|
499
401
|
}, this.#p));
|
|
500
402
|
}
|
|
501
403
|
#y() {
|
|
502
404
|
this.#g(), this.#v(this.#_());
|
|
503
405
|
}
|
|
504
406
|
#b() {
|
|
505
|
-
this.#d !== void 0 && (
|
|
407
|
+
this.#d !== void 0 && (Re.clearTimeout(this.#d), this.#d = void 0);
|
|
506
408
|
}
|
|
507
409
|
#x() {
|
|
508
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (Re.clearInterval(this.#f), this.#f = void 0);
|
|
509
411
|
}
|
|
510
412
|
createResult(e, t) {
|
|
511
413
|
let n = this.#t, r = this.options, i = this.#r, a = this.#i, o = this.#a, s = e === n ? this.#n : e.state, { state: c } = e, l = { ...c }, u = !1, d;
|
|
512
414
|
if (t._optimisticResults) {
|
|
513
|
-
let i = this.hasListeners(), a = !i &&
|
|
415
|
+
let i = this.hasListeners(), a = !i && ot(e, t), o = i && ct(e, n, t, r);
|
|
514
416
|
(a || o) && (l = {
|
|
515
417
|
...l,
|
|
516
|
-
...
|
|
418
|
+
...it(c.data, e.options)
|
|
517
419
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
518
420
|
}
|
|
519
421
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -521,11 +423,11 @@ var ot = class extends $e {
|
|
|
521
423
|
let h = !1;
|
|
522
424
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
523
425
|
let e;
|
|
524
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
426
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = G(i?.data, e, t), u = !0);
|
|
525
427
|
}
|
|
526
428
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
527
429
|
else try {
|
|
528
|
-
this.#c = t.select, d = t.select(d), d =
|
|
430
|
+
this.#c = t.select, d = t.select(d), d = G(i?.data, d, t), this.#l = d, this.#s = null;
|
|
529
431
|
} catch (e) {
|
|
530
432
|
this.#s = e;
|
|
531
433
|
}
|
|
@@ -553,16 +455,17 @@ var ot = class extends $e {
|
|
|
553
455
|
isPaused: l.fetchStatus === "paused",
|
|
554
456
|
isPlaceholderData: u,
|
|
555
457
|
isRefetchError: v && b,
|
|
556
|
-
isStale:
|
|
458
|
+
isStale: lt(e, t),
|
|
557
459
|
refetch: this.refetch,
|
|
558
460
|
promise: this.#o,
|
|
559
|
-
isEnabled:
|
|
461
|
+
isEnabled: U(t.enabled, e) !== !1
|
|
560
462
|
};
|
|
561
463
|
if (this.options.experimental_prefetchInRender) {
|
|
562
464
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
563
465
|
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
564
466
|
}, a = () => {
|
|
565
|
-
|
|
467
|
+
let e = this.#o = x.promise = Qe();
|
|
468
|
+
i(e);
|
|
566
469
|
}, o = this.#o;
|
|
567
470
|
switch (o.status) {
|
|
568
471
|
case "pending":
|
|
@@ -580,7 +483,7 @@ var ot = class extends $e {
|
|
|
580
483
|
}
|
|
581
484
|
updateResult() {
|
|
582
485
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
583
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
486
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !qe(t, e) && (this.#r = t, this.#C({ listeners: (() => {
|
|
584
487
|
if (!e) return !0;
|
|
585
488
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
586
489
|
if (n === "all" || !n && !this.#m.size) return !0;
|
|
@@ -601,7 +504,7 @@ var ot = class extends $e {
|
|
|
601
504
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
602
505
|
}
|
|
603
506
|
#C(e) {
|
|
604
|
-
|
|
507
|
+
tt.batch(() => {
|
|
605
508
|
e.listeners && this.listeners.forEach((e) => {
|
|
606
509
|
e(this.#r);
|
|
607
510
|
}), this.#e.getQueryCache().notify({
|
|
@@ -611,31 +514,129 @@ var ot = class extends $e {
|
|
|
611
514
|
});
|
|
612
515
|
}
|
|
613
516
|
};
|
|
614
|
-
function
|
|
615
|
-
return
|
|
517
|
+
function q(e, t) {
|
|
518
|
+
return U(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && U(t.retryOnMount, e) === !1);
|
|
616
519
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
520
|
+
function ot(e, t) {
|
|
521
|
+
return q(e, t) || e.state.data !== void 0 && st(e, t, t.refetchOnMount);
|
|
619
522
|
}
|
|
620
|
-
function
|
|
621
|
-
if (
|
|
523
|
+
function st(e, t, n) {
|
|
524
|
+
if (U(t.enabled, e) !== !1 && We(t.staleTime, e) !== "static") {
|
|
622
525
|
let r = typeof n == "function" ? n(e) : n;
|
|
623
|
-
return r === "always" || r !== !1 &&
|
|
526
|
+
return r === "always" || r !== !1 && lt(e, t);
|
|
624
527
|
}
|
|
625
528
|
return !1;
|
|
626
529
|
}
|
|
627
|
-
function
|
|
628
|
-
return (e !== t ||
|
|
530
|
+
function ct(e, t, n, r) {
|
|
531
|
+
return (e !== t || U(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && lt(e, n);
|
|
629
532
|
}
|
|
630
|
-
function
|
|
631
|
-
return
|
|
533
|
+
function lt(e, t) {
|
|
534
|
+
return U(t.enabled, e) !== !1 && e.isStaleByTime(We(t.staleTime, e));
|
|
632
535
|
}
|
|
633
|
-
function
|
|
634
|
-
return !
|
|
536
|
+
function J(e, t) {
|
|
537
|
+
return !qe(e.getCurrentResult(), t);
|
|
635
538
|
}
|
|
636
539
|
//#endregion
|
|
637
|
-
//#region node_modules/@tanstack/
|
|
638
|
-
|
|
540
|
+
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
541
|
+
function ut() {
|
|
542
|
+
return {
|
|
543
|
+
context: void 0,
|
|
544
|
+
data: void 0,
|
|
545
|
+
error: null,
|
|
546
|
+
failureCount: 0,
|
|
547
|
+
failureReason: null,
|
|
548
|
+
isPaused: !1,
|
|
549
|
+
status: "idle",
|
|
550
|
+
variables: void 0,
|
|
551
|
+
submittedAt: 0
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
556
|
+
var Y = class extends Fe {
|
|
557
|
+
#e;
|
|
558
|
+
#t = void 0;
|
|
559
|
+
#n;
|
|
560
|
+
#r;
|
|
561
|
+
constructor(e, t) {
|
|
562
|
+
super(), this.#e = e, this.setOptions(t), this.bindMethods(), this.#i();
|
|
563
|
+
}
|
|
564
|
+
bindMethods() {
|
|
565
|
+
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
566
|
+
}
|
|
567
|
+
setOptions(e) {
|
|
568
|
+
let t = this.options;
|
|
569
|
+
this.options = this.#e.defaultMutationOptions(e), qe(this.options, t) || this.#e.getMutationCache().notify({
|
|
570
|
+
type: "observerOptionsUpdated",
|
|
571
|
+
mutation: this.#n,
|
|
572
|
+
observer: this
|
|
573
|
+
}), t?.mutationKey && this.options.mutationKey && Ge(t.mutationKey) !== Ge(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
574
|
+
}
|
|
575
|
+
onUnsubscribe() {
|
|
576
|
+
this.hasListeners() || this.#n?.removeObserver(this);
|
|
577
|
+
}
|
|
578
|
+
onMutationUpdate(e) {
|
|
579
|
+
this.#i(), this.#a(e);
|
|
580
|
+
}
|
|
581
|
+
getCurrentResult() {
|
|
582
|
+
return this.#t;
|
|
583
|
+
}
|
|
584
|
+
reset() {
|
|
585
|
+
this.#n?.removeObserver(this), this.#n = void 0, this.#i(), this.#a();
|
|
586
|
+
}
|
|
587
|
+
mutate(e, t) {
|
|
588
|
+
return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
589
|
+
}
|
|
590
|
+
#i() {
|
|
591
|
+
let e = this.#n?.state ?? ut();
|
|
592
|
+
this.#t = {
|
|
593
|
+
...e,
|
|
594
|
+
isPending: e.status === "pending",
|
|
595
|
+
isSuccess: e.status === "success",
|
|
596
|
+
isError: e.status === "error",
|
|
597
|
+
isIdle: e.status === "idle",
|
|
598
|
+
mutate: this.mutate,
|
|
599
|
+
reset: this.reset
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
#a(e) {
|
|
603
|
+
tt.batch(() => {
|
|
604
|
+
if (this.#r && this.hasListeners()) {
|
|
605
|
+
let t = this.#t.variables, n = this.#t.context, r = {
|
|
606
|
+
client: this.#e,
|
|
607
|
+
meta: this.options.meta,
|
|
608
|
+
mutationKey: this.options.mutationKey
|
|
609
|
+
};
|
|
610
|
+
if (e?.type === "success") {
|
|
611
|
+
try {
|
|
612
|
+
this.#r.onSuccess?.(e.data, t, n, r);
|
|
613
|
+
} catch (e) {
|
|
614
|
+
Promise.reject(e);
|
|
615
|
+
}
|
|
616
|
+
try {
|
|
617
|
+
this.#r.onSettled?.(e.data, null, t, n, r);
|
|
618
|
+
} catch (e) {
|
|
619
|
+
Promise.reject(e);
|
|
620
|
+
}
|
|
621
|
+
} else if (e?.type === "error") {
|
|
622
|
+
try {
|
|
623
|
+
this.#r.onError?.(e.error, t, n, r);
|
|
624
|
+
} catch (e) {
|
|
625
|
+
Promise.reject(e);
|
|
626
|
+
}
|
|
627
|
+
try {
|
|
628
|
+
this.#r.onSettled?.(void 0, e.error, t, n, r);
|
|
629
|
+
} catch (e) {
|
|
630
|
+
Promise.reject(e);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
this.listeners.forEach((e) => {
|
|
635
|
+
e(this.#t);
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}, dt = e.createContext(void 0), ft = (t) => {
|
|
639
640
|
let n = e.useContext(dt);
|
|
640
641
|
if (t) return t;
|
|
641
642
|
if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
|
|
@@ -645,10 +646,11 @@ var dt = e.createContext(void 0), ft = (t) => {
|
|
|
645
646
|
}), [t]), /* @__PURE__ */ p(dt.Provider, {
|
|
646
647
|
value: t,
|
|
647
648
|
children: n
|
|
648
|
-
}));
|
|
649
|
+
})), mt = e.createContext(!1), ht = () => e.useContext(mt);
|
|
650
|
+
mt.Provider;
|
|
649
651
|
//#endregion
|
|
650
652
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
651
|
-
function
|
|
653
|
+
function gt() {
|
|
652
654
|
let e = !1;
|
|
653
655
|
return {
|
|
654
656
|
clearReset: () => {
|
|
@@ -660,18 +662,14 @@ function mt() {
|
|
|
660
662
|
isReset: () => e
|
|
661
663
|
};
|
|
662
664
|
}
|
|
663
|
-
var
|
|
664
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
665
|
+
var _t = e.createContext(gt()), vt = () => e.useContext(_t), yt = (e, t, n) => {
|
|
666
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? K(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
665
667
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
666
|
-
},
|
|
668
|
+
}, bt = (t) => {
|
|
667
669
|
e.useEffect(() => {
|
|
668
670
|
t.clearReset();
|
|
669
671
|
}, [t]);
|
|
670
|
-
},
|
|
671
|
-
bt.Provider;
|
|
672
|
-
//#endregion
|
|
673
|
-
//#region node_modules/@tanstack/react-query/build/modern/suspense.js
|
|
674
|
-
var St = (e) => {
|
|
672
|
+
}, xt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || K(n, [e.error, r])), St = (e) => {
|
|
675
673
|
if (e.suspense) {
|
|
676
674
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
677
675
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
@@ -683,46 +681,46 @@ var St = (e) => {
|
|
|
683
681
|
//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
684
682
|
function Et(t, n, r) {
|
|
685
683
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
|
|
686
|
-
let i =
|
|
684
|
+
let i = ht(), a = vt(), o = ft(r), s = o.defaultQueryOptions(t);
|
|
687
685
|
o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
|
|
688
686
|
let c = o.getQueryCache().get(s.queryHash);
|
|
689
687
|
process.env.NODE_ENV !== "production" && (s.queryFn || console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));
|
|
690
688
|
let l = t.subscribed !== !1;
|
|
691
|
-
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s),
|
|
689
|
+
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s), yt(s, a, c), bt(a);
|
|
692
690
|
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
693
691
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
694
|
-
let t = p ? d.subscribe(
|
|
692
|
+
let t = p ? d.subscribe(tt.batchCalls(e)) : Ve;
|
|
695
693
|
return d.updateResult(), t;
|
|
696
694
|
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
697
695
|
d.setOptions(s);
|
|
698
696
|
}, [s, d]), wt(s, f)) throw Tt(s, d, a);
|
|
699
|
-
if (
|
|
697
|
+
if (xt({
|
|
700
698
|
result: f,
|
|
701
699
|
errorResetBoundary: a,
|
|
702
700
|
throwOnError: s.throwOnError,
|
|
703
701
|
query: c,
|
|
704
702
|
suspense: s.suspense
|
|
705
703
|
})) throw f.error;
|
|
706
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !
|
|
704
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !Ze.isServer() && Ct(f, i) && (u ? Tt(s, d, a) : c?.promise)?.catch(Ve).finally(() => {
|
|
707
705
|
d.updateResult();
|
|
708
706
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
709
707
|
}
|
|
710
708
|
//#endregion
|
|
711
709
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
712
710
|
function Dt(e, t) {
|
|
713
|
-
return Et(e,
|
|
711
|
+
return Et(e, at, t);
|
|
714
712
|
}
|
|
715
713
|
//#endregion
|
|
716
714
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
717
715
|
function Ot(t, n) {
|
|
718
|
-
let r = ft(n), [i] = e.useState(() => new
|
|
716
|
+
let r = ft(n), [i] = e.useState(() => new Y(r, t));
|
|
719
717
|
e.useEffect(() => {
|
|
720
718
|
i.setOptions(t);
|
|
721
719
|
}, [i, t]);
|
|
722
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
723
|
-
i.mutate(e, t).catch(
|
|
720
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(tt.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
721
|
+
i.mutate(e, t).catch(Ve);
|
|
724
722
|
}, [i]);
|
|
725
|
-
if (a.error &&
|
|
723
|
+
if (a.error && K(i.options.throwOnError, [a.error])) throw a.error;
|
|
726
724
|
return {
|
|
727
725
|
...a,
|
|
728
726
|
mutate: o,
|
|
@@ -1192,7 +1190,7 @@ function Cn(e) {
|
|
|
1192
1190
|
return t.filter((e) => e != null);
|
|
1193
1191
|
}
|
|
1194
1192
|
function wn(e, t) {
|
|
1195
|
-
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t
|
|
1193
|
+
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : !t || t[n] !== !1).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + wn(n, t), 0) : 0;
|
|
1196
1194
|
}
|
|
1197
1195
|
function Tn(e, t, n = 0) {
|
|
1198
1196
|
if (n === t) return [...e];
|
|
@@ -1393,7 +1391,7 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1393
1391
|
accessor: e.accessor,
|
|
1394
1392
|
defaultToggle: e.defaultToggle || !0,
|
|
1395
1393
|
toggleable: e.toggleable,
|
|
1396
|
-
toggled: e.defaultToggle === void 0
|
|
1394
|
+
toggled: e.defaultToggle === void 0 || e.defaultToggle
|
|
1397
1395
|
})), [t]), [i, a] = je({
|
|
1398
1396
|
key: e ? `${e}-columns-toggle` : "",
|
|
1399
1397
|
defaultValue: e ? r : void 0,
|
|
@@ -1412,7 +1410,7 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1412
1410
|
accessor: t.accessor,
|
|
1413
1411
|
defaultToggle: t.defaultToggle || !0,
|
|
1414
1412
|
toggleable: t.toggleable,
|
|
1415
|
-
toggled: t.defaultToggle === void 0
|
|
1413
|
+
toggled: t.defaultToggle === void 0 || t.defaultToggle
|
|
1416
1414
|
});
|
|
1417
1415
|
}), e;
|
|
1418
1416
|
}, [
|
|
@@ -1493,7 +1491,7 @@ var jn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1493
1491
|
h
|
|
1494
1492
|
]), D = l(() => {
|
|
1495
1493
|
let e = E.filter((e) => !e.hidden && e.accessor !== "__selection__");
|
|
1496
|
-
return e.length
|
|
1494
|
+
return e.length !== 0 && e.every((e) => typeof e.width == "string" && /px$/.test(e.width));
|
|
1497
1495
|
}, [E]);
|
|
1498
1496
|
return {
|
|
1499
1497
|
effectiveColumns: E,
|
|
@@ -1785,11 +1783,11 @@ function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1785
1783
|
let u = (e) => a?.(i.filter((t) => t !== Q(e, n)));
|
|
1786
1784
|
return {
|
|
1787
1785
|
expandOnClick: r !== "always" && r !== "never",
|
|
1788
|
-
isRowExpanded: (e) => r === "always"
|
|
1789
|
-
isExpandable: ({ record: e, index: n }) => t
|
|
1786
|
+
isRowExpanded: (e) => r === "always" || i.includes(Q(e, n)),
|
|
1787
|
+
isExpandable: ({ record: e, index: n }) => !t || t({
|
|
1790
1788
|
record: e,
|
|
1791
1789
|
index: n
|
|
1792
|
-
})
|
|
1790
|
+
}),
|
|
1793
1791
|
expandRow: (e) => {
|
|
1794
1792
|
let t = Q(e, n);
|
|
1795
1793
|
a?.(s ? [...i, t] : [t]);
|
|
@@ -1819,7 +1817,7 @@ function Yn(e, t) {
|
|
|
1819
1817
|
}
|
|
1820
1818
|
var Xn = "mantine-datatable-nowrap", Zn = "mantine-datatable-ellipsis", Qn = "mantine-datatable-pointer-cursor", $n = "mantine-datatable-context-menu-cursor", er = "mantine-datatable-text-selection-disabled", tr = "mantine-datatable-text-align-left", nr = "mantine-datatable-text-align-center", rr = "mantine-datatable-text-align-right";
|
|
1821
1819
|
function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1822
|
-
return qn(r) ? p(
|
|
1820
|
+
return qn(r) ? p(oe, {
|
|
1823
1821
|
"data-pinned": n?.position,
|
|
1824
1822
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1825
1823
|
className: X({
|
|
@@ -1846,17 +1844,17 @@ function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1846
1844
|
}) : null;
|
|
1847
1845
|
}
|
|
1848
1846
|
function ar({ shadowVisible: e }) {
|
|
1849
|
-
return p(
|
|
1847
|
+
return p(oe, {
|
|
1850
1848
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1851
1849
|
"data-shadow-visible": e || void 0
|
|
1852
1850
|
});
|
|
1853
1851
|
}
|
|
1854
1852
|
function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1855
|
-
return p(
|
|
1853
|
+
return p(ae, {
|
|
1856
1854
|
ref: s,
|
|
1857
1855
|
className: X("mantine-datatable-footer", e),
|
|
1858
1856
|
style: t,
|
|
1859
|
-
children: m(
|
|
1857
|
+
children: m(ce, { children: [a && p(ar, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1860
1858
|
if (e) return null;
|
|
1861
1859
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1862
1860
|
...r,
|
|
@@ -1895,7 +1893,7 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1895
1893
|
n,
|
|
1896
1894
|
_
|
|
1897
1895
|
]), y = l(() => d.reduce((e, t) => e + wn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = En(f, y + v < h, m);
|
|
1898
|
-
return v > 0 ? p(
|
|
1896
|
+
return v > 0 ? p(oe, {
|
|
1899
1897
|
colSpan: v,
|
|
1900
1898
|
rowSpan: b > 1 ? b : void 0,
|
|
1901
1899
|
"data-pinned": s?.position,
|
|
@@ -2284,13 +2282,13 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2284
2282
|
});
|
|
2285
2283
|
} : void 0, z = (e) => {
|
|
2286
2284
|
e.stopPropagation(), A(r), I(!1);
|
|
2287
|
-
},
|
|
2285
|
+
}, B = (e) => {
|
|
2288
2286
|
e.preventDefault(), j(r), I(!0);
|
|
2289
|
-
},
|
|
2287
|
+
}, ae = () => {
|
|
2290
2288
|
j(r), I(!1), M();
|
|
2291
|
-
},
|
|
2289
|
+
}, se = () => {
|
|
2292
2290
|
I(!0);
|
|
2293
|
-
},
|
|
2291
|
+
}, ce = () => {
|
|
2294
2292
|
I(!1);
|
|
2295
2293
|
}, le = (e) => {
|
|
2296
2294
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
@@ -2303,7 +2301,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2303
2301
|
pinned: e
|
|
2304
2302
|
} : t));
|
|
2305
2303
|
};
|
|
2306
|
-
return m(
|
|
2304
|
+
return m(oe, {
|
|
2307
2305
|
"data-accessor": r,
|
|
2308
2306
|
"data-pinned": n?.position,
|
|
2309
2307
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2347,10 +2345,10 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2347
2345
|
}),
|
|
2348
2346
|
draggable: s,
|
|
2349
2347
|
onDragStart: s ? z : void 0,
|
|
2350
|
-
onDragEnter: s ?
|
|
2351
|
-
onDragOver: s ?
|
|
2352
|
-
onDrop: s ?
|
|
2353
|
-
onDragLeave: s ?
|
|
2348
|
+
onDragEnter: s ? se : void 0,
|
|
2349
|
+
onDragOver: s ? B : void 0,
|
|
2350
|
+
onDrop: s ? ae : void 0,
|
|
2351
|
+
onDragLeave: s ? ce : void 0,
|
|
2354
2352
|
children: [s ? p(b, {
|
|
2355
2353
|
role: "img",
|
|
2356
2354
|
"aria-label": "Drag column",
|
|
@@ -2414,7 +2412,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2414
2412
|
}
|
|
2415
2413
|
function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2416
2414
|
let u = !o.disabled;
|
|
2417
|
-
return p(
|
|
2415
|
+
return p(oe, {
|
|
2418
2416
|
ref: l,
|
|
2419
2417
|
className: X("mantine-datatable-header-selector-cell", { [Qn]: n === "cell" && u }, e),
|
|
2420
2418
|
style: t,
|
|
@@ -2457,7 +2455,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2457
2455
|
checkboxProps: v,
|
|
2458
2456
|
onChange: _,
|
|
2459
2457
|
rowSpan: c ? D : void 0
|
|
2460
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } = dn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? gn(String(e))])) : void 0, ee = m(
|
|
2458
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = dn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? gn(String(e))])) : void 0, ee = m(se, {
|
|
2461
2459
|
className: X("mantine-datatable-header", t),
|
|
2462
2460
|
style: n,
|
|
2463
2461
|
ref: w,
|
|
@@ -2466,7 +2464,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2466
2464
|
} : void 0,
|
|
2467
2465
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2468
2466
|
let n = Tn(c, t);
|
|
2469
|
-
return m(
|
|
2467
|
+
return m(ce, { children: [t === 0 && O, n.map((e, r) => p(sr, {
|
|
2470
2468
|
group: e,
|
|
2471
2469
|
pinnedInfo: Cr(e, l),
|
|
2472
2470
|
maxDepth: E,
|
|
@@ -2476,7 +2474,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2476
2474
|
withColumnBorders: C,
|
|
2477
2475
|
totalTableColumns: o.length
|
|
2478
2476
|
}, e.id))] }, `group-depth-${t}`);
|
|
2479
|
-
}), m(
|
|
2477
|
+
}), m(ce, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2480
2478
|
if (e) return null;
|
|
2481
2479
|
let { accessor: c, visibleMediaQuery: u, textAlign: d, width: f, title: m, sortable: h, draggable: g, toggleable: _, pinnable: v, resizable: y, titleClassName: b, titleStyle: x, filter: S, filterPopoverProps: C, filterPopoverDisableClickOutside: w, filtering: T, sortKey: E } = {
|
|
2482
2480
|
...s,
|
|
@@ -2690,7 +2688,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2690
2688
|
});
|
|
2691
2689
|
}
|
|
2692
2690
|
function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
|
|
2693
|
-
return qn(r) ? p(
|
|
2691
|
+
return qn(r) ? p(B, {
|
|
2694
2692
|
"data-pinned": n?.position,
|
|
2695
2693
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2696
2694
|
className: X({
|
|
@@ -2724,7 +2722,7 @@ function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2724
2722
|
}
|
|
2725
2723
|
function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2726
2724
|
let { expanded: i, visible: a } = Yn(e, r?.transitionDuration);
|
|
2727
|
-
return a ? m(f, { children: [p(
|
|
2725
|
+
return a ? m(f, { children: [p(ce, {}), p(ce, { children: p(B, {
|
|
2728
2726
|
className: "mantine-datatable-row-expansion-cell",
|
|
2729
2727
|
colSpan: t,
|
|
2730
2728
|
children: p(S, {
|
|
@@ -2744,7 +2742,7 @@ function Mr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
|
|
|
2744
2742
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2745
2743
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2746
2744
|
};
|
|
2747
|
-
return p(
|
|
2745
|
+
return p(B, {
|
|
2748
2746
|
className: X("mantine-datatable-row-selector-cell", { [Qn]: i === "cell" && d }, e),
|
|
2749
2747
|
style: t,
|
|
2750
2748
|
"data-shadow-visible": o || void 0,
|
|
@@ -2841,7 +2839,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2841
2839
|
rowProps: P,
|
|
2842
2840
|
children: M,
|
|
2843
2841
|
expandedElement: N
|
|
2844
|
-
}) : m(f, { children: [p(
|
|
2842
|
+
}) : m(f, { children: [p(ce, {
|
|
2845
2843
|
...P,
|
|
2846
2844
|
children: M
|
|
2847
2845
|
}), N] });
|
|
@@ -2908,7 +2906,7 @@ function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2908
2906
|
]
|
|
2909
2907
|
});
|
|
2910
2908
|
}
|
|
2911
|
-
function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: R, recordsPerPage: re, onRecordsPerPageChange: ie, recordsPerPageOptions:
|
|
2909
|
+
function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: R, recordsPerPage: re, onRecordsPerPageChange: ie, recordsPerPageOptions: B, recordsPerPageLabel: ae = "Records per page", paginationWithEdges: oe, paginationWithControls: se, paginationActiveTextColor: ce, paginationActiveBackgroundColor: le, paginationSize: V = "sm", paginationText: ue = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: de = "sm", getPaginationControlProps: fe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: H, customLoader: he, loaderSize: ge, loaderType: _e, loaderColor: ve, loadingText: ye = "...", emptyState: be, noRecordsText: xe = "No records", noRecordsIcon: Se, highlightOnHover: Ce, striped: we, noHeader: Te, onRowClick: Ee, onRowDoubleClick: De, onRowContextMenu: Oe, onCellClick: ke, onCellDoubleClick: Ae, onCellContextMenu: je, onScroll: Me, onScrollToTop: Pe, onScrollToBottom: Fe, onScrollToLeft: Ie, onScrollToRight: Le, c: Re, backgroundColor: ze, borderColor: Be, rowBorderColor: Ve, stripedColor: He, highlightOnHoverColor: Ue, rowColor: We, rowBackgroundColor: U, rowExpansion: Ge, rowClassName: Ke, rowStyle: W, customRowAttributes: qe, scrollViewportRef: Je, scrollAreaProps: Ye, tableRef: Xe, bodyRef: G, m: K, my: Ze, mx: Qe, mt: $e, mb: et, ml: tt, mr: nt, className: rt, classNames: it, style: at, styles: q, rowFactory: ot, tableWrapper: st, ...ct }) {
|
|
2912
2910
|
let lt = l(() => y ? Cn(y) : g, [g, y]), { refs: J, onScroll: ut } = Bn({
|
|
2913
2911
|
scrollCallbacks: {
|
|
2914
2912
|
onScroll: Me,
|
|
@@ -2924,7 +2922,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2924
2922
|
headerRef: J.header,
|
|
2925
2923
|
scrollViewportRef: J.scrollViewport
|
|
2926
2924
|
}), dt = Y.effectiveColumns, ft = Ne(J.table, Xe), pt = Ne(J.scrollViewport, Je), mt = u(null), ht = Ne(mt, G), gt = Jn({
|
|
2927
|
-
rowExpansion:
|
|
2925
|
+
rowExpansion: Ge,
|
|
2928
2926
|
records: T,
|
|
2929
2927
|
idAccessor: w
|
|
2930
2928
|
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Vn({
|
|
@@ -2989,10 +2987,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2989
2987
|
theme: e,
|
|
2990
2988
|
c: Re,
|
|
2991
2989
|
backgroundColor: ze,
|
|
2992
|
-
borderColor:
|
|
2993
|
-
rowBorderColor:
|
|
2994
|
-
stripedColor:
|
|
2995
|
-
highlightOnHoverColor:
|
|
2990
|
+
borderColor: Be,
|
|
2991
|
+
rowBorderColor: Ve,
|
|
2992
|
+
stripedColor: He,
|
|
2993
|
+
highlightOnHoverColor: Ue
|
|
2996
2994
|
}),
|
|
2997
2995
|
borderRadius: e.radius[t] || t,
|
|
2998
2996
|
boxShadow: e.shadows[d] || d,
|
|
@@ -3068,7 +3066,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3068
3066
|
let n = Q(e, w), r = Dt?.includes(n) || !1, i;
|
|
3069
3067
|
return O && D && (i = (i) => {
|
|
3070
3068
|
if (i.nativeEvent.shiftKey && Pt !== null) {
|
|
3071
|
-
let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (j
|
|
3069
|
+
let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (!j || j(e, n)) : (e, n) => n >= t && n <= Pt && (!j || j(e, n)));
|
|
3072
3070
|
O(r ? yn(D, e, (e) => Q(e, w)) : bn([...D, ...e], (e) => Q(e, w)));
|
|
3073
3071
|
} else O(r ? D.filter((e) => Q(e, w) !== n) : bn([...D, e], (e) => Q(e, w)));
|
|
3074
3072
|
Ft(t);
|
|
@@ -3093,10 +3091,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3093
3091
|
onContextMenu: Oe,
|
|
3094
3092
|
onCellContextMenu: je,
|
|
3095
3093
|
expansion: gt,
|
|
3096
|
-
color:
|
|
3097
|
-
backgroundColor:
|
|
3098
|
-
className:
|
|
3099
|
-
style:
|
|
3094
|
+
color: We,
|
|
3095
|
+
backgroundColor: U,
|
|
3096
|
+
className: Ke,
|
|
3097
|
+
style: W,
|
|
3100
3098
|
customAttributes: qe,
|
|
3101
3099
|
selectorCellShadowVisible: It,
|
|
3102
3100
|
selectionColumnClassName: k,
|
|
@@ -3129,11 +3127,11 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3129
3127
|
totalRecords: R,
|
|
3130
3128
|
recordsPerPage: re,
|
|
3131
3129
|
onRecordsPerPageChange: ie,
|
|
3132
|
-
recordsPerPageOptions:
|
|
3133
|
-
recordsPerPageLabel:
|
|
3134
|
-
paginationWithEdges:
|
|
3135
|
-
paginationWithControls:
|
|
3136
|
-
paginationActiveTextColor:
|
|
3130
|
+
recordsPerPageOptions: B,
|
|
3131
|
+
recordsPerPageLabel: ae,
|
|
3132
|
+
paginationWithEdges: oe,
|
|
3133
|
+
paginationWithControls: se,
|
|
3134
|
+
paginationActiveTextColor: ce,
|
|
3137
3135
|
paginationActiveBackgroundColor: le,
|
|
3138
3136
|
paginationSize: V,
|
|
3139
3137
|
paginationText: ue,
|
|
@@ -3599,7 +3597,7 @@ var ti = [
|
|
|
3599
3597
|
100,
|
|
3600
3598
|
500
|
|
3601
3599
|
];
|
|
3602
|
-
function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, fields: l, selection: h, pagination: b, filters: x, actions: S, steps: C, defaultSort: D, onSortChange: O, createButtonText: A, queryParams: j, tabs: M, defaultTab: P, activeTab: ee, onActiveTabChange: F, canUpdate: te, canDelete: I, showRefresh: L = !0, onRefresh: ne, autoPoll: ie, rowExpansion: z, onRowClick:
|
|
3600
|
+
function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, fields: l, selection: h, pagination: b, filters: x, actions: S, steps: C, defaultSort: D, onSortChange: O, createButtonText: A, queryParams: j, tabs: M, defaultTab: P, activeTab: ee, onActiveTabChange: F, canUpdate: te, canDelete: I, showRefresh: L = !0, onRefresh: ne, autoPoll: ie, rowExpansion: z, onRowClick: B, mobileCards: ae = !1, deleteConfirmMessage: oe, editRecordId: se, onEditRecordIdChange: ce }) {
|
|
3603
3601
|
let [ue, de] = d(P || (M && M.length > 0 ? M[0].value : null)), pe = ee === void 0 ? ue : ee, me = (e) => {
|
|
3604
3602
|
ee === void 0 && de(e), F && F(e);
|
|
3605
3603
|
}, H = M?.find((e) => e.value === pe), he = H?.queryParams || {}, ge = H?.apiPath ?? a, _e = H?.mutationApiPath ?? o ?? ge, ve = {
|
|
@@ -3622,8 +3620,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3622
3620
|
direction: D?.direction ?? "desc"
|
|
3623
3621
|
}), ze = (e) => {
|
|
3624
3622
|
Re(e), O && O(String(e.columnAccessor), e.direction);
|
|
3625
|
-
},
|
|
3626
|
-
|
|
3623
|
+
}, Be = Ur(Me, Le.columnAccessor, Le.direction), [Ve, He] = zr(ti[1], "mantine-table-page-size"), [Ue, We] = d(1), U = b ? Be.slice((Ue - 1) * Ve, Ue * Ve) : Be, [Ge, Ke] = d([]), W = z?.expanded?.recordIds ?? Ge, qe = z?.expanded?.onRecordIdsChange ?? Ke, Je = (e) => {
|
|
3624
|
+
W.includes(e) ? qe(W.filter((t) => t !== e)) : qe(z?.allowMultiple ? [...W, e] : [e]);
|
|
3627
3625
|
}, Ye = l.findIndex((e) => e.list && e.column && !e.column.hidden), Xe = z && Ye >= 0 ? l.map((e, t) => {
|
|
3628
3626
|
if (t !== Ye) return e;
|
|
3629
3627
|
let n = e.column.render;
|
|
@@ -3650,7 +3648,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3650
3648
|
size: 16,
|
|
3651
3649
|
style: {
|
|
3652
3650
|
color: "var(--mantine-primary-color-filled)",
|
|
3653
|
-
transform:
|
|
3651
|
+
transform: W.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3654
3652
|
transition: "transform 200ms ease"
|
|
3655
3653
|
}
|
|
3656
3654
|
})
|
|
@@ -3667,14 +3665,14 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3667
3665
|
}, [pe]);
|
|
3668
3666
|
let [Ze, Qe] = d(!1), [$e, et] = d(!1), [tt, nt] = d(!1), rt = u(null);
|
|
3669
3667
|
s(() => {
|
|
3670
|
-
if (!
|
|
3668
|
+
if (!se) {
|
|
3671
3669
|
rt.current = null;
|
|
3672
3670
|
return;
|
|
3673
3671
|
}
|
|
3674
|
-
if (rt.current ===
|
|
3675
|
-
let e =
|
|
3676
|
-
e && (rt.current =
|
|
3677
|
-
}, [
|
|
3672
|
+
if (rt.current === se) return;
|
|
3673
|
+
let e = Be.find((e) => e.id === se);
|
|
3674
|
+
e && (rt.current = se, K([e]), et(!0), ce?.(null));
|
|
3675
|
+
}, [se, Be]);
|
|
3678
3676
|
let it = l.some((e) => e.update), at = l.some((e) => e.delete), q = [];
|
|
3679
3677
|
return it && q.push({
|
|
3680
3678
|
icon: /* @__PURE__ */ p(we, { size: 14 }),
|
|
@@ -3768,7 +3766,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3768
3766
|
(l.some((e) => e.update) || h) && (() => {
|
|
3769
3767
|
let e = l.find((e) => e.update) && (!te || G.length > 0 && te(G[0])), t = l.find((e) => e.delete) && (!I || G.length > 0 && I(G[0])), n = (S ?? []).length > 0, r = e || t || n;
|
|
3770
3768
|
return /* @__PURE__ */ p(v, {
|
|
3771
|
-
...
|
|
3769
|
+
...ae ? { visibleFrom: "sm" } : {},
|
|
3772
3770
|
children: /* @__PURE__ */ m(k, {
|
|
3773
3771
|
shadow: "md",
|
|
3774
3772
|
children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
|
|
@@ -3837,50 +3835,50 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3837
3835
|
].fill(0).map((e, t) => /* @__PURE__ */ p(R, { height: 35 }, `skeleton-${t}`))]
|
|
3838
3836
|
}),
|
|
3839
3837
|
!De && !Ae && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3840
|
-
...
|
|
3838
|
+
...ae ? { visibleFrom: "sm" } : {},
|
|
3841
3839
|
children: /* @__PURE__ */ p(Ir, {
|
|
3842
3840
|
my: "md",
|
|
3843
3841
|
striped: !0,
|
|
3844
3842
|
highlightOnHover: !0,
|
|
3845
3843
|
minHeight: 150,
|
|
3846
3844
|
fetching: ke,
|
|
3847
|
-
records:
|
|
3845
|
+
records: U,
|
|
3848
3846
|
sortStatus: Le,
|
|
3849
3847
|
onSortStatusChange: ze,
|
|
3850
3848
|
...h && {
|
|
3851
3849
|
selectedRecords: G,
|
|
3852
3850
|
onSelectedRecordsChange: K
|
|
3853
3851
|
},
|
|
3854
|
-
...b &&
|
|
3855
|
-
totalRecords:
|
|
3856
|
-
recordsPerPage:
|
|
3857
|
-
onPageChange:
|
|
3858
|
-
page:
|
|
3852
|
+
...b && U.length && {
|
|
3853
|
+
totalRecords: Be.length,
|
|
3854
|
+
recordsPerPage: Ve,
|
|
3855
|
+
onPageChange: We,
|
|
3856
|
+
page: Ue,
|
|
3859
3857
|
recordsPerPageOptions: ti,
|
|
3860
|
-
onRecordsPerPageChange:
|
|
3858
|
+
onRecordsPerPageChange: He,
|
|
3861
3859
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3862
3860
|
},
|
|
3863
3861
|
...z && { rowExpansion: {
|
|
3864
3862
|
allowMultiple: z.allowMultiple ?? !1,
|
|
3865
|
-
trigger:
|
|
3863
|
+
trigger: B ? "never" : "click",
|
|
3866
3864
|
content: ({ record: e }) => z.content(e, !1),
|
|
3867
3865
|
expanded: {
|
|
3868
|
-
recordIds:
|
|
3866
|
+
recordIds: W,
|
|
3869
3867
|
onRecordIdsChange: qe
|
|
3870
3868
|
},
|
|
3871
3869
|
...z.expandable && { expandable: ({ record: e }) => z.expandable(e) }
|
|
3872
3870
|
} },
|
|
3873
3871
|
columns: Xe.map((e) => e.column),
|
|
3874
3872
|
noRecordsText: "Keine Einträge gefunden",
|
|
3875
|
-
onRowClick:
|
|
3876
|
-
...
|
|
3873
|
+
onRowClick: B,
|
|
3874
|
+
...B && { style: { cursor: "pointer" } }
|
|
3877
3875
|
})
|
|
3878
|
-
}),
|
|
3876
|
+
}), ae && /* @__PURE__ */ p(v, {
|
|
3879
3877
|
hiddenFrom: "sm",
|
|
3880
3878
|
children: /* @__PURE__ */ p(ei, {
|
|
3881
|
-
records:
|
|
3879
|
+
records: U,
|
|
3882
3880
|
fields: Xe,
|
|
3883
|
-
onRowClick:
|
|
3881
|
+
onRowClick: B,
|
|
3884
3882
|
sort: {
|
|
3885
3883
|
field: String(Le.columnAccessor),
|
|
3886
3884
|
direction: Le.direction,
|
|
@@ -3891,20 +3889,20 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3891
3889
|
});
|
|
3892
3890
|
}
|
|
3893
3891
|
},
|
|
3894
|
-
...b &&
|
|
3895
|
-
totalRecords:
|
|
3896
|
-
recordsPerPage:
|
|
3897
|
-
page:
|
|
3898
|
-
onPageChange:
|
|
3892
|
+
...b && U.length && { pagination: {
|
|
3893
|
+
totalRecords: Be.length,
|
|
3894
|
+
recordsPerPage: Ve,
|
|
3895
|
+
page: Ue,
|
|
3896
|
+
onPageChange: We,
|
|
3899
3897
|
recordsPerPageOptions: ti,
|
|
3900
3898
|
onRecordsPerPageChange: (e) => {
|
|
3901
|
-
|
|
3899
|
+
He(e), We(1);
|
|
3902
3900
|
}
|
|
3903
3901
|
} },
|
|
3904
3902
|
...z && { rowExpansion: {
|
|
3905
3903
|
content: z.content,
|
|
3906
3904
|
expanded: {
|
|
3907
|
-
recordIds:
|
|
3905
|
+
recordIds: W,
|
|
3908
3906
|
onRecordIdsChange: qe
|
|
3909
3907
|
},
|
|
3910
3908
|
...z.expandable && { expandable: z.expandable }
|
|
@@ -3948,7 +3946,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3948
3946
|
connectedQueryKeys: r,
|
|
3949
3947
|
apiPath: _e,
|
|
3950
3948
|
selectedRecords: G,
|
|
3951
|
-
confirmMessage:
|
|
3949
|
+
confirmMessage: oe
|
|
3952
3950
|
})
|
|
3953
3951
|
}),
|
|
3954
3952
|
/* @__PURE__ */ p(N, {
|