@espresso-lab/mantine-data-table 2.2.8 → 2.2.9
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 +345 -342
- 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 +10 -10
package/dist/index.es.js
CHANGED
|
@@ -1,70 +1,19 @@
|
|
|
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 ae, TableTfoot as oe, TableTh as se, TableThead as ce, TableTr as B, 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 =
|
|
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 = {
|
|
9
|
+
//#region node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
10
|
+
var Fe = {
|
|
62
11
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
63
12
|
clearTimeout: (e) => clearTimeout(e),
|
|
64
13
|
setInterval: (e, t) => setInterval(e, t),
|
|
65
14
|
clearInterval: (e) => clearInterval(e)
|
|
66
|
-
},
|
|
67
|
-
#e =
|
|
15
|
+
}, Ie = new class {
|
|
16
|
+
#e = Fe;
|
|
68
17
|
#t = !1;
|
|
69
18
|
setTimeoutProvider(e) {
|
|
70
19
|
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.", {
|
|
@@ -85,87 +34,87 @@ var Fe = class {
|
|
|
85
34
|
this.#e.clearInterval(e);
|
|
86
35
|
}
|
|
87
36
|
}();
|
|
88
|
-
function
|
|
37
|
+
function Le(e) {
|
|
89
38
|
setTimeout(e, 0);
|
|
90
39
|
}
|
|
91
40
|
//#endregion
|
|
92
41
|
//#region node_modules/@tanstack/query-core/build/modern/utils.js
|
|
93
|
-
var
|
|
94
|
-
function
|
|
95
|
-
function
|
|
42
|
+
var Re = typeof window > "u" || "Deno" in globalThis;
|
|
43
|
+
function ze() {}
|
|
44
|
+
function U(e) {
|
|
96
45
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
46
|
}
|
|
98
|
-
function
|
|
47
|
+
function Be(e, t) {
|
|
99
48
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
49
|
}
|
|
101
|
-
function
|
|
50
|
+
function Ve(e, t) {
|
|
102
51
|
return typeof e == "function" ? e(t) : e;
|
|
103
52
|
}
|
|
104
|
-
function
|
|
53
|
+
function W(e, t) {
|
|
105
54
|
return typeof e == "function" ? e(t) : e;
|
|
106
55
|
}
|
|
107
|
-
function
|
|
108
|
-
return JSON.stringify(e, (e, t) =>
|
|
56
|
+
function He(e) {
|
|
57
|
+
return JSON.stringify(e, (e, t) => qe(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
58
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
59
|
+
var Ue = Object.prototype.hasOwnProperty;
|
|
60
|
+
function We(e, t, n = 0) {
|
|
112
61
|
if (e === t) return e;
|
|
113
62
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
63
|
+
let r = Ke(e) && Ke(t);
|
|
64
|
+
if (!r && !(qe(e) && qe(t))) return t;
|
|
116
65
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
117
66
|
for (let l = 0; l < o; l++) {
|
|
118
67
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
119
68
|
if (u === d) {
|
|
120
|
-
s[o] = u, (r ? l < i :
|
|
69
|
+
s[o] = u, (r ? l < i : Ue.call(e, o)) && c++;
|
|
121
70
|
continue;
|
|
122
71
|
}
|
|
123
72
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
124
73
|
s[o] = d;
|
|
125
74
|
continue;
|
|
126
75
|
}
|
|
127
|
-
let f =
|
|
76
|
+
let f = We(u, d, n + 1);
|
|
128
77
|
s[o] = f, f === u && c++;
|
|
129
78
|
}
|
|
130
79
|
return i === o && c === i ? e : s;
|
|
131
80
|
}
|
|
132
|
-
function
|
|
81
|
+
function Ge(e, t) {
|
|
133
82
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
83
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
84
|
return !0;
|
|
136
85
|
}
|
|
137
|
-
function
|
|
86
|
+
function Ke(e) {
|
|
138
87
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
88
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
89
|
+
function qe(e) {
|
|
90
|
+
if (!Je(e)) return !1;
|
|
142
91
|
let t = e.constructor;
|
|
143
92
|
if (t === void 0) return !0;
|
|
144
93
|
let n = t.prototype;
|
|
145
|
-
return !(!
|
|
94
|
+
return !(!Je(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
95
|
}
|
|
147
|
-
function
|
|
96
|
+
function Je(e) {
|
|
148
97
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
98
|
}
|
|
150
|
-
function
|
|
99
|
+
function Ye(e, t, n) {
|
|
151
100
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
101
|
if (n.structuralSharing !== !1) {
|
|
153
102
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
103
|
+
return We(e, t);
|
|
155
104
|
} catch (e) {
|
|
156
105
|
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;
|
|
157
106
|
}
|
|
158
|
-
return
|
|
107
|
+
return We(e, t);
|
|
159
108
|
}
|
|
160
109
|
return t;
|
|
161
110
|
}
|
|
162
|
-
function
|
|
111
|
+
function Xe(e, t) {
|
|
163
112
|
return typeof e == "function" ? e(...t) : !!e;
|
|
164
113
|
}
|
|
165
114
|
//#endregion
|
|
166
115
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
167
|
-
var
|
|
168
|
-
let e = () =>
|
|
116
|
+
var G = /* @__PURE__ */ (() => {
|
|
117
|
+
let e = () => Re;
|
|
169
118
|
return {
|
|
170
119
|
isServer() {
|
|
171
120
|
return e();
|
|
@@ -174,38 +123,13 @@ var Ze = /* @__PURE__ */ (() => {
|
|
|
174
123
|
e = t;
|
|
175
124
|
}
|
|
176
125
|
};
|
|
177
|
-
})();
|
|
178
|
-
|
|
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() {
|
|
126
|
+
})(), K = Le;
|
|
127
|
+
function Ze() {
|
|
204
128
|
let e = [], t = 0, n = (e) => {
|
|
205
129
|
e();
|
|
206
130
|
}, r = (e) => {
|
|
207
131
|
e();
|
|
208
|
-
}, i =
|
|
132
|
+
}, i = K, a = (r) => {
|
|
209
133
|
t ? e.push(r) : i(() => {
|
|
210
134
|
n(r);
|
|
211
135
|
});
|
|
@@ -247,7 +171,58 @@ function et() {
|
|
|
247
171
|
}
|
|
248
172
|
};
|
|
249
173
|
}
|
|
250
|
-
var
|
|
174
|
+
var Qe = Ze(), $e = class {
|
|
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 {
|
|
251
226
|
#e = !0;
|
|
252
227
|
#t;
|
|
253
228
|
#n;
|
|
@@ -280,13 +255,136 @@ var tt = et(), nt = new class extends Fe {
|
|
|
280
255
|
}
|
|
281
256
|
}();
|
|
282
257
|
//#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
|
|
283
280
|
//#region node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
284
281
|
function rt(e) {
|
|
285
|
-
return (e ?? "online") === "online" ?
|
|
282
|
+
return (e ?? "online") === "online" ? tt.isOnline() : !0;
|
|
286
283
|
}
|
|
287
284
|
//#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
|
|
288
386
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
387
|
+
function q(e, t) {
|
|
290
388
|
return {
|
|
291
389
|
fetchFailureCount: 0,
|
|
292
390
|
fetchFailureReason: null,
|
|
@@ -299,9 +397,9 @@ function it(e, t) {
|
|
|
299
397
|
}
|
|
300
398
|
//#endregion
|
|
301
399
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
400
|
+
var ot = class extends $e {
|
|
303
401
|
constructor(e, t) {
|
|
304
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
402
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = nt(), this.bindMethods(), this.setOptions(t);
|
|
305
403
|
}
|
|
306
404
|
#e;
|
|
307
405
|
#t = void 0;
|
|
@@ -322,36 +420,36 @@ var at = class extends Fe {
|
|
|
322
420
|
this.refetch = this.refetch.bind(this);
|
|
323
421
|
}
|
|
324
422
|
onSubscribe() {
|
|
325
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
423
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), ct(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
326
424
|
}
|
|
327
425
|
onUnsubscribe() {
|
|
328
426
|
this.hasListeners() || this.destroy();
|
|
329
427
|
}
|
|
330
428
|
shouldFetchOnReconnect() {
|
|
331
|
-
return
|
|
429
|
+
return lt(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
430
|
}
|
|
333
431
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
432
|
+
return lt(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
335
433
|
}
|
|
336
434
|
destroy() {
|
|
337
435
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
338
436
|
}
|
|
339
437
|
setOptions(e) {
|
|
340
438
|
let t = this.options, n = this.#t;
|
|
341
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
439
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof W(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
440
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !Ge(this.options, t) && this.#e.getQueryCache().notify({
|
|
343
441
|
type: "observerOptionsUpdated",
|
|
344
442
|
query: this.#t,
|
|
345
443
|
observer: this
|
|
346
444
|
});
|
|
347
445
|
let r = this.hasListeners();
|
|
348
|
-
r &&
|
|
446
|
+
r && J(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || Ve(this.options.staleTime, this.#t) !== Ve(t.staleTime, this.#t)) && this.#g();
|
|
349
447
|
let i = this.#_();
|
|
350
|
-
r && (this.#t !== n ||
|
|
448
|
+
r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
351
449
|
}
|
|
352
450
|
getOptimisticResult(e) {
|
|
353
451
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
354
|
-
return
|
|
452
|
+
return Y(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
|
|
355
453
|
}
|
|
356
454
|
getCurrentResult() {
|
|
357
455
|
return this.#r;
|
|
@@ -381,14 +479,14 @@ var at = class extends Fe {
|
|
|
381
479
|
#h(e) {
|
|
382
480
|
this.#S();
|
|
383
481
|
let t = this.#t.fetch(this.options, e);
|
|
384
|
-
return e?.throwOnError || (t = t.catch(
|
|
482
|
+
return e?.throwOnError || (t = t.catch(ze)), t;
|
|
385
483
|
}
|
|
386
484
|
#g() {
|
|
387
485
|
this.#b();
|
|
388
|
-
let e =
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
391
|
-
this.#d =
|
|
486
|
+
let e = Ve(this.options.staleTime, this.#t);
|
|
487
|
+
if (G.isServer() || this.#r.isStale || !U(e)) return;
|
|
488
|
+
let t = Be(this.#r.dataUpdatedAt, e) + 1;
|
|
489
|
+
this.#d = Ie.setTimeout(() => {
|
|
392
490
|
this.#r.isStale || this.updateResult();
|
|
393
491
|
}, t);
|
|
394
492
|
}
|
|
@@ -396,26 +494,26 @@ var at = class extends Fe {
|
|
|
396
494
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
397
495
|
}
|
|
398
496
|
#v(e) {
|
|
399
|
-
this.#x(), this.#p = e, !(
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
497
|
+
this.#x(), this.#p = e, !(G.isServer() || W(this.options.enabled, this.#t) === !1 || !U(this.#p) || this.#p === 0) && (this.#f = Ie.setInterval(() => {
|
|
498
|
+
(this.options.refetchIntervalInBackground || et.isFocused()) && this.#h();
|
|
401
499
|
}, this.#p));
|
|
402
500
|
}
|
|
403
501
|
#y() {
|
|
404
502
|
this.#g(), this.#v(this.#_());
|
|
405
503
|
}
|
|
406
504
|
#b() {
|
|
407
|
-
this.#d !== void 0 && (
|
|
505
|
+
this.#d !== void 0 && (Ie.clearTimeout(this.#d), this.#d = void 0);
|
|
408
506
|
}
|
|
409
507
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
508
|
+
this.#f !== void 0 && (Ie.clearInterval(this.#f), this.#f = void 0);
|
|
411
509
|
}
|
|
412
510
|
createResult(e, t) {
|
|
413
511
|
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;
|
|
414
512
|
if (t._optimisticResults) {
|
|
415
|
-
let i = this.hasListeners(), a = !i &&
|
|
513
|
+
let i = this.hasListeners(), a = !i && ct(e, t), o = i && J(e, n, t, r);
|
|
416
514
|
(a || o) && (l = {
|
|
417
515
|
...l,
|
|
418
|
-
...
|
|
516
|
+
...q(c.data, e.options)
|
|
419
517
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
420
518
|
}
|
|
421
519
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -423,11 +521,11 @@ var at = class extends Fe {
|
|
|
423
521
|
let h = !1;
|
|
424
522
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
523
|
let e;
|
|
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 =
|
|
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 = Ye(i?.data, e, t), u = !0);
|
|
427
525
|
}
|
|
428
526
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
429
527
|
else try {
|
|
430
|
-
this.#c = t.select, d = t.select(d), d =
|
|
528
|
+
this.#c = t.select, d = t.select(d), d = Ye(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
529
|
} catch (e) {
|
|
432
530
|
this.#s = e;
|
|
433
531
|
}
|
|
@@ -455,16 +553,16 @@ var at = class extends Fe {
|
|
|
455
553
|
isPaused: l.fetchStatus === "paused",
|
|
456
554
|
isPlaceholderData: u,
|
|
457
555
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
556
|
+
isStale: ut(e, t),
|
|
459
557
|
refetch: this.refetch,
|
|
460
558
|
promise: this.#o,
|
|
461
|
-
isEnabled:
|
|
559
|
+
isEnabled: W(t.enabled, e) !== !1
|
|
462
560
|
};
|
|
463
561
|
if (this.options.experimental_prefetchInRender) {
|
|
464
562
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
465
563
|
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
466
564
|
}, a = () => {
|
|
467
|
-
i(this.#o = x.promise =
|
|
565
|
+
i(this.#o = x.promise = nt());
|
|
468
566
|
}, o = this.#o;
|
|
469
567
|
switch (o.status) {
|
|
470
568
|
case "pending":
|
|
@@ -482,7 +580,7 @@ var at = class extends Fe {
|
|
|
482
580
|
}
|
|
483
581
|
updateResult() {
|
|
484
582
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
485
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
583
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !Ge(t, e) && (this.#r = t, this.#C({ listeners: (() => {
|
|
486
584
|
if (!e) return !0;
|
|
487
585
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
488
586
|
if (n === "all" || !n && !this.#m.size) return !0;
|
|
@@ -503,7 +601,7 @@ var at = class extends Fe {
|
|
|
503
601
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
504
602
|
}
|
|
505
603
|
#C(e) {
|
|
506
|
-
|
|
604
|
+
Qe.batch(() => {
|
|
507
605
|
e.listeners && this.listeners.forEach((e) => {
|
|
508
606
|
e(this.#r);
|
|
509
607
|
}), this.#e.getQueryCache().notify({
|
|
@@ -513,129 +611,31 @@ var at = class extends Fe {
|
|
|
513
611
|
});
|
|
514
612
|
}
|
|
515
613
|
};
|
|
516
|
-
function
|
|
517
|
-
return
|
|
614
|
+
function st(e, t) {
|
|
615
|
+
return W(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && W(t.retryOnMount, e) === !1);
|
|
518
616
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
617
|
+
function ct(e, t) {
|
|
618
|
+
return st(e, t) || e.state.data !== void 0 && lt(e, t, t.refetchOnMount);
|
|
521
619
|
}
|
|
522
|
-
function
|
|
523
|
-
if (
|
|
620
|
+
function lt(e, t, n) {
|
|
621
|
+
if (W(t.enabled, e) !== !1 && Ve(t.staleTime, e) !== "static") {
|
|
524
622
|
let r = typeof n == "function" ? n(e) : n;
|
|
525
|
-
return r === "always" || r !== !1 &&
|
|
623
|
+
return r === "always" || r !== !1 && ut(e, t);
|
|
526
624
|
}
|
|
527
625
|
return !1;
|
|
528
626
|
}
|
|
529
|
-
function
|
|
530
|
-
return (e !== t ||
|
|
627
|
+
function J(e, t, n, r) {
|
|
628
|
+
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
|
|
531
629
|
}
|
|
532
|
-
function
|
|
533
|
-
return
|
|
630
|
+
function ut(e, t) {
|
|
631
|
+
return W(t.enabled, e) !== !1 && e.isStaleByTime(Ve(t.staleTime, e));
|
|
534
632
|
}
|
|
535
|
-
function
|
|
536
|
-
return !
|
|
633
|
+
function Y(e, t) {
|
|
634
|
+
return !Ge(e.getCurrentResult(), t);
|
|
537
635
|
}
|
|
538
636
|
//#endregion
|
|
539
|
-
//#region node_modules/@tanstack/query
|
|
540
|
-
|
|
541
|
-
return {
|
|
542
|
-
context: void 0,
|
|
543
|
-
data: void 0,
|
|
544
|
-
error: null,
|
|
545
|
-
failureCount: 0,
|
|
546
|
-
failureReason: null,
|
|
547
|
-
isPaused: !1,
|
|
548
|
-
status: "idle",
|
|
549
|
-
variables: void 0,
|
|
550
|
-
submittedAt: 0
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
//#endregion
|
|
554
|
-
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var Y = class extends Fe {
|
|
556
|
-
#e;
|
|
557
|
-
#t = void 0;
|
|
558
|
-
#n;
|
|
559
|
-
#r;
|
|
560
|
-
constructor(e, t) {
|
|
561
|
-
super(), this.#e = e, this.setOptions(t), this.bindMethods(), this.#i();
|
|
562
|
-
}
|
|
563
|
-
bindMethods() {
|
|
564
|
-
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
565
|
-
}
|
|
566
|
-
setOptions(e) {
|
|
567
|
-
let t = this.options;
|
|
568
|
-
this.options = this.#e.defaultMutationOptions(e), qe(this.options, t) || this.#e.getMutationCache().notify({
|
|
569
|
-
type: "observerOptionsUpdated",
|
|
570
|
-
mutation: this.#n,
|
|
571
|
-
observer: this
|
|
572
|
-
}), t?.mutationKey && this.options.mutationKey && Ge(t.mutationKey) !== Ge(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
573
|
-
}
|
|
574
|
-
onUnsubscribe() {
|
|
575
|
-
this.hasListeners() || this.#n?.removeObserver(this);
|
|
576
|
-
}
|
|
577
|
-
onMutationUpdate(e) {
|
|
578
|
-
this.#i(), this.#a(e);
|
|
579
|
-
}
|
|
580
|
-
getCurrentResult() {
|
|
581
|
-
return this.#t;
|
|
582
|
-
}
|
|
583
|
-
reset() {
|
|
584
|
-
this.#n?.removeObserver(this), this.#n = void 0, this.#i(), this.#a();
|
|
585
|
-
}
|
|
586
|
-
mutate(e, t) {
|
|
587
|
-
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);
|
|
588
|
-
}
|
|
589
|
-
#i() {
|
|
590
|
-
let e = this.#n?.state ?? ut();
|
|
591
|
-
this.#t = {
|
|
592
|
-
...e,
|
|
593
|
-
isPending: e.status === "pending",
|
|
594
|
-
isSuccess: e.status === "success",
|
|
595
|
-
isError: e.status === "error",
|
|
596
|
-
isIdle: e.status === "idle",
|
|
597
|
-
mutate: this.mutate,
|
|
598
|
-
reset: this.reset
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
#a(e) {
|
|
602
|
-
tt.batch(() => {
|
|
603
|
-
if (this.#r && this.hasListeners()) {
|
|
604
|
-
let t = this.#t.variables, n = this.#t.context, r = {
|
|
605
|
-
client: this.#e,
|
|
606
|
-
meta: this.options.meta,
|
|
607
|
-
mutationKey: this.options.mutationKey
|
|
608
|
-
};
|
|
609
|
-
if (e?.type === "success") {
|
|
610
|
-
try {
|
|
611
|
-
this.#r.onSuccess?.(e.data, t, n, r);
|
|
612
|
-
} catch (e) {
|
|
613
|
-
Promise.reject(e);
|
|
614
|
-
}
|
|
615
|
-
try {
|
|
616
|
-
this.#r.onSettled?.(e.data, null, t, n, r);
|
|
617
|
-
} catch (e) {
|
|
618
|
-
Promise.reject(e);
|
|
619
|
-
}
|
|
620
|
-
} else if (e?.type === "error") {
|
|
621
|
-
try {
|
|
622
|
-
this.#r.onError?.(e.error, t, n, r);
|
|
623
|
-
} catch (e) {
|
|
624
|
-
Promise.reject(e);
|
|
625
|
-
}
|
|
626
|
-
try {
|
|
627
|
-
this.#r.onSettled?.(void 0, e.error, t, n, r);
|
|
628
|
-
} catch (e) {
|
|
629
|
-
Promise.reject(e);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
this.listeners.forEach((e) => {
|
|
634
|
-
e(this.#t);
|
|
635
|
-
});
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
}, dt = e.createContext(void 0), ft = (t) => {
|
|
637
|
+
//#region node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
|
|
638
|
+
var dt = e.createContext(void 0), ft = (t) => {
|
|
639
639
|
let n = e.useContext(dt);
|
|
640
640
|
if (t) return t;
|
|
641
641
|
if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
|
|
@@ -645,11 +645,10 @@ var Y = class extends Fe {
|
|
|
645
645
|
}), [t]), /* @__PURE__ */ p(dt.Provider, {
|
|
646
646
|
value: t,
|
|
647
647
|
children: n
|
|
648
|
-
}))
|
|
649
|
-
mt.Provider;
|
|
648
|
+
}));
|
|
650
649
|
//#endregion
|
|
651
650
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
652
|
-
function
|
|
651
|
+
function mt() {
|
|
653
652
|
let e = !1;
|
|
654
653
|
return {
|
|
655
654
|
clearReset: () => {
|
|
@@ -661,14 +660,18 @@ function gt() {
|
|
|
661
660
|
isReset: () => e
|
|
662
661
|
};
|
|
663
662
|
}
|
|
664
|
-
var
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
663
|
+
var ht = e.createContext(mt()), gt = () => e.useContext(ht), _t = (e, t, n) => {
|
|
664
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? Xe(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
665
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
|
-
},
|
|
666
|
+
}, vt = (t) => {
|
|
668
667
|
e.useEffect(() => {
|
|
669
668
|
t.clearReset();
|
|
670
669
|
}, [t]);
|
|
671
|
-
},
|
|
670
|
+
}, yt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Xe(n, [e.error, r])), bt = e.createContext(!1), xt = () => e.useContext(bt);
|
|
671
|
+
bt.Provider;
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region node_modules/@tanstack/react-query/build/modern/suspense.js
|
|
674
|
+
var St = (e) => {
|
|
672
675
|
if (e.suspense) {
|
|
673
676
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
674
677
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
@@ -680,46 +683,46 @@ var _t = e.createContext(gt()), vt = () => e.useContext(_t), yt = (e, t, n) => {
|
|
|
680
683
|
//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
681
684
|
function Et(t, n, r) {
|
|
682
685
|
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");
|
|
683
|
-
let i =
|
|
686
|
+
let i = xt(), a = gt(), o = ft(r), s = o.defaultQueryOptions(t);
|
|
684
687
|
o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
|
|
685
688
|
let c = o.getQueryCache().get(s.queryHash);
|
|
686
689
|
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`));
|
|
687
690
|
let l = t.subscribed !== !1;
|
|
688
|
-
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s),
|
|
691
|
+
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s), _t(s, a, c), vt(a);
|
|
689
692
|
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
690
693
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
691
|
-
let t = p ? d.subscribe(
|
|
694
|
+
let t = p ? d.subscribe(Qe.batchCalls(e)) : ze;
|
|
692
695
|
return d.updateResult(), t;
|
|
693
696
|
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
694
697
|
d.setOptions(s);
|
|
695
698
|
}, [s, d]), wt(s, f)) throw Tt(s, d, a);
|
|
696
|
-
if (
|
|
699
|
+
if (yt({
|
|
697
700
|
result: f,
|
|
698
701
|
errorResetBoundary: a,
|
|
699
702
|
throwOnError: s.throwOnError,
|
|
700
703
|
query: c,
|
|
701
704
|
suspense: s.suspense
|
|
702
705
|
})) throw f.error;
|
|
703
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !
|
|
706
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !G.isServer() && Ct(f, i) && (u ? Tt(s, d, a) : c?.promise)?.catch(ze).finally(() => {
|
|
704
707
|
d.updateResult();
|
|
705
708
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
706
709
|
}
|
|
707
710
|
//#endregion
|
|
708
711
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
709
712
|
function Dt(e, t) {
|
|
710
|
-
return Et(e,
|
|
713
|
+
return Et(e, ot, t);
|
|
711
714
|
}
|
|
712
715
|
//#endregion
|
|
713
716
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
714
717
|
function Ot(t, n) {
|
|
715
|
-
let r = ft(n), [i] = e.useState(() => new
|
|
718
|
+
let r = ft(n), [i] = e.useState(() => new at(r, t));
|
|
716
719
|
e.useEffect(() => {
|
|
717
720
|
i.setOptions(t);
|
|
718
721
|
}, [i, t]);
|
|
719
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
720
|
-
i.mutate(e, t).catch(
|
|
722
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(Qe.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
723
|
+
i.mutate(e, t).catch(ze);
|
|
721
724
|
}, [i]);
|
|
722
|
-
if (a.error &&
|
|
725
|
+
if (a.error && Xe(i.options.throwOnError, [a.error])) throw a.error;
|
|
723
726
|
return {
|
|
724
727
|
...a,
|
|
725
728
|
mutate: o,
|
|
@@ -1816,7 +1819,7 @@ function Yn(e, t) {
|
|
|
1816
1819
|
}
|
|
1817
1820
|
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";
|
|
1818
1821
|
function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1819
|
-
return qn(r) ? p(
|
|
1822
|
+
return qn(r) ? p(se, {
|
|
1820
1823
|
"data-pinned": n?.position,
|
|
1821
1824
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1822
1825
|
className: X({
|
|
@@ -1843,17 +1846,17 @@ function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1843
1846
|
}) : null;
|
|
1844
1847
|
}
|
|
1845
1848
|
function ar({ shadowVisible: e }) {
|
|
1846
|
-
return p(
|
|
1849
|
+
return p(se, {
|
|
1847
1850
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1848
1851
|
"data-shadow-visible": e || void 0
|
|
1849
1852
|
});
|
|
1850
1853
|
}
|
|
1851
1854
|
function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1852
|
-
return p(
|
|
1855
|
+
return p(oe, {
|
|
1853
1856
|
ref: s,
|
|
1854
1857
|
className: X("mantine-datatable-footer", e),
|
|
1855
1858
|
style: t,
|
|
1856
|
-
children: m(
|
|
1859
|
+
children: m(B, { children: [a && p(ar, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1857
1860
|
if (e) return null;
|
|
1858
1861
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1859
1862
|
...r,
|
|
@@ -1892,7 +1895,7 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1892
1895
|
n,
|
|
1893
1896
|
_
|
|
1894
1897
|
]), 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);
|
|
1895
|
-
return v > 0 ? p(
|
|
1898
|
+
return v > 0 ? p(se, {
|
|
1896
1899
|
colSpan: v,
|
|
1897
1900
|
rowSpan: b > 1 ? b : void 0,
|
|
1898
1901
|
"data-pinned": s?.position,
|
|
@@ -2281,13 +2284,13 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2281
2284
|
});
|
|
2282
2285
|
} : void 0, z = (e) => {
|
|
2283
2286
|
e.stopPropagation(), A(r), I(!1);
|
|
2284
|
-
},
|
|
2287
|
+
}, ae = (e) => {
|
|
2285
2288
|
e.preventDefault(), j(r), I(!0);
|
|
2286
|
-
},
|
|
2289
|
+
}, oe = () => {
|
|
2287
2290
|
j(r), I(!1), M();
|
|
2288
|
-
}, se = () => {
|
|
2289
|
-
I(!0);
|
|
2290
2291
|
}, ce = () => {
|
|
2292
|
+
I(!0);
|
|
2293
|
+
}, B = () => {
|
|
2291
2294
|
I(!1);
|
|
2292
2295
|
}, le = (e) => {
|
|
2293
2296
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
@@ -2300,7 +2303,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2300
2303
|
pinned: e
|
|
2301
2304
|
} : t));
|
|
2302
2305
|
};
|
|
2303
|
-
return m(
|
|
2306
|
+
return m(se, {
|
|
2304
2307
|
"data-accessor": r,
|
|
2305
2308
|
"data-pinned": n?.position,
|
|
2306
2309
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2344,10 +2347,10 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2344
2347
|
}),
|
|
2345
2348
|
draggable: s,
|
|
2346
2349
|
onDragStart: s ? z : void 0,
|
|
2347
|
-
onDragEnter: s ?
|
|
2348
|
-
onDragOver: s ?
|
|
2349
|
-
onDrop: s ?
|
|
2350
|
-
onDragLeave: s ?
|
|
2350
|
+
onDragEnter: s ? ce : void 0,
|
|
2351
|
+
onDragOver: s ? ae : void 0,
|
|
2352
|
+
onDrop: s ? oe : void 0,
|
|
2353
|
+
onDragLeave: s ? B : void 0,
|
|
2351
2354
|
children: [s ? p(b, {
|
|
2352
2355
|
role: "img",
|
|
2353
2356
|
"aria-label": "Drag column",
|
|
@@ -2411,7 +2414,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2411
2414
|
}
|
|
2412
2415
|
function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2413
2416
|
let u = !o.disabled;
|
|
2414
|
-
return p(
|
|
2417
|
+
return p(se, {
|
|
2415
2418
|
ref: l,
|
|
2416
2419
|
className: X("mantine-datatable-header-selector-cell", { [Qn]: n === "cell" && u }, e),
|
|
2417
2420
|
style: t,
|
|
@@ -2454,7 +2457,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2454
2457
|
checkboxProps: v,
|
|
2455
2458
|
onChange: _,
|
|
2456
2459
|
rowSpan: c ? D : void 0
|
|
2457
|
-
}) : 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(
|
|
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(ce, {
|
|
2458
2461
|
className: X("mantine-datatable-header", t),
|
|
2459
2462
|
style: n,
|
|
2460
2463
|
ref: w,
|
|
@@ -2463,7 +2466,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2463
2466
|
} : void 0,
|
|
2464
2467
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2465
2468
|
let n = Tn(c, t);
|
|
2466
|
-
return m(
|
|
2469
|
+
return m(B, { children: [t === 0 && O, n.map((e, r) => p(sr, {
|
|
2467
2470
|
group: e,
|
|
2468
2471
|
pinnedInfo: Cr(e, l),
|
|
2469
2472
|
maxDepth: E,
|
|
@@ -2473,7 +2476,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2473
2476
|
withColumnBorders: C,
|
|
2474
2477
|
totalTableColumns: o.length
|
|
2475
2478
|
}, e.id))] }, `group-depth-${t}`);
|
|
2476
|
-
}), m(
|
|
2479
|
+
}), m(B, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2477
2480
|
if (e) return null;
|
|
2478
2481
|
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 } = {
|
|
2479
2482
|
...s,
|
|
@@ -2687,7 +2690,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2687
2690
|
});
|
|
2688
2691
|
}
|
|
2689
2692
|
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: _ }) {
|
|
2690
|
-
return qn(r) ? p(
|
|
2693
|
+
return qn(r) ? p(ae, {
|
|
2691
2694
|
"data-pinned": n?.position,
|
|
2692
2695
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2693
2696
|
className: X({
|
|
@@ -2721,7 +2724,7 @@ function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2721
2724
|
}
|
|
2722
2725
|
function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2723
2726
|
let { expanded: i, visible: a } = Yn(e, r?.transitionDuration);
|
|
2724
|
-
return a ? m(f, { children: [p(
|
|
2727
|
+
return a ? m(f, { children: [p(B, {}), p(B, { children: p(ae, {
|
|
2725
2728
|
className: "mantine-datatable-row-expansion-cell",
|
|
2726
2729
|
colSpan: t,
|
|
2727
2730
|
children: p(S, {
|
|
@@ -2741,7 +2744,7 @@ function Mr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
|
|
|
2741
2744
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2742
2745
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2743
2746
|
};
|
|
2744
|
-
return p(
|
|
2747
|
+
return p(ae, {
|
|
2745
2748
|
className: X("mantine-datatable-row-selector-cell", { [Qn]: i === "cell" && d }, e),
|
|
2746
2749
|
style: t,
|
|
2747
2750
|
"data-shadow-visible": o || void 0,
|
|
@@ -2838,7 +2841,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2838
2841
|
rowProps: P,
|
|
2839
2842
|
children: M,
|
|
2840
2843
|
expandedElement: N
|
|
2841
|
-
}) : m(f, { children: [p(
|
|
2844
|
+
}) : m(f, { children: [p(B, {
|
|
2842
2845
|
...P,
|
|
2843
2846
|
children: M
|
|
2844
2847
|
}), N] });
|
|
@@ -2905,7 +2908,7 @@ function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2905
2908
|
]
|
|
2906
2909
|
});
|
|
2907
2910
|
}
|
|
2908
|
-
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:
|
|
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: ae, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: B, 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: U, rowBorderColor: Be, stripedColor: Ve, highlightOnHoverColor: W, rowColor: He, rowBackgroundColor: Ue, rowExpansion: We, rowClassName: Ge, rowStyle: Ke, 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 }) {
|
|
2909
2912
|
let lt = l(() => y ? Cn(y) : g, [g, y]), { refs: J, onScroll: ut } = Bn({
|
|
2910
2913
|
scrollCallbacks: {
|
|
2911
2914
|
onScroll: Me,
|
|
@@ -2921,7 +2924,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2921
2924
|
headerRef: J.header,
|
|
2922
2925
|
scrollViewportRef: J.scrollViewport
|
|
2923
2926
|
}), dt = Y.effectiveColumns, ft = Ne(J.table, Xe), pt = Ne(J.scrollViewport, Je), mt = u(null), ht = Ne(mt, G), gt = Jn({
|
|
2924
|
-
rowExpansion:
|
|
2927
|
+
rowExpansion: We,
|
|
2925
2928
|
records: T,
|
|
2926
2929
|
idAccessor: w
|
|
2927
2930
|
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Vn({
|
|
@@ -2986,10 +2989,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2986
2989
|
theme: e,
|
|
2987
2990
|
c: Re,
|
|
2988
2991
|
backgroundColor: ze,
|
|
2989
|
-
borderColor:
|
|
2990
|
-
rowBorderColor:
|
|
2991
|
-
stripedColor:
|
|
2992
|
-
highlightOnHoverColor:
|
|
2992
|
+
borderColor: U,
|
|
2993
|
+
rowBorderColor: Be,
|
|
2994
|
+
stripedColor: Ve,
|
|
2995
|
+
highlightOnHoverColor: W
|
|
2993
2996
|
}),
|
|
2994
2997
|
borderRadius: e.radius[t] || t,
|
|
2995
2998
|
boxShadow: e.shadows[d] || d,
|
|
@@ -3090,10 +3093,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3090
3093
|
onContextMenu: Oe,
|
|
3091
3094
|
onCellContextMenu: je,
|
|
3092
3095
|
expansion: gt,
|
|
3093
|
-
color:
|
|
3094
|
-
backgroundColor:
|
|
3095
|
-
className:
|
|
3096
|
-
style:
|
|
3096
|
+
color: He,
|
|
3097
|
+
backgroundColor: Ue,
|
|
3098
|
+
className: Ge,
|
|
3099
|
+
style: Ke,
|
|
3097
3100
|
customAttributes: qe,
|
|
3098
3101
|
selectorCellShadowVisible: It,
|
|
3099
3102
|
selectionColumnClassName: k,
|
|
@@ -3126,11 +3129,11 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3126
3129
|
totalRecords: R,
|
|
3127
3130
|
recordsPerPage: re,
|
|
3128
3131
|
onRecordsPerPageChange: ie,
|
|
3129
|
-
recordsPerPageOptions:
|
|
3130
|
-
recordsPerPageLabel:
|
|
3131
|
-
paginationWithEdges:
|
|
3132
|
-
paginationWithControls:
|
|
3133
|
-
paginationActiveTextColor:
|
|
3132
|
+
recordsPerPageOptions: ae,
|
|
3133
|
+
recordsPerPageLabel: oe,
|
|
3134
|
+
paginationWithEdges: se,
|
|
3135
|
+
paginationWithControls: ce,
|
|
3136
|
+
paginationActiveTextColor: B,
|
|
3134
3137
|
paginationActiveBackgroundColor: le,
|
|
3135
3138
|
paginationSize: V,
|
|
3136
3139
|
paginationText: ue,
|
|
@@ -3596,7 +3599,7 @@ var ti = [
|
|
|
3596
3599
|
100,
|
|
3597
3600
|
500
|
|
3598
3601
|
];
|
|
3599
|
-
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:
|
|
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: ae, mobileCards: oe = !1, deleteConfirmMessage: se, editRecordId: ce, onEditRecordIdChange: B }) {
|
|
3600
3603
|
let [ue, de] = d(P || (M && M.length > 0 ? M[0].value : null)), pe = ee === void 0 ? ue : ee, me = (e) => {
|
|
3601
3604
|
ee === void 0 && de(e), F && F(e);
|
|
3602
3605
|
}, H = M?.find((e) => e.value === pe), he = H?.queryParams || {}, ge = H?.apiPath ?? a, _e = H?.mutationApiPath ?? o ?? ge, ve = {
|
|
@@ -3619,8 +3622,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3619
3622
|
direction: D?.direction ?? "desc"
|
|
3620
3623
|
}), ze = (e) => {
|
|
3621
3624
|
Re(e), O && O(String(e.columnAccessor), e.direction);
|
|
3622
|
-
},
|
|
3623
|
-
|
|
3625
|
+
}, U = Ur(Me, Le.columnAccessor, Le.direction), [Be, Ve] = zr(ti[1], "mantine-table-page-size"), [W, He] = d(1), Ue = b ? U.slice((W - 1) * Be, W * Be) : U, [We, Ge] = d([]), Ke = z?.expanded?.recordIds ?? We, qe = z?.expanded?.onRecordIdsChange ?? Ge, Je = (e) => {
|
|
3626
|
+
Ke.includes(e) ? qe(Ke.filter((t) => t !== e)) : qe(z?.allowMultiple ? [...Ke, e] : [e]);
|
|
3624
3627
|
}, Ye = l.findIndex((e) => e.list && e.column && !e.column.hidden), Xe = z && Ye >= 0 ? l.map((e, t) => {
|
|
3625
3628
|
if (t !== Ye) return e;
|
|
3626
3629
|
let n = e.column.render;
|
|
@@ -3647,7 +3650,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3647
3650
|
size: 16,
|
|
3648
3651
|
style: {
|
|
3649
3652
|
color: "var(--mantine-primary-color-filled)",
|
|
3650
|
-
transform:
|
|
3653
|
+
transform: Ke.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3651
3654
|
transition: "transform 200ms ease"
|
|
3652
3655
|
}
|
|
3653
3656
|
})
|
|
@@ -3664,14 +3667,14 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3664
3667
|
}, [pe]);
|
|
3665
3668
|
let [Ze, Qe] = d(!1), [$e, et] = d(!1), [tt, nt] = d(!1), rt = u(null);
|
|
3666
3669
|
s(() => {
|
|
3667
|
-
if (!
|
|
3670
|
+
if (!ce) {
|
|
3668
3671
|
rt.current = null;
|
|
3669
3672
|
return;
|
|
3670
3673
|
}
|
|
3671
|
-
if (rt.current ===
|
|
3672
|
-
let e =
|
|
3673
|
-
e && (rt.current =
|
|
3674
|
-
}, [
|
|
3674
|
+
if (rt.current === ce) return;
|
|
3675
|
+
let e = U.find((e) => e.id === ce);
|
|
3676
|
+
e && (rt.current = ce, K([e]), et(!0), B?.(null));
|
|
3677
|
+
}, [ce, U]);
|
|
3675
3678
|
let it = l.some((e) => e.update), at = l.some((e) => e.delete), q = [];
|
|
3676
3679
|
return it && q.push({
|
|
3677
3680
|
icon: /* @__PURE__ */ p(we, { size: 14 }),
|
|
@@ -3765,7 +3768,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3765
3768
|
(l.some((e) => e.update) || h) && (() => {
|
|
3766
3769
|
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;
|
|
3767
3770
|
return /* @__PURE__ */ p(v, {
|
|
3768
|
-
...
|
|
3771
|
+
...oe ? { visibleFrom: "sm" } : {},
|
|
3769
3772
|
children: /* @__PURE__ */ m(k, {
|
|
3770
3773
|
shadow: "md",
|
|
3771
3774
|
children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
|
|
@@ -3834,50 +3837,50 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3834
3837
|
].fill(0).map((e, t) => /* @__PURE__ */ p(R, { height: 35 }, `skeleton-${t}`))]
|
|
3835
3838
|
}),
|
|
3836
3839
|
!De && !Ae && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3837
|
-
...
|
|
3840
|
+
...oe ? { visibleFrom: "sm" } : {},
|
|
3838
3841
|
children: /* @__PURE__ */ p(Ir, {
|
|
3839
3842
|
my: "md",
|
|
3840
3843
|
striped: !0,
|
|
3841
3844
|
highlightOnHover: !0,
|
|
3842
3845
|
minHeight: 150,
|
|
3843
3846
|
fetching: ke,
|
|
3844
|
-
records:
|
|
3847
|
+
records: Ue,
|
|
3845
3848
|
sortStatus: Le,
|
|
3846
3849
|
onSortStatusChange: ze,
|
|
3847
3850
|
...h && {
|
|
3848
3851
|
selectedRecords: G,
|
|
3849
3852
|
onSelectedRecordsChange: K
|
|
3850
3853
|
},
|
|
3851
|
-
...b &&
|
|
3852
|
-
totalRecords:
|
|
3853
|
-
recordsPerPage:
|
|
3854
|
-
onPageChange:
|
|
3855
|
-
page:
|
|
3854
|
+
...b && Ue.length && {
|
|
3855
|
+
totalRecords: U.length,
|
|
3856
|
+
recordsPerPage: Be,
|
|
3857
|
+
onPageChange: He,
|
|
3858
|
+
page: W,
|
|
3856
3859
|
recordsPerPageOptions: ti,
|
|
3857
|
-
onRecordsPerPageChange:
|
|
3860
|
+
onRecordsPerPageChange: Ve,
|
|
3858
3861
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3859
3862
|
},
|
|
3860
3863
|
...z && { rowExpansion: {
|
|
3861
3864
|
allowMultiple: z.allowMultiple ?? !1,
|
|
3862
|
-
trigger:
|
|
3865
|
+
trigger: ae ? "never" : "click",
|
|
3863
3866
|
content: ({ record: e }) => z.content(e, !1),
|
|
3864
3867
|
expanded: {
|
|
3865
|
-
recordIds:
|
|
3868
|
+
recordIds: Ke,
|
|
3866
3869
|
onRecordIdsChange: qe
|
|
3867
3870
|
},
|
|
3868
3871
|
...z.expandable && { expandable: ({ record: e }) => z.expandable(e) }
|
|
3869
3872
|
} },
|
|
3870
3873
|
columns: Xe.map((e) => e.column),
|
|
3871
3874
|
noRecordsText: "Keine Einträge gefunden",
|
|
3872
|
-
onRowClick:
|
|
3873
|
-
...
|
|
3875
|
+
onRowClick: ae,
|
|
3876
|
+
...ae && { style: { cursor: "pointer" } }
|
|
3874
3877
|
})
|
|
3875
|
-
}),
|
|
3878
|
+
}), oe && /* @__PURE__ */ p(v, {
|
|
3876
3879
|
hiddenFrom: "sm",
|
|
3877
3880
|
children: /* @__PURE__ */ p(ei, {
|
|
3878
|
-
records:
|
|
3881
|
+
records: Ue,
|
|
3879
3882
|
fields: Xe,
|
|
3880
|
-
onRowClick:
|
|
3883
|
+
onRowClick: ae,
|
|
3881
3884
|
sort: {
|
|
3882
3885
|
field: String(Le.columnAccessor),
|
|
3883
3886
|
direction: Le.direction,
|
|
@@ -3888,20 +3891,20 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3888
3891
|
});
|
|
3889
3892
|
}
|
|
3890
3893
|
},
|
|
3891
|
-
...b &&
|
|
3892
|
-
totalRecords:
|
|
3893
|
-
recordsPerPage:
|
|
3894
|
-
page:
|
|
3895
|
-
onPageChange:
|
|
3894
|
+
...b && Ue.length && { pagination: {
|
|
3895
|
+
totalRecords: U.length,
|
|
3896
|
+
recordsPerPage: Be,
|
|
3897
|
+
page: W,
|
|
3898
|
+
onPageChange: He,
|
|
3896
3899
|
recordsPerPageOptions: ti,
|
|
3897
3900
|
onRecordsPerPageChange: (e) => {
|
|
3898
|
-
|
|
3901
|
+
Ve(e), He(1);
|
|
3899
3902
|
}
|
|
3900
3903
|
} },
|
|
3901
3904
|
...z && { rowExpansion: {
|
|
3902
3905
|
content: z.content,
|
|
3903
3906
|
expanded: {
|
|
3904
|
-
recordIds:
|
|
3907
|
+
recordIds: Ke,
|
|
3905
3908
|
onRecordIdsChange: qe
|
|
3906
3909
|
},
|
|
3907
3910
|
...z.expandable && { expandable: z.expandable }
|
|
@@ -3945,7 +3948,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3945
3948
|
connectedQueryKeys: r,
|
|
3946
3949
|
apiPath: _e,
|
|
3947
3950
|
selectedRecords: G,
|
|
3948
|
-
confirmMessage:
|
|
3951
|
+
confirmMessage: se
|
|
3949
3952
|
})
|
|
3950
3953
|
}),
|
|
3951
3954
|
/* @__PURE__ */ p(N, {
|