@espresso-lab/mantine-data-table 2.2.1 → 2.2.3
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/Context/DataTableContext.d.ts +1 -1
- package/dist/DataTable/CreateModal.d.ts +2 -1
- package/dist/DataTable/DataTable.d.ts +1 -1
- package/dist/DataTable/DeleteModal.d.ts +2 -1
- package/dist/DataTable/EntityForm.d.ts +1 -1
- package/dist/DataTable/FieldCard.d.ts +2 -2
- package/dist/DataTable/MobileCardList.d.ts +1 -1
- package/dist/DataTable/SubTable.d.ts +2 -1
- package/dist/DataTable/UpdateModal.d.ts +2 -1
- package/dist/Hooks/useApi.d.ts +3 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +570 -585
- 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 +15 -15
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
|
|
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 z, Stack as B, Stepper as te, Table as ne, TableTd as re, TableTfoot as ie, TableTh as ae, TableThead as oe, TableTr as se, Tabs as ce, Text as V, TextInput as le, Textarea as ue, Title as de, createSafeContext as fe, parseThemeColor as pe, rem as me, useDirection as he, useMantineTheme as ge } from "@mantine/core";
|
|
5
5
|
import { DateInput as _e } from "@mantine/dates";
|
|
6
6
|
import { useForm as ve } from "@mantine/form";
|
|
7
7
|
import { IconCaretDownFilled as ye, IconChevronRight as be, IconDotsVertical as xe, IconFilter as Se, IconInfoCircle as Ce, IconPencil as we, IconRefresh as Te, IconSortAscending as Ee, IconSortDescending as De, IconTrash as Oe } from "@tabler/icons-react";
|
|
8
|
-
import { useClickOutside as ke, useDisclosure as Ae, useLocalStorage as
|
|
8
|
+
import { useClickOutside as ke, useDisclosure as Ae, useLocalStorage as H, useMediaQuery as je, useMergedRef as Me, useTimeout as Ne } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var Pe = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var U = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
},
|
|
24
|
+
}, Fe = new class extends Pe {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var U = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), Ie = {
|
|
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
|
+
}, Le = new class {
|
|
67
|
+
#e = Ie;
|
|
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,30 +85,30 @@ var U = class {
|
|
|
85
85
|
this.#e.clearInterval(e);
|
|
86
86
|
}
|
|
87
87
|
}();
|
|
88
|
-
function
|
|
88
|
+
function Re(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 ze = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function Be() {}
|
|
95
|
+
function Ve(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function He(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function U(e, t) {
|
|
102
102
|
return typeof e == "function" ? e(t) : e;
|
|
103
103
|
}
|
|
104
104
|
function W(e, t) {
|
|
105
105
|
return typeof e == "function" ? e(t) : e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Ue(e) {
|
|
108
108
|
return JSON.stringify(e, (e, t) => qe(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var We = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Ge(e, t, n = 0) {
|
|
112
112
|
if (e === t) return e;
|
|
113
113
|
if (n > 500) return t;
|
|
114
114
|
let r = Ke(e) && Ke(t);
|
|
@@ -117,19 +117,19 @@ function We(e, t, n = 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 : We.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 = Ge(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 G(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;
|
|
@@ -151,11 +151,11 @@ function Ye(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 Ge(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 Ge(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
@@ -165,7 +165,7 @@ function Xe(e, t) {
|
|
|
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 = () => ze;
|
|
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 = Re;
|
|
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 Pe {
|
|
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 Pe {
|
|
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
|
}
|
|
@@ -339,13 +339,13 @@ var at = class extends U {
|
|
|
339
339
|
setOptions(e) {
|
|
340
340
|
let t = this.options, n = this.#t;
|
|
341
341
|
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof W(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !G(this.options, t) && this.#e.getQueryCache().notify({
|
|
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 || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) ||
|
|
348
|
+
r && lt(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || U(this.options.staleTime, this.#t) !== U(t.staleTime, this.#t)) && this.#g();
|
|
349
349
|
let i = this.#_();
|
|
350
350
|
r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
351
351
|
}
|
|
@@ -381,14 +381,14 @@ var at = class extends U {
|
|
|
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(Be)), 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 = U(this.options.staleTime, this.#t);
|
|
389
|
+
if (Ze.isServer() || this.#r.isStale || !Ve(e)) return;
|
|
390
|
+
let t = He(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = Le.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,18 +396,18 @@ var at = class extends U {
|
|
|
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() || W(this.options.enabled, this.#t) === !1 || !
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
399
|
+
this.#x(), this.#p = e, !(Ze.isServer() || W(this.options.enabled, this.#t) === !1 || !Ve(this.#p) || this.#p === 0) && (this.#f = Le.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Fe.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 && (Le.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (Le.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;
|
|
@@ -482,7 +482,7 @@ var at = class extends U {
|
|
|
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), !G(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;
|
|
@@ -520,7 +520,7 @@ 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 (W(t.enabled, e) !== !1 &&
|
|
523
|
+
if (W(t.enabled, e) !== !1 && U(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
|
}
|
|
@@ -530,10 +530,10 @@ function lt(e, t, n, r) {
|
|
|
530
530
|
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
|
|
531
531
|
}
|
|
532
532
|
function ut(e, t) {
|
|
533
|
-
return W(t.enabled, e) !== !1 && e.isStaleByTime(
|
|
533
|
+
return W(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
|
|
534
534
|
}
|
|
535
535
|
function dt(e, t) {
|
|
536
|
-
return !
|
|
536
|
+
return !G(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 Pe {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var ft = class extends U {
|
|
|
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), G(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 && Ue(t.mutationKey) !== Ue(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);
|
|
@@ -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)) : Be;
|
|
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(Be).finally(() => {
|
|
704
704
|
d.updateResult();
|
|
705
705
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
706
706
|
}
|
|
@@ -717,7 +717,7 @@ 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(Be);
|
|
721
721
|
}, [i]);
|
|
722
722
|
if (a.error && Xe(i.options.throwOnError, [a.error])) throw a.error;
|
|
723
723
|
return {
|
|
@@ -761,20 +761,7 @@ var Nt = class extends Error {
|
|
|
761
761
|
function Pt(e) {
|
|
762
762
|
return e instanceof Nt ? e.violations : void 0;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
if (typeof e == "string") try {
|
|
766
|
-
let t = JSON.parse(e);
|
|
767
|
-
return {
|
|
768
|
-
message: t.message || e,
|
|
769
|
-
code: t.code,
|
|
770
|
-
details: t.details
|
|
771
|
-
};
|
|
772
|
-
} catch {
|
|
773
|
-
return { message: e };
|
|
774
|
-
}
|
|
775
|
-
return e instanceof Error ? { message: e.message } : { message: "Unbekannter Fehler" };
|
|
776
|
-
}
|
|
777
|
-
async function It(e, t) {
|
|
764
|
+
async function Y(e, t) {
|
|
778
765
|
let n = await fetch(e, t);
|
|
779
766
|
if (n.status >= 400) {
|
|
780
767
|
let e = await n.text();
|
|
@@ -793,93 +780,90 @@ async function It(e, t) {
|
|
|
793
780
|
}
|
|
794
781
|
return n;
|
|
795
782
|
}
|
|
796
|
-
var
|
|
797
|
-
async function
|
|
798
|
-
return (await
|
|
783
|
+
var Ft = (e) => e.map((e) => e.toString());
|
|
784
|
+
async function It(e, t) {
|
|
785
|
+
return (await Y(e, {
|
|
799
786
|
method: "GET",
|
|
800
787
|
headers: await t()
|
|
801
788
|
})).json();
|
|
802
789
|
}
|
|
803
|
-
async function
|
|
804
|
-
return (await
|
|
790
|
+
async function Lt(e, t, n) {
|
|
791
|
+
return (await Y(`${e}/${t}`, {
|
|
805
792
|
method: "GET",
|
|
806
793
|
headers: await n()
|
|
807
794
|
})).json();
|
|
808
795
|
}
|
|
809
|
-
async function
|
|
810
|
-
await
|
|
796
|
+
async function Rt(e, t, n) {
|
|
797
|
+
await Y(`${e}/${t}`, {
|
|
811
798
|
method: "DELETE",
|
|
812
799
|
headers: await n()
|
|
813
800
|
});
|
|
814
801
|
}
|
|
815
|
-
async function
|
|
816
|
-
let r = await
|
|
802
|
+
async function zt(e, t, n) {
|
|
803
|
+
let r = await Y(e, {
|
|
817
804
|
method: "POST",
|
|
818
805
|
headers: await n(),
|
|
819
806
|
body: JSON.stringify(t)
|
|
820
807
|
});
|
|
821
808
|
return r.status === 204 ? t : r.json();
|
|
822
809
|
}
|
|
823
|
-
async function
|
|
824
|
-
let i = await
|
|
810
|
+
async function Bt(e, t, n, r) {
|
|
811
|
+
let i = await Y(t, {
|
|
825
812
|
method: e,
|
|
826
813
|
headers: await n(),
|
|
827
814
|
body: r ? JSON.stringify(r) : void 0
|
|
828
815
|
});
|
|
829
816
|
if (i.status !== 204) return i.json();
|
|
830
817
|
}
|
|
831
|
-
async function
|
|
832
|
-
let r = await
|
|
818
|
+
async function Vt(e, t, n) {
|
|
819
|
+
let r = await Y(`${e}/${t.id}`, {
|
|
833
820
|
method: "PUT",
|
|
834
821
|
headers: await n(),
|
|
835
822
|
body: JSON.stringify(t)
|
|
836
823
|
});
|
|
837
824
|
return r.status === 204 ? t : r.json();
|
|
838
825
|
}
|
|
839
|
-
function
|
|
826
|
+
function Ht(e, t, n) {
|
|
840
827
|
let { baseUrl: r, getHeaders: i } = J();
|
|
841
828
|
return Ot({
|
|
842
|
-
queryKey: [...
|
|
843
|
-
queryFn: () =>
|
|
829
|
+
queryKey: [...Ft(t), String(n?.toString())],
|
|
830
|
+
queryFn: () => Lt(`${r}${e}`, n, i),
|
|
844
831
|
enabled: !!n
|
|
845
832
|
});
|
|
846
833
|
}
|
|
847
|
-
function
|
|
834
|
+
function Ut(e, t, n = !0) {
|
|
848
835
|
let { baseUrl: r, getHeaders: i } = J();
|
|
849
836
|
return Ot({
|
|
850
|
-
queryKey:
|
|
851
|
-
queryFn: () =>
|
|
837
|
+
queryKey: Ft(t),
|
|
838
|
+
queryFn: () => It(`${r}${e}`, i),
|
|
852
839
|
enabled: n
|
|
853
840
|
});
|
|
854
841
|
}
|
|
855
|
-
function
|
|
856
|
-
|
|
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();
|
|
857
847
|
return kt({
|
|
858
|
-
mutationKey:
|
|
859
|
-
mutationFn: (t) =>
|
|
860
|
-
onSettled()
|
|
861
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
862
|
-
}
|
|
848
|
+
mutationKey: Ft(t),
|
|
849
|
+
mutationFn: (t) => zt(`${r}${e}`, t, a),
|
|
850
|
+
onSettled: () => Wt(i, t, n)
|
|
863
851
|
});
|
|
864
852
|
}
|
|
865
|
-
function Kt(e, t) {
|
|
866
|
-
let { baseUrl:
|
|
853
|
+
function Kt(e, t, n) {
|
|
854
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = J();
|
|
867
855
|
return kt({
|
|
868
|
-
mutationKey:
|
|
869
|
-
mutationFn: (t) =>
|
|
870
|
-
onSettled()
|
|
871
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
872
|
-
}
|
|
856
|
+
mutationKey: Ft(t),
|
|
857
|
+
mutationFn: (t) => Vt(`${r}${e}`, t, a),
|
|
858
|
+
onSettled: () => Wt(i, t, n)
|
|
873
859
|
});
|
|
874
860
|
}
|
|
875
|
-
function qt(e, t) {
|
|
876
|
-
let { baseUrl:
|
|
861
|
+
function qt(e, t, n) {
|
|
862
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = J();
|
|
877
863
|
return kt({
|
|
878
|
-
mutationKey:
|
|
879
|
-
mutationFn: (t) =>
|
|
880
|
-
onSettled()
|
|
881
|
-
return r.invalidateQueries({ queryKey: Y(t) });
|
|
882
|
-
}
|
|
864
|
+
mutationKey: Ft(t),
|
|
865
|
+
mutationFn: (t) => Rt(`${r}${e}`, t, a),
|
|
866
|
+
onSettled: () => Wt(i, t, n)
|
|
883
867
|
});
|
|
884
868
|
}
|
|
885
869
|
//#endregion
|
|
@@ -953,7 +937,7 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
953
937
|
required: n,
|
|
954
938
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
955
939
|
}, b.key(e.id));
|
|
956
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
940
|
+
case "textarea": return /* @__PURE__ */ p(ue, {
|
|
957
941
|
minRows: 3,
|
|
958
942
|
autosize: !0,
|
|
959
943
|
label: e.column.title,
|
|
@@ -968,7 +952,7 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
968
952
|
error: r.error,
|
|
969
953
|
required: n
|
|
970
954
|
});
|
|
971
|
-
default: return /* @__PURE__ */ p(
|
|
955
|
+
default: return /* @__PURE__ */ p(le, {
|
|
972
956
|
type: e.id.includes("email") ? "email" : void 0,
|
|
973
957
|
label: e.column.title,
|
|
974
958
|
placeholder: e.placeholder ?? "",
|
|
@@ -996,10 +980,10 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
996
980
|
}
|
|
997
981
|
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
998
982
|
}),
|
|
999
|
-
children: [E ? /* @__PURE__ */ p(
|
|
983
|
+
children: [E ? /* @__PURE__ */ p(te, {
|
|
1000
984
|
active: u,
|
|
1001
985
|
size: "sm",
|
|
1002
|
-
children: w.map((e) => /* @__PURE__ */ p(
|
|
986
|
+
children: w.map((e) => /* @__PURE__ */ p(te.Step, {
|
|
1003
987
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
1004
988
|
children: k(e)
|
|
1005
989
|
}, e))
|
|
@@ -1020,22 +1004,22 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
1020
1004
|
}
|
|
1021
1005
|
//#endregion
|
|
1022
1006
|
//#region src/DataTable/CreateModal.tsx
|
|
1023
|
-
function rn({ fields: e, onClose: t, queryKey: n,
|
|
1024
|
-
let [
|
|
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);
|
|
1025
1009
|
return /* @__PURE__ */ p(nn, {
|
|
1026
1010
|
fields: e,
|
|
1027
|
-
steps:
|
|
1028
|
-
recordId:
|
|
1029
|
-
submitting:
|
|
1030
|
-
error:
|
|
1011
|
+
steps: a,
|
|
1012
|
+
recordId: s,
|
|
1013
|
+
submitting: u || h,
|
|
1014
|
+
error: f ?? g,
|
|
1031
1015
|
onPersist: async (e) => {
|
|
1032
|
-
if (
|
|
1016
|
+
if (s != null) await m({
|
|
1033
1017
|
...e,
|
|
1034
|
-
id:
|
|
1018
|
+
id: s
|
|
1035
1019
|
});
|
|
1036
1020
|
else {
|
|
1037
|
-
let t = await
|
|
1038
|
-
|
|
1021
|
+
let t = await l(e);
|
|
1022
|
+
c(t.id), o?.(t.id);
|
|
1039
1023
|
}
|
|
1040
1024
|
},
|
|
1041
1025
|
onClose: t
|
|
@@ -1059,7 +1043,7 @@ function X() {
|
|
|
1059
1043
|
//#endregion
|
|
1060
1044
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1061
1045
|
function Z(e, t, n) {
|
|
1062
|
-
return e ?
|
|
1046
|
+
return e ? pe({
|
|
1063
1047
|
color: typeof e == "object" ? e[n] : e,
|
|
1064
1048
|
theme: t
|
|
1065
1049
|
}).value : void 0;
|
|
@@ -1096,7 +1080,7 @@ function cn({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1096
1080
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1097
1081
|
};
|
|
1098
1082
|
}
|
|
1099
|
-
var [ln, un] =
|
|
1083
|
+
var [ln, un] = fe("useDataTableColumnsContext must be used within DataTableColumnProvider"), dn = (e) => {
|
|
1100
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("");
|
|
1101
1085
|
return p(ln, {
|
|
1102
1086
|
value: {
|
|
@@ -1166,7 +1150,7 @@ function mn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1166
1150
|
children: r || m(f, { children: [e || p("div", {
|
|
1167
1151
|
className: "mantine-datatable-empty-state-icon",
|
|
1168
1152
|
children: p(pn, {})
|
|
1169
|
-
}), p(
|
|
1153
|
+
}), p(V, {
|
|
1170
1154
|
component: "div",
|
|
1171
1155
|
size: "sm",
|
|
1172
1156
|
c: "dimmed",
|
|
@@ -1174,17 +1158,59 @@ function mn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1174
1158
|
})] })
|
|
1175
1159
|
});
|
|
1176
1160
|
}
|
|
1177
|
-
function hn(
|
|
1161
|
+
function hn(e) {
|
|
1162
|
+
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1163
|
+
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1164
|
+
}
|
|
1165
|
+
function gn(e, t, n) {
|
|
1166
|
+
return !Array.isArray(e) || n && !e.every(n) ? t : e;
|
|
1167
|
+
}
|
|
1168
|
+
function _n(e) {
|
|
1169
|
+
return typeof e == "object" && !!e && typeof e.accessor == "string";
|
|
1170
|
+
}
|
|
1171
|
+
function vn(e, t, n) {
|
|
1172
|
+
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1173
|
+
}
|
|
1174
|
+
function yn(e, t) {
|
|
1175
|
+
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1176
|
+
}
|
|
1177
|
+
function bn(e, t) {
|
|
1178
|
+
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1179
|
+
}
|
|
1180
|
+
function Q(e, t) {
|
|
1181
|
+
return typeof t == "string" ? bn(e, t) : t(e);
|
|
1182
|
+
}
|
|
1183
|
+
function xn(e) {
|
|
1184
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + xn(e.groups) : 1));
|
|
1185
|
+
}
|
|
1186
|
+
function Sn(e) {
|
|
1187
|
+
let t = [];
|
|
1188
|
+
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(...Sn(n.groups));
|
|
1189
|
+
return t.filter((e) => e != null);
|
|
1190
|
+
}
|
|
1191
|
+
function Cn(e, t) {
|
|
1192
|
+
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 + Cn(n, t), 0) : 0;
|
|
1193
|
+
}
|
|
1194
|
+
function wn(e, t, n = 0) {
|
|
1195
|
+
if (n === t) return [...e];
|
|
1196
|
+
let r = [];
|
|
1197
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...wn(i.groups, t, n + 1));
|
|
1198
|
+
return r;
|
|
1199
|
+
}
|
|
1200
|
+
function Tn(e, t, n) {
|
|
1201
|
+
return n ? !e || t : !1;
|
|
1202
|
+
}
|
|
1203
|
+
function En({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1178
1204
|
let r = l(() => t.map((e) => ({
|
|
1179
1205
|
accessor: e.accessor,
|
|
1180
1206
|
defaultPinned: e.pinned,
|
|
1181
1207
|
pinnable: !!e.pinnable,
|
|
1182
1208
|
pinned: e.pinned
|
|
1183
|
-
})), [t]), [i, a] =
|
|
1209
|
+
})), [t]), [i, a] = H({
|
|
1184
1210
|
key: e ? `${e}-columns-pinning` : "",
|
|
1185
1211
|
defaultValue: e ? r : void 0,
|
|
1186
1212
|
getInitialValueInEffect: n
|
|
1187
|
-
}), o = i
|
|
1213
|
+
}), o = gn(i, r, _n);
|
|
1188
1214
|
function c(t) {
|
|
1189
1215
|
e && a(typeof t == "function" ? (e) => t(e ?? r) : t);
|
|
1190
1216
|
}
|
|
@@ -1227,12 +1253,12 @@ function hn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1227
1253
|
resetColumnsPinning: d
|
|
1228
1254
|
};
|
|
1229
1255
|
}
|
|
1230
|
-
function
|
|
1231
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1256
|
+
function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1257
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = H({
|
|
1232
1258
|
key: e ? `${e}-columns-order` : "",
|
|
1233
1259
|
defaultValue: e ? r : void 0,
|
|
1234
1260
|
getInitialValueInEffect: n
|
|
1235
|
-
}), o = i
|
|
1261
|
+
}), o = gn(i, r, (e) => typeof e == "string");
|
|
1236
1262
|
function c(t) {
|
|
1237
1263
|
e && a(t);
|
|
1238
1264
|
}
|
|
@@ -1270,16 +1296,16 @@ function gn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1270
1296
|
resetColumnsOrder: d
|
|
1271
1297
|
};
|
|
1272
1298
|
}
|
|
1273
|
-
function
|
|
1274
|
-
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] =
|
|
1299
|
+
function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1300
|
+
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] = H({
|
|
1275
1301
|
key: e ? `${e}-columns-width` : "",
|
|
1276
1302
|
defaultValue: e ? o() : void 0,
|
|
1277
1303
|
getInitialValueInEffect: n
|
|
1278
|
-
}),
|
|
1304
|
+
}), p = gn(c, [], (e) => typeof e == "object" && !!e), [m, h] = d(() => e && p.length > 0 ? p : o()), [g, _] = d(!1), v = u(!1);
|
|
1279
1305
|
s(() => {
|
|
1280
|
-
e && (!
|
|
1281
|
-
}, [e,
|
|
1282
|
-
|
|
1306
|
+
e && (!p || p.length === 0 || h(p));
|
|
1307
|
+
}, [e, p]), s(() => {
|
|
1308
|
+
h((e) => {
|
|
1283
1309
|
let n = new Set(t.filter((e) => e.accessor !== "__selection__").map((e) => String(e.accessor))), r = e.filter((e) => n.has(Object.keys(e)[0])), i = new Set(r.map((e) => Object.keys(e)[0])), a = !1;
|
|
1284
1310
|
for (let e of t) {
|
|
1285
1311
|
if (e.accessor === "__selection__") continue;
|
|
@@ -1289,30 +1315,30 @@ function _n({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1289
1315
|
return r.length !== e.length || a ? r : e;
|
|
1290
1316
|
});
|
|
1291
1317
|
}, [t]);
|
|
1292
|
-
let
|
|
1318
|
+
let y = a((e) => {
|
|
1293
1319
|
let t = e.filter((e) => e.accessor !== "__selection__");
|
|
1294
|
-
t.length !== 0 && (
|
|
1320
|
+
t.length !== 0 && (v.current = !0, h((e) => e.map((e) => {
|
|
1295
1321
|
let n = Object.keys(e)[0], r = t.find((e) => e.accessor === n);
|
|
1296
1322
|
return r ? { [n]: r.width } : e;
|
|
1297
1323
|
})));
|
|
1298
1324
|
}, []);
|
|
1299
1325
|
s(() => {
|
|
1300
|
-
!e || !
|
|
1326
|
+
!e || !v.current || g || (v.current = !1, f(m));
|
|
1301
1327
|
}, [
|
|
1302
1328
|
e,
|
|
1303
|
-
|
|
1304
|
-
|
|
1329
|
+
m,
|
|
1330
|
+
g,
|
|
1305
1331
|
f
|
|
1306
1332
|
]);
|
|
1307
|
-
let
|
|
1308
|
-
|
|
1333
|
+
let b = a((e, t) => {
|
|
1334
|
+
y([{
|
|
1309
1335
|
accessor: e,
|
|
1310
1336
|
width: t
|
|
1311
1337
|
}]);
|
|
1312
|
-
}, [
|
|
1313
|
-
|
|
1314
|
-
}, [
|
|
1315
|
-
|
|
1338
|
+
}, [y]), x = a((e) => {
|
|
1339
|
+
y(e);
|
|
1340
|
+
}, [y]), S = a(() => {
|
|
1341
|
+
_(!0);
|
|
1316
1342
|
let e = r?.current;
|
|
1317
1343
|
if (!e) return;
|
|
1318
1344
|
let t = Array.from(e.querySelectorAll("th[data-accessor]"));
|
|
@@ -1324,24 +1350,24 @@ function _n({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1324
1350
|
let r = Math.round(e.getBoundingClientRect().width);
|
|
1325
1351
|
n.push({ [t]: `${r}px` });
|
|
1326
1352
|
}
|
|
1327
|
-
|
|
1328
|
-
}, [r]),
|
|
1329
|
-
|
|
1353
|
+
v.current = !0, h(n);
|
|
1354
|
+
}, [r]), C = a(() => {
|
|
1355
|
+
_(!1);
|
|
1330
1356
|
}, []);
|
|
1331
1357
|
return {
|
|
1332
|
-
columnsWidth:
|
|
1333
|
-
setColumnsWidth:
|
|
1334
|
-
setColumnWidth:
|
|
1335
|
-
setMultipleColumnWidths:
|
|
1358
|
+
columnsWidth: m,
|
|
1359
|
+
setColumnsWidth: y,
|
|
1360
|
+
setColumnWidth: b,
|
|
1361
|
+
setMultipleColumnWidths: x,
|
|
1336
1362
|
resetColumnsWidth: a(() => {
|
|
1337
1363
|
let e = o();
|
|
1338
|
-
|
|
1364
|
+
v.current = !0, h(e), _(!1);
|
|
1339
1365
|
}, [o]),
|
|
1340
1366
|
hasResizableColumns: i,
|
|
1341
1367
|
allResizableWidthsInitial: l(() => {
|
|
1342
1368
|
if (!i) return !1;
|
|
1343
1369
|
let e = t.filter((e) => e.resizable && !e.hidden && e.accessor !== "__selection__");
|
|
1344
|
-
return
|
|
1370
|
+
return m.filter((t) => {
|
|
1345
1371
|
let n = Object.keys(t)[0];
|
|
1346
1372
|
return e.some((e) => e.accessor === n);
|
|
1347
1373
|
}).every((e) => {
|
|
@@ -1351,25 +1377,25 @@ function _n({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1351
1377
|
}, [
|
|
1352
1378
|
i,
|
|
1353
1379
|
t,
|
|
1354
|
-
|
|
1380
|
+
m
|
|
1355
1381
|
]),
|
|
1356
1382
|
measureAndSetColumnWidths: a(() => {}, []),
|
|
1357
|
-
isResizing:
|
|
1358
|
-
beginResize:
|
|
1359
|
-
endResize:
|
|
1383
|
+
isResizing: g,
|
|
1384
|
+
beginResize: S,
|
|
1385
|
+
endResize: C
|
|
1360
1386
|
};
|
|
1361
1387
|
}
|
|
1362
|
-
function
|
|
1388
|
+
function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1363
1389
|
let r = l(() => t?.map((e) => ({
|
|
1364
1390
|
accessor: e.accessor,
|
|
1365
1391
|
defaultToggle: e.defaultToggle || !0,
|
|
1366
1392
|
toggleable: e.toggleable,
|
|
1367
1393
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1368
|
-
})), [t]), [i, a] =
|
|
1394
|
+
})), [t]), [i, a] = H({
|
|
1369
1395
|
key: e ? `${e}-columns-toggle` : "",
|
|
1370
1396
|
defaultValue: e ? r : void 0,
|
|
1371
1397
|
getInitialValueInEffect: n
|
|
1372
|
-
}), o = i
|
|
1398
|
+
}), o = gn(i, r, _n);
|
|
1373
1399
|
function c(t) {
|
|
1374
1400
|
e && a(t);
|
|
1375
1401
|
}
|
|
@@ -1412,20 +1438,20 @@ function vn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1412
1438
|
resetColumnsToggle: d
|
|
1413
1439
|
};
|
|
1414
1440
|
}
|
|
1415
|
-
var
|
|
1416
|
-
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } =
|
|
1441
|
+
var An = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1442
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = Dn({
|
|
1417
1443
|
key: e,
|
|
1418
1444
|
columns: t,
|
|
1419
1445
|
getInitialValueInEffect: n
|
|
1420
|
-
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } =
|
|
1446
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = kn({
|
|
1421
1447
|
key: e,
|
|
1422
1448
|
columns: t,
|
|
1423
1449
|
getInitialValueInEffect: n
|
|
1424
|
-
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } =
|
|
1450
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = En({
|
|
1425
1451
|
key: e,
|
|
1426
1452
|
columns: t,
|
|
1427
1453
|
getInitialValueInEffect: n
|
|
1428
|
-
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } =
|
|
1454
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = On({
|
|
1429
1455
|
key: e,
|
|
1430
1456
|
columns: t,
|
|
1431
1457
|
getInitialValueInEffect: n,
|
|
@@ -1502,16 +1528,16 @@ var yn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1502
1528
|
beginResize: w,
|
|
1503
1529
|
endResize: T
|
|
1504
1530
|
};
|
|
1505
|
-
},
|
|
1506
|
-
function
|
|
1531
|
+
}, jn = typeof window < "u" ? c : s;
|
|
1532
|
+
function Mn(e) {
|
|
1507
1533
|
let t = u(e);
|
|
1508
1534
|
return t.current = e, t;
|
|
1509
1535
|
}
|
|
1510
|
-
var
|
|
1511
|
-
function
|
|
1536
|
+
var Nn = "--mantine-datatable-header-height", Pn = "--mantine-datatable-footer-height", Fn = "--mantine-datatable-selection-column-width", In = "--mantine-datatable-last-row-border-bottom";
|
|
1537
|
+
function $(e, t, n) {
|
|
1512
1538
|
e?.style.setProperty(t, n);
|
|
1513
1539
|
}
|
|
1514
|
-
function
|
|
1540
|
+
function Ln(e) {
|
|
1515
1541
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1516
1542
|
return t ? {
|
|
1517
1543
|
width: t.inlineSize,
|
|
@@ -1521,18 +1547,18 @@ function En(e) {
|
|
|
1521
1547
|
height: e.contentRect.height
|
|
1522
1548
|
};
|
|
1523
1549
|
}
|
|
1524
|
-
function
|
|
1550
|
+
function Rn(e, t, n) {
|
|
1525
1551
|
if (e) {
|
|
1526
1552
|
let r = new ResizeObserver((e) => {
|
|
1527
1553
|
let n = e[0];
|
|
1528
|
-
n && t(
|
|
1554
|
+
n && t(Ln(n));
|
|
1529
1555
|
});
|
|
1530
1556
|
return r.observe(e), () => {
|
|
1531
1557
|
r.disconnect(), n();
|
|
1532
1558
|
};
|
|
1533
1559
|
}
|
|
1534
1560
|
}
|
|
1535
|
-
function
|
|
1561
|
+
function zn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1536
1562
|
let n = {
|
|
1537
1563
|
root: u(null),
|
|
1538
1564
|
table: u(null),
|
|
@@ -1540,16 +1566,16 @@ function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1540
1566
|
header: u(null),
|
|
1541
1567
|
footer: u(null),
|
|
1542
1568
|
selectionColumnHeader: u(null)
|
|
1543
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1569
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = Mn({ withRowBorders: t }), p = Mn(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1544
1570
|
p.current.onScroll?.(e), m.current();
|
|
1545
1571
|
}, []);
|
|
1546
|
-
return s(() =>
|
|
1547
|
-
|
|
1548
|
-
}, () =>
|
|
1549
|
-
|
|
1550
|
-
}, () =>
|
|
1551
|
-
|
|
1552
|
-
}, () =>
|
|
1572
|
+
return s(() => Rn(c.current, (e) => {
|
|
1573
|
+
$(r.current, Nn, `${e.height}px`);
|
|
1574
|
+
}, () => $(r.current, Nn, "0")), [c.current]), s(() => Rn(l.current, (e) => {
|
|
1575
|
+
$(r.current, Pn, `${e.height}px`);
|
|
1576
|
+
}, () => $(r.current, Pn, "0")), [l.current]), s(() => Rn(d.current, (e) => {
|
|
1577
|
+
$(r.current, Fn, `${e.width}px`);
|
|
1578
|
+
}, () => $(r.current, Fn, "0")), [d.current]), jn(() => {
|
|
1553
1579
|
if (typeof window > "u") return;
|
|
1554
1580
|
let e = {
|
|
1555
1581
|
top: !0,
|
|
@@ -1565,14 +1591,14 @@ function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1565
1591
|
};
|
|
1566
1592
|
function a(t, n) {
|
|
1567
1593
|
let i = e[t];
|
|
1568
|
-
return e[t] = n,
|
|
1594
|
+
return e[t] = n, $(r.current, `--mantine-datatable-${t}-shadow-opacity`, n ? "0" : "1"), i;
|
|
1569
1595
|
}
|
|
1570
1596
|
function s() {
|
|
1571
1597
|
let e = t.height - n.height, i = e < 0;
|
|
1572
|
-
|
|
1598
|
+
$(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1573
1599
|
}
|
|
1574
1600
|
function c() {
|
|
1575
|
-
f.current.withRowBorders && t.height < n.height ?
|
|
1601
|
+
f.current.withRowBorders && t.height < n.height ? $(r.current, In, `${me("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, In, "unset");
|
|
1576
1602
|
}
|
|
1577
1603
|
h.current = c;
|
|
1578
1604
|
function l() {
|
|
@@ -1590,10 +1616,10 @@ function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1590
1616
|
let u = new ResizeObserver((e) => {
|
|
1591
1617
|
for (let r of e) switch (r.target.tagName) {
|
|
1592
1618
|
case "TABLE":
|
|
1593
|
-
t =
|
|
1619
|
+
t = Ln(r);
|
|
1594
1620
|
break;
|
|
1595
1621
|
case "DIV":
|
|
1596
|
-
n =
|
|
1622
|
+
n = Ln(r);
|
|
1597
1623
|
break;
|
|
1598
1624
|
}
|
|
1599
1625
|
l(), s(), c();
|
|
@@ -1601,14 +1627,14 @@ function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1601
1627
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1602
1628
|
u.disconnect();
|
|
1603
1629
|
};
|
|
1604
|
-
}, []),
|
|
1630
|
+
}, []), jn(() => {
|
|
1605
1631
|
h.current();
|
|
1606
1632
|
}, [t]), {
|
|
1607
1633
|
refs: n,
|
|
1608
1634
|
onScroll: g
|
|
1609
1635
|
};
|
|
1610
1636
|
}
|
|
1611
|
-
function
|
|
1637
|
+
function Bn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1612
1638
|
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1613
1639
|
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1614
1640
|
let a = t.current ?? n.current;
|
|
@@ -1690,13 +1716,13 @@ function kn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
|
|
|
1690
1716
|
t,
|
|
1691
1717
|
n,
|
|
1692
1718
|
f
|
|
1693
|
-
]),
|
|
1719
|
+
]), jn(f, [f]), {
|
|
1694
1720
|
pinnedMap: l,
|
|
1695
1721
|
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1696
1722
|
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1697
1723
|
};
|
|
1698
1724
|
}
|
|
1699
|
-
function
|
|
1725
|
+
function Vn(e) {
|
|
1700
1726
|
let [t, n] = d(null);
|
|
1701
1727
|
return s(() => {
|
|
1702
1728
|
n(null);
|
|
@@ -1705,7 +1731,7 @@ function An(e) {
|
|
|
1705
1731
|
setLastSelectionChangeIndex: n
|
|
1706
1732
|
};
|
|
1707
1733
|
}
|
|
1708
|
-
function
|
|
1734
|
+
function Hn(e, t) {
|
|
1709
1735
|
let n = () => {
|
|
1710
1736
|
t(e.map((e) => e.matches));
|
|
1711
1737
|
}, r = e.map((e) => {
|
|
@@ -1721,84 +1747,48 @@ function jn(e, t) {
|
|
|
1721
1747
|
});
|
|
1722
1748
|
};
|
|
1723
1749
|
}
|
|
1724
|
-
function
|
|
1750
|
+
function Un(e, t) {
|
|
1725
1751
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1726
1752
|
}
|
|
1727
|
-
function
|
|
1728
|
-
let [r, i] = d(n ? t :
|
|
1753
|
+
function Wn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1754
|
+
let [r, i] = d(n ? t : Un(e, t)), a = u(null);
|
|
1729
1755
|
return s(() => {
|
|
1730
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1756
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), Hn(a.current, (e) => {
|
|
1731
1757
|
i(e);
|
|
1732
1758
|
});
|
|
1733
1759
|
}, [e]), r;
|
|
1734
1760
|
}
|
|
1735
|
-
function
|
|
1761
|
+
function Gn(e) {
|
|
1736
1762
|
let t = ge();
|
|
1737
|
-
return
|
|
1763
|
+
return Wn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1738
1764
|
}
|
|
1739
|
-
function
|
|
1765
|
+
function Kn(e) {
|
|
1740
1766
|
let t = ge();
|
|
1741
|
-
return
|
|
1742
|
-
}
|
|
1743
|
-
function In(e) {
|
|
1744
|
-
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1745
|
-
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1767
|
+
return je((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1746
1768
|
}
|
|
1747
|
-
function
|
|
1748
|
-
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1749
|
-
}
|
|
1750
|
-
function Rn(e, t) {
|
|
1751
|
-
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1752
|
-
}
|
|
1753
|
-
function zn(e, t) {
|
|
1754
|
-
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1755
|
-
}
|
|
1756
|
-
function $(e, t) {
|
|
1757
|
-
return typeof t == "string" ? zn(e, t) : t(e);
|
|
1758
|
-
}
|
|
1759
|
-
function Bn(e) {
|
|
1760
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Bn(e.groups) : 1));
|
|
1761
|
-
}
|
|
1762
|
-
function Vn(e) {
|
|
1763
|
-
let t = [];
|
|
1764
|
-
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));
|
|
1765
|
-
return t.filter((e) => e != null);
|
|
1766
|
-
}
|
|
1767
|
-
function Hn(e, t) {
|
|
1768
|
-
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;
|
|
1769
|
-
}
|
|
1770
|
-
function Un(e, t, n = 0) {
|
|
1771
|
-
if (n === t) return [...e];
|
|
1772
|
-
let r = [];
|
|
1773
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...Un(i.groups, t, n + 1));
|
|
1774
|
-
return r;
|
|
1775
|
-
}
|
|
1776
|
-
function Wn(e, t, n) {
|
|
1777
|
-
return n ? !e || t : !1;
|
|
1778
|
-
}
|
|
1779
|
-
function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1769
|
+
function qn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1780
1770
|
let r = [];
|
|
1781
1771
|
if (e && t) {
|
|
1782
1772
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
1783
|
-
t && i === "always" ? r = t.map((e) =>
|
|
1773
|
+
t && i === "always" ? r = t.map((e) => Q(e, n)) : o && (r = t.filter((e, t) => o({
|
|
1784
1774
|
record: e,
|
|
1785
1775
|
index: t
|
|
1786
|
-
})).map((e) =>
|
|
1776
|
+
})).map((e) => Q(e, n)), a || (r = [r[0]]));
|
|
1787
1777
|
}
|
|
1788
1778
|
let i, a, o = d(r);
|
|
1789
1779
|
if (e) {
|
|
1790
1780
|
let { expandable: t, trigger: r, allowMultiple: s, collapseProps: c, content: l } = e;
|
|
1791
1781
|
e.expanded ? {recordIds: i, onRecordIdsChange: a} = e.expanded : [i, a] = o;
|
|
1792
|
-
let u = (e) => a?.(i.filter((t) => t !==
|
|
1782
|
+
let u = (e) => a?.(i.filter((t) => t !== Q(e, n)));
|
|
1793
1783
|
return {
|
|
1794
1784
|
expandOnClick: r !== "always" && r !== "never",
|
|
1795
|
-
isRowExpanded: (e) => r === "always" ? !0 : i.includes(
|
|
1785
|
+
isRowExpanded: (e) => r === "always" ? !0 : i.includes(Q(e, n)),
|
|
1796
1786
|
isExpandable: ({ record: e, index: n }) => t ? t({
|
|
1797
1787
|
record: e,
|
|
1798
1788
|
index: n
|
|
1799
1789
|
}) : !0,
|
|
1800
1790
|
expandRow: (e) => {
|
|
1801
|
-
let t =
|
|
1791
|
+
let t = Q(e, n);
|
|
1802
1792
|
a?.(s ? [...i, t] : [t]);
|
|
1803
1793
|
},
|
|
1804
1794
|
collapseRow: u,
|
|
@@ -1811,7 +1801,7 @@ function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1811
1801
|
};
|
|
1812
1802
|
}
|
|
1813
1803
|
}
|
|
1814
|
-
function
|
|
1804
|
+
function Jn(e, t) {
|
|
1815
1805
|
let [n, r] = d(e), [i, a] = d(e), o = Ne(() => r(!0), 0), c = Ne(() => a(!1), t || 200);
|
|
1816
1806
|
return s(() => {
|
|
1817
1807
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
@@ -1824,17 +1814,17 @@ function Kn(e, t) {
|
|
|
1824
1814
|
visible: i
|
|
1825
1815
|
};
|
|
1826
1816
|
}
|
|
1827
|
-
var
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1817
|
+
var Yn = "mantine-datatable-nowrap", Xn = "mantine-datatable-ellipsis", Zn = "mantine-datatable-pointer-cursor", Qn = "mantine-datatable-context-menu-cursor", $n = "mantine-datatable-text-selection-disabled", er = "mantine-datatable-text-align-left", tr = "mantine-datatable-text-align-center", nr = "mantine-datatable-text-align-right";
|
|
1818
|
+
function rr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1819
|
+
return Kn(r) ? p(ae, {
|
|
1830
1820
|
"data-pinned": n?.position,
|
|
1831
1821
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1832
1822
|
className: X({
|
|
1833
|
-
[
|
|
1834
|
-
[
|
|
1835
|
-
[
|
|
1836
|
-
[
|
|
1837
|
-
[
|
|
1823
|
+
[Yn]: a || o,
|
|
1824
|
+
[Xn]: o,
|
|
1825
|
+
[er]: s === "left",
|
|
1826
|
+
[tr]: s === "center",
|
|
1827
|
+
[nr]: s === "right"
|
|
1838
1828
|
}, e),
|
|
1839
1829
|
style: [
|
|
1840
1830
|
{
|
|
@@ -1852,24 +1842,24 @@ function tr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1852
1842
|
children: i
|
|
1853
1843
|
}) : null;
|
|
1854
1844
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return p(
|
|
1845
|
+
function ir({ shadowVisible: e }) {
|
|
1846
|
+
return p(ae, {
|
|
1857
1847
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1858
1848
|
"data-shadow-visible": e || void 0
|
|
1859
1849
|
});
|
|
1860
1850
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return p(
|
|
1851
|
+
function ar({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1852
|
+
return p(ie, {
|
|
1863
1853
|
ref: s,
|
|
1864
1854
|
className: X("mantine-datatable-footer", e),
|
|
1865
1855
|
style: t,
|
|
1866
|
-
children: m(
|
|
1856
|
+
children: m(se, { children: [a && p(ir, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1867
1857
|
if (e) return null;
|
|
1868
1858
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1869
1859
|
...r,
|
|
1870
1860
|
...t
|
|
1871
1861
|
};
|
|
1872
|
-
return p(
|
|
1862
|
+
return p(rr, {
|
|
1873
1863
|
pinnedInfo: i.get(String(n)),
|
|
1874
1864
|
className: l,
|
|
1875
1865
|
style: u,
|
|
@@ -1883,8 +1873,8 @@ function rr({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
|
|
|
1883
1873
|
})] })
|
|
1884
1874
|
});
|
|
1885
1875
|
}
|
|
1886
|
-
function
|
|
1887
|
-
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ?
|
|
1876
|
+
function or({ 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 }) {
|
|
1877
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? Sn([{
|
|
1888
1878
|
id: e,
|
|
1889
1879
|
columns: t,
|
|
1890
1880
|
groups: n
|
|
@@ -1892,7 +1882,7 @@ function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1892
1882
|
t,
|
|
1893
1883
|
n,
|
|
1894
1884
|
e
|
|
1895
|
-
]), _ =
|
|
1885
|
+
]), _ = Gn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => Cn({
|
|
1896
1886
|
id: e,
|
|
1897
1887
|
columns: t,
|
|
1898
1888
|
groups: n
|
|
@@ -1901,16 +1891,16 @@ function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1901
1891
|
t,
|
|
1902
1892
|
n,
|
|
1903
1893
|
_
|
|
1904
|
-
]), y = l(() => d.reduce((e, t) => e +
|
|
1905
|
-
return v > 0 ? p(
|
|
1894
|
+
]), y = l(() => d.reduce((e, t) => e + Cn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Tn(f, y + v < h, m);
|
|
1895
|
+
return v > 0 ? p(ae, {
|
|
1906
1896
|
colSpan: v,
|
|
1907
1897
|
rowSpan: b > 1 ? b : void 0,
|
|
1908
1898
|
"data-pinned": s?.position,
|
|
1909
1899
|
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1910
1900
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1911
|
-
[
|
|
1912
|
-
[
|
|
1913
|
-
[
|
|
1901
|
+
[er]: i === "left",
|
|
1902
|
+
[tr]: i === "center",
|
|
1903
|
+
[nr]: i === "right",
|
|
1914
1904
|
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1915
1905
|
}, a),
|
|
1916
1906
|
style: [o, s && {
|
|
@@ -1918,10 +1908,10 @@ function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1918
1908
|
[s.position]: s.offset,
|
|
1919
1909
|
overflow: "visible"
|
|
1920
1910
|
}],
|
|
1921
|
-
children: r ??
|
|
1911
|
+
children: r ?? hn(e)
|
|
1922
1912
|
}) : null;
|
|
1923
1913
|
}
|
|
1924
|
-
function
|
|
1914
|
+
function sr() {
|
|
1925
1915
|
return m("svg", {
|
|
1926
1916
|
width: "14",
|
|
1927
1917
|
height: "14",
|
|
@@ -1938,7 +1928,7 @@ function ar() {
|
|
|
1938
1928
|
}), 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" })]
|
|
1939
1929
|
});
|
|
1940
1930
|
}
|
|
1941
|
-
function
|
|
1931
|
+
function cr() {
|
|
1942
1932
|
return m("svg", {
|
|
1943
1933
|
width: "14",
|
|
1944
1934
|
height: "14",
|
|
@@ -1959,8 +1949,8 @@ function or() {
|
|
|
1959
1949
|
})]
|
|
1960
1950
|
});
|
|
1961
1951
|
}
|
|
1962
|
-
function
|
|
1963
|
-
let [i, { close: a, toggle: o }] = Ae(!1), s = t ?
|
|
1952
|
+
function lr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1953
|
+
let [i, { close: a, toggle: o }] = Ae(!1), s = t ? cr : sr, c = ke(a);
|
|
1964
1954
|
return r && (c = void 0), m(F, {
|
|
1965
1955
|
withArrow: !0,
|
|
1966
1956
|
shadow: "md",
|
|
@@ -1987,7 +1977,7 @@ function sr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1987
1977
|
})]
|
|
1988
1978
|
});
|
|
1989
1979
|
}
|
|
1990
|
-
function
|
|
1980
|
+
function ur() {
|
|
1991
1981
|
return m("svg", {
|
|
1992
1982
|
width: "14",
|
|
1993
1983
|
height: "14",
|
|
@@ -2009,7 +1999,7 @@ function cr() {
|
|
|
2009
1999
|
]
|
|
2010
2000
|
});
|
|
2011
2001
|
}
|
|
2012
|
-
function
|
|
2002
|
+
function dr() {
|
|
2013
2003
|
return m("svg", {
|
|
2014
2004
|
width: "14",
|
|
2015
2005
|
height: "14",
|
|
@@ -2031,7 +2021,7 @@ function lr() {
|
|
|
2031
2021
|
]
|
|
2032
2022
|
});
|
|
2033
2023
|
}
|
|
2034
|
-
function
|
|
2024
|
+
function fr() {
|
|
2035
2025
|
return m("svg", {
|
|
2036
2026
|
width: "14",
|
|
2037
2027
|
height: "14",
|
|
@@ -2053,7 +2043,7 @@ function ur() {
|
|
|
2053
2043
|
]
|
|
2054
2044
|
});
|
|
2055
2045
|
}
|
|
2056
|
-
function
|
|
2046
|
+
function pr() {
|
|
2057
2047
|
return m("svg", {
|
|
2058
2048
|
width: "14",
|
|
2059
2049
|
height: "14",
|
|
@@ -2074,14 +2064,14 @@ function dr() {
|
|
|
2074
2064
|
]
|
|
2075
2065
|
});
|
|
2076
2066
|
}
|
|
2077
|
-
function
|
|
2067
|
+
function mr({ currentPinned: e, onPinChange: t }) {
|
|
2078
2068
|
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2079
2069
|
if (i.current) {
|
|
2080
2070
|
let e = getComputedStyle(i.current).direction;
|
|
2081
2071
|
c(e === "rtl");
|
|
2082
2072
|
}
|
|
2083
2073
|
}, []);
|
|
2084
|
-
|
|
2074
|
+
jn(() => {
|
|
2085
2075
|
l();
|
|
2086
2076
|
}, [l]), s(() => {
|
|
2087
2077
|
n && l();
|
|
@@ -2104,7 +2094,7 @@ function fr({ currentPinned: e, onPinChange: t }) {
|
|
|
2104
2094
|
size: "xs",
|
|
2105
2095
|
variant: "light",
|
|
2106
2096
|
onClick: (e) => e.stopPropagation(),
|
|
2107
|
-
children: p(
|
|
2097
|
+
children: p(fr, {})
|
|
2108
2098
|
})
|
|
2109
2099
|
}) }), p(F.Dropdown, {
|
|
2110
2100
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -2119,14 +2109,14 @@ function fr({ currentPinned: e, onPinChange: t }) {
|
|
|
2119
2109
|
variant: _ ? "filled" : "light",
|
|
2120
2110
|
onClick: () => t(_ ? void 0 : f),
|
|
2121
2111
|
"aria-label": "Pin left",
|
|
2122
|
-
children: p(
|
|
2112
|
+
children: p(ur, {})
|
|
2123
2113
|
}),
|
|
2124
2114
|
p(g, {
|
|
2125
2115
|
size: "sm",
|
|
2126
2116
|
variant: v ? "filled" : "light",
|
|
2127
2117
|
onClick: () => t(v ? void 0 : h),
|
|
2128
2118
|
"aria-label": "Pin right",
|
|
2129
|
-
children: p(
|
|
2119
|
+
children: p(dr, {})
|
|
2130
2120
|
}),
|
|
2131
2121
|
e && p(g, {
|
|
2132
2122
|
size: "sm",
|
|
@@ -2134,14 +2124,14 @@ function fr({ currentPinned: e, onPinChange: t }) {
|
|
|
2134
2124
|
color: "red",
|
|
2135
2125
|
onClick: () => t(void 0),
|
|
2136
2126
|
"aria-label": "Unpin",
|
|
2137
|
-
children: p(
|
|
2127
|
+
children: p(pr, {})
|
|
2138
2128
|
})
|
|
2139
2129
|
]
|
|
2140
2130
|
})
|
|
2141
2131
|
})]
|
|
2142
2132
|
});
|
|
2143
2133
|
}
|
|
2144
|
-
var
|
|
2134
|
+
var hr = 50, gr = (e) => {
|
|
2145
2135
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2146
2136
|
current: 0,
|
|
2147
2137
|
next: 0
|
|
@@ -2164,7 +2154,7 @@ var pr = 50, mr = (e) => {
|
|
|
2164
2154
|
let p = (e) => {
|
|
2165
2155
|
let n = e.clientX - o.current;
|
|
2166
2156
|
l && (n = -n);
|
|
2167
|
-
let r = s.current.current -
|
|
2157
|
+
let r = s.current.current - hr, i = s.current.next - hr, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
|
|
2168
2158
|
f([{
|
|
2169
2159
|
accessor: t,
|
|
2170
2160
|
width: `${u}px`
|
|
@@ -2211,7 +2201,7 @@ var pr = 50, mr = (e) => {
|
|
|
2211
2201
|
title: "Drag to resize column, double-click to reset"
|
|
2212
2202
|
});
|
|
2213
2203
|
};
|
|
2214
|
-
function
|
|
2204
|
+
function _r() {
|
|
2215
2205
|
return m("svg", {
|
|
2216
2206
|
width: "14",
|
|
2217
2207
|
height: "14",
|
|
@@ -2233,7 +2223,7 @@ function hr() {
|
|
|
2233
2223
|
]
|
|
2234
2224
|
});
|
|
2235
2225
|
}
|
|
2236
|
-
function
|
|
2226
|
+
function vr() {
|
|
2237
2227
|
return m("svg", {
|
|
2238
2228
|
width: "14",
|
|
2239
2229
|
height: "14",
|
|
@@ -2255,7 +2245,7 @@ function gr() {
|
|
|
2255
2245
|
]
|
|
2256
2246
|
});
|
|
2257
2247
|
}
|
|
2258
|
-
function
|
|
2248
|
+
function yr() {
|
|
2259
2249
|
return m("svg", {
|
|
2260
2250
|
width: "14",
|
|
2261
2251
|
height: "14",
|
|
@@ -2280,37 +2270,37 @@ function _r() {
|
|
|
2280
2270
|
]
|
|
2281
2271
|
});
|
|
2282
2272
|
}
|
|
2283
|
-
function
|
|
2284
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: ee } = un(), [I, L] = d(!1), R = u(null),
|
|
2285
|
-
if (!
|
|
2286
|
-
let
|
|
2273
|
+
function br({ 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 }) {
|
|
2274
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: ee } = un(), [I, L] = d(!1), R = u(null), z = F?.find((e) => e.accessor === r)?.pinned;
|
|
2275
|
+
if (!Kn(i)) return null;
|
|
2276
|
+
let B = a ?? hn(r), te = typeof B == "string" ? B : void 0, ne = o && S ? (e) => {
|
|
2287
2277
|
e?.defaultPrevented || S({
|
|
2288
2278
|
sortKey: k,
|
|
2289
2279
|
columnAccessor: r,
|
|
2290
2280
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2291
2281
|
});
|
|
2292
|
-
} : void 0,
|
|
2282
|
+
} : void 0, re = (e) => {
|
|
2293
2283
|
e.stopPropagation(), A(r), L(!1);
|
|
2294
|
-
},
|
|
2284
|
+
}, ie = (e) => {
|
|
2295
2285
|
e.preventDefault(), j(r), L(!0);
|
|
2296
|
-
},
|
|
2286
|
+
}, oe = () => {
|
|
2297
2287
|
j(r), L(!1), M();
|
|
2298
|
-
},
|
|
2288
|
+
}, se = () => {
|
|
2299
2289
|
L(!0);
|
|
2300
|
-
},
|
|
2290
|
+
}, ce = () => {
|
|
2301
2291
|
L(!1);
|
|
2302
|
-
},
|
|
2292
|
+
}, V = (e) => {
|
|
2303
2293
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2304
2294
|
...e,
|
|
2305
2295
|
toggled: !1
|
|
2306
2296
|
} : e));
|
|
2307
|
-
},
|
|
2297
|
+
}, le = (e) => {
|
|
2308
2298
|
ee((t) => t.map((t) => t.accessor === r ? {
|
|
2309
2299
|
...t,
|
|
2310
2300
|
pinned: e
|
|
2311
2301
|
} : t));
|
|
2312
2302
|
};
|
|
2313
|
-
return m(
|
|
2303
|
+
return m(ae, {
|
|
2314
2304
|
"data-accessor": r,
|
|
2315
2305
|
"data-pinned": n?.position,
|
|
2316
2306
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2337,8 +2327,8 @@ function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2337
2327
|
],
|
|
2338
2328
|
role: o ? "button" : void 0,
|
|
2339
2329
|
tabIndex: o ? 0 : void 0,
|
|
2340
|
-
onClick:
|
|
2341
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2330
|
+
onClick: ne,
|
|
2331
|
+
onKeyDown: (e) => e.key === "Enter" && ne?.(),
|
|
2342
2332
|
ref: R,
|
|
2343
2333
|
children: [m(T, {
|
|
2344
2334
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
@@ -2353,11 +2343,11 @@ function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2353
2343
|
"mantine-datatable-header-cell-drag-over": I
|
|
2354
2344
|
}),
|
|
2355
2345
|
draggable: s,
|
|
2356
|
-
onDragStart: s ?
|
|
2357
|
-
onDragEnter: s ?
|
|
2358
|
-
onDragOver: s ?
|
|
2359
|
-
onDrop: s ?
|
|
2360
|
-
onDragLeave: s ?
|
|
2346
|
+
onDragStart: s ? re : void 0,
|
|
2347
|
+
onDragEnter: s ? se : void 0,
|
|
2348
|
+
onDragOver: s ? ie : void 0,
|
|
2349
|
+
onDrop: s ? oe : void 0,
|
|
2350
|
+
onDragLeave: s ? ce : void 0,
|
|
2361
2351
|
children: [s ? p(b, {
|
|
2362
2352
|
role: "img",
|
|
2363
2353
|
"aria-label": "Drag column",
|
|
@@ -2368,21 +2358,21 @@ function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2368
2358
|
onClick: (e) => {
|
|
2369
2359
|
e.stopPropagation();
|
|
2370
2360
|
},
|
|
2371
|
-
children: p(
|
|
2361
|
+
children: p(yr, {})
|
|
2372
2362
|
})
|
|
2373
2363
|
}) : null, p(v, {
|
|
2374
2364
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
2375
|
-
[
|
|
2376
|
-
[
|
|
2377
|
-
[
|
|
2378
|
-
},
|
|
2379
|
-
title:
|
|
2380
|
-
children:
|
|
2365
|
+
[er]: _ === "left",
|
|
2366
|
+
[tr]: _ === "center",
|
|
2367
|
+
[nr]: _ === "right"
|
|
2368
|
+
}, Yn, Xn),
|
|
2369
|
+
title: te,
|
|
2370
|
+
children: B
|
|
2381
2371
|
})]
|
|
2382
2372
|
}),
|
|
2383
|
-
l ? p(
|
|
2384
|
-
currentPinned:
|
|
2385
|
-
onPinChange:
|
|
2373
|
+
l ? p(mr, {
|
|
2374
|
+
currentPinned: z,
|
|
2375
|
+
onPinChange: le
|
|
2386
2376
|
}) : null,
|
|
2387
2377
|
c ? p(b, {
|
|
2388
2378
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2391,46 +2381,46 @@ function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2391
2381
|
children: p(g, {
|
|
2392
2382
|
size: "xs",
|
|
2393
2383
|
variant: "light",
|
|
2394
|
-
onClick:
|
|
2395
|
-
children: p(
|
|
2384
|
+
onClick: V,
|
|
2385
|
+
children: p(pr, {})
|
|
2396
2386
|
})
|
|
2397
2387
|
}) : null,
|
|
2398
2388
|
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
|
|
2399
2389
|
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
2400
2390
|
role: "img",
|
|
2401
2391
|
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2402
|
-
children: h?.sorted || p(
|
|
2392
|
+
children: h?.sorted || p(vr, {})
|
|
2403
2393
|
}) : p(b, {
|
|
2404
2394
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
2405
2395
|
role: "img",
|
|
2406
2396
|
"aria-label": "Not sorted",
|
|
2407
|
-
children: h?.unsorted || p(
|
|
2397
|
+
children: h?.unsorted || p(_r, {})
|
|
2408
2398
|
}) : null,
|
|
2409
|
-
C ? p(
|
|
2399
|
+
C ? p(lr, {
|
|
2410
2400
|
filterPopoverProps: E,
|
|
2411
2401
|
isActive: !!O,
|
|
2412
2402
|
filterPopoverDisableClickOutside: D,
|
|
2413
2403
|
children: C
|
|
2414
2404
|
}) : null
|
|
2415
2405
|
]
|
|
2416
|
-
}), f && r !== "__selection__" ? p(
|
|
2406
|
+
}), f && r !== "__selection__" ? p(gr, {
|
|
2417
2407
|
accessor: r,
|
|
2418
2408
|
columnRef: R
|
|
2419
2409
|
}) : null]
|
|
2420
2410
|
});
|
|
2421
2411
|
}
|
|
2422
|
-
function
|
|
2412
|
+
function xr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2423
2413
|
let u = !o.disabled;
|
|
2424
|
-
return p(
|
|
2414
|
+
return p(ae, {
|
|
2425
2415
|
ref: l,
|
|
2426
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2416
|
+
className: X("mantine-datatable-header-selector-cell", { [Zn]: n === "cell" && u }, e),
|
|
2427
2417
|
style: t,
|
|
2428
2418
|
rowSpan: c,
|
|
2429
2419
|
"data-shadow-visible": r || void 0,
|
|
2430
2420
|
"data-accessor": "__selection__",
|
|
2431
2421
|
onClick: n === "cell" && u ? s : void 0,
|
|
2432
2422
|
children: p(x, {
|
|
2433
|
-
classNames: u ? { input:
|
|
2423
|
+
classNames: u ? { input: Zn } : void 0,
|
|
2434
2424
|
checked: i,
|
|
2435
2425
|
indeterminate: a,
|
|
2436
2426
|
onChange: s,
|
|
@@ -2439,7 +2429,7 @@ function yr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
2439
2429
|
})
|
|
2440
2430
|
});
|
|
2441
2431
|
}
|
|
2442
|
-
function
|
|
2432
|
+
function Sr(e, t) {
|
|
2443
2433
|
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2444
2434
|
if (r.length === 0 || r.length !== n.length) return;
|
|
2445
2435
|
let i = new Set(r.map((e) => e.logicalSide));
|
|
@@ -2452,8 +2442,8 @@ function br(e, t) {
|
|
|
2452
2442
|
isBoundary: l?.isBoundary ?? !1
|
|
2453
2443
|
};
|
|
2454
2444
|
}
|
|
2455
|
-
function
|
|
2456
|
-
let E = c ?
|
|
2445
|
+
function Cr({ 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 }) {
|
|
2446
|
+
let E = c ? xn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(xr, {
|
|
2457
2447
|
ref: e,
|
|
2458
2448
|
className: b,
|
|
2459
2449
|
style: S,
|
|
@@ -2464,7 +2454,7 @@ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2464
2454
|
checkboxProps: v,
|
|
2465
2455
|
onChange: _,
|
|
2466
2456
|
rowSpan: c ? D : void 0
|
|
2467
|
-
}) : 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 ??
|
|
2457
|
+
}) : 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 ?? hn(String(e))])) : void 0, L = m(oe, {
|
|
2468
2458
|
className: X("mantine-datatable-header", t),
|
|
2469
2459
|
style: n,
|
|
2470
2460
|
ref: w,
|
|
@@ -2472,10 +2462,10 @@ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2472
2462
|
e.preventDefault(), M((e) => !e);
|
|
2473
2463
|
} : void 0,
|
|
2474
2464
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2475
|
-
let n =
|
|
2476
|
-
return m(
|
|
2465
|
+
let n = wn(c, t);
|
|
2466
|
+
return m(se, { children: [t === 0 && O, n.map((e, r) => p(or, {
|
|
2477
2467
|
group: e,
|
|
2478
|
-
pinnedInfo:
|
|
2468
|
+
pinnedInfo: Sr(e, l),
|
|
2479
2469
|
maxDepth: E,
|
|
2480
2470
|
currentDepth: t,
|
|
2481
2471
|
previousGroups: n.slice(0, r),
|
|
@@ -2483,13 +2473,13 @@ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2483
2473
|
withColumnBorders: C,
|
|
2484
2474
|
totalTableColumns: o.length
|
|
2485
2475
|
}, e.id))] }, `group-depth-${t}`);
|
|
2486
|
-
}), m(
|
|
2476
|
+
}), m(se, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2487
2477
|
if (e) return null;
|
|
2488
2478
|
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 } = {
|
|
2489
2479
|
...s,
|
|
2490
2480
|
...t
|
|
2491
2481
|
};
|
|
2492
|
-
return p(
|
|
2482
|
+
return p(br, {
|
|
2493
2483
|
accessor: c,
|
|
2494
2484
|
pinnedInfo: l.get(String(c)),
|
|
2495
2485
|
className: b,
|
|
@@ -2520,7 +2510,7 @@ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2520
2510
|
shadow: "md",
|
|
2521
2511
|
opened: j,
|
|
2522
2512
|
onChange: M,
|
|
2523
|
-
children: [p(I, { children: L }), p(ee, { children: p(
|
|
2513
|
+
children: [p(I, { children: L }), p(ee, { children: p(B, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2524
2514
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2525
2515
|
size: "xs",
|
|
2526
2516
|
label: P[e.accessor],
|
|
@@ -2534,7 +2524,7 @@ function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2534
2524
|
}) }, e.accessor)) }) })]
|
|
2535
2525
|
}) : L;
|
|
2536
2526
|
}
|
|
2537
|
-
function
|
|
2527
|
+
function wr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2538
2528
|
return p(b, {
|
|
2539
2529
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2540
2530
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
@@ -2545,7 +2535,7 @@ function Sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
|
|
|
2545
2535
|
}))
|
|
2546
2536
|
});
|
|
2547
2537
|
}
|
|
2548
|
-
function
|
|
2538
|
+
function Tr() {
|
|
2549
2539
|
return m("svg", {
|
|
2550
2540
|
width: "14",
|
|
2551
2541
|
height: "14",
|
|
@@ -2566,17 +2556,17 @@ function Cr() {
|
|
|
2566
2556
|
]
|
|
2567
2557
|
});
|
|
2568
2558
|
}
|
|
2569
|
-
var
|
|
2570
|
-
xs:
|
|
2571
|
-
sm:
|
|
2572
|
-
md:
|
|
2573
|
-
lg:
|
|
2574
|
-
xl:
|
|
2559
|
+
var Er = {
|
|
2560
|
+
xs: me(22),
|
|
2561
|
+
sm: me(26),
|
|
2562
|
+
md: me(32),
|
|
2563
|
+
lg: me(38),
|
|
2564
|
+
xl: me(44)
|
|
2575
2565
|
};
|
|
2576
|
-
function
|
|
2566
|
+
function Dr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2577
2567
|
return m(T, {
|
|
2578
2568
|
gap: "xs",
|
|
2579
|
-
children: [p(
|
|
2569
|
+
children: [p(V, {
|
|
2580
2570
|
component: "div",
|
|
2581
2571
|
size: e,
|
|
2582
2572
|
children: t
|
|
@@ -2589,9 +2579,9 @@ function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2589
2579
|
size: e,
|
|
2590
2580
|
variant: "default",
|
|
2591
2581
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2592
|
-
rightSection: p(
|
|
2582
|
+
rightSection: p(Tr, {}),
|
|
2593
2583
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2594
|
-
height:
|
|
2584
|
+
height: Er[e],
|
|
2595
2585
|
paddingLeft: t.spacing[e],
|
|
2596
2586
|
paddingRight: t.spacing[e]
|
|
2597
2587
|
})],
|
|
@@ -2600,14 +2590,14 @@ function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2600
2590
|
let n = t === r;
|
|
2601
2591
|
return p(A, {
|
|
2602
2592
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2603
|
-
style: [{ height:
|
|
2593
|
+
style: [{ height: Er[e] }, n && (i || a) ? (e) => sn({
|
|
2604
2594
|
theme: e,
|
|
2605
2595
|
paginationActiveTextColor: i,
|
|
2606
2596
|
paginationActiveBackgroundColor: a
|
|
2607
2597
|
}) : void 0],
|
|
2608
2598
|
disabled: n,
|
|
2609
2599
|
onClick: () => o(t),
|
|
2610
|
-
children: p(
|
|
2600
|
+
children: p(V, {
|
|
2611
2601
|
component: "div",
|
|
2612
2602
|
size: e,
|
|
2613
2603
|
children: t
|
|
@@ -2617,7 +2607,7 @@ function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2617
2607
|
})]
|
|
2618
2608
|
});
|
|
2619
2609
|
}
|
|
2620
|
-
function
|
|
2610
|
+
function Or({ 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 }) {
|
|
2621
2611
|
let O;
|
|
2622
2612
|
if (g) {
|
|
2623
2613
|
let e = (r - 1) * _ + 1;
|
|
@@ -2627,15 +2617,15 @@ function Er({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2627
2617
|
totalRecords: g
|
|
2628
2618
|
});
|
|
2629
2619
|
} else O = n ? u : d;
|
|
2630
|
-
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 = !
|
|
2631
|
-
Text: (e) => p(
|
|
2620
|
+
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 = !Kn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${me(w)}rem` : e[w] || w})`), N = {
|
|
2621
|
+
Text: (e) => p(V, {
|
|
2632
2622
|
component: "div",
|
|
2633
2623
|
className: "mantine-datatable-pagination-text",
|
|
2634
2624
|
size: l,
|
|
2635
2625
|
...e,
|
|
2636
2626
|
children: O
|
|
2637
2627
|
}),
|
|
2638
|
-
PageSizeSelector: (e) => x ? p(
|
|
2628
|
+
PageSizeSelector: (e) => x ? p(Dr, {
|
|
2639
2629
|
activeTextColor: s,
|
|
2640
2630
|
activeBackgroundColor: c,
|
|
2641
2631
|
size: l,
|
|
@@ -2696,18 +2686,18 @@ function Er({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2696
2686
|
] })
|
|
2697
2687
|
});
|
|
2698
2688
|
}
|
|
2699
|
-
function
|
|
2700
|
-
return
|
|
2689
|
+
function kr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
|
|
2690
|
+
return Kn(r) ? p(re, {
|
|
2701
2691
|
"data-pinned": n?.position,
|
|
2702
2692
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2703
2693
|
className: X({
|
|
2704
|
-
[
|
|
2705
|
-
[
|
|
2706
|
-
[
|
|
2707
|
-
[
|
|
2708
|
-
[
|
|
2709
|
-
[
|
|
2710
|
-
[
|
|
2694
|
+
[Yn]: l || u,
|
|
2695
|
+
[Xn]: u,
|
|
2696
|
+
[Zn]: o || s,
|
|
2697
|
+
[Qn]: c,
|
|
2698
|
+
[er]: d === "left",
|
|
2699
|
+
[tr]: d === "center",
|
|
2700
|
+
[nr]: d === "right"
|
|
2711
2701
|
}, e),
|
|
2712
2702
|
style: [
|
|
2713
2703
|
{
|
|
@@ -2726,12 +2716,12 @@ function Dr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2726
2716
|
onDoubleClick: s,
|
|
2727
2717
|
onContextMenu: c,
|
|
2728
2718
|
..._?.(i, a),
|
|
2729
|
-
children: h ? h(i, a) : g ? g(i, a, m) :
|
|
2719
|
+
children: h ? h(i, a) : g ? g(i, a, m) : bn(i, m)
|
|
2730
2720
|
}) : null;
|
|
2731
2721
|
}
|
|
2732
|
-
function
|
|
2733
|
-
let { expanded: i, visible: a } =
|
|
2734
|
-
return a ? m(f, { children: [p(
|
|
2722
|
+
function Ar({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2723
|
+
let { expanded: i, visible: a } = Jn(e, r?.transitionDuration);
|
|
2724
|
+
return a ? m(f, { children: [p(se, {}), p(se, { children: p(re, {
|
|
2735
2725
|
className: "mantine-datatable-row-expansion-cell",
|
|
2736
2726
|
colSpan: t,
|
|
2737
2727
|
children: p(S, {
|
|
@@ -2744,28 +2734,28 @@ function Or({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2744
2734
|
})
|
|
2745
2735
|
}) })] }) : null;
|
|
2746
2736
|
}
|
|
2747
|
-
function
|
|
2737
|
+
function jr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2748
2738
|
let u = {
|
|
2749
2739
|
...s,
|
|
2750
2740
|
...c(n, r)
|
|
2751
2741
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2752
2742
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2753
2743
|
};
|
|
2754
|
-
return p(
|
|
2755
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2744
|
+
return p(re, {
|
|
2745
|
+
className: X("mantine-datatable-row-selector-cell", { [Zn]: i === "cell" && d }, e),
|
|
2756
2746
|
style: t,
|
|
2757
2747
|
"data-shadow-visible": o || void 0,
|
|
2758
2748
|
onClick: f,
|
|
2759
2749
|
children: p(x, {
|
|
2760
|
-
classNames: d ? { input:
|
|
2750
|
+
classNames: d ? { input: Zn } : void 0,
|
|
2761
2751
|
onChange: a,
|
|
2762
2752
|
...l,
|
|
2763
2753
|
...u
|
|
2764
2754
|
})
|
|
2765
2755
|
});
|
|
2766
2756
|
}
|
|
2767
|
-
function
|
|
2768
|
-
let M = m(f, { children: [s && p(
|
|
2757
|
+
function Mr({ 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 }) {
|
|
2758
|
+
let M = m(f, { children: [s && p(jr, {
|
|
2769
2759
|
className: k,
|
|
2770
2760
|
style: A,
|
|
2771
2761
|
record: e,
|
|
@@ -2783,7 +2773,7 @@ function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2783
2773
|
...r,
|
|
2784
2774
|
...s
|
|
2785
2775
|
};
|
|
2786
|
-
return p(
|
|
2776
|
+
return p(kr, {
|
|
2787
2777
|
pinnedInfo: i.get(String(l)),
|
|
2788
2778
|
className: typeof _ == "function" ? _(e, t) : _,
|
|
2789
2779
|
style: v?.(e, t),
|
|
@@ -2820,7 +2810,7 @@ function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2820
2810
|
defaultRender: a,
|
|
2821
2811
|
customCellAttributes: S
|
|
2822
2812
|
}, l);
|
|
2823
|
-
})] }), N = S && p(
|
|
2813
|
+
})] }), N = S && p(Ar, {
|
|
2824
2814
|
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2825
2815
|
open: S.isRowExpanded(e),
|
|
2826
2816
|
content: S.content({
|
|
@@ -2828,7 +2818,7 @@ function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2828
2818
|
index: t
|
|
2829
2819
|
}),
|
|
2830
2820
|
collapseProps: S.collapseProps
|
|
2831
|
-
}), P =
|
|
2821
|
+
}), P = Nr({
|
|
2832
2822
|
record: e,
|
|
2833
2823
|
index: t,
|
|
2834
2824
|
selectionChecked: c,
|
|
@@ -2848,17 +2838,17 @@ function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2848
2838
|
rowProps: P,
|
|
2849
2839
|
children: M,
|
|
2850
2840
|
expandedElement: N
|
|
2851
|
-
}) : m(f, { children: [p(
|
|
2841
|
+
}) : m(f, { children: [p(se, {
|
|
2852
2842
|
...P,
|
|
2853
2843
|
children: M
|
|
2854
2844
|
}), N] });
|
|
2855
2845
|
}
|
|
2856
|
-
function
|
|
2846
|
+
function Nr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
|
|
2857
2847
|
return {
|
|
2858
|
-
className: X("mantine-datatable-row", { [
|
|
2848
|
+
className: X("mantine-datatable-row", { [Zn]: r || i || o?.isExpandable({
|
|
2859
2849
|
record: e,
|
|
2860
2850
|
index: t
|
|
2861
|
-
}) && o?.expandOnClick }, { [
|
|
2851
|
+
}) && o?.expandOnClick }, { [Qn]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2862
2852
|
"data-selected": n || void 0,
|
|
2863
2853
|
onClick: (n) => {
|
|
2864
2854
|
if (o) {
|
|
@@ -2895,7 +2885,7 @@ function jr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2895
2885
|
...s?.(e, t) ?? {}
|
|
2896
2886
|
};
|
|
2897
2887
|
}
|
|
2898
|
-
function
|
|
2888
|
+
function Pr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2899
2889
|
return m(L, {
|
|
2900
2890
|
...a,
|
|
2901
2891
|
viewportRef: i,
|
|
@@ -2915,26 +2905,26 @@ function Mr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2915
2905
|
]
|
|
2916
2906
|
});
|
|
2917
2907
|
}
|
|
2918
|
-
function
|
|
2919
|
-
let dt = l(() => y ?
|
|
2908
|
+
function Fr({ 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: z, totalRecords: B, recordsPerPage: te, onRecordsPerPageChange: re, recordsPerPageOptions: ie, recordsPerPageLabel: ae = "Records per page", paginationWithEdges: oe, paginationWithControls: se, paginationActiveTextColor: ce, paginationActiveBackgroundColor: V, paginationSize: le = "sm", paginationText: ue = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: de = "sm", getPaginationControlProps: fe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: Oe, onRowContextMenu: ke, onCellClick: Ae, onCellDoubleClick: H, onCellContextMenu: je, onScroll: Ne, onScrollToTop: Pe, onScrollToBottom: Fe, onScrollToLeft: Ie, onScrollToRight: Le, c: Re, backgroundColor: ze, borderColor: Be, rowBorderColor: Ve, stripedColor: He, highlightOnHoverColor: U, rowColor: W, rowBackgroundColor: Ue, rowExpansion: We, rowClassName: Ge, rowStyle: G, customRowAttributes: Ke, scrollViewportRef: qe, scrollAreaProps: Je, tableRef: Ye, bodyRef: Xe, 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 }) {
|
|
2909
|
+
let dt = l(() => y ? Sn(y) : g, [g, y]), { refs: K, onScroll: ft } = zn({
|
|
2920
2910
|
scrollCallbacks: {
|
|
2921
2911
|
onScroll: Ne,
|
|
2922
|
-
onScrollToTop:
|
|
2923
|
-
onScrollToBottom:
|
|
2924
|
-
onScrollToLeft:
|
|
2925
|
-
onScrollToRight:
|
|
2912
|
+
onScrollToTop: Pe,
|
|
2913
|
+
onScrollToBottom: Fe,
|
|
2914
|
+
onScrollToLeft: Ie,
|
|
2915
|
+
onScrollToRight: Le
|
|
2926
2916
|
},
|
|
2927
2917
|
withRowBorders: ut.withRowBorders
|
|
2928
|
-
}), q =
|
|
2918
|
+
}), q = An({
|
|
2929
2919
|
key: _,
|
|
2930
2920
|
columns: dt,
|
|
2931
2921
|
headerRef: K.header,
|
|
2932
2922
|
scrollViewportRef: K.scrollViewport
|
|
2933
|
-
}), pt = q.effectiveColumns, mt = Me(K.table, Ye), ht = Me(K.scrollViewport, qe), gt = u(null), _t = Me(gt, Xe), vt =
|
|
2934
|
-
rowExpansion:
|
|
2923
|
+
}), pt = q.effectiveColumns, mt = Me(K.table, Ye), ht = Me(K.scrollViewport, qe), gt = u(null), _t = Me(gt, Xe), vt = qn({
|
|
2924
|
+
rowExpansion: We,
|
|
2935
2925
|
records: T,
|
|
2936
2926
|
idAccessor: w
|
|
2937
|
-
}), { pinnedMap: yt, hasLeftPinned: bt, hasRightPinned: xt } =
|
|
2927
|
+
}), { pinnedMap: yt, hasLeftPinned: bt, hasRightPinned: xt } = Bn({
|
|
2938
2928
|
columns: pt,
|
|
2939
2929
|
theadRef: K.header,
|
|
2940
2930
|
tbodyRef: gt,
|
|
@@ -2943,8 +2933,8 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2943
2933
|
pinFirstColumn: b,
|
|
2944
2934
|
pinLastColumn: x
|
|
2945
2935
|
}), St = u(!1), Ct = u(R), wt = u(T), Tt = a((e) => {
|
|
2946
|
-
St.current = !0, wt.current = T,
|
|
2947
|
-
}, [
|
|
2936
|
+
St.current = !0, wt.current = T, z(e);
|
|
2937
|
+
}, [z, T]);
|
|
2948
2938
|
s(() => {
|
|
2949
2939
|
Ct.current !== R && (St.current = !0, wt.current = T, Ct.current = R);
|
|
2950
2940
|
}, [R, T]);
|
|
@@ -2965,8 +2955,8 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2965
2955
|
T,
|
|
2966
2956
|
K.scrollViewport
|
|
2967
2957
|
]);
|
|
2968
|
-
let Dt = T?.map((e) =>
|
|
2969
|
-
D && O && O(J ? D.filter((e) => !Mt.includes(
|
|
2958
|
+
let Dt = T?.map((e) => Q(e, w)), Ot = !!D, kt = D?.map((e) => Q(e, w)), At = Dt !== void 0 && kt !== void 0 && kt.length > 0, jt = j ? T?.filter(j) : T, Mt = jt?.map((e) => Q(e, w)), J = At && Mt.every((e) => kt.includes(e)), Nt = At && Mt.some((e) => kt.includes(e)), Pt = a(() => {
|
|
2959
|
+
D && O && O(J ? D.filter((e) => !Mt.includes(Q(e, w))) : yn([...D, ...jt], (e) => Q(e, w)));
|
|
2970
2960
|
}, [
|
|
2971
2961
|
J,
|
|
2972
2962
|
w,
|
|
@@ -2974,7 +2964,7 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2974
2964
|
Mt,
|
|
2975
2965
|
jt,
|
|
2976
2966
|
D
|
|
2977
|
-
]), { lastSelectionChangeIndex:
|
|
2967
|
+
]), { lastSelectionChangeIndex: Y, setLastSelectionChangeIndex: Ft } = Vn(Dt), It = Ot && !bt, Lt = {
|
|
2978
2968
|
m: Ze,
|
|
2979
2969
|
my: Qe,
|
|
2980
2970
|
mx: $e,
|
|
@@ -2994,12 +2984,12 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2994
2984
|
(e) => ({
|
|
2995
2985
|
...on({
|
|
2996
2986
|
theme: e,
|
|
2997
|
-
c:
|
|
2998
|
-
backgroundColor:
|
|
2999
|
-
borderColor:
|
|
3000
|
-
rowBorderColor:
|
|
3001
|
-
stripedColor:
|
|
3002
|
-
highlightOnHoverColor:
|
|
2987
|
+
c: Re,
|
|
2988
|
+
backgroundColor: ze,
|
|
2989
|
+
borderColor: Be,
|
|
2990
|
+
rowBorderColor: Ve,
|
|
2991
|
+
stripedColor: He,
|
|
2992
|
+
highlightOnHoverColor: U
|
|
3003
2993
|
}),
|
|
3004
2994
|
borderRadius: e.radius[t] || t,
|
|
3005
2995
|
boxShadow: e.shadows[d] || d,
|
|
@@ -3012,17 +3002,17 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3012
3002
|
{ position: "relative" }
|
|
3013
3003
|
],
|
|
3014
3004
|
children: [
|
|
3015
|
-
p(
|
|
3005
|
+
p(Pr, {
|
|
3016
3006
|
viewportRef: ht,
|
|
3017
3007
|
leftShadowBehind: Ot || bt,
|
|
3018
3008
|
rightShadowBehind: xt,
|
|
3019
3009
|
onScrollPositionChange: ft,
|
|
3020
3010
|
scrollAreaProps: Je,
|
|
3021
|
-
children: p(Rt, { children: m(
|
|
3011
|
+
children: p(Rt, { children: m(ne, {
|
|
3022
3012
|
ref: mt,
|
|
3023
3013
|
horizontalSpacing: L,
|
|
3024
3014
|
className: X("mantine-datatable-table", {
|
|
3025
|
-
[
|
|
3015
|
+
[$n]: n,
|
|
3026
3016
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3027
3017
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3028
3018
|
"mantine-datatable-selection-column-visible": Ot,
|
|
@@ -3042,7 +3032,7 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3042
3032
|
Ee ? null : p(dn, {
|
|
3043
3033
|
...q,
|
|
3044
3034
|
pinnedMap: yt,
|
|
3045
|
-
children: p(
|
|
3035
|
+
children: p(Cr, {
|
|
3046
3036
|
ref: K.header,
|
|
3047
3037
|
selectionColumnHeaderRef: K.selectionColumnHeader,
|
|
3048
3038
|
className: at?.header,
|
|
@@ -3063,7 +3053,7 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3063
3053
|
...M,
|
|
3064
3054
|
...N
|
|
3065
3055
|
},
|
|
3066
|
-
selectorCellShadowVisible:
|
|
3056
|
+
selectorCellShadowVisible: It,
|
|
3067
3057
|
selectionColumnClassName: k,
|
|
3068
3058
|
selectionColumnStyle: A,
|
|
3069
3059
|
withColumnBorders: ut.withColumnBorders
|
|
@@ -3072,14 +3062,14 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3072
3062
|
p("tbody", {
|
|
3073
3063
|
ref: _t,
|
|
3074
3064
|
children: Et ? T.map((e, t) => {
|
|
3075
|
-
let n =
|
|
3065
|
+
let n = Q(e, w), r = kt?.includes(n) || !1, i;
|
|
3076
3066
|
return O && D && (i = (i) => {
|
|
3077
|
-
if (i.nativeEvent.shiftKey &&
|
|
3078
|
-
let e = T.filter(t >
|
|
3079
|
-
O(r ?
|
|
3080
|
-
} else O(r ? D.filter((e) =>
|
|
3081
|
-
|
|
3082
|
-
}), p(
|
|
3067
|
+
if (i.nativeEvent.shiftKey && Y !== null) {
|
|
3068
|
+
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));
|
|
3069
|
+
O(r ? vn(D, e, (e) => Q(e, w)) : yn([...D, ...e], (e) => Q(e, w)));
|
|
3070
|
+
} else O(r ? D.filter((e) => Q(e, w) !== n) : yn([...D, e], (e) => Q(e, w)));
|
|
3071
|
+
Ft(t);
|
|
3072
|
+
}), p(Mr, {
|
|
3083
3073
|
record: e,
|
|
3084
3074
|
index: t,
|
|
3085
3075
|
columns: pt,
|
|
@@ -3096,16 +3086,16 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3096
3086
|
onClick: De,
|
|
3097
3087
|
onDoubleClick: Oe,
|
|
3098
3088
|
onCellClick: Ae,
|
|
3099
|
-
onCellDoubleClick:
|
|
3089
|
+
onCellDoubleClick: H,
|
|
3100
3090
|
onContextMenu: ke,
|
|
3101
|
-
onCellContextMenu:
|
|
3091
|
+
onCellContextMenu: je,
|
|
3102
3092
|
expansion: vt,
|
|
3103
3093
|
color: W,
|
|
3104
|
-
backgroundColor:
|
|
3105
|
-
className:
|
|
3106
|
-
style:
|
|
3094
|
+
backgroundColor: Ue,
|
|
3095
|
+
className: Ge,
|
|
3096
|
+
style: G,
|
|
3107
3097
|
customAttributes: Ke,
|
|
3108
|
-
selectorCellShadowVisible:
|
|
3098
|
+
selectorCellShadowVisible: It,
|
|
3109
3099
|
selectionColumnClassName: k,
|
|
3110
3100
|
selectionColumnStyle: A,
|
|
3111
3101
|
idAccessor: w,
|
|
@@ -3113,7 +3103,7 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3113
3103
|
}, n);
|
|
3114
3104
|
}) : p(fn, {})
|
|
3115
3105
|
}),
|
|
3116
|
-
pt.some(({ footer: e }) => e) && p(
|
|
3106
|
+
pt.some(({ footer: e }) => e) && p(ar, {
|
|
3117
3107
|
ref: K.footer,
|
|
3118
3108
|
className: at?.footer,
|
|
3119
3109
|
style: st?.footer,
|
|
@@ -3121,38 +3111,38 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3121
3111
|
defaultColumnProps: S,
|
|
3122
3112
|
pinnedMap: yt,
|
|
3123
3113
|
selectionVisible: Ot,
|
|
3124
|
-
selectorCellShadowVisible:
|
|
3114
|
+
selectorCellShadowVisible: It
|
|
3125
3115
|
})
|
|
3126
3116
|
]
|
|
3127
3117
|
}) })
|
|
3128
3118
|
}),
|
|
3129
|
-
!!(R && Et) && p(
|
|
3119
|
+
!!(R && Et) && p(Or, {
|
|
3130
3120
|
className: at?.pagination,
|
|
3131
3121
|
style: st?.pagination,
|
|
3132
3122
|
horizontalSpacing: L,
|
|
3133
3123
|
fetching: h,
|
|
3134
3124
|
page: R,
|
|
3135
3125
|
onPageChange: Tt,
|
|
3136
|
-
totalRecords:
|
|
3137
|
-
recordsPerPage:
|
|
3138
|
-
onRecordsPerPageChange:
|
|
3139
|
-
recordsPerPageOptions:
|
|
3140
|
-
recordsPerPageLabel:
|
|
3141
|
-
paginationWithEdges:
|
|
3142
|
-
paginationWithControls:
|
|
3143
|
-
paginationActiveTextColor:
|
|
3144
|
-
paginationActiveBackgroundColor:
|
|
3145
|
-
paginationSize:
|
|
3146
|
-
paginationText:
|
|
3147
|
-
paginationWrapBreakpoint:
|
|
3148
|
-
getPaginationControlProps:
|
|
3149
|
-
getPaginationItemProps:
|
|
3126
|
+
totalRecords: B,
|
|
3127
|
+
recordsPerPage: te,
|
|
3128
|
+
onRecordsPerPageChange: re,
|
|
3129
|
+
recordsPerPageOptions: ie,
|
|
3130
|
+
recordsPerPageLabel: ae,
|
|
3131
|
+
paginationWithEdges: oe,
|
|
3132
|
+
paginationWithControls: se,
|
|
3133
|
+
paginationActiveTextColor: ce,
|
|
3134
|
+
paginationActiveBackgroundColor: V,
|
|
3135
|
+
paginationSize: le,
|
|
3136
|
+
paginationText: ue,
|
|
3137
|
+
paginationWrapBreakpoint: de,
|
|
3138
|
+
getPaginationControlProps: fe,
|
|
3139
|
+
getPaginationItemProps: pe,
|
|
3150
3140
|
noRecordsText: Se,
|
|
3151
3141
|
loadingText: be,
|
|
3152
3142
|
recordsLength: Et,
|
|
3153
|
-
renderPagination:
|
|
3143
|
+
renderPagination: me
|
|
3154
3144
|
}),
|
|
3155
|
-
p(
|
|
3145
|
+
p(wr, {
|
|
3156
3146
|
fetching: h,
|
|
3157
3147
|
backgroundBlur: he,
|
|
3158
3148
|
customContent: ge,
|
|
@@ -3172,20 +3162,20 @@ function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3172
3162
|
}
|
|
3173
3163
|
//#endregion
|
|
3174
3164
|
//#region src/DataTable/UpdateModal.tsx
|
|
3175
|
-
function
|
|
3176
|
-
let { data:
|
|
3177
|
-
return
|
|
3165
|
+
function Ir({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3166
|
+
let { data: s, isLoading: c } = Ht(i, n, a), { mutateAsync: l, isPending: u, error: d } = Kt(i, n, r);
|
|
3167
|
+
return c || !s ? /* @__PURE__ */ m(B, {
|
|
3178
3168
|
gap: "md",
|
|
3179
3169
|
children: [
|
|
3180
|
-
/* @__PURE__ */ p(
|
|
3181
|
-
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(
|
|
3170
|
+
/* @__PURE__ */ p(z, { height: 40 }),
|
|
3171
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(z, { height: 35 }, t)),
|
|
3182
3172
|
/* @__PURE__ */ m(T, {
|
|
3183
3173
|
mt: "md",
|
|
3184
3174
|
justify: "end",
|
|
3185
|
-
children: [/* @__PURE__ */ p(
|
|
3175
|
+
children: [/* @__PURE__ */ p(z, {
|
|
3186
3176
|
width: 100,
|
|
3187
3177
|
height: 36
|
|
3188
|
-
}), /* @__PURE__ */ p(
|
|
3178
|
+
}), /* @__PURE__ */ p(z, {
|
|
3189
3179
|
width: 100,
|
|
3190
3180
|
height: 36
|
|
3191
3181
|
})]
|
|
@@ -3193,15 +3183,15 @@ function Pr({ fields: e, onClose: t, queryKey: n, apiPath: r, id: i, steps: a })
|
|
|
3193
3183
|
]
|
|
3194
3184
|
}) : /* @__PURE__ */ p(nn, {
|
|
3195
3185
|
fields: e,
|
|
3196
|
-
steps:
|
|
3197
|
-
record:
|
|
3198
|
-
recordId:
|
|
3199
|
-
submitting:
|
|
3200
|
-
error:
|
|
3186
|
+
steps: o,
|
|
3187
|
+
record: s,
|
|
3188
|
+
recordId: a,
|
|
3189
|
+
submitting: u,
|
|
3190
|
+
error: d,
|
|
3201
3191
|
onPersist: async (e) => {
|
|
3202
|
-
await
|
|
3192
|
+
await l({
|
|
3203
3193
|
...e,
|
|
3204
|
-
id:
|
|
3194
|
+
id: a
|
|
3205
3195
|
});
|
|
3206
3196
|
},
|
|
3207
3197
|
onClose: t
|
|
@@ -3209,35 +3199,35 @@ function Pr({ fields: e, onClose: t, queryKey: n, apiPath: r, id: i, steps: a })
|
|
|
3209
3199
|
}
|
|
3210
3200
|
//#endregion
|
|
3211
3201
|
//#region src/DataTable/DeleteModal.tsx
|
|
3212
|
-
function
|
|
3213
|
-
let { mutateAsync:
|
|
3202
|
+
function Lr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, selectedRecords: i, confirmMessage: a }) {
|
|
3203
|
+
let { mutateAsync: o, isError: c, error: l, isPending: u } = qt(n, e, t), [h, g] = d(i), [v, b] = d(!1), x = v || u;
|
|
3214
3204
|
return s(() => {
|
|
3215
|
-
|
|
3216
|
-
}, [
|
|
3217
|
-
|
|
3205
|
+
h.length || r();
|
|
3206
|
+
}, [r, h]), h.length ? /* @__PURE__ */ m(f, { children: [
|
|
3207
|
+
c && l.message && /* @__PURE__ */ p(_, {
|
|
3218
3208
|
variant: "outline",
|
|
3219
3209
|
color: "red",
|
|
3220
|
-
title:
|
|
3221
|
-
children:
|
|
3210
|
+
title: l.name,
|
|
3211
|
+
children: l.message
|
|
3222
3212
|
}),
|
|
3223
|
-
/* @__PURE__ */ p(
|
|
3213
|
+
/* @__PURE__ */ p(V, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3224
3214
|
/* @__PURE__ */ m(T, {
|
|
3225
3215
|
mt: "md",
|
|
3226
3216
|
justify: "end",
|
|
3227
3217
|
children: [/* @__PURE__ */ p(y, {
|
|
3228
|
-
onClick:
|
|
3218
|
+
onClick: r,
|
|
3229
3219
|
variant: "outline",
|
|
3230
|
-
disabled:
|
|
3220
|
+
disabled: x,
|
|
3231
3221
|
children: "Abbrechen"
|
|
3232
3222
|
}), /* @__PURE__ */ p(y, {
|
|
3233
3223
|
color: "red",
|
|
3234
|
-
loading:
|
|
3224
|
+
loading: x,
|
|
3235
3225
|
onClick: async () => {
|
|
3236
|
-
|
|
3226
|
+
b(!0);
|
|
3237
3227
|
try {
|
|
3238
|
-
await Promise.all(
|
|
3228
|
+
await Promise.all(h.map((e) => o(e.id))), g([]);
|
|
3239
3229
|
} finally {
|
|
3240
|
-
|
|
3230
|
+
b(!1);
|
|
3241
3231
|
}
|
|
3242
3232
|
},
|
|
3243
3233
|
children: "Löschen"
|
|
@@ -3247,7 +3237,7 @@ function Fr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMe
|
|
|
3247
3237
|
}
|
|
3248
3238
|
//#endregion
|
|
3249
3239
|
//#region src/Hooks/usePersistentState.ts
|
|
3250
|
-
function
|
|
3240
|
+
function Rr(e, t) {
|
|
3251
3241
|
let n = `use_persistent_storage_${t}`, [r, i] = d(() => {
|
|
3252
3242
|
try {
|
|
3253
3243
|
let t = localStorage.getItem(n);
|
|
@@ -3265,12 +3255,12 @@ function Ir(e, t) {
|
|
|
3265
3255
|
}
|
|
3266
3256
|
//#endregion
|
|
3267
3257
|
//#region src/utils/sort.ts
|
|
3268
|
-
var
|
|
3258
|
+
var zr = [
|
|
3269
3259
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
3270
3260
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
3271
3261
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
3272
3262
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
3273
|
-
],
|
|
3263
|
+
], Br = (e, t) => {
|
|
3274
3264
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
3275
3265
|
if (n.length === 0) return "string";
|
|
3276
3266
|
let r = n.slice(0, 100), i = {
|
|
@@ -3286,7 +3276,7 @@ var Lr = [
|
|
|
3286
3276
|
i.number++;
|
|
3287
3277
|
return;
|
|
3288
3278
|
}
|
|
3289
|
-
if (
|
|
3279
|
+
if (zr.some((e) => e.test(t))) {
|
|
3290
3280
|
let e = new Date(t);
|
|
3291
3281
|
if (!isNaN(e.getTime())) {
|
|
3292
3282
|
i.date++;
|
|
@@ -3299,7 +3289,7 @@ var Lr = [
|
|
|
3299
3289
|
let a = i.string + i.number + i.date;
|
|
3300
3290
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
3301
3291
|
};
|
|
3302
|
-
function
|
|
3292
|
+
function Vr(e, t) {
|
|
3303
3293
|
switch (t) {
|
|
3304
3294
|
case "date":
|
|
3305
3295
|
if (typeof e == "string") {
|
|
@@ -3315,54 +3305,54 @@ function zr(e, t) {
|
|
|
3315
3305
|
default: return String(e).toLowerCase().trim();
|
|
3316
3306
|
}
|
|
3317
3307
|
}
|
|
3318
|
-
var
|
|
3308
|
+
var Hr = (e, t, n = "asc") => {
|
|
3319
3309
|
if (!e || e.length === 0) return [];
|
|
3320
|
-
let r =
|
|
3310
|
+
let r = Br(e, t);
|
|
3321
3311
|
return [...e].sort((e, i) => {
|
|
3322
3312
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
3323
3313
|
if (s && c) return 0;
|
|
3324
3314
|
if (s) return n === "asc" ? -1 : 1;
|
|
3325
3315
|
if (c) return n === "asc" ? 1 : -1;
|
|
3326
|
-
let l =
|
|
3316
|
+
let l = Vr(a, r), u = Vr(o, r);
|
|
3327
3317
|
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;
|
|
3328
3318
|
});
|
|
3329
3319
|
};
|
|
3330
3320
|
//#endregion
|
|
3331
3321
|
//#region src/utils/filter.ts
|
|
3332
|
-
function
|
|
3322
|
+
function Ur(e) {
|
|
3333
3323
|
return !!e && typeof e == "object" && "id" in e;
|
|
3334
3324
|
}
|
|
3335
|
-
function
|
|
3325
|
+
function Wr(e, t) {
|
|
3336
3326
|
if (typeof e == "string" || typeof e == "number") return t.includes(String(e));
|
|
3337
3327
|
if (e && typeof e == "object") {
|
|
3338
3328
|
let n = e;
|
|
3339
|
-
return
|
|
3329
|
+
return Ur(n) && t.includes(n.id) ? !0 : Object.values(n).some((e) => typeof e == "string" && t.includes(e) || Ur(e) && t.includes(e.id));
|
|
3340
3330
|
}
|
|
3341
3331
|
return !1;
|
|
3342
3332
|
}
|
|
3343
|
-
function
|
|
3344
|
-
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) =>
|
|
3333
|
+
function Gr(e, t) {
|
|
3334
|
+
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) => Wr(e, t)) : Ur(e) ? t.includes(e.id) : !1 : typeof e == "string" && e.includes(t);
|
|
3345
3335
|
}
|
|
3346
|
-
function
|
|
3336
|
+
function Kr(e, [t, n]) {
|
|
3347
3337
|
if (!t && !n || typeof e != "string") return !0;
|
|
3348
3338
|
let r = e.split(" ")[0];
|
|
3349
3339
|
return t && n ? r >= t && r <= n : t ? r >= t : r <= n;
|
|
3350
3340
|
}
|
|
3351
|
-
function
|
|
3341
|
+
function qr(e, t) {
|
|
3352
3342
|
if (t.value === void 0) return !0;
|
|
3353
3343
|
let n = e[t.id];
|
|
3354
3344
|
switch (t.type) {
|
|
3355
|
-
case "query": return
|
|
3356
|
-
case "date": return
|
|
3345
|
+
case "query": return Gr(n, t.value);
|
|
3346
|
+
case "date": return Kr(n, t.value);
|
|
3357
3347
|
case "boolean": return n === t.value;
|
|
3358
3348
|
}
|
|
3359
3349
|
}
|
|
3360
|
-
function
|
|
3361
|
-
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) =>
|
|
3350
|
+
function Jr(e, t) {
|
|
3351
|
+
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => qr(e, t)));
|
|
3362
3352
|
}
|
|
3363
3353
|
//#endregion
|
|
3364
3354
|
//#region src/DataTable/FieldCard.tsx
|
|
3365
|
-
function
|
|
3355
|
+
function Yr({ rows: e }) {
|
|
3366
3356
|
return /* @__PURE__ */ p(f, { children: e.map((e, t) => /* @__PURE__ */ m(v, { children: [t > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ m(T, {
|
|
3367
3357
|
wrap: "nowrap",
|
|
3368
3358
|
justify: "space-between",
|
|
@@ -3370,7 +3360,7 @@ function qr({ rows: e }) {
|
|
|
3370
3360
|
gap: "md",
|
|
3371
3361
|
py: "xs",
|
|
3372
3362
|
px: "sm",
|
|
3373
|
-
children: [/* @__PURE__ */ p(
|
|
3363
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3374
3364
|
fw: 700,
|
|
3375
3365
|
fz: "sm",
|
|
3376
3366
|
style: { flexShrink: 0 },
|
|
@@ -3383,39 +3373,39 @@ function qr({ rows: e }) {
|
|
|
3383
3373
|
})]
|
|
3384
3374
|
})] }, typeof e.label == "string" ? e.label : t)) });
|
|
3385
3375
|
}
|
|
3386
|
-
function
|
|
3376
|
+
function Xr({ rows: e }) {
|
|
3387
3377
|
return /* @__PURE__ */ p(v, {
|
|
3388
3378
|
bg: "var(--mantine-color-gray-light)",
|
|
3389
3379
|
style: {
|
|
3390
3380
|
borderRadius: "var(--mantine-radius-md)",
|
|
3391
3381
|
overflow: "hidden"
|
|
3392
3382
|
},
|
|
3393
|
-
children: /* @__PURE__ */ p(
|
|
3383
|
+
children: /* @__PURE__ */ p(Yr, { rows: e })
|
|
3394
3384
|
});
|
|
3395
3385
|
}
|
|
3396
3386
|
//#endregion
|
|
3397
3387
|
//#region src/DataTable/MobileCardList.tsx
|
|
3398
|
-
function
|
|
3388
|
+
function Zr(e, t) {
|
|
3399
3389
|
return t.split(".").reduce((e, t) => {
|
|
3400
3390
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
3401
3391
|
}, e);
|
|
3402
3392
|
}
|
|
3403
|
-
function
|
|
3393
|
+
function Qr(e, t) {
|
|
3404
3394
|
let n = t.column;
|
|
3405
3395
|
if (n.render) return n.render(e, 0);
|
|
3406
|
-
let r =
|
|
3407
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3396
|
+
let r = Zr(e, n.accessor ?? t.id);
|
|
3397
|
+
return r == null ? /* @__PURE__ */ p(V, {
|
|
3408
3398
|
c: "dimmed",
|
|
3409
3399
|
children: "–"
|
|
3410
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3400
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(V, {
|
|
3411
3401
|
fz: "sm",
|
|
3412
3402
|
children: r ? "Ja" : "Nein"
|
|
3413
|
-
}) : /* @__PURE__ */ p(
|
|
3403
|
+
}) : /* @__PURE__ */ p(V, {
|
|
3414
3404
|
fz: "sm",
|
|
3415
3405
|
children: String(r)
|
|
3416
3406
|
});
|
|
3417
3407
|
}
|
|
3418
|
-
function
|
|
3408
|
+
function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3419
3409
|
let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
|
|
3420
3410
|
if (y) {
|
|
3421
3411
|
let { recordIds: t, onRecordIdsChange: n } = y;
|
|
@@ -3437,7 +3427,7 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3437
3427
|
event: n
|
|
3438
3428
|
});
|
|
3439
3429
|
};
|
|
3440
|
-
return /* @__PURE__ */ m(
|
|
3430
|
+
return /* @__PURE__ */ m(B, {
|
|
3441
3431
|
gap: "sm",
|
|
3442
3432
|
my: "md",
|
|
3443
3433
|
children: [
|
|
@@ -3488,7 +3478,7 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3488
3478
|
value: e.id,
|
|
3489
3479
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3490
3480
|
gap: "xs",
|
|
3491
|
-
children: [/* @__PURE__ */ p(
|
|
3481
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3492
3482
|
fw: 600,
|
|
3493
3483
|
fz: "sm",
|
|
3494
3484
|
children: e.column.title ?? e.id
|
|
@@ -3504,7 +3494,7 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3504
3494
|
})]
|
|
3505
3495
|
})]
|
|
3506
3496
|
}),
|
|
3507
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3497
|
+
e.length === 0 && /* @__PURE__ */ p(V, {
|
|
3508
3498
|
c: "dimmed",
|
|
3509
3499
|
ta: "center",
|
|
3510
3500
|
py: "xl",
|
|
@@ -3549,9 +3539,9 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3549
3539
|
}, `card_action_${n}`)) })]
|
|
3550
3540
|
});
|
|
3551
3541
|
})()
|
|
3552
|
-
}), /* @__PURE__ */ p(
|
|
3542
|
+
}), /* @__PURE__ */ p(Yr, { rows: w.map((t) => ({
|
|
3553
3543
|
label: t.column.title ?? t.id,
|
|
3554
|
-
value:
|
|
3544
|
+
value: Qr(e, t)
|
|
3555
3545
|
})) })]
|
|
3556
3546
|
}), c && /* @__PURE__ */ m(S, {
|
|
3557
3547
|
expanded: u,
|
|
@@ -3563,7 +3553,7 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3563
3553
|
})]
|
|
3564
3554
|
}) }, s);
|
|
3565
3555
|
}),
|
|
3566
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3556
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(B, {
|
|
3567
3557
|
gap: "xs",
|
|
3568
3558
|
mt: "sm",
|
|
3569
3559
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3577,7 +3567,7 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3577
3567
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3578
3568
|
justify: "center",
|
|
3579
3569
|
gap: "xs",
|
|
3580
|
-
children: [/* @__PURE__ */ p(
|
|
3570
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3581
3571
|
fz: "xs",
|
|
3582
3572
|
c: "dimmed",
|
|
3583
3573
|
children: "Einträge pro Seite:"
|
|
@@ -3599,33 +3589,25 @@ function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3599
3589
|
}
|
|
3600
3590
|
//#endregion
|
|
3601
3591
|
//#region src/DataTable/DataTable.tsx
|
|
3602
|
-
var
|
|
3592
|
+
var ei = [
|
|
3603
3593
|
10,
|
|
3604
3594
|
15,
|
|
3605
3595
|
50,
|
|
3606
3596
|
100,
|
|
3607
3597
|
500
|
|
3608
3598
|
];
|
|
3609
|
-
function
|
|
3610
|
-
let [
|
|
3611
|
-
j === void 0 &&
|
|
3612
|
-
},
|
|
3599
|
+
function ti({ 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: te, editRecordId: ne, onEditRecordIdChange: re }) {
|
|
3600
|
+
let [ie, ae] = d(A || (k && k.length > 0 ? k[0].value : null)), oe = j === void 0 ? ie : j, se = (e) => {
|
|
3601
|
+
j === void 0 && ae(e), N && N(e);
|
|
3602
|
+
}, V = k?.find((e) => e.value === oe), le = V?.queryParams || {}, ue = V?.apiPath ?? r, fe = V?.mutationApiPath ?? a ?? ue, pe = {
|
|
3613
3603
|
...D,
|
|
3614
|
-
...
|
|
3615
|
-
},
|
|
3616
|
-
s(() => {
|
|
3617
|
-
!ge || !Array.isArray(ge) || n?.forEach((e) => Ee.invalidateQueries({ queryKey: e }));
|
|
3618
|
-
}, [
|
|
3619
|
-
ge,
|
|
3620
|
-
n,
|
|
3621
|
-
Ee
|
|
3622
|
-
]);
|
|
3623
|
-
let De = Kr(Array.isArray(ge) ? ge : [], h), [ke, Ae] = d({
|
|
3604
|
+
...le
|
|
3605
|
+
}, me = pe ? "?" + Object.entries(pe).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", he = oe ? [...t, oe] : t, { data: ge, isLoading: _e, isError: ve, isRefetching: xe, refetch: Se } = Ut(ue + me, he), Ee = Jr(Array.isArray(ge) ? ge : [], h), [De, ke] = d({
|
|
3624
3606
|
columnAccessor: S?.field ?? c[0].id,
|
|
3625
3607
|
direction: S?.direction ?? "desc"
|
|
3626
|
-
}),
|
|
3627
|
-
|
|
3628
|
-
}, H =
|
|
3608
|
+
}), Ae = (e) => {
|
|
3609
|
+
ke(e), C && C(String(e.columnAccessor), e.direction);
|
|
3610
|
+
}, H = Hr(Ee, De.columnAccessor, De.direction), [je, Me] = Rr(ei[1], "mantine-table-page-size"), [Ne, Pe] = d(1), Fe = u ? H.slice((Ne - 1) * je, Ne * je) : H, [Ie, Le] = d([]), Re = I?.expanded?.recordIds ?? Ie, ze = I?.expanded?.onRecordIdsChange ?? Le, Be = (e) => {
|
|
3629
3611
|
Re.includes(e) ? ze(Re.filter((t) => t !== e)) : ze(I?.allowMultiple ? [...Re, e] : [e]);
|
|
3630
3612
|
}, Ve = c.findIndex((e) => e.list && e.column && !e.column.hidden), He = I && Ve >= 0 ? c.map((e, t) => {
|
|
3631
3613
|
if (t !== Ve) return e;
|
|
@@ -3660,33 +3642,33 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3660
3642
|
}) : /* @__PURE__ */ p(v, {
|
|
3661
3643
|
w: 16,
|
|
3662
3644
|
style: { flexShrink: 0 }
|
|
3663
|
-
}), n ? n(t, r) : String(
|
|
3645
|
+
}), n ? n(t, r) : String(bn(t, e.column.accessor) ?? "")]
|
|
3664
3646
|
})
|
|
3665
3647
|
}
|
|
3666
3648
|
};
|
|
3667
|
-
}) : c, [
|
|
3649
|
+
}) : c, [U, W] = d([]);
|
|
3668
3650
|
s(() => {
|
|
3669
|
-
|
|
3670
|
-
}, [
|
|
3671
|
-
let [Ue, We] = d(!1), [Ge,
|
|
3651
|
+
W([]);
|
|
3652
|
+
}, [oe]);
|
|
3653
|
+
let [Ue, We] = d(!1), [Ge, G] = d(!1), [Ke, qe] = d(!1);
|
|
3672
3654
|
s(() => {
|
|
3673
|
-
if (
|
|
3674
|
-
let e = H.find((e) => e.id ===
|
|
3675
|
-
e && (
|
|
3655
|
+
if (ne && H.length > 0) {
|
|
3656
|
+
let e = H.find((e) => e.id === ne);
|
|
3657
|
+
e && (W([e]), G(!0), re?.(null));
|
|
3676
3658
|
}
|
|
3677
|
-
}, [
|
|
3678
|
-
let
|
|
3679
|
-
return
|
|
3659
|
+
}, [ne, H]);
|
|
3660
|
+
let Je = c.some((e) => e.update), Ye = c.some((e) => e.delete), Xe = [];
|
|
3661
|
+
return Je && Xe.push({
|
|
3680
3662
|
icon: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3681
3663
|
label: "Bearbeiten",
|
|
3682
3664
|
onClick: (e) => {
|
|
3683
|
-
|
|
3665
|
+
W(e), G(!0);
|
|
3684
3666
|
}
|
|
3685
|
-
}), b &&
|
|
3667
|
+
}), b && Xe.push(...b), Ye && Xe.push({
|
|
3686
3668
|
icon: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3687
3669
|
label: "Löschen",
|
|
3688
3670
|
onClick: (e) => {
|
|
3689
|
-
|
|
3671
|
+
W(e), qe(!0);
|
|
3690
3672
|
}
|
|
3691
3673
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3692
3674
|
/* @__PURE__ */ m(w, {
|
|
@@ -3701,7 +3683,7 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3701
3683
|
},
|
|
3702
3684
|
justify: e ? "space-between" : "flex-end",
|
|
3703
3685
|
wrap: "wrap",
|
|
3704
|
-
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(
|
|
3686
|
+
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(de, {
|
|
3705
3687
|
order: 4,
|
|
3706
3688
|
children: e
|
|
3707
3689
|
}) : e), /* @__PURE__ */ m(w, {
|
|
@@ -3731,7 +3713,7 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3731
3713
|
children: /* @__PURE__ */ p(Te, {})
|
|
3732
3714
|
}),
|
|
3733
3715
|
(c.some((e) => e.update) || l) && (() => {
|
|
3734
|
-
let e = c.find((e) => e.update) && (!P ||
|
|
3716
|
+
let e = c.find((e) => e.update) && (!P || U.length > 0 && P(U[0])), t = c.find((e) => e.delete) && (!F || U.length > 0 && F(U[0])), n = (b ?? []).length > 0, r = e || t || n;
|
|
3735
3717
|
return /* @__PURE__ */ p(v, {
|
|
3736
3718
|
...R ? { visibleFrom: "sm" } : {},
|
|
3737
3719
|
children: /* @__PURE__ */ m(O, {
|
|
@@ -3739,24 +3721,24 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3739
3721
|
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(y, {
|
|
3740
3722
|
variant: "outline",
|
|
3741
3723
|
rightSection: /* @__PURE__ */ p(ye, { size: 14 }),
|
|
3742
|
-
disabled: !
|
|
3724
|
+
disabled: !U.length || !r,
|
|
3743
3725
|
children: "Aktionen"
|
|
3744
3726
|
}) }), /* @__PURE__ */ m(O.Dropdown, { children: [
|
|
3745
3727
|
e && /* @__PURE__ */ p(O.Item, {
|
|
3746
3728
|
leftSection: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3747
|
-
onClick: () =>
|
|
3748
|
-
disabled:
|
|
3729
|
+
onClick: () => G(!0),
|
|
3730
|
+
disabled: U.length !== 1,
|
|
3749
3731
|
children: "Bearbeiten"
|
|
3750
3732
|
}),
|
|
3751
3733
|
(b ?? []).map((e, t) => /* @__PURE__ */ i(O.Item, {
|
|
3752
3734
|
...e.icon && { leftSection: e.icon },
|
|
3753
3735
|
key: `custom_action_${t}`,
|
|
3754
|
-
onClick: () => e.onClick(
|
|
3755
|
-
disabled: e.disabled?.(
|
|
3736
|
+
onClick: () => e.onClick(U),
|
|
3737
|
+
disabled: e.disabled?.(U) ?? !1
|
|
3756
3738
|
}, e.label)),
|
|
3757
3739
|
t && /* @__PURE__ */ p(O.Item, {
|
|
3758
3740
|
leftSection: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3759
|
-
onClick: () =>
|
|
3741
|
+
onClick: () => qe(!0),
|
|
3760
3742
|
color: "red",
|
|
3761
3743
|
children: "Löschen"
|
|
3762
3744
|
})
|
|
@@ -3773,11 +3755,11 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3773
3755
|
]
|
|
3774
3756
|
})]
|
|
3775
3757
|
}),
|
|
3776
|
-
k && k.length > 0 && /* @__PURE__ */ p(
|
|
3777
|
-
value:
|
|
3778
|
-
onChange:
|
|
3758
|
+
k && k.length > 0 && /* @__PURE__ */ p(ce, {
|
|
3759
|
+
value: oe,
|
|
3760
|
+
onChange: se,
|
|
3779
3761
|
mt: "md",
|
|
3780
|
-
children: /* @__PURE__ */ p(
|
|
3762
|
+
children: /* @__PURE__ */ p(ce.List, { children: k.map((e) => /* @__PURE__ */ p(ce.Tab, {
|
|
3781
3763
|
value: e.value,
|
|
3782
3764
|
leftSection: e.icon,
|
|
3783
3765
|
children: e.label
|
|
@@ -3791,38 +3773,38 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3791
3773
|
icon: /* @__PURE__ */ p(Ce, {}),
|
|
3792
3774
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3793
3775
|
}),
|
|
3794
|
-
(_e || xe) && /* @__PURE__ */ m(
|
|
3776
|
+
(_e || xe) && /* @__PURE__ */ m(B, {
|
|
3795
3777
|
my: "md",
|
|
3796
|
-
children: [/* @__PURE__ */ p(
|
|
3778
|
+
children: [/* @__PURE__ */ p(z, { height: 40 }), [
|
|
3797
3779
|
,
|
|
3798
3780
|
,
|
|
3799
3781
|
,
|
|
3800
3782
|
,
|
|
3801
3783
|
,
|
|
3802
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3784
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(z, { height: 35 }, `skeleton-${t}`))]
|
|
3803
3785
|
}),
|
|
3804
3786
|
!_e && !xe && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3805
3787
|
...R ? { visibleFrom: "sm" } : {},
|
|
3806
|
-
children: /* @__PURE__ */ p(
|
|
3788
|
+
children: /* @__PURE__ */ p(Fr, {
|
|
3807
3789
|
my: "md",
|
|
3808
3790
|
striped: !0,
|
|
3809
3791
|
highlightOnHover: !0,
|
|
3810
3792
|
minHeight: 150,
|
|
3811
3793
|
fetching: ve,
|
|
3812
3794
|
records: Fe,
|
|
3813
|
-
sortStatus:
|
|
3814
|
-
onSortStatusChange:
|
|
3795
|
+
sortStatus: De,
|
|
3796
|
+
onSortStatusChange: Ae,
|
|
3815
3797
|
...l && {
|
|
3816
|
-
selectedRecords:
|
|
3817
|
-
onSelectedRecordsChange:
|
|
3798
|
+
selectedRecords: U,
|
|
3799
|
+
onSelectedRecordsChange: W
|
|
3818
3800
|
},
|
|
3819
3801
|
...u && Fe.length && {
|
|
3820
3802
|
totalRecords: H.length,
|
|
3821
|
-
recordsPerPage:
|
|
3803
|
+
recordsPerPage: je,
|
|
3822
3804
|
onPageChange: Pe,
|
|
3823
|
-
page:
|
|
3824
|
-
recordsPerPageOptions:
|
|
3825
|
-
onRecordsPerPageChange:
|
|
3805
|
+
page: Ne,
|
|
3806
|
+
recordsPerPageOptions: ei,
|
|
3807
|
+
onRecordsPerPageChange: Me,
|
|
3826
3808
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3827
3809
|
},
|
|
3828
3810
|
...I && { rowExpansion: {
|
|
@@ -3842,15 +3824,15 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3842
3824
|
})
|
|
3843
3825
|
}), R && /* @__PURE__ */ p(v, {
|
|
3844
3826
|
hiddenFrom: "sm",
|
|
3845
|
-
children: /* @__PURE__ */ p(
|
|
3827
|
+
children: /* @__PURE__ */ p($r, {
|
|
3846
3828
|
records: Fe,
|
|
3847
3829
|
fields: He,
|
|
3848
3830
|
onRowClick: L,
|
|
3849
3831
|
sort: {
|
|
3850
|
-
field: String(
|
|
3851
|
-
direction:
|
|
3832
|
+
field: String(De.columnAccessor),
|
|
3833
|
+
direction: De.direction,
|
|
3852
3834
|
onSortChange: (e, t) => {
|
|
3853
|
-
|
|
3835
|
+
Ae({
|
|
3854
3836
|
columnAccessor: e,
|
|
3855
3837
|
direction: t
|
|
3856
3838
|
});
|
|
@@ -3858,12 +3840,12 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3858
3840
|
},
|
|
3859
3841
|
...u && Fe.length && { pagination: {
|
|
3860
3842
|
totalRecords: H.length,
|
|
3861
|
-
recordsPerPage:
|
|
3862
|
-
page:
|
|
3843
|
+
recordsPerPage: je,
|
|
3844
|
+
page: Ne,
|
|
3863
3845
|
onPageChange: Pe,
|
|
3864
|
-
recordsPerPageOptions:
|
|
3846
|
+
recordsPerPageOptions: ei,
|
|
3865
3847
|
onRecordsPerPageChange: (e) => {
|
|
3866
|
-
|
|
3848
|
+
Me(e), Pe(1);
|
|
3867
3849
|
}
|
|
3868
3850
|
} },
|
|
3869
3851
|
...I && { rowExpansion: {
|
|
@@ -3874,8 +3856,8 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3874
3856
|
},
|
|
3875
3857
|
...I.expandable && { expandable: I.expandable }
|
|
3876
3858
|
} },
|
|
3877
|
-
...
|
|
3878
|
-
actions:
|
|
3859
|
+
...Xe.length > 0 && {
|
|
3860
|
+
actions: Xe,
|
|
3879
3861
|
canUpdate: P,
|
|
3880
3862
|
canDelete: F
|
|
3881
3863
|
}
|
|
@@ -3884,34 +3866,36 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3884
3866
|
/* @__PURE__ */ p(M, {
|
|
3885
3867
|
opened: Ge,
|
|
3886
3868
|
onClose: () => {
|
|
3887
|
-
|
|
3869
|
+
G(!1), W([]);
|
|
3888
3870
|
},
|
|
3889
3871
|
title: e ?? "Bearbeiten",
|
|
3890
|
-
children:
|
|
3872
|
+
children: U.length > 0 && /* @__PURE__ */ p(Ir, {
|
|
3891
3873
|
fields: c.filter((e) => e.update),
|
|
3892
3874
|
queryKey: t,
|
|
3893
|
-
|
|
3894
|
-
|
|
3875
|
+
connectedQueryKeys: n,
|
|
3876
|
+
apiPath: fe,
|
|
3877
|
+
id: U[0].id,
|
|
3895
3878
|
onClose: () => {
|
|
3896
|
-
|
|
3879
|
+
G(!1), W([]);
|
|
3897
3880
|
},
|
|
3898
3881
|
steps: x
|
|
3899
3882
|
})
|
|
3900
3883
|
}),
|
|
3901
|
-
|
|
3902
|
-
opened:
|
|
3884
|
+
U.length > 0 && /* @__PURE__ */ p(M, {
|
|
3885
|
+
opened: Ke,
|
|
3903
3886
|
onClose: () => {
|
|
3904
|
-
|
|
3887
|
+
qe(!1), W([]);
|
|
3905
3888
|
},
|
|
3906
3889
|
title: e ?? "Löschen",
|
|
3907
|
-
children: /* @__PURE__ */ p(
|
|
3890
|
+
children: /* @__PURE__ */ p(Lr, {
|
|
3908
3891
|
onClose: () => {
|
|
3909
|
-
|
|
3892
|
+
qe(!1), W([]);
|
|
3910
3893
|
},
|
|
3911
3894
|
queryKey: t,
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3895
|
+
connectedQueryKeys: n,
|
|
3896
|
+
apiPath: fe,
|
|
3897
|
+
selectedRecords: U,
|
|
3898
|
+
confirmMessage: te
|
|
3915
3899
|
})
|
|
3916
3900
|
}),
|
|
3917
3901
|
/* @__PURE__ */ p(M, {
|
|
@@ -3922,7 +3906,8 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3922
3906
|
title: e ?? "Anlegen",
|
|
3923
3907
|
children: /* @__PURE__ */ p(rn, {
|
|
3924
3908
|
queryKey: t,
|
|
3925
|
-
|
|
3909
|
+
connectedQueryKeys: n,
|
|
3910
|
+
apiPath: fe,
|
|
3926
3911
|
onClose: () => {
|
|
3927
3912
|
We(!1);
|
|
3928
3913
|
},
|
|
@@ -3934,23 +3919,23 @@ function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3934
3919
|
}
|
|
3935
3920
|
//#endregion
|
|
3936
3921
|
//#region src/DataTable/SubTable.tsx
|
|
3937
|
-
function
|
|
3938
|
-
return e ? /* @__PURE__ */ p(
|
|
3922
|
+
function ni({ mobile: e, columns: t, ...n }) {
|
|
3923
|
+
return e ? /* @__PURE__ */ p(B, {
|
|
3939
3924
|
gap: "sm",
|
|
3940
3925
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
3941
3926
|
children: (n.records ?? []).map((e, r) => {
|
|
3942
3927
|
let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
|
|
3943
|
-
label: t.title ??
|
|
3944
|
-
value: t.render ? t.render(e, r) :
|
|
3945
|
-
})), a = n.idAccessor ?
|
|
3946
|
-
return /* @__PURE__ */ p(
|
|
3928
|
+
label: t.title ?? hn(String(t.accessor)),
|
|
3929
|
+
value: t.render ? t.render(e, r) : bn(e, t.accessor)
|
|
3930
|
+
})), a = n.idAccessor ? Q(e, n.idAccessor) : r;
|
|
3931
|
+
return /* @__PURE__ */ p(Xr, { rows: i }, a);
|
|
3947
3932
|
})
|
|
3948
|
-
}) : /* @__PURE__ */ p(
|
|
3933
|
+
}) : /* @__PURE__ */ p(Fr, {
|
|
3949
3934
|
columns: t,
|
|
3950
3935
|
...n
|
|
3951
3936
|
});
|
|
3952
3937
|
}
|
|
3953
3938
|
//#endregion
|
|
3954
|
-
export { rn as CreateModal,
|
|
3939
|
+
export { rn as CreateModal, ti as DataTable, Mt as DataTableProvider, Lr as DeleteModal, Xr as FieldCard, $r as MobileCardList, ni as SubTable, Ir as UpdateModal, Bt as api, zt as createOne, Rt as deleteOne, It as getAll, Lt as getOne, Hr as sortData, Vt as updateOne, Gt as useAddOne, J as useDataTable, qt as useDeleteOne, Ut as useGetAll, Ht as useGetOne, Rr as usePersistentState, Kt as useUpdateOne };
|
|
3955
3940
|
|
|
3956
3941
|
//# sourceMappingURL=index.es.js.map
|