@espresso-lab/mantine-data-table 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/CreateModal.d.ts +2 -1
- package/dist/DataTable/DeleteModal.d.ts +2 -1
- package/dist/DataTable/EntityForm.d.ts +1 -1
- package/dist/DataTable/UpdateModal.d.ts +2 -1
- package/dist/Hooks/useApi.d.ts +12 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +621 -620
- 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 +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as P, Popover as F, PopoverDropdown as ee, PopoverTarget as I, ScrollArea as L, Select as R, Skeleton as te, Stack as z, Stepper as ne, Table as re, TableTd as ie, TableTfoot as ae, TableTh as oe, TableThead as se, TableTr as
|
|
5
|
-
import { DateInput as
|
|
6
|
-
import { useForm as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as P, Popover as F, PopoverDropdown as ee, PopoverTarget as I, ScrollArea as L, Select as R, Skeleton as te, Stack as z, Stepper as ne, Table as re, TableTd as ie, TableTfoot as ae, TableTh as oe, TableThead as se, TableTr as ce, Tabs as le, Text as B, 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 V, useMediaQuery as Me, useMergedRef as Ne, useTimeout as Pe } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var Fe = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var Ne = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
},
|
|
24
|
+
}, Ie = new class extends Fe {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var Ne = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), Le = {
|
|
62
62
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
63
63
|
clearTimeout: (e) => clearTimeout(e),
|
|
64
64
|
setInterval: (e, t) => setInterval(e, t),
|
|
65
65
|
clearInterval: (e) => clearInterval(e)
|
|
66
|
-
},
|
|
67
|
-
#e =
|
|
66
|
+
}, Re = new class {
|
|
67
|
+
#e = Le;
|
|
68
68
|
#t = !1;
|
|
69
69
|
setTimeoutProvider(e) {
|
|
70
70
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
|
|
@@ -85,87 +85,87 @@ var Ne = class {
|
|
|
85
85
|
this.#e.clearInterval(e);
|
|
86
86
|
}
|
|
87
87
|
}();
|
|
88
|
-
function
|
|
88
|
+
function ze(e) {
|
|
89
89
|
setTimeout(e, 0);
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region node_modules/@tanstack/query-core/build/modern/utils.js
|
|
93
|
-
var
|
|
94
|
-
function
|
|
95
|
-
function
|
|
93
|
+
var Be = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function Ve() {}
|
|
95
|
+
function He(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Ue(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function H(e, t) {
|
|
102
102
|
return typeof e == "function" ? e(t) : e;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function U(e, t) {
|
|
105
105
|
return typeof e == "function" ? e(t) : e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function We(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Je(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var Ge = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Ke(e, t, n = 0) {
|
|
112
112
|
if (e === t) return e;
|
|
113
113
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
114
|
+
let r = qe(e) && qe(t);
|
|
115
|
+
if (!r && !(Je(e) && Je(t))) return t;
|
|
116
116
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
117
117
|
for (let l = 0; l < o; l++) {
|
|
118
118
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
119
119
|
if (u === d) {
|
|
120
|
-
s[o] = u, (r ? l < i :
|
|
120
|
+
s[o] = u, (r ? l < i : Ge.call(e, o)) && c++;
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
124
124
|
s[o] = d;
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
let f =
|
|
127
|
+
let f = Ke(u, d, n + 1);
|
|
128
128
|
s[o] = f, f === u && c++;
|
|
129
129
|
}
|
|
130
130
|
return i === o && c === i ? e : s;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function W(e, t) {
|
|
133
133
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
134
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
135
|
return !0;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function qe(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function Je(e) {
|
|
141
|
+
if (!Ye(e)) return !1;
|
|
142
142
|
let t = e.constructor;
|
|
143
143
|
if (t === void 0) return !0;
|
|
144
144
|
let n = t.prototype;
|
|
145
|
-
return !(!
|
|
145
|
+
return !(!Ye(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Ye(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Xe(e, t, n) {
|
|
151
151
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
152
|
if (n.structuralSharing !== !1) {
|
|
153
153
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
154
|
+
return Ke(e, t);
|
|
155
155
|
} catch (e) {
|
|
156
156
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return Ke(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function G(e, t) {
|
|
163
163
|
return typeof e == "function" ? e(...t) : !!e;
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
167
167
|
var Ze = /* @__PURE__ */ (() => {
|
|
168
|
-
let e = () =>
|
|
168
|
+
let e = () => Be;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
171
171
|
return e();
|
|
@@ -199,7 +199,7 @@ function Qe() {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
202
|
-
var $e =
|
|
202
|
+
var $e = ze;
|
|
203
203
|
function et() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
@@ -247,7 +247,7 @@ function et() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var tt = et(), nt = new class extends
|
|
250
|
+
var tt = et(), nt = new class extends Fe {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -299,7 +299,7 @@ function it(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var at = class extends
|
|
302
|
+
var at = class extends Fe {
|
|
303
303
|
constructor(e, t) {
|
|
304
304
|
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Qe(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
@@ -338,16 +338,16 @@ var at = class extends Ne {
|
|
|
338
338
|
}
|
|
339
339
|
setOptions(e) {
|
|
340
340
|
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 && !
|
|
341
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof U(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !W(this.options, t) && this.#e.getQueryCache().notify({
|
|
343
343
|
type: "observerOptionsUpdated",
|
|
344
344
|
query: this.#t,
|
|
345
345
|
observer: this
|
|
346
346
|
});
|
|
347
347
|
let r = this.hasListeners();
|
|
348
|
-
r && lt(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n ||
|
|
348
|
+
r && lt(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || H(this.options.staleTime, this.#t) !== H(t.staleTime, this.#t)) && this.#g();
|
|
349
349
|
let i = this.#_();
|
|
350
|
-
r && (this.#t !== n ||
|
|
350
|
+
r && (this.#t !== n || U(this.options.enabled, this.#t) !== U(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
351
351
|
}
|
|
352
352
|
getOptimisticResult(e) {
|
|
353
353
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
@@ -381,14 +381,14 @@ var at = class extends Ne {
|
|
|
381
381
|
#h(e) {
|
|
382
382
|
this.#S();
|
|
383
383
|
let t = this.#t.fetch(this.options, e);
|
|
384
|
-
return e?.throwOnError || (t = t.catch(
|
|
384
|
+
return e?.throwOnError || (t = t.catch(Ve)), t;
|
|
385
385
|
}
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
|
-
let e =
|
|
389
|
-
if (Ze.isServer() || this.#r.isStale || !
|
|
390
|
-
let t =
|
|
391
|
-
this.#d =
|
|
388
|
+
let e = H(this.options.staleTime, this.#t);
|
|
389
|
+
if (Ze.isServer() || this.#r.isStale || !He(e)) return;
|
|
390
|
+
let t = Ue(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = Re.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,18 +396,18 @@ var at = class extends Ne {
|
|
|
396
396
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
397
397
|
}
|
|
398
398
|
#v(e) {
|
|
399
|
-
this.#x(), this.#p = e, !(Ze.isServer() ||
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
399
|
+
this.#x(), this.#p = e, !(Ze.isServer() || U(this.options.enabled, this.#t) === !1 || !He(this.#p) || this.#p === 0) && (this.#f = Re.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Ie.isFocused()) && this.#h();
|
|
401
401
|
}, this.#p));
|
|
402
402
|
}
|
|
403
403
|
#y() {
|
|
404
404
|
this.#g(), this.#v(this.#_());
|
|
405
405
|
}
|
|
406
406
|
#b() {
|
|
407
|
-
this.#d !== void 0 && (
|
|
407
|
+
this.#d !== void 0 && (Re.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (Re.clearInterval(this.#f), this.#f = void 0);
|
|
411
411
|
}
|
|
412
412
|
createResult(e, t) {
|
|
413
413
|
let n = this.#t, r = this.options, i = this.#r, a = this.#i, o = this.#a, s = e === n ? this.#n : e.state, { state: c } = e, l = { ...c }, u = !1, d;
|
|
@@ -423,11 +423,11 @@ var at = class extends Ne {
|
|
|
423
423
|
let h = !1;
|
|
424
424
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
425
|
let e;
|
|
426
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
426
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = Xe(i?.data, e, t), u = !0);
|
|
427
427
|
}
|
|
428
428
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
429
429
|
else try {
|
|
430
|
-
this.#c = t.select, d = t.select(d), d =
|
|
430
|
+
this.#c = t.select, d = t.select(d), d = Xe(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
431
|
} catch (e) {
|
|
432
432
|
this.#s = e;
|
|
433
433
|
}
|
|
@@ -458,7 +458,7 @@ var at = class extends Ne {
|
|
|
458
458
|
isStale: ut(e, t),
|
|
459
459
|
refetch: this.refetch,
|
|
460
460
|
promise: this.#o,
|
|
461
|
-
isEnabled:
|
|
461
|
+
isEnabled: U(t.enabled, e) !== !1
|
|
462
462
|
};
|
|
463
463
|
if (this.options.experimental_prefetchInRender) {
|
|
464
464
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
@@ -482,7 +482,7 @@ var at = class extends Ne {
|
|
|
482
482
|
}
|
|
483
483
|
updateResult() {
|
|
484
484
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
485
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
485
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !W(t, e) && (this.#r = t, this.#C({ listeners: (() => {
|
|
486
486
|
if (!e) return !0;
|
|
487
487
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
488
488
|
if (n === "all" || !n && !this.#m.size) return !0;
|
|
@@ -514,26 +514,26 @@ var at = class extends Ne {
|
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
function ot(e, t) {
|
|
517
|
-
return
|
|
517
|
+
return U(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && U(t.retryOnMount, e) === !1);
|
|
518
518
|
}
|
|
519
519
|
function st(e, t) {
|
|
520
520
|
return ot(e, t) || e.state.data !== void 0 && ct(e, t, t.refetchOnMount);
|
|
521
521
|
}
|
|
522
522
|
function ct(e, t, n) {
|
|
523
|
-
if (
|
|
523
|
+
if (U(t.enabled, e) !== !1 && H(t.staleTime, e) !== "static") {
|
|
524
524
|
let r = typeof n == "function" ? n(e) : n;
|
|
525
525
|
return r === "always" || r !== !1 && ut(e, t);
|
|
526
526
|
}
|
|
527
527
|
return !1;
|
|
528
528
|
}
|
|
529
529
|
function lt(e, t, n, r) {
|
|
530
|
-
return (e !== t ||
|
|
530
|
+
return (e !== t || U(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
|
|
531
531
|
}
|
|
532
532
|
function ut(e, t) {
|
|
533
|
-
return
|
|
533
|
+
return U(t.enabled, e) !== !1 && e.isStaleByTime(H(t.staleTime, e));
|
|
534
534
|
}
|
|
535
535
|
function dt(e, t) {
|
|
536
|
-
return !
|
|
536
|
+
return !W(e.getCurrentResult(), t);
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
@@ -552,7 +552,7 @@ function K() {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var ft = class extends
|
|
555
|
+
var ft = class extends Fe {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var ft = class extends Ne {
|
|
|
565
565
|
}
|
|
566
566
|
setOptions(e) {
|
|
567
567
|
let t = this.options;
|
|
568
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
568
|
+
this.options = this.#e.defaultMutationOptions(e), W(this.options, t) || this.#e.getMutationCache().notify({
|
|
569
569
|
type: "observerOptionsUpdated",
|
|
570
570
|
mutation: this.#n,
|
|
571
571
|
observer: this
|
|
572
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
572
|
+
}), t?.mutationKey && this.options.mutationKey && We(t.mutationKey) !== We(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
573
573
|
}
|
|
574
574
|
onUnsubscribe() {
|
|
575
575
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -662,13 +662,13 @@ function _t() {
|
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
664
|
var vt = e.createContext(_t()), yt = () => e.useContext(vt), bt = (e, t, n) => {
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
665
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? G(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
666
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
667
|
}, xt = (t) => {
|
|
668
668
|
e.useEffect(() => {
|
|
669
669
|
t.clearReset();
|
|
670
670
|
}, [t]);
|
|
671
|
-
}, St = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 ||
|
|
671
|
+
}, St = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || G(n, [e.error, r])), Ct = (e) => {
|
|
672
672
|
if (e.suspense) {
|
|
673
673
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
674
674
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
@@ -688,7 +688,7 @@ function Dt(t, n, r) {
|
|
|
688
688
|
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, Ct(s), bt(s, a, c), xt(a);
|
|
689
689
|
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
690
690
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
691
|
-
let t = p ? d.subscribe(tt.batchCalls(e)) :
|
|
691
|
+
let t = p ? d.subscribe(tt.batchCalls(e)) : Ve;
|
|
692
692
|
return d.updateResult(), t;
|
|
693
693
|
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
694
694
|
d.setOptions(s);
|
|
@@ -700,7 +700,7 @@ function Dt(t, n, r) {
|
|
|
700
700
|
query: c,
|
|
701
701
|
suspense: s.suspense
|
|
702
702
|
})) throw f.error;
|
|
703
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !Ze.isServer() && wt(f, i) && (u ? Et(s, d, a) : c?.promise)?.catch(
|
|
703
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !Ze.isServer() && wt(f, i) && (u ? Et(s, d, a) : c?.promise)?.catch(Ve).finally(() => {
|
|
704
704
|
d.updateResult();
|
|
705
705
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
706
706
|
}
|
|
@@ -717,9 +717,9 @@ function kt(t, n) {
|
|
|
717
717
|
i.setOptions(t);
|
|
718
718
|
}, [i, t]);
|
|
719
719
|
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(tt.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
720
|
-
i.mutate(e, t).catch(
|
|
720
|
+
i.mutate(e, t).catch(Ve);
|
|
721
721
|
}, [i]);
|
|
722
|
-
if (a.error &&
|
|
722
|
+
if (a.error && G(i.options.throwOnError, [a.error])) throw a.error;
|
|
723
723
|
return {
|
|
724
724
|
...a,
|
|
725
725
|
mutate: o,
|
|
@@ -751,161 +751,169 @@ function J() {
|
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/Hooks/useApi.ts
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
code: t.code,
|
|
760
|
-
details: t.details
|
|
761
|
-
};
|
|
762
|
-
} catch {
|
|
763
|
-
return { message: e };
|
|
754
|
+
var Nt = class extends Error {
|
|
755
|
+
status;
|
|
756
|
+
violations;
|
|
757
|
+
constructor(e, t, n) {
|
|
758
|
+
super(e), this.name = "ApiError", this.status = t, this.violations = n;
|
|
764
759
|
}
|
|
765
|
-
|
|
760
|
+
};
|
|
761
|
+
function Pt(e) {
|
|
762
|
+
return e instanceof Nt ? e.violations : void 0;
|
|
766
763
|
}
|
|
767
|
-
async function
|
|
764
|
+
async function Y(e, t) {
|
|
768
765
|
let n = await fetch(e, t);
|
|
769
766
|
if (n.status >= 400) {
|
|
770
767
|
let e = await n.text();
|
|
771
|
-
if (!e) throw
|
|
768
|
+
if (!e) throw new Nt(`HTTP ${n.status}: ${n.statusText}`, n.status);
|
|
772
769
|
let t = null;
|
|
773
770
|
try {
|
|
774
771
|
t = JSON.parse(e);
|
|
775
772
|
} catch {
|
|
776
|
-
throw
|
|
773
|
+
throw new Nt(e, n.status);
|
|
777
774
|
}
|
|
778
|
-
|
|
775
|
+
let r = Array.isArray(t?.violations) ? t.violations.filter((e) => e?.field && e?.message).map((e) => ({
|
|
776
|
+
field: String(e.field),
|
|
777
|
+
message: String(e.message)
|
|
778
|
+
})) : void 0;
|
|
779
|
+
throw new Nt(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
|
|
779
780
|
}
|
|
780
781
|
return n;
|
|
781
782
|
}
|
|
782
|
-
var
|
|
783
|
-
async function
|
|
784
|
-
return (await
|
|
783
|
+
var Ft = (e) => e.map((e) => e.toString());
|
|
784
|
+
async function It(e, t) {
|
|
785
|
+
return (await Y(e, {
|
|
785
786
|
method: "GET",
|
|
786
787
|
headers: await t()
|
|
787
788
|
})).json();
|
|
788
789
|
}
|
|
789
|
-
async function
|
|
790
|
-
return (await
|
|
790
|
+
async function Lt(e, t, n) {
|
|
791
|
+
return (await Y(`${e}/${t}`, {
|
|
791
792
|
method: "GET",
|
|
792
793
|
headers: await n()
|
|
793
794
|
})).json();
|
|
794
795
|
}
|
|
795
|
-
async function
|
|
796
|
-
await
|
|
796
|
+
async function Rt(e, t, n) {
|
|
797
|
+
await Y(`${e}/${t}`, {
|
|
797
798
|
method: "DELETE",
|
|
798
799
|
headers: await n()
|
|
799
800
|
});
|
|
800
801
|
}
|
|
801
|
-
async function
|
|
802
|
-
let r = await
|
|
802
|
+
async function zt(e, t, n) {
|
|
803
|
+
let r = await Y(e, {
|
|
803
804
|
method: "POST",
|
|
804
805
|
headers: await n(),
|
|
805
806
|
body: JSON.stringify(t)
|
|
806
807
|
});
|
|
807
808
|
return r.status === 204 ? t : r.json();
|
|
808
809
|
}
|
|
809
|
-
async function
|
|
810
|
-
let i = await
|
|
810
|
+
async function Bt(e, t, n, r) {
|
|
811
|
+
let i = await Y(t, {
|
|
811
812
|
method: e,
|
|
812
813
|
headers: await n(),
|
|
813
814
|
body: r ? JSON.stringify(r) : void 0
|
|
814
815
|
});
|
|
815
816
|
if (i.status !== 204) return i.json();
|
|
816
817
|
}
|
|
817
|
-
async function
|
|
818
|
-
let r = await
|
|
818
|
+
async function Vt(e, t, n) {
|
|
819
|
+
let r = await Y(`${e}/${t.id}`, {
|
|
819
820
|
method: "PUT",
|
|
820
821
|
headers: await n(),
|
|
821
822
|
body: JSON.stringify(t)
|
|
822
823
|
});
|
|
823
824
|
return r.status === 204 ? t : r.json();
|
|
824
825
|
}
|
|
825
|
-
function
|
|
826
|
+
function Ht(e, t, n) {
|
|
826
827
|
let { baseUrl: r, getHeaders: i } = J();
|
|
827
828
|
return Ot({
|
|
828
|
-
queryKey: [...
|
|
829
|
-
queryFn: () =>
|
|
829
|
+
queryKey: [...Ft(t), String(n?.toString())],
|
|
830
|
+
queryFn: () => Lt(`${r}${e}`, n, i),
|
|
830
831
|
enabled: !!n
|
|
831
832
|
});
|
|
832
833
|
}
|
|
833
|
-
function
|
|
834
|
+
function Ut(e, t, n = !0) {
|
|
834
835
|
let { baseUrl: r, getHeaders: i } = J();
|
|
835
836
|
return Ot({
|
|
836
|
-
queryKey:
|
|
837
|
-
queryFn: () =>
|
|
837
|
+
queryKey: Ft(t),
|
|
838
|
+
queryFn: () => It(`${r}${e}`, i),
|
|
838
839
|
enabled: n
|
|
839
840
|
});
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
-
|
|
842
|
+
function Wt(e, t, n) {
|
|
843
|
+
return Promise.all([e.invalidateQueries({ queryKey: Ft(t) }), ...(n ?? []).map((t) => e.invalidateQueries({ queryKey: t }))]);
|
|
844
|
+
}
|
|
845
|
+
function Gt(e, t, n) {
|
|
846
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = J();
|
|
843
847
|
return kt({
|
|
844
|
-
mutationKey:
|
|
845
|
-
mutationFn: (t) =>
|
|
846
|
-
onSettled()
|
|
847
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
848
|
-
}
|
|
848
|
+
mutationKey: Ft(t),
|
|
849
|
+
mutationFn: (t) => zt(`${r}${e}`, t, a),
|
|
850
|
+
onSettled: () => Wt(i, t, n)
|
|
849
851
|
});
|
|
850
852
|
}
|
|
851
|
-
function
|
|
852
|
-
let { baseUrl:
|
|
853
|
+
function Kt(e, t, n) {
|
|
854
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = J();
|
|
853
855
|
return kt({
|
|
854
|
-
mutationKey:
|
|
855
|
-
mutationFn: (t) =>
|
|
856
|
-
onSettled()
|
|
857
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
858
|
-
}
|
|
856
|
+
mutationKey: Ft(t),
|
|
857
|
+
mutationFn: (t) => Vt(`${r}${e}`, t, a),
|
|
858
|
+
onSettled: () => Wt(i, t, n)
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
let { baseUrl:
|
|
861
|
+
function qt(e, t, n) {
|
|
862
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = J();
|
|
863
863
|
return kt({
|
|
864
|
-
mutationKey:
|
|
865
|
-
mutationFn: (t) =>
|
|
866
|
-
onSettled()
|
|
867
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
868
|
-
}
|
|
864
|
+
mutationKey: Ft(t),
|
|
865
|
+
mutationFn: (t) => Rt(`${r}${e}`, t, a),
|
|
866
|
+
onSettled: () => Wt(i, t, n)
|
|
869
867
|
});
|
|
870
868
|
}
|
|
871
869
|
//#endregion
|
|
872
870
|
//#region src/DataTable/EntityForm.tsx
|
|
873
|
-
function
|
|
871
|
+
function Jt(e, t) {
|
|
874
872
|
return typeof e.required == "function" ? e.required(t) : !!e.required;
|
|
875
873
|
}
|
|
876
|
-
function
|
|
874
|
+
function Yt(e) {
|
|
877
875
|
return e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {});
|
|
878
876
|
}
|
|
879
|
-
function
|
|
880
|
-
return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !
|
|
877
|
+
function Xt(e) {
|
|
878
|
+
return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !Jt(t, n) || e ? null : "Pflichtfeld", e), {});
|
|
881
879
|
}
|
|
882
|
-
function
|
|
880
|
+
function Zt(e) {
|
|
883
881
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
|
|
884
882
|
}
|
|
885
|
-
function
|
|
883
|
+
function Qt(e, t) {
|
|
886
884
|
let n = { ...e };
|
|
887
885
|
return t.forEach((e) => {
|
|
888
886
|
let t = e.id;
|
|
889
887
|
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] = "");
|
|
890
888
|
}), n;
|
|
891
889
|
}
|
|
892
|
-
|
|
893
|
-
|
|
890
|
+
var $t = (e) => e.split(".").pop() ?? e;
|
|
891
|
+
function en(e, t) {
|
|
892
|
+
return Object.fromEntries((Pt(e) ?? []).filter((e) => t.has($t(e.field))).map((e) => [$t(e.field), e.message]));
|
|
893
|
+
}
|
|
894
|
+
function tn(e, t) {
|
|
895
|
+
let n = Pt(e);
|
|
896
|
+
if (!n) return e?.message;
|
|
897
|
+
let r = n.filter((e) => !t.has($t(e.field)));
|
|
898
|
+
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
899
|
+
}
|
|
900
|
+
function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
901
|
+
let [u, h] = d(0), [g, v] = d(!1), b = ye({
|
|
894
902
|
mode: "uncontrolled",
|
|
895
|
-
initialValues:
|
|
896
|
-
validate:
|
|
903
|
+
initialValues: Yt(e),
|
|
904
|
+
validate: Xt(e)
|
|
897
905
|
});
|
|
898
906
|
s(() => {
|
|
899
907
|
if (r) {
|
|
900
|
-
let t =
|
|
908
|
+
let t = Qt(r, e);
|
|
901
909
|
b.initialize(t), b.setValues(t);
|
|
902
910
|
}
|
|
903
911
|
}, [r]);
|
|
904
|
-
let S = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))],
|
|
905
|
-
function
|
|
912
|
+
let S = new Set(e.map((e) => String(e.id))), C = tn(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;
|
|
913
|
+
function O(e) {
|
|
906
914
|
let t = b.getValues();
|
|
907
915
|
if (e.conditional && !e.conditional(t)) return null;
|
|
908
|
-
let n =
|
|
916
|
+
let n = Jt(e, t), r = b.getInputProps(e.id);
|
|
909
917
|
switch (e.type) {
|
|
910
918
|
case "number": return /* @__PURE__ */ p(N, {
|
|
911
919
|
decimalSeparator: ",",
|
|
@@ -915,7 +923,7 @@ function Zt({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
915
923
|
required: n,
|
|
916
924
|
...r
|
|
917
925
|
}, b.key(e.id));
|
|
918
|
-
case "date": return /* @__PURE__ */ p(
|
|
926
|
+
case "date": return /* @__PURE__ */ p(ve, {
|
|
919
927
|
valueFormat: "DD.MM.YYYY",
|
|
920
928
|
clearable: !0,
|
|
921
929
|
label: e.column.title,
|
|
@@ -929,7 +937,7 @@ function Zt({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
929
937
|
required: n,
|
|
930
938
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
931
939
|
}, b.key(e.id));
|
|
932
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
940
|
+
case "textarea": return /* @__PURE__ */ p(de, {
|
|
933
941
|
minRows: 3,
|
|
934
942
|
autosize: !0,
|
|
935
943
|
label: e.column.title,
|
|
@@ -944,7 +952,7 @@ function Zt({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
944
952
|
error: r.error,
|
|
945
953
|
required: n
|
|
946
954
|
});
|
|
947
|
-
default: return /* @__PURE__ */ p(
|
|
955
|
+
default: return /* @__PURE__ */ p(ue, {
|
|
948
956
|
type: e.id.includes("email") ? "email" : void 0,
|
|
949
957
|
label: e.column.title,
|
|
950
958
|
placeholder: e.placeholder ?? "",
|
|
@@ -953,63 +961,65 @@ function Zt({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
953
961
|
}, b.key(e.id));
|
|
954
962
|
}
|
|
955
963
|
}
|
|
956
|
-
let
|
|
957
|
-
return /* @__PURE__ */ m(f, { children: [
|
|
964
|
+
let k = (t) => (t === void 0 ? e : e.filter((e) => e.step === t)).map((e) => /* @__PURE__ */ p(n, { children: O(e) }, e.id));
|
|
965
|
+
return /* @__PURE__ */ m(f, { children: [C && /* @__PURE__ */ p(_, {
|
|
958
966
|
variant: "outline",
|
|
959
967
|
color: "red",
|
|
960
|
-
title:
|
|
968
|
+
title: "Fehler aufgetreten",
|
|
961
969
|
mb: "lg",
|
|
962
|
-
children:
|
|
970
|
+
children: C
|
|
963
971
|
}), /* @__PURE__ */ m("form", {
|
|
964
972
|
onSubmit: b.onSubmit(async (e) => {
|
|
965
|
-
let t =
|
|
966
|
-
|
|
973
|
+
let t = Zt(e);
|
|
974
|
+
try {
|
|
975
|
+
await c(t);
|
|
976
|
+
} catch (e) {
|
|
977
|
+
let t = en(e, S);
|
|
978
|
+
Object.keys(t).length > 0 && b.setErrors(t);
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
967
982
|
}),
|
|
968
|
-
children: [
|
|
983
|
+
children: [E ? /* @__PURE__ */ p(ne, {
|
|
969
984
|
active: u,
|
|
970
985
|
size: "sm",
|
|
971
|
-
children:
|
|
986
|
+
children: w.map((e) => /* @__PURE__ */ p(ne.Step, {
|
|
972
987
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
973
|
-
children:
|
|
988
|
+
children: k(e)
|
|
974
989
|
}, e))
|
|
975
|
-
}) :
|
|
990
|
+
}) : k(), !g && /* @__PURE__ */ m(T, {
|
|
976
991
|
mt: "md",
|
|
977
992
|
justify: "end",
|
|
978
993
|
children: [/* @__PURE__ */ p(y, {
|
|
979
994
|
variant: "outline",
|
|
980
|
-
onClick: () =>
|
|
981
|
-
children:
|
|
995
|
+
onClick: () => E && u > 0 ? h((e) => e - 1) : l(),
|
|
996
|
+
children: E && u > 0 ? "Zurück" : "Abbrechen"
|
|
982
997
|
}), /* @__PURE__ */ p(y, {
|
|
983
998
|
type: "submit",
|
|
984
999
|
loading: a,
|
|
985
|
-
children:
|
|
1000
|
+
children: E && !D ? "Weiter" : "Speichern"
|
|
986
1001
|
})]
|
|
987
1002
|
})]
|
|
988
1003
|
})] });
|
|
989
1004
|
}
|
|
990
1005
|
//#endregion
|
|
991
1006
|
//#region src/DataTable/CreateModal.tsx
|
|
992
|
-
function
|
|
993
|
-
let [
|
|
994
|
-
return /* @__PURE__ */ p(
|
|
1007
|
+
function rn({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, steps: a, onCreated: o }) {
|
|
1008
|
+
let [s, c] = d(), { mutateAsync: l, isPending: u, error: f } = Gt(i, n, r), { mutateAsync: m, isPending: h, error: g } = Kt(i, n, r);
|
|
1009
|
+
return /* @__PURE__ */ p(nn, {
|
|
995
1010
|
fields: e,
|
|
996
|
-
steps:
|
|
997
|
-
recordId:
|
|
998
|
-
submitting:
|
|
999
|
-
error:
|
|
1011
|
+
steps: a,
|
|
1012
|
+
recordId: s,
|
|
1013
|
+
submitting: u || h,
|
|
1014
|
+
error: f ?? g,
|
|
1000
1015
|
onPersist: async (e) => {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
s(t.id), a?.(t.id);
|
|
1009
|
-
}
|
|
1010
|
-
return !0;
|
|
1011
|
-
} catch {
|
|
1012
|
-
return !1;
|
|
1016
|
+
if (s != null) await m({
|
|
1017
|
+
...e,
|
|
1018
|
+
id: s
|
|
1019
|
+
});
|
|
1020
|
+
else {
|
|
1021
|
+
let t = await l(e);
|
|
1022
|
+
c(t.id), o?.(t.id);
|
|
1013
1023
|
}
|
|
1014
1024
|
},
|
|
1015
1025
|
onClose: t
|
|
@@ -1017,28 +1027,28 @@ function Qt({ fields: e, onClose: t, queryKey: n, apiPath: r, steps: i, onCreate
|
|
|
1017
1027
|
}
|
|
1018
1028
|
//#endregion
|
|
1019
1029
|
//#region node_modules/clsx/dist/clsx.mjs
|
|
1020
|
-
function
|
|
1030
|
+
function an(e) {
|
|
1021
1031
|
var t, n, r = "";
|
|
1022
1032
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
1023
1033
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1024
1034
|
var i = e.length;
|
|
1025
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
1035
|
+
for (t = 0; t < i; t++) e[t] && (n = an(e[t])) && (r && (r += " "), r += n);
|
|
1026
1036
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
1027
1037
|
return r;
|
|
1028
1038
|
}
|
|
1029
1039
|
function X() {
|
|
1030
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
1040
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = an(e)) && (r && (r += " "), r += t);
|
|
1031
1041
|
return r;
|
|
1032
1042
|
}
|
|
1033
1043
|
//#endregion
|
|
1034
1044
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1035
1045
|
function Z(e, t, n) {
|
|
1036
|
-
return e ?
|
|
1046
|
+
return e ? me({
|
|
1037
1047
|
color: typeof e == "object" ? e[n] : e,
|
|
1038
1048
|
theme: t
|
|
1039
1049
|
}).value : void 0;
|
|
1040
1050
|
}
|
|
1041
|
-
function
|
|
1051
|
+
function on({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
1042
1052
|
return {
|
|
1043
1053
|
"--mantine-datatable-color-light": Z(t, e, "light"),
|
|
1044
1054
|
"--mantine-datatable-color-dark": Z(t, e, "dark"),
|
|
@@ -1054,7 +1064,7 @@ function en({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor
|
|
|
1054
1064
|
"--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
|
|
1055
1065
|
};
|
|
1056
1066
|
}
|
|
1057
|
-
function
|
|
1067
|
+
function sn({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
1058
1068
|
return {
|
|
1059
1069
|
"--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
|
|
1060
1070
|
"--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
|
|
@@ -1062,7 +1072,7 @@ function tn({ theme: e, paginationActiveTextColor: t, paginationActiveBackground
|
|
|
1062
1072
|
"--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
|
|
1063
1073
|
};
|
|
1064
1074
|
}
|
|
1065
|
-
function
|
|
1075
|
+
function cn({ theme: e, color: t, backgroundColor: n }) {
|
|
1066
1076
|
return {
|
|
1067
1077
|
"--mantine-datatable-row-color-light": Z(t, e, "light"),
|
|
1068
1078
|
"--mantine-datatable-row-color-dark": Z(t, e, "dark"),
|
|
@@ -1070,9 +1080,9 @@ function nn({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1070
1080
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1071
1081
|
};
|
|
1072
1082
|
}
|
|
1073
|
-
var [
|
|
1083
|
+
var [ln, un] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), dn = (e) => {
|
|
1074
1084
|
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("");
|
|
1075
|
-
return p(
|
|
1085
|
+
return p(ln, {
|
|
1076
1086
|
value: {
|
|
1077
1087
|
sourceColumn: y,
|
|
1078
1088
|
setSourceColumn: b,
|
|
@@ -1104,13 +1114,13 @@ var [rn, an] = fe("useDataTableColumnsContext must be used within DataTableColum
|
|
|
1104
1114
|
children: t
|
|
1105
1115
|
});
|
|
1106
1116
|
};
|
|
1107
|
-
function
|
|
1117
|
+
function fn() {
|
|
1108
1118
|
return p("tr", {
|
|
1109
1119
|
className: "mantine-datatable-empty-row",
|
|
1110
1120
|
children: p("td", {})
|
|
1111
1121
|
});
|
|
1112
1122
|
}
|
|
1113
|
-
function
|
|
1123
|
+
function pn() {
|
|
1114
1124
|
return m("svg", {
|
|
1115
1125
|
width: "24",
|
|
1116
1126
|
height: "24",
|
|
@@ -1133,14 +1143,14 @@ function cn() {
|
|
|
1133
1143
|
]
|
|
1134
1144
|
});
|
|
1135
1145
|
}
|
|
1136
|
-
function
|
|
1146
|
+
function mn({ icon: e, text: t, active: n, children: r }) {
|
|
1137
1147
|
return p(b, {
|
|
1138
1148
|
className: "mantine-datatable-empty-state",
|
|
1139
1149
|
"data-active": n || void 0,
|
|
1140
1150
|
children: r || m(f, { children: [e || p("div", {
|
|
1141
1151
|
className: "mantine-datatable-empty-state-icon",
|
|
1142
|
-
children: p(
|
|
1143
|
-
}), p(
|
|
1152
|
+
children: p(pn, {})
|
|
1153
|
+
}), p(B, {
|
|
1144
1154
|
component: "div",
|
|
1145
1155
|
size: "sm",
|
|
1146
1156
|
c: "dimmed",
|
|
@@ -1148,13 +1158,13 @@ function ln({ icon: e, text: t, active: n, children: r }) {
|
|
|
1148
1158
|
})] })
|
|
1149
1159
|
});
|
|
1150
1160
|
}
|
|
1151
|
-
function
|
|
1161
|
+
function hn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1152
1162
|
let r = l(() => t.map((e) => ({
|
|
1153
1163
|
accessor: e.accessor,
|
|
1154
1164
|
defaultPinned: e.pinned,
|
|
1155
1165
|
pinnable: !!e.pinnable,
|
|
1156
1166
|
pinned: e.pinned
|
|
1157
|
-
})), [t]), [i, a] =
|
|
1167
|
+
})), [t]), [i, a] = V({
|
|
1158
1168
|
key: e ? `${e}-columns-pinning` : "",
|
|
1159
1169
|
defaultValue: e ? r : void 0,
|
|
1160
1170
|
getInitialValueInEffect: n
|
|
@@ -1201,8 +1211,8 @@ function un({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1201
1211
|
resetColumnsPinning: d
|
|
1202
1212
|
};
|
|
1203
1213
|
}
|
|
1204
|
-
function
|
|
1205
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1214
|
+
function gn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1215
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = V({
|
|
1206
1216
|
key: e ? `${e}-columns-order` : "",
|
|
1207
1217
|
defaultValue: e ? r : void 0,
|
|
1208
1218
|
getInitialValueInEffect: n
|
|
@@ -1244,8 +1254,8 @@ function dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1244
1254
|
resetColumnsOrder: d
|
|
1245
1255
|
};
|
|
1246
1256
|
}
|
|
1247
|
-
function
|
|
1248
|
-
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] =
|
|
1257
|
+
function _n({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1258
|
+
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] = V({
|
|
1249
1259
|
key: e ? `${e}-columns-width` : "",
|
|
1250
1260
|
defaultValue: e ? o() : void 0,
|
|
1251
1261
|
getInitialValueInEffect: n
|
|
@@ -1333,13 +1343,13 @@ function fn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1333
1343
|
endResize: S
|
|
1334
1344
|
};
|
|
1335
1345
|
}
|
|
1336
|
-
function
|
|
1346
|
+
function vn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1337
1347
|
let r = l(() => t?.map((e) => ({
|
|
1338
1348
|
accessor: e.accessor,
|
|
1339
1349
|
defaultToggle: e.defaultToggle || !0,
|
|
1340
1350
|
toggleable: e.toggleable,
|
|
1341
1351
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1342
|
-
})), [t]), [i, a] =
|
|
1352
|
+
})), [t]), [i, a] = V({
|
|
1343
1353
|
key: e ? `${e}-columns-toggle` : "",
|
|
1344
1354
|
defaultValue: e ? r : void 0,
|
|
1345
1355
|
getInitialValueInEffect: n
|
|
@@ -1386,20 +1396,20 @@ function pn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1386
1396
|
resetColumnsToggle: d
|
|
1387
1397
|
};
|
|
1388
1398
|
}
|
|
1389
|
-
var
|
|
1390
|
-
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } =
|
|
1399
|
+
var yn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1400
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = gn({
|
|
1391
1401
|
key: e,
|
|
1392
1402
|
columns: t,
|
|
1393
1403
|
getInitialValueInEffect: n
|
|
1394
|
-
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } =
|
|
1404
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = vn({
|
|
1395
1405
|
key: e,
|
|
1396
1406
|
columns: t,
|
|
1397
1407
|
getInitialValueInEffect: n
|
|
1398
|
-
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } =
|
|
1408
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = hn({
|
|
1399
1409
|
key: e,
|
|
1400
1410
|
columns: t,
|
|
1401
1411
|
getInitialValueInEffect: n
|
|
1402
|
-
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } =
|
|
1412
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = _n({
|
|
1403
1413
|
key: e,
|
|
1404
1414
|
columns: t,
|
|
1405
1415
|
getInitialValueInEffect: n,
|
|
@@ -1476,16 +1486,16 @@ var mn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1476
1486
|
beginResize: w,
|
|
1477
1487
|
endResize: T
|
|
1478
1488
|
};
|
|
1479
|
-
},
|
|
1480
|
-
function
|
|
1489
|
+
}, bn = typeof window < "u" ? c : s;
|
|
1490
|
+
function xn(e) {
|
|
1481
1491
|
let t = u(e);
|
|
1482
1492
|
return t.current = e, t;
|
|
1483
1493
|
}
|
|
1484
|
-
var
|
|
1494
|
+
var Sn = "--mantine-datatable-header-height", Cn = "--mantine-datatable-footer-height", wn = "--mantine-datatable-selection-column-width", Tn = "--mantine-datatable-last-row-border-bottom";
|
|
1485
1495
|
function Q(e, t, n) {
|
|
1486
1496
|
e?.style.setProperty(t, n);
|
|
1487
1497
|
}
|
|
1488
|
-
function
|
|
1498
|
+
function En(e) {
|
|
1489
1499
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1490
1500
|
return t ? {
|
|
1491
1501
|
width: t.inlineSize,
|
|
@@ -1495,18 +1505,18 @@ function xn(e) {
|
|
|
1495
1505
|
height: e.contentRect.height
|
|
1496
1506
|
};
|
|
1497
1507
|
}
|
|
1498
|
-
function
|
|
1508
|
+
function Dn(e, t, n) {
|
|
1499
1509
|
if (e) {
|
|
1500
1510
|
let r = new ResizeObserver((e) => {
|
|
1501
1511
|
let n = e[0];
|
|
1502
|
-
n && t(
|
|
1512
|
+
n && t(En(n));
|
|
1503
1513
|
});
|
|
1504
1514
|
return r.observe(e), () => {
|
|
1505
1515
|
r.disconnect(), n();
|
|
1506
1516
|
};
|
|
1507
1517
|
}
|
|
1508
1518
|
}
|
|
1509
|
-
function
|
|
1519
|
+
function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1510
1520
|
let n = {
|
|
1511
1521
|
root: u(null),
|
|
1512
1522
|
table: u(null),
|
|
@@ -1514,16 +1524,16 @@ function Cn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1514
1524
|
header: u(null),
|
|
1515
1525
|
footer: u(null),
|
|
1516
1526
|
selectionColumnHeader: u(null)
|
|
1517
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1527
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = xn({ withRowBorders: t }), p = xn(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1518
1528
|
p.current.onScroll?.(e), m.current();
|
|
1519
1529
|
}, []);
|
|
1520
|
-
return s(() =>
|
|
1521
|
-
Q(r.current,
|
|
1522
|
-
}, () => Q(r.current,
|
|
1523
|
-
Q(r.current,
|
|
1524
|
-
}, () => Q(r.current,
|
|
1525
|
-
Q(r.current,
|
|
1526
|
-
}, () => Q(r.current,
|
|
1530
|
+
return s(() => Dn(c.current, (e) => {
|
|
1531
|
+
Q(r.current, Sn, `${e.height}px`);
|
|
1532
|
+
}, () => Q(r.current, Sn, "0")), [c.current]), s(() => Dn(l.current, (e) => {
|
|
1533
|
+
Q(r.current, Cn, `${e.height}px`);
|
|
1534
|
+
}, () => Q(r.current, Cn, "0")), [l.current]), s(() => Dn(d.current, (e) => {
|
|
1535
|
+
Q(r.current, wn, `${e.width}px`);
|
|
1536
|
+
}, () => Q(r.current, wn, "0")), [d.current]), bn(() => {
|
|
1527
1537
|
if (typeof window > "u") return;
|
|
1528
1538
|
let e = {
|
|
1529
1539
|
top: !0,
|
|
@@ -1546,7 +1556,7 @@ function Cn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1546
1556
|
Q(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), Q(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1547
1557
|
}
|
|
1548
1558
|
function c() {
|
|
1549
|
-
f.current.withRowBorders && t.height < n.height ? Q(r.current,
|
|
1559
|
+
f.current.withRowBorders && t.height < n.height ? Q(r.current, Tn, `${he("1px")} solid var(--mantine-datatable-border-color)`) : Q(r.current, Tn, "unset");
|
|
1550
1560
|
}
|
|
1551
1561
|
h.current = c;
|
|
1552
1562
|
function l() {
|
|
@@ -1564,10 +1574,10 @@ function Cn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1564
1574
|
let u = new ResizeObserver((e) => {
|
|
1565
1575
|
for (let r of e) switch (r.target.tagName) {
|
|
1566
1576
|
case "TABLE":
|
|
1567
|
-
t =
|
|
1577
|
+
t = En(r);
|
|
1568
1578
|
break;
|
|
1569
1579
|
case "DIV":
|
|
1570
|
-
n =
|
|
1580
|
+
n = En(r);
|
|
1571
1581
|
break;
|
|
1572
1582
|
}
|
|
1573
1583
|
l(), s(), c();
|
|
@@ -1575,14 +1585,14 @@ function Cn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1575
1585
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1576
1586
|
u.disconnect();
|
|
1577
1587
|
};
|
|
1578
|
-
}, []),
|
|
1588
|
+
}, []), bn(() => {
|
|
1579
1589
|
h.current();
|
|
1580
1590
|
}, [t]), {
|
|
1581
1591
|
refs: n,
|
|
1582
1592
|
onScroll: g
|
|
1583
1593
|
};
|
|
1584
1594
|
}
|
|
1585
|
-
function
|
|
1595
|
+
function kn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1586
1596
|
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1587
1597
|
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1588
1598
|
let a = t.current ?? n.current;
|
|
@@ -1664,13 +1674,13 @@ function wn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
|
|
|
1664
1674
|
t,
|
|
1665
1675
|
n,
|
|
1666
1676
|
f
|
|
1667
|
-
]),
|
|
1677
|
+
]), bn(f, [f]), {
|
|
1668
1678
|
pinnedMap: l,
|
|
1669
1679
|
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1670
1680
|
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1671
1681
|
};
|
|
1672
1682
|
}
|
|
1673
|
-
function
|
|
1683
|
+
function An(e) {
|
|
1674
1684
|
let [t, n] = d(null);
|
|
1675
1685
|
return s(() => {
|
|
1676
1686
|
n(null);
|
|
@@ -1679,7 +1689,7 @@ function Tn(e) {
|
|
|
1679
1689
|
setLastSelectionChangeIndex: n
|
|
1680
1690
|
};
|
|
1681
1691
|
}
|
|
1682
|
-
function
|
|
1692
|
+
function jn(e, t) {
|
|
1683
1693
|
let n = () => {
|
|
1684
1694
|
t(e.map((e) => e.matches));
|
|
1685
1695
|
}, r = e.map((e) => {
|
|
@@ -1695,62 +1705,62 @@ function En(e, t) {
|
|
|
1695
1705
|
});
|
|
1696
1706
|
};
|
|
1697
1707
|
}
|
|
1698
|
-
function
|
|
1708
|
+
function Mn(e, t) {
|
|
1699
1709
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1700
1710
|
}
|
|
1701
|
-
function
|
|
1702
|
-
let [r, i] = d(n ? t :
|
|
1711
|
+
function Nn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1712
|
+
let [r, i] = d(n ? t : Mn(e, t)), a = u(null);
|
|
1703
1713
|
return s(() => {
|
|
1704
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1714
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), jn(a.current, (e) => {
|
|
1705
1715
|
i(e);
|
|
1706
1716
|
});
|
|
1707
1717
|
}, [e]), r;
|
|
1708
1718
|
}
|
|
1709
|
-
function
|
|
1710
|
-
let t =
|
|
1711
|
-
return
|
|
1719
|
+
function Pn(e) {
|
|
1720
|
+
let t = _e();
|
|
1721
|
+
return Nn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1712
1722
|
}
|
|
1713
|
-
function
|
|
1714
|
-
let t =
|
|
1715
|
-
return
|
|
1723
|
+
function Fn(e) {
|
|
1724
|
+
let t = _e();
|
|
1725
|
+
return Me((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1716
1726
|
}
|
|
1717
|
-
function
|
|
1727
|
+
function In(e) {
|
|
1718
1728
|
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1719
1729
|
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1720
1730
|
}
|
|
1721
|
-
function
|
|
1731
|
+
function Ln(e, t, n) {
|
|
1722
1732
|
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1723
1733
|
}
|
|
1724
|
-
function
|
|
1734
|
+
function Rn(e, t) {
|
|
1725
1735
|
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1726
1736
|
}
|
|
1727
|
-
function
|
|
1737
|
+
function zn(e, t) {
|
|
1728
1738
|
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1729
1739
|
}
|
|
1730
1740
|
function $(e, t) {
|
|
1731
|
-
return typeof t == "string" ?
|
|
1741
|
+
return typeof t == "string" ? zn(e, t) : t(e);
|
|
1732
1742
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 +
|
|
1743
|
+
function Bn(e) {
|
|
1744
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Bn(e.groups) : 1));
|
|
1735
1745
|
}
|
|
1736
|
-
function
|
|
1746
|
+
function Vn(e) {
|
|
1737
1747
|
let t = [];
|
|
1738
|
-
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(...
|
|
1748
|
+
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(...Vn(n.groups));
|
|
1739
1749
|
return t.filter((e) => e != null);
|
|
1740
1750
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t ? t[n] !== !1 : !0).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e +
|
|
1751
|
+
function Hn(e, t) {
|
|
1752
|
+
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t ? t[n] !== !1 : !0).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + Hn(n, t), 0) : 0;
|
|
1743
1753
|
}
|
|
1744
|
-
function
|
|
1754
|
+
function Un(e, t, n = 0) {
|
|
1745
1755
|
if (n === t) return [...e];
|
|
1746
1756
|
let r = [];
|
|
1747
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...
|
|
1757
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...Un(i.groups, t, n + 1));
|
|
1748
1758
|
return r;
|
|
1749
1759
|
}
|
|
1750
|
-
function
|
|
1760
|
+
function Wn(e, t, n) {
|
|
1751
1761
|
return n ? !e || t : !1;
|
|
1752
1762
|
}
|
|
1753
|
-
function
|
|
1763
|
+
function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1754
1764
|
let r = [];
|
|
1755
1765
|
if (e && t) {
|
|
1756
1766
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
@@ -1785,8 +1795,8 @@ function Bn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1785
1795
|
};
|
|
1786
1796
|
}
|
|
1787
1797
|
}
|
|
1788
|
-
function
|
|
1789
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1798
|
+
function Kn(e, t) {
|
|
1799
|
+
let [n, r] = d(e), [i, a] = d(e), o = Pe(() => r(!0), 0), c = Pe(() => a(!1), t || 200);
|
|
1790
1800
|
return s(() => {
|
|
1791
1801
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1792
1802
|
}, [
|
|
@@ -1798,17 +1808,17 @@ function Vn(e, t) {
|
|
|
1798
1808
|
visible: i
|
|
1799
1809
|
};
|
|
1800
1810
|
}
|
|
1801
|
-
var
|
|
1802
|
-
function
|
|
1803
|
-
return
|
|
1811
|
+
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";
|
|
1812
|
+
function tr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1813
|
+
return Fn(r) ? p(oe, {
|
|
1804
1814
|
"data-pinned": n?.position,
|
|
1805
1815
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1806
1816
|
className: X({
|
|
1807
|
-
[
|
|
1808
|
-
[
|
|
1809
|
-
[
|
|
1810
|
-
[
|
|
1811
|
-
[
|
|
1817
|
+
[qn]: a || o,
|
|
1818
|
+
[Jn]: o,
|
|
1819
|
+
[Qn]: s === "left",
|
|
1820
|
+
[$n]: s === "center",
|
|
1821
|
+
[er]: s === "right"
|
|
1812
1822
|
}, e),
|
|
1813
1823
|
style: [
|
|
1814
1824
|
{
|
|
@@ -1826,24 +1836,24 @@ function Xn({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1826
1836
|
children: i
|
|
1827
1837
|
}) : null;
|
|
1828
1838
|
}
|
|
1829
|
-
function
|
|
1839
|
+
function nr({ shadowVisible: e }) {
|
|
1830
1840
|
return p(oe, {
|
|
1831
1841
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1832
1842
|
"data-shadow-visible": e || void 0
|
|
1833
1843
|
});
|
|
1834
1844
|
}
|
|
1835
|
-
function
|
|
1845
|
+
function rr({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1836
1846
|
return p(ae, {
|
|
1837
1847
|
ref: s,
|
|
1838
1848
|
className: X("mantine-datatable-footer", e),
|
|
1839
1849
|
style: t,
|
|
1840
|
-
children: m(
|
|
1850
|
+
children: m(ce, { children: [a && p(nr, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1841
1851
|
if (e) return null;
|
|
1842
1852
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1843
1853
|
...r,
|
|
1844
1854
|
...t
|
|
1845
1855
|
};
|
|
1846
|
-
return p(
|
|
1856
|
+
return p(tr, {
|
|
1847
1857
|
pinnedInfo: i.get(String(n)),
|
|
1848
1858
|
className: l,
|
|
1849
1859
|
style: u,
|
|
@@ -1857,8 +1867,8 @@ function Qn({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
|
|
|
1857
1867
|
})] })
|
|
1858
1868
|
});
|
|
1859
1869
|
}
|
|
1860
|
-
function
|
|
1861
|
-
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ?
|
|
1870
|
+
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 }) {
|
|
1871
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? Vn([{
|
|
1862
1872
|
id: e,
|
|
1863
1873
|
columns: t,
|
|
1864
1874
|
groups: n
|
|
@@ -1866,7 +1876,7 @@ function $n({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1866
1876
|
t,
|
|
1867
1877
|
n,
|
|
1868
1878
|
e
|
|
1869
|
-
]), _ =
|
|
1879
|
+
]), _ = Pn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => Hn({
|
|
1870
1880
|
id: e,
|
|
1871
1881
|
columns: t,
|
|
1872
1882
|
groups: n
|
|
@@ -1875,16 +1885,16 @@ function $n({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1875
1885
|
t,
|
|
1876
1886
|
n,
|
|
1877
1887
|
_
|
|
1878
|
-
]), y = l(() => d.reduce((e, t) => e +
|
|
1888
|
+
]), y = l(() => d.reduce((e, t) => e + Hn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Wn(f, y + v < h, m);
|
|
1879
1889
|
return v > 0 ? p(oe, {
|
|
1880
1890
|
colSpan: v,
|
|
1881
1891
|
rowSpan: b > 1 ? b : void 0,
|
|
1882
1892
|
"data-pinned": s?.position,
|
|
1883
1893
|
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1884
1894
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1885
|
-
[
|
|
1886
|
-
[
|
|
1887
|
-
[
|
|
1895
|
+
[Qn]: i === "left",
|
|
1896
|
+
[$n]: i === "center",
|
|
1897
|
+
[er]: i === "right",
|
|
1888
1898
|
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1889
1899
|
}, a),
|
|
1890
1900
|
style: [o, s && {
|
|
@@ -1892,10 +1902,10 @@ function $n({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1892
1902
|
[s.position]: s.offset,
|
|
1893
1903
|
overflow: "visible"
|
|
1894
1904
|
}],
|
|
1895
|
-
children: r ??
|
|
1905
|
+
children: r ?? In(e)
|
|
1896
1906
|
}) : null;
|
|
1897
1907
|
}
|
|
1898
|
-
function
|
|
1908
|
+
function ar() {
|
|
1899
1909
|
return m("svg", {
|
|
1900
1910
|
width: "14",
|
|
1901
1911
|
height: "14",
|
|
@@ -1912,7 +1922,7 @@ function er() {
|
|
|
1912
1922
|
}), 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" })]
|
|
1913
1923
|
});
|
|
1914
1924
|
}
|
|
1915
|
-
function
|
|
1925
|
+
function or() {
|
|
1916
1926
|
return m("svg", {
|
|
1917
1927
|
width: "14",
|
|
1918
1928
|
height: "14",
|
|
@@ -1933,8 +1943,8 @@ function tr() {
|
|
|
1933
1943
|
})]
|
|
1934
1944
|
});
|
|
1935
1945
|
}
|
|
1936
|
-
function
|
|
1937
|
-
let [i, { close: a, toggle: o }] =
|
|
1946
|
+
function sr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1947
|
+
let [i, { close: a, toggle: o }] = je(!1), s = t ? or : ar, c = Ae(a);
|
|
1938
1948
|
return r && (c = void 0), m(F, {
|
|
1939
1949
|
withArrow: !0,
|
|
1940
1950
|
shadow: "md",
|
|
@@ -1961,7 +1971,7 @@ function nr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1961
1971
|
})]
|
|
1962
1972
|
});
|
|
1963
1973
|
}
|
|
1964
|
-
function
|
|
1974
|
+
function cr() {
|
|
1965
1975
|
return m("svg", {
|
|
1966
1976
|
width: "14",
|
|
1967
1977
|
height: "14",
|
|
@@ -1983,7 +1993,7 @@ function rr() {
|
|
|
1983
1993
|
]
|
|
1984
1994
|
});
|
|
1985
1995
|
}
|
|
1986
|
-
function
|
|
1996
|
+
function lr() {
|
|
1987
1997
|
return m("svg", {
|
|
1988
1998
|
width: "14",
|
|
1989
1999
|
height: "14",
|
|
@@ -2005,7 +2015,7 @@ function ir() {
|
|
|
2005
2015
|
]
|
|
2006
2016
|
});
|
|
2007
2017
|
}
|
|
2008
|
-
function
|
|
2018
|
+
function ur() {
|
|
2009
2019
|
return m("svg", {
|
|
2010
2020
|
width: "14",
|
|
2011
2021
|
height: "14",
|
|
@@ -2027,7 +2037,7 @@ function ar() {
|
|
|
2027
2037
|
]
|
|
2028
2038
|
});
|
|
2029
2039
|
}
|
|
2030
|
-
function
|
|
2040
|
+
function dr() {
|
|
2031
2041
|
return m("svg", {
|
|
2032
2042
|
width: "14",
|
|
2033
2043
|
height: "14",
|
|
@@ -2048,14 +2058,14 @@ function or() {
|
|
|
2048
2058
|
]
|
|
2049
2059
|
});
|
|
2050
2060
|
}
|
|
2051
|
-
function
|
|
2061
|
+
function fr({ currentPinned: e, onPinChange: t }) {
|
|
2052
2062
|
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2053
2063
|
if (i.current) {
|
|
2054
2064
|
let e = getComputedStyle(i.current).direction;
|
|
2055
2065
|
c(e === "rtl");
|
|
2056
2066
|
}
|
|
2057
2067
|
}, []);
|
|
2058
|
-
|
|
2068
|
+
bn(() => {
|
|
2059
2069
|
l();
|
|
2060
2070
|
}, [l]), s(() => {
|
|
2061
2071
|
n && l();
|
|
@@ -2078,7 +2088,7 @@ function sr({ currentPinned: e, onPinChange: t }) {
|
|
|
2078
2088
|
size: "xs",
|
|
2079
2089
|
variant: "light",
|
|
2080
2090
|
onClick: (e) => e.stopPropagation(),
|
|
2081
|
-
children: p(
|
|
2091
|
+
children: p(ur, {})
|
|
2082
2092
|
})
|
|
2083
2093
|
}) }), p(F.Dropdown, {
|
|
2084
2094
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -2093,14 +2103,14 @@ function sr({ currentPinned: e, onPinChange: t }) {
|
|
|
2093
2103
|
variant: _ ? "filled" : "light",
|
|
2094
2104
|
onClick: () => t(_ ? void 0 : f),
|
|
2095
2105
|
"aria-label": "Pin left",
|
|
2096
|
-
children: p(
|
|
2106
|
+
children: p(cr, {})
|
|
2097
2107
|
}),
|
|
2098
2108
|
p(g, {
|
|
2099
2109
|
size: "sm",
|
|
2100
2110
|
variant: v ? "filled" : "light",
|
|
2101
2111
|
onClick: () => t(v ? void 0 : h),
|
|
2102
2112
|
"aria-label": "Pin right",
|
|
2103
|
-
children: p(
|
|
2113
|
+
children: p(lr, {})
|
|
2104
2114
|
}),
|
|
2105
2115
|
e && p(g, {
|
|
2106
2116
|
size: "sm",
|
|
@@ -2108,18 +2118,18 @@ function sr({ currentPinned: e, onPinChange: t }) {
|
|
|
2108
2118
|
color: "red",
|
|
2109
2119
|
onClick: () => t(void 0),
|
|
2110
2120
|
"aria-label": "Unpin",
|
|
2111
|
-
children: p(
|
|
2121
|
+
children: p(dr, {})
|
|
2112
2122
|
})
|
|
2113
2123
|
]
|
|
2114
2124
|
})
|
|
2115
2125
|
})]
|
|
2116
2126
|
});
|
|
2117
2127
|
}
|
|
2118
|
-
var
|
|
2128
|
+
var pr = 50, mr = (e) => {
|
|
2119
2129
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2120
2130
|
current: 0,
|
|
2121
2131
|
next: 0
|
|
2122
|
-
}), { dir: c } =
|
|
2132
|
+
}), { dir: c } = ge(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = un(), g = a((e) => {
|
|
2123
2133
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2124
2134
|
let r = n.current, a = r.nextElementSibling;
|
|
2125
2135
|
for (; a;) {
|
|
@@ -2138,7 +2148,7 @@ var cr = 50, lr = (e) => {
|
|
|
2138
2148
|
let p = (e) => {
|
|
2139
2149
|
let n = e.clientX - o.current;
|
|
2140
2150
|
l && (n = -n);
|
|
2141
|
-
let r = s.current.current -
|
|
2151
|
+
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;
|
|
2142
2152
|
f([{
|
|
2143
2153
|
accessor: t,
|
|
2144
2154
|
width: `${u}px`
|
|
@@ -2185,7 +2195,7 @@ var cr = 50, lr = (e) => {
|
|
|
2185
2195
|
title: "Drag to resize column, double-click to reset"
|
|
2186
2196
|
});
|
|
2187
2197
|
};
|
|
2188
|
-
function
|
|
2198
|
+
function hr() {
|
|
2189
2199
|
return m("svg", {
|
|
2190
2200
|
width: "14",
|
|
2191
2201
|
height: "14",
|
|
@@ -2207,7 +2217,7 @@ function ur() {
|
|
|
2207
2217
|
]
|
|
2208
2218
|
});
|
|
2209
2219
|
}
|
|
2210
|
-
function
|
|
2220
|
+
function gr() {
|
|
2211
2221
|
return m("svg", {
|
|
2212
2222
|
width: "14",
|
|
2213
2223
|
height: "14",
|
|
@@ -2229,7 +2239,7 @@ function dr() {
|
|
|
2229
2239
|
]
|
|
2230
2240
|
});
|
|
2231
2241
|
}
|
|
2232
|
-
function
|
|
2242
|
+
function _r() {
|
|
2233
2243
|
return m("svg", {
|
|
2234
2244
|
width: "14",
|
|
2235
2245
|
height: "14",
|
|
@@ -2254,10 +2264,10 @@ function fr() {
|
|
|
2254
2264
|
]
|
|
2255
2265
|
});
|
|
2256
2266
|
}
|
|
2257
|
-
function
|
|
2258
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: ee } =
|
|
2259
|
-
if (!
|
|
2260
|
-
let z = a ??
|
|
2267
|
+
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 }) {
|
|
2268
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: ee } = un(), [I, L] = d(!1), R = u(null), te = F?.find((e) => e.accessor === r)?.pinned;
|
|
2269
|
+
if (!Fn(i)) return null;
|
|
2270
|
+
let z = a ?? In(r), ne = typeof z == "string" ? z : void 0, re = o && S ? (e) => {
|
|
2261
2271
|
e?.defaultPrevented || S({
|
|
2262
2272
|
sortKey: k,
|
|
2263
2273
|
columnAccessor: r,
|
|
@@ -2269,16 +2279,16 @@ function pr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2269
2279
|
e.preventDefault(), j(r), L(!0);
|
|
2270
2280
|
}, se = () => {
|
|
2271
2281
|
j(r), L(!1), M();
|
|
2272
|
-
}, B = () => {
|
|
2273
|
-
L(!0);
|
|
2274
2282
|
}, ce = () => {
|
|
2283
|
+
L(!0);
|
|
2284
|
+
}, le = () => {
|
|
2275
2285
|
L(!1);
|
|
2276
|
-
},
|
|
2286
|
+
}, B = (e) => {
|
|
2277
2287
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2278
2288
|
...e,
|
|
2279
2289
|
toggled: !1
|
|
2280
2290
|
} : e));
|
|
2281
|
-
},
|
|
2291
|
+
}, ue = (e) => {
|
|
2282
2292
|
ee((t) => t.map((t) => t.accessor === r ? {
|
|
2283
2293
|
...t,
|
|
2284
2294
|
pinned: e
|
|
@@ -2328,10 +2338,10 @@ function pr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2328
2338
|
}),
|
|
2329
2339
|
draggable: s,
|
|
2330
2340
|
onDragStart: s ? ie : void 0,
|
|
2331
|
-
onDragEnter: s ?
|
|
2341
|
+
onDragEnter: s ? ce : void 0,
|
|
2332
2342
|
onDragOver: s ? ae : void 0,
|
|
2333
2343
|
onDrop: s ? se : void 0,
|
|
2334
|
-
onDragLeave: s ?
|
|
2344
|
+
onDragLeave: s ? le : void 0,
|
|
2335
2345
|
children: [s ? p(b, {
|
|
2336
2346
|
role: "img",
|
|
2337
2347
|
"aria-label": "Drag column",
|
|
@@ -2342,21 +2352,21 @@ function pr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2342
2352
|
onClick: (e) => {
|
|
2343
2353
|
e.stopPropagation();
|
|
2344
2354
|
},
|
|
2345
|
-
children: p(
|
|
2355
|
+
children: p(_r, {})
|
|
2346
2356
|
})
|
|
2347
2357
|
}) : null, p(v, {
|
|
2348
2358
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
2349
|
-
[
|
|
2350
|
-
[
|
|
2351
|
-
[
|
|
2352
|
-
},
|
|
2359
|
+
[Qn]: _ === "left",
|
|
2360
|
+
[$n]: _ === "center",
|
|
2361
|
+
[er]: _ === "right"
|
|
2362
|
+
}, qn, Jn),
|
|
2353
2363
|
title: ne,
|
|
2354
2364
|
children: z
|
|
2355
2365
|
})]
|
|
2356
2366
|
}),
|
|
2357
|
-
l ? p(
|
|
2367
|
+
l ? p(fr, {
|
|
2358
2368
|
currentPinned: te,
|
|
2359
|
-
onPinChange:
|
|
2369
|
+
onPinChange: ue
|
|
2360
2370
|
}) : null,
|
|
2361
2371
|
c ? p(b, {
|
|
2362
2372
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2365,46 +2375,46 @@ function pr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2365
2375
|
children: p(g, {
|
|
2366
2376
|
size: "xs",
|
|
2367
2377
|
variant: "light",
|
|
2368
|
-
onClick:
|
|
2369
|
-
children: p(
|
|
2378
|
+
onClick: B,
|
|
2379
|
+
children: p(dr, {})
|
|
2370
2380
|
})
|
|
2371
2381
|
}) : null,
|
|
2372
2382
|
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
|
|
2373
2383
|
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
2374
2384
|
role: "img",
|
|
2375
2385
|
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2376
|
-
children: h?.sorted || p(
|
|
2386
|
+
children: h?.sorted || p(gr, {})
|
|
2377
2387
|
}) : p(b, {
|
|
2378
2388
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
2379
2389
|
role: "img",
|
|
2380
2390
|
"aria-label": "Not sorted",
|
|
2381
|
-
children: h?.unsorted || p(
|
|
2391
|
+
children: h?.unsorted || p(hr, {})
|
|
2382
2392
|
}) : null,
|
|
2383
|
-
C ? p(
|
|
2393
|
+
C ? p(sr, {
|
|
2384
2394
|
filterPopoverProps: E,
|
|
2385
2395
|
isActive: !!O,
|
|
2386
2396
|
filterPopoverDisableClickOutside: D,
|
|
2387
2397
|
children: C
|
|
2388
2398
|
}) : null
|
|
2389
2399
|
]
|
|
2390
|
-
}), f && r !== "__selection__" ? p(
|
|
2400
|
+
}), f && r !== "__selection__" ? p(mr, {
|
|
2391
2401
|
accessor: r,
|
|
2392
2402
|
columnRef: R
|
|
2393
2403
|
}) : null]
|
|
2394
2404
|
});
|
|
2395
2405
|
}
|
|
2396
|
-
function
|
|
2406
|
+
function yr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2397
2407
|
let u = !o.disabled;
|
|
2398
2408
|
return p(oe, {
|
|
2399
2409
|
ref: l,
|
|
2400
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2410
|
+
className: X("mantine-datatable-header-selector-cell", { [Yn]: n === "cell" && u }, e),
|
|
2401
2411
|
style: t,
|
|
2402
2412
|
rowSpan: c,
|
|
2403
2413
|
"data-shadow-visible": r || void 0,
|
|
2404
2414
|
"data-accessor": "__selection__",
|
|
2405
2415
|
onClick: n === "cell" && u ? s : void 0,
|
|
2406
2416
|
children: p(x, {
|
|
2407
|
-
classNames: u ? { input:
|
|
2417
|
+
classNames: u ? { input: Yn } : void 0,
|
|
2408
2418
|
checked: i,
|
|
2409
2419
|
indeterminate: a,
|
|
2410
2420
|
onChange: s,
|
|
@@ -2413,7 +2423,7 @@ function mr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
2413
2423
|
})
|
|
2414
2424
|
});
|
|
2415
2425
|
}
|
|
2416
|
-
function
|
|
2426
|
+
function br(e, t) {
|
|
2417
2427
|
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2418
2428
|
if (r.length === 0 || r.length !== n.length) return;
|
|
2419
2429
|
let i = new Set(r.map((e) => e.logicalSide));
|
|
@@ -2426,8 +2436,8 @@ function hr(e, t) {
|
|
|
2426
2436
|
isBoundary: l?.isBoundary ?? !1
|
|
2427
2437
|
};
|
|
2428
2438
|
}
|
|
2429
|
-
function
|
|
2430
|
-
let E = c ?
|
|
2439
|
+
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 }) {
|
|
2440
|
+
let E = c ? Bn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(yr, {
|
|
2431
2441
|
ref: e,
|
|
2432
2442
|
className: b,
|
|
2433
2443
|
style: S,
|
|
@@ -2438,7 +2448,7 @@ function gr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2438
2448
|
checkboxProps: v,
|
|
2439
2449
|
onChange: _,
|
|
2440
2450
|
rowSpan: c ? D : void 0
|
|
2441
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } =
|
|
2451
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = un(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? In(String(e))])) : void 0, L = m(se, {
|
|
2442
2452
|
className: X("mantine-datatable-header", t),
|
|
2443
2453
|
style: n,
|
|
2444
2454
|
ref: w,
|
|
@@ -2446,10 +2456,10 @@ function gr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2446
2456
|
e.preventDefault(), M((e) => !e);
|
|
2447
2457
|
} : void 0,
|
|
2448
2458
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2449
|
-
let n =
|
|
2450
|
-
return m(
|
|
2459
|
+
let n = Un(c, t);
|
|
2460
|
+
return m(ce, { children: [t === 0 && O, n.map((e, r) => p(ir, {
|
|
2451
2461
|
group: e,
|
|
2452
|
-
pinnedInfo:
|
|
2462
|
+
pinnedInfo: br(e, l),
|
|
2453
2463
|
maxDepth: E,
|
|
2454
2464
|
currentDepth: t,
|
|
2455
2465
|
previousGroups: n.slice(0, r),
|
|
@@ -2457,13 +2467,13 @@ function gr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2457
2467
|
withColumnBorders: C,
|
|
2458
2468
|
totalTableColumns: o.length
|
|
2459
2469
|
}, e.id))] }, `group-depth-${t}`);
|
|
2460
|
-
}), m(
|
|
2470
|
+
}), m(ce, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2461
2471
|
if (e) return null;
|
|
2462
2472
|
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 } = {
|
|
2463
2473
|
...s,
|
|
2464
2474
|
...t
|
|
2465
2475
|
};
|
|
2466
|
-
return p(
|
|
2476
|
+
return p(vr, {
|
|
2467
2477
|
accessor: c,
|
|
2468
2478
|
pinnedInfo: l.get(String(c)),
|
|
2469
2479
|
className: b,
|
|
@@ -2508,7 +2518,7 @@ function gr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2508
2518
|
}) }, e.accessor)) }) })]
|
|
2509
2519
|
}) : L;
|
|
2510
2520
|
}
|
|
2511
|
-
function
|
|
2521
|
+
function Sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2512
2522
|
return p(b, {
|
|
2513
2523
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2514
2524
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
@@ -2519,7 +2529,7 @@ function _r({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
|
|
|
2519
2529
|
}))
|
|
2520
2530
|
});
|
|
2521
2531
|
}
|
|
2522
|
-
function
|
|
2532
|
+
function Cr() {
|
|
2523
2533
|
return m("svg", {
|
|
2524
2534
|
width: "14",
|
|
2525
2535
|
height: "14",
|
|
@@ -2540,17 +2550,17 @@ function vr() {
|
|
|
2540
2550
|
]
|
|
2541
2551
|
});
|
|
2542
2552
|
}
|
|
2543
|
-
var
|
|
2544
|
-
xs:
|
|
2545
|
-
sm:
|
|
2546
|
-
md:
|
|
2547
|
-
lg:
|
|
2548
|
-
xl:
|
|
2553
|
+
var wr = {
|
|
2554
|
+
xs: he(22),
|
|
2555
|
+
sm: he(26),
|
|
2556
|
+
md: he(32),
|
|
2557
|
+
lg: he(38),
|
|
2558
|
+
xl: he(44)
|
|
2549
2559
|
};
|
|
2550
|
-
function
|
|
2560
|
+
function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2551
2561
|
return m(T, {
|
|
2552
2562
|
gap: "xs",
|
|
2553
|
-
children: [p(
|
|
2563
|
+
children: [p(B, {
|
|
2554
2564
|
component: "div",
|
|
2555
2565
|
size: e,
|
|
2556
2566
|
children: t
|
|
@@ -2563,9 +2573,9 @@ function br({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2563
2573
|
size: e,
|
|
2564
2574
|
variant: "default",
|
|
2565
2575
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2566
|
-
rightSection: p(
|
|
2576
|
+
rightSection: p(Cr, {}),
|
|
2567
2577
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2568
|
-
height:
|
|
2578
|
+
height: wr[e],
|
|
2569
2579
|
paddingLeft: t.spacing[e],
|
|
2570
2580
|
paddingRight: t.spacing[e]
|
|
2571
2581
|
})],
|
|
@@ -2574,14 +2584,14 @@ function br({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2574
2584
|
let n = t === r;
|
|
2575
2585
|
return p(A, {
|
|
2576
2586
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2577
|
-
style: [{ height:
|
|
2587
|
+
style: [{ height: wr[e] }, n && (i || a) ? (e) => sn({
|
|
2578
2588
|
theme: e,
|
|
2579
2589
|
paginationActiveTextColor: i,
|
|
2580
2590
|
paginationActiveBackgroundColor: a
|
|
2581
2591
|
}) : void 0],
|
|
2582
2592
|
disabled: n,
|
|
2583
2593
|
onClick: () => o(t),
|
|
2584
|
-
children: p(
|
|
2594
|
+
children: p(B, {
|
|
2585
2595
|
component: "div",
|
|
2586
2596
|
size: e,
|
|
2587
2597
|
children: t
|
|
@@ -2591,7 +2601,7 @@ function br({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2591
2601
|
})]
|
|
2592
2602
|
});
|
|
2593
2603
|
}
|
|
2594
|
-
function
|
|
2604
|
+
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 }) {
|
|
2595
2605
|
let O;
|
|
2596
2606
|
if (g) {
|
|
2597
2607
|
let e = (r - 1) * _ + 1;
|
|
@@ -2601,15 +2611,15 @@ function xr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2601
2611
|
totalRecords: g
|
|
2602
2612
|
});
|
|
2603
2613
|
} else O = n ? u : d;
|
|
2604
|
-
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 = !
|
|
2605
|
-
Text: (e) => p(
|
|
2614
|
+
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 = !Fn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${he(w)}rem` : e[w] || w})`), N = {
|
|
2615
|
+
Text: (e) => p(B, {
|
|
2606
2616
|
component: "div",
|
|
2607
2617
|
className: "mantine-datatable-pagination-text",
|
|
2608
2618
|
size: l,
|
|
2609
2619
|
...e,
|
|
2610
2620
|
children: O
|
|
2611
2621
|
}),
|
|
2612
|
-
PageSizeSelector: (e) => x ? p(
|
|
2622
|
+
PageSizeSelector: (e) => x ? p(Tr, {
|
|
2613
2623
|
activeTextColor: s,
|
|
2614
2624
|
activeBackgroundColor: c,
|
|
2615
2625
|
size: l,
|
|
@@ -2624,7 +2634,7 @@ function xr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2624
2634
|
root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
|
|
2625
2635
|
control: "mantine-datatable-pagination-pages-control"
|
|
2626
2636
|
},
|
|
2627
|
-
style: s || c ? (e) =>
|
|
2637
|
+
style: s || c ? (e) => sn({
|
|
2628
2638
|
theme: e,
|
|
2629
2639
|
paginationActiveTextColor: s,
|
|
2630
2640
|
paginationActiveBackgroundColor: c
|
|
@@ -2670,18 +2680,18 @@ function xr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2670
2680
|
] })
|
|
2671
2681
|
});
|
|
2672
2682
|
}
|
|
2673
|
-
function
|
|
2674
|
-
return
|
|
2683
|
+
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: _ }) {
|
|
2684
|
+
return Fn(r) ? p(ie, {
|
|
2675
2685
|
"data-pinned": n?.position,
|
|
2676
2686
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2677
2687
|
className: X({
|
|
2678
|
-
[
|
|
2679
|
-
[
|
|
2680
|
-
[
|
|
2681
|
-
[
|
|
2682
|
-
[
|
|
2683
|
-
[
|
|
2684
|
-
[
|
|
2688
|
+
[qn]: l || u,
|
|
2689
|
+
[Jn]: u,
|
|
2690
|
+
[Yn]: o || s,
|
|
2691
|
+
[Xn]: c,
|
|
2692
|
+
[Qn]: d === "left",
|
|
2693
|
+
[$n]: d === "center",
|
|
2694
|
+
[er]: d === "right"
|
|
2685
2695
|
}, e),
|
|
2686
2696
|
style: [
|
|
2687
2697
|
{
|
|
@@ -2700,12 +2710,12 @@ function Sr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2700
2710
|
onDoubleClick: s,
|
|
2701
2711
|
onContextMenu: c,
|
|
2702
2712
|
..._?.(i, a),
|
|
2703
|
-
children: h ? h(i, a) : g ? g(i, a, m) :
|
|
2713
|
+
children: h ? h(i, a) : g ? g(i, a, m) : zn(i, m)
|
|
2704
2714
|
}) : null;
|
|
2705
2715
|
}
|
|
2706
|
-
function
|
|
2707
|
-
let { expanded: i, visible: a } =
|
|
2708
|
-
return a ? m(f, { children: [p(
|
|
2716
|
+
function Or({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2717
|
+
let { expanded: i, visible: a } = Kn(e, r?.transitionDuration);
|
|
2718
|
+
return a ? m(f, { children: [p(ce, {}), p(ce, { children: p(ie, {
|
|
2709
2719
|
className: "mantine-datatable-row-expansion-cell",
|
|
2710
2720
|
colSpan: t,
|
|
2711
2721
|
children: p(S, {
|
|
@@ -2718,7 +2728,7 @@ function Cr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2718
2728
|
})
|
|
2719
2729
|
}) })] }) : null;
|
|
2720
2730
|
}
|
|
2721
|
-
function
|
|
2731
|
+
function kr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2722
2732
|
let u = {
|
|
2723
2733
|
...s,
|
|
2724
2734
|
...c(n, r)
|
|
@@ -2726,20 +2736,20 @@ function wr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
|
|
|
2726
2736
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2727
2737
|
};
|
|
2728
2738
|
return p(ie, {
|
|
2729
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2739
|
+
className: X("mantine-datatable-row-selector-cell", { [Yn]: i === "cell" && d }, e),
|
|
2730
2740
|
style: t,
|
|
2731
2741
|
"data-shadow-visible": o || void 0,
|
|
2732
2742
|
onClick: f,
|
|
2733
2743
|
children: p(x, {
|
|
2734
|
-
classNames: d ? { input:
|
|
2744
|
+
classNames: d ? { input: Yn } : void 0,
|
|
2735
2745
|
onChange: a,
|
|
2736
2746
|
...l,
|
|
2737
2747
|
...u
|
|
2738
2748
|
})
|
|
2739
2749
|
});
|
|
2740
2750
|
}
|
|
2741
|
-
function
|
|
2742
|
-
let M = m(f, { children: [s && p(
|
|
2751
|
+
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 }) {
|
|
2752
|
+
let M = m(f, { children: [s && p(kr, {
|
|
2743
2753
|
className: k,
|
|
2744
2754
|
style: A,
|
|
2745
2755
|
record: e,
|
|
@@ -2757,7 +2767,7 @@ function Tr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2757
2767
|
...r,
|
|
2758
2768
|
...s
|
|
2759
2769
|
};
|
|
2760
|
-
return p(
|
|
2770
|
+
return p(Dr, {
|
|
2761
2771
|
pinnedInfo: i.get(String(l)),
|
|
2762
2772
|
className: typeof _ == "function" ? _(e, t) : _,
|
|
2763
2773
|
style: v?.(e, t),
|
|
@@ -2794,7 +2804,7 @@ function Tr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2794
2804
|
defaultRender: a,
|
|
2795
2805
|
customCellAttributes: S
|
|
2796
2806
|
}, l);
|
|
2797
|
-
})] }), N = S && p(
|
|
2807
|
+
})] }), N = S && p(Or, {
|
|
2798
2808
|
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2799
2809
|
open: S.isRowExpanded(e),
|
|
2800
2810
|
content: S.content({
|
|
@@ -2802,7 +2812,7 @@ function Tr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2802
2812
|
index: t
|
|
2803
2813
|
}),
|
|
2804
2814
|
collapseProps: S.collapseProps
|
|
2805
|
-
}), P =
|
|
2815
|
+
}), P = jr({
|
|
2806
2816
|
record: e,
|
|
2807
2817
|
index: t,
|
|
2808
2818
|
selectionChecked: c,
|
|
@@ -2822,17 +2832,17 @@ function Tr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2822
2832
|
rowProps: P,
|
|
2823
2833
|
children: M,
|
|
2824
2834
|
expandedElement: N
|
|
2825
|
-
}) : m(f, { children: [p(
|
|
2835
|
+
}) : m(f, { children: [p(ce, {
|
|
2826
2836
|
...P,
|
|
2827
2837
|
children: M
|
|
2828
2838
|
}), N] });
|
|
2829
2839
|
}
|
|
2830
|
-
function
|
|
2840
|
+
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 }) {
|
|
2831
2841
|
return {
|
|
2832
|
-
className: X("mantine-datatable-row", { [
|
|
2842
|
+
className: X("mantine-datatable-row", { [Yn]: r || i || o?.isExpandable({
|
|
2833
2843
|
record: e,
|
|
2834
2844
|
index: t
|
|
2835
|
-
}) && o?.expandOnClick }, { [
|
|
2845
|
+
}) && o?.expandOnClick }, { [Xn]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2836
2846
|
"data-selected": n || void 0,
|
|
2837
2847
|
onClick: (n) => {
|
|
2838
2848
|
if (o) {
|
|
@@ -2860,7 +2870,7 @@ function Er({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2860
2870
|
}) : void 0,
|
|
2861
2871
|
style: [c || l ? (n) => {
|
|
2862
2872
|
let r = c?.(e, t), i = l?.(e, t);
|
|
2863
|
-
return
|
|
2873
|
+
return cn({
|
|
2864
2874
|
theme: n,
|
|
2865
2875
|
color: r,
|
|
2866
2876
|
backgroundColor: i
|
|
@@ -2869,7 +2879,7 @@ function Er({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2869
2879
|
...s?.(e, t) ?? {}
|
|
2870
2880
|
};
|
|
2871
2881
|
}
|
|
2872
|
-
function
|
|
2882
|
+
function Mr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2873
2883
|
return m(L, {
|
|
2874
2884
|
...a,
|
|
2875
2885
|
viewportRef: i,
|
|
@@ -2889,26 +2899,26 @@ function Dr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2889
2899
|
]
|
|
2890
2900
|
});
|
|
2891
2901
|
}
|
|
2892
|
-
function
|
|
2893
|
-
let dt = l(() => y ?
|
|
2902
|
+
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: F, sortIcons: ee, onSortStatusChange: I, horizontalSpacing: L, page: R, onPageChange: te, totalRecords: z, recordsPerPage: ne, onRecordsPerPageChange: ie, recordsPerPageOptions: ae, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: le, paginationActiveBackgroundColor: B, paginationSize: ue = "sm", paginationText: de = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: fe = "sm", getPaginationControlProps: pe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: me, renderPagination: he, loaderBackgroundBlur: ge, customLoader: _e, loaderSize: ve, loaderType: ye, loaderColor: be, loadingText: xe = "...", emptyState: Se, noRecordsText: Ce = "No records", noRecordsIcon: we, highlightOnHover: Te, striped: Ee, noHeader: De, onRowClick: Oe, onRowDoubleClick: ke, onRowContextMenu: Ae, onCellClick: je, onCellDoubleClick: V, onCellContextMenu: Me, onScroll: Pe, onScrollToTop: Fe, onScrollToBottom: Ie, onScrollToLeft: Le, onScrollToRight: Re, c: ze, backgroundColor: Be, borderColor: Ve, rowBorderColor: He, stripedColor: Ue, highlightOnHoverColor: H, rowColor: U, rowBackgroundColor: We, rowExpansion: Ge, rowClassName: Ke, rowStyle: W, customRowAttributes: qe, scrollViewportRef: Je, scrollAreaProps: Ye, tableRef: Xe, bodyRef: G, m: Ze, my: Qe, mx: $e, mt: et, mb: tt, ml: nt, mr: rt, className: it, classNames: at, style: ot, styles: st, rowFactory: ct, tableWrapper: lt, ...ut }) {
|
|
2903
|
+
let dt = l(() => y ? Vn(y) : g, [g, y]), { refs: K, onScroll: ft } = On({
|
|
2894
2904
|
scrollCallbacks: {
|
|
2895
|
-
onScroll:
|
|
2896
|
-
onScrollToTop:
|
|
2897
|
-
onScrollToBottom:
|
|
2898
|
-
onScrollToLeft:
|
|
2899
|
-
onScrollToRight:
|
|
2905
|
+
onScroll: Pe,
|
|
2906
|
+
onScrollToTop: Fe,
|
|
2907
|
+
onScrollToBottom: Ie,
|
|
2908
|
+
onScrollToLeft: Le,
|
|
2909
|
+
onScrollToRight: Re
|
|
2900
2910
|
},
|
|
2901
2911
|
withRowBorders: ut.withRowBorders
|
|
2902
|
-
}), q =
|
|
2912
|
+
}), q = yn({
|
|
2903
2913
|
key: _,
|
|
2904
2914
|
columns: dt,
|
|
2905
2915
|
headerRef: K.header,
|
|
2906
2916
|
scrollViewportRef: K.scrollViewport
|
|
2907
|
-
}), pt = q.effectiveColumns, mt =
|
|
2908
|
-
rowExpansion:
|
|
2917
|
+
}), pt = q.effectiveColumns, mt = Ne(K.table, Xe), ht = Ne(K.scrollViewport, Je), gt = u(null), _t = Ne(gt, G), vt = Gn({
|
|
2918
|
+
rowExpansion: Ge,
|
|
2909
2919
|
records: T,
|
|
2910
2920
|
idAccessor: w
|
|
2911
|
-
}), { pinnedMap: yt, hasLeftPinned: bt, hasRightPinned: xt } =
|
|
2921
|
+
}), { pinnedMap: yt, hasLeftPinned: bt, hasRightPinned: xt } = kn({
|
|
2912
2922
|
columns: pt,
|
|
2913
2923
|
theadRef: K.header,
|
|
2914
2924
|
tbodyRef: gt,
|
|
@@ -2940,7 +2950,7 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2940
2950
|
K.scrollViewport
|
|
2941
2951
|
]);
|
|
2942
2952
|
let Dt = T?.map((e) => $(e, w)), Ot = !!D, kt = D?.map((e) => $(e, w)), At = Dt !== void 0 && kt !== void 0 && kt.length > 0, jt = j ? T?.filter(j) : T, Mt = jt?.map((e) => $(e, w)), J = At && Mt.every((e) => kt.includes(e)), Nt = At && Mt.some((e) => kt.includes(e)), Pt = a(() => {
|
|
2943
|
-
D && O && O(J ? D.filter((e) => !Mt.includes($(e, w))) :
|
|
2953
|
+
D && O && O(J ? D.filter((e) => !Mt.includes($(e, w))) : Rn([...D, ...jt], (e) => $(e, w)));
|
|
2944
2954
|
}, [
|
|
2945
2955
|
J,
|
|
2946
2956
|
w,
|
|
@@ -2948,7 +2958,7 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2948
2958
|
Mt,
|
|
2949
2959
|
jt,
|
|
2950
2960
|
D
|
|
2951
|
-
]), { lastSelectionChangeIndex: Y, setLastSelectionChangeIndex: Ft } =
|
|
2961
|
+
]), { lastSelectionChangeIndex: Y, setLastSelectionChangeIndex: Ft } = An(Dt), It = Ot && !bt, Lt = {
|
|
2952
2962
|
m: Ze,
|
|
2953
2963
|
my: Qe,
|
|
2954
2964
|
mx: $e,
|
|
@@ -2957,7 +2967,7 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2957
2967
|
ml: nt,
|
|
2958
2968
|
mr: rt
|
|
2959
2969
|
}, Rt = a(({ children: e }) => lt ? lt({ children: e }) : e, [lt]);
|
|
2960
|
-
return p(
|
|
2970
|
+
return p(dn, {
|
|
2961
2971
|
...q,
|
|
2962
2972
|
pinnedMap: yt,
|
|
2963
2973
|
children: m(v, {
|
|
@@ -2966,14 +2976,14 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2966
2976
|
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, it, at?.root),
|
|
2967
2977
|
style: [
|
|
2968
2978
|
(e) => ({
|
|
2969
|
-
...
|
|
2979
|
+
...on({
|
|
2970
2980
|
theme: e,
|
|
2971
|
-
c:
|
|
2972
|
-
backgroundColor:
|
|
2973
|
-
borderColor:
|
|
2974
|
-
rowBorderColor:
|
|
2975
|
-
stripedColor:
|
|
2976
|
-
highlightOnHoverColor:
|
|
2981
|
+
c: ze,
|
|
2982
|
+
backgroundColor: Be,
|
|
2983
|
+
borderColor: Ve,
|
|
2984
|
+
rowBorderColor: He,
|
|
2985
|
+
stripedColor: Ue,
|
|
2986
|
+
highlightOnHoverColor: H
|
|
2977
2987
|
}),
|
|
2978
2988
|
borderRadius: e.radius[t] || t,
|
|
2979
2989
|
boxShadow: e.shadows[d] || d,
|
|
@@ -2986,17 +2996,17 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2986
2996
|
{ position: "relative" }
|
|
2987
2997
|
],
|
|
2988
2998
|
children: [
|
|
2989
|
-
p(
|
|
2999
|
+
p(Mr, {
|
|
2990
3000
|
viewportRef: ht,
|
|
2991
3001
|
leftShadowBehind: Ot || bt,
|
|
2992
3002
|
rightShadowBehind: xt,
|
|
2993
3003
|
onScrollPositionChange: ft,
|
|
2994
|
-
scrollAreaProps:
|
|
3004
|
+
scrollAreaProps: Ye,
|
|
2995
3005
|
children: p(Rt, { children: m(re, {
|
|
2996
3006
|
ref: mt,
|
|
2997
3007
|
horizontalSpacing: L,
|
|
2998
3008
|
className: X("mantine-datatable-table", {
|
|
2999
|
-
[
|
|
3009
|
+
[Zn]: n,
|
|
3000
3010
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3001
3011
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3002
3012
|
"mantine-datatable-selection-column-visible": Ot,
|
|
@@ -3009,14 +3019,14 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3009
3019
|
...q.isLocked ? { tableLayout: "fixed" } : null,
|
|
3010
3020
|
...q.tableWidth == null ? null : { width: `${q.tableWidth}px` }
|
|
3011
3021
|
},
|
|
3012
|
-
"data-striped": Et &&
|
|
3013
|
-
"data-highlight-on-hover":
|
|
3022
|
+
"data-striped": Et && Ee || void 0,
|
|
3023
|
+
"data-highlight-on-hover": Te || void 0,
|
|
3014
3024
|
...ut,
|
|
3015
3025
|
children: [
|
|
3016
|
-
|
|
3026
|
+
De ? null : p(dn, {
|
|
3017
3027
|
...q,
|
|
3018
3028
|
pinnedMap: yt,
|
|
3019
|
-
children: p(
|
|
3029
|
+
children: p(xr, {
|
|
3020
3030
|
ref: K.header,
|
|
3021
3031
|
selectionColumnHeaderRef: K.selectionColumnHeader,
|
|
3022
3032
|
className: at?.header,
|
|
@@ -3050,10 +3060,10 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3050
3060
|
return O && D && (i = (i) => {
|
|
3051
3061
|
if (i.nativeEvent.shiftKey && Y !== null) {
|
|
3052
3062
|
let e = T.filter(t > Y ? (e, n) => n >= Y && n <= t && (j ? j(e, n) : !0) : (e, n) => n >= t && n <= Y && (j ? j(e, n) : !0));
|
|
3053
|
-
O(r ?
|
|
3054
|
-
} else O(r ? D.filter((e) => $(e, w) !== n) :
|
|
3063
|
+
O(r ? Ln(D, e, (e) => $(e, w)) : Rn([...D, ...e], (e) => $(e, w)));
|
|
3064
|
+
} else O(r ? D.filter((e) => $(e, w) !== n) : Rn([...D, e], (e) => $(e, w)));
|
|
3055
3065
|
Ft(t);
|
|
3056
|
-
}), p(
|
|
3066
|
+
}), p(Ar, {
|
|
3057
3067
|
record: e,
|
|
3058
3068
|
index: t,
|
|
3059
3069
|
columns: pt,
|
|
@@ -3067,27 +3077,27 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3067
3077
|
isRecordSelectable: j,
|
|
3068
3078
|
selectionCheckboxProps: M,
|
|
3069
3079
|
getSelectionCheckboxProps: P,
|
|
3070
|
-
onClick:
|
|
3071
|
-
onDoubleClick:
|
|
3072
|
-
onCellClick:
|
|
3073
|
-
onCellDoubleClick:
|
|
3074
|
-
onContextMenu:
|
|
3075
|
-
onCellContextMenu:
|
|
3080
|
+
onClick: Oe,
|
|
3081
|
+
onDoubleClick: ke,
|
|
3082
|
+
onCellClick: je,
|
|
3083
|
+
onCellDoubleClick: V,
|
|
3084
|
+
onContextMenu: Ae,
|
|
3085
|
+
onCellContextMenu: Me,
|
|
3076
3086
|
expansion: vt,
|
|
3077
|
-
color:
|
|
3078
|
-
backgroundColor:
|
|
3079
|
-
className:
|
|
3080
|
-
style:
|
|
3081
|
-
customAttributes:
|
|
3087
|
+
color: U,
|
|
3088
|
+
backgroundColor: We,
|
|
3089
|
+
className: Ke,
|
|
3090
|
+
style: W,
|
|
3091
|
+
customAttributes: qe,
|
|
3082
3092
|
selectorCellShadowVisible: It,
|
|
3083
3093
|
selectionColumnClassName: k,
|
|
3084
3094
|
selectionColumnStyle: A,
|
|
3085
3095
|
idAccessor: w,
|
|
3086
3096
|
rowFactory: ct
|
|
3087
3097
|
}, n);
|
|
3088
|
-
}) : p(
|
|
3098
|
+
}) : p(fn, {})
|
|
3089
3099
|
}),
|
|
3090
|
-
pt.some(({ footer: e }) => e) && p(
|
|
3100
|
+
pt.some(({ footer: e }) => e) && p(rr, {
|
|
3091
3101
|
ref: K.footer,
|
|
3092
3102
|
className: at?.footer,
|
|
3093
3103
|
style: st?.footer,
|
|
@@ -3100,7 +3110,7 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3100
3110
|
]
|
|
3101
3111
|
}) })
|
|
3102
3112
|
}),
|
|
3103
|
-
!!(R && Et) && p(
|
|
3113
|
+
!!(R && Et) && p(Er, {
|
|
3104
3114
|
className: at?.pagination,
|
|
3105
3115
|
style: st?.pagination,
|
|
3106
3116
|
horizontalSpacing: L,
|
|
@@ -3113,32 +3123,32 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3113
3123
|
recordsPerPageOptions: ae,
|
|
3114
3124
|
recordsPerPageLabel: oe,
|
|
3115
3125
|
paginationWithEdges: se,
|
|
3116
|
-
paginationWithControls:
|
|
3117
|
-
paginationActiveTextColor:
|
|
3118
|
-
paginationActiveBackgroundColor:
|
|
3119
|
-
paginationSize:
|
|
3120
|
-
paginationText:
|
|
3121
|
-
paginationWrapBreakpoint:
|
|
3122
|
-
getPaginationControlProps:
|
|
3123
|
-
getPaginationItemProps:
|
|
3124
|
-
noRecordsText:
|
|
3125
|
-
loadingText:
|
|
3126
|
+
paginationWithControls: ce,
|
|
3127
|
+
paginationActiveTextColor: le,
|
|
3128
|
+
paginationActiveBackgroundColor: B,
|
|
3129
|
+
paginationSize: ue,
|
|
3130
|
+
paginationText: de,
|
|
3131
|
+
paginationWrapBreakpoint: fe,
|
|
3132
|
+
getPaginationControlProps: pe,
|
|
3133
|
+
getPaginationItemProps: me,
|
|
3134
|
+
noRecordsText: Ce,
|
|
3135
|
+
loadingText: xe,
|
|
3126
3136
|
recordsLength: Et,
|
|
3127
|
-
renderPagination:
|
|
3137
|
+
renderPagination: he
|
|
3128
3138
|
}),
|
|
3129
|
-
p(
|
|
3139
|
+
p(Sr, {
|
|
3130
3140
|
fetching: h,
|
|
3131
|
-
backgroundBlur:
|
|
3132
|
-
customContent:
|
|
3133
|
-
size:
|
|
3134
|
-
type:
|
|
3135
|
-
color:
|
|
3141
|
+
backgroundBlur: ge,
|
|
3142
|
+
customContent: _e,
|
|
3143
|
+
size: ve,
|
|
3144
|
+
type: ye,
|
|
3145
|
+
color: be
|
|
3136
3146
|
}),
|
|
3137
|
-
p(
|
|
3138
|
-
icon:
|
|
3139
|
-
text:
|
|
3147
|
+
p(mn, {
|
|
3148
|
+
icon: we,
|
|
3149
|
+
text: Ce,
|
|
3140
3150
|
active: !h && !Et,
|
|
3141
|
-
children:
|
|
3151
|
+
children: Se
|
|
3142
3152
|
})
|
|
3143
3153
|
]
|
|
3144
3154
|
})
|
|
@@ -3146,9 +3156,9 @@ function Or({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3146
3156
|
}
|
|
3147
3157
|
//#endregion
|
|
3148
3158
|
//#region src/DataTable/UpdateModal.tsx
|
|
3149
|
-
function
|
|
3150
|
-
let { data:
|
|
3151
|
-
return
|
|
3159
|
+
function Pr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3160
|
+
let { data: s, isLoading: c } = Ht(i, n, a), { mutateAsync: l, isPending: u, error: d } = Kt(i, n, r);
|
|
3161
|
+
return c || !s ? /* @__PURE__ */ m(z, {
|
|
3152
3162
|
gap: "md",
|
|
3153
3163
|
children: [
|
|
3154
3164
|
/* @__PURE__ */ p(te, { height: 40 }),
|
|
@@ -3165,57 +3175,53 @@ function kr({ fields: e, onClose: t, queryKey: n, apiPath: r, id: i, steps: a })
|
|
|
3165
3175
|
})]
|
|
3166
3176
|
})
|
|
3167
3177
|
]
|
|
3168
|
-
}) : /* @__PURE__ */ p(
|
|
3178
|
+
}) : /* @__PURE__ */ p(nn, {
|
|
3169
3179
|
fields: e,
|
|
3170
|
-
steps:
|
|
3171
|
-
record:
|
|
3172
|
-
recordId:
|
|
3173
|
-
submitting:
|
|
3174
|
-
error:
|
|
3180
|
+
steps: o,
|
|
3181
|
+
record: s,
|
|
3182
|
+
recordId: a,
|
|
3183
|
+
submitting: u,
|
|
3184
|
+
error: d,
|
|
3175
3185
|
onPersist: async (e) => {
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
}), !0;
|
|
3181
|
-
} catch {
|
|
3182
|
-
return !1;
|
|
3183
|
-
}
|
|
3186
|
+
await l({
|
|
3187
|
+
...e,
|
|
3188
|
+
id: a
|
|
3189
|
+
});
|
|
3184
3190
|
},
|
|
3185
3191
|
onClose: t
|
|
3186
3192
|
});
|
|
3187
3193
|
}
|
|
3188
3194
|
//#endregion
|
|
3189
3195
|
//#region src/DataTable/DeleteModal.tsx
|
|
3190
|
-
function
|
|
3191
|
-
let { mutateAsync:
|
|
3196
|
+
function Fr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, selectedRecords: i, confirmMessage: a }) {
|
|
3197
|
+
let { mutateAsync: o, isError: c, error: l, isPending: u } = qt(n, e, t), [h, g] = d(i), [v, b] = d(!1), x = v || u;
|
|
3192
3198
|
return s(() => {
|
|
3193
|
-
|
|
3194
|
-
}, [
|
|
3195
|
-
|
|
3199
|
+
h.length || r();
|
|
3200
|
+
}, [r, h]), h.length ? /* @__PURE__ */ m(f, { children: [
|
|
3201
|
+
c && l.message && /* @__PURE__ */ p(_, {
|
|
3196
3202
|
variant: "outline",
|
|
3197
3203
|
color: "red",
|
|
3198
|
-
title:
|
|
3199
|
-
children:
|
|
3204
|
+
title: l.name,
|
|
3205
|
+
children: l.message
|
|
3200
3206
|
}),
|
|
3201
|
-
/* @__PURE__ */ p(
|
|
3207
|
+
/* @__PURE__ */ p(B, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3202
3208
|
/* @__PURE__ */ m(T, {
|
|
3203
3209
|
mt: "md",
|
|
3204
3210
|
justify: "end",
|
|
3205
3211
|
children: [/* @__PURE__ */ p(y, {
|
|
3206
|
-
onClick:
|
|
3212
|
+
onClick: r,
|
|
3207
3213
|
variant: "outline",
|
|
3208
|
-
disabled:
|
|
3214
|
+
disabled: x,
|
|
3209
3215
|
children: "Abbrechen"
|
|
3210
3216
|
}), /* @__PURE__ */ p(y, {
|
|
3211
3217
|
color: "red",
|
|
3212
|
-
loading:
|
|
3218
|
+
loading: x,
|
|
3213
3219
|
onClick: async () => {
|
|
3214
|
-
|
|
3220
|
+
b(!0);
|
|
3215
3221
|
try {
|
|
3216
|
-
await Promise.all(
|
|
3222
|
+
await Promise.all(h.map((e) => o(e.id))), g([]);
|
|
3217
3223
|
} finally {
|
|
3218
|
-
|
|
3224
|
+
b(!1);
|
|
3219
3225
|
}
|
|
3220
3226
|
},
|
|
3221
3227
|
children: "Löschen"
|
|
@@ -3225,7 +3231,7 @@ function Ar({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMe
|
|
|
3225
3231
|
}
|
|
3226
3232
|
//#endregion
|
|
3227
3233
|
//#region src/Hooks/usePersistentState.ts
|
|
3228
|
-
function
|
|
3234
|
+
function Ir(e, t) {
|
|
3229
3235
|
let n = `use_persistent_storage_${t}`, [r, i] = d(() => {
|
|
3230
3236
|
try {
|
|
3231
3237
|
let t = localStorage.getItem(n);
|
|
@@ -3243,12 +3249,12 @@ function jr(e, t) {
|
|
|
3243
3249
|
}
|
|
3244
3250
|
//#endregion
|
|
3245
3251
|
//#region src/utils/sort.ts
|
|
3246
|
-
var
|
|
3252
|
+
var Lr = [
|
|
3247
3253
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
3248
3254
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
3249
3255
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
3250
3256
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
3251
|
-
],
|
|
3257
|
+
], Rr = (e, t) => {
|
|
3252
3258
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
3253
3259
|
if (n.length === 0) return "string";
|
|
3254
3260
|
let r = n.slice(0, 100), i = {
|
|
@@ -3264,7 +3270,7 @@ var Mr = [
|
|
|
3264
3270
|
i.number++;
|
|
3265
3271
|
return;
|
|
3266
3272
|
}
|
|
3267
|
-
if (
|
|
3273
|
+
if (Lr.some((e) => e.test(t))) {
|
|
3268
3274
|
let e = new Date(t);
|
|
3269
3275
|
if (!isNaN(e.getTime())) {
|
|
3270
3276
|
i.date++;
|
|
@@ -3277,7 +3283,7 @@ var Mr = [
|
|
|
3277
3283
|
let a = i.string + i.number + i.date;
|
|
3278
3284
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
3279
3285
|
};
|
|
3280
|
-
function
|
|
3286
|
+
function zr(e, t) {
|
|
3281
3287
|
switch (t) {
|
|
3282
3288
|
case "date":
|
|
3283
3289
|
if (typeof e == "string") {
|
|
@@ -3293,54 +3299,54 @@ function Pr(e, t) {
|
|
|
3293
3299
|
default: return String(e).toLowerCase().trim();
|
|
3294
3300
|
}
|
|
3295
3301
|
}
|
|
3296
|
-
var
|
|
3302
|
+
var Br = (e, t, n = "asc") => {
|
|
3297
3303
|
if (!e || e.length === 0) return [];
|
|
3298
|
-
let r =
|
|
3304
|
+
let r = Rr(e, t);
|
|
3299
3305
|
return [...e].sort((e, i) => {
|
|
3300
3306
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
3301
3307
|
if (s && c) return 0;
|
|
3302
3308
|
if (s) return n === "asc" ? -1 : 1;
|
|
3303
3309
|
if (c) return n === "asc" ? 1 : -1;
|
|
3304
|
-
let l =
|
|
3310
|
+
let l = zr(a, r), u = zr(o, r);
|
|
3305
3311
|
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;
|
|
3306
3312
|
});
|
|
3307
3313
|
};
|
|
3308
3314
|
//#endregion
|
|
3309
3315
|
//#region src/utils/filter.ts
|
|
3310
|
-
function
|
|
3316
|
+
function Vr(e) {
|
|
3311
3317
|
return !!e && typeof e == "object" && "id" in e;
|
|
3312
3318
|
}
|
|
3313
|
-
function
|
|
3319
|
+
function Hr(e, t) {
|
|
3314
3320
|
if (typeof e == "string" || typeof e == "number") return t.includes(String(e));
|
|
3315
3321
|
if (e && typeof e == "object") {
|
|
3316
3322
|
let n = e;
|
|
3317
|
-
return
|
|
3323
|
+
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));
|
|
3318
3324
|
}
|
|
3319
3325
|
return !1;
|
|
3320
3326
|
}
|
|
3321
|
-
function
|
|
3322
|
-
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) =>
|
|
3327
|
+
function Ur(e, t) {
|
|
3328
|
+
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);
|
|
3323
3329
|
}
|
|
3324
|
-
function
|
|
3330
|
+
function Wr(e, [t, n]) {
|
|
3325
3331
|
if (!t && !n || typeof e != "string") return !0;
|
|
3326
3332
|
let r = e.split(" ")[0];
|
|
3327
3333
|
return t && n ? r >= t && r <= n : t ? r >= t : r <= n;
|
|
3328
3334
|
}
|
|
3329
|
-
function
|
|
3335
|
+
function Gr(e, t) {
|
|
3330
3336
|
if (t.value === void 0) return !0;
|
|
3331
3337
|
let n = e[t.id];
|
|
3332
3338
|
switch (t.type) {
|
|
3333
|
-
case "query": return
|
|
3334
|
-
case "date": return
|
|
3339
|
+
case "query": return Ur(n, t.value);
|
|
3340
|
+
case "date": return Wr(n, t.value);
|
|
3335
3341
|
case "boolean": return n === t.value;
|
|
3336
3342
|
}
|
|
3337
3343
|
}
|
|
3338
|
-
function
|
|
3339
|
-
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) =>
|
|
3344
|
+
function Kr(e, t) {
|
|
3345
|
+
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => Gr(e, t)));
|
|
3340
3346
|
}
|
|
3341
3347
|
//#endregion
|
|
3342
3348
|
//#region src/DataTable/FieldCard.tsx
|
|
3343
|
-
function
|
|
3349
|
+
function qr({ rows: e }) {
|
|
3344
3350
|
return /* @__PURE__ */ p(f, { children: e.map((e, t) => /* @__PURE__ */ m(v, { children: [t > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ m(T, {
|
|
3345
3351
|
wrap: "nowrap",
|
|
3346
3352
|
justify: "space-between",
|
|
@@ -3348,7 +3354,7 @@ function Hr({ rows: e }) {
|
|
|
3348
3354
|
gap: "md",
|
|
3349
3355
|
py: "xs",
|
|
3350
3356
|
px: "sm",
|
|
3351
|
-
children: [/* @__PURE__ */ p(
|
|
3357
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3352
3358
|
fw: 700,
|
|
3353
3359
|
fz: "sm",
|
|
3354
3360
|
style: { flexShrink: 0 },
|
|
@@ -3361,39 +3367,39 @@ function Hr({ rows: e }) {
|
|
|
3361
3367
|
})]
|
|
3362
3368
|
})] }, typeof e.label == "string" ? e.label : t)) });
|
|
3363
3369
|
}
|
|
3364
|
-
function
|
|
3370
|
+
function Jr({ rows: e }) {
|
|
3365
3371
|
return /* @__PURE__ */ p(v, {
|
|
3366
3372
|
bg: "var(--mantine-color-gray-light)",
|
|
3367
3373
|
style: {
|
|
3368
3374
|
borderRadius: "var(--mantine-radius-md)",
|
|
3369
3375
|
overflow: "hidden"
|
|
3370
3376
|
},
|
|
3371
|
-
children: /* @__PURE__ */ p(
|
|
3377
|
+
children: /* @__PURE__ */ p(qr, { rows: e })
|
|
3372
3378
|
});
|
|
3373
3379
|
}
|
|
3374
3380
|
//#endregion
|
|
3375
3381
|
//#region src/DataTable/MobileCardList.tsx
|
|
3376
|
-
function
|
|
3382
|
+
function Yr(e, t) {
|
|
3377
3383
|
return t.split(".").reduce((e, t) => {
|
|
3378
3384
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
3379
3385
|
}, e);
|
|
3380
3386
|
}
|
|
3381
|
-
function
|
|
3387
|
+
function Xr(e, t) {
|
|
3382
3388
|
let n = t.column;
|
|
3383
3389
|
if (n.render) return n.render(e, 0);
|
|
3384
|
-
let r =
|
|
3385
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3390
|
+
let r = Yr(e, n.accessor ?? t.id);
|
|
3391
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
3386
3392
|
c: "dimmed",
|
|
3387
3393
|
children: "–"
|
|
3388
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3394
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
3389
3395
|
fz: "sm",
|
|
3390
3396
|
children: r ? "Ja" : "Nein"
|
|
3391
|
-
}) : /* @__PURE__ */ p(
|
|
3397
|
+
}) : /* @__PURE__ */ p(B, {
|
|
3392
3398
|
fz: "sm",
|
|
3393
3399
|
children: String(r)
|
|
3394
3400
|
});
|
|
3395
3401
|
}
|
|
3396
|
-
function
|
|
3402
|
+
function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3397
3403
|
let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
|
|
3398
3404
|
if (y) {
|
|
3399
3405
|
let { recordIds: t, onRecordIdsChange: n } = y;
|
|
@@ -3433,7 +3439,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3433
3439
|
variant: "filled",
|
|
3434
3440
|
size: "input-sm",
|
|
3435
3441
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3436
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3442
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(De, { size: 18 }) : /* @__PURE__ */ p(Oe, { size: 18 })
|
|
3437
3443
|
})] }), D.length > 0 && /* @__PURE__ */ m(F, {
|
|
3438
3444
|
opened: M,
|
|
3439
3445
|
onChange: N,
|
|
@@ -3451,7 +3457,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3451
3457
|
size: "input-sm",
|
|
3452
3458
|
onClick: () => N((e) => !e),
|
|
3453
3459
|
"aria-label": "Filter",
|
|
3454
|
-
children: /* @__PURE__ */ p(
|
|
3460
|
+
children: /* @__PURE__ */ p(Ce, { size: 18 })
|
|
3455
3461
|
})
|
|
3456
3462
|
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3457
3463
|
p: 0,
|
|
@@ -3466,7 +3472,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3466
3472
|
value: e.id,
|
|
3467
3473
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3468
3474
|
gap: "xs",
|
|
3469
|
-
children: [/* @__PURE__ */ p(
|
|
3475
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3470
3476
|
fw: 600,
|
|
3471
3477
|
fz: "sm",
|
|
3472
3478
|
children: e.column.title ?? e.id
|
|
@@ -3482,7 +3488,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3482
3488
|
})]
|
|
3483
3489
|
})]
|
|
3484
3490
|
}),
|
|
3485
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3491
|
+
e.length === 0 && /* @__PURE__ */ p(B, {
|
|
3486
3492
|
c: "dimmed",
|
|
3487
3493
|
ta: "center",
|
|
3488
3494
|
py: "xl",
|
|
@@ -3517,7 +3523,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3517
3523
|
color: "gray",
|
|
3518
3524
|
size: "sm",
|
|
3519
3525
|
onClick: (e) => e.stopPropagation(),
|
|
3520
|
-
children: /* @__PURE__ */ p(
|
|
3526
|
+
children: /* @__PURE__ */ p(Se, { size: 16 })
|
|
3521
3527
|
}) }), /* @__PURE__ */ p(O.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(O.Item, {
|
|
3522
3528
|
leftSection: t.icon,
|
|
3523
3529
|
onClick: (n) => {
|
|
@@ -3527,9 +3533,9 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3527
3533
|
}, `card_action_${n}`)) })]
|
|
3528
3534
|
});
|
|
3529
3535
|
})()
|
|
3530
|
-
}), /* @__PURE__ */ p(
|
|
3536
|
+
}), /* @__PURE__ */ p(qr, { rows: w.map((t) => ({
|
|
3531
3537
|
label: t.column.title ?? t.id,
|
|
3532
|
-
value:
|
|
3538
|
+
value: Xr(e, t)
|
|
3533
3539
|
})) })]
|
|
3534
3540
|
}), c && /* @__PURE__ */ m(S, {
|
|
3535
3541
|
expanded: u,
|
|
@@ -3555,7 +3561,7 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3555
3561
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3556
3562
|
justify: "center",
|
|
3557
3563
|
gap: "xs",
|
|
3558
|
-
children: [/* @__PURE__ */ p(
|
|
3564
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3559
3565
|
fz: "xs",
|
|
3560
3566
|
c: "dimmed",
|
|
3561
3567
|
children: "Einträge pro Seite:"
|
|
@@ -3577,36 +3583,28 @@ function Kr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3577
3583
|
}
|
|
3578
3584
|
//#endregion
|
|
3579
3585
|
//#region src/DataTable/DataTable.tsx
|
|
3580
|
-
var
|
|
3586
|
+
var Qr = [
|
|
3581
3587
|
10,
|
|
3582
3588
|
15,
|
|
3583
3589
|
50,
|
|
3584
3590
|
100,
|
|
3585
3591
|
500
|
|
3586
3592
|
];
|
|
3587
|
-
function
|
|
3588
|
-
let [ae, oe] = d(A || (k && k.length > 0 ? k[0].value : null)), se = j === void 0 ? ae : j,
|
|
3593
|
+
function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutationApiPath: a, buttons: o, fields: c, selection: l, pagination: u, filters: h, actions: b, steps: x, defaultSort: S, onSortChange: C, createButtonText: E, queryParams: D, tabs: k, defaultTab: A, activeTab: j, onActiveTabChange: N, canUpdate: P, canDelete: F, showRefresh: ee = !0, rowExpansion: I, onRowClick: L, mobileCards: R = !1, deleteConfirmMessage: ne, editRecordId: re, onEditRecordIdChange: ie }) {
|
|
3594
|
+
let [ae, oe] = d(A || (k && k.length > 0 ? k[0].value : null)), se = j === void 0 ? ae : j, ce = (e) => {
|
|
3589
3595
|
j === void 0 && oe(e), N && N(e);
|
|
3590
|
-
},
|
|
3596
|
+
}, B = k?.find((e) => e.value === se), ue = B?.queryParams || {}, de = B?.apiPath ?? r, pe = B?.mutationApiPath ?? a ?? de, me = {
|
|
3591
3597
|
...D,
|
|
3592
|
-
...
|
|
3593
|
-
},
|
|
3594
|
-
s(() => {
|
|
3595
|
-
!he || !Array.isArray(he) || n?.forEach((e) => Te.invalidateQueries({ queryKey: e }));
|
|
3596
|
-
}, [
|
|
3597
|
-
he,
|
|
3598
|
-
n,
|
|
3599
|
-
Te
|
|
3600
|
-
]);
|
|
3601
|
-
let Ee = Vr(Array.isArray(he) ? he : [], h), [Oe, ke] = d({
|
|
3598
|
+
...ue
|
|
3599
|
+
}, he = me ? "?" + Object.entries(me).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", ge = se ? [...t, se] : t, { data: _e, isLoading: ve, isError: ye, isRefetching: Se, refetch: Ce } = Ut(de + he, ge), De = Kr(Array.isArray(_e) ? _e : [], h), [Oe, Ae] = d({
|
|
3602
3600
|
columnAccessor: S?.field ?? c[0].id,
|
|
3603
3601
|
direction: S?.direction ?? "desc"
|
|
3604
|
-
}),
|
|
3605
|
-
|
|
3606
|
-
},
|
|
3607
|
-
|
|
3608
|
-
},
|
|
3609
|
-
if (t !==
|
|
3602
|
+
}), je = (e) => {
|
|
3603
|
+
Ae(e), C && C(String(e.columnAccessor), e.direction);
|
|
3604
|
+
}, V = Br(De, Oe.columnAccessor, Oe.direction), [Me, Ne] = Ir(Qr[1], "mantine-table-page-size"), [Pe, Fe] = d(1), Ie = u ? V.slice((Pe - 1) * Me, Pe * Me) : V, [Le, Re] = d([]), ze = I?.expanded?.recordIds ?? Le, Be = I?.expanded?.onRecordIdsChange ?? Re, Ve = (e) => {
|
|
3605
|
+
ze.includes(e) ? Be(ze.filter((t) => t !== e)) : Be(I?.allowMultiple ? [...ze, e] : [e]);
|
|
3606
|
+
}, He = c.findIndex((e) => e.list && e.column && !e.column.hidden), Ue = I && He >= 0 ? c.map((e, t) => {
|
|
3607
|
+
if (t !== He) return e;
|
|
3610
3608
|
let n = e.column.render;
|
|
3611
3609
|
return {
|
|
3612
3610
|
...e,
|
|
@@ -3620,51 +3618,51 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3620
3618
|
component: "span",
|
|
3621
3619
|
"aria-label": "Aufklappen",
|
|
3622
3620
|
onClick: (e) => {
|
|
3623
|
-
e.stopPropagation(),
|
|
3621
|
+
e.stopPropagation(), Ve(t.id);
|
|
3624
3622
|
},
|
|
3625
3623
|
style: {
|
|
3626
3624
|
display: "inline-flex",
|
|
3627
3625
|
flexShrink: 0,
|
|
3628
3626
|
cursor: "pointer"
|
|
3629
3627
|
},
|
|
3630
|
-
children: /* @__PURE__ */ p(
|
|
3628
|
+
children: /* @__PURE__ */ p(xe, {
|
|
3631
3629
|
size: 16,
|
|
3632
3630
|
style: {
|
|
3633
3631
|
color: "var(--mantine-primary-color-filled)",
|
|
3634
|
-
transform:
|
|
3632
|
+
transform: ze.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3635
3633
|
transition: "transform 200ms ease"
|
|
3636
3634
|
}
|
|
3637
3635
|
})
|
|
3638
3636
|
}) : /* @__PURE__ */ p(v, {
|
|
3639
3637
|
w: 16,
|
|
3640
3638
|
style: { flexShrink: 0 }
|
|
3641
|
-
}), n ? n(t, r) : String(
|
|
3639
|
+
}), n ? n(t, r) : String(zn(t, e.column.accessor) ?? "")]
|
|
3642
3640
|
})
|
|
3643
3641
|
}
|
|
3644
3642
|
};
|
|
3645
|
-
}) : c, [
|
|
3643
|
+
}) : c, [H, U] = d([]);
|
|
3646
3644
|
s(() => {
|
|
3647
|
-
|
|
3645
|
+
U([]);
|
|
3648
3646
|
}, [se]);
|
|
3649
|
-
let [
|
|
3647
|
+
let [We, Ge] = d(!1), [Ke, W] = d(!1), [qe, Je] = d(!1);
|
|
3650
3648
|
s(() => {
|
|
3651
|
-
if (re &&
|
|
3652
|
-
let e =
|
|
3653
|
-
e && (
|
|
3649
|
+
if (re && V.length > 0) {
|
|
3650
|
+
let e = V.find((e) => e.id === re);
|
|
3651
|
+
e && (U([e]), W(!0), ie?.(null));
|
|
3654
3652
|
}
|
|
3655
|
-
}, [re,
|
|
3656
|
-
let Ye = c.some((e) => e.update), Xe = c.some((e) => e.delete),
|
|
3657
|
-
return Ye &&
|
|
3658
|
-
icon: /* @__PURE__ */ p(
|
|
3653
|
+
}, [re, V]);
|
|
3654
|
+
let Ye = c.some((e) => e.update), Xe = c.some((e) => e.delete), G = [];
|
|
3655
|
+
return Ye && G.push({
|
|
3656
|
+
icon: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3659
3657
|
label: "Bearbeiten",
|
|
3660
3658
|
onClick: (e) => {
|
|
3661
|
-
|
|
3659
|
+
U(e), W(!0);
|
|
3662
3660
|
}
|
|
3663
|
-
}), b &&
|
|
3664
|
-
icon: /* @__PURE__ */ p(
|
|
3661
|
+
}), b && G.push(...b), Xe && G.push({
|
|
3662
|
+
icon: /* @__PURE__ */ p(ke, { size: 14 }),
|
|
3665
3663
|
label: "Löschen",
|
|
3666
3664
|
onClick: (e) => {
|
|
3667
|
-
|
|
3665
|
+
U(e), Je(!0);
|
|
3668
3666
|
}
|
|
3669
3667
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3670
3668
|
/* @__PURE__ */ m(w, {
|
|
@@ -3679,7 +3677,7 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3679
3677
|
},
|
|
3680
3678
|
justify: e ? "space-between" : "flex-end",
|
|
3681
3679
|
wrap: "wrap",
|
|
3682
|
-
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(
|
|
3680
|
+
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(fe, {
|
|
3683
3681
|
order: 4,
|
|
3684
3682
|
children: e
|
|
3685
3683
|
}) : e), /* @__PURE__ */ m(w, {
|
|
@@ -3704,36 +3702,36 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3704
3702
|
children: [
|
|
3705
3703
|
ee && /* @__PURE__ */ p(g, {
|
|
3706
3704
|
variant: "subtle",
|
|
3707
|
-
onClick: () =>
|
|
3705
|
+
onClick: () => Ce(),
|
|
3708
3706
|
"aria-label": "Neuladen",
|
|
3709
|
-
children: /* @__PURE__ */ p(
|
|
3707
|
+
children: /* @__PURE__ */ p(Ee, {})
|
|
3710
3708
|
}),
|
|
3711
3709
|
(c.some((e) => e.update) || l) && (() => {
|
|
3712
|
-
let e = c.find((e) => e.update) && (!P ||
|
|
3710
|
+
let e = c.find((e) => e.update) && (!P || H.length > 0 && P(H[0])), t = c.find((e) => e.delete) && (!F || H.length > 0 && F(H[0])), n = (b ?? []).length > 0, r = e || t || n;
|
|
3713
3711
|
return /* @__PURE__ */ p(v, {
|
|
3714
3712
|
...R ? { visibleFrom: "sm" } : {},
|
|
3715
3713
|
children: /* @__PURE__ */ m(O, {
|
|
3716
3714
|
shadow: "md",
|
|
3717
3715
|
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(y, {
|
|
3718
3716
|
variant: "outline",
|
|
3719
|
-
rightSection: /* @__PURE__ */ p(
|
|
3720
|
-
disabled: !
|
|
3717
|
+
rightSection: /* @__PURE__ */ p(be, { size: 14 }),
|
|
3718
|
+
disabled: !H.length || !r,
|
|
3721
3719
|
children: "Aktionen"
|
|
3722
3720
|
}) }), /* @__PURE__ */ m(O.Dropdown, { children: [
|
|
3723
3721
|
e && /* @__PURE__ */ p(O.Item, {
|
|
3724
|
-
leftSection: /* @__PURE__ */ p(
|
|
3725
|
-
onClick: () =>
|
|
3726
|
-
disabled:
|
|
3722
|
+
leftSection: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3723
|
+
onClick: () => W(!0),
|
|
3724
|
+
disabled: H.length !== 1,
|
|
3727
3725
|
children: "Bearbeiten"
|
|
3728
3726
|
}),
|
|
3729
3727
|
(b ?? []).map((e, t) => /* @__PURE__ */ i(O.Item, {
|
|
3730
3728
|
...e.icon && { leftSection: e.icon },
|
|
3731
3729
|
key: `custom_action_${t}`,
|
|
3732
|
-
onClick: () => e.onClick(
|
|
3733
|
-
disabled: e.disabled?.(
|
|
3730
|
+
onClick: () => e.onClick(H),
|
|
3731
|
+
disabled: e.disabled?.(H) ?? !1
|
|
3734
3732
|
}, e.label)),
|
|
3735
3733
|
t && /* @__PURE__ */ p(O.Item, {
|
|
3736
|
-
leftSection: /* @__PURE__ */ p(
|
|
3734
|
+
leftSection: /* @__PURE__ */ p(ke, { size: 14 }),
|
|
3737
3735
|
onClick: () => Je(!0),
|
|
3738
3736
|
color: "red",
|
|
3739
3737
|
children: "Löschen"
|
|
@@ -3743,33 +3741,33 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3743
3741
|
});
|
|
3744
3742
|
})(),
|
|
3745
3743
|
c.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3746
|
-
onClick: () =>
|
|
3747
|
-
disabled:
|
|
3744
|
+
onClick: () => Ge(!0),
|
|
3745
|
+
disabled: ve,
|
|
3748
3746
|
children: E ?? "Erstellen"
|
|
3749
3747
|
}),
|
|
3750
3748
|
o
|
|
3751
3749
|
]
|
|
3752
3750
|
})]
|
|
3753
3751
|
}),
|
|
3754
|
-
k && k.length > 0 && /* @__PURE__ */ p(
|
|
3752
|
+
k && k.length > 0 && /* @__PURE__ */ p(le, {
|
|
3755
3753
|
value: se,
|
|
3756
|
-
onChange:
|
|
3754
|
+
onChange: ce,
|
|
3757
3755
|
mt: "md",
|
|
3758
|
-
children: /* @__PURE__ */ p(
|
|
3756
|
+
children: /* @__PURE__ */ p(le.List, { children: k.map((e) => /* @__PURE__ */ p(le.Tab, {
|
|
3759
3757
|
value: e.value,
|
|
3760
3758
|
leftSection: e.icon,
|
|
3761
3759
|
children: e.label
|
|
3762
3760
|
}, e.value)) })
|
|
3763
3761
|
}),
|
|
3764
|
-
|
|
3762
|
+
ye && /* @__PURE__ */ p(_, {
|
|
3765
3763
|
mt: "md",
|
|
3766
3764
|
variant: "light",
|
|
3767
3765
|
color: "red",
|
|
3768
3766
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3769
|
-
icon: /* @__PURE__ */ p(
|
|
3767
|
+
icon: /* @__PURE__ */ p(we, {}),
|
|
3770
3768
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3771
3769
|
}),
|
|
3772
|
-
(
|
|
3770
|
+
(ve || Se) && /* @__PURE__ */ m(z, {
|
|
3773
3771
|
my: "md",
|
|
3774
3772
|
children: [/* @__PURE__ */ p(te, { height: 40 }), [
|
|
3775
3773
|
,
|
|
@@ -3779,28 +3777,28 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3779
3777
|
,
|
|
3780
3778
|
].fill(0).map((e, t) => /* @__PURE__ */ p(te, { height: 35 }, `skeleton-${t}`))]
|
|
3781
3779
|
}),
|
|
3782
|
-
!
|
|
3780
|
+
!ve && !Se && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3783
3781
|
...R ? { visibleFrom: "sm" } : {},
|
|
3784
|
-
children: /* @__PURE__ */ p(
|
|
3782
|
+
children: /* @__PURE__ */ p(Nr, {
|
|
3785
3783
|
my: "md",
|
|
3786
3784
|
striped: !0,
|
|
3787
3785
|
highlightOnHover: !0,
|
|
3788
3786
|
minHeight: 150,
|
|
3789
|
-
fetching:
|
|
3790
|
-
records:
|
|
3787
|
+
fetching: ye,
|
|
3788
|
+
records: Ie,
|
|
3791
3789
|
sortStatus: Oe,
|
|
3792
|
-
onSortStatusChange:
|
|
3790
|
+
onSortStatusChange: je,
|
|
3793
3791
|
...l && {
|
|
3794
|
-
selectedRecords:
|
|
3795
|
-
onSelectedRecordsChange:
|
|
3792
|
+
selectedRecords: H,
|
|
3793
|
+
onSelectedRecordsChange: U
|
|
3796
3794
|
},
|
|
3797
|
-
...u &&
|
|
3798
|
-
totalRecords:
|
|
3799
|
-
recordsPerPage:
|
|
3800
|
-
onPageChange:
|
|
3801
|
-
page:
|
|
3802
|
-
recordsPerPageOptions:
|
|
3803
|
-
onRecordsPerPageChange:
|
|
3795
|
+
...u && Ie.length && {
|
|
3796
|
+
totalRecords: V.length,
|
|
3797
|
+
recordsPerPage: Me,
|
|
3798
|
+
onPageChange: Fe,
|
|
3799
|
+
page: Pe,
|
|
3800
|
+
recordsPerPageOptions: Qr,
|
|
3801
|
+
onRecordsPerPageChange: Ne,
|
|
3804
3802
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3805
3803
|
},
|
|
3806
3804
|
...I && { rowExpansion: {
|
|
@@ -3808,101 +3806,104 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3808
3806
|
trigger: L ? "never" : "click",
|
|
3809
3807
|
content: ({ record: e }) => I.content(e, !1),
|
|
3810
3808
|
expanded: {
|
|
3811
|
-
recordIds:
|
|
3812
|
-
onRecordIdsChange:
|
|
3809
|
+
recordIds: ze,
|
|
3810
|
+
onRecordIdsChange: Be
|
|
3813
3811
|
},
|
|
3814
3812
|
...I.expandable && { expandable: ({ record: e }) => I.expandable(e) }
|
|
3815
3813
|
} },
|
|
3816
|
-
columns:
|
|
3814
|
+
columns: Ue.map((e) => e.column),
|
|
3817
3815
|
noRecordsText: "Keine Einträge gefunden",
|
|
3818
3816
|
onRowClick: L,
|
|
3819
3817
|
...L && { style: { cursor: "pointer" } }
|
|
3820
3818
|
})
|
|
3821
3819
|
}), R && /* @__PURE__ */ p(v, {
|
|
3822
3820
|
hiddenFrom: "sm",
|
|
3823
|
-
children: /* @__PURE__ */ p(
|
|
3824
|
-
records:
|
|
3825
|
-
fields:
|
|
3821
|
+
children: /* @__PURE__ */ p(Zr, {
|
|
3822
|
+
records: Ie,
|
|
3823
|
+
fields: Ue,
|
|
3826
3824
|
onRowClick: L,
|
|
3827
3825
|
sort: {
|
|
3828
3826
|
field: String(Oe.columnAccessor),
|
|
3829
3827
|
direction: Oe.direction,
|
|
3830
3828
|
onSortChange: (e, t) => {
|
|
3831
|
-
|
|
3829
|
+
je({
|
|
3832
3830
|
columnAccessor: e,
|
|
3833
3831
|
direction: t
|
|
3834
3832
|
});
|
|
3835
3833
|
}
|
|
3836
3834
|
},
|
|
3837
|
-
...u &&
|
|
3838
|
-
totalRecords:
|
|
3839
|
-
recordsPerPage:
|
|
3840
|
-
page:
|
|
3841
|
-
onPageChange:
|
|
3842
|
-
recordsPerPageOptions:
|
|
3835
|
+
...u && Ie.length && { pagination: {
|
|
3836
|
+
totalRecords: V.length,
|
|
3837
|
+
recordsPerPage: Me,
|
|
3838
|
+
page: Pe,
|
|
3839
|
+
onPageChange: Fe,
|
|
3840
|
+
recordsPerPageOptions: Qr,
|
|
3843
3841
|
onRecordsPerPageChange: (e) => {
|
|
3844
|
-
|
|
3842
|
+
Ne(e), Fe(1);
|
|
3845
3843
|
}
|
|
3846
3844
|
} },
|
|
3847
3845
|
...I && { rowExpansion: {
|
|
3848
3846
|
content: I.content,
|
|
3849
3847
|
expanded: {
|
|
3850
|
-
recordIds:
|
|
3851
|
-
onRecordIdsChange:
|
|
3848
|
+
recordIds: ze,
|
|
3849
|
+
onRecordIdsChange: Be
|
|
3852
3850
|
},
|
|
3853
3851
|
...I.expandable && { expandable: I.expandable }
|
|
3854
3852
|
} },
|
|
3855
|
-
...
|
|
3856
|
-
actions:
|
|
3853
|
+
...G.length > 0 && {
|
|
3854
|
+
actions: G,
|
|
3857
3855
|
canUpdate: P,
|
|
3858
3856
|
canDelete: F
|
|
3859
3857
|
}
|
|
3860
3858
|
})
|
|
3861
3859
|
})] }),
|
|
3862
3860
|
/* @__PURE__ */ p(M, {
|
|
3863
|
-
opened:
|
|
3861
|
+
opened: Ke,
|
|
3864
3862
|
onClose: () => {
|
|
3865
|
-
|
|
3863
|
+
W(!1), U([]);
|
|
3866
3864
|
},
|
|
3867
3865
|
title: e ?? "Bearbeiten",
|
|
3868
|
-
children:
|
|
3866
|
+
children: H.length > 0 && /* @__PURE__ */ p(Pr, {
|
|
3869
3867
|
fields: c.filter((e) => e.update),
|
|
3870
3868
|
queryKey: t,
|
|
3871
|
-
|
|
3872
|
-
|
|
3869
|
+
connectedQueryKeys: n,
|
|
3870
|
+
apiPath: pe,
|
|
3871
|
+
id: H[0].id,
|
|
3873
3872
|
onClose: () => {
|
|
3874
|
-
|
|
3873
|
+
W(!1), U([]);
|
|
3875
3874
|
},
|
|
3876
3875
|
steps: x
|
|
3877
3876
|
})
|
|
3878
3877
|
}),
|
|
3879
|
-
|
|
3878
|
+
H.length > 0 && /* @__PURE__ */ p(M, {
|
|
3880
3879
|
opened: qe,
|
|
3881
3880
|
onClose: () => {
|
|
3882
|
-
Je(!1),
|
|
3881
|
+
Je(!1), U([]);
|
|
3883
3882
|
},
|
|
3884
3883
|
title: e ?? "Löschen",
|
|
3885
|
-
children: /* @__PURE__ */ p(
|
|
3884
|
+
children: /* @__PURE__ */ p(Fr, {
|
|
3886
3885
|
onClose: () => {
|
|
3887
|
-
Je(!1),
|
|
3886
|
+
Je(!1), U([]);
|
|
3888
3887
|
},
|
|
3889
3888
|
queryKey: t,
|
|
3890
|
-
|
|
3891
|
-
|
|
3889
|
+
connectedQueryKeys: n,
|
|
3890
|
+
apiPath: pe,
|
|
3891
|
+
selectedRecords: H,
|
|
3892
3892
|
confirmMessage: ne
|
|
3893
3893
|
})
|
|
3894
3894
|
}),
|
|
3895
3895
|
/* @__PURE__ */ p(M, {
|
|
3896
|
-
opened:
|
|
3896
|
+
opened: We,
|
|
3897
3897
|
onClose: () => {
|
|
3898
|
-
|
|
3898
|
+
Ge(!1);
|
|
3899
3899
|
},
|
|
3900
3900
|
title: e ?? "Anlegen",
|
|
3901
|
-
children: /* @__PURE__ */ p(
|
|
3901
|
+
children: /* @__PURE__ */ p(rn, {
|
|
3902
3902
|
queryKey: t,
|
|
3903
|
-
|
|
3903
|
+
connectedQueryKeys: n,
|
|
3904
|
+
apiPath: pe,
|
|
3904
3905
|
onClose: () => {
|
|
3905
|
-
|
|
3906
|
+
Ge(!1);
|
|
3906
3907
|
},
|
|
3907
3908
|
fields: c.filter((e) => e.create),
|
|
3908
3909
|
steps: x
|
|
@@ -3912,23 +3913,23 @@ function Jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3912
3913
|
}
|
|
3913
3914
|
//#endregion
|
|
3914
3915
|
//#region src/DataTable/SubTable.tsx
|
|
3915
|
-
function
|
|
3916
|
+
function ei({ mobile: e, columns: t, ...n }) {
|
|
3916
3917
|
return e ? /* @__PURE__ */ p(z, {
|
|
3917
3918
|
gap: "sm",
|
|
3918
3919
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
3919
3920
|
children: (n.records ?? []).map((e, r) => {
|
|
3920
3921
|
let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
|
|
3921
|
-
label: t.title ??
|
|
3922
|
-
value: t.render ? t.render(e, r) :
|
|
3922
|
+
label: t.title ?? In(String(t.accessor)),
|
|
3923
|
+
value: t.render ? t.render(e, r) : zn(e, t.accessor)
|
|
3923
3924
|
})), a = n.idAccessor ? $(e, n.idAccessor) : r;
|
|
3924
|
-
return /* @__PURE__ */ p(
|
|
3925
|
+
return /* @__PURE__ */ p(Jr, { rows: i }, a);
|
|
3925
3926
|
})
|
|
3926
|
-
}) : /* @__PURE__ */ p(
|
|
3927
|
+
}) : /* @__PURE__ */ p(Nr, {
|
|
3927
3928
|
columns: t,
|
|
3928
3929
|
...n
|
|
3929
3930
|
});
|
|
3930
3931
|
}
|
|
3931
3932
|
//#endregion
|
|
3932
|
-
export {
|
|
3933
|
+
export { rn as CreateModal, $r as DataTable, Mt as DataTableProvider, Fr as DeleteModal, Jr as FieldCard, Zr as MobileCardList, ei as SubTable, Pr as UpdateModal, Bt as api, zt as createOne, Rt as deleteOne, It as getAll, Lt as getOne, Br as sortData, Vt as updateOne, Gt as useAddOne, J as useDataTable, qt as useDeleteOne, Ut as useGetAll, Ht as useGetOne, Ir as usePersistentState, Kt as useUpdateOne };
|
|
3933
3934
|
|
|
3934
3935
|
//# sourceMappingURL=index.es.js.map
|