@espresso-lab/mantine-data-table 2.3.3 → 2.3.5
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/Hooks/useApi.d.ts +2 -2
- package/dist/index.es.js +871 -913
- 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 +20 -20
package/dist/index.es.js
CHANGED
|
@@ -1,69 +1,28 @@
|
|
|
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
|
|
10
|
-
var Le =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 = {
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, HoverCard as E, Indicator as D, Loader as O, Menu as k, MenuDropdown as A, MenuItem as j, MenuTarget as M, Modal as N, NumberInput as P, Pagination as ee, Popover as F, PopoverDropdown as te, PopoverTarget as I, ScrollArea as L, Select as ne, Skeleton as R, Stack as re, Stepper as ie, Table as ae, TableTd as z, TableTfoot as oe, TableTh as se, TableThead as ce, TableTr as B, Tabs as le, Text as V, TextInput as ue, Textarea as de, Title as fe, createSafeContext as pe, parseThemeColor as me, rem as he, useDirection as ge, useMantineTheme as _e } from "@mantine/core";
|
|
5
|
+
import { DateInput as ve } from "@mantine/dates";
|
|
6
|
+
import { useForm as ye } from "@mantine/form";
|
|
7
|
+
import { IconCaretDownFilled as be, IconChevronRight as xe, IconDotsVertical as Se, IconFilter as Ce, IconInfoCircle as we, IconPencil as Te, IconRefresh as Ee, IconSortAscending as De, IconSortDescending as Oe, IconTrash as ke } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as Ae, useDisclosure as je, useLocalStorage as Me, useMediaQuery as Ne, useMergedRef as Pe, useTimeout as Fe } from "@mantine/hooks";
|
|
9
|
+
//#region node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
|
|
10
|
+
var Ie = e.createContext(void 0), Le = (t) => {
|
|
11
|
+
let n = e.useContext(Ie);
|
|
12
|
+
if (t) return t;
|
|
13
|
+
if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
|
|
14
|
+
return n;
|
|
15
|
+
}, Re = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
16
|
+
t.unmount();
|
|
17
|
+
}), [t]), /* @__PURE__ */ p(Ie.Provider, {
|
|
18
|
+
value: t,
|
|
19
|
+
children: n
|
|
20
|
+
})), ze = {
|
|
62
21
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
63
22
|
clearTimeout: (e) => clearTimeout(e),
|
|
64
23
|
setInterval: (e, t) => setInterval(e, t),
|
|
65
24
|
clearInterval: (e) => clearInterval(e)
|
|
66
|
-
},
|
|
25
|
+
}, Be = new class {
|
|
67
26
|
#e = ze;
|
|
68
27
|
#t = !1;
|
|
69
28
|
setTimeoutProvider(e) {
|
|
@@ -85,127 +44,140 @@ var Le = class {
|
|
|
85
44
|
this.#e.clearInterval(e);
|
|
86
45
|
}
|
|
87
46
|
}();
|
|
88
|
-
function
|
|
47
|
+
function Ve(e) {
|
|
89
48
|
setTimeout(e, 0);
|
|
90
49
|
}
|
|
91
50
|
//#endregion
|
|
92
51
|
//#region node_modules/@tanstack/query-core/build/modern/utils.js
|
|
93
|
-
var
|
|
94
|
-
function
|
|
95
|
-
function
|
|
52
|
+
var H = typeof window > "u" || "Deno" in globalThis;
|
|
53
|
+
function He() {}
|
|
54
|
+
function Ue(e) {
|
|
96
55
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
56
|
}
|
|
98
|
-
function
|
|
57
|
+
function We(e, t) {
|
|
99
58
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
59
|
}
|
|
101
60
|
function U(e, t) {
|
|
102
61
|
return typeof e == "function" ? e(t) : e;
|
|
103
62
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
-
}
|
|
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);
|
|
63
|
+
function Ge(e) {
|
|
64
|
+
return JSON.stringify(e, (e, t) => Xe(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
65
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
66
|
+
var Ke = Object.prototype.hasOwnProperty;
|
|
67
|
+
function qe(e, t, n = 0) {
|
|
112
68
|
if (e === t) return e;
|
|
113
69
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
70
|
+
let r = Ye(e) && Ye(t);
|
|
71
|
+
if (!r && !(Xe(e) && Xe(t))) return t;
|
|
116
72
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
117
73
|
for (let l = 0; l < o; l++) {
|
|
118
74
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
119
75
|
if (u === d) {
|
|
120
|
-
s[o] = u, (r ? l < i :
|
|
76
|
+
s[o] = u, (r ? l < i : Ke.call(e, o)) && c++;
|
|
121
77
|
continue;
|
|
122
78
|
}
|
|
123
79
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
124
80
|
s[o] = d;
|
|
125
81
|
continue;
|
|
126
82
|
}
|
|
127
|
-
let f =
|
|
83
|
+
let f = qe(u, d, n + 1);
|
|
128
84
|
s[o] = f, f === u && c++;
|
|
129
85
|
}
|
|
130
86
|
return i === o && c === i ? e : s;
|
|
131
87
|
}
|
|
132
|
-
function
|
|
88
|
+
function Je(e, t) {
|
|
133
89
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
90
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
91
|
return !0;
|
|
136
92
|
}
|
|
137
|
-
function
|
|
93
|
+
function Ye(e) {
|
|
138
94
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
95
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
96
|
+
function Xe(e) {
|
|
97
|
+
if (!Ze(e)) return !1;
|
|
142
98
|
let t = e.constructor;
|
|
143
99
|
if (t === void 0) return !0;
|
|
144
100
|
let n = t.prototype;
|
|
145
|
-
return !(!
|
|
101
|
+
return !(!Ze(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
102
|
}
|
|
147
|
-
function
|
|
103
|
+
function Ze(e) {
|
|
148
104
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
105
|
}
|
|
150
|
-
function
|
|
106
|
+
function Qe(e, t, n) {
|
|
151
107
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
108
|
if (n.structuralSharing !== !1) {
|
|
153
109
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
110
|
+
return qe(e, t);
|
|
155
111
|
} catch (e) {
|
|
156
112
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
157
113
|
}
|
|
158
|
-
return
|
|
114
|
+
return qe(e, t);
|
|
159
115
|
}
|
|
160
116
|
return t;
|
|
161
117
|
}
|
|
162
|
-
function
|
|
118
|
+
function $e(e, t) {
|
|
163
119
|
return typeof e == "function" ? e(...t) : !!e;
|
|
164
120
|
}
|
|
165
121
|
//#endregion
|
|
166
122
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
n
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
123
|
+
var et = () => H, tt = () => et(), W = class {
|
|
124
|
+
constructor() {
|
|
125
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
126
|
+
}
|
|
127
|
+
subscribe(e) {
|
|
128
|
+
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
129
|
+
this.listeners.delete(e), this.onUnsubscribe();
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
hasListeners() {
|
|
133
|
+
return this.listeners.size > 0;
|
|
134
|
+
}
|
|
135
|
+
onSubscribe() {}
|
|
136
|
+
onUnsubscribe() {}
|
|
137
|
+
}, G = new class extends W {
|
|
138
|
+
#e;
|
|
139
|
+
#t;
|
|
140
|
+
#n;
|
|
141
|
+
constructor() {
|
|
142
|
+
super(), this.#n = (e) => {
|
|
143
|
+
if (typeof window < "u" && window.addEventListener) {
|
|
144
|
+
let t = () => e();
|
|
145
|
+
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
146
|
+
window.removeEventListener("visibilitychange", t);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
onSubscribe() {
|
|
152
|
+
this.#t || this.setEventListener(this.#n);
|
|
153
|
+
}
|
|
154
|
+
onUnsubscribe() {
|
|
155
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
156
|
+
}
|
|
157
|
+
setEventListener(e) {
|
|
158
|
+
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
159
|
+
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
setFocused(e) {
|
|
163
|
+
this.#e !== e && (this.#e = e, this.onFocus());
|
|
164
|
+
}
|
|
165
|
+
onFocus() {
|
|
166
|
+
let e = this.isFocused();
|
|
167
|
+
this.listeners.forEach((t) => {
|
|
168
|
+
t(e);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
isFocused() {
|
|
172
|
+
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
173
|
+
}
|
|
174
|
+
}(), nt = Ve;
|
|
175
|
+
function rt() {
|
|
204
176
|
let e = [], t = 0, n = (e) => {
|
|
205
177
|
e();
|
|
206
178
|
}, r = (e) => {
|
|
207
179
|
e();
|
|
208
|
-
}, i =
|
|
180
|
+
}, i = nt, a = (r) => {
|
|
209
181
|
t ? e.push(r) : i(() => {
|
|
210
182
|
n(r);
|
|
211
183
|
});
|
|
@@ -247,7 +219,7 @@ function $e() {
|
|
|
247
219
|
}
|
|
248
220
|
};
|
|
249
221
|
}
|
|
250
|
-
var
|
|
222
|
+
var it = rt(), K = new class extends W {
|
|
251
223
|
#e = !0;
|
|
252
224
|
#t;
|
|
253
225
|
#n;
|
|
@@ -281,16 +253,16 @@ var J = $e(), et = new class extends Le {
|
|
|
281
253
|
}();
|
|
282
254
|
//#endregion
|
|
283
255
|
//#region node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
284
|
-
function
|
|
285
|
-
return (e ?? "online") !== "online" ||
|
|
256
|
+
function at(e) {
|
|
257
|
+
return (e ?? "online") !== "online" || K.isOnline();
|
|
286
258
|
}
|
|
287
259
|
//#endregion
|
|
288
260
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
261
|
+
function q(e, t) {
|
|
290
262
|
return {
|
|
291
263
|
fetchFailureCount: 0,
|
|
292
264
|
fetchFailureReason: null,
|
|
293
|
-
fetchStatus:
|
|
265
|
+
fetchStatus: at(t.networkMode) ? "fetching" : "paused",
|
|
294
266
|
...e === void 0 && {
|
|
295
267
|
error: null,
|
|
296
268
|
status: "pending"
|
|
@@ -299,10 +271,7 @@ function nt(e, t) {
|
|
|
299
271
|
}
|
|
300
272
|
//#endregion
|
|
301
273
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
303
|
-
constructor(e, t) {
|
|
304
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Ze(), this.bindMethods(), this.setOptions(t);
|
|
305
|
-
}
|
|
274
|
+
var ot = class extends W {
|
|
306
275
|
#e;
|
|
307
276
|
#t = void 0;
|
|
308
277
|
#n = void 0;
|
|
@@ -316,51 +285,53 @@ var rt = class extends Le {
|
|
|
316
285
|
#u;
|
|
317
286
|
#d;
|
|
318
287
|
#f;
|
|
319
|
-
#p;
|
|
320
|
-
|
|
288
|
+
#p = /* @__PURE__ */ new Set();
|
|
289
|
+
constructor(e, t) {
|
|
290
|
+
super(), this.options = t, this.#e = e, this.#o = null, this.bindMethods(), this.setOptions(t);
|
|
291
|
+
}
|
|
321
292
|
bindMethods() {
|
|
322
293
|
this.refetch = this.refetch.bind(this);
|
|
323
294
|
}
|
|
324
295
|
onSubscribe() {
|
|
325
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
296
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), ct(this.#t, this.options) ? this.#m() : this.updateResult(), this.#y());
|
|
326
297
|
}
|
|
327
298
|
onUnsubscribe() {
|
|
328
299
|
this.hasListeners() || this.destroy();
|
|
329
300
|
}
|
|
330
301
|
shouldFetchOnReconnect() {
|
|
331
|
-
return
|
|
302
|
+
return lt(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
303
|
}
|
|
333
304
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
305
|
+
return lt(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
335
306
|
}
|
|
336
307
|
destroy() {
|
|
337
308
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
338
309
|
}
|
|
339
310
|
setOptions(e) {
|
|
340
311
|
let t = this.options, n = this.#t;
|
|
341
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
312
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof U(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
313
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !Je(this.options, t) && this.#e.getQueryCache().notify({
|
|
343
314
|
type: "observerOptionsUpdated",
|
|
344
315
|
query: this.#t,
|
|
345
316
|
observer: this
|
|
346
317
|
});
|
|
347
318
|
let r = this.hasListeners();
|
|
348
|
-
r &&
|
|
319
|
+
r && J(this.#t, n, this.options, t) && this.#m(), this.updateResult(), r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || U(this.options.staleTime, this.#t) !== U(t.staleTime, this.#t)) && this.#g();
|
|
349
320
|
let i = this.#_();
|
|
350
|
-
r && (this.#t !== n ||
|
|
321
|
+
r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || i !== this.#f) && this.#v(i);
|
|
351
322
|
}
|
|
352
323
|
getOptimisticResult(e) {
|
|
353
324
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
354
|
-
return
|
|
325
|
+
return Je(this.getCurrentResult(), n) || (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
|
|
355
326
|
}
|
|
356
327
|
getCurrentResult() {
|
|
357
328
|
return this.#r;
|
|
358
329
|
}
|
|
359
330
|
trackResult(e, t) {
|
|
360
|
-
return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n),
|
|
331
|
+
return new Proxy(e, { get: (e, n) => (this.trackProp(n), t?.(n), Reflect.get(e, n)) });
|
|
361
332
|
}
|
|
362
333
|
trackProp(e) {
|
|
363
|
-
this.#
|
|
334
|
+
this.#p.add(e);
|
|
364
335
|
}
|
|
365
336
|
getCurrentQuery() {
|
|
366
337
|
return this.#t;
|
|
@@ -369,26 +340,38 @@ var rt = class extends Le {
|
|
|
369
340
|
return this.fetch({ ...e });
|
|
370
341
|
}
|
|
371
342
|
fetchOptimistic(e) {
|
|
372
|
-
let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t)
|
|
373
|
-
|
|
343
|
+
let t = this.#e.defaultQueryOptions(e), n = this.#e.getQueryCache().build(this.#e, t), r = () => {}, i, a = new Promise((e) => {
|
|
344
|
+
i = e, r = this.#e.getQueryCache().subscribe((i) => {
|
|
345
|
+
i.type === "updated" && i.query.queryHash === n.queryHash && n.state.data !== void 0 && (r(), e(this.createResult(n, t)));
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
return Promise.race([n.fetch().then(() => {
|
|
349
|
+
let e = this.createResult(n, t);
|
|
350
|
+
return i?.(e), e;
|
|
351
|
+
}).finally(() => {
|
|
352
|
+
r();
|
|
353
|
+
}), a]);
|
|
374
354
|
}
|
|
375
355
|
fetch(e) {
|
|
376
|
-
return this.#
|
|
356
|
+
return this.#m({
|
|
377
357
|
...e,
|
|
378
358
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
379
359
|
}).then(() => (this.updateResult(), this.#r));
|
|
380
360
|
}
|
|
381
|
-
#
|
|
361
|
+
#m(e) {
|
|
382
362
|
this.#S();
|
|
383
363
|
let t = this.#t.fetch(this.options, e);
|
|
384
|
-
return e?.throwOnError || (t = t.catch(
|
|
364
|
+
return e?.throwOnError || (t = t.catch(He)), t;
|
|
365
|
+
}
|
|
366
|
+
#h(e) {
|
|
367
|
+
return !tt() && U(this.options.enabled, this.#t) !== !1 && Ue(e);
|
|
385
368
|
}
|
|
386
369
|
#g() {
|
|
387
370
|
this.#b();
|
|
388
371
|
let e = U(this.options.staleTime, this.#t);
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
391
|
-
this.#
|
|
372
|
+
if (this.#r.isStale || !this.#h(e)) return;
|
|
373
|
+
let t = We(this.#r.dataUpdatedAt, e) + 1;
|
|
374
|
+
this.#u = Be.setTimeout(() => {
|
|
392
375
|
this.#r.isStale || this.updateResult();
|
|
393
376
|
}, t);
|
|
394
377
|
}
|
|
@@ -396,26 +379,26 @@ var rt = class extends Le {
|
|
|
396
379
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
397
380
|
}
|
|
398
381
|
#v(e) {
|
|
399
|
-
this.#x(), this.#
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
401
|
-
}, this.#
|
|
382
|
+
this.#x(), this.#f = e, this.#f !== 0 && this.#h(this.#f) && (this.#d = Be.setInterval(() => {
|
|
383
|
+
(this.options.refetchIntervalInBackground || G.isFocused()) && this.#m();
|
|
384
|
+
}, this.#f));
|
|
402
385
|
}
|
|
403
386
|
#y() {
|
|
404
387
|
this.#g(), this.#v(this.#_());
|
|
405
388
|
}
|
|
406
389
|
#b() {
|
|
407
|
-
this.#
|
|
390
|
+
this.#u !== void 0 && (Be.clearTimeout(this.#u), this.#u = void 0);
|
|
408
391
|
}
|
|
409
392
|
#x() {
|
|
410
|
-
this.#
|
|
393
|
+
this.#d !== void 0 && (Be.clearInterval(this.#d), this.#d = void 0);
|
|
411
394
|
}
|
|
412
395
|
createResult(e, t) {
|
|
413
396
|
let n = this.#t, r = this.options, i = this.#r, a = this.#i, o = this.#a, s = e === n ? this.#n : e.state, { state: c } = e, l = { ...c }, u = !1, d;
|
|
414
397
|
if (t._optimisticResults) {
|
|
415
|
-
let i = this.hasListeners(), a = !i &&
|
|
398
|
+
let i = this.hasListeners(), a = !i && ct(e, t), o = i && J(e, n, t, r);
|
|
416
399
|
(a || o) && (l = {
|
|
417
400
|
...l,
|
|
418
|
-
...
|
|
401
|
+
...q(c.data, e.options)
|
|
419
402
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
420
403
|
}
|
|
421
404
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -423,16 +406,19 @@ var rt = class extends Le {
|
|
|
423
406
|
let h = !1;
|
|
424
407
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
408
|
let e;
|
|
426
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#
|
|
427
|
-
}
|
|
428
|
-
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
429
|
-
else try {
|
|
430
|
-
this.#c = t.select, d = t.select(d), d = Xe(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
|
-
} catch (e) {
|
|
432
|
-
this.#s = e;
|
|
409
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#l?.state.data, this.#l) : t.placeholderData, e !== void 0 && (m = "success", d = Qe(i?.data, e, t), u = !0);
|
|
433
410
|
}
|
|
434
|
-
|
|
435
|
-
|
|
411
|
+
if (t.select && d !== void 0 && !h) {
|
|
412
|
+
if (i && d === a?.data && t.select === this.#s) d = this.#c;
|
|
413
|
+
else try {
|
|
414
|
+
this.#s = t.select, d = t.select(d), d = Qe(i?.data, d, t), this.#c = d, this.#o = null;
|
|
415
|
+
} catch (e) {
|
|
416
|
+
this.#o = e;
|
|
417
|
+
}
|
|
418
|
+
} else d === void 0 && (this.#o = null);
|
|
419
|
+
this.#o && (f = this.#o, d = this.#c, p = Date.now(), m = "error", u = !1);
|
|
420
|
+
let g = l.fetchStatus === "fetching", _ = m === "pending", v = m === "error", y = _ && g, b = d !== void 0;
|
|
421
|
+
return {
|
|
436
422
|
status: m,
|
|
437
423
|
fetchStatus: l.fetchStatus,
|
|
438
424
|
isPending: _,
|
|
@@ -455,44 +441,33 @@ var rt = class extends Le {
|
|
|
455
441
|
isPaused: l.fetchStatus === "paused",
|
|
456
442
|
isPlaceholderData: u,
|
|
457
443
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
444
|
+
isStale: ut(e, t),
|
|
459
445
|
refetch: this.refetch,
|
|
460
|
-
|
|
461
|
-
isEnabled: W(t.enabled, e) !== !1
|
|
446
|
+
isEnabled: U(t.enabled, e) !== !1
|
|
462
447
|
};
|
|
463
|
-
if (this.options.experimental_prefetchInRender) {
|
|
464
|
-
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
465
|
-
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
466
|
-
}, a = () => {
|
|
467
|
-
let e = this.#o = x.promise = Ze();
|
|
468
|
-
i(e);
|
|
469
|
-
}, o = this.#o;
|
|
470
|
-
switch (o.status) {
|
|
471
|
-
case "pending":
|
|
472
|
-
e.queryHash === n.queryHash && i(o);
|
|
473
|
-
break;
|
|
474
|
-
case "fulfilled":
|
|
475
|
-
(r || x.data !== o.value) && a();
|
|
476
|
-
break;
|
|
477
|
-
case "rejected":
|
|
478
|
-
(!r || x.error !== o.reason) && a();
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
return x;
|
|
483
448
|
}
|
|
484
449
|
updateResult() {
|
|
485
450
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
486
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#
|
|
451
|
+
if (this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#l = this.#t), Je(t, e)) return;
|
|
452
|
+
this.#r = t;
|
|
453
|
+
let n = (() => {
|
|
487
454
|
if (!e) return !0;
|
|
488
455
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
489
|
-
if (n === "all" || !n && !this.#
|
|
490
|
-
let r = new Set(n ?? this.#
|
|
456
|
+
if (n === "all" || !n && !this.#p.size) return !0;
|
|
457
|
+
let r = new Set(n ?? this.#p);
|
|
491
458
|
return this.options.throwOnError && r.add("error"), Object.keys(this.#r).some((t) => {
|
|
492
459
|
let n = t;
|
|
493
460
|
return this.#r[n] !== e[n] && r.has(n);
|
|
494
461
|
});
|
|
495
|
-
})()
|
|
462
|
+
})();
|
|
463
|
+
it.batch(() => {
|
|
464
|
+
n && this.listeners.forEach((e) => {
|
|
465
|
+
e(this.#r);
|
|
466
|
+
}), this.#e.getQueryCache().notify({
|
|
467
|
+
query: this.#t,
|
|
468
|
+
type: "observerResultsUpdated"
|
|
469
|
+
});
|
|
470
|
+
});
|
|
496
471
|
}
|
|
497
472
|
#S() {
|
|
498
473
|
let e = this.#e.getQueryCache().build(this.#e, this.options);
|
|
@@ -503,42 +478,29 @@ var rt = class extends Le {
|
|
|
503
478
|
onQueryUpdate() {
|
|
504
479
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
505
480
|
}
|
|
506
|
-
#C(e) {
|
|
507
|
-
J.batch(() => {
|
|
508
|
-
e.listeners && this.listeners.forEach((e) => {
|
|
509
|
-
e(this.#r);
|
|
510
|
-
}), this.#e.getQueryCache().notify({
|
|
511
|
-
query: this.#t,
|
|
512
|
-
type: "observerResultsUpdated"
|
|
513
|
-
});
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
481
|
};
|
|
517
|
-
function
|
|
518
|
-
return
|
|
482
|
+
function st(e, t) {
|
|
483
|
+
return U(t.enabled, e) !== !1 && e.state.data === void 0 && (e.state.status !== "error" || U(t.retryOnMount, e) !== !1);
|
|
519
484
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
485
|
+
function ct(e, t) {
|
|
486
|
+
return st(e, t) || e.state.data !== void 0 && lt(e, t, t.refetchOnMount);
|
|
522
487
|
}
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
488
|
+
function lt(e, t, n) {
|
|
489
|
+
if (U(t.enabled, e) !== !1 && U(t.staleTime, e) !== "static") {
|
|
525
490
|
let r = typeof n == "function" ? n(e) : n;
|
|
526
|
-
return r === "always" || r !== !1 &&
|
|
491
|
+
return r === "always" || r !== !1 && ut(e, t);
|
|
527
492
|
}
|
|
528
493
|
return !1;
|
|
529
494
|
}
|
|
530
|
-
function
|
|
531
|
-
return (e !== t ||
|
|
532
|
-
}
|
|
533
|
-
function ct(e, t) {
|
|
534
|
-
return W(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
|
|
495
|
+
function J(e, t, n, r) {
|
|
496
|
+
return (e !== t || U(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
|
|
535
497
|
}
|
|
536
|
-
function
|
|
537
|
-
return
|
|
498
|
+
function ut(e, t) {
|
|
499
|
+
return U(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
|
|
538
500
|
}
|
|
539
501
|
//#endregion
|
|
540
502
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
541
|
-
function
|
|
503
|
+
function Y() {
|
|
542
504
|
return {
|
|
543
505
|
context: void 0,
|
|
544
506
|
data: void 0,
|
|
@@ -553,7 +515,7 @@ function lt() {
|
|
|
553
515
|
}
|
|
554
516
|
//#endregion
|
|
555
517
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
556
|
-
var
|
|
518
|
+
var dt = class extends W {
|
|
557
519
|
#e;
|
|
558
520
|
#t = void 0;
|
|
559
521
|
#n;
|
|
@@ -566,11 +528,14 @@ var ut = class extends Le {
|
|
|
566
528
|
}
|
|
567
529
|
setOptions(e) {
|
|
568
530
|
let t = this.options;
|
|
569
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
531
|
+
this.options = this.#e.defaultMutationOptions(e), Je(this.options, t) || this.#e.getMutationCache().notify({
|
|
570
532
|
type: "observerOptionsUpdated",
|
|
571
533
|
mutation: this.#n,
|
|
572
534
|
observer: this
|
|
573
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
535
|
+
}), t?.mutationKey && this.options.mutationKey && Ge(t.mutationKey) !== Ge(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
536
|
+
}
|
|
537
|
+
onSubscribe() {
|
|
538
|
+
this.listeners.size === 1 && this.#n && (this.#n.addObserver(this), this.#i());
|
|
574
539
|
}
|
|
575
540
|
onUnsubscribe() {
|
|
576
541
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -588,7 +553,7 @@ var ut = class extends Le {
|
|
|
588
553
|
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
554
|
}
|
|
590
555
|
#i() {
|
|
591
|
-
let e = this.#n?.state ??
|
|
556
|
+
let e = this.#n?.state ?? Y();
|
|
592
557
|
this.#t = {
|
|
593
558
|
...e,
|
|
594
559
|
isPending: e.status === "pending",
|
|
@@ -600,7 +565,7 @@ var ut = class extends Le {
|
|
|
600
565
|
};
|
|
601
566
|
}
|
|
602
567
|
#a(e) {
|
|
603
|
-
|
|
568
|
+
it.batch(() => {
|
|
604
569
|
if (this.#r && this.hasListeners()) {
|
|
605
570
|
let t = this.#t.variables, n = this.#t.context, r = {
|
|
606
571
|
client: this.#e,
|
|
@@ -636,21 +601,11 @@ var ut = class extends Le {
|
|
|
636
601
|
});
|
|
637
602
|
});
|
|
638
603
|
}
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
if (t) return t;
|
|
642
|
-
if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
|
|
643
|
-
return n;
|
|
644
|
-
}, pt = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
645
|
-
t.unmount();
|
|
646
|
-
}), [t]), /* @__PURE__ */ p(dt.Provider, {
|
|
647
|
-
value: t,
|
|
648
|
-
children: n
|
|
649
|
-
})), mt = e.createContext(!1), ht = () => e.useContext(mt);
|
|
650
|
-
mt.Provider;
|
|
604
|
+
}, ft = e.createContext(!1), pt = () => e.useContext(ft);
|
|
605
|
+
ft.Provider;
|
|
651
606
|
//#endregion
|
|
652
607
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
653
|
-
function
|
|
608
|
+
function mt() {
|
|
654
609
|
let e = !1;
|
|
655
610
|
return {
|
|
656
611
|
clearReset: () => {
|
|
@@ -662,65 +617,61 @@ function gt() {
|
|
|
662
617
|
isReset: () => e
|
|
663
618
|
};
|
|
664
619
|
}
|
|
665
|
-
var
|
|
666
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
667
|
-
(e.suspense ||
|
|
668
|
-
},
|
|
620
|
+
var ht = e.createContext(mt()), gt = () => e.useContext(ht), _t = (e, t, n) => {
|
|
621
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? $e(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
622
|
+
(e.suspense || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
623
|
+
}, vt = (t) => {
|
|
669
624
|
e.useEffect(() => {
|
|
670
625
|
t.clearReset();
|
|
671
626
|
}, [t]);
|
|
672
|
-
},
|
|
627
|
+
}, yt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || $e(n, [e.error, r])), bt = (e) => {
|
|
673
628
|
if (e.suspense) {
|
|
674
629
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
675
630
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
676
631
|
}
|
|
677
|
-
},
|
|
632
|
+
}, xt = (e, t) => e?.suspense && t.isPending, St = (e, t, n) => t.fetchOptimistic(e).catch(() => {
|
|
678
633
|
n.clearReset();
|
|
679
634
|
});
|
|
680
635
|
//#endregion
|
|
681
636
|
//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
682
|
-
function
|
|
637
|
+
function Ct(t, n, r) {
|
|
683
638
|
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");
|
|
684
|
-
let i =
|
|
685
|
-
o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
|
|
686
|
-
let c = o.getQueryCache().get(s.queryHash);
|
|
639
|
+
let i = pt(), a = gt(), o = Le(r), s = o.defaultQueryOptions(t), c = o.getQueryCache().get(s.queryHash);
|
|
687
640
|
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`));
|
|
688
641
|
let l = t.subscribed !== !1;
|
|
689
|
-
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0,
|
|
690
|
-
let u
|
|
642
|
+
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, bt(s), _t(s, a, c), vt(a);
|
|
643
|
+
let [u] = e.useState(() => new n(o, s)), d = u.getOptimisticResult(s), f = !i && l;
|
|
691
644
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
692
|
-
let t =
|
|
693
|
-
return
|
|
694
|
-
}, [
|
|
695
|
-
|
|
696
|
-
}, [s,
|
|
697
|
-
if (
|
|
698
|
-
result:
|
|
645
|
+
let t = f ? u.subscribe(it.batchCalls(e)) : He;
|
|
646
|
+
return u.updateResult(), t;
|
|
647
|
+
}, [u, f]), () => u.getCurrentResult(), () => u.getCurrentResult()), e.useEffect(() => {
|
|
648
|
+
u.setOptions(s);
|
|
649
|
+
}, [s, u]), xt(s, d)) throw St(s, u, a);
|
|
650
|
+
if (yt({
|
|
651
|
+
result: d,
|
|
699
652
|
errorResetBoundary: a,
|
|
700
653
|
throwOnError: s.throwOnError,
|
|
701
654
|
query: c,
|
|
702
655
|
suspense: s.suspense
|
|
703
|
-
})) throw
|
|
704
|
-
return
|
|
705
|
-
d.updateResult();
|
|
706
|
-
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
656
|
+
})) throw d.error;
|
|
657
|
+
return s.notifyOnChangeProps ? d : u.trackResult(d);
|
|
707
658
|
}
|
|
708
659
|
//#endregion
|
|
709
660
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
710
|
-
function
|
|
711
|
-
return
|
|
661
|
+
function wt(e, t) {
|
|
662
|
+
return Ct(e, ot, t);
|
|
712
663
|
}
|
|
713
664
|
//#endregion
|
|
714
665
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
715
|
-
function
|
|
716
|
-
let r =
|
|
666
|
+
function Tt(t, n) {
|
|
667
|
+
let r = Le(n), [i] = e.useState(() => new dt(r, t));
|
|
717
668
|
e.useEffect(() => {
|
|
718
669
|
i.setOptions(t);
|
|
719
670
|
}, [i, t]);
|
|
720
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
721
|
-
i.mutate(e,
|
|
671
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(it.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((...e) => {
|
|
672
|
+
i.mutate(e[0], e[1]).catch(He);
|
|
722
673
|
}, [i]);
|
|
723
|
-
if (a.error &&
|
|
674
|
+
if (a.error && $e(i.options.throwOnError, [a.error])) throw a.error;
|
|
724
675
|
return {
|
|
725
676
|
...a,
|
|
726
677
|
mutate: o,
|
|
@@ -729,15 +680,15 @@ function Ot(t, n) {
|
|
|
729
680
|
}
|
|
730
681
|
//#endregion
|
|
731
682
|
//#region src/Context/DataTableContext.tsx
|
|
732
|
-
var
|
|
733
|
-
function
|
|
734
|
-
return /* @__PURE__ */ p(
|
|
683
|
+
var Et = r(void 0), Dt = async () => ({ "Content-Type": "application/json" });
|
|
684
|
+
function Ot({ children: e, baseUrl: t, queryClient: n, getHeaders: r = Dt }) {
|
|
685
|
+
return /* @__PURE__ */ p(Et.Provider, {
|
|
735
686
|
value: {
|
|
736
687
|
baseUrl: t,
|
|
737
688
|
queryClient: n,
|
|
738
689
|
getHeaders: r
|
|
739
690
|
},
|
|
740
|
-
children: /* @__PURE__ */ p(
|
|
691
|
+
children: /* @__PURE__ */ p(Re, {
|
|
741
692
|
client: n,
|
|
742
693
|
children: e
|
|
743
694
|
})
|
|
@@ -745,176 +696,176 @@ function jt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = At }) {
|
|
|
745
696
|
}
|
|
746
697
|
//#endregion
|
|
747
698
|
//#region src/Hooks/useDataTable.ts
|
|
748
|
-
function
|
|
749
|
-
let e = o(
|
|
699
|
+
function kt() {
|
|
700
|
+
let e = o(Et);
|
|
750
701
|
if (!e) throw Error("useDataTable must be used within a DataTableProvider");
|
|
751
702
|
return e;
|
|
752
703
|
}
|
|
753
704
|
//#endregion
|
|
754
705
|
//#region src/Hooks/useApi.ts
|
|
755
|
-
var
|
|
706
|
+
var At = class extends Error {
|
|
756
707
|
status;
|
|
757
708
|
violations;
|
|
758
709
|
constructor(e, t, n) {
|
|
759
710
|
super(e), this.name = "ApiError", this.status = t, this.violations = n;
|
|
760
711
|
}
|
|
761
712
|
};
|
|
762
|
-
function
|
|
763
|
-
return e instanceof
|
|
713
|
+
function jt(e) {
|
|
714
|
+
return e instanceof At ? e.violations : void 0;
|
|
764
715
|
}
|
|
765
|
-
async function
|
|
716
|
+
async function Mt(e, t) {
|
|
766
717
|
let n = await fetch(e, t);
|
|
767
718
|
if (n.status >= 400) {
|
|
768
719
|
let e = await n.text();
|
|
769
|
-
if (!e) throw new
|
|
720
|
+
if (!e) throw new At(`HTTP ${n.status}: ${n.statusText}`, n.status);
|
|
770
721
|
let t = null;
|
|
771
722
|
try {
|
|
772
723
|
t = JSON.parse(e);
|
|
773
724
|
} catch {
|
|
774
|
-
throw new
|
|
725
|
+
throw new At(e, n.status);
|
|
775
726
|
}
|
|
776
727
|
let r = Array.isArray(t?.violations) ? t.violations.filter((e) => e?.field && e?.message).map((e) => ({
|
|
777
728
|
field: String(e.field),
|
|
778
729
|
message: String(e.message)
|
|
779
730
|
})) : void 0;
|
|
780
|
-
throw new
|
|
731
|
+
throw new At(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
|
|
781
732
|
}
|
|
782
733
|
return n;
|
|
783
734
|
}
|
|
784
|
-
var
|
|
785
|
-
async function
|
|
786
|
-
return (await
|
|
735
|
+
var Nt = (e) => e.map((e) => e.toString());
|
|
736
|
+
async function Pt(e, t) {
|
|
737
|
+
return (await Mt(e, {
|
|
787
738
|
method: "GET",
|
|
788
739
|
headers: await t()
|
|
789
740
|
})).json();
|
|
790
741
|
}
|
|
791
|
-
async function
|
|
792
|
-
return (await
|
|
742
|
+
async function Ft(e, t, n) {
|
|
743
|
+
return (await Mt(`${e}/${t}`, {
|
|
793
744
|
method: "GET",
|
|
794
745
|
headers: await n()
|
|
795
746
|
})).json();
|
|
796
747
|
}
|
|
797
|
-
async function
|
|
798
|
-
await
|
|
748
|
+
async function It(e, t, n) {
|
|
749
|
+
await Mt(`${e}/${t}`, {
|
|
799
750
|
method: "DELETE",
|
|
800
751
|
headers: await n()
|
|
801
752
|
});
|
|
802
753
|
}
|
|
803
|
-
async function
|
|
804
|
-
let r = await
|
|
754
|
+
async function Lt(e, t, n) {
|
|
755
|
+
let r = await Mt(e, {
|
|
805
756
|
method: "POST",
|
|
806
757
|
headers: await n(),
|
|
807
758
|
body: JSON.stringify(t)
|
|
808
759
|
});
|
|
809
760
|
return r.status === 204 ? t : r.json();
|
|
810
761
|
}
|
|
811
|
-
async function
|
|
812
|
-
let i = await
|
|
762
|
+
async function Rt(e, t, n, r) {
|
|
763
|
+
let i = await Mt(t, {
|
|
813
764
|
method: e,
|
|
814
765
|
headers: await n(),
|
|
815
766
|
body: r ? JSON.stringify(r) : void 0
|
|
816
767
|
});
|
|
817
768
|
if (i.status !== 204) return i.json();
|
|
818
769
|
}
|
|
819
|
-
async function
|
|
820
|
-
let r = await
|
|
770
|
+
async function zt(e, t, n) {
|
|
771
|
+
let r = await Mt(`${e}/${t.id}`, {
|
|
821
772
|
method: "PUT",
|
|
822
773
|
headers: await n(),
|
|
823
774
|
body: JSON.stringify(t)
|
|
824
775
|
});
|
|
825
776
|
return r.status === 204 ? t : r.json();
|
|
826
777
|
}
|
|
827
|
-
function
|
|
828
|
-
let { baseUrl: r, getHeaders: i } =
|
|
829
|
-
return
|
|
830
|
-
queryKey: [...
|
|
831
|
-
queryFn: () =>
|
|
778
|
+
function Bt(e, t, n) {
|
|
779
|
+
let { baseUrl: r, getHeaders: i } = kt();
|
|
780
|
+
return wt({
|
|
781
|
+
queryKey: [...Nt(t), String(n?.toString())],
|
|
782
|
+
queryFn: () => Ft(`${r}${e}`, n, i),
|
|
832
783
|
enabled: !!n
|
|
833
784
|
});
|
|
834
785
|
}
|
|
835
|
-
function
|
|
836
|
-
let { baseUrl: r, getHeaders: i } =
|
|
837
|
-
return
|
|
838
|
-
queryKey:
|
|
839
|
-
queryFn: () =>
|
|
786
|
+
function Vt(e, t, n = !0) {
|
|
787
|
+
let { baseUrl: r, getHeaders: i } = kt();
|
|
788
|
+
return wt({
|
|
789
|
+
queryKey: Nt(t),
|
|
790
|
+
queryFn: () => Pt(`${r}${e}`, i),
|
|
840
791
|
enabled: n
|
|
841
792
|
});
|
|
842
793
|
}
|
|
843
|
-
function
|
|
844
|
-
return Promise.all([e.invalidateQueries({ queryKey:
|
|
845
|
-
}
|
|
846
|
-
function Kt(e, t, n) {
|
|
847
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } = Mt();
|
|
848
|
-
return Ot({
|
|
849
|
-
mutationKey: It(t),
|
|
850
|
-
mutationFn: (t) => Bt(`${r}${e}`, t, a),
|
|
851
|
-
onSettled: () => Gt(i, t, n)
|
|
852
|
-
});
|
|
794
|
+
function Ht(e, t, n) {
|
|
795
|
+
return Promise.all([e.invalidateQueries({ queryKey: Nt(t) }), ...(n ?? []).map((t) => e.invalidateQueries({ queryKey: t }))]);
|
|
853
796
|
}
|
|
854
|
-
function
|
|
855
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } =
|
|
856
|
-
return
|
|
857
|
-
mutationKey:
|
|
858
|
-
mutationFn: (t) =>
|
|
859
|
-
onSettled: () =>
|
|
797
|
+
function Ut(e, t, n) {
|
|
798
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
|
|
799
|
+
return Tt({
|
|
800
|
+
mutationKey: Nt(t),
|
|
801
|
+
mutationFn: (t) => Lt(`${r}${e}`, t, a),
|
|
802
|
+
onSettled: () => Ht(i, t, n)
|
|
860
803
|
});
|
|
861
804
|
}
|
|
862
|
-
function
|
|
863
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } =
|
|
864
|
-
return
|
|
865
|
-
mutationKey:
|
|
805
|
+
function Wt(e, t, n) {
|
|
806
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
|
|
807
|
+
return Tt({
|
|
808
|
+
mutationKey: Nt(t),
|
|
866
809
|
mutationFn: (t) => zt(`${r}${e}`, t, a),
|
|
867
|
-
onSettled: () =>
|
|
810
|
+
onSettled: () => Ht(i, t, n)
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
function Gt(e, t, n) {
|
|
814
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = kt();
|
|
815
|
+
return Tt({
|
|
816
|
+
mutationKey: Nt(t),
|
|
817
|
+
mutationFn: (t) => It(`${r}${e}`, t, a),
|
|
818
|
+
onSettled: () => Ht(i, t, n)
|
|
868
819
|
});
|
|
869
820
|
}
|
|
870
821
|
//#endregion
|
|
871
822
|
//#region src/DataTable/EntityForm.tsx
|
|
872
|
-
function
|
|
823
|
+
function Kt(e, t) {
|
|
873
824
|
return typeof e.required == "function" ? e.required(t) : !!e.required;
|
|
874
825
|
}
|
|
875
|
-
function
|
|
826
|
+
function qt(e) {
|
|
876
827
|
return e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {});
|
|
877
828
|
}
|
|
878
|
-
function
|
|
879
|
-
return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !
|
|
829
|
+
function Jt(e) {
|
|
830
|
+
return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !Kt(t, n) || e ? null : "Pflichtfeld", e), {});
|
|
880
831
|
}
|
|
881
|
-
function
|
|
832
|
+
function Yt(e) {
|
|
882
833
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
|
|
883
834
|
}
|
|
884
|
-
function
|
|
835
|
+
function Xt(e, t) {
|
|
885
836
|
let n = { ...e };
|
|
886
837
|
return t.forEach((e) => {
|
|
887
838
|
let t = e.id;
|
|
888
839
|
e.type === "boolean" && n[t] === null ? n[t] = !1 : e.type === "date" && n[t] ? n[t] = new Date(n[t]) : n[t] === null && (n[t] = "");
|
|
889
840
|
}), n;
|
|
890
841
|
}
|
|
891
|
-
var
|
|
892
|
-
function
|
|
893
|
-
return Object.fromEntries((
|
|
842
|
+
var Zt = (e) => e.split(".").pop() ?? e;
|
|
843
|
+
function Qt(e, t) {
|
|
844
|
+
return Object.fromEntries((jt(e) ?? []).filter((e) => t.has(Zt(e.field))).map((e) => [Zt(e.field), e.message]));
|
|
894
845
|
}
|
|
895
|
-
function
|
|
896
|
-
let n =
|
|
846
|
+
function $t(e, t) {
|
|
847
|
+
let n = jt(e);
|
|
897
848
|
if (!n) return e?.message;
|
|
898
|
-
let r = n.filter((e) => !t.has(
|
|
849
|
+
let r = n.filter((e) => !t.has(Zt(e.field)));
|
|
899
850
|
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
900
851
|
}
|
|
901
|
-
function
|
|
902
|
-
let [u, h] = d(0), [g, v] = d(!1), b =
|
|
852
|
+
function en({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
853
|
+
let [u, h] = d(0), [g, v] = d(!1), b = ye({
|
|
903
854
|
mode: "uncontrolled",
|
|
904
|
-
initialValues:
|
|
905
|
-
validate:
|
|
855
|
+
initialValues: qt(e),
|
|
856
|
+
validate: Jt(e)
|
|
906
857
|
});
|
|
907
858
|
s(() => {
|
|
908
859
|
if (r) {
|
|
909
|
-
let t =
|
|
860
|
+
let t = Xt(r, e);
|
|
910
861
|
b.initialize(t), b.setValues(t);
|
|
911
862
|
}
|
|
912
863
|
}, [r]);
|
|
913
|
-
let S = new Set(e.map((e) => String(e.id))), C =
|
|
864
|
+
let S = new Set(e.map((e) => String(e.id))), C = $t(o, S), w = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], E = w.length > 0, D = u === w.length - 1;
|
|
914
865
|
function O(e) {
|
|
915
866
|
let t = b.getValues();
|
|
916
867
|
if (e.conditional && !e.conditional(t)) return null;
|
|
917
|
-
let n =
|
|
868
|
+
let n = Kt(e, t), r = b.getInputProps(e.id);
|
|
918
869
|
switch (e.type) {
|
|
919
870
|
case "number": return /* @__PURE__ */ p(P, {
|
|
920
871
|
decimalSeparator: ",",
|
|
@@ -924,7 +875,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
924
875
|
required: n,
|
|
925
876
|
...r
|
|
926
877
|
}, b.key(e.id));
|
|
927
|
-
case "date": return /* @__PURE__ */ p(
|
|
878
|
+
case "date": return /* @__PURE__ */ p(ve, {
|
|
928
879
|
valueFormat: "DD.MM.YYYY",
|
|
929
880
|
clearable: !0,
|
|
930
881
|
label: e.column.title,
|
|
@@ -938,7 +889,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
938
889
|
required: n,
|
|
939
890
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
940
891
|
}, b.key(e.id));
|
|
941
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
892
|
+
case "textarea": return /* @__PURE__ */ p(de, {
|
|
942
893
|
minRows: 3,
|
|
943
894
|
autosize: !0,
|
|
944
895
|
label: e.column.title,
|
|
@@ -953,7 +904,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
953
904
|
error: r.error,
|
|
954
905
|
required: n
|
|
955
906
|
});
|
|
956
|
-
default: return /* @__PURE__ */ p(
|
|
907
|
+
default: return /* @__PURE__ */ p(ue, {
|
|
957
908
|
type: e.id.includes("email") ? "email" : void 0,
|
|
958
909
|
label: e.column.title,
|
|
959
910
|
placeholder: e.placeholder ?? "",
|
|
@@ -971,20 +922,20 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
971
922
|
children: C
|
|
972
923
|
}), /* @__PURE__ */ m("form", {
|
|
973
924
|
onSubmit: b.onSubmit(async (e) => {
|
|
974
|
-
let t =
|
|
925
|
+
let t = Yt(e);
|
|
975
926
|
try {
|
|
976
927
|
await c(t);
|
|
977
928
|
} catch (e) {
|
|
978
|
-
let t =
|
|
929
|
+
let t = Qt(e, S);
|
|
979
930
|
Object.keys(t).length > 0 && b.setErrors(t);
|
|
980
931
|
return;
|
|
981
932
|
}
|
|
982
933
|
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
983
934
|
}),
|
|
984
|
-
children: [E ? /* @__PURE__ */ p(
|
|
935
|
+
children: [E ? /* @__PURE__ */ p(ie, {
|
|
985
936
|
active: u,
|
|
986
937
|
size: "sm",
|
|
987
|
-
children: w.map((e) => /* @__PURE__ */ p(
|
|
938
|
+
children: w.map((e) => /* @__PURE__ */ p(ie.Step, {
|
|
988
939
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
989
940
|
children: k(e)
|
|
990
941
|
}, e))
|
|
@@ -1005,9 +956,9 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
1005
956
|
}
|
|
1006
957
|
//#endregion
|
|
1007
958
|
//#region src/DataTable/CreateModal.tsx
|
|
1008
|
-
function
|
|
1009
|
-
let [s, c] = d(), { mutateAsync: l, isPending: u, error: f } =
|
|
1010
|
-
return /* @__PURE__ */ p(
|
|
959
|
+
function tn({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, steps: a, onCreated: o }) {
|
|
960
|
+
let [s, c] = d(), { mutateAsync: l, isPending: u, error: f } = Ut(i, n, r), { mutateAsync: m, isPending: h, error: g } = Wt(i, n, r);
|
|
961
|
+
return /* @__PURE__ */ p(en, {
|
|
1011
962
|
fields: e,
|
|
1012
963
|
steps: a,
|
|
1013
964
|
recordId: s,
|
|
@@ -1028,28 +979,30 @@ function an({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath
|
|
|
1028
979
|
}
|
|
1029
980
|
//#endregion
|
|
1030
981
|
//#region node_modules/clsx/dist/clsx.mjs
|
|
1031
|
-
function
|
|
982
|
+
function nn(e) {
|
|
1032
983
|
var t, n, r = "";
|
|
1033
984
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1034
|
-
else if (typeof e == "object")
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
985
|
+
else if (typeof e == "object") {
|
|
986
|
+
if (Array.isArray(e)) {
|
|
987
|
+
var i = e.length;
|
|
988
|
+
for (t = 0; t < i; t++) e[t] && (n = nn(e[t])) && (r && (r += " "), r += n);
|
|
989
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
990
|
+
}
|
|
1038
991
|
return r;
|
|
1039
992
|
}
|
|
1040
993
|
function X() {
|
|
1041
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
994
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = nn(e)) && (r && (r += " "), r += t);
|
|
1042
995
|
return r;
|
|
1043
996
|
}
|
|
1044
997
|
//#endregion
|
|
1045
998
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1046
999
|
function Z(e, t, n) {
|
|
1047
|
-
return e ?
|
|
1000
|
+
return e ? me({
|
|
1048
1001
|
color: typeof e == "object" ? e[n] : e,
|
|
1049
1002
|
theme: t
|
|
1050
1003
|
}).value : void 0;
|
|
1051
1004
|
}
|
|
1052
|
-
function
|
|
1005
|
+
function rn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
1053
1006
|
return {
|
|
1054
1007
|
"--mantine-datatable-color-light": Z(t, e, "light"),
|
|
1055
1008
|
"--mantine-datatable-color-dark": Z(t, e, "dark"),
|
|
@@ -1065,7 +1018,7 @@ function sn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor
|
|
|
1065
1018
|
"--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
|
|
1066
1019
|
};
|
|
1067
1020
|
}
|
|
1068
|
-
function
|
|
1021
|
+
function an({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
1069
1022
|
return {
|
|
1070
1023
|
"--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
|
|
1071
1024
|
"--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
|
|
@@ -1073,7 +1026,7 @@ function cn({ theme: e, paginationActiveTextColor: t, paginationActiveBackground
|
|
|
1073
1026
|
"--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
|
|
1074
1027
|
};
|
|
1075
1028
|
}
|
|
1076
|
-
function
|
|
1029
|
+
function on({ theme: e, color: t, backgroundColor: n }) {
|
|
1077
1030
|
return {
|
|
1078
1031
|
"--mantine-datatable-row-color-light": Z(t, e, "light"),
|
|
1079
1032
|
"--mantine-datatable-row-color-dark": Z(t, e, "dark"),
|
|
@@ -1081,9 +1034,9 @@ function ln({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1081
1034
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1082
1035
|
};
|
|
1083
1036
|
}
|
|
1084
|
-
var [
|
|
1037
|
+
var [sn, cn] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), ln = (e) => {
|
|
1085
1038
|
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("");
|
|
1086
|
-
return p(
|
|
1039
|
+
return p(sn, {
|
|
1087
1040
|
value: {
|
|
1088
1041
|
sourceColumn: y,
|
|
1089
1042
|
setSourceColumn: b,
|
|
@@ -1115,13 +1068,13 @@ var [un, dn] = me("useDataTableColumnsContext must be used within DataTableColum
|
|
|
1115
1068
|
children: t
|
|
1116
1069
|
});
|
|
1117
1070
|
};
|
|
1118
|
-
function
|
|
1071
|
+
function un() {
|
|
1119
1072
|
return p("tr", {
|
|
1120
1073
|
className: "mantine-datatable-empty-row",
|
|
1121
1074
|
children: p("td", {})
|
|
1122
1075
|
});
|
|
1123
1076
|
}
|
|
1124
|
-
function
|
|
1077
|
+
function dn() {
|
|
1125
1078
|
return m("svg", {
|
|
1126
1079
|
width: "24",
|
|
1127
1080
|
height: "24",
|
|
@@ -1144,14 +1097,14 @@ function mn() {
|
|
|
1144
1097
|
]
|
|
1145
1098
|
});
|
|
1146
1099
|
}
|
|
1147
|
-
function
|
|
1100
|
+
function fn({ icon: e, text: t, active: n, children: r }) {
|
|
1148
1101
|
return p(b, {
|
|
1149
1102
|
className: "mantine-datatable-empty-state",
|
|
1150
1103
|
"data-active": n || void 0,
|
|
1151
1104
|
children: r || m(f, { children: [e || p("div", {
|
|
1152
1105
|
className: "mantine-datatable-empty-state-icon",
|
|
1153
|
-
children: p(
|
|
1154
|
-
}), p(
|
|
1106
|
+
children: p(dn, {})
|
|
1107
|
+
}), p(V, {
|
|
1155
1108
|
component: "div",
|
|
1156
1109
|
size: "sm",
|
|
1157
1110
|
c: "dimmed",
|
|
@@ -1159,59 +1112,59 @@ function hn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1159
1112
|
})] })
|
|
1160
1113
|
});
|
|
1161
1114
|
}
|
|
1162
|
-
function
|
|
1115
|
+
function pn(e) {
|
|
1163
1116
|
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1164
1117
|
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1165
1118
|
}
|
|
1166
|
-
function
|
|
1119
|
+
function mn(e, t, n) {
|
|
1167
1120
|
return !Array.isArray(e) || n && !e.every(n) ? t : e;
|
|
1168
1121
|
}
|
|
1169
|
-
function
|
|
1122
|
+
function hn(e) {
|
|
1170
1123
|
return typeof e == "object" && !!e && typeof e.accessor == "string";
|
|
1171
1124
|
}
|
|
1172
|
-
function
|
|
1125
|
+
function gn(e, t, n) {
|
|
1173
1126
|
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1174
1127
|
}
|
|
1175
|
-
function
|
|
1128
|
+
function _n(e, t) {
|
|
1176
1129
|
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1177
1130
|
}
|
|
1178
|
-
function
|
|
1131
|
+
function vn(e, t) {
|
|
1179
1132
|
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1180
1133
|
}
|
|
1181
1134
|
function Q(e, t) {
|
|
1182
|
-
return typeof t == "string" ?
|
|
1135
|
+
return typeof t == "string" ? vn(e, t) : t(e);
|
|
1183
1136
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 +
|
|
1137
|
+
function yn(e) {
|
|
1138
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + yn(e.groups) : 1));
|
|
1186
1139
|
}
|
|
1187
|
-
function
|
|
1140
|
+
function bn(e) {
|
|
1188
1141
|
let t = [];
|
|
1189
|
-
for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...
|
|
1142
|
+
for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...bn(n.groups));
|
|
1190
1143
|
return t.filter((e) => e != null);
|
|
1191
1144
|
}
|
|
1192
|
-
function
|
|
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 +
|
|
1145
|
+
function xn(e, t) {
|
|
1146
|
+
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 + xn(n, t), 0) : 0;
|
|
1194
1147
|
}
|
|
1195
|
-
function
|
|
1148
|
+
function Sn(e, t, n = 0) {
|
|
1196
1149
|
if (n === t) return [...e];
|
|
1197
1150
|
let r = [];
|
|
1198
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...
|
|
1151
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...Sn(i.groups, t, n + 1));
|
|
1199
1152
|
return r;
|
|
1200
1153
|
}
|
|
1201
|
-
function
|
|
1154
|
+
function Cn(e, t, n) {
|
|
1202
1155
|
return n ? !e || t : !1;
|
|
1203
1156
|
}
|
|
1204
|
-
function
|
|
1157
|
+
function wn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1205
1158
|
let r = l(() => t.map((e) => ({
|
|
1206
1159
|
accessor: e.accessor,
|
|
1207
1160
|
defaultPinned: e.pinned,
|
|
1208
1161
|
pinnable: !!e.pinnable,
|
|
1209
1162
|
pinned: e.pinned
|
|
1210
|
-
})), [t]), [i, a] =
|
|
1163
|
+
})), [t]), [i, a] = Me({
|
|
1211
1164
|
key: e ? `${e}-columns-pinning` : "",
|
|
1212
1165
|
defaultValue: e ? r : void 0,
|
|
1213
1166
|
getInitialValueInEffect: n
|
|
1214
|
-
}), o =
|
|
1167
|
+
}), o = mn(i, r, hn);
|
|
1215
1168
|
function c(t) {
|
|
1216
1169
|
e && a(typeof t == "function" ? (e) => t(e ?? r) : t);
|
|
1217
1170
|
}
|
|
@@ -1254,12 +1207,12 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1254
1207
|
resetColumnsPinning: d
|
|
1255
1208
|
};
|
|
1256
1209
|
}
|
|
1257
|
-
function
|
|
1258
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1210
|
+
function Tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1211
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = Me({
|
|
1259
1212
|
key: e ? `${e}-columns-order` : "",
|
|
1260
1213
|
defaultValue: e ? r : void 0,
|
|
1261
1214
|
getInitialValueInEffect: n
|
|
1262
|
-
}), o =
|
|
1215
|
+
}), o = mn(i, r, (e) => typeof e == "string");
|
|
1263
1216
|
function c(t) {
|
|
1264
1217
|
e && a(t);
|
|
1265
1218
|
}
|
|
@@ -1297,12 +1250,12 @@ function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1297
1250
|
resetColumnsOrder: d
|
|
1298
1251
|
};
|
|
1299
1252
|
}
|
|
1300
|
-
function
|
|
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] =
|
|
1253
|
+
function En({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1254
|
+
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] = Me({
|
|
1302
1255
|
key: e ? `${e}-columns-width` : "",
|
|
1303
1256
|
defaultValue: e ? o() : void 0,
|
|
1304
1257
|
getInitialValueInEffect: n
|
|
1305
|
-
}), p =
|
|
1258
|
+
}), p = mn(c, [], (e) => typeof e == "object" && !!e), [m, h] = d(() => e && p.length > 0 ? p : o()), [g, _] = d(!1), v = u(!1);
|
|
1306
1259
|
s(() => {
|
|
1307
1260
|
e && (!p || p.length === 0 || h(p));
|
|
1308
1261
|
}, [e, p]), s(() => {
|
|
@@ -1386,17 +1339,17 @@ function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1386
1339
|
endResize: C
|
|
1387
1340
|
};
|
|
1388
1341
|
}
|
|
1389
|
-
function
|
|
1342
|
+
function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1390
1343
|
let r = l(() => t?.map((e) => ({
|
|
1391
1344
|
accessor: e.accessor,
|
|
1392
1345
|
defaultToggle: e.defaultToggle || !0,
|
|
1393
1346
|
toggleable: e.toggleable,
|
|
1394
1347
|
toggled: e.defaultToggle === void 0 || e.defaultToggle
|
|
1395
|
-
})), [t]), [i, a] =
|
|
1348
|
+
})), [t]), [i, a] = Me({
|
|
1396
1349
|
key: e ? `${e}-columns-toggle` : "",
|
|
1397
1350
|
defaultValue: e ? r : void 0,
|
|
1398
1351
|
getInitialValueInEffect: n
|
|
1399
|
-
}), o =
|
|
1352
|
+
}), o = mn(i, r, hn);
|
|
1400
1353
|
function c(t) {
|
|
1401
1354
|
e && a(t);
|
|
1402
1355
|
}
|
|
@@ -1439,20 +1392,20 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1439
1392
|
resetColumnsToggle: d
|
|
1440
1393
|
};
|
|
1441
1394
|
}
|
|
1442
|
-
var
|
|
1443
|
-
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } =
|
|
1395
|
+
var On = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1396
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = Tn({
|
|
1444
1397
|
key: e,
|
|
1445
1398
|
columns: t,
|
|
1446
1399
|
getInitialValueInEffect: n
|
|
1447
|
-
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } =
|
|
1400
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = Dn({
|
|
1448
1401
|
key: e,
|
|
1449
1402
|
columns: t,
|
|
1450
1403
|
getInitialValueInEffect: n
|
|
1451
|
-
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } =
|
|
1404
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = wn({
|
|
1452
1405
|
key: e,
|
|
1453
1406
|
columns: t,
|
|
1454
1407
|
getInitialValueInEffect: n
|
|
1455
|
-
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } =
|
|
1408
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = En({
|
|
1456
1409
|
key: e,
|
|
1457
1410
|
columns: t,
|
|
1458
1411
|
getInitialValueInEffect: n,
|
|
@@ -1529,16 +1482,16 @@ var jn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1529
1482
|
beginResize: w,
|
|
1530
1483
|
endResize: T
|
|
1531
1484
|
};
|
|
1532
|
-
},
|
|
1533
|
-
function
|
|
1485
|
+
}, kn = typeof window < "u" ? c : s;
|
|
1486
|
+
function An(e) {
|
|
1534
1487
|
let t = u(e);
|
|
1535
1488
|
return t.current = e, t;
|
|
1536
1489
|
}
|
|
1537
|
-
var
|
|
1490
|
+
var jn = "--mantine-datatable-header-height", Mn = "--mantine-datatable-footer-height", Nn = "--mantine-datatable-selection-column-width", Pn = "--mantine-datatable-last-row-border-bottom";
|
|
1538
1491
|
function $(e, t, n) {
|
|
1539
1492
|
e?.style.setProperty(t, n);
|
|
1540
1493
|
}
|
|
1541
|
-
function
|
|
1494
|
+
function Fn(e) {
|
|
1542
1495
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1543
1496
|
return t ? {
|
|
1544
1497
|
width: t.inlineSize,
|
|
@@ -1548,18 +1501,18 @@ function Rn(e) {
|
|
|
1548
1501
|
height: e.contentRect.height
|
|
1549
1502
|
};
|
|
1550
1503
|
}
|
|
1551
|
-
function
|
|
1504
|
+
function In(e, t, n) {
|
|
1552
1505
|
if (e) {
|
|
1553
1506
|
let r = new ResizeObserver((e) => {
|
|
1554
1507
|
let n = e[0];
|
|
1555
|
-
n && t(
|
|
1508
|
+
n && t(Fn(n));
|
|
1556
1509
|
});
|
|
1557
1510
|
return r.observe(e), () => {
|
|
1558
1511
|
r.disconnect(), n();
|
|
1559
1512
|
};
|
|
1560
1513
|
}
|
|
1561
1514
|
}
|
|
1562
|
-
function
|
|
1515
|
+
function Ln({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1563
1516
|
let n = {
|
|
1564
1517
|
root: u(null),
|
|
1565
1518
|
table: u(null),
|
|
@@ -1567,16 +1520,16 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1567
1520
|
header: u(null),
|
|
1568
1521
|
footer: u(null),
|
|
1569
1522
|
selectionColumnHeader: u(null)
|
|
1570
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1523
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = An({ withRowBorders: t }), p = An(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1571
1524
|
p.current.onScroll?.(e), m.current();
|
|
1572
1525
|
}, []);
|
|
1573
|
-
return s(() =>
|
|
1574
|
-
$(r.current,
|
|
1575
|
-
}, () => $(r.current,
|
|
1576
|
-
$(r.current,
|
|
1577
|
-
}, () => $(r.current,
|
|
1578
|
-
$(r.current,
|
|
1579
|
-
}, () => $(r.current,
|
|
1526
|
+
return s(() => In(c.current, (e) => {
|
|
1527
|
+
$(r.current, jn, `${e.height}px`);
|
|
1528
|
+
}, () => $(r.current, jn, "0")), [c.current]), s(() => In(l.current, (e) => {
|
|
1529
|
+
$(r.current, Mn, `${e.height}px`);
|
|
1530
|
+
}, () => $(r.current, Mn, "0")), [l.current]), s(() => In(d.current, (e) => {
|
|
1531
|
+
$(r.current, Nn, `${e.width}px`);
|
|
1532
|
+
}, () => $(r.current, Nn, "0")), [d.current]), kn(() => {
|
|
1580
1533
|
if (typeof window > "u") return;
|
|
1581
1534
|
let e = {
|
|
1582
1535
|
top: !0,
|
|
@@ -1599,7 +1552,7 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1599
1552
|
$(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1600
1553
|
}
|
|
1601
1554
|
function c() {
|
|
1602
|
-
f.current.withRowBorders && t.height < n.height ? $(r.current,
|
|
1555
|
+
f.current.withRowBorders && t.height < n.height ? $(r.current, Pn, `${he("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, Pn, "unset");
|
|
1603
1556
|
}
|
|
1604
1557
|
h.current = c;
|
|
1605
1558
|
function l() {
|
|
@@ -1617,25 +1570,23 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1617
1570
|
let u = new ResizeObserver((e) => {
|
|
1618
1571
|
for (let r of e) switch (r.target.tagName) {
|
|
1619
1572
|
case "TABLE":
|
|
1620
|
-
t =
|
|
1621
|
-
break;
|
|
1622
|
-
case "DIV":
|
|
1623
|
-
n = Rn(r);
|
|
1573
|
+
t = Fn(r);
|
|
1624
1574
|
break;
|
|
1575
|
+
case "DIV": n = Fn(r);
|
|
1625
1576
|
}
|
|
1626
1577
|
l(), s(), c();
|
|
1627
1578
|
});
|
|
1628
1579
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1629
1580
|
u.disconnect();
|
|
1630
1581
|
};
|
|
1631
|
-
}, []),
|
|
1582
|
+
}, []), kn(() => {
|
|
1632
1583
|
h.current();
|
|
1633
1584
|
}, [t]), {
|
|
1634
1585
|
refs: n,
|
|
1635
1586
|
onScroll: g
|
|
1636
1587
|
};
|
|
1637
1588
|
}
|
|
1638
|
-
function
|
|
1589
|
+
function Rn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1639
1590
|
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1640
1591
|
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1641
1592
|
let a = t.current ?? n.current;
|
|
@@ -1717,22 +1668,22 @@ function Vn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
|
|
|
1717
1668
|
t,
|
|
1718
1669
|
n,
|
|
1719
1670
|
f
|
|
1720
|
-
]),
|
|
1671
|
+
]), kn(f, [f]), {
|
|
1721
1672
|
pinnedMap: l,
|
|
1722
1673
|
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1723
1674
|
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1724
1675
|
};
|
|
1725
1676
|
}
|
|
1726
|
-
function
|
|
1727
|
-
let [t, n] = d(null);
|
|
1677
|
+
function zn(e) {
|
|
1678
|
+
let [t, n] = d(null), r = e?.join(":") || "";
|
|
1728
1679
|
return s(() => {
|
|
1729
1680
|
n(null);
|
|
1730
|
-
}, [
|
|
1681
|
+
}, [r]), {
|
|
1731
1682
|
lastSelectionChangeIndex: t,
|
|
1732
1683
|
setLastSelectionChangeIndex: n
|
|
1733
1684
|
};
|
|
1734
1685
|
}
|
|
1735
|
-
function
|
|
1686
|
+
function Bn(e, t) {
|
|
1736
1687
|
let n = () => {
|
|
1737
1688
|
t(e.map((e) => e.matches));
|
|
1738
1689
|
}, r = e.map((e) => {
|
|
@@ -1748,26 +1699,26 @@ function Un(e, t) {
|
|
|
1748
1699
|
});
|
|
1749
1700
|
};
|
|
1750
1701
|
}
|
|
1751
|
-
function
|
|
1702
|
+
function Vn(e, t) {
|
|
1752
1703
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1753
1704
|
}
|
|
1754
|
-
function
|
|
1755
|
-
let [r, i] = d(n ? t :
|
|
1705
|
+
function Hn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1706
|
+
let [r, i] = d(n ? t : Vn(e, t)), a = u(null);
|
|
1756
1707
|
return s(() => {
|
|
1757
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1708
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), Bn(a.current, (e) => {
|
|
1758
1709
|
i(e);
|
|
1759
1710
|
});
|
|
1760
1711
|
}, [e]), r;
|
|
1761
1712
|
}
|
|
1762
|
-
function
|
|
1763
|
-
let t =
|
|
1764
|
-
return
|
|
1713
|
+
function Un(e) {
|
|
1714
|
+
let t = _e();
|
|
1715
|
+
return Hn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1765
1716
|
}
|
|
1766
|
-
function
|
|
1767
|
-
let t =
|
|
1768
|
-
return
|
|
1717
|
+
function Wn(e) {
|
|
1718
|
+
let t = _e(), n = typeof e == "function" ? e(t) : e;
|
|
1719
|
+
return Ne(n || "", !0);
|
|
1769
1720
|
}
|
|
1770
|
-
function
|
|
1721
|
+
function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1771
1722
|
let r = [];
|
|
1772
1723
|
if (e && t) {
|
|
1773
1724
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
@@ -1802,8 +1753,8 @@ function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1802
1753
|
};
|
|
1803
1754
|
}
|
|
1804
1755
|
}
|
|
1805
|
-
function
|
|
1806
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1756
|
+
function Kn(e, t) {
|
|
1757
|
+
let [n, r] = d(e), [i, a] = d(e), o = Fe(() => r(!0), 0), c = Fe(() => a(!1), t || 200);
|
|
1807
1758
|
return s(() => {
|
|
1808
1759
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1809
1760
|
}, [
|
|
@@ -1815,17 +1766,17 @@ function Yn(e, t) {
|
|
|
1815
1766
|
visible: i
|
|
1816
1767
|
};
|
|
1817
1768
|
}
|
|
1818
|
-
var
|
|
1819
|
-
function
|
|
1820
|
-
return
|
|
1769
|
+
var qn = "mantine-datatable-nowrap", Jn = "mantine-datatable-ellipsis", Yn = "mantine-datatable-pointer-cursor", Xn = "mantine-datatable-context-menu-cursor", Zn = "mantine-datatable-text-selection-disabled", Qn = "mantine-datatable-text-align-left", $n = "mantine-datatable-text-align-center", er = "mantine-datatable-text-align-right";
|
|
1770
|
+
function tr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1771
|
+
return Wn(r) ? p(se, {
|
|
1821
1772
|
"data-pinned": n?.position,
|
|
1822
1773
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1823
1774
|
className: X({
|
|
1824
|
-
[
|
|
1825
|
-
[
|
|
1826
|
-
[
|
|
1827
|
-
[
|
|
1828
|
-
[
|
|
1775
|
+
[qn]: a || o,
|
|
1776
|
+
[Jn]: o,
|
|
1777
|
+
[Qn]: s === "left",
|
|
1778
|
+
[$n]: s === "center",
|
|
1779
|
+
[er]: s === "right"
|
|
1829
1780
|
}, e),
|
|
1830
1781
|
style: [
|
|
1831
1782
|
{
|
|
@@ -1843,24 +1794,24 @@ function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1843
1794
|
children: i
|
|
1844
1795
|
}) : null;
|
|
1845
1796
|
}
|
|
1846
|
-
function
|
|
1847
|
-
return p(
|
|
1797
|
+
function nr({ shadowVisible: e }) {
|
|
1798
|
+
return p(se, {
|
|
1848
1799
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1849
1800
|
"data-shadow-visible": e || void 0
|
|
1850
1801
|
});
|
|
1851
1802
|
}
|
|
1852
|
-
function
|
|
1853
|
-
return p(
|
|
1803
|
+
function rr({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1804
|
+
return p(oe, {
|
|
1854
1805
|
ref: s,
|
|
1855
1806
|
className: X("mantine-datatable-footer", e),
|
|
1856
1807
|
style: t,
|
|
1857
|
-
children: m(
|
|
1808
|
+
children: m(B, { children: [a && p(nr, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1858
1809
|
if (e) return null;
|
|
1859
1810
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1860
1811
|
...r,
|
|
1861
1812
|
...t
|
|
1862
1813
|
};
|
|
1863
|
-
return p(
|
|
1814
|
+
return p(tr, {
|
|
1864
1815
|
pinnedInfo: i.get(String(n)),
|
|
1865
1816
|
className: l,
|
|
1866
1817
|
style: u,
|
|
@@ -1874,8 +1825,8 @@ function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
|
|
|
1874
1825
|
})] })
|
|
1875
1826
|
});
|
|
1876
1827
|
}
|
|
1877
|
-
function
|
|
1878
|
-
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ?
|
|
1828
|
+
function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, className: a, style: o }, pinnedInfo: s, maxDepth: c, currentDepth: u, previousGroups: d, isLastGroup: f, withColumnBorders: m = !1, totalTableColumns: h }) {
|
|
1829
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? bn([{
|
|
1879
1830
|
id: e,
|
|
1880
1831
|
columns: t,
|
|
1881
1832
|
groups: n
|
|
@@ -1883,7 +1834,7 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1883
1834
|
t,
|
|
1884
1835
|
n,
|
|
1885
1836
|
e
|
|
1886
|
-
]), _ =
|
|
1837
|
+
]), _ = Un(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => xn({
|
|
1887
1838
|
id: e,
|
|
1888
1839
|
columns: t,
|
|
1889
1840
|
groups: n
|
|
@@ -1892,16 +1843,16 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1892
1843
|
t,
|
|
1893
1844
|
n,
|
|
1894
1845
|
_
|
|
1895
|
-
]), y = l(() => d.reduce((e, t) => e +
|
|
1896
|
-
return v > 0 ? p(
|
|
1846
|
+
]), y = l(() => d.reduce((e, t) => e + xn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Cn(f, y + v < h, m);
|
|
1847
|
+
return v > 0 ? p(se, {
|
|
1897
1848
|
colSpan: v,
|
|
1898
1849
|
rowSpan: b > 1 ? b : void 0,
|
|
1899
1850
|
"data-pinned": s?.position,
|
|
1900
1851
|
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1901
1852
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1902
|
-
[
|
|
1903
|
-
[
|
|
1904
|
-
[
|
|
1853
|
+
[Qn]: i === "left",
|
|
1854
|
+
[$n]: i === "center",
|
|
1855
|
+
[er]: i === "right",
|
|
1905
1856
|
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1906
1857
|
}, a),
|
|
1907
1858
|
style: [o, s && {
|
|
@@ -1909,10 +1860,10 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1909
1860
|
[s.position]: s.offset,
|
|
1910
1861
|
overflow: "visible"
|
|
1911
1862
|
}],
|
|
1912
|
-
children: r ??
|
|
1863
|
+
children: r ?? pn(e)
|
|
1913
1864
|
}) : null;
|
|
1914
1865
|
}
|
|
1915
|
-
function
|
|
1866
|
+
function ar() {
|
|
1916
1867
|
return m("svg", {
|
|
1917
1868
|
width: "14",
|
|
1918
1869
|
height: "14",
|
|
@@ -1929,7 +1880,7 @@ function cr() {
|
|
|
1929
1880
|
}), p("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })]
|
|
1930
1881
|
});
|
|
1931
1882
|
}
|
|
1932
|
-
function
|
|
1883
|
+
function or() {
|
|
1933
1884
|
return m("svg", {
|
|
1934
1885
|
width: "14",
|
|
1935
1886
|
height: "14",
|
|
@@ -1950,8 +1901,8 @@ function lr() {
|
|
|
1950
1901
|
})]
|
|
1951
1902
|
});
|
|
1952
1903
|
}
|
|
1953
|
-
function
|
|
1954
|
-
let [i, { close: a, toggle: o }] =
|
|
1904
|
+
function sr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1905
|
+
let [i, { close: a, toggle: o }] = je(!1), s = t ? or : ar, c = Ae(a);
|
|
1955
1906
|
return r && (c = void 0), m(F, {
|
|
1956
1907
|
withArrow: !0,
|
|
1957
1908
|
shadow: "md",
|
|
@@ -1978,7 +1929,7 @@ function ur({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1978
1929
|
})]
|
|
1979
1930
|
});
|
|
1980
1931
|
}
|
|
1981
|
-
function
|
|
1932
|
+
function cr() {
|
|
1982
1933
|
return m("svg", {
|
|
1983
1934
|
width: "14",
|
|
1984
1935
|
height: "14",
|
|
@@ -2000,7 +1951,7 @@ function dr() {
|
|
|
2000
1951
|
]
|
|
2001
1952
|
});
|
|
2002
1953
|
}
|
|
2003
|
-
function
|
|
1954
|
+
function lr() {
|
|
2004
1955
|
return m("svg", {
|
|
2005
1956
|
width: "14",
|
|
2006
1957
|
height: "14",
|
|
@@ -2022,7 +1973,7 @@ function fr() {
|
|
|
2022
1973
|
]
|
|
2023
1974
|
});
|
|
2024
1975
|
}
|
|
2025
|
-
function
|
|
1976
|
+
function ur() {
|
|
2026
1977
|
return m("svg", {
|
|
2027
1978
|
width: "14",
|
|
2028
1979
|
height: "14",
|
|
@@ -2044,7 +1995,7 @@ function pr() {
|
|
|
2044
1995
|
]
|
|
2045
1996
|
});
|
|
2046
1997
|
}
|
|
2047
|
-
function
|
|
1998
|
+
function dr() {
|
|
2048
1999
|
return m("svg", {
|
|
2049
2000
|
width: "14",
|
|
2050
2001
|
height: "14",
|
|
@@ -2065,14 +2016,14 @@ function mr() {
|
|
|
2065
2016
|
]
|
|
2066
2017
|
});
|
|
2067
2018
|
}
|
|
2068
|
-
function
|
|
2019
|
+
function fr({ currentPinned: e, onPinChange: t }) {
|
|
2069
2020
|
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2070
2021
|
if (i.current) {
|
|
2071
2022
|
let e = getComputedStyle(i.current).direction;
|
|
2072
2023
|
c(e === "rtl");
|
|
2073
2024
|
}
|
|
2074
2025
|
}, []);
|
|
2075
|
-
|
|
2026
|
+
kn(() => {
|
|
2076
2027
|
l();
|
|
2077
2028
|
}, [l]), s(() => {
|
|
2078
2029
|
n && l();
|
|
@@ -2095,7 +2046,7 @@ function hr({ currentPinned: e, onPinChange: t }) {
|
|
|
2095
2046
|
size: "xs",
|
|
2096
2047
|
variant: "light",
|
|
2097
2048
|
onClick: (e) => e.stopPropagation(),
|
|
2098
|
-
children: p(
|
|
2049
|
+
children: p(ur, {})
|
|
2099
2050
|
})
|
|
2100
2051
|
}) }), p(F.Dropdown, {
|
|
2101
2052
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -2110,14 +2061,14 @@ function hr({ currentPinned: e, onPinChange: t }) {
|
|
|
2110
2061
|
variant: _ ? "filled" : "light",
|
|
2111
2062
|
onClick: () => t(_ ? void 0 : f),
|
|
2112
2063
|
"aria-label": "Pin left",
|
|
2113
|
-
children: p(
|
|
2064
|
+
children: p(cr, {})
|
|
2114
2065
|
}),
|
|
2115
2066
|
p(g, {
|
|
2116
2067
|
size: "sm",
|
|
2117
2068
|
variant: v ? "filled" : "light",
|
|
2118
2069
|
onClick: () => t(v ? void 0 : h),
|
|
2119
2070
|
"aria-label": "Pin right",
|
|
2120
|
-
children: p(
|
|
2071
|
+
children: p(lr, {})
|
|
2121
2072
|
}),
|
|
2122
2073
|
e && p(g, {
|
|
2123
2074
|
size: "sm",
|
|
@@ -2125,18 +2076,18 @@ function hr({ currentPinned: e, onPinChange: t }) {
|
|
|
2125
2076
|
color: "red",
|
|
2126
2077
|
onClick: () => t(void 0),
|
|
2127
2078
|
"aria-label": "Unpin",
|
|
2128
|
-
children: p(
|
|
2079
|
+
children: p(dr, {})
|
|
2129
2080
|
})
|
|
2130
2081
|
]
|
|
2131
2082
|
})
|
|
2132
2083
|
})]
|
|
2133
2084
|
});
|
|
2134
2085
|
}
|
|
2135
|
-
var
|
|
2086
|
+
var pr = 50, mr = (e) => {
|
|
2136
2087
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2137
2088
|
current: 0,
|
|
2138
2089
|
next: 0
|
|
2139
|
-
}), { dir: c } =
|
|
2090
|
+
}), { dir: c } = ge(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = cn(), g = a((e) => {
|
|
2140
2091
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2141
2092
|
let r = n.current, a = r.nextElementSibling;
|
|
2142
2093
|
for (; a;) {
|
|
@@ -2155,7 +2106,7 @@ var gr = 50, _r = (e) => {
|
|
|
2155
2106
|
let p = (e) => {
|
|
2156
2107
|
let n = e.clientX - o.current;
|
|
2157
2108
|
l && (n = -n);
|
|
2158
|
-
let r = s.current.current -
|
|
2109
|
+
let r = s.current.current - pr, i = s.current.next - pr, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
|
|
2159
2110
|
f([{
|
|
2160
2111
|
accessor: t,
|
|
2161
2112
|
width: `${u}px`
|
|
@@ -2202,7 +2153,7 @@ var gr = 50, _r = (e) => {
|
|
|
2202
2153
|
title: "Drag to resize column, double-click to reset"
|
|
2203
2154
|
});
|
|
2204
2155
|
};
|
|
2205
|
-
function
|
|
2156
|
+
function hr() {
|
|
2206
2157
|
return m("svg", {
|
|
2207
2158
|
width: "14",
|
|
2208
2159
|
height: "14",
|
|
@@ -2224,7 +2175,7 @@ function vr() {
|
|
|
2224
2175
|
]
|
|
2225
2176
|
});
|
|
2226
2177
|
}
|
|
2227
|
-
function
|
|
2178
|
+
function gr() {
|
|
2228
2179
|
return m("svg", {
|
|
2229
2180
|
width: "14",
|
|
2230
2181
|
height: "14",
|
|
@@ -2246,7 +2197,7 @@ function yr() {
|
|
|
2246
2197
|
]
|
|
2247
2198
|
});
|
|
2248
2199
|
}
|
|
2249
|
-
function
|
|
2200
|
+
function _r() {
|
|
2250
2201
|
return m("svg", {
|
|
2251
2202
|
width: "14",
|
|
2252
2203
|
height: "14",
|
|
@@ -2271,37 +2222,37 @@ function br() {
|
|
|
2271
2222
|
]
|
|
2272
2223
|
});
|
|
2273
2224
|
}
|
|
2274
|
-
function
|
|
2275
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } =
|
|
2276
|
-
if (!
|
|
2277
|
-
let
|
|
2225
|
+
function vr({ 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 }) {
|
|
2226
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = cn(), [te, I] = d(!1), L = u(null), ne = ee?.find((e) => e.accessor === r)?.pinned;
|
|
2227
|
+
if (!Wn(i)) return null;
|
|
2228
|
+
let R = a ?? pn(r), re = typeof R == "string" ? R : void 0, ie = o && S ? (e) => {
|
|
2278
2229
|
e?.defaultPrevented || S({
|
|
2279
2230
|
sortKey: k,
|
|
2280
2231
|
columnAccessor: r,
|
|
2281
2232
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2282
2233
|
});
|
|
2283
|
-
} : void 0,
|
|
2234
|
+
} : void 0, ae = (e) => {
|
|
2284
2235
|
e.stopPropagation(), A(r), I(!1);
|
|
2285
|
-
},
|
|
2236
|
+
}, z = (e) => {
|
|
2286
2237
|
e.preventDefault(), j(r), I(!0);
|
|
2287
|
-
},
|
|
2238
|
+
}, oe = () => {
|
|
2288
2239
|
j(r), I(!1), M();
|
|
2289
|
-
},
|
|
2240
|
+
}, ce = () => {
|
|
2290
2241
|
I(!0);
|
|
2291
|
-
},
|
|
2242
|
+
}, B = () => {
|
|
2292
2243
|
I(!1);
|
|
2293
|
-
},
|
|
2244
|
+
}, le = (e) => {
|
|
2294
2245
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2295
2246
|
...e,
|
|
2296
2247
|
toggled: !1
|
|
2297
2248
|
} : e));
|
|
2298
|
-
},
|
|
2249
|
+
}, V = (e) => {
|
|
2299
2250
|
F((t) => t.map((t) => t.accessor === r ? {
|
|
2300
2251
|
...t,
|
|
2301
2252
|
pinned: e
|
|
2302
2253
|
} : t));
|
|
2303
2254
|
};
|
|
2304
|
-
return m(
|
|
2255
|
+
return m(se, {
|
|
2305
2256
|
"data-accessor": r,
|
|
2306
2257
|
"data-pinned": n?.position,
|
|
2307
2258
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2328,8 +2279,8 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2328
2279
|
],
|
|
2329
2280
|
role: o ? "button" : void 0,
|
|
2330
2281
|
tabIndex: o ? 0 : void 0,
|
|
2331
|
-
onClick:
|
|
2332
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2282
|
+
onClick: ie,
|
|
2283
|
+
onKeyDown: (e) => e.key === "Enter" && ie?.(),
|
|
2333
2284
|
ref: L,
|
|
2334
2285
|
children: [m(T, {
|
|
2335
2286
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
@@ -2344,11 +2295,11 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2344
2295
|
"mantine-datatable-header-cell-drag-over": te
|
|
2345
2296
|
}),
|
|
2346
2297
|
draggable: s,
|
|
2347
|
-
onDragStart: s ?
|
|
2348
|
-
onDragEnter: s ?
|
|
2349
|
-
onDragOver: s ?
|
|
2350
|
-
onDrop: s ?
|
|
2351
|
-
onDragLeave: s ?
|
|
2298
|
+
onDragStart: s ? ae : void 0,
|
|
2299
|
+
onDragEnter: s ? ce : void 0,
|
|
2300
|
+
onDragOver: s ? z : void 0,
|
|
2301
|
+
onDrop: s ? oe : void 0,
|
|
2302
|
+
onDragLeave: s ? B : void 0,
|
|
2352
2303
|
children: [s ? p(b, {
|
|
2353
2304
|
role: "img",
|
|
2354
2305
|
"aria-label": "Drag column",
|
|
@@ -2359,21 +2310,21 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2359
2310
|
onClick: (e) => {
|
|
2360
2311
|
e.stopPropagation();
|
|
2361
2312
|
},
|
|
2362
|
-
children: p(
|
|
2313
|
+
children: p(_r, {})
|
|
2363
2314
|
})
|
|
2364
2315
|
}) : null, p(v, {
|
|
2365
2316
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
2366
|
-
[
|
|
2367
|
-
[
|
|
2368
|
-
[
|
|
2369
|
-
},
|
|
2370
|
-
title:
|
|
2371
|
-
children:
|
|
2317
|
+
[Qn]: _ === "left",
|
|
2318
|
+
[$n]: _ === "center",
|
|
2319
|
+
[er]: _ === "right"
|
|
2320
|
+
}, qn, Jn),
|
|
2321
|
+
title: re,
|
|
2322
|
+
children: R
|
|
2372
2323
|
})]
|
|
2373
2324
|
}),
|
|
2374
|
-
l ? p(
|
|
2325
|
+
l ? p(fr, {
|
|
2375
2326
|
currentPinned: ne,
|
|
2376
|
-
onPinChange:
|
|
2327
|
+
onPinChange: V
|
|
2377
2328
|
}) : null,
|
|
2378
2329
|
c ? p(b, {
|
|
2379
2330
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2382,46 +2333,46 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2382
2333
|
children: p(g, {
|
|
2383
2334
|
size: "xs",
|
|
2384
2335
|
variant: "light",
|
|
2385
|
-
onClick:
|
|
2386
|
-
children: p(
|
|
2336
|
+
onClick: le,
|
|
2337
|
+
children: p(dr, {})
|
|
2387
2338
|
})
|
|
2388
2339
|
}) : null,
|
|
2389
2340
|
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
|
|
2390
2341
|
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
2391
2342
|
role: "img",
|
|
2392
2343
|
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2393
|
-
children: h?.sorted || p(
|
|
2344
|
+
children: h?.sorted || p(gr, {})
|
|
2394
2345
|
}) : p(b, {
|
|
2395
2346
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
2396
2347
|
role: "img",
|
|
2397
2348
|
"aria-label": "Not sorted",
|
|
2398
|
-
children: h?.unsorted || p(
|
|
2349
|
+
children: h?.unsorted || p(hr, {})
|
|
2399
2350
|
}) : null,
|
|
2400
|
-
C ? p(
|
|
2351
|
+
C ? p(sr, {
|
|
2401
2352
|
filterPopoverProps: E,
|
|
2402
2353
|
isActive: !!O,
|
|
2403
2354
|
filterPopoverDisableClickOutside: D,
|
|
2404
2355
|
children: C
|
|
2405
2356
|
}) : null
|
|
2406
2357
|
]
|
|
2407
|
-
}), f && r !== "__selection__" ? p(
|
|
2358
|
+
}), f && r !== "__selection__" ? p(mr, {
|
|
2408
2359
|
accessor: r,
|
|
2409
2360
|
columnRef: L
|
|
2410
2361
|
}) : null]
|
|
2411
2362
|
});
|
|
2412
2363
|
}
|
|
2413
|
-
function
|
|
2364
|
+
function yr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2414
2365
|
let u = !o.disabled;
|
|
2415
|
-
return p(
|
|
2366
|
+
return p(se, {
|
|
2416
2367
|
ref: l,
|
|
2417
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2368
|
+
className: X("mantine-datatable-header-selector-cell", { [Yn]: n === "cell" && u }, e),
|
|
2418
2369
|
style: t,
|
|
2419
2370
|
rowSpan: c,
|
|
2420
2371
|
"data-shadow-visible": r || void 0,
|
|
2421
2372
|
"data-accessor": "__selection__",
|
|
2422
2373
|
onClick: n === "cell" && u ? s : void 0,
|
|
2423
2374
|
children: p(x, {
|
|
2424
|
-
classNames: u ? { input:
|
|
2375
|
+
classNames: u ? { input: Yn } : void 0,
|
|
2425
2376
|
checked: i,
|
|
2426
2377
|
indeterminate: a,
|
|
2427
2378
|
onChange: s,
|
|
@@ -2430,7 +2381,7 @@ function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
2430
2381
|
})
|
|
2431
2382
|
});
|
|
2432
2383
|
}
|
|
2433
|
-
function
|
|
2384
|
+
function br(e, t) {
|
|
2434
2385
|
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2435
2386
|
if (r.length === 0 || r.length !== n.length) return;
|
|
2436
2387
|
let i = new Set(r.map((e) => e.logicalSide));
|
|
@@ -2443,8 +2394,8 @@ function Cr(e, t) {
|
|
|
2443
2394
|
isBoundary: l?.isBoundary ?? !1
|
|
2444
2395
|
};
|
|
2445
2396
|
}
|
|
2446
|
-
function
|
|
2447
|
-
let E = c ?
|
|
2397
|
+
function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r, sortIcons: i, onSortStatusChange: a, columns: o, defaultColumnProps: s, groups: c, pinnedMap: l, selectionTrigger: u, selectionVisible: f, selectionChecked: h, selectionIndeterminate: g, onSelectionChange: _, selectionCheckboxProps: v, selectorCellShadowVisible: y, selectionColumnClassName: b, selectionColumnStyle: S, withColumnBorders: C = !1, ref: w }) {
|
|
2398
|
+
let E = c ? yn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(yr, {
|
|
2448
2399
|
ref: e,
|
|
2449
2400
|
className: b,
|
|
2450
2401
|
style: S,
|
|
@@ -2455,7 +2406,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2455
2406
|
checkboxProps: v,
|
|
2456
2407
|
onChange: _,
|
|
2457
2408
|
rowSpan: c ? D : void 0
|
|
2458
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } =
|
|
2409
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = cn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? pn(String(e))])) : void 0, ee = m(ce, {
|
|
2459
2410
|
className: X("mantine-datatable-header", t),
|
|
2460
2411
|
style: n,
|
|
2461
2412
|
ref: w,
|
|
@@ -2463,10 +2414,10 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2463
2414
|
e.preventDefault(), M((e) => !e);
|
|
2464
2415
|
} : void 0,
|
|
2465
2416
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2466
|
-
let n =
|
|
2467
|
-
return m(
|
|
2417
|
+
let n = Sn(c, t);
|
|
2418
|
+
return m(B, { children: [t === 0 && O, n.map((e, r) => p(ir, {
|
|
2468
2419
|
group: e,
|
|
2469
|
-
pinnedInfo:
|
|
2420
|
+
pinnedInfo: br(e, l),
|
|
2470
2421
|
maxDepth: E,
|
|
2471
2422
|
currentDepth: t,
|
|
2472
2423
|
previousGroups: n.slice(0, r),
|
|
@@ -2474,13 +2425,13 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2474
2425
|
withColumnBorders: C,
|
|
2475
2426
|
totalTableColumns: o.length
|
|
2476
2427
|
}, e.id))] }, `group-depth-${t}`);
|
|
2477
|
-
}), m(
|
|
2428
|
+
}), m(B, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2478
2429
|
if (e) return null;
|
|
2479
2430
|
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 } = {
|
|
2480
2431
|
...s,
|
|
2481
2432
|
...t
|
|
2482
2433
|
};
|
|
2483
|
-
return p(
|
|
2434
|
+
return p(vr, {
|
|
2484
2435
|
accessor: c,
|
|
2485
2436
|
pinnedInfo: l.get(String(c)),
|
|
2486
2437
|
className: b,
|
|
@@ -2511,7 +2462,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2511
2462
|
shadow: "md",
|
|
2512
2463
|
opened: j,
|
|
2513
2464
|
onChange: M,
|
|
2514
|
-
children: [p(I, { children: ee }), p(te, { children: p(
|
|
2465
|
+
children: [p(I, { children: ee }), p(te, { children: p(re, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2515
2466
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2516
2467
|
size: "xs",
|
|
2517
2468
|
label: P[e.accessor],
|
|
@@ -2525,7 +2476,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2525
2476
|
}) }, e.accessor)) }) })]
|
|
2526
2477
|
}) : ee;
|
|
2527
2478
|
}
|
|
2528
|
-
function
|
|
2479
|
+
function Sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2529
2480
|
return p(b, {
|
|
2530
2481
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2531
2482
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
@@ -2536,7 +2487,7 @@ function Tr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
|
|
|
2536
2487
|
}))
|
|
2537
2488
|
});
|
|
2538
2489
|
}
|
|
2539
|
-
function
|
|
2490
|
+
function Cr() {
|
|
2540
2491
|
return m("svg", {
|
|
2541
2492
|
width: "14",
|
|
2542
2493
|
height: "14",
|
|
@@ -2557,17 +2508,17 @@ function Er() {
|
|
|
2557
2508
|
]
|
|
2558
2509
|
});
|
|
2559
2510
|
}
|
|
2560
|
-
var
|
|
2561
|
-
xs:
|
|
2562
|
-
sm:
|
|
2563
|
-
md:
|
|
2564
|
-
lg:
|
|
2565
|
-
xl:
|
|
2511
|
+
var wr = {
|
|
2512
|
+
xs: he(22),
|
|
2513
|
+
sm: he(26),
|
|
2514
|
+
md: he(32),
|
|
2515
|
+
lg: he(38),
|
|
2516
|
+
xl: he(44)
|
|
2566
2517
|
};
|
|
2567
|
-
function
|
|
2518
|
+
function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2568
2519
|
return m(T, {
|
|
2569
2520
|
gap: "xs",
|
|
2570
|
-
children: [p(
|
|
2521
|
+
children: [p(V, {
|
|
2571
2522
|
component: "div",
|
|
2572
2523
|
size: e,
|
|
2573
2524
|
children: t
|
|
@@ -2580,9 +2531,9 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2580
2531
|
size: e,
|
|
2581
2532
|
variant: "default",
|
|
2582
2533
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2583
|
-
rightSection: p(
|
|
2534
|
+
rightSection: p(Cr, {}),
|
|
2584
2535
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2585
|
-
height:
|
|
2536
|
+
height: wr[e],
|
|
2586
2537
|
paddingLeft: t.spacing[e],
|
|
2587
2538
|
paddingRight: t.spacing[e]
|
|
2588
2539
|
})],
|
|
@@ -2591,14 +2542,14 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2591
2542
|
let n = t === r;
|
|
2592
2543
|
return p(j, {
|
|
2593
2544
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2594
|
-
style: [{ height:
|
|
2545
|
+
style: [{ height: wr[e] }, n && (i || a) ? (e) => an({
|
|
2595
2546
|
theme: e,
|
|
2596
2547
|
paginationActiveTextColor: i,
|
|
2597
2548
|
paginationActiveBackgroundColor: a
|
|
2598
2549
|
}) : void 0],
|
|
2599
2550
|
disabled: n,
|
|
2600
2551
|
onClick: () => o(t),
|
|
2601
|
-
children: p(
|
|
2552
|
+
children: p(V, {
|
|
2602
2553
|
component: "div",
|
|
2603
2554
|
size: e,
|
|
2604
2555
|
children: t
|
|
@@ -2608,7 +2559,7 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2608
2559
|
})]
|
|
2609
2560
|
});
|
|
2610
2561
|
}
|
|
2611
|
-
function
|
|
2562
|
+
function Er({ className: e, style: t, fetching: n, page: r, onPageChange: i, paginationWithEdges: a, paginationWithControls: o, paginationActiveTextColor: s, paginationActiveBackgroundColor: c, paginationSize: l, loadingText: u, noRecordsText: d, paginationText: h, totalRecords: g, recordsPerPage: _, onRecordsPerPageChange: y, recordsPerPageLabel: b, recordsPerPageOptions: x, recordsLength: S, horizontalSpacing: C, paginationWrapBreakpoint: w, getPaginationControlProps: T, getPaginationItemProps: E, renderPagination: D }) {
|
|
2612
2563
|
let O;
|
|
2613
2564
|
if (g) {
|
|
2614
2565
|
let e = (r - 1) * _ + 1;
|
|
@@ -2618,15 +2569,15 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2618
2569
|
totalRecords: g
|
|
2619
2570
|
});
|
|
2620
2571
|
} else O = n ? u : d;
|
|
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 = !
|
|
2622
|
-
Text: (e) => p(
|
|
2572
|
+
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 = !Wn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${he(w)}rem` : e[w] || w})`), N = {
|
|
2573
|
+
Text: (e) => p(V, {
|
|
2623
2574
|
component: "div",
|
|
2624
2575
|
className: "mantine-datatable-pagination-text",
|
|
2625
2576
|
size: l,
|
|
2626
2577
|
...e,
|
|
2627
2578
|
children: O
|
|
2628
2579
|
}),
|
|
2629
|
-
PageSizeSelector: (e) => x ? p(
|
|
2580
|
+
PageSizeSelector: (e) => x ? p(Tr, {
|
|
2630
2581
|
activeTextColor: s,
|
|
2631
2582
|
activeBackgroundColor: c,
|
|
2632
2583
|
size: l,
|
|
@@ -2641,7 +2592,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2641
2592
|
root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
|
|
2642
2593
|
control: "mantine-datatable-pagination-pages-control"
|
|
2643
2594
|
},
|
|
2644
|
-
style: s || c ? (e) =>
|
|
2595
|
+
style: s || c ? (e) => an({
|
|
2645
2596
|
theme: e,
|
|
2646
2597
|
paginationActiveTextColor: s,
|
|
2647
2598
|
paginationActiveBackgroundColor: c
|
|
@@ -2687,18 +2638,18 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2687
2638
|
] })
|
|
2688
2639
|
});
|
|
2689
2640
|
}
|
|
2690
|
-
function
|
|
2691
|
-
return
|
|
2641
|
+
function Dr({ 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: _ }) {
|
|
2642
|
+
return Wn(r) ? p(z, {
|
|
2692
2643
|
"data-pinned": n?.position,
|
|
2693
2644
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2694
2645
|
className: X({
|
|
2695
|
-
[
|
|
2696
|
-
[
|
|
2697
|
-
[
|
|
2698
|
-
[
|
|
2699
|
-
[
|
|
2700
|
-
[
|
|
2701
|
-
[
|
|
2646
|
+
[qn]: l || u,
|
|
2647
|
+
[Jn]: u,
|
|
2648
|
+
[Yn]: o || s,
|
|
2649
|
+
[Xn]: c,
|
|
2650
|
+
[Qn]: d === "left",
|
|
2651
|
+
[$n]: d === "center",
|
|
2652
|
+
[er]: d === "right"
|
|
2702
2653
|
}, e),
|
|
2703
2654
|
style: [
|
|
2704
2655
|
{
|
|
@@ -2717,12 +2668,12 @@ function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2717
2668
|
onDoubleClick: s,
|
|
2718
2669
|
onContextMenu: c,
|
|
2719
2670
|
..._?.(i, a),
|
|
2720
|
-
children: h ? h(i, a) : g ? g(i, a, m) :
|
|
2671
|
+
children: h ? h(i, a) : g ? g(i, a, m) : vn(i, m)
|
|
2721
2672
|
}) : null;
|
|
2722
2673
|
}
|
|
2723
|
-
function
|
|
2724
|
-
let { expanded: i, visible: a } =
|
|
2725
|
-
return a ? m(f, { children: [p(
|
|
2674
|
+
function Or({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2675
|
+
let { expanded: i, visible: a } = Kn(e, r?.transitionDuration);
|
|
2676
|
+
return a ? m(f, { children: [p(B, {}), p(B, { children: p(z, {
|
|
2726
2677
|
className: "mantine-datatable-row-expansion-cell",
|
|
2727
2678
|
colSpan: t,
|
|
2728
2679
|
children: p(S, {
|
|
@@ -2735,28 +2686,28 @@ function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2735
2686
|
})
|
|
2736
2687
|
}) })] }) : null;
|
|
2737
2688
|
}
|
|
2738
|
-
function
|
|
2689
|
+
function kr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2739
2690
|
let u = {
|
|
2740
2691
|
...s,
|
|
2741
2692
|
...c(n, r)
|
|
2742
2693
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2743
2694
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2744
2695
|
};
|
|
2745
|
-
return p(
|
|
2746
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2696
|
+
return p(z, {
|
|
2697
|
+
className: X("mantine-datatable-row-selector-cell", { [Yn]: i === "cell" && d }, e),
|
|
2747
2698
|
style: t,
|
|
2748
2699
|
"data-shadow-visible": o || void 0,
|
|
2749
2700
|
onClick: f,
|
|
2750
2701
|
children: p(x, {
|
|
2751
|
-
classNames: d ? { input:
|
|
2702
|
+
classNames: d ? { input: Yn } : void 0,
|
|
2752
2703
|
onChange: a,
|
|
2753
2704
|
...l,
|
|
2754
2705
|
...u
|
|
2755
2706
|
})
|
|
2756
2707
|
});
|
|
2757
2708
|
}
|
|
2758
|
-
function
|
|
2759
|
-
let M = m(f, { children: [s && p(
|
|
2709
|
+
function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap: i, defaultColumnRender: a, selectionTrigger: o, selectionVisible: s, selectionChecked: c, onSelectionChange: l, isRecordSelectable: u, selectionCheckboxProps: d, getSelectionCheckboxProps: h, onClick: g, onDoubleClick: _, onContextMenu: v, onCellClick: y, onCellDoubleClick: b, onCellContextMenu: x, expansion: S, customAttributes: C, color: w, backgroundColor: T, className: E, style: D, selectorCellShadowVisible: O, selectionColumnClassName: k, selectionColumnStyle: A, rowFactory: j }) {
|
|
2710
|
+
let M = m(f, { children: [s && p(kr, {
|
|
2760
2711
|
className: k,
|
|
2761
2712
|
style: A,
|
|
2762
2713
|
record: e,
|
|
@@ -2774,7 +2725,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2774
2725
|
...r,
|
|
2775
2726
|
...s
|
|
2776
2727
|
};
|
|
2777
|
-
return p(
|
|
2728
|
+
return p(Dr, {
|
|
2778
2729
|
pinnedInfo: i.get(String(l)),
|
|
2779
2730
|
className: typeof _ == "function" ? _(e, t) : _,
|
|
2780
2731
|
style: v?.(e, t),
|
|
@@ -2811,7 +2762,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2811
2762
|
defaultRender: a,
|
|
2812
2763
|
customCellAttributes: S
|
|
2813
2764
|
}, l);
|
|
2814
|
-
})] }), N = S && p(
|
|
2765
|
+
})] }), N = S && p(Or, {
|
|
2815
2766
|
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2816
2767
|
open: S.isRowExpanded(e),
|
|
2817
2768
|
content: S.content({
|
|
@@ -2819,7 +2770,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2819
2770
|
index: t
|
|
2820
2771
|
}),
|
|
2821
2772
|
collapseProps: S.collapseProps
|
|
2822
|
-
}), P =
|
|
2773
|
+
}), P = jr({
|
|
2823
2774
|
record: e,
|
|
2824
2775
|
index: t,
|
|
2825
2776
|
selectionChecked: c,
|
|
@@ -2839,17 +2790,17 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2839
2790
|
rowProps: P,
|
|
2840
2791
|
children: M,
|
|
2841
2792
|
expandedElement: N
|
|
2842
|
-
}) : m(f, { children: [p(
|
|
2793
|
+
}) : m(f, { children: [p(B, {
|
|
2843
2794
|
...P,
|
|
2844
2795
|
children: M
|
|
2845
2796
|
}), N] });
|
|
2846
2797
|
}
|
|
2847
|
-
function
|
|
2798
|
+
function jr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
|
|
2848
2799
|
return {
|
|
2849
|
-
className: X("mantine-datatable-row", { [
|
|
2800
|
+
className: X("mantine-datatable-row", { [Yn]: r || i || o?.isExpandable({
|
|
2850
2801
|
record: e,
|
|
2851
2802
|
index: t
|
|
2852
|
-
}) && o?.expandOnClick }, { [
|
|
2803
|
+
}) && o?.expandOnClick }, { [Xn]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2853
2804
|
"data-selected": n || void 0,
|
|
2854
2805
|
onClick: (n) => {
|
|
2855
2806
|
if (o) {
|
|
@@ -2877,7 +2828,7 @@ function Pr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2877
2828
|
}) : void 0,
|
|
2878
2829
|
style: [c || l ? (n) => {
|
|
2879
2830
|
let r = c?.(e, t), i = l?.(e, t);
|
|
2880
|
-
return
|
|
2831
|
+
return on({
|
|
2881
2832
|
theme: n,
|
|
2882
2833
|
color: r,
|
|
2883
2834
|
backgroundColor: i
|
|
@@ -2886,7 +2837,7 @@ function Pr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2886
2837
|
...s?.(e, t) ?? {}
|
|
2887
2838
|
};
|
|
2888
2839
|
}
|
|
2889
|
-
function
|
|
2840
|
+
function Mr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2890
2841
|
return m(L, {
|
|
2891
2842
|
...a,
|
|
2892
2843
|
viewportRef: i,
|
|
@@ -2906,30 +2857,30 @@ function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2906
2857
|
]
|
|
2907
2858
|
});
|
|
2908
2859
|
}
|
|
2909
|
-
function
|
|
2910
|
-
let
|
|
2860
|
+
function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: R, recordsPerPage: re, onRecordsPerPageChange: ie, recordsPerPageOptions: z, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: B, paginationActiveBackgroundColor: le, paginationSize: V = "sm", paginationText: ue = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: de = "sm", getPaginationControlProps: fe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: Oe, onRowContextMenu: ke, onCellClick: Ae, onCellDoubleClick: je, onCellContextMenu: Me, onScroll: Ne, onScrollToTop: Fe, onScrollToBottom: Ie, onScrollToLeft: Le, onScrollToRight: Re, c: ze, backgroundColor: Be, borderColor: Ve, rowBorderColor: H, stripedColor: He, highlightOnHoverColor: Ue, rowColor: We, rowBackgroundColor: U, rowExpansion: Ge, rowClassName: Ke, rowStyle: qe, customRowAttributes: Je, scrollViewportRef: Ye, scrollAreaProps: Xe, tableRef: Ze, bodyRef: Qe, m: $e, my: et, mx: tt, mt: W, mb: G, ml: nt, mr: rt, className: it, classNames: K, style: at, styles: q, rowFactory: ot, tableWrapper: st, ...ct }) {
|
|
2861
|
+
let lt = l(() => y ? bn(y) : g, [g, y]), { refs: J, onScroll: ut } = Ln({
|
|
2911
2862
|
scrollCallbacks: {
|
|
2912
|
-
onScroll:
|
|
2913
|
-
onScrollToTop:
|
|
2914
|
-
onScrollToBottom:
|
|
2915
|
-
onScrollToLeft:
|
|
2916
|
-
onScrollToRight:
|
|
2863
|
+
onScroll: Ne,
|
|
2864
|
+
onScrollToTop: Fe,
|
|
2865
|
+
onScrollToBottom: Ie,
|
|
2866
|
+
onScrollToLeft: Le,
|
|
2867
|
+
onScrollToRight: Re
|
|
2917
2868
|
},
|
|
2918
|
-
withRowBorders:
|
|
2919
|
-
}),
|
|
2869
|
+
withRowBorders: ct.withRowBorders
|
|
2870
|
+
}), Y = On({
|
|
2920
2871
|
key: _,
|
|
2921
|
-
columns:
|
|
2922
|
-
headerRef:
|
|
2923
|
-
scrollViewportRef:
|
|
2924
|
-
}), dt =
|
|
2925
|
-
rowExpansion:
|
|
2872
|
+
columns: lt,
|
|
2873
|
+
headerRef: J.header,
|
|
2874
|
+
scrollViewportRef: J.scrollViewport
|
|
2875
|
+
}), dt = Y.effectiveColumns, ft = Pe(J.table, Ze), pt = Pe(J.scrollViewport, Ye), mt = u(null), ht = Pe(mt, Qe), gt = Gn({
|
|
2876
|
+
rowExpansion: Ge,
|
|
2926
2877
|
records: T,
|
|
2927
2878
|
idAccessor: w
|
|
2928
|
-
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } =
|
|
2879
|
+
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Rn({
|
|
2929
2880
|
columns: dt,
|
|
2930
|
-
theadRef:
|
|
2881
|
+
theadRef: J.header,
|
|
2931
2882
|
tbodyRef: mt,
|
|
2932
|
-
selectionColumnHeaderRef:
|
|
2883
|
+
selectionColumnHeaderRef: J.selectionColumnHeader,
|
|
2933
2884
|
selectionVisible: !!D,
|
|
2934
2885
|
pinFirstColumn: b,
|
|
2935
2886
|
pinLastColumn: x
|
|
@@ -2942,7 +2893,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2942
2893
|
let wt = T?.length;
|
|
2943
2894
|
c(() => {
|
|
2944
2895
|
if (!bt.current || h || T === St.current) return;
|
|
2945
|
-
let e =
|
|
2896
|
+
let e = J.scrollViewport.current;
|
|
2946
2897
|
if (!e) return;
|
|
2947
2898
|
let t = requestAnimationFrame(() => {
|
|
2948
2899
|
e.scrollTo({
|
|
@@ -2954,10 +2905,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2954
2905
|
}, [
|
|
2955
2906
|
h,
|
|
2956
2907
|
T,
|
|
2957
|
-
|
|
2908
|
+
J.scrollViewport
|
|
2958
2909
|
]);
|
|
2959
2910
|
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(() => {
|
|
2960
|
-
D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) :
|
|
2911
|
+
D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) : _n([...D, ...kt], (e) => Q(e, w)));
|
|
2961
2912
|
}, [
|
|
2962
2913
|
jt,
|
|
2963
2914
|
w,
|
|
@@ -2965,27 +2916,27 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2965
2916
|
At,
|
|
2966
2917
|
kt,
|
|
2967
2918
|
D
|
|
2968
|
-
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } =
|
|
2969
|
-
m:
|
|
2970
|
-
my:
|
|
2971
|
-
mx:
|
|
2972
|
-
mt:
|
|
2973
|
-
mb:
|
|
2974
|
-
ml:
|
|
2975
|
-
mr:
|
|
2976
|
-
}, Rt = a(({ children: e }) =>
|
|
2977
|
-
return p(
|
|
2978
|
-
...
|
|
2919
|
+
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = zn(Tt), It = Et && !vt, Lt = {
|
|
2920
|
+
m: $e,
|
|
2921
|
+
my: et,
|
|
2922
|
+
mx: tt,
|
|
2923
|
+
mt: W,
|
|
2924
|
+
mb: G,
|
|
2925
|
+
ml: nt,
|
|
2926
|
+
mr: rt
|
|
2927
|
+
}, Rt = a(({ children: e }) => st ? st({ children: e }) : e, [st]);
|
|
2928
|
+
return p(ln, {
|
|
2929
|
+
...Y,
|
|
2979
2930
|
pinnedMap: _t,
|
|
2980
2931
|
children: m(v, {
|
|
2981
|
-
ref:
|
|
2932
|
+
ref: J.root,
|
|
2982
2933
|
...Lt,
|
|
2983
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2934
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, it, K?.root),
|
|
2984
2935
|
style: [
|
|
2985
2936
|
(e) => ({
|
|
2986
|
-
...
|
|
2937
|
+
...rn({
|
|
2987
2938
|
theme: e,
|
|
2988
|
-
c:
|
|
2939
|
+
c: ze,
|
|
2989
2940
|
backgroundColor: Be,
|
|
2990
2941
|
borderColor: Ve,
|
|
2991
2942
|
rowBorderColor: H,
|
|
@@ -2998,46 +2949,46 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2998
2949
|
minHeight: i,
|
|
2999
2950
|
maxHeight: o
|
|
3000
2951
|
}),
|
|
3001
|
-
|
|
3002
|
-
|
|
2952
|
+
at,
|
|
2953
|
+
q?.root,
|
|
3003
2954
|
{ position: "relative" }
|
|
3004
2955
|
],
|
|
3005
2956
|
children: [
|
|
3006
|
-
p(
|
|
2957
|
+
p(Mr, {
|
|
3007
2958
|
viewportRef: pt,
|
|
3008
2959
|
leftShadowBehind: Et || vt,
|
|
3009
2960
|
rightShadowBehind: yt,
|
|
3010
|
-
onScrollPositionChange:
|
|
3011
|
-
scrollAreaProps:
|
|
3012
|
-
children: p(Rt, { children: m(
|
|
2961
|
+
onScrollPositionChange: ut,
|
|
2962
|
+
scrollAreaProps: Xe,
|
|
2963
|
+
children: p(Rt, { children: m(ae, {
|
|
3013
2964
|
ref: ft,
|
|
3014
2965
|
horizontalSpacing: I,
|
|
3015
2966
|
className: X("mantine-datatable-table", {
|
|
3016
|
-
[
|
|
2967
|
+
[Zn]: n,
|
|
3017
2968
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3018
2969
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3019
2970
|
"mantine-datatable-selection-column-visible": Et,
|
|
3020
|
-
"mantine-datatable-resizable-columns":
|
|
3021
|
-
"mantine-datatable-resize-locked":
|
|
3022
|
-
"mantine-datatable-resizing":
|
|
3023
|
-
},
|
|
2971
|
+
"mantine-datatable-resizable-columns": Y.hasResizableColumns,
|
|
2972
|
+
"mantine-datatable-resize-locked": Y.isLocked,
|
|
2973
|
+
"mantine-datatable-resizing": Y.isResizing
|
|
2974
|
+
}, K?.table),
|
|
3024
2975
|
style: {
|
|
3025
|
-
...
|
|
3026
|
-
...
|
|
3027
|
-
...
|
|
2976
|
+
...q?.table,
|
|
2977
|
+
...Y.isLocked ? { tableLayout: "fixed" } : null,
|
|
2978
|
+
...Y.tableWidth == null ? null : { width: `${Y.tableWidth}px` }
|
|
3028
2979
|
},
|
|
3029
|
-
"data-striped": wt &&
|
|
3030
|
-
"data-highlight-on-hover":
|
|
3031
|
-
...
|
|
2980
|
+
"data-striped": wt && Te || void 0,
|
|
2981
|
+
"data-highlight-on-hover": we || void 0,
|
|
2982
|
+
...ct,
|
|
3032
2983
|
children: [
|
|
3033
|
-
|
|
3034
|
-
...
|
|
2984
|
+
Ee ? null : p(ln, {
|
|
2985
|
+
...Y,
|
|
3035
2986
|
pinnedMap: _t,
|
|
3036
|
-
children: p(
|
|
3037
|
-
ref:
|
|
3038
|
-
selectionColumnHeaderRef:
|
|
3039
|
-
className:
|
|
3040
|
-
style:
|
|
2987
|
+
children: p(xr, {
|
|
2988
|
+
ref: J.header,
|
|
2989
|
+
selectionColumnHeaderRef: J.selectionColumnHeader,
|
|
2990
|
+
className: K?.header,
|
|
2991
|
+
style: q?.header,
|
|
3041
2992
|
columns: dt,
|
|
3042
2993
|
defaultColumnProps: S,
|
|
3043
2994
|
groups: y,
|
|
@@ -3057,7 +3008,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3057
3008
|
selectorCellShadowVisible: It,
|
|
3058
3009
|
selectionColumnClassName: k,
|
|
3059
3010
|
selectionColumnStyle: A,
|
|
3060
|
-
withColumnBorders:
|
|
3011
|
+
withColumnBorders: ct.withColumnBorders
|
|
3061
3012
|
})
|
|
3062
3013
|
}),
|
|
3063
3014
|
p("tbody", {
|
|
@@ -3067,10 +3018,10 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3067
3018
|
return O && D && (i = (i) => {
|
|
3068
3019
|
if (i.nativeEvent.shiftKey && Pt !== null) {
|
|
3069
3020
|
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)));
|
|
3070
|
-
O(r ?
|
|
3071
|
-
} else O(r ? D.filter((e) => Q(e, w) !== n) :
|
|
3021
|
+
O(r ? gn(D, e, (e) => Q(e, w)) : _n([...D, ...e], (e) => Q(e, w)));
|
|
3022
|
+
} else O(r ? D.filter((e) => Q(e, w) !== n) : _n([...D, e], (e) => Q(e, w)));
|
|
3072
3023
|
Ft(t);
|
|
3073
|
-
}), p(
|
|
3024
|
+
}), p(Ar, {
|
|
3074
3025
|
record: e,
|
|
3075
3026
|
index: t,
|
|
3076
3027
|
columns: dt,
|
|
@@ -3084,30 +3035,30 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3084
3035
|
isRecordSelectable: j,
|
|
3085
3036
|
selectionCheckboxProps: M,
|
|
3086
3037
|
getSelectionCheckboxProps: P,
|
|
3087
|
-
onClick:
|
|
3088
|
-
onDoubleClick:
|
|
3089
|
-
onCellClick:
|
|
3090
|
-
onCellDoubleClick:
|
|
3091
|
-
onContextMenu:
|
|
3092
|
-
onCellContextMenu:
|
|
3038
|
+
onClick: De,
|
|
3039
|
+
onDoubleClick: Oe,
|
|
3040
|
+
onCellClick: Ae,
|
|
3041
|
+
onCellDoubleClick: je,
|
|
3042
|
+
onContextMenu: ke,
|
|
3043
|
+
onCellContextMenu: Me,
|
|
3093
3044
|
expansion: gt,
|
|
3094
|
-
color:
|
|
3095
|
-
backgroundColor:
|
|
3096
|
-
className:
|
|
3097
|
-
style:
|
|
3098
|
-
customAttributes:
|
|
3045
|
+
color: We,
|
|
3046
|
+
backgroundColor: U,
|
|
3047
|
+
className: Ke,
|
|
3048
|
+
style: qe,
|
|
3049
|
+
customAttributes: Je,
|
|
3099
3050
|
selectorCellShadowVisible: It,
|
|
3100
3051
|
selectionColumnClassName: k,
|
|
3101
3052
|
selectionColumnStyle: A,
|
|
3102
3053
|
idAccessor: w,
|
|
3103
|
-
rowFactory:
|
|
3054
|
+
rowFactory: ot
|
|
3104
3055
|
}, n);
|
|
3105
|
-
}) : p(
|
|
3056
|
+
}) : p(un, {})
|
|
3106
3057
|
}),
|
|
3107
|
-
dt.some(({ footer: e }) => e) && p(
|
|
3108
|
-
ref:
|
|
3109
|
-
className:
|
|
3110
|
-
style:
|
|
3058
|
+
dt.some(({ footer: e }) => e) && p(rr, {
|
|
3059
|
+
ref: J.footer,
|
|
3060
|
+
className: K?.footer,
|
|
3061
|
+
style: q?.footer,
|
|
3111
3062
|
columns: dt,
|
|
3112
3063
|
defaultColumnProps: S,
|
|
3113
3064
|
pinnedMap: _t,
|
|
@@ -3117,45 +3068,45 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3117
3068
|
]
|
|
3118
3069
|
}) })
|
|
3119
3070
|
}),
|
|
3120
|
-
!!(L && wt) && p(
|
|
3121
|
-
className:
|
|
3122
|
-
style:
|
|
3071
|
+
!!(L && wt) && p(Er, {
|
|
3072
|
+
className: K?.pagination,
|
|
3073
|
+
style: q?.pagination,
|
|
3123
3074
|
horizontalSpacing: I,
|
|
3124
3075
|
fetching: h,
|
|
3125
3076
|
page: L,
|
|
3126
3077
|
onPageChange: Ct,
|
|
3127
|
-
totalRecords:
|
|
3128
|
-
recordsPerPage:
|
|
3129
|
-
onRecordsPerPageChange:
|
|
3130
|
-
recordsPerPageOptions:
|
|
3131
|
-
recordsPerPageLabel:
|
|
3132
|
-
paginationWithEdges:
|
|
3133
|
-
paginationWithControls:
|
|
3134
|
-
paginationActiveTextColor:
|
|
3135
|
-
paginationActiveBackgroundColor:
|
|
3136
|
-
paginationSize:
|
|
3137
|
-
paginationText:
|
|
3138
|
-
paginationWrapBreakpoint:
|
|
3139
|
-
getPaginationControlProps:
|
|
3140
|
-
getPaginationItemProps:
|
|
3141
|
-
noRecordsText:
|
|
3142
|
-
loadingText:
|
|
3078
|
+
totalRecords: R,
|
|
3079
|
+
recordsPerPage: re,
|
|
3080
|
+
onRecordsPerPageChange: ie,
|
|
3081
|
+
recordsPerPageOptions: z,
|
|
3082
|
+
recordsPerPageLabel: oe,
|
|
3083
|
+
paginationWithEdges: se,
|
|
3084
|
+
paginationWithControls: ce,
|
|
3085
|
+
paginationActiveTextColor: B,
|
|
3086
|
+
paginationActiveBackgroundColor: le,
|
|
3087
|
+
paginationSize: V,
|
|
3088
|
+
paginationText: ue,
|
|
3089
|
+
paginationWrapBreakpoint: de,
|
|
3090
|
+
getPaginationControlProps: fe,
|
|
3091
|
+
getPaginationItemProps: pe,
|
|
3092
|
+
noRecordsText: Se,
|
|
3093
|
+
loadingText: be,
|
|
3143
3094
|
recordsLength: wt,
|
|
3144
|
-
renderPagination:
|
|
3095
|
+
renderPagination: me
|
|
3145
3096
|
}),
|
|
3146
|
-
p(
|
|
3097
|
+
p(Sr, {
|
|
3147
3098
|
fetching: h,
|
|
3148
|
-
backgroundBlur:
|
|
3149
|
-
customContent:
|
|
3150
|
-
size:
|
|
3151
|
-
type:
|
|
3152
|
-
color:
|
|
3099
|
+
backgroundBlur: he,
|
|
3100
|
+
customContent: ge,
|
|
3101
|
+
size: _e,
|
|
3102
|
+
type: ve,
|
|
3103
|
+
color: ye
|
|
3153
3104
|
}),
|
|
3154
|
-
p(
|
|
3155
|
-
icon:
|
|
3156
|
-
text:
|
|
3105
|
+
p(fn, {
|
|
3106
|
+
icon: Ce,
|
|
3107
|
+
text: Se,
|
|
3157
3108
|
active: !h && !wt,
|
|
3158
|
-
children:
|
|
3109
|
+
children: xe
|
|
3159
3110
|
})
|
|
3160
3111
|
]
|
|
3161
3112
|
})
|
|
@@ -3163,26 +3114,26 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3163
3114
|
}
|
|
3164
3115
|
//#endregion
|
|
3165
3116
|
//#region src/DataTable/UpdateModal.tsx
|
|
3166
|
-
function
|
|
3167
|
-
let { data: s, isLoading: c } =
|
|
3168
|
-
return c || !s ? /* @__PURE__ */ m(
|
|
3117
|
+
function Pr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3118
|
+
let { data: s, isLoading: c } = Bt(i, n, a), { mutateAsync: l, isPending: u, error: d } = Wt(i, n, r);
|
|
3119
|
+
return c || !s ? /* @__PURE__ */ m(re, {
|
|
3169
3120
|
gap: "md",
|
|
3170
3121
|
children: [
|
|
3171
|
-
/* @__PURE__ */ p(
|
|
3172
|
-
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(
|
|
3122
|
+
/* @__PURE__ */ p(R, { height: 40 }),
|
|
3123
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(R, { height: 35 }, t)),
|
|
3173
3124
|
/* @__PURE__ */ m(T, {
|
|
3174
3125
|
mt: "md",
|
|
3175
3126
|
justify: "end",
|
|
3176
|
-
children: [/* @__PURE__ */ p(
|
|
3127
|
+
children: [/* @__PURE__ */ p(R, {
|
|
3177
3128
|
width: 100,
|
|
3178
3129
|
height: 36
|
|
3179
|
-
}), /* @__PURE__ */ p(
|
|
3130
|
+
}), /* @__PURE__ */ p(R, {
|
|
3180
3131
|
width: 100,
|
|
3181
3132
|
height: 36
|
|
3182
3133
|
})]
|
|
3183
3134
|
})
|
|
3184
3135
|
]
|
|
3185
|
-
}) : /* @__PURE__ */ p(
|
|
3136
|
+
}) : /* @__PURE__ */ p(en, {
|
|
3186
3137
|
fields: e,
|
|
3187
3138
|
steps: o,
|
|
3188
3139
|
record: s,
|
|
@@ -3200,8 +3151,8 @@ function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath
|
|
|
3200
3151
|
}
|
|
3201
3152
|
//#endregion
|
|
3202
3153
|
//#region src/DataTable/DeleteModal.tsx
|
|
3203
|
-
function
|
|
3204
|
-
let { mutateAsync: o, isError: c, error: l, isPending: u } =
|
|
3154
|
+
function Fr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, selectedRecords: i, confirmMessage: a }) {
|
|
3155
|
+
let { mutateAsync: o, isError: c, error: l, isPending: u } = Gt(n, e, t), [h, g] = d(i), [v, b] = d(!1), x = v || u;
|
|
3205
3156
|
return s(() => {
|
|
3206
3157
|
h.length || r();
|
|
3207
3158
|
}, [r, h]), h.length ? /* @__PURE__ */ m(f, { children: [
|
|
@@ -3211,7 +3162,7 @@ function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
|
|
|
3211
3162
|
title: l.name,
|
|
3212
3163
|
children: l.message
|
|
3213
3164
|
}),
|
|
3214
|
-
/* @__PURE__ */ p(
|
|
3165
|
+
/* @__PURE__ */ p(V, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3215
3166
|
/* @__PURE__ */ m(T, {
|
|
3216
3167
|
mt: "md",
|
|
3217
3168
|
justify: "end",
|
|
@@ -3238,7 +3189,7 @@ function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
|
|
|
3238
3189
|
}
|
|
3239
3190
|
//#endregion
|
|
3240
3191
|
//#region src/Hooks/usePersistentState.ts
|
|
3241
|
-
function
|
|
3192
|
+
function Ir(e, t) {
|
|
3242
3193
|
let n = `use_persistent_storage_${t}`, [r, i] = d(() => {
|
|
3243
3194
|
try {
|
|
3244
3195
|
let t = localStorage.getItem(n);
|
|
@@ -3256,12 +3207,12 @@ function zr(e, t) {
|
|
|
3256
3207
|
}
|
|
3257
3208
|
//#endregion
|
|
3258
3209
|
//#region src/utils/sort.ts
|
|
3259
|
-
var
|
|
3210
|
+
var Lr = [
|
|
3260
3211
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
3261
3212
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
3262
3213
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
3263
3214
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
3264
|
-
],
|
|
3215
|
+
], Rr = (e, t) => {
|
|
3265
3216
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
3266
3217
|
if (n.length === 0) return "string";
|
|
3267
3218
|
let r = n.slice(0, 100), i = {
|
|
@@ -3277,7 +3228,7 @@ var Br = [
|
|
|
3277
3228
|
i.number++;
|
|
3278
3229
|
return;
|
|
3279
3230
|
}
|
|
3280
|
-
if (
|
|
3231
|
+
if (Lr.some((e) => e.test(t))) {
|
|
3281
3232
|
let e = new Date(t);
|
|
3282
3233
|
if (!isNaN(e.getTime())) {
|
|
3283
3234
|
i.date++;
|
|
@@ -3290,7 +3241,7 @@ var Br = [
|
|
|
3290
3241
|
let a = i.string + i.number + i.date;
|
|
3291
3242
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
3292
3243
|
};
|
|
3293
|
-
function
|
|
3244
|
+
function zr(e, t) {
|
|
3294
3245
|
switch (t) {
|
|
3295
3246
|
case "date":
|
|
3296
3247
|
if (typeof e == "string") {
|
|
@@ -3306,54 +3257,54 @@ function Hr(e, t) {
|
|
|
3306
3257
|
default: return String(e).toLowerCase().trim();
|
|
3307
3258
|
}
|
|
3308
3259
|
}
|
|
3309
|
-
var
|
|
3260
|
+
var Br = (e, t, n = "asc") => {
|
|
3310
3261
|
if (!e || e.length === 0) return [];
|
|
3311
|
-
let r =
|
|
3262
|
+
let r = Rr(e, t);
|
|
3312
3263
|
return [...e].sort((e, i) => {
|
|
3313
3264
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
3314
3265
|
if (s && c) return 0;
|
|
3315
3266
|
if (s) return n === "asc" ? -1 : 1;
|
|
3316
3267
|
if (c) return n === "asc" ? 1 : -1;
|
|
3317
|
-
let l =
|
|
3268
|
+
let l = zr(a, r), u = zr(o, r);
|
|
3318
3269
|
return l === null && u === null ? 0 : l === null ? n === "asc" ? 1 : -1 : u === null || l < u ? n === "asc" ? -1 : 1 : l > u ? n === "asc" ? 1 : -1 : 0;
|
|
3319
3270
|
});
|
|
3320
3271
|
};
|
|
3321
3272
|
//#endregion
|
|
3322
3273
|
//#region src/utils/filter.ts
|
|
3323
|
-
function
|
|
3274
|
+
function Vr(e) {
|
|
3324
3275
|
return !!e && typeof e == "object" && "id" in e;
|
|
3325
3276
|
}
|
|
3326
|
-
function
|
|
3277
|
+
function Hr(e, t) {
|
|
3327
3278
|
if (typeof e == "string" || typeof e == "number") return t.includes(String(e));
|
|
3328
3279
|
if (e && typeof e == "object") {
|
|
3329
3280
|
let n = e;
|
|
3330
|
-
return
|
|
3281
|
+
return Vr(n) && t.includes(n.id) ? !0 : Object.values(n).some((e) => typeof e == "string" && t.includes(e) || Vr(e) && t.includes(e.id));
|
|
3331
3282
|
}
|
|
3332
3283
|
return !1;
|
|
3333
3284
|
}
|
|
3334
|
-
function
|
|
3335
|
-
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) =>
|
|
3285
|
+
function Ur(e, t) {
|
|
3286
|
+
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) => Hr(e, t)) : Vr(e) ? t.includes(e.id) : !1 : typeof e == "string" && e.includes(t);
|
|
3336
3287
|
}
|
|
3337
|
-
function
|
|
3288
|
+
function Wr(e, [t, n]) {
|
|
3338
3289
|
if (!t && !n || typeof e != "string") return !0;
|
|
3339
3290
|
let r = e.split(" ")[0];
|
|
3340
3291
|
return t && n ? r >= t && r <= n : t ? r >= t : r <= n;
|
|
3341
3292
|
}
|
|
3342
|
-
function
|
|
3293
|
+
function Gr(e, t) {
|
|
3343
3294
|
if (t.value === void 0) return !0;
|
|
3344
3295
|
let n = e[t.id];
|
|
3345
3296
|
switch (t.type) {
|
|
3346
|
-
case "query": return
|
|
3347
|
-
case "date": return
|
|
3297
|
+
case "query": return Ur(n, t.value);
|
|
3298
|
+
case "date": return Wr(n, t.value);
|
|
3348
3299
|
case "boolean": return n === t.value;
|
|
3349
3300
|
}
|
|
3350
3301
|
}
|
|
3351
|
-
function
|
|
3352
|
-
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) =>
|
|
3302
|
+
function Kr(e, t) {
|
|
3303
|
+
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => Gr(e, t)));
|
|
3353
3304
|
}
|
|
3354
3305
|
//#endregion
|
|
3355
3306
|
//#region src/DataTable/FieldCard.tsx
|
|
3356
|
-
function
|
|
3307
|
+
function qr({ rows: e }) {
|
|
3357
3308
|
return /* @__PURE__ */ p(f, { children: e.map((e, t) => /* @__PURE__ */ m(v, { children: [t > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ m(T, {
|
|
3358
3309
|
wrap: "nowrap",
|
|
3359
3310
|
justify: "space-between",
|
|
@@ -3361,7 +3312,7 @@ function Xr({ rows: e }) {
|
|
|
3361
3312
|
gap: "md",
|
|
3362
3313
|
py: "xs",
|
|
3363
3314
|
px: "sm",
|
|
3364
|
-
children: [/* @__PURE__ */ p(
|
|
3315
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3365
3316
|
fw: 700,
|
|
3366
3317
|
fz: "sm",
|
|
3367
3318
|
style: { flexShrink: 0 },
|
|
@@ -3374,39 +3325,39 @@ function Xr({ rows: e }) {
|
|
|
3374
3325
|
})]
|
|
3375
3326
|
})] }, typeof e.label == "string" ? e.label : t)) });
|
|
3376
3327
|
}
|
|
3377
|
-
function
|
|
3328
|
+
function Jr({ rows: e }) {
|
|
3378
3329
|
return /* @__PURE__ */ p(v, {
|
|
3379
3330
|
bg: "var(--mantine-color-gray-light)",
|
|
3380
3331
|
style: {
|
|
3381
3332
|
borderRadius: "var(--mantine-radius-md)",
|
|
3382
3333
|
overflow: "hidden"
|
|
3383
3334
|
},
|
|
3384
|
-
children: /* @__PURE__ */ p(
|
|
3335
|
+
children: /* @__PURE__ */ p(qr, { rows: e })
|
|
3385
3336
|
});
|
|
3386
3337
|
}
|
|
3387
3338
|
//#endregion
|
|
3388
3339
|
//#region src/DataTable/MobileCardList.tsx
|
|
3389
|
-
function
|
|
3340
|
+
function Yr(e, t) {
|
|
3390
3341
|
return t.split(".").reduce((e, t) => {
|
|
3391
3342
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
3392
3343
|
}, e);
|
|
3393
3344
|
}
|
|
3394
|
-
function
|
|
3345
|
+
function Xr(e, t) {
|
|
3395
3346
|
let n = t.column;
|
|
3396
3347
|
if (n.render) return n.render(e, 0);
|
|
3397
|
-
let r =
|
|
3398
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3348
|
+
let r = Yr(e, n.accessor ?? t.id);
|
|
3349
|
+
return r == null ? /* @__PURE__ */ p(V, {
|
|
3399
3350
|
c: "dimmed",
|
|
3400
3351
|
children: "–"
|
|
3401
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3352
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(V, {
|
|
3402
3353
|
fz: "sm",
|
|
3403
3354
|
children: r ? "Ja" : "Nein"
|
|
3404
|
-
}) : /* @__PURE__ */ p(
|
|
3355
|
+
}) : /* @__PURE__ */ p(V, {
|
|
3405
3356
|
fz: "sm",
|
|
3406
3357
|
children: String(r)
|
|
3407
3358
|
});
|
|
3408
3359
|
}
|
|
3409
|
-
function
|
|
3360
|
+
function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3410
3361
|
let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
|
|
3411
3362
|
if (y) {
|
|
3412
3363
|
let { recordIds: t, onRecordIdsChange: n } = y;
|
|
@@ -3428,7 +3379,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3428
3379
|
event: n
|
|
3429
3380
|
});
|
|
3430
3381
|
};
|
|
3431
|
-
return /* @__PURE__ */ m(
|
|
3382
|
+
return /* @__PURE__ */ m(re, {
|
|
3432
3383
|
gap: "sm",
|
|
3433
3384
|
my: "md",
|
|
3434
3385
|
children: [
|
|
@@ -3446,7 +3397,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3446
3397
|
variant: "filled",
|
|
3447
3398
|
size: "input-sm",
|
|
3448
3399
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3449
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3400
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(De, { size: 18 }) : /* @__PURE__ */ p(Oe, { size: 18 })
|
|
3450
3401
|
})] }), E.length > 0 && /* @__PURE__ */ m(F, {
|
|
3451
3402
|
opened: M,
|
|
3452
3403
|
onChange: N,
|
|
@@ -3464,7 +3415,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3464
3415
|
size: "input-sm",
|
|
3465
3416
|
onClick: () => N((e) => !e),
|
|
3466
3417
|
"aria-label": "Filter",
|
|
3467
|
-
children: /* @__PURE__ */ p(
|
|
3418
|
+
children: /* @__PURE__ */ p(Ce, { size: 18 })
|
|
3468
3419
|
})
|
|
3469
3420
|
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3470
3421
|
p: 0,
|
|
@@ -3479,7 +3430,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3479
3430
|
value: e.id,
|
|
3480
3431
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3481
3432
|
gap: "xs",
|
|
3482
|
-
children: [/* @__PURE__ */ p(
|
|
3433
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3483
3434
|
fw: 600,
|
|
3484
3435
|
fz: "sm",
|
|
3485
3436
|
children: e.column.title ?? e.id
|
|
@@ -3495,7 +3446,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3495
3446
|
})]
|
|
3496
3447
|
})]
|
|
3497
3448
|
}),
|
|
3498
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3449
|
+
e.length === 0 && /* @__PURE__ */ p(V, {
|
|
3499
3450
|
c: "dimmed",
|
|
3500
3451
|
ta: "center",
|
|
3501
3452
|
py: "xl",
|
|
@@ -3530,7 +3481,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3530
3481
|
color: "gray",
|
|
3531
3482
|
size: "sm",
|
|
3532
3483
|
onClick: (e) => e.stopPropagation(),
|
|
3533
|
-
children: /* @__PURE__ */ p(
|
|
3484
|
+
children: /* @__PURE__ */ p(Se, { size: 16 })
|
|
3534
3485
|
}) }), /* @__PURE__ */ p(k.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(k.Item, {
|
|
3535
3486
|
leftSection: t.icon,
|
|
3536
3487
|
onClick: (n) => {
|
|
@@ -3540,9 +3491,9 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3540
3491
|
}, `card_action_${n}`)) })]
|
|
3541
3492
|
});
|
|
3542
3493
|
})()
|
|
3543
|
-
}), /* @__PURE__ */ p(
|
|
3494
|
+
}), /* @__PURE__ */ p(qr, { rows: w.map((t) => ({
|
|
3544
3495
|
label: t.column.title ?? t.id,
|
|
3545
|
-
value:
|
|
3496
|
+
value: Xr(e, t)
|
|
3546
3497
|
})) })]
|
|
3547
3498
|
}), c && /* @__PURE__ */ m(S, {
|
|
3548
3499
|
expanded: u,
|
|
@@ -3554,7 +3505,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3554
3505
|
})]
|
|
3555
3506
|
}) }, s);
|
|
3556
3507
|
}),
|
|
3557
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3508
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(re, {
|
|
3558
3509
|
gap: "xs",
|
|
3559
3510
|
mt: "sm",
|
|
3560
3511
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3568,7 +3519,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3568
3519
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3569
3520
|
justify: "center",
|
|
3570
3521
|
gap: "xs",
|
|
3571
|
-
children: [/* @__PURE__ */ p(
|
|
3522
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3572
3523
|
fz: "xs",
|
|
3573
3524
|
c: "dimmed",
|
|
3574
3525
|
children: "Einträge pro Seite:"
|
|
@@ -3590,101 +3541,106 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3590
3541
|
}
|
|
3591
3542
|
//#endregion
|
|
3592
3543
|
//#region src/DataTable/DataTable.tsx
|
|
3593
|
-
var
|
|
3544
|
+
var Qr = [
|
|
3594
3545
|
10,
|
|
3595
3546
|
15,
|
|
3596
3547
|
50,
|
|
3597
3548
|
100,
|
|
3598
3549
|
500
|
|
3599
3550
|
];
|
|
3600
|
-
function
|
|
3601
|
-
let [
|
|
3602
|
-
F === void 0 &&
|
|
3603
|
-
},
|
|
3551
|
+
function $r({ 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: ie, autoPoll: ae, rowExpansion: z, onRowClick: oe, mobileCards: se = !1, deleteConfirmMessage: ce, editRecordId: B, onEditRecordIdChange: ue }) {
|
|
3552
|
+
let [de, pe] = d(ee || (P && P.length > 0 ? P[0].value : null)), me = F === void 0 ? de : F, he = (e) => {
|
|
3553
|
+
F === void 0 && pe(e), te && te(e);
|
|
3554
|
+
}, ge = P?.find((e) => e.value === me), _e = ge?.queryParams || {}, ve = ge?.apiPath ?? a, ye = ge?.mutationApiPath ?? o ?? ve, Se = {
|
|
3604
3555
|
...M,
|
|
3605
|
-
...
|
|
3606
|
-
},
|
|
3556
|
+
..._e
|
|
3557
|
+
}, Ce = Se ? "?" + Object.entries(Se).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", De = me ? [...n, me] : n, { data: Oe, isLoading: Ae, isError: je, isRefetching: Me, refetch: Ne } = Vt(ve + Ce, De), Pe = Kr(Array.isArray(Oe) ? Oe : [], S), [Fe, Ie] = d(!1), Le = u(() => {});
|
|
3607
3558
|
s(() => {
|
|
3608
|
-
|
|
3559
|
+
Le.current = ie ?? (() => Ne());
|
|
3609
3560
|
});
|
|
3610
|
-
let
|
|
3561
|
+
let Re = typeof ae == "function" ? ae(Array.isArray(Oe) ? Oe : []) : ae ?? !1;
|
|
3611
3562
|
s(() => {
|
|
3612
|
-
if (!
|
|
3563
|
+
if (!Re) return;
|
|
3613
3564
|
let e = setInterval(() => {
|
|
3614
|
-
Promise.resolve(
|
|
3615
|
-
},
|
|
3565
|
+
Promise.resolve(Le.current()).catch(() => {});
|
|
3566
|
+
}, Re);
|
|
3616
3567
|
return () => clearInterval(e);
|
|
3617
|
-
}, [
|
|
3618
|
-
let [
|
|
3568
|
+
}, [Re]);
|
|
3569
|
+
let [ze, Be] = d({
|
|
3619
3570
|
columnAccessor: O?.field ?? h[0].id,
|
|
3620
3571
|
direction: O?.direction ?? "desc"
|
|
3621
3572
|
}), Ve = (e) => {
|
|
3622
3573
|
Be(e), A && A(String(e.columnAccessor), e.direction);
|
|
3623
|
-
}, H =
|
|
3624
|
-
|
|
3625
|
-
},
|
|
3626
|
-
|
|
3574
|
+
}, H = Br(Pe, ze.columnAccessor, ze.direction), [He, Ue] = Ir(Qr[1], "mantine-table-page-size"), [We, U] = d(1), Ge = Math.max(1, Math.ceil(H.length / He)), Ke = Math.min(We, Ge), qe = (e) => {
|
|
3575
|
+
Ue(e), U(1);
|
|
3576
|
+
}, Je = x ? H.slice((Ke - 1) * He, Ke * He) : H, [Ye, Xe] = d([]), Ze = z?.expanded?.recordIds ?? Ye, Qe = z?.expanded?.onRecordIdsChange ?? Xe, $e = (e) => {
|
|
3577
|
+
Ze.includes(e) ? Qe(Ze.filter((t) => t !== e)) : Qe(z?.allowMultiple ? [...Ze, e] : [e]);
|
|
3578
|
+
}, et = h.findIndex((e) => e.list && e.column && !e.column.hidden), tt = z && et >= 0 ? h.map((e, t) => {
|
|
3579
|
+
if (t !== et) return e;
|
|
3627
3580
|
let n = e.column.render;
|
|
3628
3581
|
return {
|
|
3629
3582
|
...e,
|
|
3630
3583
|
column: {
|
|
3631
3584
|
...e.column,
|
|
3632
|
-
render: (t, r) =>
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
flexShrink: 0,
|
|
3645
|
-
cursor: "pointer"
|
|
3646
|
-
},
|
|
3647
|
-
children: /* @__PURE__ */ p(Se, {
|
|
3648
|
-
size: 16,
|
|
3585
|
+
render: (t, r) => {
|
|
3586
|
+
let i = !z.expandable || z.expandable(t);
|
|
3587
|
+
return /* @__PURE__ */ m(T, {
|
|
3588
|
+
gap: "xs",
|
|
3589
|
+
wrap: "nowrap",
|
|
3590
|
+
align: "center",
|
|
3591
|
+
children: [i ? /* @__PURE__ */ p(v, {
|
|
3592
|
+
component: "span",
|
|
3593
|
+
"aria-label": "Aufklappen",
|
|
3594
|
+
onClick: (e) => {
|
|
3595
|
+
e.stopPropagation(), $e(t.id);
|
|
3596
|
+
},
|
|
3649
3597
|
style: {
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
}
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3598
|
+
display: "inline-flex",
|
|
3599
|
+
flexShrink: 0,
|
|
3600
|
+
cursor: "pointer"
|
|
3601
|
+
},
|
|
3602
|
+
children: /* @__PURE__ */ p(xe, {
|
|
3603
|
+
size: 16,
|
|
3604
|
+
style: {
|
|
3605
|
+
color: "var(--mantine-primary-color-filled)",
|
|
3606
|
+
transform: Ze.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3607
|
+
transition: "transform 200ms ease"
|
|
3608
|
+
}
|
|
3609
|
+
})
|
|
3610
|
+
}) : /* @__PURE__ */ p(v, {
|
|
3611
|
+
w: 16,
|
|
3612
|
+
style: { flexShrink: 0 }
|
|
3613
|
+
}), n ? n(t, r) : String(vn(t, e.column.accessor) ?? "")]
|
|
3614
|
+
});
|
|
3615
|
+
}
|
|
3660
3616
|
}
|
|
3661
3617
|
};
|
|
3662
|
-
}) : h, [
|
|
3618
|
+
}) : h, [W, G] = d([]);
|
|
3663
3619
|
s(() => {
|
|
3664
|
-
|
|
3665
|
-
}, [
|
|
3666
|
-
let [
|
|
3620
|
+
G([]);
|
|
3621
|
+
}, [me]);
|
|
3622
|
+
let [nt, rt] = d(!1), [it, K] = d(!1), [at, q] = d(!1), ot = u(null);
|
|
3667
3623
|
s(() => {
|
|
3668
|
-
if (!
|
|
3669
|
-
|
|
3624
|
+
if (!B) {
|
|
3625
|
+
ot.current = null;
|
|
3670
3626
|
return;
|
|
3671
3627
|
}
|
|
3672
|
-
if (
|
|
3673
|
-
let e = H.find((e) => e.id ===
|
|
3674
|
-
e && (
|
|
3675
|
-
}, [
|
|
3676
|
-
let
|
|
3677
|
-
return
|
|
3678
|
-
icon: /* @__PURE__ */ p(
|
|
3628
|
+
if (ot.current === B) return;
|
|
3629
|
+
let e = H.find((e) => e.id === B);
|
|
3630
|
+
e && (ot.current = B, G([e]), K(!0), ue?.(null));
|
|
3631
|
+
}, [B, H]);
|
|
3632
|
+
let st = h.some((e) => e.update), ct = h.some((e) => e.delete), lt = [];
|
|
3633
|
+
return st && lt.push({
|
|
3634
|
+
icon: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3679
3635
|
label: "Bearbeiten",
|
|
3680
3636
|
onClick: (e) => {
|
|
3681
|
-
|
|
3637
|
+
G(e), K(!0);
|
|
3682
3638
|
}
|
|
3683
|
-
}), C &&
|
|
3684
|
-
icon: /* @__PURE__ */ p(
|
|
3639
|
+
}), C && lt.push(...C), ct && lt.push({
|
|
3640
|
+
icon: /* @__PURE__ */ p(ke, { size: 14 }),
|
|
3685
3641
|
label: "Löschen",
|
|
3686
3642
|
onClick: (e) => {
|
|
3687
|
-
|
|
3643
|
+
G(e), q(!0);
|
|
3688
3644
|
}
|
|
3689
3645
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3690
3646
|
/* @__PURE__ */ m(w, {
|
|
@@ -3703,7 +3659,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3703
3659
|
gap: 6,
|
|
3704
3660
|
align: "center",
|
|
3705
3661
|
wrap: "nowrap",
|
|
3706
|
-
children: [typeof e == "string" ? /* @__PURE__ */ p(
|
|
3662
|
+
children: [typeof e == "string" ? /* @__PURE__ */ p(fe, {
|
|
3707
3663
|
order: 4,
|
|
3708
3664
|
children: e
|
|
3709
3665
|
}) : e, t != null && /* @__PURE__ */ m(E, {
|
|
@@ -3719,8 +3675,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3719
3675
|
size: "sm",
|
|
3720
3676
|
radius: "xl",
|
|
3721
3677
|
"aria-label": "Mehr Informationen",
|
|
3722
|
-
children: /* @__PURE__ */ p(
|
|
3723
|
-
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(
|
|
3678
|
+
children: /* @__PURE__ */ p(we, { size: 16 })
|
|
3679
|
+
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(V, {
|
|
3724
3680
|
component: "div",
|
|
3725
3681
|
size: "sm",
|
|
3726
3682
|
c: "dimmed",
|
|
@@ -3749,47 +3705,47 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3749
3705
|
children: [
|
|
3750
3706
|
ne && /* @__PURE__ */ p(g, {
|
|
3751
3707
|
variant: "subtle",
|
|
3752
|
-
loading:
|
|
3708
|
+
loading: Fe,
|
|
3753
3709
|
onClick: async () => {
|
|
3754
|
-
if (
|
|
3755
|
-
|
|
3710
|
+
if (ie) {
|
|
3711
|
+
Ie(!0);
|
|
3756
3712
|
try {
|
|
3757
|
-
await
|
|
3713
|
+
await ie();
|
|
3758
3714
|
} finally {
|
|
3759
|
-
|
|
3715
|
+
Ie(!1);
|
|
3760
3716
|
}
|
|
3761
|
-
} else
|
|
3717
|
+
} else Ne();
|
|
3762
3718
|
},
|
|
3763
3719
|
"aria-label": "Neuladen",
|
|
3764
|
-
children: /* @__PURE__ */ p(
|
|
3720
|
+
children: /* @__PURE__ */ p(Ee, {})
|
|
3765
3721
|
}),
|
|
3766
3722
|
(h.some((e) => e.update) || b) && (() => {
|
|
3767
|
-
let e = h.find((e) => e.update) && (!I ||
|
|
3723
|
+
let e = h.find((e) => e.update) && (!I || W.length > 0 && I(W[0])), t = h.find((e) => e.delete) && (!L || W.length > 0 && L(W[0])), n = (C ?? []).length > 0, r = e || t || n;
|
|
3768
3724
|
return /* @__PURE__ */ p(v, {
|
|
3769
|
-
...
|
|
3725
|
+
...se ? { visibleFrom: "sm" } : {},
|
|
3770
3726
|
children: /* @__PURE__ */ m(k, {
|
|
3771
3727
|
shadow: "md",
|
|
3772
3728
|
children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
|
|
3773
3729
|
variant: "outline",
|
|
3774
|
-
rightSection: /* @__PURE__ */ p(
|
|
3775
|
-
disabled: !
|
|
3730
|
+
rightSection: /* @__PURE__ */ p(be, { size: 14 }),
|
|
3731
|
+
disabled: !W.length || !r,
|
|
3776
3732
|
children: "Aktionen"
|
|
3777
3733
|
}) }), /* @__PURE__ */ m(k.Dropdown, { children: [
|
|
3778
3734
|
e && /* @__PURE__ */ p(k.Item, {
|
|
3779
|
-
leftSection: /* @__PURE__ */ p(
|
|
3780
|
-
onClick: () =>
|
|
3781
|
-
disabled:
|
|
3735
|
+
leftSection: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3736
|
+
onClick: () => K(!0),
|
|
3737
|
+
disabled: W.length !== 1,
|
|
3782
3738
|
children: "Bearbeiten"
|
|
3783
3739
|
}),
|
|
3784
3740
|
(C ?? []).map((e, t) => /* @__PURE__ */ i(k.Item, {
|
|
3785
3741
|
...e.icon && { leftSection: e.icon },
|
|
3786
3742
|
key: `custom_action_${t}`,
|
|
3787
|
-
onClick: () => e.onClick(
|
|
3788
|
-
disabled: e.disabled?.(
|
|
3743
|
+
onClick: () => e.onClick(W),
|
|
3744
|
+
disabled: e.disabled?.(W) ?? !1
|
|
3789
3745
|
}, e.label)),
|
|
3790
3746
|
t && /* @__PURE__ */ p(k.Item, {
|
|
3791
|
-
leftSection: /* @__PURE__ */ p(
|
|
3792
|
-
onClick: () =>
|
|
3747
|
+
leftSection: /* @__PURE__ */ p(ke, { size: 14 }),
|
|
3748
|
+
onClick: () => q(!0),
|
|
3793
3749
|
color: "red",
|
|
3794
3750
|
children: "Löschen"
|
|
3795
3751
|
})
|
|
@@ -3798,8 +3754,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3798
3754
|
});
|
|
3799
3755
|
})(),
|
|
3800
3756
|
h.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3801
|
-
onClick: () =>
|
|
3802
|
-
disabled:
|
|
3757
|
+
onClick: () => rt(!0),
|
|
3758
|
+
disabled: Ae,
|
|
3803
3759
|
children: j ?? "Erstellen"
|
|
3804
3760
|
}),
|
|
3805
3761
|
c
|
|
@@ -3807,37 +3763,37 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3807
3763
|
})]
|
|
3808
3764
|
}),
|
|
3809
3765
|
l,
|
|
3810
|
-
P && P.length > 0 && /* @__PURE__ */ p(
|
|
3811
|
-
value:
|
|
3812
|
-
onChange:
|
|
3766
|
+
P && P.length > 0 && /* @__PURE__ */ p(le, {
|
|
3767
|
+
value: me,
|
|
3768
|
+
onChange: he,
|
|
3813
3769
|
mt: "md",
|
|
3814
|
-
children: /* @__PURE__ */ p(
|
|
3770
|
+
children: /* @__PURE__ */ p(le.List, { children: P.map((e) => /* @__PURE__ */ p(le.Tab, {
|
|
3815
3771
|
value: e.value,
|
|
3816
3772
|
leftSection: e.icon,
|
|
3817
3773
|
children: e.label
|
|
3818
3774
|
}, e.value)) })
|
|
3819
3775
|
}),
|
|
3820
|
-
|
|
3776
|
+
je && /* @__PURE__ */ p(_, {
|
|
3821
3777
|
mt: "md",
|
|
3822
3778
|
variant: "light",
|
|
3823
3779
|
color: "red",
|
|
3824
3780
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3825
|
-
icon: /* @__PURE__ */ p(
|
|
3781
|
+
icon: /* @__PURE__ */ p(we, {}),
|
|
3826
3782
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3827
3783
|
}),
|
|
3828
|
-
(
|
|
3784
|
+
(Ae || Me) && /* @__PURE__ */ m(re, {
|
|
3829
3785
|
my: "md",
|
|
3830
|
-
children: [/* @__PURE__ */ p(
|
|
3786
|
+
children: [/* @__PURE__ */ p(R, { height: 40 }), [
|
|
3831
3787
|
,
|
|
3832
3788
|
,
|
|
3833
3789
|
,
|
|
3834
3790
|
,
|
|
3835
3791
|
,
|
|
3836
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3792
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(R, { height: 35 }, `skeleton-${t}`))]
|
|
3837
3793
|
}),
|
|
3838
|
-
!
|
|
3839
|
-
...
|
|
3840
|
-
children: /* @__PURE__ */ p(
|
|
3794
|
+
!Ae && !Me && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3795
|
+
...se ? { visibleFrom: "sm" } : {},
|
|
3796
|
+
children: /* @__PURE__ */ p(Nr, {
|
|
3841
3797
|
my: "md",
|
|
3842
3798
|
withTableBorder: !0,
|
|
3843
3799
|
borderRadius: "md",
|
|
@@ -3845,50 +3801,50 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3845
3801
|
verticalSpacing: "sm",
|
|
3846
3802
|
horizontalSpacing: "md",
|
|
3847
3803
|
minHeight: 150,
|
|
3848
|
-
fetching:
|
|
3849
|
-
records:
|
|
3850
|
-
sortStatus:
|
|
3804
|
+
fetching: je,
|
|
3805
|
+
records: Je,
|
|
3806
|
+
sortStatus: ze,
|
|
3851
3807
|
onSortStatusChange: Ve,
|
|
3852
3808
|
...b && {
|
|
3853
|
-
selectedRecords:
|
|
3854
|
-
onSelectedRecordsChange:
|
|
3809
|
+
selectedRecords: W,
|
|
3810
|
+
onSelectedRecordsChange: G
|
|
3855
3811
|
},
|
|
3856
|
-
...x &&
|
|
3812
|
+
...x && H.length && {
|
|
3857
3813
|
totalRecords: H.length,
|
|
3858
3814
|
recordsPerPage: He,
|
|
3859
|
-
onPageChange:
|
|
3860
|
-
page:
|
|
3861
|
-
recordsPerPageOptions:
|
|
3862
|
-
onRecordsPerPageChange:
|
|
3815
|
+
onPageChange: U,
|
|
3816
|
+
page: Ke,
|
|
3817
|
+
recordsPerPageOptions: Qr,
|
|
3818
|
+
onRecordsPerPageChange: qe,
|
|
3863
3819
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3864
3820
|
},
|
|
3865
|
-
...
|
|
3866
|
-
allowMultiple:
|
|
3867
|
-
trigger:
|
|
3821
|
+
...z && { rowExpansion: {
|
|
3822
|
+
allowMultiple: z.allowMultiple ?? !1,
|
|
3823
|
+
trigger: oe ? "never" : "click",
|
|
3868
3824
|
content: ({ record: e }) => /* @__PURE__ */ p(v, {
|
|
3869
3825
|
bg: "var(--mantine-color-body)",
|
|
3870
|
-
children:
|
|
3826
|
+
children: z.content(e, !1)
|
|
3871
3827
|
}),
|
|
3872
3828
|
expanded: {
|
|
3873
|
-
recordIds:
|
|
3874
|
-
onRecordIdsChange:
|
|
3829
|
+
recordIds: Ze,
|
|
3830
|
+
onRecordIdsChange: Qe
|
|
3875
3831
|
},
|
|
3876
|
-
...
|
|
3832
|
+
...z.expandable && { expandable: ({ record: e }) => z.expandable(e) }
|
|
3877
3833
|
} },
|
|
3878
|
-
columns:
|
|
3834
|
+
columns: tt.map((e) => e.column),
|
|
3879
3835
|
noRecordsText: "Keine Einträge gefunden",
|
|
3880
|
-
onRowClick:
|
|
3881
|
-
...
|
|
3836
|
+
onRowClick: oe,
|
|
3837
|
+
...oe && { style: { cursor: "pointer" } }
|
|
3882
3838
|
})
|
|
3883
|
-
}),
|
|
3839
|
+
}), se && /* @__PURE__ */ p(v, {
|
|
3884
3840
|
hiddenFrom: "sm",
|
|
3885
|
-
children: /* @__PURE__ */ p(
|
|
3886
|
-
records:
|
|
3887
|
-
fields:
|
|
3888
|
-
onRowClick:
|
|
3841
|
+
children: /* @__PURE__ */ p(Zr, {
|
|
3842
|
+
records: Je,
|
|
3843
|
+
fields: tt,
|
|
3844
|
+
onRowClick: oe,
|
|
3889
3845
|
sort: {
|
|
3890
|
-
field: String(
|
|
3891
|
-
direction:
|
|
3846
|
+
field: String(ze.columnAccessor),
|
|
3847
|
+
direction: ze.direction,
|
|
3892
3848
|
onSortChange: (e, t) => {
|
|
3893
3849
|
Ve({
|
|
3894
3850
|
columnAccessor: e,
|
|
@@ -3896,78 +3852,76 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3896
3852
|
});
|
|
3897
3853
|
}
|
|
3898
3854
|
},
|
|
3899
|
-
...x &&
|
|
3855
|
+
...x && H.length && { pagination: {
|
|
3900
3856
|
totalRecords: H.length,
|
|
3901
3857
|
recordsPerPage: He,
|
|
3902
|
-
page:
|
|
3903
|
-
onPageChange:
|
|
3904
|
-
recordsPerPageOptions:
|
|
3905
|
-
onRecordsPerPageChange:
|
|
3906
|
-
Ue(e), W(1);
|
|
3907
|
-
}
|
|
3858
|
+
page: Ke,
|
|
3859
|
+
onPageChange: U,
|
|
3860
|
+
recordsPerPageOptions: Qr,
|
|
3861
|
+
onRecordsPerPageChange: qe
|
|
3908
3862
|
} },
|
|
3909
|
-
...
|
|
3910
|
-
content:
|
|
3863
|
+
...z && { rowExpansion: {
|
|
3864
|
+
content: z.content,
|
|
3911
3865
|
expanded: {
|
|
3912
|
-
recordIds:
|
|
3913
|
-
onRecordIdsChange:
|
|
3866
|
+
recordIds: Ze,
|
|
3867
|
+
onRecordIdsChange: Qe
|
|
3914
3868
|
},
|
|
3915
|
-
...
|
|
3869
|
+
...z.expandable && { expandable: z.expandable }
|
|
3916
3870
|
} },
|
|
3917
|
-
...
|
|
3918
|
-
actions:
|
|
3871
|
+
...lt.length > 0 && {
|
|
3872
|
+
actions: lt,
|
|
3919
3873
|
canUpdate: I,
|
|
3920
3874
|
canDelete: L
|
|
3921
3875
|
}
|
|
3922
3876
|
})
|
|
3923
3877
|
})] }),
|
|
3924
3878
|
/* @__PURE__ */ p(N, {
|
|
3925
|
-
opened:
|
|
3879
|
+
opened: it,
|
|
3926
3880
|
onClose: () => {
|
|
3927
|
-
|
|
3881
|
+
K(!1), G([]);
|
|
3928
3882
|
},
|
|
3929
3883
|
title: e ?? "Bearbeiten",
|
|
3930
|
-
children:
|
|
3884
|
+
children: W.length > 0 && /* @__PURE__ */ p(Pr, {
|
|
3931
3885
|
fields: h.filter((e) => e.update),
|
|
3932
3886
|
queryKey: n,
|
|
3933
3887
|
connectedQueryKeys: r,
|
|
3934
|
-
apiPath:
|
|
3935
|
-
id:
|
|
3888
|
+
apiPath: ye,
|
|
3889
|
+
id: W[0].id,
|
|
3936
3890
|
onClose: () => {
|
|
3937
|
-
|
|
3891
|
+
K(!1), G([]);
|
|
3938
3892
|
},
|
|
3939
3893
|
steps: D
|
|
3940
3894
|
})
|
|
3941
3895
|
}),
|
|
3942
|
-
|
|
3943
|
-
opened:
|
|
3896
|
+
W.length > 0 && /* @__PURE__ */ p(N, {
|
|
3897
|
+
opened: at,
|
|
3944
3898
|
onClose: () => {
|
|
3945
|
-
|
|
3899
|
+
q(!1), G([]);
|
|
3946
3900
|
},
|
|
3947
3901
|
title: e ?? "Löschen",
|
|
3948
|
-
children: /* @__PURE__ */ p(
|
|
3902
|
+
children: /* @__PURE__ */ p(Fr, {
|
|
3949
3903
|
onClose: () => {
|
|
3950
|
-
|
|
3904
|
+
q(!1), G([]);
|
|
3951
3905
|
},
|
|
3952
3906
|
queryKey: n,
|
|
3953
3907
|
connectedQueryKeys: r,
|
|
3954
|
-
apiPath:
|
|
3955
|
-
selectedRecords:
|
|
3956
|
-
confirmMessage:
|
|
3908
|
+
apiPath: ye,
|
|
3909
|
+
selectedRecords: W,
|
|
3910
|
+
confirmMessage: ce
|
|
3957
3911
|
})
|
|
3958
3912
|
}),
|
|
3959
3913
|
/* @__PURE__ */ p(N, {
|
|
3960
|
-
opened:
|
|
3914
|
+
opened: nt,
|
|
3961
3915
|
onClose: () => {
|
|
3962
|
-
|
|
3916
|
+
rt(!1);
|
|
3963
3917
|
},
|
|
3964
3918
|
title: e ?? "Anlegen",
|
|
3965
|
-
children: /* @__PURE__ */ p(
|
|
3919
|
+
children: /* @__PURE__ */ p(tn, {
|
|
3966
3920
|
queryKey: n,
|
|
3967
3921
|
connectedQueryKeys: r,
|
|
3968
|
-
apiPath:
|
|
3922
|
+
apiPath: ye,
|
|
3969
3923
|
onClose: () => {
|
|
3970
|
-
|
|
3924
|
+
rt(!1);
|
|
3971
3925
|
},
|
|
3972
3926
|
fields: h.filter((e) => e.create),
|
|
3973
3927
|
steps: D
|
|
@@ -3977,24 +3931,28 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3977
3931
|
}
|
|
3978
3932
|
//#endregion
|
|
3979
3933
|
//#region src/DataTable/SubTable.tsx
|
|
3980
|
-
function
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3934
|
+
function ei({ mobile: e, columns: t, ...n }) {
|
|
3935
|
+
if (e) {
|
|
3936
|
+
let e = n.records ?? [];
|
|
3937
|
+
return /* @__PURE__ */ p(re, {
|
|
3938
|
+
gap: "sm",
|
|
3939
|
+
style: { fontVariantNumeric: "tabular-nums" },
|
|
3940
|
+
children: e.map((e, r) => {
|
|
3941
|
+
let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
|
|
3942
|
+
label: t.title ?? pn(String(t.accessor)),
|
|
3943
|
+
value: t.render ? t.render(e, r) : vn(e, t.accessor)
|
|
3944
|
+
})), a = n.idAccessor ? Q(e, n.idAccessor) : r;
|
|
3945
|
+
return /* @__PURE__ */ p(Jr, { rows: i }, a);
|
|
3946
|
+
})
|
|
3947
|
+
});
|
|
3948
|
+
}
|
|
3949
|
+
return /* @__PURE__ */ p(Nr, {
|
|
3992
3950
|
backgroundColor: "transparent",
|
|
3993
3951
|
columns: t,
|
|
3994
3952
|
...n
|
|
3995
3953
|
});
|
|
3996
3954
|
}
|
|
3997
3955
|
//#endregion
|
|
3998
|
-
export {
|
|
3956
|
+
export { tn as CreateModal, $r as DataTable, Ot as DataTableProvider, Fr as DeleteModal, Jr as FieldCard, Zr as MobileCardList, ei as SubTable, Pr as UpdateModal, Rt as api, Lt as createOne, It as deleteOne, Pt as getAll, Ft as getOne, Br as sortData, zt as updateOne, Ut as useAddOne, kt as useDataTable, Gt as useDeleteOne, Vt as useGetAll, Bt as useGetOne, Ir as usePersistentState, Wt as useUpdateOne };
|
|
3999
3957
|
|
|
4000
3958
|
//# sourceMappingURL=index.es.js.map
|