@espresso-lab/mantine-data-table 2.2.9 → 2.2.11
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/DataTable/DataTable.d.ts +2 -1
- package/dist/index.es.js +594 -595
- 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
|
|
5
|
-
import { DateInput as
|
|
6
|
-
import { useForm as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
9
|
-
//#region node_modules/@tanstack/query-core/build/modern/
|
|
10
|
-
var
|
|
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 re, Stack as ie, Stepper as ae, Table as oe, TableTd as R, TableTfoot as se, TableTh as ce, TableThead as le, TableTr as z, Tabs as ue, Text as B, TextInput as de, Textarea as fe, Title as pe, createSafeContext as me, parseThemeColor as he, rem as ge, useDirection as _e, useMantineTheme as ve } from "@mantine/core";
|
|
5
|
+
import { DateInput as ye } from "@mantine/dates";
|
|
6
|
+
import { useForm as be } from "@mantine/form";
|
|
7
|
+
import { IconCaretDownFilled as xe, IconChevronRight as Se, IconDotsVertical as Ce, IconFilter as we, IconInfoCircle as Te, IconPencil as Ee, IconRefresh as De, IconSortAscending as Oe, IconSortDescending as ke, IconTrash as Ae } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as je, useDisclosure as Me, useLocalStorage as Ne, useMediaQuery as Pe, useMergedRef as Fe, useTimeout as Ie } from "@mantine/hooks";
|
|
9
|
+
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
+
var Le = 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
|
+
}, Re = new class extends Le {
|
|
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
|
+
}(), ze = {
|
|
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
|
+
}, V = new class {
|
|
67
|
+
#e = ze;
|
|
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 Be(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 Ve = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function H() {}
|
|
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 U(e, t) {
|
|
51
102
|
return typeof e == "function" ? e(t) : e;
|
|
52
103
|
}
|
|
53
104
|
function W(e, t) {
|
|
54
105
|
return typeof e == "function" ? e(t) : e;
|
|
55
106
|
}
|
|
56
|
-
function
|
|
57
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function We(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Je(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
58
109
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
110
|
+
var Ge = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Ke(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 = qe(e) && qe(t);
|
|
115
|
+
if (!r && !(Je(e) && Je(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 : Ge.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 = Ke(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 G(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 qe(e) {
|
|
87
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
88
139
|
}
|
|
89
|
-
function
|
|
90
|
-
if (!
|
|
140
|
+
function Je(e) {
|
|
141
|
+
if (!Ye(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 !(!Ye(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
95
146
|
}
|
|
96
|
-
function
|
|
147
|
+
function Ye(e) {
|
|
97
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
98
149
|
}
|
|
99
|
-
function
|
|
150
|
+
function Xe(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 Ke(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 Ke(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 q = /* @__PURE__ */ (() => {
|
|
168
|
+
let e = () => Ve;
|
|
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
|
-
})()
|
|
177
|
+
})();
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
127
180
|
function Ze() {
|
|
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 Qe = Be;
|
|
203
|
+
function $e() {
|
|
128
204
|
let e = [], t = 0, n = (e) => {
|
|
129
205
|
e();
|
|
130
206
|
}, r = (e) => {
|
|
131
207
|
e();
|
|
132
|
-
}, i =
|
|
208
|
+
}, i = Qe, 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 J = $e(), et = new class extends Le {
|
|
226
251
|
#e = !0;
|
|
227
252
|
#t;
|
|
228
253
|
#n;
|
|
@@ -255,140 +280,17 @@ 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
|
-
function
|
|
282
|
-
return (e ?? "online")
|
|
284
|
+
function tt(e) {
|
|
285
|
+
return (e ?? "online") !== "online" || et.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 nt(e, t) {
|
|
388
290
|
return {
|
|
389
291
|
fetchFailureCount: 0,
|
|
390
292
|
fetchFailureReason: null,
|
|
391
|
-
fetchStatus:
|
|
293
|
+
fetchStatus: tt(t.networkMode) ? "fetching" : "paused",
|
|
392
294
|
...e === void 0 && {
|
|
393
295
|
error: null,
|
|
394
296
|
status: "pending"
|
|
@@ -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 rt = class extends Le {
|
|
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 = Ze(), this.bindMethods(), this.setOptions(t);
|
|
403
305
|
}
|
|
404
306
|
#e;
|
|
405
307
|
#t = void 0;
|
|
@@ -420,16 +322,16 @@ 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), at(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 ot(this.#t, this.options, this.options.refetchOnReconnect);
|
|
430
332
|
}
|
|
431
333
|
shouldFetchOnWindowFocus() {
|
|
432
|
-
return
|
|
334
|
+
return ot(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);
|
|
@@ -437,13 +339,13 @@ var ot = class extends $e {
|
|
|
437
339
|
setOptions(e) {
|
|
438
340
|
let t = this.options, n = this.#t;
|
|
439
341
|
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 && !
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !G(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 && st(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) || U(this.options.staleTime, this.#t) !== U(t.staleTime, this.#t)) && this.#g();
|
|
447
349
|
let i = this.#_();
|
|
448
350
|
r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
449
351
|
}
|
|
@@ -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(H)), t;
|
|
483
385
|
}
|
|
484
386
|
#g() {
|
|
485
387
|
this.#b();
|
|
486
|
-
let e =
|
|
487
|
-
if (
|
|
488
|
-
let t =
|
|
489
|
-
this.#d =
|
|
388
|
+
let e = U(this.options.staleTime, this.#t);
|
|
389
|
+
if (q.isServer() || this.#r.isStale || !He(e)) return;
|
|
390
|
+
let t = Ue(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = V.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, !(q.isServer() || W(this.options.enabled, this.#t) === !1 || !He(this.#p) || this.#p === 0) && (this.#f = V.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Re.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 && (V.clearTimeout(this.#d), this.#d = void 0);
|
|
506
408
|
}
|
|
507
409
|
#x() {
|
|
508
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (V.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 && at(e, t), o = i && st(e, n, t, r);
|
|
514
416
|
(a || o) && (l = {
|
|
515
417
|
...l,
|
|
516
|
-
...
|
|
418
|
+
...nt(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 = Xe(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 = Xe(i?.data, d, t), this.#l = d, this.#s = null;
|
|
529
431
|
} catch (e) {
|
|
530
432
|
this.#s = e;
|
|
531
433
|
}
|
|
@@ -553,7 +455,7 @@ var ot = class extends $e {
|
|
|
553
455
|
isPaused: l.fetchStatus === "paused",
|
|
554
456
|
isPlaceholderData: u,
|
|
555
457
|
isRefetchError: v && b,
|
|
556
|
-
isStale:
|
|
458
|
+
isStale: ct(e, t),
|
|
557
459
|
refetch: this.refetch,
|
|
558
460
|
promise: this.#o,
|
|
559
461
|
isEnabled: W(t.enabled, e) !== !1
|
|
@@ -562,7 +464,8 @@ var ot = class extends $e {
|
|
|
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 = Ze();
|
|
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), !G(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
|
+
J.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
|
|
517
|
+
function it(e, t) {
|
|
615
518
|
return W(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && W(t.retryOnMount, e) === !1);
|
|
616
519
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
520
|
+
function at(e, t) {
|
|
521
|
+
return it(e, t) || e.state.data !== void 0 && ot(e, t, t.refetchOnMount);
|
|
619
522
|
}
|
|
620
|
-
function
|
|
621
|
-
if (W(t.enabled, e) !== !1 &&
|
|
523
|
+
function ot(e, t, n) {
|
|
524
|
+
if (W(t.enabled, e) !== !1 && U(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 && ct(e, t);
|
|
624
527
|
}
|
|
625
528
|
return !1;
|
|
626
529
|
}
|
|
627
|
-
function
|
|
628
|
-
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") &&
|
|
530
|
+
function st(e, t, n, r) {
|
|
531
|
+
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ct(e, n);
|
|
629
532
|
}
|
|
630
|
-
function
|
|
631
|
-
return W(t.enabled, e) !== !1 && e.isStaleByTime(
|
|
533
|
+
function ct(e, t) {
|
|
534
|
+
return W(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
|
|
632
535
|
}
|
|
633
536
|
function Y(e, t) {
|
|
634
|
-
return !
|
|
537
|
+
return !G(e.getCurrentResult(), t);
|
|
538
|
+
}
|
|
539
|
+
//#endregion
|
|
540
|
+
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
541
|
+
function lt() {
|
|
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
|
+
};
|
|
635
553
|
}
|
|
636
554
|
//#endregion
|
|
637
|
-
//#region node_modules/@tanstack/
|
|
638
|
-
var
|
|
555
|
+
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
556
|
+
var ut = class extends Le {
|
|
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), G(this.options, t) || this.#e.getMutationCache().notify({
|
|
570
|
+
type: "observerOptionsUpdated",
|
|
571
|
+
mutation: this.#n,
|
|
572
|
+
observer: this
|
|
573
|
+
}), t?.mutationKey && this.options.mutationKey && We(t.mutationKey) !== We(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 ?? lt();
|
|
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
|
+
J.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(J.batchCalls(e)) : H;
|
|
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 && !q.isServer() && Ct(f, i) && (u ? Tt(s, d, a) : c?.promise)?.catch(H).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, rt, 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 ut(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(J.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
721
|
+
i.mutate(e, t).catch(H);
|
|
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,
|
|
@@ -901,7 +899,7 @@ function nn(e, t) {
|
|
|
901
899
|
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
902
900
|
}
|
|
903
901
|
function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
904
|
-
let [u, h] = d(0), [g, v] = d(!1), b =
|
|
902
|
+
let [u, h] = d(0), [g, v] = d(!1), b = be({
|
|
905
903
|
mode: "uncontrolled",
|
|
906
904
|
initialValues: Xt(e),
|
|
907
905
|
validate: Zt(e)
|
|
@@ -926,7 +924,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
926
924
|
required: n,
|
|
927
925
|
...r
|
|
928
926
|
}, b.key(e.id));
|
|
929
|
-
case "date": return /* @__PURE__ */ p(
|
|
927
|
+
case "date": return /* @__PURE__ */ p(ye, {
|
|
930
928
|
valueFormat: "DD.MM.YYYY",
|
|
931
929
|
clearable: !0,
|
|
932
930
|
label: e.column.title,
|
|
@@ -940,7 +938,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
940
938
|
required: n,
|
|
941
939
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
942
940
|
}, b.key(e.id));
|
|
943
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
941
|
+
case "textarea": return /* @__PURE__ */ p(fe, {
|
|
944
942
|
minRows: 3,
|
|
945
943
|
autosize: !0,
|
|
946
944
|
label: e.column.title,
|
|
@@ -955,7 +953,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
955
953
|
error: r.error,
|
|
956
954
|
required: n
|
|
957
955
|
});
|
|
958
|
-
default: return /* @__PURE__ */ p(
|
|
956
|
+
default: return /* @__PURE__ */ p(de, {
|
|
959
957
|
type: e.id.includes("email") ? "email" : void 0,
|
|
960
958
|
label: e.column.title,
|
|
961
959
|
placeholder: e.placeholder ?? "",
|
|
@@ -983,10 +981,10 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
983
981
|
}
|
|
984
982
|
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
985
983
|
}),
|
|
986
|
-
children: [E ? /* @__PURE__ */ p(
|
|
984
|
+
children: [E ? /* @__PURE__ */ p(ae, {
|
|
987
985
|
active: u,
|
|
988
986
|
size: "sm",
|
|
989
|
-
children: w.map((e) => /* @__PURE__ */ p(
|
|
987
|
+
children: w.map((e) => /* @__PURE__ */ p(ae.Step, {
|
|
990
988
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
991
989
|
children: k(e)
|
|
992
990
|
}, e))
|
|
@@ -1046,7 +1044,7 @@ function X() {
|
|
|
1046
1044
|
//#endregion
|
|
1047
1045
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1048
1046
|
function Z(e, t, n) {
|
|
1049
|
-
return e ?
|
|
1047
|
+
return e ? he({
|
|
1050
1048
|
color: typeof e == "object" ? e[n] : e,
|
|
1051
1049
|
theme: t
|
|
1052
1050
|
}).value : void 0;
|
|
@@ -1083,7 +1081,7 @@ function ln({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1083
1081
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1084
1082
|
};
|
|
1085
1083
|
}
|
|
1086
|
-
var [un, dn] =
|
|
1084
|
+
var [un, dn] = me("useDataTableColumnsContext must be used within DataTableColumnProvider"), fn = (e) => {
|
|
1087
1085
|
let { children: t, columnsOrder: n, setColumnsOrder: r, columnsToggle: i, setColumnsToggle: a, columnsPinning: o, setColumnsPinning: s, resetColumnsOrder: c, resetColumnsToggle: l, resetColumnsPinning: u, setColumnWidth: f, setMultipleColumnWidths: m, resetColumnsWidth: h, beginResize: g, endResize: _, pinnedMap: v } = e, [y, b] = d(""), [x, S] = d("");
|
|
1088
1086
|
return p(un, {
|
|
1089
1087
|
value: {
|
|
@@ -1153,7 +1151,7 @@ function hn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1153
1151
|
children: r || m(f, { children: [e || p("div", {
|
|
1154
1152
|
className: "mantine-datatable-empty-state-icon",
|
|
1155
1153
|
children: p(mn, {})
|
|
1156
|
-
}), p(
|
|
1154
|
+
}), p(B, {
|
|
1157
1155
|
component: "div",
|
|
1158
1156
|
size: "sm",
|
|
1159
1157
|
c: "dimmed",
|
|
@@ -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];
|
|
@@ -1209,7 +1207,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1209
1207
|
defaultPinned: e.pinned,
|
|
1210
1208
|
pinnable: !!e.pinnable,
|
|
1211
1209
|
pinned: e.pinned
|
|
1212
|
-
})), [t]), [i, a] =
|
|
1210
|
+
})), [t]), [i, a] = Ne({
|
|
1213
1211
|
key: e ? `${e}-columns-pinning` : "",
|
|
1214
1212
|
defaultValue: e ? r : void 0,
|
|
1215
1213
|
getInitialValueInEffect: n
|
|
@@ -1257,7 +1255,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1257
1255
|
};
|
|
1258
1256
|
}
|
|
1259
1257
|
function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1260
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1258
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = Ne({
|
|
1261
1259
|
key: e ? `${e}-columns-order` : "",
|
|
1262
1260
|
defaultValue: e ? r : void 0,
|
|
1263
1261
|
getInitialValueInEffect: n
|
|
@@ -1300,7 +1298,7 @@ function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1300
1298
|
};
|
|
1301
1299
|
}
|
|
1302
1300
|
function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1303
|
-
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] =
|
|
1301
|
+
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = Ne({
|
|
1304
1302
|
key: e ? `${e}-columns-width` : "",
|
|
1305
1303
|
defaultValue: e ? o() : void 0,
|
|
1306
1304
|
getInitialValueInEffect: n
|
|
@@ -1393,8 +1391,8 @@ 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
|
|
1397
|
-
})), [t]), [i, a] =
|
|
1394
|
+
toggled: e.defaultToggle === void 0 || e.defaultToggle
|
|
1395
|
+
})), [t]), [i, a] = Ne({
|
|
1398
1396
|
key: e ? `${e}-columns-toggle` : "",
|
|
1399
1397
|
defaultValue: e ? r : void 0,
|
|
1400
1398
|
getInitialValueInEffect: n
|
|
@@ -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,
|
|
@@ -1601,7 +1599,7 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1601
1599
|
$(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1602
1600
|
}
|
|
1603
1601
|
function c() {
|
|
1604
|
-
f.current.withRowBorders && t.height < n.height ? $(r.current, Ln, `${
|
|
1602
|
+
f.current.withRowBorders && t.height < n.height ? $(r.current, Ln, `${ge("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, Ln, "unset");
|
|
1605
1603
|
}
|
|
1606
1604
|
h.current = c;
|
|
1607
1605
|
function l() {
|
|
@@ -1762,12 +1760,12 @@ function Gn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0
|
|
|
1762
1760
|
}, [e]), r;
|
|
1763
1761
|
}
|
|
1764
1762
|
function Kn(e) {
|
|
1765
|
-
let t =
|
|
1763
|
+
let t = ve();
|
|
1766
1764
|
return Gn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1767
1765
|
}
|
|
1768
1766
|
function qn(e) {
|
|
1769
|
-
let t =
|
|
1770
|
-
return
|
|
1767
|
+
let t = ve();
|
|
1768
|
+
return Pe((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1771
1769
|
}
|
|
1772
1770
|
function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1773
1771
|
let r = [];
|
|
@@ -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]);
|
|
@@ -1805,7 +1803,7 @@ function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1805
1803
|
}
|
|
1806
1804
|
}
|
|
1807
1805
|
function Yn(e, t) {
|
|
1808
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1806
|
+
let [n, r] = d(e), [i, a] = d(e), o = Ie(() => r(!0), 0), c = Ie(() => a(!1), t || 200);
|
|
1809
1807
|
return s(() => {
|
|
1810
1808
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1811
1809
|
}, [
|
|
@@ -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(ce, {
|
|
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(ce, {
|
|
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(se, {
|
|
1856
1854
|
ref: s,
|
|
1857
1855
|
className: X("mantine-datatable-footer", e),
|
|
1858
1856
|
style: t,
|
|
1859
|
-
children: m(
|
|
1857
|
+
children: m(z, { 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(ce, {
|
|
1899
1897
|
colSpan: v,
|
|
1900
1898
|
rowSpan: b > 1 ? b : void 0,
|
|
1901
1899
|
"data-pinned": s?.position,
|
|
@@ -1953,7 +1951,7 @@ function lr() {
|
|
|
1953
1951
|
});
|
|
1954
1952
|
}
|
|
1955
1953
|
function ur({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1956
|
-
let [i, { close: a, toggle: o }] =
|
|
1954
|
+
let [i, { close: a, toggle: o }] = Me(!1), s = t ? lr : cr, c = je(a);
|
|
1957
1955
|
return r && (c = void 0), m(F, {
|
|
1958
1956
|
withArrow: !0,
|
|
1959
1957
|
shadow: "md",
|
|
@@ -2138,7 +2136,7 @@ var gr = 50, _r = (e) => {
|
|
|
2138
2136
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2139
2137
|
current: 0,
|
|
2140
2138
|
next: 0
|
|
2141
|
-
}), { dir: c } =
|
|
2139
|
+
}), { dir: c } = _e(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = dn(), g = a((e) => {
|
|
2142
2140
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2143
2141
|
let r = n.current, a = r.nextElementSibling;
|
|
2144
2142
|
for (; a;) {
|
|
@@ -2276,34 +2274,34 @@ function br() {
|
|
|
2276
2274
|
function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
|
|
2277
2275
|
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = dn(), [te, I] = d(!1), L = u(null), ne = ee?.find((e) => e.accessor === r)?.pinned;
|
|
2278
2276
|
if (!qn(i)) return null;
|
|
2279
|
-
let
|
|
2277
|
+
let re = a ?? gn(r), ie = typeof re == "string" ? re : void 0, ae = o && S ? (e) => {
|
|
2280
2278
|
e?.defaultPrevented || S({
|
|
2281
2279
|
sortKey: k,
|
|
2282
2280
|
columnAccessor: r,
|
|
2283
2281
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2284
2282
|
});
|
|
2285
|
-
} : void 0,
|
|
2283
|
+
} : void 0, oe = (e) => {
|
|
2286
2284
|
e.stopPropagation(), A(r), I(!1);
|
|
2287
|
-
},
|
|
2285
|
+
}, R = (e) => {
|
|
2288
2286
|
e.preventDefault(), j(r), I(!0);
|
|
2289
|
-
},
|
|
2287
|
+
}, se = () => {
|
|
2290
2288
|
j(r), I(!1), M();
|
|
2291
|
-
},
|
|
2289
|
+
}, le = () => {
|
|
2292
2290
|
I(!0);
|
|
2293
|
-
},
|
|
2291
|
+
}, z = () => {
|
|
2294
2292
|
I(!1);
|
|
2295
|
-
},
|
|
2293
|
+
}, ue = (e) => {
|
|
2296
2294
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2297
2295
|
...e,
|
|
2298
2296
|
toggled: !1
|
|
2299
2297
|
} : e));
|
|
2300
|
-
},
|
|
2298
|
+
}, B = (e) => {
|
|
2301
2299
|
F((t) => t.map((t) => t.accessor === r ? {
|
|
2302
2300
|
...t,
|
|
2303
2301
|
pinned: e
|
|
2304
2302
|
} : t));
|
|
2305
2303
|
};
|
|
2306
|
-
return m(
|
|
2304
|
+
return m(ce, {
|
|
2307
2305
|
"data-accessor": r,
|
|
2308
2306
|
"data-pinned": n?.position,
|
|
2309
2307
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2330,8 +2328,8 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2330
2328
|
],
|
|
2331
2329
|
role: o ? "button" : void 0,
|
|
2332
2330
|
tabIndex: o ? 0 : void 0,
|
|
2333
|
-
onClick:
|
|
2334
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2331
|
+
onClick: ae,
|
|
2332
|
+
onKeyDown: (e) => e.key === "Enter" && ae?.(),
|
|
2335
2333
|
ref: L,
|
|
2336
2334
|
children: [m(T, {
|
|
2337
2335
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
@@ -2346,11 +2344,11 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2346
2344
|
"mantine-datatable-header-cell-drag-over": te
|
|
2347
2345
|
}),
|
|
2348
2346
|
draggable: s,
|
|
2349
|
-
onDragStart: s ?
|
|
2350
|
-
onDragEnter: s ?
|
|
2351
|
-
onDragOver: s ?
|
|
2352
|
-
onDrop: s ?
|
|
2353
|
-
onDragLeave: s ?
|
|
2347
|
+
onDragStart: s ? oe : void 0,
|
|
2348
|
+
onDragEnter: s ? le : void 0,
|
|
2349
|
+
onDragOver: s ? R : void 0,
|
|
2350
|
+
onDrop: s ? se : void 0,
|
|
2351
|
+
onDragLeave: s ? z : void 0,
|
|
2354
2352
|
children: [s ? p(b, {
|
|
2355
2353
|
role: "img",
|
|
2356
2354
|
"aria-label": "Drag column",
|
|
@@ -2369,13 +2367,13 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2369
2367
|
[nr]: _ === "center",
|
|
2370
2368
|
[rr]: _ === "right"
|
|
2371
2369
|
}, Xn, Zn),
|
|
2372
|
-
title:
|
|
2373
|
-
children:
|
|
2370
|
+
title: ie,
|
|
2371
|
+
children: re
|
|
2374
2372
|
})]
|
|
2375
2373
|
}),
|
|
2376
2374
|
l ? p(hr, {
|
|
2377
2375
|
currentPinned: ne,
|
|
2378
|
-
onPinChange:
|
|
2376
|
+
onPinChange: B
|
|
2379
2377
|
}) : null,
|
|
2380
2378
|
c ? p(b, {
|
|
2381
2379
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2384,7 +2382,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2384
2382
|
children: p(g, {
|
|
2385
2383
|
size: "xs",
|
|
2386
2384
|
variant: "light",
|
|
2387
|
-
onClick:
|
|
2385
|
+
onClick: ue,
|
|
2388
2386
|
children: p(mr, {})
|
|
2389
2387
|
})
|
|
2390
2388
|
}) : null,
|
|
@@ -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(ce, {
|
|
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(le, {
|
|
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(z, { 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(z, { 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,
|
|
@@ -2513,7 +2511,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2513
2511
|
shadow: "md",
|
|
2514
2512
|
opened: j,
|
|
2515
2513
|
onChange: M,
|
|
2516
|
-
children: [p(I, { children: ee }), p(te, { children: p(
|
|
2514
|
+
children: [p(I, { children: ee }), p(te, { children: p(ie, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2517
2515
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2518
2516
|
size: "xs",
|
|
2519
2517
|
label: P[e.accessor],
|
|
@@ -2560,16 +2558,16 @@ function Er() {
|
|
|
2560
2558
|
});
|
|
2561
2559
|
}
|
|
2562
2560
|
var Dr = {
|
|
2563
|
-
xs:
|
|
2564
|
-
sm:
|
|
2565
|
-
md:
|
|
2566
|
-
lg:
|
|
2567
|
-
xl:
|
|
2561
|
+
xs: ge(22),
|
|
2562
|
+
sm: ge(26),
|
|
2563
|
+
md: ge(32),
|
|
2564
|
+
lg: ge(38),
|
|
2565
|
+
xl: ge(44)
|
|
2568
2566
|
};
|
|
2569
2567
|
function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2570
2568
|
return m(T, {
|
|
2571
2569
|
gap: "xs",
|
|
2572
|
-
children: [p(
|
|
2570
|
+
children: [p(B, {
|
|
2573
2571
|
component: "div",
|
|
2574
2572
|
size: e,
|
|
2575
2573
|
children: t
|
|
@@ -2600,7 +2598,7 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2600
2598
|
}) : void 0],
|
|
2601
2599
|
disabled: n,
|
|
2602
2600
|
onClick: () => o(t),
|
|
2603
|
-
children: p(
|
|
2601
|
+
children: p(B, {
|
|
2604
2602
|
component: "div",
|
|
2605
2603
|
size: e,
|
|
2606
2604
|
children: t
|
|
@@ -2620,8 +2618,8 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2620
2618
|
totalRecords: g
|
|
2621
2619
|
});
|
|
2622
2620
|
} else O = n ? u : d;
|
|
2623
|
-
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !qn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${
|
|
2624
|
-
Text: (e) => p(
|
|
2621
|
+
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !qn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${ge(w)}rem` : e[w] || w})`), N = {
|
|
2622
|
+
Text: (e) => p(B, {
|
|
2625
2623
|
component: "div",
|
|
2626
2624
|
className: "mantine-datatable-pagination-text",
|
|
2627
2625
|
size: l,
|
|
@@ -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(R, {
|
|
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(z, {}), p(z, { children: p(R, {
|
|
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(R, {
|
|
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(z, {
|
|
2845
2843
|
...P,
|
|
2846
2844
|
children: M
|
|
2847
2845
|
}), N] });
|
|
@@ -2908,30 +2906,30 @@ 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:
|
|
2912
|
-
let
|
|
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: re, recordsPerPage: ie, onRecordsPerPageChange: ae, recordsPerPageOptions: R, recordsPerPageLabel: se = "Records per page", paginationWithEdges: ce, paginationWithControls: le, paginationActiveTextColor: z, paginationActiveBackgroundColor: ue, paginationSize: B = "sm", paginationText: de = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: fe = "sm", getPaginationControlProps: pe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: me, renderPagination: he, loaderBackgroundBlur: ge, customLoader: _e, loaderSize: ve, loaderType: ye, loaderColor: be, loadingText: xe = "...", emptyState: Se, noRecordsText: Ce = "No records", noRecordsIcon: we, highlightOnHover: Te, striped: Ee, noHeader: De, onRowClick: Oe, onRowDoubleClick: ke, onRowContextMenu: Ae, onCellClick: je, onCellDoubleClick: Me, onCellContextMenu: Ne, onScroll: Pe, onScrollToTop: Ie, onScrollToBottom: Le, onScrollToLeft: Re, onScrollToRight: ze, c: V, backgroundColor: Be, borderColor: Ve, rowBorderColor: H, stripedColor: He, highlightOnHoverColor: Ue, rowColor: U, rowBackgroundColor: W, rowExpansion: We, rowClassName: Ge, rowStyle: Ke, customRowAttributes: G, scrollViewportRef: qe, scrollAreaProps: Je, tableRef: Ye, bodyRef: Xe, m: K, my: q, mx: Ze, mt: Qe, mb: $e, ml: J, mr: et, className: tt, classNames: nt, style: rt, styles: it, rowFactory: at, tableWrapper: ot, ...st }) {
|
|
2910
|
+
let ct = l(() => y ? Cn(y) : g, [g, y]), { refs: Y, onScroll: lt } = Bn({
|
|
2913
2911
|
scrollCallbacks: {
|
|
2914
|
-
onScroll:
|
|
2915
|
-
onScrollToTop:
|
|
2916
|
-
onScrollToBottom:
|
|
2917
|
-
onScrollToLeft:
|
|
2918
|
-
onScrollToRight:
|
|
2912
|
+
onScroll: Pe,
|
|
2913
|
+
onScrollToTop: Ie,
|
|
2914
|
+
onScrollToBottom: Le,
|
|
2915
|
+
onScrollToLeft: Re,
|
|
2916
|
+
onScrollToRight: ze
|
|
2919
2917
|
},
|
|
2920
|
-
withRowBorders:
|
|
2921
|
-
}),
|
|
2918
|
+
withRowBorders: st.withRowBorders
|
|
2919
|
+
}), ut = jn({
|
|
2922
2920
|
key: _,
|
|
2923
|
-
columns:
|
|
2924
|
-
headerRef:
|
|
2925
|
-
scrollViewportRef:
|
|
2926
|
-
}), dt =
|
|
2921
|
+
columns: ct,
|
|
2922
|
+
headerRef: Y.header,
|
|
2923
|
+
scrollViewportRef: Y.scrollViewport
|
|
2924
|
+
}), dt = ut.effectiveColumns, ft = Fe(Y.table, Ye), pt = Fe(Y.scrollViewport, qe), mt = u(null), ht = Fe(mt, Xe), gt = Jn({
|
|
2927
2925
|
rowExpansion: We,
|
|
2928
2926
|
records: T,
|
|
2929
2927
|
idAccessor: w
|
|
2930
2928
|
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Vn({
|
|
2931
2929
|
columns: dt,
|
|
2932
|
-
theadRef:
|
|
2930
|
+
theadRef: Y.header,
|
|
2933
2931
|
tbodyRef: mt,
|
|
2934
|
-
selectionColumnHeaderRef:
|
|
2932
|
+
selectionColumnHeaderRef: Y.selectionColumnHeader,
|
|
2935
2933
|
selectionVisible: !!D,
|
|
2936
2934
|
pinFirstColumn: b,
|
|
2937
2935
|
pinLastColumn: x
|
|
@@ -2944,7 +2942,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2944
2942
|
let wt = T?.length;
|
|
2945
2943
|
c(() => {
|
|
2946
2944
|
if (!bt.current || h || T === St.current) return;
|
|
2947
|
-
let e =
|
|
2945
|
+
let e = Y.scrollViewport.current;
|
|
2948
2946
|
if (!e) return;
|
|
2949
2947
|
let t = requestAnimationFrame(() => {
|
|
2950
2948
|
e.scrollTo({
|
|
@@ -2956,7 +2954,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2956
2954
|
}, [
|
|
2957
2955
|
h,
|
|
2958
2956
|
T,
|
|
2959
|
-
|
|
2957
|
+
Y.scrollViewport
|
|
2960
2958
|
]);
|
|
2961
2959
|
let Tt = T?.map((e) => Q(e, w)), Et = !!D, Dt = D?.map((e) => Q(e, w)), Ot = Tt !== void 0 && Dt !== void 0 && Dt.length > 0, kt = j ? T?.filter(j) : T, At = kt?.map((e) => Q(e, w)), jt = Ot && At.every((e) => Dt.includes(e)), Mt = Ot && At.some((e) => Dt.includes(e)), Nt = a(() => {
|
|
2962
2960
|
D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) : bn([...D, ...kt], (e) => Q(e, w)));
|
|
@@ -2969,30 +2967,30 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2969
2967
|
D
|
|
2970
2968
|
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = Hn(Tt), It = Et && !vt, Lt = {
|
|
2971
2969
|
m: K,
|
|
2972
|
-
my:
|
|
2973
|
-
mx:
|
|
2974
|
-
mt:
|
|
2975
|
-
mb:
|
|
2976
|
-
ml:
|
|
2977
|
-
mr:
|
|
2978
|
-
}, Rt = a(({ children: e }) =>
|
|
2970
|
+
my: q,
|
|
2971
|
+
mx: Ze,
|
|
2972
|
+
mt: Qe,
|
|
2973
|
+
mb: $e,
|
|
2974
|
+
ml: J,
|
|
2975
|
+
mr: et
|
|
2976
|
+
}, Rt = a(({ children: e }) => ot ? ot({ children: e }) : e, [ot]);
|
|
2979
2977
|
return p(fn, {
|
|
2980
|
-
...
|
|
2978
|
+
...ut,
|
|
2981
2979
|
pinnedMap: _t,
|
|
2982
2980
|
children: m(v, {
|
|
2983
|
-
ref:
|
|
2981
|
+
ref: Y.root,
|
|
2984
2982
|
...Lt,
|
|
2985
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2983
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, tt, nt?.root),
|
|
2986
2984
|
style: [
|
|
2987
2985
|
(e) => ({
|
|
2988
2986
|
...sn({
|
|
2989
2987
|
theme: e,
|
|
2990
|
-
c:
|
|
2991
|
-
backgroundColor:
|
|
2992
|
-
borderColor:
|
|
2993
|
-
rowBorderColor:
|
|
2994
|
-
stripedColor:
|
|
2995
|
-
highlightOnHoverColor:
|
|
2988
|
+
c: V,
|
|
2989
|
+
backgroundColor: Be,
|
|
2990
|
+
borderColor: Ve,
|
|
2991
|
+
rowBorderColor: H,
|
|
2992
|
+
stripedColor: He,
|
|
2993
|
+
highlightOnHoverColor: Ue
|
|
2996
2994
|
}),
|
|
2997
2995
|
borderRadius: e.radius[t] || t,
|
|
2998
2996
|
boxShadow: e.shadows[d] || d,
|
|
@@ -3000,8 +2998,8 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3000
2998
|
minHeight: i,
|
|
3001
2999
|
maxHeight: o
|
|
3002
3000
|
}),
|
|
3003
|
-
|
|
3004
|
-
|
|
3001
|
+
rt,
|
|
3002
|
+
it?.root,
|
|
3005
3003
|
{ position: "relative" }
|
|
3006
3004
|
],
|
|
3007
3005
|
children: [
|
|
@@ -3009,9 +3007,9 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3009
3007
|
viewportRef: pt,
|
|
3010
3008
|
leftShadowBehind: Et || vt,
|
|
3011
3009
|
rightShadowBehind: yt,
|
|
3012
|
-
onScrollPositionChange:
|
|
3013
|
-
scrollAreaProps:
|
|
3014
|
-
children: p(Rt, { children: m(
|
|
3010
|
+
onScrollPositionChange: lt,
|
|
3011
|
+
scrollAreaProps: Je,
|
|
3012
|
+
children: p(Rt, { children: m(oe, {
|
|
3015
3013
|
ref: ft,
|
|
3016
3014
|
horizontalSpacing: I,
|
|
3017
3015
|
className: X("mantine-datatable-table", {
|
|
@@ -3019,27 +3017,27 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3019
3017
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3020
3018
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3021
3019
|
"mantine-datatable-selection-column-visible": Et,
|
|
3022
|
-
"mantine-datatable-resizable-columns":
|
|
3023
|
-
"mantine-datatable-resize-locked":
|
|
3024
|
-
"mantine-datatable-resizing":
|
|
3025
|
-
},
|
|
3020
|
+
"mantine-datatable-resizable-columns": ut.hasResizableColumns,
|
|
3021
|
+
"mantine-datatable-resize-locked": ut.isLocked,
|
|
3022
|
+
"mantine-datatable-resizing": ut.isResizing
|
|
3023
|
+
}, nt?.table),
|
|
3026
3024
|
style: {
|
|
3027
|
-
...
|
|
3028
|
-
...
|
|
3029
|
-
...
|
|
3025
|
+
...it?.table,
|
|
3026
|
+
...ut.isLocked ? { tableLayout: "fixed" } : null,
|
|
3027
|
+
...ut.tableWidth == null ? null : { width: `${ut.tableWidth}px` }
|
|
3030
3028
|
},
|
|
3031
|
-
"data-striped": wt &&
|
|
3032
|
-
"data-highlight-on-hover":
|
|
3033
|
-
...
|
|
3029
|
+
"data-striped": wt && Ee || void 0,
|
|
3030
|
+
"data-highlight-on-hover": Te || void 0,
|
|
3031
|
+
...st,
|
|
3034
3032
|
children: [
|
|
3035
|
-
|
|
3036
|
-
...
|
|
3033
|
+
De ? null : p(fn, {
|
|
3034
|
+
...ut,
|
|
3037
3035
|
pinnedMap: _t,
|
|
3038
3036
|
children: p(wr, {
|
|
3039
|
-
ref:
|
|
3040
|
-
selectionColumnHeaderRef:
|
|
3041
|
-
className:
|
|
3042
|
-
style:
|
|
3037
|
+
ref: Y.header,
|
|
3038
|
+
selectionColumnHeaderRef: Y.selectionColumnHeader,
|
|
3039
|
+
className: nt?.header,
|
|
3040
|
+
style: it?.header,
|
|
3043
3041
|
columns: dt,
|
|
3044
3042
|
defaultColumnProps: S,
|
|
3045
3043
|
groups: y,
|
|
@@ -3059,7 +3057,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3059
3057
|
selectorCellShadowVisible: It,
|
|
3060
3058
|
selectionColumnClassName: k,
|
|
3061
3059
|
selectionColumnStyle: A,
|
|
3062
|
-
withColumnBorders:
|
|
3060
|
+
withColumnBorders: st.withColumnBorders
|
|
3063
3061
|
})
|
|
3064
3062
|
}),
|
|
3065
3063
|
p("tbody", {
|
|
@@ -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);
|
|
@@ -3086,30 +3084,30 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3086
3084
|
isRecordSelectable: j,
|
|
3087
3085
|
selectionCheckboxProps: M,
|
|
3088
3086
|
getSelectionCheckboxProps: P,
|
|
3089
|
-
onClick:
|
|
3090
|
-
onDoubleClick:
|
|
3091
|
-
onCellClick:
|
|
3092
|
-
onCellDoubleClick:
|
|
3093
|
-
onContextMenu:
|
|
3094
|
-
onCellContextMenu:
|
|
3087
|
+
onClick: Oe,
|
|
3088
|
+
onDoubleClick: ke,
|
|
3089
|
+
onCellClick: je,
|
|
3090
|
+
onCellDoubleClick: Me,
|
|
3091
|
+
onContextMenu: Ae,
|
|
3092
|
+
onCellContextMenu: Ne,
|
|
3095
3093
|
expansion: gt,
|
|
3096
|
-
color:
|
|
3097
|
-
backgroundColor:
|
|
3094
|
+
color: U,
|
|
3095
|
+
backgroundColor: W,
|
|
3098
3096
|
className: Ge,
|
|
3099
3097
|
style: Ke,
|
|
3100
|
-
customAttributes:
|
|
3098
|
+
customAttributes: G,
|
|
3101
3099
|
selectorCellShadowVisible: It,
|
|
3102
3100
|
selectionColumnClassName: k,
|
|
3103
3101
|
selectionColumnStyle: A,
|
|
3104
3102
|
idAccessor: w,
|
|
3105
|
-
rowFactory:
|
|
3103
|
+
rowFactory: at
|
|
3106
3104
|
}, n);
|
|
3107
3105
|
}) : p(pn, {})
|
|
3108
3106
|
}),
|
|
3109
3107
|
dt.some(({ footer: e }) => e) && p(or, {
|
|
3110
|
-
ref:
|
|
3111
|
-
className:
|
|
3112
|
-
style:
|
|
3108
|
+
ref: Y.footer,
|
|
3109
|
+
className: nt?.footer,
|
|
3110
|
+
style: it?.footer,
|
|
3113
3111
|
columns: dt,
|
|
3114
3112
|
defaultColumnProps: S,
|
|
3115
3113
|
pinnedMap: _t,
|
|
@@ -3120,44 +3118,44 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3120
3118
|
}) })
|
|
3121
3119
|
}),
|
|
3122
3120
|
!!(L && wt) && p(kr, {
|
|
3123
|
-
className:
|
|
3124
|
-
style:
|
|
3121
|
+
className: nt?.pagination,
|
|
3122
|
+
style: it?.pagination,
|
|
3125
3123
|
horizontalSpacing: I,
|
|
3126
3124
|
fetching: h,
|
|
3127
3125
|
page: L,
|
|
3128
3126
|
onPageChange: Ct,
|
|
3129
|
-
totalRecords:
|
|
3130
|
-
recordsPerPage:
|
|
3131
|
-
onRecordsPerPageChange:
|
|
3132
|
-
recordsPerPageOptions:
|
|
3133
|
-
recordsPerPageLabel:
|
|
3134
|
-
paginationWithEdges:
|
|
3135
|
-
paginationWithControls:
|
|
3136
|
-
paginationActiveTextColor:
|
|
3137
|
-
paginationActiveBackgroundColor:
|
|
3138
|
-
paginationSize:
|
|
3139
|
-
paginationText:
|
|
3140
|
-
paginationWrapBreakpoint:
|
|
3141
|
-
getPaginationControlProps:
|
|
3142
|
-
getPaginationItemProps:
|
|
3143
|
-
noRecordsText:
|
|
3144
|
-
loadingText:
|
|
3127
|
+
totalRecords: re,
|
|
3128
|
+
recordsPerPage: ie,
|
|
3129
|
+
onRecordsPerPageChange: ae,
|
|
3130
|
+
recordsPerPageOptions: R,
|
|
3131
|
+
recordsPerPageLabel: se,
|
|
3132
|
+
paginationWithEdges: ce,
|
|
3133
|
+
paginationWithControls: le,
|
|
3134
|
+
paginationActiveTextColor: z,
|
|
3135
|
+
paginationActiveBackgroundColor: ue,
|
|
3136
|
+
paginationSize: B,
|
|
3137
|
+
paginationText: de,
|
|
3138
|
+
paginationWrapBreakpoint: fe,
|
|
3139
|
+
getPaginationControlProps: pe,
|
|
3140
|
+
getPaginationItemProps: me,
|
|
3141
|
+
noRecordsText: Ce,
|
|
3142
|
+
loadingText: xe,
|
|
3145
3143
|
recordsLength: wt,
|
|
3146
|
-
renderPagination:
|
|
3144
|
+
renderPagination: he
|
|
3147
3145
|
}),
|
|
3148
3146
|
p(Tr, {
|
|
3149
3147
|
fetching: h,
|
|
3150
|
-
backgroundBlur:
|
|
3151
|
-
customContent:
|
|
3152
|
-
size:
|
|
3153
|
-
type:
|
|
3154
|
-
color:
|
|
3148
|
+
backgroundBlur: ge,
|
|
3149
|
+
customContent: _e,
|
|
3150
|
+
size: ve,
|
|
3151
|
+
type: ye,
|
|
3152
|
+
color: be
|
|
3155
3153
|
}),
|
|
3156
3154
|
p(hn, {
|
|
3157
|
-
icon:
|
|
3158
|
-
text:
|
|
3155
|
+
icon: we,
|
|
3156
|
+
text: Ce,
|
|
3159
3157
|
active: !h && !wt,
|
|
3160
|
-
children:
|
|
3158
|
+
children: Se
|
|
3161
3159
|
})
|
|
3162
3160
|
]
|
|
3163
3161
|
})
|
|
@@ -3167,18 +3165,18 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3167
3165
|
//#region src/DataTable/UpdateModal.tsx
|
|
3168
3166
|
function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3169
3167
|
let { data: s, isLoading: c } = Ut(i, n, a), { mutateAsync: l, isPending: u, error: d } = qt(i, n, r);
|
|
3170
|
-
return c || !s ? /* @__PURE__ */ m(
|
|
3168
|
+
return c || !s ? /* @__PURE__ */ m(ie, {
|
|
3171
3169
|
gap: "md",
|
|
3172
3170
|
children: [
|
|
3173
|
-
/* @__PURE__ */ p(
|
|
3174
|
-
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(
|
|
3171
|
+
/* @__PURE__ */ p(re, { height: 40 }),
|
|
3172
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, t)),
|
|
3175
3173
|
/* @__PURE__ */ m(T, {
|
|
3176
3174
|
mt: "md",
|
|
3177
3175
|
justify: "end",
|
|
3178
|
-
children: [/* @__PURE__ */ p(
|
|
3176
|
+
children: [/* @__PURE__ */ p(re, {
|
|
3179
3177
|
width: 100,
|
|
3180
3178
|
height: 36
|
|
3181
|
-
}), /* @__PURE__ */ p(
|
|
3179
|
+
}), /* @__PURE__ */ p(re, {
|
|
3182
3180
|
width: 100,
|
|
3183
3181
|
height: 36
|
|
3184
3182
|
})]
|
|
@@ -3213,7 +3211,7 @@ function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
|
|
|
3213
3211
|
title: l.name,
|
|
3214
3212
|
children: l.message
|
|
3215
3213
|
}),
|
|
3216
|
-
/* @__PURE__ */ p(
|
|
3214
|
+
/* @__PURE__ */ p(B, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3217
3215
|
/* @__PURE__ */ m(T, {
|
|
3218
3216
|
mt: "md",
|
|
3219
3217
|
justify: "end",
|
|
@@ -3363,7 +3361,7 @@ function Xr({ rows: e }) {
|
|
|
3363
3361
|
gap: "md",
|
|
3364
3362
|
py: "xs",
|
|
3365
3363
|
px: "sm",
|
|
3366
|
-
children: [/* @__PURE__ */ p(
|
|
3364
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3367
3365
|
fw: 700,
|
|
3368
3366
|
fz: "sm",
|
|
3369
3367
|
style: { flexShrink: 0 },
|
|
@@ -3397,13 +3395,13 @@ function $r(e, t) {
|
|
|
3397
3395
|
let n = t.column;
|
|
3398
3396
|
if (n.render) return n.render(e, 0);
|
|
3399
3397
|
let r = Qr(e, n.accessor ?? t.id);
|
|
3400
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3398
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
3401
3399
|
c: "dimmed",
|
|
3402
3400
|
children: "–"
|
|
3403
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3401
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
3404
3402
|
fz: "sm",
|
|
3405
3403
|
children: r ? "Ja" : "Nein"
|
|
3406
|
-
}) : /* @__PURE__ */ p(
|
|
3404
|
+
}) : /* @__PURE__ */ p(B, {
|
|
3407
3405
|
fz: "sm",
|
|
3408
3406
|
children: String(r)
|
|
3409
3407
|
});
|
|
@@ -3430,7 +3428,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3430
3428
|
event: n
|
|
3431
3429
|
});
|
|
3432
3430
|
};
|
|
3433
|
-
return /* @__PURE__ */ m(
|
|
3431
|
+
return /* @__PURE__ */ m(ie, {
|
|
3434
3432
|
gap: "sm",
|
|
3435
3433
|
my: "md",
|
|
3436
3434
|
children: [
|
|
@@ -3448,7 +3446,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3448
3446
|
variant: "filled",
|
|
3449
3447
|
size: "input-sm",
|
|
3450
3448
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3451
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3449
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(Oe, { size: 18 }) : /* @__PURE__ */ p(ke, { size: 18 })
|
|
3452
3450
|
})] }), E.length > 0 && /* @__PURE__ */ m(F, {
|
|
3453
3451
|
opened: M,
|
|
3454
3452
|
onChange: N,
|
|
@@ -3466,7 +3464,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3466
3464
|
size: "input-sm",
|
|
3467
3465
|
onClick: () => N((e) => !e),
|
|
3468
3466
|
"aria-label": "Filter",
|
|
3469
|
-
children: /* @__PURE__ */ p(
|
|
3467
|
+
children: /* @__PURE__ */ p(we, { size: 18 })
|
|
3470
3468
|
})
|
|
3471
3469
|
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3472
3470
|
p: 0,
|
|
@@ -3481,7 +3479,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3481
3479
|
value: e.id,
|
|
3482
3480
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3483
3481
|
gap: "xs",
|
|
3484
|
-
children: [/* @__PURE__ */ p(
|
|
3482
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3485
3483
|
fw: 600,
|
|
3486
3484
|
fz: "sm",
|
|
3487
3485
|
children: e.column.title ?? e.id
|
|
@@ -3497,7 +3495,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3497
3495
|
})]
|
|
3498
3496
|
})]
|
|
3499
3497
|
}),
|
|
3500
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3498
|
+
e.length === 0 && /* @__PURE__ */ p(B, {
|
|
3501
3499
|
c: "dimmed",
|
|
3502
3500
|
ta: "center",
|
|
3503
3501
|
py: "xl",
|
|
@@ -3532,7 +3530,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3532
3530
|
color: "gray",
|
|
3533
3531
|
size: "sm",
|
|
3534
3532
|
onClick: (e) => e.stopPropagation(),
|
|
3535
|
-
children: /* @__PURE__ */ p(
|
|
3533
|
+
children: /* @__PURE__ */ p(Ce, { size: 16 })
|
|
3536
3534
|
}) }), /* @__PURE__ */ p(k.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(k.Item, {
|
|
3537
3535
|
leftSection: t.icon,
|
|
3538
3536
|
onClick: (n) => {
|
|
@@ -3556,7 +3554,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3556
3554
|
})]
|
|
3557
3555
|
}) }, s);
|
|
3558
3556
|
}),
|
|
3559
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3557
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(ie, {
|
|
3560
3558
|
gap: "xs",
|
|
3561
3559
|
mt: "sm",
|
|
3562
3560
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3570,7 +3568,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3570
3568
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3571
3569
|
justify: "center",
|
|
3572
3570
|
gap: "xs",
|
|
3573
|
-
children: [/* @__PURE__ */ p(
|
|
3571
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3574
3572
|
fz: "xs",
|
|
3575
3573
|
c: "dimmed",
|
|
3576
3574
|
children: "Einträge pro Seite:"
|
|
@@ -3599,32 +3597,32 @@ 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,
|
|
3603
|
-
let [
|
|
3604
|
-
|
|
3605
|
-
},
|
|
3606
|
-
...
|
|
3607
|
-
...
|
|
3608
|
-
},
|
|
3600
|
+
function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, topContent: l, fields: h, selection: b, pagination: x, filters: S, actions: C, steps: D, defaultSort: O, onSortChange: A, createButtonText: j, queryParams: M, tabs: P, defaultTab: ee, activeTab: F, onActiveTabChange: te, canUpdate: I, canDelete: L, showRefresh: ne = !0, onRefresh: ae, autoPoll: oe, rowExpansion: R, onRowClick: se, mobileCards: ce = !1, deleteConfirmMessage: le, editRecordId: z, onEditRecordIdChange: de }) {
|
|
3601
|
+
let [fe, me] = d(ee || (P && P.length > 0 ? P[0].value : null)), he = F === void 0 ? fe : F, ge = (e) => {
|
|
3602
|
+
F === void 0 && me(e), te && te(e);
|
|
3603
|
+
}, _e = P?.find((e) => e.value === he), ve = _e?.queryParams || {}, ye = _e?.apiPath ?? a, be = _e?.mutationApiPath ?? o ?? ye, Ce = {
|
|
3604
|
+
...M,
|
|
3605
|
+
...ve
|
|
3606
|
+
}, we = Ce ? "?" + Object.entries(Ce).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", Oe = he ? [...n, he] : n, { data: ke, isLoading: je, isError: Me, isRefetching: Ne, refetch: Pe } = Wt(ye + we, Oe), Fe = Yr(Array.isArray(ke) ? ke : [], S), [Ie, Le] = d(!1), Re = u(() => {});
|
|
3609
3607
|
s(() => {
|
|
3610
|
-
|
|
3608
|
+
Re.current = ae ?? (() => Pe());
|
|
3611
3609
|
});
|
|
3612
|
-
let
|
|
3610
|
+
let ze = typeof oe == "function" ? oe(Array.isArray(ke) ? ke : []) : oe ?? !1;
|
|
3613
3611
|
s(() => {
|
|
3614
|
-
if (!
|
|
3612
|
+
if (!ze) return;
|
|
3615
3613
|
let e = setInterval(() => {
|
|
3616
|
-
Promise.resolve(
|
|
3617
|
-
},
|
|
3614
|
+
Promise.resolve(Re.current()).catch(() => {});
|
|
3615
|
+
}, ze);
|
|
3618
3616
|
return () => clearInterval(e);
|
|
3619
|
-
}, [
|
|
3620
|
-
let [
|
|
3621
|
-
columnAccessor:
|
|
3622
|
-
direction:
|
|
3623
|
-
}),
|
|
3624
|
-
|
|
3625
|
-
},
|
|
3626
|
-
|
|
3627
|
-
}, Ye =
|
|
3617
|
+
}, [ze]);
|
|
3618
|
+
let [V, Be] = d({
|
|
3619
|
+
columnAccessor: O?.field ?? h[0].id,
|
|
3620
|
+
direction: O?.direction ?? "desc"
|
|
3621
|
+
}), Ve = (e) => {
|
|
3622
|
+
Be(e), A && A(String(e.columnAccessor), e.direction);
|
|
3623
|
+
}, H = Ur(Fe, V.columnAccessor, V.direction), [He, Ue] = zr(ti[1], "mantine-table-page-size"), [U, W] = d(1), We = x ? H.slice((U - 1) * He, U * He) : H, [Ge, Ke] = d([]), G = R?.expanded?.recordIds ?? Ge, qe = R?.expanded?.onRecordIdsChange ?? Ke, Je = (e) => {
|
|
3624
|
+
G.includes(e) ? qe(G.filter((t) => t !== e)) : qe(R?.allowMultiple ? [...G, e] : [e]);
|
|
3625
|
+
}, Ye = h.findIndex((e) => e.list && e.column && !e.column.hidden), Xe = R && Ye >= 0 ? h.map((e, t) => {
|
|
3628
3626
|
if (t !== Ye) return e;
|
|
3629
3627
|
let n = e.column.render;
|
|
3630
3628
|
return {
|
|
@@ -3635,7 +3633,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3635
3633
|
gap: "xs",
|
|
3636
3634
|
wrap: "nowrap",
|
|
3637
3635
|
align: "center",
|
|
3638
|
-
children: [!
|
|
3636
|
+
children: [!R.expandable || R.expandable(t) ? /* @__PURE__ */ p(v, {
|
|
3639
3637
|
component: "span",
|
|
3640
3638
|
"aria-label": "Aufklappen",
|
|
3641
3639
|
onClick: (e) => {
|
|
@@ -3646,11 +3644,11 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3646
3644
|
flexShrink: 0,
|
|
3647
3645
|
cursor: "pointer"
|
|
3648
3646
|
},
|
|
3649
|
-
children: /* @__PURE__ */ p(
|
|
3647
|
+
children: /* @__PURE__ */ p(Se, {
|
|
3650
3648
|
size: 16,
|
|
3651
3649
|
style: {
|
|
3652
3650
|
color: "var(--mantine-primary-color-filled)",
|
|
3653
|
-
transform:
|
|
3651
|
+
transform: G.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3654
3652
|
transition: "transform 200ms ease"
|
|
3655
3653
|
}
|
|
3656
3654
|
})
|
|
@@ -3661,32 +3659,32 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3661
3659
|
})
|
|
3662
3660
|
}
|
|
3663
3661
|
};
|
|
3664
|
-
}) :
|
|
3662
|
+
}) : h, [K, q] = d([]);
|
|
3665
3663
|
s(() => {
|
|
3666
|
-
|
|
3667
|
-
}, [
|
|
3668
|
-
let [Ze, Qe] = d(!1), [$e,
|
|
3664
|
+
q([]);
|
|
3665
|
+
}, [he]);
|
|
3666
|
+
let [Ze, Qe] = d(!1), [$e, J] = d(!1), [et, tt] = d(!1), nt = u(null);
|
|
3669
3667
|
s(() => {
|
|
3670
|
-
if (!
|
|
3671
|
-
|
|
3668
|
+
if (!z) {
|
|
3669
|
+
nt.current = null;
|
|
3672
3670
|
return;
|
|
3673
3671
|
}
|
|
3674
|
-
if (
|
|
3675
|
-
let e =
|
|
3676
|
-
e && (
|
|
3677
|
-
}, [
|
|
3678
|
-
let
|
|
3679
|
-
return
|
|
3680
|
-
icon: /* @__PURE__ */ p(
|
|
3672
|
+
if (nt.current === z) return;
|
|
3673
|
+
let e = H.find((e) => e.id === z);
|
|
3674
|
+
e && (nt.current = z, q([e]), J(!0), de?.(null));
|
|
3675
|
+
}, [z, H]);
|
|
3676
|
+
let rt = h.some((e) => e.update), it = h.some((e) => e.delete), at = [];
|
|
3677
|
+
return rt && at.push({
|
|
3678
|
+
icon: /* @__PURE__ */ p(Ee, { size: 14 }),
|
|
3681
3679
|
label: "Bearbeiten",
|
|
3682
3680
|
onClick: (e) => {
|
|
3683
|
-
|
|
3681
|
+
q(e), J(!0);
|
|
3684
3682
|
}
|
|
3685
|
-
}),
|
|
3686
|
-
icon: /* @__PURE__ */ p(
|
|
3683
|
+
}), C && at.push(...C), it && at.push({
|
|
3684
|
+
icon: /* @__PURE__ */ p(Ae, { size: 14 }),
|
|
3687
3685
|
label: "Löschen",
|
|
3688
3686
|
onClick: (e) => {
|
|
3689
|
-
|
|
3687
|
+
q(e), tt(!0);
|
|
3690
3688
|
}
|
|
3691
3689
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3692
3690
|
/* @__PURE__ */ m(w, {
|
|
@@ -3705,7 +3703,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3705
3703
|
gap: 6,
|
|
3706
3704
|
align: "center",
|
|
3707
3705
|
wrap: "nowrap",
|
|
3708
|
-
children: [typeof e == "string" ? /* @__PURE__ */ p(
|
|
3706
|
+
children: [typeof e == "string" ? /* @__PURE__ */ p(pe, {
|
|
3709
3707
|
order: 4,
|
|
3710
3708
|
children: e
|
|
3711
3709
|
}) : e, t != null && /* @__PURE__ */ m(E, {
|
|
@@ -3721,8 +3719,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3721
3719
|
size: "sm",
|
|
3722
3720
|
radius: "xl",
|
|
3723
3721
|
"aria-label": "Mehr Informationen",
|
|
3724
|
-
children: /* @__PURE__ */ p(
|
|
3725
|
-
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(
|
|
3722
|
+
children: /* @__PURE__ */ p(Te, { size: 16 })
|
|
3723
|
+
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(B, {
|
|
3726
3724
|
component: "div",
|
|
3727
3725
|
size: "sm",
|
|
3728
3726
|
c: "dimmed",
|
|
@@ -3749,49 +3747,49 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3749
3747
|
sm: "auto"
|
|
3750
3748
|
},
|
|
3751
3749
|
children: [
|
|
3752
|
-
|
|
3750
|
+
ne && /* @__PURE__ */ p(g, {
|
|
3753
3751
|
variant: "subtle",
|
|
3754
|
-
loading:
|
|
3752
|
+
loading: Ie,
|
|
3755
3753
|
onClick: async () => {
|
|
3756
|
-
if (
|
|
3757
|
-
|
|
3754
|
+
if (ae) {
|
|
3755
|
+
Le(!0);
|
|
3758
3756
|
try {
|
|
3759
|
-
await
|
|
3757
|
+
await ae();
|
|
3760
3758
|
} finally {
|
|
3761
|
-
|
|
3759
|
+
Le(!1);
|
|
3762
3760
|
}
|
|
3763
|
-
} else
|
|
3761
|
+
} else Pe();
|
|
3764
3762
|
},
|
|
3765
3763
|
"aria-label": "Neuladen",
|
|
3766
|
-
children: /* @__PURE__ */ p(
|
|
3764
|
+
children: /* @__PURE__ */ p(De, {})
|
|
3767
3765
|
}),
|
|
3768
|
-
(
|
|
3769
|
-
let e =
|
|
3766
|
+
(h.some((e) => e.update) || b) && (() => {
|
|
3767
|
+
let e = h.find((e) => e.update) && (!I || K.length > 0 && I(K[0])), t = h.find((e) => e.delete) && (!L || K.length > 0 && L(K[0])), n = (C ?? []).length > 0, r = e || t || n;
|
|
3770
3768
|
return /* @__PURE__ */ p(v, {
|
|
3771
|
-
...
|
|
3769
|
+
...ce ? { visibleFrom: "sm" } : {},
|
|
3772
3770
|
children: /* @__PURE__ */ m(k, {
|
|
3773
3771
|
shadow: "md",
|
|
3774
3772
|
children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
|
|
3775
3773
|
variant: "outline",
|
|
3776
|
-
rightSection: /* @__PURE__ */ p(
|
|
3777
|
-
disabled: !
|
|
3774
|
+
rightSection: /* @__PURE__ */ p(xe, { size: 14 }),
|
|
3775
|
+
disabled: !K.length || !r,
|
|
3778
3776
|
children: "Aktionen"
|
|
3779
3777
|
}) }), /* @__PURE__ */ m(k.Dropdown, { children: [
|
|
3780
3778
|
e && /* @__PURE__ */ p(k.Item, {
|
|
3781
|
-
leftSection: /* @__PURE__ */ p(
|
|
3782
|
-
onClick: () =>
|
|
3783
|
-
disabled:
|
|
3779
|
+
leftSection: /* @__PURE__ */ p(Ee, { size: 14 }),
|
|
3780
|
+
onClick: () => J(!0),
|
|
3781
|
+
disabled: K.length !== 1,
|
|
3784
3782
|
children: "Bearbeiten"
|
|
3785
3783
|
}),
|
|
3786
|
-
(
|
|
3784
|
+
(C ?? []).map((e, t) => /* @__PURE__ */ i(k.Item, {
|
|
3787
3785
|
...e.icon && { leftSection: e.icon },
|
|
3788
3786
|
key: `custom_action_${t}`,
|
|
3789
|
-
onClick: () => e.onClick(
|
|
3790
|
-
disabled: e.disabled?.(
|
|
3787
|
+
onClick: () => e.onClick(K),
|
|
3788
|
+
disabled: e.disabled?.(K) ?? !1
|
|
3791
3789
|
}, e.label)),
|
|
3792
3790
|
t && /* @__PURE__ */ p(k.Item, {
|
|
3793
|
-
leftSection: /* @__PURE__ */ p(
|
|
3794
|
-
onClick: () =>
|
|
3791
|
+
leftSection: /* @__PURE__ */ p(Ae, { size: 14 }),
|
|
3792
|
+
onClick: () => tt(!0),
|
|
3795
3793
|
color: "red",
|
|
3796
3794
|
children: "Löschen"
|
|
3797
3795
|
})
|
|
@@ -3799,156 +3797,157 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3799
3797
|
})
|
|
3800
3798
|
});
|
|
3801
3799
|
})(),
|
|
3802
|
-
|
|
3800
|
+
h.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3803
3801
|
onClick: () => Qe(!0),
|
|
3804
|
-
disabled:
|
|
3805
|
-
children:
|
|
3802
|
+
disabled: je,
|
|
3803
|
+
children: j ?? "Erstellen"
|
|
3806
3804
|
}),
|
|
3807
3805
|
c
|
|
3808
3806
|
]
|
|
3809
3807
|
})]
|
|
3810
3808
|
}),
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3809
|
+
l,
|
|
3810
|
+
P && P.length > 0 && /* @__PURE__ */ p(ue, {
|
|
3811
|
+
value: he,
|
|
3812
|
+
onChange: ge,
|
|
3814
3813
|
mt: "md",
|
|
3815
|
-
children: /* @__PURE__ */ p(
|
|
3814
|
+
children: /* @__PURE__ */ p(ue.List, { children: P.map((e) => /* @__PURE__ */ p(ue.Tab, {
|
|
3816
3815
|
value: e.value,
|
|
3817
3816
|
leftSection: e.icon,
|
|
3818
3817
|
children: e.label
|
|
3819
3818
|
}, e.value)) })
|
|
3820
3819
|
}),
|
|
3821
|
-
|
|
3820
|
+
Me && /* @__PURE__ */ p(_, {
|
|
3822
3821
|
mt: "md",
|
|
3823
3822
|
variant: "light",
|
|
3824
3823
|
color: "red",
|
|
3825
3824
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3826
|
-
icon: /* @__PURE__ */ p(
|
|
3825
|
+
icon: /* @__PURE__ */ p(Te, {}),
|
|
3827
3826
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3828
3827
|
}),
|
|
3829
|
-
(
|
|
3828
|
+
(je || Ne) && /* @__PURE__ */ m(ie, {
|
|
3830
3829
|
my: "md",
|
|
3831
|
-
children: [/* @__PURE__ */ p(
|
|
3830
|
+
children: [/* @__PURE__ */ p(re, { height: 40 }), [
|
|
3832
3831
|
,
|
|
3833
3832
|
,
|
|
3834
3833
|
,
|
|
3835
3834
|
,
|
|
3836
3835
|
,
|
|
3837
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3836
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, `skeleton-${t}`))]
|
|
3838
3837
|
}),
|
|
3839
|
-
!
|
|
3840
|
-
...
|
|
3838
|
+
!je && !Ne && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3839
|
+
...ce ? { visibleFrom: "sm" } : {},
|
|
3841
3840
|
children: /* @__PURE__ */ p(Ir, {
|
|
3842
3841
|
my: "md",
|
|
3843
3842
|
striped: !0,
|
|
3844
3843
|
highlightOnHover: !0,
|
|
3845
3844
|
minHeight: 150,
|
|
3846
|
-
fetching:
|
|
3847
|
-
records:
|
|
3848
|
-
sortStatus:
|
|
3849
|
-
onSortStatusChange:
|
|
3850
|
-
...
|
|
3851
|
-
selectedRecords:
|
|
3852
|
-
onSelectedRecordsChange:
|
|
3845
|
+
fetching: Me,
|
|
3846
|
+
records: We,
|
|
3847
|
+
sortStatus: V,
|
|
3848
|
+
onSortStatusChange: Ve,
|
|
3849
|
+
...b && {
|
|
3850
|
+
selectedRecords: K,
|
|
3851
|
+
onSelectedRecordsChange: q
|
|
3853
3852
|
},
|
|
3854
|
-
...
|
|
3855
|
-
totalRecords:
|
|
3856
|
-
recordsPerPage:
|
|
3857
|
-
onPageChange:
|
|
3858
|
-
page:
|
|
3853
|
+
...x && We.length && {
|
|
3854
|
+
totalRecords: H.length,
|
|
3855
|
+
recordsPerPage: He,
|
|
3856
|
+
onPageChange: W,
|
|
3857
|
+
page: U,
|
|
3859
3858
|
recordsPerPageOptions: ti,
|
|
3860
|
-
onRecordsPerPageChange:
|
|
3859
|
+
onRecordsPerPageChange: Ue,
|
|
3861
3860
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3862
3861
|
},
|
|
3863
|
-
...
|
|
3864
|
-
allowMultiple:
|
|
3865
|
-
trigger:
|
|
3866
|
-
content: ({ record: e }) =>
|
|
3862
|
+
...R && { rowExpansion: {
|
|
3863
|
+
allowMultiple: R.allowMultiple ?? !1,
|
|
3864
|
+
trigger: se ? "never" : "click",
|
|
3865
|
+
content: ({ record: e }) => R.content(e, !1),
|
|
3867
3866
|
expanded: {
|
|
3868
|
-
recordIds:
|
|
3867
|
+
recordIds: G,
|
|
3869
3868
|
onRecordIdsChange: qe
|
|
3870
3869
|
},
|
|
3871
|
-
...
|
|
3870
|
+
...R.expandable && { expandable: ({ record: e }) => R.expandable(e) }
|
|
3872
3871
|
} },
|
|
3873
3872
|
columns: Xe.map((e) => e.column),
|
|
3874
3873
|
noRecordsText: "Keine Einträge gefunden",
|
|
3875
|
-
onRowClick:
|
|
3876
|
-
...
|
|
3874
|
+
onRowClick: se,
|
|
3875
|
+
...se && { style: { cursor: "pointer" } }
|
|
3877
3876
|
})
|
|
3878
|
-
}),
|
|
3877
|
+
}), ce && /* @__PURE__ */ p(v, {
|
|
3879
3878
|
hiddenFrom: "sm",
|
|
3880
3879
|
children: /* @__PURE__ */ p(ei, {
|
|
3881
|
-
records:
|
|
3880
|
+
records: We,
|
|
3882
3881
|
fields: Xe,
|
|
3883
|
-
onRowClick:
|
|
3882
|
+
onRowClick: se,
|
|
3884
3883
|
sort: {
|
|
3885
|
-
field: String(
|
|
3886
|
-
direction:
|
|
3884
|
+
field: String(V.columnAccessor),
|
|
3885
|
+
direction: V.direction,
|
|
3887
3886
|
onSortChange: (e, t) => {
|
|
3888
|
-
|
|
3887
|
+
Ve({
|
|
3889
3888
|
columnAccessor: e,
|
|
3890
3889
|
direction: t
|
|
3891
3890
|
});
|
|
3892
3891
|
}
|
|
3893
3892
|
},
|
|
3894
|
-
...
|
|
3895
|
-
totalRecords:
|
|
3896
|
-
recordsPerPage:
|
|
3897
|
-
page:
|
|
3898
|
-
onPageChange:
|
|
3893
|
+
...x && We.length && { pagination: {
|
|
3894
|
+
totalRecords: H.length,
|
|
3895
|
+
recordsPerPage: He,
|
|
3896
|
+
page: U,
|
|
3897
|
+
onPageChange: W,
|
|
3899
3898
|
recordsPerPageOptions: ti,
|
|
3900
3899
|
onRecordsPerPageChange: (e) => {
|
|
3901
|
-
|
|
3900
|
+
Ue(e), W(1);
|
|
3902
3901
|
}
|
|
3903
3902
|
} },
|
|
3904
|
-
...
|
|
3905
|
-
content:
|
|
3903
|
+
...R && { rowExpansion: {
|
|
3904
|
+
content: R.content,
|
|
3906
3905
|
expanded: {
|
|
3907
|
-
recordIds:
|
|
3906
|
+
recordIds: G,
|
|
3908
3907
|
onRecordIdsChange: qe
|
|
3909
3908
|
},
|
|
3910
|
-
...
|
|
3909
|
+
...R.expandable && { expandable: R.expandable }
|
|
3911
3910
|
} },
|
|
3912
|
-
...
|
|
3913
|
-
actions:
|
|
3914
|
-
canUpdate:
|
|
3915
|
-
canDelete:
|
|
3911
|
+
...at.length > 0 && {
|
|
3912
|
+
actions: at,
|
|
3913
|
+
canUpdate: I,
|
|
3914
|
+
canDelete: L
|
|
3916
3915
|
}
|
|
3917
3916
|
})
|
|
3918
3917
|
})] }),
|
|
3919
3918
|
/* @__PURE__ */ p(N, {
|
|
3920
3919
|
opened: $e,
|
|
3921
3920
|
onClose: () => {
|
|
3922
|
-
|
|
3921
|
+
J(!1), q([]);
|
|
3923
3922
|
},
|
|
3924
3923
|
title: e ?? "Bearbeiten",
|
|
3925
|
-
children:
|
|
3926
|
-
fields:
|
|
3924
|
+
children: K.length > 0 && /* @__PURE__ */ p(Lr, {
|
|
3925
|
+
fields: h.filter((e) => e.update),
|
|
3927
3926
|
queryKey: n,
|
|
3928
3927
|
connectedQueryKeys: r,
|
|
3929
|
-
apiPath:
|
|
3930
|
-
id:
|
|
3928
|
+
apiPath: be,
|
|
3929
|
+
id: K[0].id,
|
|
3931
3930
|
onClose: () => {
|
|
3932
|
-
|
|
3931
|
+
J(!1), q([]);
|
|
3933
3932
|
},
|
|
3934
|
-
steps:
|
|
3933
|
+
steps: D
|
|
3935
3934
|
})
|
|
3936
3935
|
}),
|
|
3937
|
-
|
|
3938
|
-
opened:
|
|
3936
|
+
K.length > 0 && /* @__PURE__ */ p(N, {
|
|
3937
|
+
opened: et,
|
|
3939
3938
|
onClose: () => {
|
|
3940
|
-
|
|
3939
|
+
tt(!1), q([]);
|
|
3941
3940
|
},
|
|
3942
3941
|
title: e ?? "Löschen",
|
|
3943
3942
|
children: /* @__PURE__ */ p(Rr, {
|
|
3944
3943
|
onClose: () => {
|
|
3945
|
-
|
|
3944
|
+
tt(!1), q([]);
|
|
3946
3945
|
},
|
|
3947
3946
|
queryKey: n,
|
|
3948
3947
|
connectedQueryKeys: r,
|
|
3949
|
-
apiPath:
|
|
3950
|
-
selectedRecords:
|
|
3951
|
-
confirmMessage:
|
|
3948
|
+
apiPath: be,
|
|
3949
|
+
selectedRecords: K,
|
|
3950
|
+
confirmMessage: le
|
|
3952
3951
|
})
|
|
3953
3952
|
}),
|
|
3954
3953
|
/* @__PURE__ */ p(N, {
|
|
@@ -3960,12 +3959,12 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3960
3959
|
children: /* @__PURE__ */ p(an, {
|
|
3961
3960
|
queryKey: n,
|
|
3962
3961
|
connectedQueryKeys: r,
|
|
3963
|
-
apiPath:
|
|
3962
|
+
apiPath: be,
|
|
3964
3963
|
onClose: () => {
|
|
3965
3964
|
Qe(!1);
|
|
3966
3965
|
},
|
|
3967
|
-
fields:
|
|
3968
|
-
steps:
|
|
3966
|
+
fields: h.filter((e) => e.create),
|
|
3967
|
+
steps: D
|
|
3969
3968
|
})
|
|
3970
3969
|
})
|
|
3971
3970
|
] });
|
|
@@ -3973,7 +3972,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3973
3972
|
//#endregion
|
|
3974
3973
|
//#region src/DataTable/SubTable.tsx
|
|
3975
3974
|
function ri({ mobile: e, columns: t, ...n }) {
|
|
3976
|
-
return e ? /* @__PURE__ */ p(
|
|
3975
|
+
return e ? /* @__PURE__ */ p(ie, {
|
|
3977
3976
|
gap: "sm",
|
|
3978
3977
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
3979
3978
|
children: (n.records ?? []).map((e, r) => {
|