@espresso-lab/mantine-data-table 2.1.11 → 2.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTableInner.d.ts +1 -1
- package/dist/DataTable/MobileCardList.d.ts +6 -5
- package/dist/Hooks/useApi.d.ts +2 -2
- package/dist/index.es.js +845 -819
- 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 +14 -14
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 {
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { DateInput as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as P, Popover as F, PopoverDropdown as I, PopoverTarget as ee, ScrollArea as L, Select as R, Skeleton as te, Stack as ne, Stepper as re, Table as ie, TableTd as ae, TableTfoot as oe, TableTh as z, TableThead as se, TableTr as B, 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
|
+
import { useForm as _e } from "@mantine/form";
|
|
6
|
+
import { DateInput as ve } from "@mantine/dates";
|
|
7
|
+
import { IconCaretDownFilled as ye, IconDotsVertical as be, IconFilter as xe, IconInfoCircle as Se, IconPencil as Ce, IconRefresh as we, IconSortAscending as Te, IconSortDescending as Ee, IconTrash as De } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as Oe, useDisclosure as ke, useLocalStorage as H, useMediaQuery as Ae, useMergedRef as je, useTimeout as Me } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var Ne = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var je = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
},
|
|
24
|
+
}, Pe = new class extends Ne {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var je = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), U = {
|
|
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
|
+
}, W = new class {
|
|
67
|
+
#e = U;
|
|
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,17 +85,17 @@ var je = class {
|
|
|
85
85
|
this.#e.clearInterval(e);
|
|
86
86
|
}
|
|
87
87
|
}();
|
|
88
|
-
function
|
|
88
|
+
function Fe(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 Ie = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function Le() {}
|
|
95
|
+
function Re(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function ze(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
101
|
function G(e, t) {
|
|
@@ -104,68 +104,68 @@ function G(e, t) {
|
|
|
104
104
|
function K(e, t) {
|
|
105
105
|
return typeof e == "function" ? e(t) : e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function Be(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Ge(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var Ve = Object.prototype.hasOwnProperty;
|
|
111
|
+
function He(e, t, n = 0) {
|
|
112
112
|
if (e === t) return e;
|
|
113
113
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
114
|
+
let r = We(e) && We(t);
|
|
115
|
+
if (!r && !(Ge(e) && Ge(t))) return t;
|
|
116
116
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
117
117
|
for (let l = 0; l < o; l++) {
|
|
118
118
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
119
119
|
if (u === d) {
|
|
120
|
-
s[o] = u, (r ? l < i :
|
|
120
|
+
s[o] = u, (r ? l < i : Ve.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 = He(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 Ue(e, t) {
|
|
133
133
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
134
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
135
|
return !0;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function We(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function Ge(e) {
|
|
141
|
+
if (!Ke(e)) return !1;
|
|
142
142
|
let t = e.constructor;
|
|
143
143
|
if (t === void 0) return !0;
|
|
144
144
|
let n = t.prototype;
|
|
145
|
-
return !(!
|
|
145
|
+
return !(!Ke(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Ke(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function qe(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 He(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 He(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Je(e, t) {
|
|
163
163
|
return typeof e == "function" ? e(...t) : !!e;
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
167
|
-
var
|
|
168
|
-
let e = () =>
|
|
167
|
+
var Ye = /* @__PURE__ */ (() => {
|
|
168
|
+
let e = () => Ie;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
171
171
|
return e();
|
|
@@ -177,7 +177,7 @@ var Ke = /* @__PURE__ */ (() => {
|
|
|
177
177
|
})();
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
-
function
|
|
180
|
+
function Xe() {
|
|
181
181
|
let e, t, n = new Promise((n, r) => {
|
|
182
182
|
e = n, t = r;
|
|
183
183
|
});
|
|
@@ -199,13 +199,13 @@ function qe() {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var Ze = Fe;
|
|
203
|
+
function Qe() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
206
206
|
}, r = (e) => {
|
|
207
207
|
e();
|
|
208
|
-
}, i =
|
|
208
|
+
}, i = Ze, a = (r) => {
|
|
209
209
|
t ? e.push(r) : i(() => {
|
|
210
210
|
n(r);
|
|
211
211
|
});
|
|
@@ -247,7 +247,7 @@ function Ye() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var $e = Qe(), et = new class extends Ne {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -281,16 +281,16 @@ var Xe = Ye(), Ze = new class extends je {
|
|
|
281
281
|
}();
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
284
|
-
function
|
|
285
|
-
return (e ?? "online") === "online" ?
|
|
284
|
+
function tt(e) {
|
|
285
|
+
return (e ?? "online") === "online" ? et.isOnline() : !0;
|
|
286
286
|
}
|
|
287
287
|
//#endregion
|
|
288
288
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
289
|
+
function nt(e, t) {
|
|
290
290
|
return {
|
|
291
291
|
fetchFailureCount: 0,
|
|
292
292
|
fetchFailureReason: null,
|
|
293
|
-
fetchStatus:
|
|
293
|
+
fetchStatus: tt(t.networkMode) ? "fetching" : "paused",
|
|
294
294
|
...e === void 0 && {
|
|
295
295
|
error: null,
|
|
296
296
|
status: "pending"
|
|
@@ -299,9 +299,9 @@ function $e(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
302
|
+
var rt = class extends Ne {
|
|
303
303
|
constructor(e, t) {
|
|
304
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
304
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Xe(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
306
306
|
#e;
|
|
307
307
|
#t = void 0;
|
|
@@ -322,16 +322,16 @@ var et = class extends je {
|
|
|
322
322
|
this.refetch = this.refetch.bind(this);
|
|
323
323
|
}
|
|
324
324
|
onSubscribe() {
|
|
325
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
325
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), at(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
326
326
|
}
|
|
327
327
|
onUnsubscribe() {
|
|
328
328
|
this.hasListeners() || this.destroy();
|
|
329
329
|
}
|
|
330
330
|
shouldFetchOnReconnect() {
|
|
331
|
-
return
|
|
331
|
+
return ot(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
332
|
}
|
|
333
333
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
334
|
+
return ot(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
335
335
|
}
|
|
336
336
|
destroy() {
|
|
337
337
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
@@ -339,19 +339,19 @@ var et = class extends je {
|
|
|
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 K(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 && !Ue(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 &&
|
|
348
|
+
r && st(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || K(this.options.enabled, this.#t) !== K(t.enabled, this.#t) || G(this.options.staleTime, this.#t) !== G(t.staleTime, this.#t)) && this.#g();
|
|
349
349
|
let i = this.#_();
|
|
350
350
|
r && (this.#t !== n || K(this.options.enabled, this.#t) !== K(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
351
351
|
}
|
|
352
352
|
getOptimisticResult(e) {
|
|
353
353
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
354
|
-
return
|
|
354
|
+
return lt(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
|
|
355
355
|
}
|
|
356
356
|
getCurrentResult() {
|
|
357
357
|
return this.#r;
|
|
@@ -381,14 +381,14 @@ var et = class extends je {
|
|
|
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(Le)), t;
|
|
385
385
|
}
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
388
|
let e = G(this.options.staleTime, this.#t);
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
391
|
-
this.#d =
|
|
389
|
+
if (Ye.isServer() || this.#r.isStale || !Re(e)) return;
|
|
390
|
+
let t = ze(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = W.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,26 +396,26 @@ var et = class extends je {
|
|
|
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, !(
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
399
|
+
this.#x(), this.#p = e, !(Ye.isServer() || K(this.options.enabled, this.#t) === !1 || !Re(this.#p) || this.#p === 0) && (this.#f = W.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Pe.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 && (W.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (W.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;
|
|
414
414
|
if (t._optimisticResults) {
|
|
415
|
-
let i = this.hasListeners(), a = !i &&
|
|
415
|
+
let i = this.hasListeners(), a = !i && at(e, t), o = i && st(e, n, t, r);
|
|
416
416
|
(a || o) && (l = {
|
|
417
417
|
...l,
|
|
418
|
-
|
|
418
|
+
...nt(c.data, e.options)
|
|
419
419
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
420
420
|
}
|
|
421
421
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -423,11 +423,11 @@ var et = class extends je {
|
|
|
423
423
|
let h = !1;
|
|
424
424
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
425
|
let e;
|
|
426
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
426
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = qe(i?.data, e, t), u = !0);
|
|
427
427
|
}
|
|
428
428
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
429
429
|
else try {
|
|
430
|
-
this.#c = t.select, d = t.select(d), d =
|
|
430
|
+
this.#c = t.select, d = t.select(d), d = qe(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
431
|
} catch (e) {
|
|
432
432
|
this.#s = e;
|
|
433
433
|
}
|
|
@@ -455,7 +455,7 @@ var et = class extends je {
|
|
|
455
455
|
isPaused: l.fetchStatus === "paused",
|
|
456
456
|
isPlaceholderData: u,
|
|
457
457
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
458
|
+
isStale: ct(e, t),
|
|
459
459
|
refetch: this.refetch,
|
|
460
460
|
promise: this.#o,
|
|
461
461
|
isEnabled: K(t.enabled, e) !== !1
|
|
@@ -464,7 +464,7 @@ var et = class extends je {
|
|
|
464
464
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
465
465
|
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
466
466
|
}, a = () => {
|
|
467
|
-
i(this.#o = x.promise =
|
|
467
|
+
i(this.#o = x.promise = Xe());
|
|
468
468
|
}, o = this.#o;
|
|
469
469
|
switch (o.status) {
|
|
470
470
|
case "pending":
|
|
@@ -482,7 +482,7 @@ var et = class extends je {
|
|
|
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), !Ue(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;
|
|
@@ -503,7 +503,7 @@ var et = class extends je {
|
|
|
503
503
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
504
504
|
}
|
|
505
505
|
#C(e) {
|
|
506
|
-
|
|
506
|
+
$e.batch(() => {
|
|
507
507
|
e.listeners && this.listeners.forEach((e) => {
|
|
508
508
|
e(this.#r);
|
|
509
509
|
}), this.#e.getQueryCache().notify({
|
|
@@ -513,31 +513,31 @@ var et = class extends je {
|
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
|
-
function
|
|
516
|
+
function it(e, t) {
|
|
517
517
|
return K(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && K(t.retryOnMount, e) === !1);
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function at(e, t) {
|
|
520
|
+
return it(e, t) || e.state.data !== void 0 && ot(e, t, t.refetchOnMount);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function ot(e, t, n) {
|
|
523
523
|
if (K(t.enabled, e) !== !1 && G(t.staleTime, e) !== "static") {
|
|
524
524
|
let r = typeof n == "function" ? n(e) : n;
|
|
525
|
-
return r === "always" || r !== !1 &&
|
|
525
|
+
return r === "always" || r !== !1 && ct(e, t);
|
|
526
526
|
}
|
|
527
527
|
return !1;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
return (e !== t || K(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") &&
|
|
529
|
+
function st(e, t, n, r) {
|
|
530
|
+
return (e !== t || K(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ct(e, n);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function ct(e, t) {
|
|
533
533
|
return K(t.enabled, e) !== !1 && e.isStaleByTime(G(t.staleTime, e));
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
return !
|
|
535
|
+
function lt(e, t) {
|
|
536
|
+
return !Ue(e.getCurrentResult(), t);
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
540
|
-
function
|
|
540
|
+
function ut() {
|
|
541
541
|
return {
|
|
542
542
|
context: void 0,
|
|
543
543
|
data: void 0,
|
|
@@ -552,7 +552,7 @@ function st() {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var
|
|
555
|
+
var q = class extends Ne {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var ct = class extends je {
|
|
|
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), Ue(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 && Be(t.mutationKey) !== Be(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);
|
|
@@ -587,7 +587,7 @@ var ct = class extends je {
|
|
|
587
587
|
return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
588
588
|
}
|
|
589
589
|
#i() {
|
|
590
|
-
let e = this.#n?.state ??
|
|
590
|
+
let e = this.#n?.state ?? ut();
|
|
591
591
|
this.#t = {
|
|
592
592
|
...e,
|
|
593
593
|
isPending: e.status === "pending",
|
|
@@ -599,7 +599,7 @@ var ct = class extends je {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
#a(e) {
|
|
602
|
-
|
|
602
|
+
$e.batch(() => {
|
|
603
603
|
if (this.#r && this.hasListeners()) {
|
|
604
604
|
let t = this.#t.variables, n = this.#t.context, r = {
|
|
605
605
|
client: this.#e,
|
|
@@ -635,21 +635,21 @@ var ct = class extends je {
|
|
|
635
635
|
});
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
},
|
|
639
|
-
let n = e.useContext(
|
|
638
|
+
}, dt = e.createContext(void 0), J = (t) => {
|
|
639
|
+
let n = e.useContext(dt);
|
|
640
640
|
if (t) return t;
|
|
641
641
|
if (!n) throw Error("No QueryClient set, use QueryClientProvider to set one");
|
|
642
642
|
return n;
|
|
643
|
-
},
|
|
643
|
+
}, ft = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
644
644
|
t.unmount();
|
|
645
|
-
}), [t]), /* @__PURE__ */ p(
|
|
645
|
+
}), [t]), /* @__PURE__ */ p(dt.Provider, {
|
|
646
646
|
value: t,
|
|
647
647
|
children: n
|
|
648
|
-
})),
|
|
649
|
-
|
|
648
|
+
})), pt = e.createContext(!1), mt = () => e.useContext(pt);
|
|
649
|
+
pt.Provider;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
652
|
-
function
|
|
652
|
+
function ht() {
|
|
653
653
|
let e = !1;
|
|
654
654
|
return {
|
|
655
655
|
clearReset: () => {
|
|
@@ -661,63 +661,65 @@ function ft() {
|
|
|
661
661
|
isReset: () => e
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
|
-
var
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
664
|
+
var gt = e.createContext(ht()), _t = () => e.useContext(gt), vt = (e, t, n) => {
|
|
665
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? Je(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
666
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
|
-
},
|
|
667
|
+
}, yt = (t) => {
|
|
668
668
|
e.useEffect(() => {
|
|
669
669
|
t.clearReset();
|
|
670
670
|
}, [t]);
|
|
671
|
-
},
|
|
671
|
+
}, bt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Je(n, [e.error, r])), xt = (e) => {
|
|
672
672
|
if (e.suspense) {
|
|
673
673
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
674
674
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
675
675
|
}
|
|
676
|
-
},
|
|
676
|
+
}, St = (e, t) => e.isLoading && e.isFetching && !t, Ct = (e, t) => e?.suspense && t.isPending, wt = (e, t, n) => t.fetchOptimistic(e).catch(() => {
|
|
677
677
|
n.clearReset();
|
|
678
678
|
});
|
|
679
679
|
//#endregion
|
|
680
680
|
//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
681
|
-
function
|
|
681
|
+
function Tt(t, n, r) {
|
|
682
682
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t))) throw Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
|
|
683
|
-
let i =
|
|
683
|
+
let i = mt(), a = _t(), o = J(r), s = o.defaultQueryOptions(t);
|
|
684
684
|
o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
|
|
685
685
|
let c = o.getQueryCache().get(s.queryHash);
|
|
686
|
-
process.env.NODE_ENV !== "production" && (s.queryFn || console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`))
|
|
687
|
-
let l =
|
|
686
|
+
process.env.NODE_ENV !== "production" && (s.queryFn || console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));
|
|
687
|
+
let l = t.subscribed !== !1;
|
|
688
|
+
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, xt(s), vt(s, a, c), yt(a);
|
|
689
|
+
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
688
690
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
689
|
-
let t =
|
|
690
|
-
return
|
|
691
|
-
}, [
|
|
692
|
-
|
|
693
|
-
}, [s,
|
|
694
|
-
if (
|
|
695
|
-
result:
|
|
691
|
+
let t = p ? d.subscribe($e.batchCalls(e)) : Le;
|
|
692
|
+
return d.updateResult(), t;
|
|
693
|
+
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
694
|
+
d.setOptions(s);
|
|
695
|
+
}, [s, d]), Ct(s, f)) throw wt(s, d, a);
|
|
696
|
+
if (bt({
|
|
697
|
+
result: f,
|
|
696
698
|
errorResetBoundary: a,
|
|
697
699
|
throwOnError: s.throwOnError,
|
|
698
700
|
query: c,
|
|
699
701
|
suspense: s.suspense
|
|
700
|
-
})) throw
|
|
701
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,
|
|
702
|
-
|
|
703
|
-
}), s.notifyOnChangeProps ?
|
|
702
|
+
})) throw f.error;
|
|
703
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !Ye.isServer() && St(f, i) && (u ? wt(s, d, a) : c?.promise)?.catch(Le).finally(() => {
|
|
704
|
+
d.updateResult();
|
|
705
|
+
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
704
706
|
}
|
|
705
707
|
//#endregion
|
|
706
708
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
707
|
-
function
|
|
708
|
-
return
|
|
709
|
+
function Et(e, t) {
|
|
710
|
+
return Tt(e, rt, t);
|
|
709
711
|
}
|
|
710
712
|
//#endregion
|
|
711
713
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
712
|
-
function
|
|
713
|
-
let r = J(n), [i] = e.useState(() => new
|
|
714
|
+
function Dt(t, n) {
|
|
715
|
+
let r = J(n), [i] = e.useState(() => new q(r, t));
|
|
714
716
|
e.useEffect(() => {
|
|
715
717
|
i.setOptions(t);
|
|
716
718
|
}, [i, t]);
|
|
717
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
718
|
-
i.mutate(e, t).catch(
|
|
719
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe($e.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
720
|
+
i.mutate(e, t).catch(Le);
|
|
719
721
|
}, [i]);
|
|
720
|
-
if (a.error &&
|
|
722
|
+
if (a.error && Je(i.options.throwOnError, [a.error])) throw a.error;
|
|
721
723
|
return {
|
|
722
724
|
...a,
|
|
723
725
|
mutate: o,
|
|
@@ -726,15 +728,15 @@ function wt(t, n) {
|
|
|
726
728
|
}
|
|
727
729
|
//#endregion
|
|
728
730
|
//#region src/Context/DataTableContext.tsx
|
|
729
|
-
var
|
|
730
|
-
function
|
|
731
|
-
return /* @__PURE__ */ p(
|
|
731
|
+
var Ot = r(void 0), kt = async () => ({ "Content-Type": "application/json" });
|
|
732
|
+
function At({ children: e, baseUrl: t, queryClient: n, getHeaders: r = kt }) {
|
|
733
|
+
return /* @__PURE__ */ p(Ot.Provider, {
|
|
732
734
|
value: {
|
|
733
735
|
baseUrl: t,
|
|
734
736
|
queryClient: n,
|
|
735
737
|
getHeaders: r
|
|
736
738
|
},
|
|
737
|
-
children: /* @__PURE__ */ p(
|
|
739
|
+
children: /* @__PURE__ */ p(ft, {
|
|
738
740
|
client: n,
|
|
739
741
|
children: e
|
|
740
742
|
})
|
|
@@ -742,14 +744,14 @@ function Dt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = Et }) {
|
|
|
742
744
|
}
|
|
743
745
|
//#endregion
|
|
744
746
|
//#region src/Hooks/useDataTable.ts
|
|
745
|
-
function
|
|
746
|
-
let e = o(
|
|
747
|
+
function Y() {
|
|
748
|
+
let e = o(Ot);
|
|
747
749
|
if (!e) throw Error("useDataTable must be used within a DataTableProvider");
|
|
748
750
|
return e;
|
|
749
751
|
}
|
|
750
752
|
//#endregion
|
|
751
753
|
//#region src/Hooks/useApi.ts
|
|
752
|
-
function
|
|
754
|
+
function jt(e) {
|
|
753
755
|
if (typeof e == "string") try {
|
|
754
756
|
let t = JSON.parse(e);
|
|
755
757
|
return {
|
|
@@ -762,7 +764,7 @@ function kt(e) {
|
|
|
762
764
|
}
|
|
763
765
|
return e instanceof Error ? { message: e.message } : { message: "Unbekannter Fehler" };
|
|
764
766
|
}
|
|
765
|
-
async function
|
|
767
|
+
async function Mt(e, t) {
|
|
766
768
|
let n = await fetch(e, t);
|
|
767
769
|
if (n.status >= 400) {
|
|
768
770
|
let e = await n.text();
|
|
@@ -777,89 +779,89 @@ async function At(e, t) {
|
|
|
777
779
|
}
|
|
778
780
|
return n;
|
|
779
781
|
}
|
|
780
|
-
async function
|
|
781
|
-
return (await
|
|
782
|
+
async function Nt(e, t) {
|
|
783
|
+
return (await Mt(e, {
|
|
782
784
|
method: "GET",
|
|
783
785
|
headers: await t()
|
|
784
786
|
})).json();
|
|
785
787
|
}
|
|
786
|
-
async function
|
|
787
|
-
return (await
|
|
788
|
+
async function Pt(e, t, n) {
|
|
789
|
+
return (await Mt(`${e}/${t}`, {
|
|
788
790
|
method: "GET",
|
|
789
791
|
headers: await n()
|
|
790
792
|
})).json();
|
|
791
793
|
}
|
|
792
|
-
async function
|
|
793
|
-
await
|
|
794
|
+
async function Ft(e, t, n) {
|
|
795
|
+
await Mt(`${e}/${t}`, {
|
|
794
796
|
method: "DELETE",
|
|
795
797
|
headers: await n()
|
|
796
798
|
});
|
|
797
799
|
}
|
|
798
|
-
async function
|
|
799
|
-
let r = await
|
|
800
|
+
async function It(e, t, n) {
|
|
801
|
+
let r = await Mt(e, {
|
|
800
802
|
method: "POST",
|
|
801
803
|
headers: await n(),
|
|
802
804
|
body: JSON.stringify(t)
|
|
803
805
|
});
|
|
804
806
|
return r.status === 204 ? t : r.json();
|
|
805
807
|
}
|
|
806
|
-
async function
|
|
807
|
-
let i = await
|
|
808
|
+
async function Lt(e, t, n, r) {
|
|
809
|
+
let i = await Mt(t, {
|
|
808
810
|
method: e,
|
|
809
811
|
headers: await n(),
|
|
810
812
|
body: r ? JSON.stringify(r) : void 0
|
|
811
813
|
});
|
|
812
814
|
if (i.status !== 204) return i.json();
|
|
813
815
|
}
|
|
814
|
-
async function
|
|
815
|
-
let r = await
|
|
816
|
+
async function Rt(e, t, n) {
|
|
817
|
+
let r = await Mt(`${e}/${t.id}`, {
|
|
816
818
|
method: "PUT",
|
|
817
819
|
headers: await n(),
|
|
818
820
|
body: JSON.stringify(t)
|
|
819
821
|
});
|
|
820
822
|
return r.status === 204 ? t : r.json();
|
|
821
823
|
}
|
|
822
|
-
function
|
|
823
|
-
let { baseUrl: r, getHeaders: i } =
|
|
824
|
-
return
|
|
824
|
+
function zt(e, t, n) {
|
|
825
|
+
let { baseUrl: r, getHeaders: i } = Y();
|
|
826
|
+
return Et({
|
|
825
827
|
queryKey: [...t.map((e) => e.toString()), String(n?.toString())],
|
|
826
|
-
queryFn: () =>
|
|
828
|
+
queryFn: () => Pt(`${r}${e}`, n, i),
|
|
827
829
|
enabled: !!n
|
|
828
830
|
});
|
|
829
831
|
}
|
|
830
|
-
function
|
|
831
|
-
let { baseUrl: r, getHeaders: i } =
|
|
832
|
-
return
|
|
832
|
+
function Bt(e, t, n = !0) {
|
|
833
|
+
let { baseUrl: r, getHeaders: i } = Y();
|
|
834
|
+
return Et({
|
|
833
835
|
queryKey: [...t.map((e) => e.toString())],
|
|
834
|
-
queryFn: () =>
|
|
836
|
+
queryFn: () => Nt(`${r}${e}`, i),
|
|
835
837
|
enabled: n
|
|
836
838
|
});
|
|
837
839
|
}
|
|
838
|
-
function
|
|
839
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
840
|
-
return
|
|
840
|
+
function Vt(e, t) {
|
|
841
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = Y();
|
|
842
|
+
return Dt({
|
|
841
843
|
mutationKey: [...t.map((e) => e.toString())],
|
|
842
|
-
mutationFn: (t) =>
|
|
844
|
+
mutationFn: (t) => It(`${n}${e}`, t, i),
|
|
843
845
|
onSettled() {
|
|
844
846
|
return r.invalidateQueries({ queryKey: [...t.map((e) => e.toString())] });
|
|
845
847
|
}
|
|
846
848
|
});
|
|
847
849
|
}
|
|
848
|
-
function
|
|
849
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
850
|
-
return
|
|
850
|
+
function Ht(e, t) {
|
|
851
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = Y();
|
|
852
|
+
return Dt({
|
|
851
853
|
mutationKey: [...t.map((e) => e.toString())],
|
|
852
|
-
mutationFn: (t) =>
|
|
854
|
+
mutationFn: (t) => Rt(`${n}${e}`, t, i),
|
|
853
855
|
onSettled() {
|
|
854
856
|
return r.invalidateQueries({ queryKey: [...t.map((e) => e.toString())] });
|
|
855
857
|
}
|
|
856
858
|
});
|
|
857
859
|
}
|
|
858
|
-
function
|
|
859
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
860
|
-
return
|
|
860
|
+
function Ut(e, t) {
|
|
861
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = Y();
|
|
862
|
+
return Dt({
|
|
861
863
|
mutationKey: [...t.map((e) => e.toString())],
|
|
862
|
-
mutationFn: (t) =>
|
|
864
|
+
mutationFn: (t) => Ft(`${n}${e}`, t, i),
|
|
863
865
|
onSettled() {
|
|
864
866
|
return r.invalidateQueries({ queryKey: [...t.map((e) => e.toString())] });
|
|
865
867
|
}
|
|
@@ -867,17 +869,17 @@ function Vt(e, t) {
|
|
|
867
869
|
}
|
|
868
870
|
//#endregion
|
|
869
871
|
//#region src/DataTable/CreateModal.tsx
|
|
870
|
-
function
|
|
871
|
-
let [s, c] = d(0), [l, u] = d(!1), [h,
|
|
872
|
+
function Wt({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreated: o }) {
|
|
873
|
+
let [s, c] = d(0), [l, u] = d(!1), [h, g] = d(), { mutateAsync: v, isError: b, error: S, isPending: C } = Vt(i, r), { mutateAsync: w, isPending: E } = Ht(i, r), D = C || E, O = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))];
|
|
872
874
|
function k(e, t) {
|
|
873
875
|
return typeof e.required == "function" ? e.required(t ?? {}) : !!e.required;
|
|
874
876
|
}
|
|
875
|
-
let A =
|
|
877
|
+
let A = _e({
|
|
876
878
|
mode: "uncontrolled",
|
|
877
879
|
initialValues: e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? !1 : t.defaultValue ?? "", e), {}),
|
|
878
880
|
validate: e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !k(t, n) || e ? null : "Pflichtfeld", e), {})
|
|
879
881
|
});
|
|
880
|
-
function
|
|
882
|
+
function j(e) {
|
|
881
883
|
let t = A.getValues();
|
|
882
884
|
if (e.conditional && !e.conditional(t)) return null;
|
|
883
885
|
let r = k(e, t);
|
|
@@ -889,14 +891,14 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
889
891
|
type: e.id.includes("email") ? "email" : void 0,
|
|
890
892
|
required: r
|
|
891
893
|
}, A.key(e.id)),
|
|
892
|
-
e.type === "number" && /* @__PURE__ */ p(
|
|
894
|
+
e.type === "number" && /* @__PURE__ */ p(N, {
|
|
893
895
|
decimalSeparator: ",",
|
|
894
896
|
label: e.column.title,
|
|
895
897
|
placeholder: e.placeholder ?? "",
|
|
896
898
|
...A.getInputProps(e.id),
|
|
897
899
|
required: r
|
|
898
900
|
}, A.key(e.id)),
|
|
899
|
-
e.type === "date" && /* @__PURE__ */ p(
|
|
901
|
+
e.type === "date" && /* @__PURE__ */ p(ve, {
|
|
900
902
|
label: e.column.title,
|
|
901
903
|
placeholder: e.placeholder ?? "",
|
|
902
904
|
valueFormat: "DD.MM.YYYY",
|
|
@@ -904,7 +906,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
904
906
|
...A.getInputProps(e.id),
|
|
905
907
|
required: r
|
|
906
908
|
}, A.key(e.id)),
|
|
907
|
-
e.type === "boolean" && /* @__PURE__ */ p(
|
|
909
|
+
e.type === "boolean" && /* @__PURE__ */ p(x, {
|
|
908
910
|
mt: "md",
|
|
909
911
|
label: e.column.title,
|
|
910
912
|
...A.getInputProps(e.id, { type: "checkbox" }),
|
|
@@ -927,7 +929,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
927
929
|
})
|
|
928
930
|
] }, e.id);
|
|
929
931
|
}
|
|
930
|
-
return /* @__PURE__ */ m(f, { children: [
|
|
932
|
+
return /* @__PURE__ */ m(f, { children: [b && /* @__PURE__ */ p(_, {
|
|
931
933
|
variant: "outline",
|
|
932
934
|
color: "red",
|
|
933
935
|
title: S?.name ?? "Fehler aufgetreten",
|
|
@@ -936,31 +938,31 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
936
938
|
}), /* @__PURE__ */ m("form", {
|
|
937
939
|
onSubmit: A.onSubmit(async (e) => {
|
|
938
940
|
let n = Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
|
|
939
|
-
if (h) await
|
|
941
|
+
if (h) await w({
|
|
940
942
|
...n,
|
|
941
943
|
id: h
|
|
942
944
|
});
|
|
943
945
|
else {
|
|
944
|
-
let e = await
|
|
945
|
-
|
|
946
|
+
let e = await v(n);
|
|
947
|
+
g(e.id), o?.(e.id);
|
|
946
948
|
}
|
|
947
|
-
O.length && s < O.length - 1 ?
|
|
949
|
+
O.length && s < O.length - 1 ? b || c(s + 1) : b || (A.setInitialValues(n), A.reset(), t());
|
|
948
950
|
}),
|
|
949
|
-
children: [O.length ? /* @__PURE__ */ p(
|
|
951
|
+
children: [O.length ? /* @__PURE__ */ p(re, {
|
|
950
952
|
active: s,
|
|
951
953
|
size: "sm",
|
|
952
|
-
children: O.map((t) => /* @__PURE__ */ p(
|
|
954
|
+
children: O.map((t) => /* @__PURE__ */ p(re.Step, {
|
|
953
955
|
...a && a[t - 1] ? { label: a[t - 1].label } : {},
|
|
954
|
-
children: e.filter((e) => e.step === t).map((e) =>
|
|
956
|
+
children: e.filter((e) => e.step === t).map((e) => j(e))
|
|
955
957
|
}, t))
|
|
956
|
-
}) : e.map((e) =>
|
|
958
|
+
}) : e.map((e) => j(e)), !l && /* @__PURE__ */ m(T, {
|
|
957
959
|
mt: "md",
|
|
958
960
|
justify: "end",
|
|
959
|
-
children: [/* @__PURE__ */ p(
|
|
961
|
+
children: [/* @__PURE__ */ p(y, {
|
|
960
962
|
onClick: () => O.length ? s === 0 ? t() : c(s - 1) : t(),
|
|
961
963
|
variant: "outline",
|
|
962
964
|
children: O.length ? s === 0 ? "Abbrechen" : "Zurück" : "Abbrechen"
|
|
963
|
-
}), /* @__PURE__ */ p(
|
|
965
|
+
}), /* @__PURE__ */ p(y, {
|
|
964
966
|
type: "submit",
|
|
965
967
|
loading: D,
|
|
966
968
|
children: O.length ? s === O.length - 1 ? "Speichern" : "Weiter" : "Speichern"
|
|
@@ -970,17 +972,17 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
970
972
|
}
|
|
971
973
|
//#endregion
|
|
972
974
|
//#region node_modules/clsx/dist/clsx.mjs
|
|
973
|
-
function
|
|
975
|
+
function Gt(e) {
|
|
974
976
|
var t, n, r = "";
|
|
975
977
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
976
978
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
977
979
|
var i = e.length;
|
|
978
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
980
|
+
for (t = 0; t < i; t++) e[t] && (n = Gt(e[t])) && (r && (r += " "), r += n);
|
|
979
981
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
980
982
|
return r;
|
|
981
983
|
}
|
|
982
984
|
function X() {
|
|
983
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
985
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Gt(e)) && (r && (r += " "), r += t);
|
|
984
986
|
return r;
|
|
985
987
|
}
|
|
986
988
|
//#endregion
|
|
@@ -991,7 +993,7 @@ function Z(e, t, n) {
|
|
|
991
993
|
theme: t
|
|
992
994
|
}).value : void 0;
|
|
993
995
|
}
|
|
994
|
-
function
|
|
996
|
+
function Kt({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
995
997
|
return {
|
|
996
998
|
"--mantine-datatable-color-light": Z(t, e, "light"),
|
|
997
999
|
"--mantine-datatable-color-dark": Z(t, e, "dark"),
|
|
@@ -1007,7 +1009,7 @@ function Wt({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor
|
|
|
1007
1009
|
"--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
|
|
1008
1010
|
};
|
|
1009
1011
|
}
|
|
1010
|
-
function
|
|
1012
|
+
function qt({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
1011
1013
|
return {
|
|
1012
1014
|
"--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
|
|
1013
1015
|
"--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
|
|
@@ -1015,7 +1017,7 @@ function Gt({ theme: e, paginationActiveTextColor: t, paginationActiveBackground
|
|
|
1015
1017
|
"--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
|
|
1016
1018
|
};
|
|
1017
1019
|
}
|
|
1018
|
-
function
|
|
1020
|
+
function Jt({ theme: e, color: t, backgroundColor: n }) {
|
|
1019
1021
|
return {
|
|
1020
1022
|
"--mantine-datatable-row-color-light": Z(t, e, "light"),
|
|
1021
1023
|
"--mantine-datatable-row-color-dark": Z(t, e, "dark"),
|
|
@@ -1023,9 +1025,9 @@ function Kt({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1023
1025
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1024
1026
|
};
|
|
1025
1027
|
}
|
|
1026
|
-
var [
|
|
1028
|
+
var [Yt, Xt] = fe("useDataTableColumnsContext must be used within DataTableColumnProvider"), Zt = (e) => {
|
|
1027
1029
|
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("");
|
|
1028
|
-
return p(
|
|
1030
|
+
return p(Yt, {
|
|
1029
1031
|
value: {
|
|
1030
1032
|
sourceColumn: y,
|
|
1031
1033
|
setSourceColumn: b,
|
|
@@ -1057,13 +1059,13 @@ var [qt, Jt] = fe("useDataTableColumnsContext must be used within DataTableColum
|
|
|
1057
1059
|
children: t
|
|
1058
1060
|
});
|
|
1059
1061
|
};
|
|
1060
|
-
function
|
|
1062
|
+
function Qt() {
|
|
1061
1063
|
return p("tr", {
|
|
1062
1064
|
className: "mantine-datatable-empty-row",
|
|
1063
1065
|
children: p("td", {})
|
|
1064
1066
|
});
|
|
1065
1067
|
}
|
|
1066
|
-
function
|
|
1068
|
+
function $t() {
|
|
1067
1069
|
return m("svg", {
|
|
1068
1070
|
width: "24",
|
|
1069
1071
|
height: "24",
|
|
@@ -1086,14 +1088,14 @@ function Zt() {
|
|
|
1086
1088
|
]
|
|
1087
1089
|
});
|
|
1088
1090
|
}
|
|
1089
|
-
function
|
|
1090
|
-
return p(
|
|
1091
|
+
function en({ icon: e, text: t, active: n, children: r }) {
|
|
1092
|
+
return p(b, {
|
|
1091
1093
|
className: "mantine-datatable-empty-state",
|
|
1092
1094
|
"data-active": n || void 0,
|
|
1093
1095
|
children: r || m(f, { children: [e || p("div", {
|
|
1094
1096
|
className: "mantine-datatable-empty-state-icon",
|
|
1095
|
-
children: p(
|
|
1096
|
-
}), p(
|
|
1097
|
+
children: p($t, {})
|
|
1098
|
+
}), p(V, {
|
|
1097
1099
|
component: "div",
|
|
1098
1100
|
size: "sm",
|
|
1099
1101
|
c: "dimmed",
|
|
@@ -1101,13 +1103,13 @@ function Qt({ icon: e, text: t, active: n, children: r }) {
|
|
|
1101
1103
|
})] })
|
|
1102
1104
|
});
|
|
1103
1105
|
}
|
|
1104
|
-
function
|
|
1106
|
+
function tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1105
1107
|
let r = l(() => t.map((e) => ({
|
|
1106
1108
|
accessor: e.accessor,
|
|
1107
1109
|
defaultPinned: e.pinned,
|
|
1108
1110
|
pinnable: !!e.pinnable,
|
|
1109
1111
|
pinned: e.pinned
|
|
1110
|
-
})), [t]), [i, a] =
|
|
1112
|
+
})), [t]), [i, a] = H({
|
|
1111
1113
|
key: e ? `${e}-columns-pinning` : "",
|
|
1112
1114
|
defaultValue: e ? r : void 0,
|
|
1113
1115
|
getInitialValueInEffect: n
|
|
@@ -1154,8 +1156,8 @@ function $t({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1154
1156
|
resetColumnsPinning: d
|
|
1155
1157
|
};
|
|
1156
1158
|
}
|
|
1157
|
-
function
|
|
1158
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1159
|
+
function nn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1160
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = H({
|
|
1159
1161
|
key: e ? `${e}-columns-order` : "",
|
|
1160
1162
|
defaultValue: e ? r : void 0,
|
|
1161
1163
|
getInitialValueInEffect: n
|
|
@@ -1197,8 +1199,8 @@ function en({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1197
1199
|
resetColumnsOrder: d
|
|
1198
1200
|
};
|
|
1199
1201
|
}
|
|
1200
|
-
function
|
|
1201
|
-
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] =
|
|
1202
|
+
function rn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1203
|
+
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({
|
|
1202
1204
|
key: e ? `${e}-columns-width` : "",
|
|
1203
1205
|
defaultValue: e ? o() : void 0,
|
|
1204
1206
|
getInitialValueInEffect: n
|
|
@@ -1286,13 +1288,13 @@ function tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1286
1288
|
endResize: S
|
|
1287
1289
|
};
|
|
1288
1290
|
}
|
|
1289
|
-
function
|
|
1291
|
+
function an({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1290
1292
|
let r = l(() => t?.map((e) => ({
|
|
1291
1293
|
accessor: e.accessor,
|
|
1292
1294
|
defaultToggle: e.defaultToggle || !0,
|
|
1293
1295
|
toggleable: e.toggleable,
|
|
1294
1296
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1295
|
-
})), [t]), [i, a] =
|
|
1297
|
+
})), [t]), [i, a] = H({
|
|
1296
1298
|
key: e ? `${e}-columns-toggle` : "",
|
|
1297
1299
|
defaultValue: e ? r : void 0,
|
|
1298
1300
|
getInitialValueInEffect: n
|
|
@@ -1339,20 +1341,20 @@ function nn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1339
1341
|
resetColumnsToggle: d
|
|
1340
1342
|
};
|
|
1341
1343
|
}
|
|
1342
|
-
var
|
|
1343
|
-
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } =
|
|
1344
|
+
var on = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1345
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = nn({
|
|
1344
1346
|
key: e,
|
|
1345
1347
|
columns: t,
|
|
1346
1348
|
getInitialValueInEffect: n
|
|
1347
|
-
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } =
|
|
1349
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = an({
|
|
1348
1350
|
key: e,
|
|
1349
1351
|
columns: t,
|
|
1350
1352
|
getInitialValueInEffect: n
|
|
1351
|
-
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } =
|
|
1353
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = tn({
|
|
1352
1354
|
key: e,
|
|
1353
1355
|
columns: t,
|
|
1354
1356
|
getInitialValueInEffect: n
|
|
1355
|
-
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } =
|
|
1357
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = rn({
|
|
1356
1358
|
key: e,
|
|
1357
1359
|
columns: t,
|
|
1358
1360
|
getInitialValueInEffect: n,
|
|
@@ -1429,16 +1431,16 @@ var rn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1429
1431
|
beginResize: w,
|
|
1430
1432
|
endResize: T
|
|
1431
1433
|
};
|
|
1432
|
-
},
|
|
1433
|
-
function
|
|
1434
|
+
}, sn = typeof window < "u" ? c : s;
|
|
1435
|
+
function cn(e) {
|
|
1434
1436
|
let t = u(e);
|
|
1435
1437
|
return t.current = e, t;
|
|
1436
1438
|
}
|
|
1437
|
-
var
|
|
1439
|
+
var ln = "--mantine-datatable-header-height", un = "--mantine-datatable-footer-height", dn = "--mantine-datatable-selection-column-width", fn = "--mantine-datatable-last-row-border-bottom";
|
|
1438
1440
|
function Q(e, t, n) {
|
|
1439
1441
|
e?.style.setProperty(t, n);
|
|
1440
1442
|
}
|
|
1441
|
-
function
|
|
1443
|
+
function pn(e) {
|
|
1442
1444
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1443
1445
|
return t ? {
|
|
1444
1446
|
width: t.inlineSize,
|
|
@@ -1448,18 +1450,18 @@ function dn(e) {
|
|
|
1448
1450
|
height: e.contentRect.height
|
|
1449
1451
|
};
|
|
1450
1452
|
}
|
|
1451
|
-
function
|
|
1453
|
+
function mn(e, t, n) {
|
|
1452
1454
|
if (e) {
|
|
1453
1455
|
let r = new ResizeObserver((e) => {
|
|
1454
1456
|
let n = e[0];
|
|
1455
|
-
n && t(
|
|
1457
|
+
n && t(pn(n));
|
|
1456
1458
|
});
|
|
1457
1459
|
return r.observe(e), () => {
|
|
1458
1460
|
r.disconnect(), n();
|
|
1459
1461
|
};
|
|
1460
1462
|
}
|
|
1461
1463
|
}
|
|
1462
|
-
function
|
|
1464
|
+
function hn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1463
1465
|
let n = {
|
|
1464
1466
|
root: u(null),
|
|
1465
1467
|
table: u(null),
|
|
@@ -1467,16 +1469,16 @@ function pn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1467
1469
|
header: u(null),
|
|
1468
1470
|
footer: u(null),
|
|
1469
1471
|
selectionColumnHeader: u(null)
|
|
1470
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1472
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = cn({ withRowBorders: t }), p = cn(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1471
1473
|
p.current.onScroll?.(e), m.current();
|
|
1472
1474
|
}, []);
|
|
1473
|
-
return s(() =>
|
|
1474
|
-
Q(r.current,
|
|
1475
|
-
}, () => Q(r.current,
|
|
1476
|
-
Q(r.current,
|
|
1477
|
-
}, () => Q(r.current,
|
|
1478
|
-
Q(r.current,
|
|
1479
|
-
}, () => Q(r.current,
|
|
1475
|
+
return s(() => mn(c.current, (e) => {
|
|
1476
|
+
Q(r.current, ln, `${e.height}px`);
|
|
1477
|
+
}, () => Q(r.current, ln, "0")), [c.current]), s(() => mn(l.current, (e) => {
|
|
1478
|
+
Q(r.current, un, `${e.height}px`);
|
|
1479
|
+
}, () => Q(r.current, un, "0")), [l.current]), s(() => mn(d.current, (e) => {
|
|
1480
|
+
Q(r.current, dn, `${e.width}px`);
|
|
1481
|
+
}, () => Q(r.current, dn, "0")), [d.current]), sn(() => {
|
|
1480
1482
|
if (typeof window > "u") return;
|
|
1481
1483
|
let e = {
|
|
1482
1484
|
top: !0,
|
|
@@ -1499,7 +1501,7 @@ function pn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1499
1501
|
Q(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), Q(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1500
1502
|
}
|
|
1501
1503
|
function c() {
|
|
1502
|
-
f.current.withRowBorders && t.height < n.height ? Q(r.current,
|
|
1504
|
+
f.current.withRowBorders && t.height < n.height ? Q(r.current, fn, `${me("1px")} solid var(--mantine-datatable-border-color)`) : Q(r.current, fn, "unset");
|
|
1503
1505
|
}
|
|
1504
1506
|
h.current = c;
|
|
1505
1507
|
function l() {
|
|
@@ -1517,10 +1519,10 @@ function pn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1517
1519
|
let u = new ResizeObserver((e) => {
|
|
1518
1520
|
for (let r of e) switch (r.target.tagName) {
|
|
1519
1521
|
case "TABLE":
|
|
1520
|
-
t =
|
|
1522
|
+
t = pn(r);
|
|
1521
1523
|
break;
|
|
1522
1524
|
case "DIV":
|
|
1523
|
-
n =
|
|
1525
|
+
n = pn(r);
|
|
1524
1526
|
break;
|
|
1525
1527
|
}
|
|
1526
1528
|
l(), s(), c();
|
|
@@ -1528,14 +1530,14 @@ function pn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1528
1530
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1529
1531
|
u.disconnect();
|
|
1530
1532
|
};
|
|
1531
|
-
}, []),
|
|
1533
|
+
}, []), sn(() => {
|
|
1532
1534
|
h.current();
|
|
1533
1535
|
}, [t]), {
|
|
1534
1536
|
refs: n,
|
|
1535
1537
|
onScroll: g
|
|
1536
1538
|
};
|
|
1537
1539
|
}
|
|
1538
|
-
function
|
|
1540
|
+
function gn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1539
1541
|
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1540
1542
|
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1541
1543
|
let a = t.current ?? n.current;
|
|
@@ -1617,13 +1619,13 @@ function mn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
|
|
|
1617
1619
|
t,
|
|
1618
1620
|
n,
|
|
1619
1621
|
f
|
|
1620
|
-
]),
|
|
1622
|
+
]), sn(f, [f]), {
|
|
1621
1623
|
pinnedMap: l,
|
|
1622
1624
|
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1623
1625
|
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1624
1626
|
};
|
|
1625
1627
|
}
|
|
1626
|
-
function
|
|
1628
|
+
function _n(e) {
|
|
1627
1629
|
let [t, n] = d(null);
|
|
1628
1630
|
return s(() => {
|
|
1629
1631
|
n(null);
|
|
@@ -1632,7 +1634,7 @@ function hn(e) {
|
|
|
1632
1634
|
setLastSelectionChangeIndex: n
|
|
1633
1635
|
};
|
|
1634
1636
|
}
|
|
1635
|
-
function
|
|
1637
|
+
function vn(e, t) {
|
|
1636
1638
|
let n = () => {
|
|
1637
1639
|
t(e.map((e) => e.matches));
|
|
1638
1640
|
}, r = e.map((e) => {
|
|
@@ -1648,62 +1650,62 @@ function gn(e, t) {
|
|
|
1648
1650
|
});
|
|
1649
1651
|
};
|
|
1650
1652
|
}
|
|
1651
|
-
function
|
|
1653
|
+
function yn(e, t) {
|
|
1652
1654
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1653
1655
|
}
|
|
1654
|
-
function
|
|
1655
|
-
let [r, i] = d(n ? t :
|
|
1656
|
+
function bn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1657
|
+
let [r, i] = d(n ? t : yn(e, t)), a = u(null);
|
|
1656
1658
|
return s(() => {
|
|
1657
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1659
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), vn(a.current, (e) => {
|
|
1658
1660
|
i(e);
|
|
1659
1661
|
});
|
|
1660
1662
|
}, [e]), r;
|
|
1661
1663
|
}
|
|
1662
|
-
function
|
|
1663
|
-
let t =
|
|
1664
|
-
return
|
|
1664
|
+
function xn(e) {
|
|
1665
|
+
let t = ge();
|
|
1666
|
+
return bn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1665
1667
|
}
|
|
1666
|
-
function
|
|
1667
|
-
let t =
|
|
1668
|
-
return
|
|
1668
|
+
function Sn(e) {
|
|
1669
|
+
let t = ge();
|
|
1670
|
+
return Ae((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1669
1671
|
}
|
|
1670
|
-
function
|
|
1672
|
+
function Cn(e) {
|
|
1671
1673
|
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1672
1674
|
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1673
1675
|
}
|
|
1674
|
-
function
|
|
1676
|
+
function wn(e, t, n) {
|
|
1675
1677
|
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1676
1678
|
}
|
|
1677
|
-
function
|
|
1679
|
+
function Tn(e, t) {
|
|
1678
1680
|
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1679
1681
|
}
|
|
1680
|
-
function
|
|
1682
|
+
function En(e, t) {
|
|
1681
1683
|
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1682
1684
|
}
|
|
1683
1685
|
function $(e, t) {
|
|
1684
|
-
return typeof t == "string" ?
|
|
1686
|
+
return typeof t == "string" ? En(e, t) : t(e);
|
|
1685
1687
|
}
|
|
1686
|
-
function
|
|
1687
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 +
|
|
1688
|
+
function Dn(e) {
|
|
1689
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Dn(e.groups) : 1));
|
|
1688
1690
|
}
|
|
1689
|
-
function
|
|
1691
|
+
function On(e) {
|
|
1690
1692
|
let t = [];
|
|
1691
|
-
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(...
|
|
1693
|
+
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(...On(n.groups));
|
|
1692
1694
|
return t.filter((e) => e != null);
|
|
1693
1695
|
}
|
|
1694
|
-
function
|
|
1695
|
-
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 +
|
|
1696
|
+
function kn(e, t) {
|
|
1697
|
+
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 + kn(n, t), 0) : 0;
|
|
1696
1698
|
}
|
|
1697
|
-
function
|
|
1699
|
+
function An(e, t, n = 0) {
|
|
1698
1700
|
if (n === t) return [...e];
|
|
1699
1701
|
let r = [];
|
|
1700
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...
|
|
1702
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...An(i.groups, t, n + 1));
|
|
1701
1703
|
return r;
|
|
1702
1704
|
}
|
|
1703
|
-
function
|
|
1705
|
+
function jn(e, t, n) {
|
|
1704
1706
|
return n ? !e || t : !1;
|
|
1705
1707
|
}
|
|
1706
|
-
function
|
|
1708
|
+
function Mn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1707
1709
|
let r = [];
|
|
1708
1710
|
if (e && t) {
|
|
1709
1711
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
@@ -1738,8 +1740,8 @@ function An({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1738
1740
|
};
|
|
1739
1741
|
}
|
|
1740
1742
|
}
|
|
1741
|
-
function
|
|
1742
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1743
|
+
function Nn(e, t) {
|
|
1744
|
+
let [n, r] = d(e), [i, a] = d(e), o = Me(() => r(!0), 0), c = Me(() => a(!1), t || 200);
|
|
1743
1745
|
return s(() => {
|
|
1744
1746
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1745
1747
|
}, [
|
|
@@ -1751,17 +1753,17 @@ function jn(e, t) {
|
|
|
1751
1753
|
visible: i
|
|
1752
1754
|
};
|
|
1753
1755
|
}
|
|
1754
|
-
var
|
|
1755
|
-
function
|
|
1756
|
-
return
|
|
1756
|
+
var Pn = "mantine-datatable-nowrap", Fn = "mantine-datatable-ellipsis", In = "mantine-datatable-pointer-cursor", Ln = "mantine-datatable-context-menu-cursor", Rn = "mantine-datatable-text-selection-disabled", zn = "mantine-datatable-text-align-left", Bn = "mantine-datatable-text-align-center", Vn = "mantine-datatable-text-align-right";
|
|
1757
|
+
function Hn({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1758
|
+
return Sn(r) ? p(z, {
|
|
1757
1759
|
"data-pinned": n?.position,
|
|
1758
1760
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1759
1761
|
className: X({
|
|
1760
|
-
[
|
|
1761
|
-
[
|
|
1762
|
-
[
|
|
1763
|
-
[
|
|
1764
|
-
[
|
|
1762
|
+
[Pn]: a || o,
|
|
1763
|
+
[Fn]: o,
|
|
1764
|
+
[zn]: s === "left",
|
|
1765
|
+
[Bn]: s === "center",
|
|
1766
|
+
[Vn]: s === "right"
|
|
1765
1767
|
}, e),
|
|
1766
1768
|
style: [
|
|
1767
1769
|
{
|
|
@@ -1779,24 +1781,24 @@ function Bn({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1779
1781
|
children: i
|
|
1780
1782
|
}) : null;
|
|
1781
1783
|
}
|
|
1782
|
-
function
|
|
1783
|
-
return p(
|
|
1784
|
+
function Un({ shadowVisible: e }) {
|
|
1785
|
+
return p(z, {
|
|
1784
1786
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1785
1787
|
"data-shadow-visible": e || void 0
|
|
1786
1788
|
});
|
|
1787
1789
|
}
|
|
1788
|
-
function
|
|
1789
|
-
return p(
|
|
1790
|
+
function Wn({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1791
|
+
return p(oe, {
|
|
1790
1792
|
ref: s,
|
|
1791
1793
|
className: X("mantine-datatable-footer", e),
|
|
1792
1794
|
style: t,
|
|
1793
|
-
children: m(
|
|
1795
|
+
children: m(B, { children: [a && p(Un, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1794
1796
|
if (e) return null;
|
|
1795
1797
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1796
1798
|
...r,
|
|
1797
1799
|
...t
|
|
1798
1800
|
};
|
|
1799
|
-
return p(
|
|
1801
|
+
return p(Hn, {
|
|
1800
1802
|
pinnedInfo: i.get(String(n)),
|
|
1801
1803
|
className: l,
|
|
1802
1804
|
style: u,
|
|
@@ -1810,8 +1812,8 @@ function Hn({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
|
|
|
1810
1812
|
})] })
|
|
1811
1813
|
});
|
|
1812
1814
|
}
|
|
1813
|
-
function
|
|
1814
|
-
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ?
|
|
1815
|
+
function Gn({ 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 }) {
|
|
1816
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? On([{
|
|
1815
1817
|
id: e,
|
|
1816
1818
|
columns: t,
|
|
1817
1819
|
groups: n
|
|
@@ -1819,7 +1821,7 @@ function Un({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1819
1821
|
t,
|
|
1820
1822
|
n,
|
|
1821
1823
|
e
|
|
1822
|
-
]), _ =
|
|
1824
|
+
]), _ = xn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => kn({
|
|
1823
1825
|
id: e,
|
|
1824
1826
|
columns: t,
|
|
1825
1827
|
groups: n
|
|
@@ -1828,16 +1830,16 @@ function Un({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1828
1830
|
t,
|
|
1829
1831
|
n,
|
|
1830
1832
|
_
|
|
1831
|
-
]), y = l(() => d.reduce((e, t) => e +
|
|
1832
|
-
return v > 0 ? p(
|
|
1833
|
+
]), y = l(() => d.reduce((e, t) => e + kn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = jn(f, y + v < h, m);
|
|
1834
|
+
return v > 0 ? p(z, {
|
|
1833
1835
|
colSpan: v,
|
|
1834
1836
|
rowSpan: b > 1 ? b : void 0,
|
|
1835
1837
|
"data-pinned": s?.position,
|
|
1836
1838
|
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1837
1839
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1838
|
-
[
|
|
1839
|
-
[
|
|
1840
|
-
[
|
|
1840
|
+
[zn]: i === "left",
|
|
1841
|
+
[Bn]: i === "center",
|
|
1842
|
+
[Vn]: i === "right",
|
|
1841
1843
|
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1842
1844
|
}, a),
|
|
1843
1845
|
style: [o, s && {
|
|
@@ -1845,10 +1847,10 @@ function Un({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1845
1847
|
[s.position]: s.offset,
|
|
1846
1848
|
overflow: "visible"
|
|
1847
1849
|
}],
|
|
1848
|
-
children: r ??
|
|
1850
|
+
children: r ?? Cn(e)
|
|
1849
1851
|
}) : null;
|
|
1850
1852
|
}
|
|
1851
|
-
function
|
|
1853
|
+
function Kn() {
|
|
1852
1854
|
return m("svg", {
|
|
1853
1855
|
width: "14",
|
|
1854
1856
|
height: "14",
|
|
@@ -1865,7 +1867,7 @@ function Wn() {
|
|
|
1865
1867
|
}), 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" })]
|
|
1866
1868
|
});
|
|
1867
1869
|
}
|
|
1868
|
-
function
|
|
1870
|
+
function qn() {
|
|
1869
1871
|
return m("svg", {
|
|
1870
1872
|
width: "14",
|
|
1871
1873
|
height: "14",
|
|
@@ -1886,9 +1888,9 @@ function Gn() {
|
|
|
1886
1888
|
})]
|
|
1887
1889
|
});
|
|
1888
1890
|
}
|
|
1889
|
-
function
|
|
1890
|
-
let [i, { close: a, toggle: o }] =
|
|
1891
|
-
return r && (c = void 0), m(
|
|
1891
|
+
function Jn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1892
|
+
let [i, { close: a, toggle: o }] = ke(!1), s = t ? qn : Kn, c = Oe(a);
|
|
1893
|
+
return r && (c = void 0), m(F, {
|
|
1892
1894
|
withArrow: !0,
|
|
1893
1895
|
shadow: "md",
|
|
1894
1896
|
trapFocus: !0,
|
|
@@ -1896,7 +1898,7 @@ function Kn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1896
1898
|
opened: i,
|
|
1897
1899
|
onClose: a,
|
|
1898
1900
|
onDismiss: a,
|
|
1899
|
-
children: [p(ee, { children: p(
|
|
1901
|
+
children: [p(ee, { children: p(g, {
|
|
1900
1902
|
className: "mantine-datatable-header-cell-filter-action-icon",
|
|
1901
1903
|
"data-active": t || void 0,
|
|
1902
1904
|
size: "sm",
|
|
@@ -1906,7 +1908,7 @@ function Kn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1906
1908
|
},
|
|
1907
1909
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1908
1910
|
children: p(s, {})
|
|
1909
|
-
}) }), p(
|
|
1911
|
+
}) }), p(I, {
|
|
1910
1912
|
ref: c,
|
|
1911
1913
|
onClick: (e) => e.stopPropagation(),
|
|
1912
1914
|
onKeyDown: (e) => e.stopPropagation(),
|
|
@@ -1914,7 +1916,7 @@ function Kn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1914
1916
|
})]
|
|
1915
1917
|
});
|
|
1916
1918
|
}
|
|
1917
|
-
function
|
|
1919
|
+
function Yn() {
|
|
1918
1920
|
return m("svg", {
|
|
1919
1921
|
width: "14",
|
|
1920
1922
|
height: "14",
|
|
@@ -1936,7 +1938,7 @@ function qn() {
|
|
|
1936
1938
|
]
|
|
1937
1939
|
});
|
|
1938
1940
|
}
|
|
1939
|
-
function
|
|
1941
|
+
function Xn() {
|
|
1940
1942
|
return m("svg", {
|
|
1941
1943
|
width: "14",
|
|
1942
1944
|
height: "14",
|
|
@@ -1958,7 +1960,7 @@ function Jn() {
|
|
|
1958
1960
|
]
|
|
1959
1961
|
});
|
|
1960
1962
|
}
|
|
1961
|
-
function
|
|
1963
|
+
function Zn() {
|
|
1962
1964
|
return m("svg", {
|
|
1963
1965
|
width: "14",
|
|
1964
1966
|
height: "14",
|
|
@@ -1980,7 +1982,7 @@ function Yn() {
|
|
|
1980
1982
|
]
|
|
1981
1983
|
});
|
|
1982
1984
|
}
|
|
1983
|
-
function
|
|
1985
|
+
function Qn() {
|
|
1984
1986
|
return m("svg", {
|
|
1985
1987
|
width: "14",
|
|
1986
1988
|
height: "14",
|
|
@@ -2001,78 +2003,78 @@ function Xn() {
|
|
|
2001
2003
|
]
|
|
2002
2004
|
});
|
|
2003
2005
|
}
|
|
2004
|
-
function
|
|
2006
|
+
function $n({ currentPinned: e, onPinChange: t }) {
|
|
2005
2007
|
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2006
2008
|
if (i.current) {
|
|
2007
2009
|
let e = getComputedStyle(i.current).direction;
|
|
2008
2010
|
c(e === "rtl");
|
|
2009
2011
|
}
|
|
2010
2012
|
}, []);
|
|
2011
|
-
|
|
2013
|
+
sn(() => {
|
|
2012
2014
|
l();
|
|
2013
2015
|
}, [l]), s(() => {
|
|
2014
2016
|
n && l();
|
|
2015
2017
|
}, [n, l]);
|
|
2016
|
-
let f = o ? "right" : "left",
|
|
2017
|
-
return m(
|
|
2018
|
+
let f = o ? "right" : "left", h = o ? "left" : "right", _ = e === f, v = e === h;
|
|
2019
|
+
return m(F, {
|
|
2018
2020
|
opened: n,
|
|
2019
2021
|
onChange: r,
|
|
2020
2022
|
position: "bottom",
|
|
2021
2023
|
withArrow: !0,
|
|
2022
2024
|
shadow: "sm",
|
|
2023
|
-
children: [p(
|
|
2025
|
+
children: [p(F.Target, { children: p(b, {
|
|
2024
2026
|
ref: i,
|
|
2025
2027
|
className: "mantine-datatable-header-cell-pinnable-icon",
|
|
2026
2028
|
role: "button",
|
|
2027
2029
|
"aria-label": "Pin column",
|
|
2028
2030
|
onMouseEnter: () => r(!0),
|
|
2029
2031
|
onMouseLeave: () => r(!1),
|
|
2030
|
-
children: p(
|
|
2032
|
+
children: p(g, {
|
|
2031
2033
|
size: "xs",
|
|
2032
2034
|
variant: "light",
|
|
2033
2035
|
onClick: (e) => e.stopPropagation(),
|
|
2034
|
-
children: p(
|
|
2036
|
+
children: p(Zn, {})
|
|
2035
2037
|
})
|
|
2036
|
-
}) }), p(
|
|
2038
|
+
}) }), p(F.Dropdown, {
|
|
2037
2039
|
onClick: (e) => e.stopPropagation(),
|
|
2038
2040
|
onMouseEnter: () => r(!0),
|
|
2039
2041
|
onMouseLeave: () => r(!1),
|
|
2040
2042
|
className: "mantine-datatable-pinnable-dropdown",
|
|
2041
|
-
children: m(
|
|
2043
|
+
children: m(T, {
|
|
2042
2044
|
gap: 4,
|
|
2043
2045
|
children: [
|
|
2044
|
-
p(
|
|
2046
|
+
p(g, {
|
|
2045
2047
|
size: "sm",
|
|
2046
2048
|
variant: _ ? "filled" : "light",
|
|
2047
2049
|
onClick: () => t(_ ? void 0 : f),
|
|
2048
2050
|
"aria-label": "Pin left",
|
|
2049
|
-
children: p(
|
|
2051
|
+
children: p(Yn, {})
|
|
2050
2052
|
}),
|
|
2051
|
-
p(
|
|
2053
|
+
p(g, {
|
|
2052
2054
|
size: "sm",
|
|
2053
2055
|
variant: v ? "filled" : "light",
|
|
2054
|
-
onClick: () => t(v ? void 0 :
|
|
2056
|
+
onClick: () => t(v ? void 0 : h),
|
|
2055
2057
|
"aria-label": "Pin right",
|
|
2056
|
-
children: p(
|
|
2058
|
+
children: p(Xn, {})
|
|
2057
2059
|
}),
|
|
2058
|
-
e && p(
|
|
2060
|
+
e && p(g, {
|
|
2059
2061
|
size: "sm",
|
|
2060
2062
|
variant: "light",
|
|
2061
2063
|
color: "red",
|
|
2062
2064
|
onClick: () => t(void 0),
|
|
2063
2065
|
"aria-label": "Unpin",
|
|
2064
|
-
children: p(
|
|
2066
|
+
children: p(Qn, {})
|
|
2065
2067
|
})
|
|
2066
2068
|
]
|
|
2067
2069
|
})
|
|
2068
2070
|
})]
|
|
2069
2071
|
});
|
|
2070
2072
|
}
|
|
2071
|
-
var
|
|
2073
|
+
var er = 50, tr = (e) => {
|
|
2072
2074
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2073
2075
|
current: 0,
|
|
2074
2076
|
next: 0
|
|
2075
|
-
}), { dir: c } =
|
|
2077
|
+
}), { dir: c } = he(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = Xt(), g = a((e) => {
|
|
2076
2078
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2077
2079
|
let r = n.current, a = r.nextElementSibling;
|
|
2078
2080
|
for (; a;) {
|
|
@@ -2091,7 +2093,7 @@ var Qn = 50, $n = (e) => {
|
|
|
2091
2093
|
let p = (e) => {
|
|
2092
2094
|
let n = e.clientX - o.current;
|
|
2093
2095
|
l && (n = -n);
|
|
2094
|
-
let r = s.current.current -
|
|
2096
|
+
let r = s.current.current - er, i = s.current.next - er, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
|
|
2095
2097
|
f([{
|
|
2096
2098
|
accessor: t,
|
|
2097
2099
|
width: `${u}px`
|
|
@@ -2138,7 +2140,7 @@ var Qn = 50, $n = (e) => {
|
|
|
2138
2140
|
title: "Drag to resize column, double-click to reset"
|
|
2139
2141
|
});
|
|
2140
2142
|
};
|
|
2141
|
-
function
|
|
2143
|
+
function nr() {
|
|
2142
2144
|
return m("svg", {
|
|
2143
2145
|
width: "14",
|
|
2144
2146
|
height: "14",
|
|
@@ -2160,7 +2162,7 @@ function er() {
|
|
|
2160
2162
|
]
|
|
2161
2163
|
});
|
|
2162
2164
|
}
|
|
2163
|
-
function
|
|
2165
|
+
function rr() {
|
|
2164
2166
|
return m("svg", {
|
|
2165
2167
|
width: "14",
|
|
2166
2168
|
height: "14",
|
|
@@ -2182,7 +2184,7 @@ function tr() {
|
|
|
2182
2184
|
]
|
|
2183
2185
|
});
|
|
2184
2186
|
}
|
|
2185
|
-
function
|
|
2187
|
+
function ir() {
|
|
2186
2188
|
return m("svg", {
|
|
2187
2189
|
width: "14",
|
|
2188
2190
|
height: "14",
|
|
@@ -2207,37 +2209,37 @@ function nr() {
|
|
|
2207
2209
|
]
|
|
2208
2210
|
});
|
|
2209
2211
|
}
|
|
2210
|
-
function
|
|
2211
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning:
|
|
2212
|
-
if (!
|
|
2213
|
-
let
|
|
2212
|
+
function ar({ 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 }) {
|
|
2213
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: I } = Xt(), [ee, L] = d(!1), R = u(null), te = F?.find((e) => e.accessor === r)?.pinned;
|
|
2214
|
+
if (!Sn(i)) return null;
|
|
2215
|
+
let ne = a ?? Cn(r), re = typeof ne == "string" ? ne : void 0, ie = o && S ? (e) => {
|
|
2214
2216
|
e?.defaultPrevented || S({
|
|
2215
2217
|
sortKey: k,
|
|
2216
2218
|
columnAccessor: r,
|
|
2217
2219
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2218
2220
|
});
|
|
2219
|
-
} : void 0,
|
|
2220
|
-
e.stopPropagation(), A(r),
|
|
2221
|
-
},
|
|
2222
|
-
e.preventDefault(), j(r),
|
|
2221
|
+
} : void 0, ae = (e) => {
|
|
2222
|
+
e.stopPropagation(), A(r), L(!1);
|
|
2223
|
+
}, oe = (e) => {
|
|
2224
|
+
e.preventDefault(), j(r), L(!0);
|
|
2225
|
+
}, se = () => {
|
|
2226
|
+
j(r), L(!1), M();
|
|
2227
|
+
}, B = () => {
|
|
2228
|
+
L(!0);
|
|
2223
2229
|
}, ce = () => {
|
|
2224
|
-
|
|
2225
|
-
},
|
|
2226
|
-
I(!0);
|
|
2227
|
-
}, le = () => {
|
|
2228
|
-
I(!1);
|
|
2229
|
-
}, ue = (e) => {
|
|
2230
|
+
L(!1);
|
|
2231
|
+
}, V = (e) => {
|
|
2230
2232
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2231
2233
|
...e,
|
|
2232
2234
|
toggled: !1
|
|
2233
2235
|
} : e));
|
|
2234
|
-
},
|
|
2235
|
-
|
|
2236
|
+
}, le = (e) => {
|
|
2237
|
+
I((t) => t.map((t) => t.accessor === r ? {
|
|
2236
2238
|
...t,
|
|
2237
2239
|
pinned: e
|
|
2238
2240
|
} : t));
|
|
2239
2241
|
};
|
|
2240
|
-
return m(
|
|
2242
|
+
return m(z, {
|
|
2241
2243
|
"data-accessor": r,
|
|
2242
2244
|
"data-pinned": n?.position,
|
|
2243
2245
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2249,10 +2251,10 @@ function rr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2249
2251
|
}, e),
|
|
2250
2252
|
style: [
|
|
2251
2253
|
{
|
|
2252
|
-
width:
|
|
2254
|
+
width: y,
|
|
2253
2255
|
...f ? {} : {
|
|
2254
|
-
minWidth:
|
|
2255
|
-
maxWidth:
|
|
2256
|
+
minWidth: y,
|
|
2257
|
+
maxWidth: y
|
|
2256
2258
|
}
|
|
2257
2259
|
},
|
|
2258
2260
|
t,
|
|
@@ -2264,100 +2266,100 @@ function rr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2264
2266
|
],
|
|
2265
2267
|
role: o ? "button" : void 0,
|
|
2266
2268
|
tabIndex: o ? 0 : void 0,
|
|
2267
|
-
onClick:
|
|
2268
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2269
|
-
ref:
|
|
2270
|
-
children: [m(
|
|
2269
|
+
onClick: ie,
|
|
2270
|
+
onKeyDown: (e) => e.key === "Enter" && ie?.(),
|
|
2271
|
+
ref: R,
|
|
2272
|
+
children: [m(T, {
|
|
2271
2273
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
2272
2274
|
justify: "space-between",
|
|
2273
2275
|
wrap: "nowrap",
|
|
2274
2276
|
children: [
|
|
2275
|
-
m(
|
|
2277
|
+
m(w, {
|
|
2276
2278
|
align: "center",
|
|
2277
2279
|
w: "100%",
|
|
2278
2280
|
className: X({
|
|
2279
2281
|
"mantine-datatable-header-cell-draggable": s,
|
|
2280
|
-
"mantine-datatable-header-cell-drag-over":
|
|
2282
|
+
"mantine-datatable-header-cell-drag-over": ee
|
|
2281
2283
|
}),
|
|
2282
2284
|
draggable: s,
|
|
2283
|
-
onDragStart: s ?
|
|
2284
|
-
onDragEnter: s ?
|
|
2285
|
-
onDragOver: s ?
|
|
2286
|
-
onDrop: s ?
|
|
2287
|
-
onDragLeave: s ?
|
|
2288
|
-
children: [s ? p(
|
|
2285
|
+
onDragStart: s ? ae : void 0,
|
|
2286
|
+
onDragEnter: s ? B : void 0,
|
|
2287
|
+
onDragOver: s ? oe : void 0,
|
|
2288
|
+
onDrop: s ? se : void 0,
|
|
2289
|
+
onDragLeave: s ? ce : void 0,
|
|
2290
|
+
children: [s ? p(b, {
|
|
2289
2291
|
role: "img",
|
|
2290
2292
|
"aria-label": "Drag column",
|
|
2291
|
-
children: p(
|
|
2293
|
+
children: p(g, {
|
|
2292
2294
|
className: "mantine-datatable-header-cell-draggable-action-icon",
|
|
2293
2295
|
variant: "subtle",
|
|
2294
2296
|
size: "xs",
|
|
2295
2297
|
onClick: (e) => {
|
|
2296
2298
|
e.stopPropagation();
|
|
2297
2299
|
},
|
|
2298
|
-
children: p(
|
|
2300
|
+
children: p(ir, {})
|
|
2299
2301
|
})
|
|
2300
|
-
}) : null, p(
|
|
2302
|
+
}) : null, p(v, {
|
|
2301
2303
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
2302
|
-
[
|
|
2303
|
-
[
|
|
2304
|
-
[
|
|
2305
|
-
},
|
|
2306
|
-
title:
|
|
2307
|
-
children:
|
|
2304
|
+
[zn]: _ === "left",
|
|
2305
|
+
[Bn]: _ === "center",
|
|
2306
|
+
[Vn]: _ === "right"
|
|
2307
|
+
}, Pn, Fn),
|
|
2308
|
+
title: re,
|
|
2309
|
+
children: ne
|
|
2308
2310
|
})]
|
|
2309
2311
|
}),
|
|
2310
|
-
l ? p(
|
|
2311
|
-
currentPinned:
|
|
2312
|
-
onPinChange:
|
|
2312
|
+
l ? p($n, {
|
|
2313
|
+
currentPinned: te,
|
|
2314
|
+
onPinChange: le
|
|
2313
2315
|
}) : null,
|
|
2314
|
-
c ? p(
|
|
2316
|
+
c ? p(b, {
|
|
2315
2317
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
2316
2318
|
role: "img",
|
|
2317
2319
|
"aria-label": "Toggle column",
|
|
2318
|
-
children: p(
|
|
2320
|
+
children: p(g, {
|
|
2319
2321
|
size: "xs",
|
|
2320
2322
|
variant: "light",
|
|
2321
|
-
onClick:
|
|
2322
|
-
children: p(
|
|
2323
|
+
onClick: V,
|
|
2324
|
+
children: p(Qn, {})
|
|
2323
2325
|
})
|
|
2324
2326
|
}) : null,
|
|
2325
|
-
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(
|
|
2327
|
+
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
|
|
2326
2328
|
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
2327
2329
|
role: "img",
|
|
2328
2330
|
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2329
|
-
children:
|
|
2330
|
-
}) : p(
|
|
2331
|
+
children: h?.sorted || p(rr, {})
|
|
2332
|
+
}) : p(b, {
|
|
2331
2333
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
2332
2334
|
role: "img",
|
|
2333
2335
|
"aria-label": "Not sorted",
|
|
2334
|
-
children:
|
|
2336
|
+
children: h?.unsorted || p(nr, {})
|
|
2335
2337
|
}) : null,
|
|
2336
|
-
|
|
2338
|
+
C ? p(Jn, {
|
|
2337
2339
|
filterPopoverProps: E,
|
|
2338
2340
|
isActive: !!O,
|
|
2339
2341
|
filterPopoverDisableClickOutside: D,
|
|
2340
|
-
children:
|
|
2342
|
+
children: C
|
|
2341
2343
|
}) : null
|
|
2342
2344
|
]
|
|
2343
|
-
}), f && r !== "__selection__" ? p(
|
|
2345
|
+
}), f && r !== "__selection__" ? p(tr, {
|
|
2344
2346
|
accessor: r,
|
|
2345
|
-
columnRef:
|
|
2347
|
+
columnRef: R
|
|
2346
2348
|
}) : null]
|
|
2347
2349
|
});
|
|
2348
2350
|
}
|
|
2349
|
-
function
|
|
2351
|
+
function or({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2350
2352
|
let u = !o.disabled;
|
|
2351
|
-
return p(
|
|
2353
|
+
return p(z, {
|
|
2352
2354
|
ref: l,
|
|
2353
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2355
|
+
className: X("mantine-datatable-header-selector-cell", { [In]: n === "cell" && u }, e),
|
|
2354
2356
|
style: t,
|
|
2355
2357
|
rowSpan: c,
|
|
2356
2358
|
"data-shadow-visible": r || void 0,
|
|
2357
2359
|
"data-accessor": "__selection__",
|
|
2358
2360
|
onClick: n === "cell" && u ? s : void 0,
|
|
2359
|
-
children: p(
|
|
2360
|
-
classNames: u ? { input:
|
|
2361
|
+
children: p(x, {
|
|
2362
|
+
classNames: u ? { input: In } : void 0,
|
|
2361
2363
|
checked: i,
|
|
2362
2364
|
indeterminate: a,
|
|
2363
2365
|
onChange: s,
|
|
@@ -2366,7 +2368,7 @@ function ir({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
2366
2368
|
})
|
|
2367
2369
|
});
|
|
2368
2370
|
}
|
|
2369
|
-
function
|
|
2371
|
+
function sr(e, t) {
|
|
2370
2372
|
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2371
2373
|
if (r.length === 0 || r.length !== n.length) return;
|
|
2372
2374
|
let i = new Set(r.map((e) => e.logicalSide));
|
|
@@ -2379,10 +2381,10 @@ function ar(e, t) {
|
|
|
2379
2381
|
isBoundary: l?.isBoundary ?? !1
|
|
2380
2382
|
};
|
|
2381
2383
|
}
|
|
2382
|
-
function
|
|
2383
|
-
let E = c ?
|
|
2384
|
+
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 }) {
|
|
2385
|
+
let E = c ? Dn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(or, {
|
|
2384
2386
|
ref: e,
|
|
2385
|
-
className:
|
|
2387
|
+
className: b,
|
|
2386
2388
|
style: S,
|
|
2387
2389
|
trigger: u,
|
|
2388
2390
|
shadowVisible: y,
|
|
@@ -2391,18 +2393,18 @@ function or({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2391
2393
|
checkboxProps: v,
|
|
2392
2394
|
onChange: _,
|
|
2393
2395
|
rowSpan: c ? D : void 0
|
|
2394
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } =
|
|
2396
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = Xt(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? Cn(String(e))])) : void 0, L = m(se, {
|
|
2395
2397
|
className: X("mantine-datatable-header", t),
|
|
2396
2398
|
style: n,
|
|
2397
|
-
ref:
|
|
2398
|
-
onContextMenu:
|
|
2399
|
+
ref: w,
|
|
2400
|
+
onContextMenu: N ? (e) => {
|
|
2399
2401
|
e.preventDefault(), M((e) => !e);
|
|
2400
2402
|
} : void 0,
|
|
2401
2403
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2402
|
-
let n =
|
|
2403
|
-
return m(
|
|
2404
|
+
let n = An(c, t);
|
|
2405
|
+
return m(B, { children: [t === 0 && O, n.map((e, r) => p(Gn, {
|
|
2404
2406
|
group: e,
|
|
2405
|
-
pinnedInfo:
|
|
2407
|
+
pinnedInfo: sr(e, l),
|
|
2406
2408
|
maxDepth: E,
|
|
2407
2409
|
currentDepth: t,
|
|
2408
2410
|
previousGroups: n.slice(0, r),
|
|
@@ -2410,13 +2412,13 @@ function or({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2410
2412
|
withColumnBorders: C,
|
|
2411
2413
|
totalTableColumns: o.length
|
|
2412
2414
|
}, e.id))] }, `group-depth-${t}`);
|
|
2413
|
-
}), m(
|
|
2415
|
+
}), m(B, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2414
2416
|
if (e) return null;
|
|
2415
2417
|
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 } = {
|
|
2416
2418
|
...s,
|
|
2417
2419
|
...t
|
|
2418
2420
|
};
|
|
2419
|
-
return p(
|
|
2421
|
+
return p(ar, {
|
|
2420
2422
|
accessor: c,
|
|
2421
2423
|
pinnedInfo: l.get(String(c)),
|
|
2422
2424
|
className: b,
|
|
@@ -2441,16 +2443,16 @@ function or({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2441
2443
|
}, c);
|
|
2442
2444
|
})] })]
|
|
2443
2445
|
});
|
|
2444
|
-
return
|
|
2446
|
+
return N ? m(F, {
|
|
2445
2447
|
position: "bottom",
|
|
2446
2448
|
withArrow: !0,
|
|
2447
2449
|
shadow: "md",
|
|
2448
2450
|
opened: j,
|
|
2449
2451
|
onChange: M,
|
|
2450
|
-
children: [p(ee, { children:
|
|
2452
|
+
children: [p(ee, { children: L }), p(I, { children: p(ne, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2451
2453
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2452
2454
|
size: "xs",
|
|
2453
|
-
label:
|
|
2455
|
+
label: P[e.accessor],
|
|
2454
2456
|
checked: e.toggled,
|
|
2455
2457
|
onChange: (t) => {
|
|
2456
2458
|
A(k.map((n) => n.accessor === e.accessor ? {
|
|
@@ -2459,20 +2461,20 @@ function or({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2459
2461
|
} : n));
|
|
2460
2462
|
}
|
|
2461
2463
|
}) }, e.accessor)) }) })]
|
|
2462
|
-
}) :
|
|
2464
|
+
}) : L;
|
|
2463
2465
|
}
|
|
2464
|
-
function
|
|
2465
|
-
return p(
|
|
2466
|
+
function lr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2467
|
+
return p(b, {
|
|
2466
2468
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2467
2469
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
2468
|
-
children: e && (t || p(
|
|
2470
|
+
children: e && (t || p(D, {
|
|
2469
2471
|
size: r,
|
|
2470
2472
|
type: i,
|
|
2471
2473
|
color: a
|
|
2472
2474
|
}))
|
|
2473
2475
|
});
|
|
2474
2476
|
}
|
|
2475
|
-
function
|
|
2477
|
+
function ur() {
|
|
2476
2478
|
return m("svg", {
|
|
2477
2479
|
width: "14",
|
|
2478
2480
|
height: "14",
|
|
@@ -2493,48 +2495,48 @@ function cr() {
|
|
|
2493
2495
|
]
|
|
2494
2496
|
});
|
|
2495
2497
|
}
|
|
2496
|
-
var
|
|
2497
|
-
xs:
|
|
2498
|
-
sm:
|
|
2499
|
-
md:
|
|
2500
|
-
lg:
|
|
2501
|
-
xl:
|
|
2498
|
+
var dr = {
|
|
2499
|
+
xs: me(22),
|
|
2500
|
+
sm: me(26),
|
|
2501
|
+
md: me(32),
|
|
2502
|
+
lg: me(38),
|
|
2503
|
+
xl: me(44)
|
|
2502
2504
|
};
|
|
2503
|
-
function
|
|
2504
|
-
return m(
|
|
2505
|
+
function fr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2506
|
+
return m(T, {
|
|
2505
2507
|
gap: "xs",
|
|
2506
|
-
children: [p(
|
|
2508
|
+
children: [p(V, {
|
|
2507
2509
|
component: "div",
|
|
2508
2510
|
size: e,
|
|
2509
2511
|
children: t
|
|
2510
|
-
}), m(
|
|
2512
|
+
}), m(O, {
|
|
2511
2513
|
withinPortal: !0,
|
|
2512
2514
|
withArrow: !0,
|
|
2513
2515
|
offset: 2,
|
|
2514
2516
|
classNames: { arrow: "mantine-datatable-page-size-selector-menu-arrow" },
|
|
2515
|
-
children: [p(
|
|
2517
|
+
children: [p(j, { children: p(y, {
|
|
2516
2518
|
size: e,
|
|
2517
2519
|
variant: "default",
|
|
2518
2520
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2519
|
-
rightSection: p(
|
|
2521
|
+
rightSection: p(ur, {}),
|
|
2520
2522
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2521
|
-
height:
|
|
2523
|
+
height: dr[e],
|
|
2522
2524
|
paddingLeft: t.spacing[e],
|
|
2523
2525
|
paddingRight: t.spacing[e]
|
|
2524
2526
|
})],
|
|
2525
2527
|
children: r
|
|
2526
|
-
}) }), p(
|
|
2528
|
+
}) }), p(k, { children: n.map((t) => {
|
|
2527
2529
|
let n = t === r;
|
|
2528
|
-
return p(
|
|
2530
|
+
return p(A, {
|
|
2529
2531
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2530
|
-
style: [{ height:
|
|
2532
|
+
style: [{ height: dr[e] }, n && (i || a) ? (e) => qt({
|
|
2531
2533
|
theme: e,
|
|
2532
2534
|
paginationActiveTextColor: i,
|
|
2533
2535
|
paginationActiveBackgroundColor: a
|
|
2534
2536
|
}) : void 0],
|
|
2535
2537
|
disabled: n,
|
|
2536
2538
|
onClick: () => o(t),
|
|
2537
|
-
children: p(
|
|
2539
|
+
children: p(V, {
|
|
2538
2540
|
component: "div",
|
|
2539
2541
|
size: e,
|
|
2540
2542
|
children: t
|
|
@@ -2544,40 +2546,40 @@ function ur({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2544
2546
|
})]
|
|
2545
2547
|
});
|
|
2546
2548
|
}
|
|
2547
|
-
function
|
|
2549
|
+
function pr({ 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 }) {
|
|
2548
2550
|
let O;
|
|
2549
2551
|
if (g) {
|
|
2550
|
-
let e = (r - 1) *
|
|
2552
|
+
let e = (r - 1) * _ + 1;
|
|
2551
2553
|
O = h({
|
|
2552
2554
|
from: e,
|
|
2553
2555
|
to: e + (S || 0) - 1,
|
|
2554
2556
|
totalRecords: g
|
|
2555
2557
|
});
|
|
2556
2558
|
} else O = n ? u : d;
|
|
2557
|
-
let k = g &&
|
|
2558
|
-
Text: (e) => p(
|
|
2559
|
+
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 = !Sn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${me(w)}rem` : e[w] || w})`), N = {
|
|
2560
|
+
Text: (e) => p(V, {
|
|
2559
2561
|
component: "div",
|
|
2560
2562
|
className: "mantine-datatable-pagination-text",
|
|
2561
2563
|
size: l,
|
|
2562
2564
|
...e,
|
|
2563
2565
|
children: O
|
|
2564
2566
|
}),
|
|
2565
|
-
PageSizeSelector: (e) => x ? p(
|
|
2567
|
+
PageSizeSelector: (e) => x ? p(fr, {
|
|
2566
2568
|
activeTextColor: s,
|
|
2567
2569
|
activeBackgroundColor: c,
|
|
2568
2570
|
size: l,
|
|
2569
2571
|
label: b,
|
|
2570
2572
|
values: x,
|
|
2571
|
-
value:
|
|
2573
|
+
value: _,
|
|
2572
2574
|
onChange: y,
|
|
2573
2575
|
...e
|
|
2574
2576
|
}) : null,
|
|
2575
|
-
Pagination: (e) => p(
|
|
2577
|
+
Pagination: (e) => p(P, {
|
|
2576
2578
|
classNames: {
|
|
2577
2579
|
root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
|
|
2578
2580
|
control: "mantine-datatable-pagination-pages-control"
|
|
2579
2581
|
},
|
|
2580
|
-
style: s || c ? (e) =>
|
|
2582
|
+
style: s || c ? (e) => qt({
|
|
2581
2583
|
theme: e,
|
|
2582
2584
|
paginationActiveTextColor: s,
|
|
2583
2585
|
paginationActiveBackgroundColor: c
|
|
@@ -2592,49 +2594,49 @@ function dr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2592
2594
|
getItemProps: E,
|
|
2593
2595
|
...e
|
|
2594
2596
|
})
|
|
2595
|
-
},
|
|
2597
|
+
}, F = {
|
|
2596
2598
|
state: {
|
|
2597
2599
|
paginationSize: l,
|
|
2598
2600
|
page: r,
|
|
2599
2601
|
totalPages: k,
|
|
2600
2602
|
totalRecords: g,
|
|
2601
|
-
recordsPerPage:
|
|
2603
|
+
recordsPerPage: _,
|
|
2602
2604
|
recordsLength: S,
|
|
2603
2605
|
fetching: n,
|
|
2604
2606
|
from: A,
|
|
2605
2607
|
to: j,
|
|
2606
|
-
isWrapped:
|
|
2608
|
+
isWrapped: M
|
|
2607
2609
|
},
|
|
2608
2610
|
actions: {
|
|
2609
2611
|
setPage: (e) => i?.(e),
|
|
2610
2612
|
setRecordsPerPage: y ? (e) => y(e) : void 0
|
|
2611
2613
|
},
|
|
2612
|
-
Controls:
|
|
2614
|
+
Controls: N
|
|
2613
2615
|
};
|
|
2614
|
-
return p(
|
|
2616
|
+
return p(v, {
|
|
2615
2617
|
px: C ?? "xs",
|
|
2616
2618
|
py: "xs",
|
|
2617
2619
|
className: X("mantine-datatable-pagination", e),
|
|
2618
|
-
style: [{ flexDirection:
|
|
2619
|
-
children: typeof D == "function" ? D(
|
|
2620
|
-
p(
|
|
2621
|
-
p(
|
|
2622
|
-
p(
|
|
2620
|
+
style: [{ flexDirection: M ? "column" : "row" }, t],
|
|
2621
|
+
children: typeof D == "function" ? D(F) : m(f, { children: [
|
|
2622
|
+
p(N.Text, {}),
|
|
2623
|
+
p(N.PageSizeSelector, {}),
|
|
2624
|
+
p(N.Pagination, {})
|
|
2623
2625
|
] })
|
|
2624
2626
|
});
|
|
2625
2627
|
}
|
|
2626
|
-
function
|
|
2627
|
-
return
|
|
2628
|
+
function mr({ 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: _ }) {
|
|
2629
|
+
return Sn(r) ? p(ae, {
|
|
2628
2630
|
"data-pinned": n?.position,
|
|
2629
2631
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2630
2632
|
className: X({
|
|
2631
|
-
[
|
|
2632
|
-
[
|
|
2633
|
-
[
|
|
2634
|
-
[
|
|
2635
|
-
[
|
|
2636
|
-
[
|
|
2637
|
-
[
|
|
2633
|
+
[Pn]: l || u,
|
|
2634
|
+
[Fn]: u,
|
|
2635
|
+
[In]: o || s,
|
|
2636
|
+
[Ln]: c,
|
|
2637
|
+
[zn]: d === "left",
|
|
2638
|
+
[Bn]: d === "center",
|
|
2639
|
+
[Vn]: d === "right"
|
|
2638
2640
|
}, e),
|
|
2639
2641
|
style: [
|
|
2640
2642
|
{
|
|
@@ -2653,15 +2655,15 @@ function fr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2653
2655
|
onDoubleClick: s,
|
|
2654
2656
|
onContextMenu: c,
|
|
2655
2657
|
..._?.(i, a),
|
|
2656
|
-
children: h ? h(i, a) : g ? g(i, a, m) :
|
|
2658
|
+
children: h ? h(i, a) : g ? g(i, a, m) : En(i, m)
|
|
2657
2659
|
}) : null;
|
|
2658
2660
|
}
|
|
2659
|
-
function
|
|
2660
|
-
let { expanded: i, visible: a } =
|
|
2661
|
-
return a ? m(f, { children: [p(
|
|
2661
|
+
function hr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2662
|
+
let { expanded: i, visible: a } = Nn(e, r?.transitionDuration);
|
|
2663
|
+
return a ? m(f, { children: [p(B, {}), p(B, { children: p(ae, {
|
|
2662
2664
|
className: "mantine-datatable-row-expansion-cell",
|
|
2663
2665
|
colSpan: t,
|
|
2664
|
-
children: p(
|
|
2666
|
+
children: p(S, {
|
|
2665
2667
|
expanded: i,
|
|
2666
2668
|
...r,
|
|
2667
2669
|
children: p("div", {
|
|
@@ -2671,28 +2673,28 @@ function pr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2671
2673
|
})
|
|
2672
2674
|
}) })] }) : null;
|
|
2673
2675
|
}
|
|
2674
|
-
function
|
|
2676
|
+
function gr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2675
2677
|
let u = {
|
|
2676
2678
|
...s,
|
|
2677
2679
|
...c(n, r)
|
|
2678
2680
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2679
2681
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2680
2682
|
};
|
|
2681
|
-
return p(
|
|
2682
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2683
|
+
return p(ae, {
|
|
2684
|
+
className: X("mantine-datatable-row-selector-cell", { [In]: i === "cell" && d }, e),
|
|
2683
2685
|
style: t,
|
|
2684
2686
|
"data-shadow-visible": o || void 0,
|
|
2685
2687
|
onClick: f,
|
|
2686
|
-
children: p(
|
|
2687
|
-
classNames: d ? { input:
|
|
2688
|
+
children: p(x, {
|
|
2689
|
+
classNames: d ? { input: In } : void 0,
|
|
2688
2690
|
onChange: a,
|
|
2689
2691
|
...l,
|
|
2690
2692
|
...u
|
|
2691
2693
|
})
|
|
2692
2694
|
});
|
|
2693
2695
|
}
|
|
2694
|
-
function
|
|
2695
|
-
let M = m(f, { children: [s && p(
|
|
2696
|
+
function _r({ 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 }) {
|
|
2697
|
+
let M = m(f, { children: [s && p(gr, {
|
|
2696
2698
|
className: k,
|
|
2697
2699
|
style: A,
|
|
2698
2700
|
record: e,
|
|
@@ -2710,7 +2712,7 @@ function hr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2710
2712
|
...r,
|
|
2711
2713
|
...s
|
|
2712
2714
|
};
|
|
2713
|
-
return p(
|
|
2715
|
+
return p(mr, {
|
|
2714
2716
|
pinnedInfo: i.get(String(l)),
|
|
2715
2717
|
className: typeof _ == "function" ? _(e, t) : _,
|
|
2716
2718
|
style: v?.(e, t),
|
|
@@ -2747,7 +2749,7 @@ function hr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2747
2749
|
defaultRender: a,
|
|
2748
2750
|
customCellAttributes: S
|
|
2749
2751
|
}, l);
|
|
2750
|
-
})] }), N = S && p(
|
|
2752
|
+
})] }), N = S && p(hr, {
|
|
2751
2753
|
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2752
2754
|
open: S.isRowExpanded(e),
|
|
2753
2755
|
content: S.content({
|
|
@@ -2755,7 +2757,7 @@ function hr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2755
2757
|
index: t
|
|
2756
2758
|
}),
|
|
2757
2759
|
collapseProps: S.collapseProps
|
|
2758
|
-
}), P =
|
|
2760
|
+
}), P = vr({
|
|
2759
2761
|
record: e,
|
|
2760
2762
|
index: t,
|
|
2761
2763
|
selectionChecked: c,
|
|
@@ -2775,17 +2777,17 @@ function hr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2775
2777
|
rowProps: P,
|
|
2776
2778
|
children: M,
|
|
2777
2779
|
expandedElement: N
|
|
2778
|
-
}) : m(f, { children: [p(
|
|
2780
|
+
}) : m(f, { children: [p(B, {
|
|
2779
2781
|
...P,
|
|
2780
2782
|
children: M
|
|
2781
2783
|
}), N] });
|
|
2782
2784
|
}
|
|
2783
|
-
function
|
|
2785
|
+
function vr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
|
|
2784
2786
|
return {
|
|
2785
|
-
className: X("mantine-datatable-row", { [
|
|
2787
|
+
className: X("mantine-datatable-row", { [In]: r || i || o?.isExpandable({
|
|
2786
2788
|
record: e,
|
|
2787
2789
|
index: t
|
|
2788
|
-
}) && o?.expandOnClick }, { [
|
|
2790
|
+
}) && o?.expandOnClick }, { [Ln]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2789
2791
|
"data-selected": n || void 0,
|
|
2790
2792
|
onClick: (n) => {
|
|
2791
2793
|
if (o) {
|
|
@@ -2813,7 +2815,7 @@ function gr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2813
2815
|
}) : void 0,
|
|
2814
2816
|
style: [c || l ? (n) => {
|
|
2815
2817
|
let r = c?.(e, t), i = l?.(e, t);
|
|
2816
|
-
return
|
|
2818
|
+
return Jt({
|
|
2817
2819
|
theme: n,
|
|
2818
2820
|
color: r,
|
|
2819
2821
|
backgroundColor: i
|
|
@@ -2822,8 +2824,8 @@ function gr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2822
2824
|
...s?.(e, t) ?? {}
|
|
2823
2825
|
};
|
|
2824
2826
|
}
|
|
2825
|
-
function
|
|
2826
|
-
return m(
|
|
2827
|
+
function yr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2828
|
+
return m(L, {
|
|
2827
2829
|
...a,
|
|
2828
2830
|
viewportRef: i,
|
|
2829
2831
|
classNames: {
|
|
@@ -2835,15 +2837,15 @@ function _r({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2835
2837
|
onScrollPositionChange: n,
|
|
2836
2838
|
children: [
|
|
2837
2839
|
r,
|
|
2838
|
-
p(
|
|
2840
|
+
p(v, { className: X("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-top-shadow") }),
|
|
2839
2841
|
p("div", { className: X("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-left-shadow", { "mantine-datatable-scroll-area-shadow-behind": e }) }),
|
|
2840
2842
|
p("div", { className: X("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-right-shadow", { "mantine-datatable-scroll-area-shadow-behind": t }) }),
|
|
2841
|
-
p(
|
|
2843
|
+
p(v, { className: X("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-bottom-shadow") })
|
|
2842
2844
|
]
|
|
2843
2845
|
});
|
|
2844
2846
|
}
|
|
2845
|
-
function
|
|
2846
|
-
let
|
|
2847
|
+
function br({ 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: I, onSortStatusChange: ee, horizontalSpacing: L, page: R, onPageChange: te, totalRecords: ne, recordsPerPage: re, onRecordsPerPageChange: ae, recordsPerPageOptions: oe, recordsPerPageLabel: z = "Records per page", paginationWithEdges: se, paginationWithControls: B, 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: H, onCellDoubleClick: Ae, onCellContextMenu: Me, onScroll: Ne, onScrollToTop: Pe, onScrollToBottom: U, onScrollToLeft: W, onScrollToRight: Fe, c: Ie, backgroundColor: Le, borderColor: Re, rowBorderColor: ze, stripedColor: G, highlightOnHoverColor: K, rowColor: Be, rowBackgroundColor: Ve, rowExpansion: He, rowClassName: Ue, rowStyle: We, customRowAttributes: Ge, scrollViewportRef: Ke, scrollAreaProps: qe, tableRef: Je, bodyRef: Ye, m: Xe, my: Ze, mx: Qe, mt: $e, mb: et, ml: tt, mr: nt, className: rt, classNames: it, style: at, styles: ot, rowFactory: st, tableWrapper: ct, ...lt }) {
|
|
2848
|
+
let ut = l(() => y ? On(y) : g, [g, y]), { refs: q, onScroll: dt } = hn({
|
|
2847
2849
|
scrollCallbacks: {
|
|
2848
2850
|
onScroll: Ne,
|
|
2849
2851
|
onScrollToTop: Pe,
|
|
@@ -2851,82 +2853,82 @@ function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2851
2853
|
onScrollToLeft: W,
|
|
2852
2854
|
onScrollToRight: Fe
|
|
2853
2855
|
},
|
|
2854
|
-
withRowBorders:
|
|
2855
|
-
}),
|
|
2856
|
-
key:
|
|
2857
|
-
columns:
|
|
2858
|
-
headerRef:
|
|
2859
|
-
scrollViewportRef:
|
|
2860
|
-
}),
|
|
2861
|
-
rowExpansion:
|
|
2856
|
+
withRowBorders: lt.withRowBorders
|
|
2857
|
+
}), J = on({
|
|
2858
|
+
key: _,
|
|
2859
|
+
columns: ut,
|
|
2860
|
+
headerRef: q.header,
|
|
2861
|
+
scrollViewportRef: q.scrollViewport
|
|
2862
|
+
}), ft = J.effectiveColumns, pt = je(q.table, Je), mt = je(q.scrollViewport, Ke), ht = u(null), gt = je(ht, Ye), _t = Mn({
|
|
2863
|
+
rowExpansion: He,
|
|
2862
2864
|
records: T,
|
|
2863
2865
|
idAccessor: w
|
|
2864
|
-
}), { pinnedMap:
|
|
2865
|
-
columns:
|
|
2866
|
-
theadRef:
|
|
2867
|
-
tbodyRef:
|
|
2868
|
-
selectionColumnHeaderRef:
|
|
2866
|
+
}), { pinnedMap: vt, hasLeftPinned: yt, hasRightPinned: bt } = gn({
|
|
2867
|
+
columns: ft,
|
|
2868
|
+
theadRef: q.header,
|
|
2869
|
+
tbodyRef: ht,
|
|
2870
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
2869
2871
|
selectionVisible: !!D,
|
|
2870
2872
|
pinFirstColumn: b,
|
|
2871
2873
|
pinLastColumn: x
|
|
2872
|
-
}),
|
|
2873
|
-
|
|
2874
|
-
}, [
|
|
2874
|
+
}), xt = u(!1), St = u(R), Ct = u(T), wt = a((e) => {
|
|
2875
|
+
xt.current = !0, Ct.current = T, te(e);
|
|
2876
|
+
}, [te, T]);
|
|
2875
2877
|
s(() => {
|
|
2876
|
-
|
|
2877
|
-
}, [
|
|
2878
|
-
let
|
|
2878
|
+
St.current !== R && (xt.current = !0, Ct.current = T, St.current = R);
|
|
2879
|
+
}, [R, T]);
|
|
2880
|
+
let Tt = T?.length;
|
|
2879
2881
|
c(() => {
|
|
2880
|
-
if (!
|
|
2881
|
-
let e =
|
|
2882
|
+
if (!xt.current || h || T === Ct.current) return;
|
|
2883
|
+
let e = q.scrollViewport.current;
|
|
2882
2884
|
if (!e) return;
|
|
2883
2885
|
let t = requestAnimationFrame(() => {
|
|
2884
2886
|
e.scrollTo({
|
|
2885
2887
|
top: 0,
|
|
2886
2888
|
left: 0
|
|
2887
|
-
}),
|
|
2889
|
+
}), xt.current = !1;
|
|
2888
2890
|
});
|
|
2889
2891
|
return () => cancelAnimationFrame(t);
|
|
2890
2892
|
}, [
|
|
2891
2893
|
h,
|
|
2892
2894
|
T,
|
|
2893
|
-
|
|
2895
|
+
q.scrollViewport
|
|
2894
2896
|
]);
|
|
2895
|
-
let
|
|
2896
|
-
D && O && O(jt ? D.filter((e) => !
|
|
2897
|
+
let Et = T?.map((e) => $(e, w)), Dt = !!D, Ot = D?.map((e) => $(e, w)), kt = Et !== void 0 && Ot !== void 0 && Ot.length > 0, At = j ? T?.filter(j) : T, Y = At?.map((e) => $(e, w)), jt = kt && Y.every((e) => Ot.includes(e)), Mt = kt && Y.some((e) => Ot.includes(e)), Nt = a(() => {
|
|
2898
|
+
D && O && O(jt ? D.filter((e) => !Y.includes($(e, w))) : Tn([...D, ...At], (e) => $(e, w)));
|
|
2897
2899
|
}, [
|
|
2898
2900
|
jt,
|
|
2899
2901
|
w,
|
|
2900
2902
|
O,
|
|
2903
|
+
Y,
|
|
2901
2904
|
At,
|
|
2902
|
-
kt,
|
|
2903
2905
|
D
|
|
2904
|
-
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } =
|
|
2905
|
-
m:
|
|
2906
|
-
my:
|
|
2907
|
-
mx:
|
|
2908
|
-
mt:
|
|
2909
|
-
mb:
|
|
2910
|
-
ml:
|
|
2911
|
-
mr:
|
|
2912
|
-
}, Rt = a(({ children: e }) =>
|
|
2913
|
-
return p(
|
|
2914
|
-
...
|
|
2915
|
-
pinnedMap:
|
|
2916
|
-
children: m(
|
|
2917
|
-
ref:
|
|
2906
|
+
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = _n(Et), It = Dt && !yt, Lt = {
|
|
2907
|
+
m: Xe,
|
|
2908
|
+
my: Ze,
|
|
2909
|
+
mx: Qe,
|
|
2910
|
+
mt: $e,
|
|
2911
|
+
mb: et,
|
|
2912
|
+
ml: tt,
|
|
2913
|
+
mr: nt
|
|
2914
|
+
}, Rt = a(({ children: e }) => ct ? ct({ children: e }) : e, [ct]);
|
|
2915
|
+
return p(Zt, {
|
|
2916
|
+
...J,
|
|
2917
|
+
pinnedMap: vt,
|
|
2918
|
+
children: m(v, {
|
|
2919
|
+
ref: q.root,
|
|
2918
2920
|
...Lt,
|
|
2919
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2921
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, rt, it?.root),
|
|
2920
2922
|
style: [
|
|
2921
2923
|
(e) => ({
|
|
2922
|
-
...
|
|
2924
|
+
...Kt({
|
|
2923
2925
|
theme: e,
|
|
2924
2926
|
c: Ie,
|
|
2925
2927
|
backgroundColor: Le,
|
|
2926
|
-
borderColor:
|
|
2927
|
-
rowBorderColor:
|
|
2928
|
-
stripedColor:
|
|
2929
|
-
highlightOnHoverColor:
|
|
2928
|
+
borderColor: Re,
|
|
2929
|
+
rowBorderColor: ze,
|
|
2930
|
+
stripedColor: G,
|
|
2931
|
+
highlightOnHoverColor: K
|
|
2930
2932
|
}),
|
|
2931
2933
|
borderRadius: e.radius[t] || t,
|
|
2932
2934
|
boxShadow: e.shadows[d] || d,
|
|
@@ -2934,55 +2936,55 @@ function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2934
2936
|
minHeight: i,
|
|
2935
2937
|
maxHeight: o
|
|
2936
2938
|
}),
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
+
at,
|
|
2940
|
+
ot?.root,
|
|
2939
2941
|
{ position: "relative" }
|
|
2940
2942
|
],
|
|
2941
2943
|
children: [
|
|
2942
|
-
p(
|
|
2943
|
-
viewportRef:
|
|
2944
|
-
leftShadowBehind:
|
|
2945
|
-
rightShadowBehind:
|
|
2946
|
-
onScrollPositionChange:
|
|
2947
|
-
scrollAreaProps:
|
|
2948
|
-
children: p(Rt, { children: m(
|
|
2949
|
-
ref:
|
|
2950
|
-
horizontalSpacing:
|
|
2944
|
+
p(yr, {
|
|
2945
|
+
viewportRef: mt,
|
|
2946
|
+
leftShadowBehind: Dt || yt,
|
|
2947
|
+
rightShadowBehind: bt,
|
|
2948
|
+
onScrollPositionChange: dt,
|
|
2949
|
+
scrollAreaProps: qe,
|
|
2950
|
+
children: p(Rt, { children: m(ie, {
|
|
2951
|
+
ref: pt,
|
|
2952
|
+
horizontalSpacing: L,
|
|
2951
2953
|
className: X("mantine-datatable-table", {
|
|
2952
|
-
[
|
|
2954
|
+
[Rn]: n,
|
|
2953
2955
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
2954
2956
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
2955
|
-
"mantine-datatable-selection-column-visible":
|
|
2956
|
-
"mantine-datatable-resizable-columns":
|
|
2957
|
-
"mantine-datatable-resize-locked":
|
|
2958
|
-
"mantine-datatable-resizing":
|
|
2959
|
-
},
|
|
2957
|
+
"mantine-datatable-selection-column-visible": Dt,
|
|
2958
|
+
"mantine-datatable-resizable-columns": J.hasResizableColumns,
|
|
2959
|
+
"mantine-datatable-resize-locked": J.isLocked,
|
|
2960
|
+
"mantine-datatable-resizing": J.isResizing
|
|
2961
|
+
}, it?.table),
|
|
2960
2962
|
style: {
|
|
2961
|
-
...
|
|
2962
|
-
...
|
|
2963
|
-
...
|
|
2963
|
+
...ot?.table,
|
|
2964
|
+
...J.isLocked ? { tableLayout: "fixed" } : null,
|
|
2965
|
+
...J.tableWidth == null ? null : { width: `${J.tableWidth}px` }
|
|
2964
2966
|
},
|
|
2965
|
-
"data-striped":
|
|
2967
|
+
"data-striped": Tt && Te || void 0,
|
|
2966
2968
|
"data-highlight-on-hover": we || void 0,
|
|
2967
|
-
...
|
|
2969
|
+
...lt,
|
|
2968
2970
|
children: [
|
|
2969
|
-
Ee ? null : p(
|
|
2970
|
-
...
|
|
2971
|
-
pinnedMap:
|
|
2972
|
-
children: p(
|
|
2973
|
-
ref:
|
|
2974
|
-
selectionColumnHeaderRef:
|
|
2975
|
-
className:
|
|
2976
|
-
style:
|
|
2977
|
-
columns:
|
|
2971
|
+
Ee ? null : p(Zt, {
|
|
2972
|
+
...J,
|
|
2973
|
+
pinnedMap: vt,
|
|
2974
|
+
children: p(cr, {
|
|
2975
|
+
ref: q.header,
|
|
2976
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
2977
|
+
className: it?.header,
|
|
2978
|
+
style: ot?.header,
|
|
2979
|
+
columns: ft,
|
|
2978
2980
|
defaultColumnProps: S,
|
|
2979
2981
|
groups: y,
|
|
2980
|
-
pinnedMap:
|
|
2981
|
-
sortStatus:
|
|
2982
|
-
sortIcons:
|
|
2983
|
-
onSortStatusChange:
|
|
2982
|
+
pinnedMap: vt,
|
|
2983
|
+
sortStatus: F,
|
|
2984
|
+
sortIcons: I,
|
|
2985
|
+
onSortStatusChange: ee,
|
|
2984
2986
|
selectionTrigger: E,
|
|
2985
|
-
selectionVisible:
|
|
2987
|
+
selectionVisible: Dt,
|
|
2986
2988
|
selectionChecked: jt,
|
|
2987
2989
|
selectionIndeterminate: Mt && !jt,
|
|
2988
2990
|
onSelectionChange: Nt,
|
|
@@ -2993,28 +2995,28 @@ function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2993
2995
|
selectorCellShadowVisible: It,
|
|
2994
2996
|
selectionColumnClassName: k,
|
|
2995
2997
|
selectionColumnStyle: A,
|
|
2996
|
-
withColumnBorders:
|
|
2998
|
+
withColumnBorders: lt.withColumnBorders
|
|
2997
2999
|
})
|
|
2998
3000
|
}),
|
|
2999
3001
|
p("tbody", {
|
|
3000
|
-
ref:
|
|
3001
|
-
children:
|
|
3002
|
-
let n = $(e, w), r =
|
|
3002
|
+
ref: gt,
|
|
3003
|
+
children: Tt ? T.map((e, t) => {
|
|
3004
|
+
let n = $(e, w), r = Ot?.includes(n) || !1, i;
|
|
3003
3005
|
return O && D && (i = (i) => {
|
|
3004
3006
|
if (i.nativeEvent.shiftKey && Pt !== null) {
|
|
3005
3007
|
let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (j ? j(e, n) : !0) : (e, n) => n >= t && n <= Pt && (j ? j(e, n) : !0));
|
|
3006
|
-
O(r ?
|
|
3007
|
-
} else O(r ? D.filter((e) => $(e, w) !== n) :
|
|
3008
|
+
O(r ? wn(D, e, (e) => $(e, w)) : Tn([...D, ...e], (e) => $(e, w)));
|
|
3009
|
+
} else O(r ? D.filter((e) => $(e, w) !== n) : Tn([...D, e], (e) => $(e, w)));
|
|
3008
3010
|
Ft(t);
|
|
3009
|
-
}), p(
|
|
3011
|
+
}), p(_r, {
|
|
3010
3012
|
record: e,
|
|
3011
3013
|
index: t,
|
|
3012
|
-
columns:
|
|
3014
|
+
columns: ft,
|
|
3013
3015
|
defaultColumnProps: S,
|
|
3014
|
-
pinnedMap:
|
|
3016
|
+
pinnedMap: vt,
|
|
3015
3017
|
defaultColumnRender: C,
|
|
3016
3018
|
selectionTrigger: E,
|
|
3017
|
-
selectionVisible:
|
|
3019
|
+
selectionVisible: Dt,
|
|
3018
3020
|
selectionChecked: r,
|
|
3019
3021
|
onSelectionChange: i,
|
|
3020
3022
|
isRecordSelectable: j,
|
|
@@ -3022,75 +3024,75 @@ function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3022
3024
|
getSelectionCheckboxProps: P,
|
|
3023
3025
|
onClick: De,
|
|
3024
3026
|
onDoubleClick: Oe,
|
|
3025
|
-
onCellClick:
|
|
3026
|
-
onCellDoubleClick:
|
|
3027
|
+
onCellClick: H,
|
|
3028
|
+
onCellDoubleClick: Ae,
|
|
3027
3029
|
onContextMenu: ke,
|
|
3028
3030
|
onCellContextMenu: Me,
|
|
3029
|
-
expansion:
|
|
3031
|
+
expansion: _t,
|
|
3030
3032
|
color: Be,
|
|
3031
|
-
backgroundColor:
|
|
3032
|
-
className:
|
|
3033
|
-
style:
|
|
3034
|
-
customAttributes:
|
|
3033
|
+
backgroundColor: Ve,
|
|
3034
|
+
className: Ue,
|
|
3035
|
+
style: We,
|
|
3036
|
+
customAttributes: Ge,
|
|
3035
3037
|
selectorCellShadowVisible: It,
|
|
3036
3038
|
selectionColumnClassName: k,
|
|
3037
3039
|
selectionColumnStyle: A,
|
|
3038
3040
|
idAccessor: w,
|
|
3039
|
-
rowFactory:
|
|
3041
|
+
rowFactory: st
|
|
3040
3042
|
}, n);
|
|
3041
|
-
}) : p(
|
|
3043
|
+
}) : p(Qt, {})
|
|
3042
3044
|
}),
|
|
3043
|
-
|
|
3044
|
-
ref:
|
|
3045
|
-
className:
|
|
3046
|
-
style:
|
|
3047
|
-
columns:
|
|
3045
|
+
ft.some(({ footer: e }) => e) && p(Wn, {
|
|
3046
|
+
ref: q.footer,
|
|
3047
|
+
className: it?.footer,
|
|
3048
|
+
style: ot?.footer,
|
|
3049
|
+
columns: ft,
|
|
3048
3050
|
defaultColumnProps: S,
|
|
3049
|
-
pinnedMap:
|
|
3050
|
-
selectionVisible:
|
|
3051
|
+
pinnedMap: vt,
|
|
3052
|
+
selectionVisible: Dt,
|
|
3051
3053
|
selectorCellShadowVisible: It
|
|
3052
3054
|
})
|
|
3053
3055
|
]
|
|
3054
3056
|
}) })
|
|
3055
3057
|
}),
|
|
3056
|
-
!!(
|
|
3057
|
-
className:
|
|
3058
|
-
style:
|
|
3059
|
-
horizontalSpacing:
|
|
3058
|
+
!!(R && Tt) && p(pr, {
|
|
3059
|
+
className: it?.pagination,
|
|
3060
|
+
style: ot?.pagination,
|
|
3061
|
+
horizontalSpacing: L,
|
|
3060
3062
|
fetching: h,
|
|
3061
|
-
page:
|
|
3062
|
-
onPageChange:
|
|
3063
|
-
totalRecords:
|
|
3064
|
-
recordsPerPage:
|
|
3065
|
-
onRecordsPerPageChange:
|
|
3066
|
-
recordsPerPageOptions:
|
|
3067
|
-
recordsPerPageLabel:
|
|
3068
|
-
paginationWithEdges:
|
|
3069
|
-
paginationWithControls:
|
|
3070
|
-
paginationActiveTextColor:
|
|
3071
|
-
paginationActiveBackgroundColor:
|
|
3072
|
-
paginationSize:
|
|
3073
|
-
paginationText:
|
|
3074
|
-
paginationWrapBreakpoint:
|
|
3075
|
-
getPaginationControlProps:
|
|
3076
|
-
getPaginationItemProps:
|
|
3063
|
+
page: R,
|
|
3064
|
+
onPageChange: wt,
|
|
3065
|
+
totalRecords: ne,
|
|
3066
|
+
recordsPerPage: re,
|
|
3067
|
+
onRecordsPerPageChange: ae,
|
|
3068
|
+
recordsPerPageOptions: oe,
|
|
3069
|
+
recordsPerPageLabel: z,
|
|
3070
|
+
paginationWithEdges: se,
|
|
3071
|
+
paginationWithControls: B,
|
|
3072
|
+
paginationActiveTextColor: ce,
|
|
3073
|
+
paginationActiveBackgroundColor: V,
|
|
3074
|
+
paginationSize: le,
|
|
3075
|
+
paginationText: ue,
|
|
3076
|
+
paginationWrapBreakpoint: de,
|
|
3077
|
+
getPaginationControlProps: fe,
|
|
3078
|
+
getPaginationItemProps: pe,
|
|
3077
3079
|
noRecordsText: Se,
|
|
3078
3080
|
loadingText: be,
|
|
3079
|
-
recordsLength:
|
|
3080
|
-
renderPagination:
|
|
3081
|
+
recordsLength: Tt,
|
|
3082
|
+
renderPagination: me
|
|
3081
3083
|
}),
|
|
3082
|
-
p(
|
|
3084
|
+
p(lr, {
|
|
3083
3085
|
fetching: h,
|
|
3084
|
-
backgroundBlur:
|
|
3086
|
+
backgroundBlur: he,
|
|
3085
3087
|
customContent: ge,
|
|
3086
3088
|
size: _e,
|
|
3087
3089
|
type: ve,
|
|
3088
3090
|
color: ye
|
|
3089
3091
|
}),
|
|
3090
|
-
p(
|
|
3092
|
+
p(en, {
|
|
3091
3093
|
icon: Ce,
|
|
3092
3094
|
text: Se,
|
|
3093
|
-
active: !h && !
|
|
3095
|
+
active: !h && !Tt,
|
|
3094
3096
|
children: xe
|
|
3095
3097
|
})
|
|
3096
3098
|
]
|
|
@@ -3099,21 +3101,21 @@ function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3099
3101
|
}
|
|
3100
3102
|
//#endregion
|
|
3101
3103
|
//#region src/DataTable/UpdateModal.tsx
|
|
3102
|
-
function
|
|
3103
|
-
let [c, l] = d(0), [u, h] = d(!1), { data:
|
|
3104
|
+
function xr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o }) {
|
|
3105
|
+
let [c, l] = d(0), [u, h] = d(!1), { data: g, isLoading: v } = zt(i, r, a), { mutateAsync: b, isError: S, error: C, isPending: w } = Ht(i, r), E = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], D = _e({
|
|
3104
3106
|
mode: "uncontrolled",
|
|
3105
3107
|
initialValues: e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {}),
|
|
3106
3108
|
validate: e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !(typeof t.required == "function" ? t.required(n) : t.required) || e ? null : "Pflichtfeld", e), {})
|
|
3107
3109
|
});
|
|
3108
3110
|
s(() => {
|
|
3109
|
-
if (
|
|
3110
|
-
let t = { ...
|
|
3111
|
+
if (g) {
|
|
3112
|
+
let t = { ...g };
|
|
3111
3113
|
e.forEach((e) => {
|
|
3112
3114
|
let n = e.id;
|
|
3113
3115
|
e.type === "boolean" && t[n] === null ? t[n] = !1 : e.type === "date" && t[n] ? t[n] = new Date(t[n]) : t[n] === null && (t[n] = "");
|
|
3114
3116
|
}), D.initialize(t), D.setValues(t);
|
|
3115
3117
|
}
|
|
3116
|
-
}, [
|
|
3118
|
+
}, [g]);
|
|
3117
3119
|
function O(e, t) {
|
|
3118
3120
|
return typeof e.required == "function" ? e.required(t ?? {}) : !!e.required;
|
|
3119
3121
|
}
|
|
@@ -3129,14 +3131,14 @@ function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3129
3131
|
type: e.id.includes("email") ? "email" : void 0,
|
|
3130
3132
|
required: r
|
|
3131
3133
|
}, D.key(e.id)),
|
|
3132
|
-
e.type === "number" && /* @__PURE__ */ p(
|
|
3134
|
+
e.type === "number" && /* @__PURE__ */ p(N, {
|
|
3133
3135
|
decimalSeparator: ",",
|
|
3134
3136
|
label: e.column.title,
|
|
3135
3137
|
placeholder: e.placeholder ?? "",
|
|
3136
3138
|
...D.getInputProps(e.id),
|
|
3137
3139
|
required: r
|
|
3138
3140
|
}, D.key(e.id)),
|
|
3139
|
-
e.type === "date" && /* @__PURE__ */ p(
|
|
3141
|
+
e.type === "date" && /* @__PURE__ */ p(ve, {
|
|
3140
3142
|
label: e.column.title,
|
|
3141
3143
|
placeholder: e.placeholder ?? "",
|
|
3142
3144
|
valueFormat: "DD.MM.YYYY",
|
|
@@ -3144,7 +3146,7 @@ function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3144
3146
|
...D.getInputProps(e.id),
|
|
3145
3147
|
required: r
|
|
3146
3148
|
}, D.key(e.id)),
|
|
3147
|
-
e.type === "boolean" && /* @__PURE__ */ p(
|
|
3149
|
+
e.type === "boolean" && /* @__PURE__ */ p(x, {
|
|
3148
3150
|
mt: "md",
|
|
3149
3151
|
label: e.column.title,
|
|
3150
3152
|
...D.getInputProps(e.id, { type: "checkbox" }),
|
|
@@ -3167,24 +3169,24 @@ function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3167
3169
|
})
|
|
3168
3170
|
] }, e.id);
|
|
3169
3171
|
}
|
|
3170
|
-
return /* @__PURE__ */ m(f, { children: [S && /* @__PURE__ */ p(
|
|
3172
|
+
return /* @__PURE__ */ m(f, { children: [S && /* @__PURE__ */ p(_, {
|
|
3171
3173
|
variant: "outline",
|
|
3172
3174
|
color: "red",
|
|
3173
3175
|
title: C?.name ?? "Fehler aufgetreten",
|
|
3174
3176
|
mb: "lg",
|
|
3175
3177
|
children: C?.message ?? "Fehler aufgetreten"
|
|
3176
|
-
}),
|
|
3178
|
+
}), v ? /* @__PURE__ */ m(ne, {
|
|
3177
3179
|
gap: "md",
|
|
3178
3180
|
children: [
|
|
3179
|
-
/* @__PURE__ */ p(
|
|
3180
|
-
Array(e.length).fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3181
|
-
/* @__PURE__ */ m(
|
|
3181
|
+
/* @__PURE__ */ p(te, { height: 40 }),
|
|
3182
|
+
Array(e.length).fill(0).map((e, t) => /* @__PURE__ */ p(te, { height: 35 }, `skeleton-field-${t}`)),
|
|
3183
|
+
/* @__PURE__ */ m(T, {
|
|
3182
3184
|
mt: "md",
|
|
3183
3185
|
justify: "end",
|
|
3184
|
-
children: [/* @__PURE__ */ p(
|
|
3186
|
+
children: [/* @__PURE__ */ p(te, {
|
|
3185
3187
|
width: 100,
|
|
3186
3188
|
height: 36
|
|
3187
|
-
}), /* @__PURE__ */ p(
|
|
3189
|
+
}), /* @__PURE__ */ p(te, {
|
|
3188
3190
|
width: 100,
|
|
3189
3191
|
height: 36
|
|
3190
3192
|
})]
|
|
@@ -3193,28 +3195,28 @@ function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3193
3195
|
}) : /* @__PURE__ */ m("form", {
|
|
3194
3196
|
onSubmit: D.onSubmit(async (e) => {
|
|
3195
3197
|
let n = Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
|
|
3196
|
-
await
|
|
3198
|
+
await b({
|
|
3197
3199
|
...n,
|
|
3198
3200
|
id: a
|
|
3199
3201
|
}), E.length && c < E.length - 1 ? S || l(c + 1) : S || (D.setInitialValues(n), D.reset(), t());
|
|
3200
3202
|
}),
|
|
3201
|
-
children: [E.length ? /* @__PURE__ */ p(
|
|
3203
|
+
children: [E.length ? /* @__PURE__ */ p(re, {
|
|
3202
3204
|
active: c,
|
|
3203
3205
|
size: "sm",
|
|
3204
|
-
children: E.map((t) => /* @__PURE__ */ p(
|
|
3206
|
+
children: E.map((t) => /* @__PURE__ */ p(re.Step, {
|
|
3205
3207
|
...o && o[t - 1] ? { label: o[t - 1].label } : {},
|
|
3206
3208
|
children: e.filter((e) => e.step === t).map((e) => k(e))
|
|
3207
3209
|
}, t))
|
|
3208
|
-
}) : e.map((e) => k(e)), !u && /* @__PURE__ */ m(
|
|
3210
|
+
}) : e.map((e) => k(e)), !u && /* @__PURE__ */ m(T, {
|
|
3209
3211
|
mt: "md",
|
|
3210
3212
|
justify: "end",
|
|
3211
|
-
children: [/* @__PURE__ */ p(
|
|
3213
|
+
children: [/* @__PURE__ */ p(y, {
|
|
3212
3214
|
onClick: () => E.length ? c === 0 ? t() : l(c - 1) : t(),
|
|
3213
3215
|
variant: "outline",
|
|
3214
3216
|
children: E.length ? c === 0 ? "Abbrechen" : "Zurück" : "Abbrechen"
|
|
3215
|
-
}), /* @__PURE__ */ p(
|
|
3217
|
+
}), /* @__PURE__ */ p(y, {
|
|
3216
3218
|
type: "submit",
|
|
3217
|
-
loading:
|
|
3219
|
+
loading: w,
|
|
3218
3220
|
children: E.length ? c === E.length - 1 ? "Speichern" : "Weiter" : "Speichern"
|
|
3219
3221
|
})]
|
|
3220
3222
|
})]
|
|
@@ -3222,35 +3224,35 @@ function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3222
3224
|
}
|
|
3223
3225
|
//#endregion
|
|
3224
3226
|
//#region src/DataTable/DeleteModal.tsx
|
|
3225
|
-
function
|
|
3226
|
-
let { mutateAsync: a, isError: o, error: c, isPending: l } =
|
|
3227
|
+
function Sr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMessage: i }) {
|
|
3228
|
+
let { mutateAsync: a, isError: o, error: c, isPending: l } = Ut(t, e), [u, h] = d(r), [g, v] = d(!1), b = g || l;
|
|
3227
3229
|
return s(() => {
|
|
3228
3230
|
u.length || n();
|
|
3229
3231
|
}, [n, u]), u.length ? /* @__PURE__ */ m(f, { children: [
|
|
3230
|
-
o && c.message && /* @__PURE__ */ p(
|
|
3232
|
+
o && c.message && /* @__PURE__ */ p(_, {
|
|
3231
3233
|
variant: "outline",
|
|
3232
3234
|
color: "red",
|
|
3233
3235
|
title: c.name,
|
|
3234
3236
|
children: c.message
|
|
3235
3237
|
}),
|
|
3236
|
-
/* @__PURE__ */ p(
|
|
3237
|
-
/* @__PURE__ */ m(
|
|
3238
|
+
/* @__PURE__ */ p(V, { children: i ? i(u) : u.length === 1 ? `Soll ${u.length} Eintrag wirklich gelöscht werden?` : `Sollen ${u.length} Einträge wirklich gelöscht werden?` }),
|
|
3239
|
+
/* @__PURE__ */ m(T, {
|
|
3238
3240
|
mt: "md",
|
|
3239
3241
|
justify: "end",
|
|
3240
|
-
children: [/* @__PURE__ */ p(
|
|
3242
|
+
children: [/* @__PURE__ */ p(y, {
|
|
3241
3243
|
onClick: n,
|
|
3242
3244
|
variant: "outline",
|
|
3243
3245
|
disabled: b,
|
|
3244
3246
|
children: "Abbrechen"
|
|
3245
|
-
}), /* @__PURE__ */ p(
|
|
3247
|
+
}), /* @__PURE__ */ p(y, {
|
|
3246
3248
|
color: "red",
|
|
3247
3249
|
loading: b,
|
|
3248
3250
|
onClick: async () => {
|
|
3249
|
-
|
|
3251
|
+
v(!0);
|
|
3250
3252
|
try {
|
|
3251
3253
|
await Promise.all(u.map((e) => a(e.id))), h([]);
|
|
3252
3254
|
} finally {
|
|
3253
|
-
|
|
3255
|
+
v(!1);
|
|
3254
3256
|
}
|
|
3255
3257
|
},
|
|
3256
3258
|
children: "Löschen"
|
|
@@ -3260,7 +3262,7 @@ function br({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMe
|
|
|
3260
3262
|
}
|
|
3261
3263
|
//#endregion
|
|
3262
3264
|
//#region src/Hooks/usePersistentState.ts
|
|
3263
|
-
function
|
|
3265
|
+
function Cr(e, t) {
|
|
3264
3266
|
let [n, r] = d(() => {
|
|
3265
3267
|
let n = localStorage.getItem(`use_persistent_storage_${t}`);
|
|
3266
3268
|
return n ? JSON.parse(n) : e;
|
|
@@ -3271,12 +3273,12 @@ function xr(e, t) {
|
|
|
3271
3273
|
}
|
|
3272
3274
|
//#endregion
|
|
3273
3275
|
//#region src/utils/sort.ts
|
|
3274
|
-
var
|
|
3276
|
+
var wr = [
|
|
3275
3277
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
3276
3278
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
3277
3279
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
3278
3280
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
3279
|
-
],
|
|
3281
|
+
], Tr = (e, t) => {
|
|
3280
3282
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
3281
3283
|
if (n.length === 0) return "string";
|
|
3282
3284
|
let r = n.slice(0, 100), i = {
|
|
@@ -3292,7 +3294,7 @@ var Sr = [
|
|
|
3292
3294
|
i.number++;
|
|
3293
3295
|
return;
|
|
3294
3296
|
}
|
|
3295
|
-
if (
|
|
3297
|
+
if (wr.some((e) => e.test(t))) {
|
|
3296
3298
|
let e = new Date(t);
|
|
3297
3299
|
if (!isNaN(e.getTime())) {
|
|
3298
3300
|
i.date++;
|
|
@@ -3305,7 +3307,7 @@ var Sr = [
|
|
|
3305
3307
|
let a = i.string + i.number + i.date;
|
|
3306
3308
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
3307
3309
|
};
|
|
3308
|
-
function
|
|
3310
|
+
function Er(e, t) {
|
|
3309
3311
|
switch (t) {
|
|
3310
3312
|
case "date":
|
|
3311
3313
|
if (typeof e == "string") {
|
|
@@ -3321,159 +3323,183 @@ function wr(e, t) {
|
|
|
3321
3323
|
default: return String(e).toLowerCase().trim();
|
|
3322
3324
|
}
|
|
3323
3325
|
}
|
|
3324
|
-
var
|
|
3326
|
+
var Dr = (e, t, n = "asc") => {
|
|
3325
3327
|
if (!e || e.length === 0) return [];
|
|
3326
|
-
let r =
|
|
3328
|
+
let r = Tr(e, t);
|
|
3327
3329
|
return [...e].sort((e, i) => {
|
|
3328
3330
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
3329
3331
|
if (s && c) return 0;
|
|
3330
3332
|
if (s) return n === "asc" ? -1 : 1;
|
|
3331
3333
|
if (c) return n === "asc" ? 1 : -1;
|
|
3332
|
-
let l =
|
|
3334
|
+
let l = Er(a, r), u = Er(o, r);
|
|
3333
3335
|
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;
|
|
3334
3336
|
});
|
|
3335
3337
|
};
|
|
3336
3338
|
//#endregion
|
|
3337
3339
|
//#region src/DataTable/MobileCardList.tsx
|
|
3338
|
-
function
|
|
3340
|
+
function Or(e, t) {
|
|
3339
3341
|
return t.split(".").reduce((e, t) => {
|
|
3340
3342
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
3341
3343
|
}, e);
|
|
3342
3344
|
}
|
|
3343
|
-
function
|
|
3345
|
+
function kr(e, t) {
|
|
3344
3346
|
let n = t.column;
|
|
3345
3347
|
if (n.render) return n.render(e, 0);
|
|
3346
|
-
let r =
|
|
3347
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3348
|
+
let r = Or(e, n.accessor ?? t.id);
|
|
3349
|
+
return r == null ? /* @__PURE__ */ p(V, {
|
|
3348
3350
|
c: "dimmed",
|
|
3349
3351
|
children: "–"
|
|
3350
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3352
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(V, {
|
|
3351
3353
|
fz: "sm",
|
|
3352
3354
|
children: r ? "Ja" : "Nein"
|
|
3353
|
-
}) : /* @__PURE__ */ p(
|
|
3355
|
+
}) : /* @__PURE__ */ p(V, {
|
|
3354
3356
|
fz: "sm",
|
|
3355
3357
|
children: String(r)
|
|
3356
3358
|
});
|
|
3357
3359
|
}
|
|
3358
|
-
function
|
|
3359
|
-
return /* @__PURE__ */ m(
|
|
3360
|
+
function Ar({ field: e, record: t }) {
|
|
3361
|
+
return /* @__PURE__ */ m(T, {
|
|
3360
3362
|
wrap: "nowrap",
|
|
3361
3363
|
justify: "space-between",
|
|
3362
3364
|
align: "center",
|
|
3363
3365
|
py: "xs",
|
|
3364
3366
|
px: "sm",
|
|
3365
|
-
children: [/* @__PURE__ */ p(
|
|
3367
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3366
3368
|
fw: 700,
|
|
3367
3369
|
fz: "sm",
|
|
3368
3370
|
children: e.column.title ?? e.id
|
|
3369
|
-
}), /* @__PURE__ */ p(
|
|
3371
|
+
}), /* @__PURE__ */ p(v, {
|
|
3370
3372
|
ta: "right",
|
|
3371
3373
|
fz: "sm",
|
|
3372
|
-
children:
|
|
3374
|
+
children: kr(t, e)
|
|
3373
3375
|
})]
|
|
3374
3376
|
});
|
|
3375
3377
|
}
|
|
3376
|
-
function
|
|
3377
|
-
let [
|
|
3378
|
-
y
|
|
3378
|
+
function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3379
|
+
let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
|
|
3380
|
+
if (y) {
|
|
3381
|
+
let { recordIds: t, onRecordIdsChange: n } = y;
|
|
3382
|
+
n(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
3383
|
+
} else _((t) => {
|
|
3379
3384
|
let n = new Set(t);
|
|
3380
3385
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
3381
3386
|
});
|
|
3382
|
-
},
|
|
3387
|
+
}, w = n.filter((e) => e.list && e.column && !e.column.hidden), D = n.filter((e) => e.column && e.column.filter != null), k = D.filter((e) => e.column.filtering).map((e) => e.id), A = k.length > 0, j = A ? k : D.slice(0, 1).map((e) => e.id), [M, N] = d(!1), I = w.filter((e) => e.column.sortable !== !1).reduce((e, t) => {
|
|
3383
3388
|
let n = t.column.accessor ?? t.id;
|
|
3384
3389
|
return e.some((e) => e.value === n) || e.push({
|
|
3385
3390
|
value: n,
|
|
3386
3391
|
label: t.column.title ?? t.id
|
|
3387
3392
|
}), e;
|
|
3388
|
-
}, []),
|
|
3389
|
-
|
|
3390
|
-
}, A = (e, t, n) => {
|
|
3391
|
-
o ? o({
|
|
3393
|
+
}, []), ee = (e, t, n) => {
|
|
3394
|
+
r?.({
|
|
3392
3395
|
record: e,
|
|
3393
3396
|
index: t,
|
|
3394
3397
|
event: n
|
|
3395
|
-
})
|
|
3398
|
+
});
|
|
3396
3399
|
};
|
|
3397
|
-
return e.length === 0 ? /* @__PURE__ */ p(
|
|
3400
|
+
return e.length === 0 ? /* @__PURE__ */ p(V, {
|
|
3398
3401
|
c: "dimmed",
|
|
3399
3402
|
ta: "center",
|
|
3400
3403
|
py: "xl",
|
|
3401
3404
|
children: "Keine Einträge gefunden"
|
|
3402
|
-
}) : /* @__PURE__ */ m(
|
|
3405
|
+
}) : /* @__PURE__ */ m(ne, {
|
|
3403
3406
|
gap: "sm",
|
|
3404
3407
|
my: "md",
|
|
3405
3408
|
children: [
|
|
3406
|
-
|
|
3409
|
+
(c && I.length > 0 || D.length > 0) && /* @__PURE__ */ m(T, {
|
|
3407
3410
|
gap: "xs",
|
|
3408
3411
|
wrap: "nowrap",
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3412
|
+
justify: "flex-end",
|
|
3413
|
+
children: [c && I.length > 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(R, {
|
|
3414
|
+
data: I,
|
|
3415
|
+
value: c.field,
|
|
3416
|
+
onChange: (e) => e && c.onSortChange(e, c.direction),
|
|
3413
3417
|
allowDeselect: !1,
|
|
3414
3418
|
style: { flex: 1 }
|
|
3415
|
-
}), /* @__PURE__ */ p(
|
|
3419
|
+
}), /* @__PURE__ */ p(g, {
|
|
3416
3420
|
variant: "filled",
|
|
3417
3421
|
size: "input-sm",
|
|
3418
|
-
onClick: () =>
|
|
3419
|
-
children:
|
|
3422
|
+
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3423
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(Te, { size: 18 }) : /* @__PURE__ */ p(Ee, { size: 18 })
|
|
3424
|
+
})] }), D.length > 0 && /* @__PURE__ */ m(F, {
|
|
3425
|
+
opened: M,
|
|
3426
|
+
onChange: N,
|
|
3427
|
+
position: "bottom-end",
|
|
3428
|
+
withArrow: !0,
|
|
3429
|
+
shadow: "md",
|
|
3430
|
+
trapFocus: !0,
|
|
3431
|
+
children: [/* @__PURE__ */ p(F.Target, { children: /* @__PURE__ */ p(E, {
|
|
3432
|
+
disabled: !A,
|
|
3433
|
+
color: "blue",
|
|
3434
|
+
size: 8,
|
|
3435
|
+
offset: 4,
|
|
3436
|
+
children: /* @__PURE__ */ p(g, {
|
|
3437
|
+
variant: A ? "filled" : "default",
|
|
3438
|
+
size: "input-sm",
|
|
3439
|
+
onClick: () => N((e) => !e),
|
|
3440
|
+
"aria-label": "Filter",
|
|
3441
|
+
children: /* @__PURE__ */ p(xe, { size: 18 })
|
|
3442
|
+
})
|
|
3443
|
+
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3444
|
+
p: 0,
|
|
3445
|
+
children: /* @__PURE__ */ p(h, {
|
|
3446
|
+
multiple: !0,
|
|
3447
|
+
defaultValue: j,
|
|
3448
|
+
style: {
|
|
3449
|
+
minWidth: 260,
|
|
3450
|
+
maxWidth: 320
|
|
3451
|
+
},
|
|
3452
|
+
children: D.map((e) => /* @__PURE__ */ m(h.Item, {
|
|
3453
|
+
value: e.id,
|
|
3454
|
+
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3455
|
+
gap: "xs",
|
|
3456
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3457
|
+
fw: 600,
|
|
3458
|
+
fz: "sm",
|
|
3459
|
+
children: e.column.title ?? e.id
|
|
3460
|
+
}), e.column.filtering && /* @__PURE__ */ p(v, {
|
|
3461
|
+
w: 8,
|
|
3462
|
+
h: 8,
|
|
3463
|
+
bg: "blue",
|
|
3464
|
+
style: { borderRadius: "50%" }
|
|
3465
|
+
})]
|
|
3466
|
+
}) }), /* @__PURE__ */ p(h.Panel, { children: typeof e.column.filter == "function" ? e.column.filter({ close: () => N(!1) }) : e.column.filter })]
|
|
3467
|
+
}, e.id))
|
|
3468
|
+
})
|
|
3469
|
+
})]
|
|
3420
3470
|
})]
|
|
3421
3471
|
}),
|
|
3422
3472
|
e.map((e, n) => {
|
|
3423
|
-
let
|
|
3424
|
-
return /* @__PURE__ */ p(t.Fragment, { children: /* @__PURE__ */ m(
|
|
3425
|
-
bg:
|
|
3426
|
-
bd:
|
|
3473
|
+
let s = e.id ?? n, c = b(s);
|
|
3474
|
+
return /* @__PURE__ */ p(t.Fragment, { children: /* @__PURE__ */ m(v, {
|
|
3475
|
+
bg: "var(--mantine-color-body)",
|
|
3476
|
+
bd: "1px solid var(--mantine-color-default-border)",
|
|
3427
3477
|
style: {
|
|
3428
3478
|
borderRadius: "var(--mantine-radius-md)",
|
|
3429
3479
|
overflow: "hidden"
|
|
3430
3480
|
},
|
|
3431
|
-
children: [/* @__PURE__ */ m(
|
|
3481
|
+
children: [/* @__PURE__ */ m(v, {
|
|
3432
3482
|
w: "100%",
|
|
3433
|
-
style: { cursor:
|
|
3483
|
+
style: { cursor: r || l ? "pointer" : "default" },
|
|
3434
3484
|
onClick: (t) => {
|
|
3435
|
-
|
|
3485
|
+
l && !r ? x(s) : ee(e, n, t);
|
|
3436
3486
|
},
|
|
3437
|
-
children: [
|
|
3487
|
+
children: [i && i.length > 0 && /* @__PURE__ */ p(T, {
|
|
3438
3488
|
px: "sm",
|
|
3439
3489
|
pt: "sm",
|
|
3440
|
-
justify: "
|
|
3441
|
-
children:
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
c: "var(--mantine-primary-color-filled)",
|
|
3445
|
-
style: {
|
|
3446
|
-
cursor: "pointer",
|
|
3447
|
-
display: "flex",
|
|
3448
|
-
alignItems: "center"
|
|
3449
|
-
},
|
|
3450
|
-
onClick: (e) => {
|
|
3451
|
-
e.stopPropagation(), C(u);
|
|
3452
|
-
},
|
|
3453
|
-
children: /* @__PURE__ */ p(ve, {
|
|
3454
|
-
size: 16,
|
|
3455
|
-
style: {
|
|
3456
|
-
transform: d ? "rotate(0deg)" : "rotate(-90deg)",
|
|
3457
|
-
transition: "transform 200ms"
|
|
3458
|
-
}
|
|
3459
|
-
})
|
|
3460
|
-
}), r && /* @__PURE__ */ p(b, {
|
|
3461
|
-
checked: i,
|
|
3462
|
-
onChange: () => k(e),
|
|
3463
|
-
onClick: (e) => e.stopPropagation()
|
|
3464
|
-
})]
|
|
3465
|
-
}), s && s.length > 0 && (() => {
|
|
3466
|
-
let t = s.filter((t) => !(t.label === "Bearbeiten" && c && !c(e) || t.label === "Löschen" && l && !l(e)));
|
|
3467
|
-
return t.length === 0 ? null : /* @__PURE__ */ m(E, {
|
|
3490
|
+
justify: "flex-end",
|
|
3491
|
+
children: (() => {
|
|
3492
|
+
let t = i.filter((t) => !(t.label === "Bearbeiten" && a && !a(e) || t.label === "Löschen" && o && !o(e)));
|
|
3493
|
+
return t.length === 0 ? null : /* @__PURE__ */ m(O, {
|
|
3468
3494
|
shadow: "md",
|
|
3469
3495
|
position: "bottom-end",
|
|
3470
|
-
children: [/* @__PURE__ */ p(
|
|
3496
|
+
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(g, {
|
|
3471
3497
|
variant: "subtle",
|
|
3472
3498
|
color: "gray",
|
|
3473
3499
|
size: "sm",
|
|
3474
3500
|
onClick: (e) => e.stopPropagation(),
|
|
3475
|
-
children: /* @__PURE__ */ p(
|
|
3476
|
-
}) }), /* @__PURE__ */ p(
|
|
3501
|
+
children: /* @__PURE__ */ p(be, { size: 16 })
|
|
3502
|
+
}) }), /* @__PURE__ */ p(O.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(O.Item, {
|
|
3477
3503
|
leftSection: t.icon,
|
|
3478
3504
|
onClick: (n) => {
|
|
3479
3505
|
n.stopPropagation(), t.onClick([e]);
|
|
@@ -3481,46 +3507,46 @@ function kr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3481
3507
|
children: t.label
|
|
3482
3508
|
}, `card_action_${n}`)) })]
|
|
3483
3509
|
});
|
|
3484
|
-
})()
|
|
3485
|
-
}),
|
|
3510
|
+
})()
|
|
3511
|
+
}), w.map((n, r) => /* @__PURE__ */ m(t.Fragment, { children: [r > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ p(Ar, {
|
|
3486
3512
|
field: n,
|
|
3487
3513
|
record: e
|
|
3488
3514
|
})] }, n.id))]
|
|
3489
|
-
}),
|
|
3490
|
-
expanded:
|
|
3491
|
-
children: [/* @__PURE__ */ p(
|
|
3515
|
+
}), l && /* @__PURE__ */ m(S, {
|
|
3516
|
+
expanded: c,
|
|
3517
|
+
children: [/* @__PURE__ */ p(C, {}), /* @__PURE__ */ p(v, {
|
|
3492
3518
|
px: "sm",
|
|
3493
3519
|
py: "sm",
|
|
3494
|
-
children:
|
|
3520
|
+
children: l.content(e, !0)
|
|
3495
3521
|
})]
|
|
3496
3522
|
})]
|
|
3497
|
-
}) },
|
|
3523
|
+
}) }, s);
|
|
3498
3524
|
}),
|
|
3499
|
-
|
|
3525
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(ne, {
|
|
3500
3526
|
gap: "xs",
|
|
3501
3527
|
mt: "sm",
|
|
3502
|
-
children: [/* @__PURE__ */ p(
|
|
3528
|
+
children: [/* @__PURE__ */ p(T, {
|
|
3503
3529
|
justify: "center",
|
|
3504
|
-
children: /* @__PURE__ */ p(
|
|
3505
|
-
total: Math.ceil(
|
|
3506
|
-
value:
|
|
3507
|
-
onChange:
|
|
3530
|
+
children: /* @__PURE__ */ p(P, {
|
|
3531
|
+
total: Math.ceil(s.totalRecords / s.recordsPerPage),
|
|
3532
|
+
value: s.page,
|
|
3533
|
+
onChange: s.onPageChange,
|
|
3508
3534
|
size: "sm"
|
|
3509
3535
|
})
|
|
3510
|
-
}),
|
|
3536
|
+
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3511
3537
|
justify: "center",
|
|
3512
3538
|
gap: "xs",
|
|
3513
|
-
children: [/* @__PURE__ */ p(
|
|
3539
|
+
children: [/* @__PURE__ */ p(V, {
|
|
3514
3540
|
fz: "xs",
|
|
3515
3541
|
c: "dimmed",
|
|
3516
3542
|
children: "Einträge pro Seite:"
|
|
3517
|
-
}), /* @__PURE__ */ p(
|
|
3518
|
-
data:
|
|
3543
|
+
}), /* @__PURE__ */ p(R, {
|
|
3544
|
+
data: s.recordsPerPageOptions.map((e) => ({
|
|
3519
3545
|
value: String(e),
|
|
3520
3546
|
label: String(e)
|
|
3521
3547
|
})),
|
|
3522
|
-
value: String(
|
|
3523
|
-
onChange: (e) => e &&
|
|
3548
|
+
value: String(s.recordsPerPage),
|
|
3549
|
+
onChange: (e) => e && s.onRecordsPerPageChange(Number(e)),
|
|
3524
3550
|
allowDeselect: !1,
|
|
3525
3551
|
size: "xs",
|
|
3526
3552
|
w: 70
|
|
@@ -3532,28 +3558,28 @@ function kr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3532
3558
|
}
|
|
3533
3559
|
//#endregion
|
|
3534
3560
|
//#region src/DataTable/DataTableInner.tsx
|
|
3535
|
-
var
|
|
3561
|
+
var Mr = [
|
|
3536
3562
|
10,
|
|
3537
3563
|
15,
|
|
3538
3564
|
50,
|
|
3539
3565
|
100,
|
|
3540
3566
|
500
|
|
3541
3567
|
];
|
|
3542
|
-
function
|
|
3543
|
-
let [
|
|
3544
|
-
|
|
3545
|
-
},
|
|
3546
|
-
...
|
|
3547
|
-
...
|
|
3548
|
-
},
|
|
3568
|
+
function Nr({ 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: T, queryParams: E, tabs: D, defaultTab: k, activeTab: A, onActiveTabChange: j, canUpdate: N, canDelete: P, showRefresh: F = !0, rowExpansion: I, onRowClick: ee, mobileCards: L = !1, deleteConfirmMessage: R, editRecordId: re, onEditRecordIdChange: ie }) {
|
|
3569
|
+
let [ae, oe] = d(k || (D && D.length > 0 ? D[0].value : null)), z = A === void 0 ? ae : A, se = (e) => {
|
|
3570
|
+
A === void 0 && oe(e), j && j(e);
|
|
3571
|
+
}, B = D?.find((e) => e.value === z), V = B?.queryParams || {}, le = B?.apiPath ?? r, ue = B?.mutationApiPath ?? a ?? le, fe = {
|
|
3572
|
+
...E,
|
|
3573
|
+
...V
|
|
3574
|
+
}, pe = fe ? "?" + Object.entries(fe).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", me = z ? [...t, z] : t, { data: he, isLoading: ge, isError: _e, isRefetching: ve, refetch: be } = Bt(le + pe, me), { queryClient: xe } = Y();
|
|
3549
3575
|
s(() => {
|
|
3550
|
-
!
|
|
3576
|
+
!he || !Array.isArray(he) || n?.forEach((e) => xe.invalidateQueries({ queryKey: e }));
|
|
3551
3577
|
}, [
|
|
3552
|
-
|
|
3578
|
+
he,
|
|
3553
3579
|
n,
|
|
3554
|
-
|
|
3580
|
+
xe
|
|
3555
3581
|
]);
|
|
3556
|
-
let
|
|
3582
|
+
let Te = !he || !Array.isArray(he) ? [] : !h || h.length === 0 ? he : he.filter((e) => h.every((t) => {
|
|
3557
3583
|
if (t.value === void 0) return !0;
|
|
3558
3584
|
let n = t.id;
|
|
3559
3585
|
if (t.type === "query") {
|
|
@@ -3585,37 +3611,37 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3585
3611
|
return !0;
|
|
3586
3612
|
} else if (t.type === "boolean") return e[n] === t.value;
|
|
3587
3613
|
return !0;
|
|
3588
|
-
})), [
|
|
3614
|
+
})), [Ee, Oe] = d({
|
|
3589
3615
|
columnAccessor: S?.field ?? c[0].id,
|
|
3590
3616
|
direction: S?.direction ?? "desc"
|
|
3591
3617
|
}), ke = (e) => {
|
|
3592
|
-
Oe(e),
|
|
3593
|
-
}, H =
|
|
3618
|
+
Oe(e), C && C(String(e.columnAccessor), e.direction);
|
|
3619
|
+
}, H = Dr(Te, Ee.columnAccessor, Ee.direction), [Ae, je] = Cr(Mr[1], "mantine-table-page-size"), [Me, Ne] = d(1), Pe = u ? H.slice((Me - 1) * Ae, Me * Ae) : H, [U, W] = d([]);
|
|
3594
3620
|
s(() => {
|
|
3595
3621
|
W([]);
|
|
3596
|
-
}, [
|
|
3597
|
-
let [Fe, Ie] = d(!1), [Le,
|
|
3622
|
+
}, [z]);
|
|
3623
|
+
let [Fe, Ie] = d(!1), [Le, Re] = d(!1), [ze, G] = d(!1);
|
|
3598
3624
|
s(() => {
|
|
3599
|
-
if (
|
|
3600
|
-
let e = H.find((e) => e.id ===
|
|
3601
|
-
e && (W([e]),
|
|
3625
|
+
if (re && H.length > 0) {
|
|
3626
|
+
let e = H.find((e) => e.id === re);
|
|
3627
|
+
e && (W([e]), Re(!0), ie?.(null));
|
|
3602
3628
|
}
|
|
3603
|
-
}, [
|
|
3604
|
-
let
|
|
3605
|
-
return
|
|
3606
|
-
icon: /* @__PURE__ */ p(
|
|
3629
|
+
}, [re, H]);
|
|
3630
|
+
let K = c.some((e) => e.update), Be = c.some((e) => e.delete), Ve = [];
|
|
3631
|
+
return K && Ve.push({
|
|
3632
|
+
icon: /* @__PURE__ */ p(Ce, { size: 14 }),
|
|
3607
3633
|
label: "Bearbeiten",
|
|
3608
3634
|
onClick: (e) => {
|
|
3609
|
-
W(e),
|
|
3635
|
+
W(e), Re(!0);
|
|
3610
3636
|
}
|
|
3611
|
-
}), b &&
|
|
3612
|
-
icon: /* @__PURE__ */ p(
|
|
3637
|
+
}), b && Ve.push(...b), Be && Ve.push({
|
|
3638
|
+
icon: /* @__PURE__ */ p(De, { size: 14 }),
|
|
3613
3639
|
label: "Löschen",
|
|
3614
3640
|
onClick: (e) => {
|
|
3615
|
-
W(e),
|
|
3641
|
+
W(e), G(!0);
|
|
3616
3642
|
}
|
|
3617
3643
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3618
|
-
/* @__PURE__ */ m(
|
|
3644
|
+
/* @__PURE__ */ m(w, {
|
|
3619
3645
|
gap: "xs",
|
|
3620
3646
|
align: {
|
|
3621
3647
|
base: "stretch",
|
|
@@ -3630,7 +3656,7 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3630
3656
|
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(de, {
|
|
3631
3657
|
order: 4,
|
|
3632
3658
|
children: e
|
|
3633
|
-
}) : e), /* @__PURE__ */ m(
|
|
3659
|
+
}) : e), /* @__PURE__ */ m(w, {
|
|
3634
3660
|
align: {
|
|
3635
3661
|
base: "stretch",
|
|
3636
3662
|
sm: "center"
|
|
@@ -3650,39 +3676,39 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3650
3676
|
sm: "auto"
|
|
3651
3677
|
},
|
|
3652
3678
|
children: [
|
|
3653
|
-
|
|
3679
|
+
F && /* @__PURE__ */ p(g, {
|
|
3654
3680
|
variant: "subtle",
|
|
3655
|
-
onClick: () =>
|
|
3681
|
+
onClick: () => be(),
|
|
3656
3682
|
"aria-label": "Neuladen",
|
|
3657
|
-
children: /* @__PURE__ */ p(
|
|
3683
|
+
children: /* @__PURE__ */ p(we, {})
|
|
3658
3684
|
}),
|
|
3659
3685
|
(c.some((e) => e.update) || l) && (() => {
|
|
3660
3686
|
let e = c.find((e) => e.update) && (!N || U.length > 0 && N(U[0])), t = c.find((e) => e.delete) && (!P || U.length > 0 && P(U[0])), n = (b ?? []).length > 0, r = e || t || n;
|
|
3661
|
-
return /* @__PURE__ */ p(
|
|
3662
|
-
...
|
|
3663
|
-
children: /* @__PURE__ */ m(
|
|
3687
|
+
return /* @__PURE__ */ p(v, {
|
|
3688
|
+
...L ? { visibleFrom: "sm" } : {},
|
|
3689
|
+
children: /* @__PURE__ */ m(O, {
|
|
3664
3690
|
shadow: "md",
|
|
3665
|
-
children: [/* @__PURE__ */ p(
|
|
3691
|
+
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(y, {
|
|
3666
3692
|
variant: "outline",
|
|
3667
|
-
rightSection: /* @__PURE__ */ p(
|
|
3693
|
+
rightSection: /* @__PURE__ */ p(ye, { size: 14 }),
|
|
3668
3694
|
disabled: !U.length || !r,
|
|
3669
3695
|
children: "Aktionen"
|
|
3670
|
-
}) }), /* @__PURE__ */ m(
|
|
3671
|
-
e && /* @__PURE__ */ p(
|
|
3672
|
-
leftSection: /* @__PURE__ */ p(
|
|
3673
|
-
onClick: () =>
|
|
3696
|
+
}) }), /* @__PURE__ */ m(O.Dropdown, { children: [
|
|
3697
|
+
e && /* @__PURE__ */ p(O.Item, {
|
|
3698
|
+
leftSection: /* @__PURE__ */ p(Ce, { size: 14 }),
|
|
3699
|
+
onClick: () => Re(!0),
|
|
3674
3700
|
disabled: U.length !== 1,
|
|
3675
3701
|
children: "Bearbeiten"
|
|
3676
3702
|
}),
|
|
3677
|
-
(b ?? []).map((e, t) => /* @__PURE__ */ i(
|
|
3703
|
+
(b ?? []).map((e, t) => /* @__PURE__ */ i(O.Item, {
|
|
3678
3704
|
...e.icon && { leftSection: e.icon },
|
|
3679
3705
|
key: `custom_action_${t}`,
|
|
3680
3706
|
onClick: () => e.onClick(U),
|
|
3681
3707
|
disabled: e.disabled?.(U) ?? !1
|
|
3682
3708
|
}, e.label)),
|
|
3683
|
-
t && /* @__PURE__ */ p(
|
|
3684
|
-
leftSection: /* @__PURE__ */ p(
|
|
3685
|
-
onClick: () =>
|
|
3709
|
+
t && /* @__PURE__ */ p(O.Item, {
|
|
3710
|
+
leftSection: /* @__PURE__ */ p(De, { size: 14 }),
|
|
3711
|
+
onClick: () => G(!0),
|
|
3686
3712
|
color: "red",
|
|
3687
3713
|
children: "Löschen"
|
|
3688
3714
|
})
|
|
@@ -3690,7 +3716,7 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3690
3716
|
})
|
|
3691
3717
|
});
|
|
3692
3718
|
})(),
|
|
3693
|
-
c.find((e) => e.create) && /* @__PURE__ */ p(
|
|
3719
|
+
c.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3694
3720
|
onClick: () => Ie(!0),
|
|
3695
3721
|
disabled: ge,
|
|
3696
3722
|
children: T ?? "Erstellen"
|
|
@@ -3699,44 +3725,44 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3699
3725
|
]
|
|
3700
3726
|
})]
|
|
3701
3727
|
}),
|
|
3702
|
-
|
|
3703
|
-
value:
|
|
3704
|
-
onChange:
|
|
3728
|
+
D && D.length > 0 && /* @__PURE__ */ p(ce, {
|
|
3729
|
+
value: z,
|
|
3730
|
+
onChange: se,
|
|
3705
3731
|
mt: "md",
|
|
3706
|
-
children: /* @__PURE__ */ p(ce.List, { children:
|
|
3732
|
+
children: /* @__PURE__ */ p(ce.List, { children: D.map((e) => /* @__PURE__ */ p(ce.Tab, {
|
|
3707
3733
|
value: e.value,
|
|
3708
3734
|
leftSection: e.icon,
|
|
3709
3735
|
children: e.label
|
|
3710
3736
|
}, e.value)) })
|
|
3711
3737
|
}),
|
|
3712
|
-
|
|
3738
|
+
_e && /* @__PURE__ */ p(_, {
|
|
3713
3739
|
mt: "md",
|
|
3714
3740
|
variant: "light",
|
|
3715
3741
|
color: "red",
|
|
3716
3742
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3717
|
-
icon: /* @__PURE__ */ p(
|
|
3743
|
+
icon: /* @__PURE__ */ p(Se, {}),
|
|
3718
3744
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3719
3745
|
}),
|
|
3720
|
-
(ge ||
|
|
3746
|
+
(ge || ve) && /* @__PURE__ */ m(ne, {
|
|
3721
3747
|
my: "md",
|
|
3722
|
-
children: [/* @__PURE__ */ p(
|
|
3748
|
+
children: [/* @__PURE__ */ p(te, { height: 40 }), [
|
|
3723
3749
|
,
|
|
3724
3750
|
,
|
|
3725
3751
|
,
|
|
3726
3752
|
,
|
|
3727
3753
|
,
|
|
3728
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3754
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(te, { height: 35 }, `skeleton-${t}`))]
|
|
3729
3755
|
}),
|
|
3730
|
-
!ge && !
|
|
3731
|
-
...
|
|
3732
|
-
children: /* @__PURE__ */ p(
|
|
3756
|
+
!ge && !ve && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3757
|
+
...L ? { visibleFrom: "sm" } : {},
|
|
3758
|
+
children: /* @__PURE__ */ p(br, {
|
|
3733
3759
|
my: "md",
|
|
3734
3760
|
striped: !0,
|
|
3735
3761
|
highlightOnHover: !0,
|
|
3736
3762
|
minHeight: 150,
|
|
3737
|
-
fetching:
|
|
3763
|
+
fetching: _e,
|
|
3738
3764
|
records: Pe,
|
|
3739
|
-
sortStatus:
|
|
3765
|
+
sortStatus: Ee,
|
|
3740
3766
|
onSortStatusChange: ke,
|
|
3741
3767
|
...l && {
|
|
3742
3768
|
selectedRecords: U,
|
|
@@ -3747,32 +3773,29 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3747
3773
|
recordsPerPage: Ae,
|
|
3748
3774
|
onPageChange: Ne,
|
|
3749
3775
|
page: Me,
|
|
3750
|
-
recordsPerPageOptions:
|
|
3776
|
+
recordsPerPageOptions: Mr,
|
|
3751
3777
|
onRecordsPerPageChange: je,
|
|
3752
3778
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3753
3779
|
},
|
|
3754
|
-
...
|
|
3755
|
-
allowMultiple:
|
|
3756
|
-
content: ({ record: e }) =>
|
|
3757
|
-
...
|
|
3780
|
+
...I && { rowExpansion: {
|
|
3781
|
+
allowMultiple: I.allowMultiple ?? !1,
|
|
3782
|
+
content: ({ record: e }) => I.content(e, !1),
|
|
3783
|
+
...I.expanded && { expanded: I.expanded }
|
|
3758
3784
|
} },
|
|
3759
3785
|
columns: c.map((e) => e.column),
|
|
3760
3786
|
noRecordsText: "Keine Einträge gefunden",
|
|
3761
|
-
onRowClick:
|
|
3762
|
-
...
|
|
3787
|
+
onRowClick: ee,
|
|
3788
|
+
...ee && { style: { cursor: "pointer" } }
|
|
3763
3789
|
})
|
|
3764
|
-
}),
|
|
3790
|
+
}), L && /* @__PURE__ */ p(v, {
|
|
3765
3791
|
hiddenFrom: "sm",
|
|
3766
|
-
children: /* @__PURE__ */ p(
|
|
3792
|
+
children: /* @__PURE__ */ p(jr, {
|
|
3767
3793
|
records: Pe,
|
|
3768
3794
|
fields: c,
|
|
3769
|
-
|
|
3770
|
-
selectedRecords: U,
|
|
3771
|
-
onSelectedRecordsChange: W,
|
|
3772
|
-
onRowClick: te,
|
|
3795
|
+
onRowClick: ee,
|
|
3773
3796
|
sort: {
|
|
3774
|
-
field: String(
|
|
3775
|
-
direction:
|
|
3797
|
+
field: String(Ee.columnAccessor),
|
|
3798
|
+
direction: Ee.direction,
|
|
3776
3799
|
onSortChange: (e, t) => {
|
|
3777
3800
|
ke({
|
|
3778
3801
|
columnAccessor: e,
|
|
@@ -3785,61 +3808,64 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3785
3808
|
recordsPerPage: Ae,
|
|
3786
3809
|
page: Me,
|
|
3787
3810
|
onPageChange: Ne,
|
|
3788
|
-
recordsPerPageOptions:
|
|
3811
|
+
recordsPerPageOptions: Mr,
|
|
3789
3812
|
onRecordsPerPageChange: (e) => {
|
|
3790
3813
|
je(e), Ne(1);
|
|
3791
3814
|
}
|
|
3792
3815
|
} },
|
|
3793
|
-
...
|
|
3794
|
-
|
|
3795
|
-
|
|
3816
|
+
...I && { rowExpansion: {
|
|
3817
|
+
content: I.content,
|
|
3818
|
+
...I.expanded && { expanded: I.expanded }
|
|
3819
|
+
} },
|
|
3820
|
+
...Ve.length > 0 && {
|
|
3821
|
+
actions: Ve,
|
|
3796
3822
|
canUpdate: N,
|
|
3797
3823
|
canDelete: P
|
|
3798
3824
|
}
|
|
3799
3825
|
})
|
|
3800
3826
|
})] }),
|
|
3801
|
-
/* @__PURE__ */ p(
|
|
3827
|
+
/* @__PURE__ */ p(M, {
|
|
3802
3828
|
opened: Le,
|
|
3803
3829
|
onClose: () => {
|
|
3804
|
-
|
|
3830
|
+
Re(!1), W([]);
|
|
3805
3831
|
},
|
|
3806
3832
|
title: e ?? "Bearbeiten",
|
|
3807
|
-
children: U.length > 0 && /* @__PURE__ */ p(
|
|
3833
|
+
children: U.length > 0 && /* @__PURE__ */ p(xr, {
|
|
3808
3834
|
fields: c.filter((e) => e.update),
|
|
3809
3835
|
queryKey: t,
|
|
3810
|
-
apiPath:
|
|
3836
|
+
apiPath: ue,
|
|
3811
3837
|
id: U[0].id,
|
|
3812
3838
|
onClose: () => {
|
|
3813
|
-
|
|
3839
|
+
Re(!1), W([]);
|
|
3814
3840
|
},
|
|
3815
3841
|
steps: x
|
|
3816
3842
|
})
|
|
3817
3843
|
}),
|
|
3818
|
-
U.length > 0 && /* @__PURE__ */ p(
|
|
3819
|
-
opened:
|
|
3844
|
+
U.length > 0 && /* @__PURE__ */ p(M, {
|
|
3845
|
+
opened: ze,
|
|
3820
3846
|
onClose: () => {
|
|
3821
|
-
|
|
3847
|
+
G(!1), W([]);
|
|
3822
3848
|
},
|
|
3823
3849
|
title: e ?? "Löschen",
|
|
3824
|
-
children: /* @__PURE__ */ p(
|
|
3850
|
+
children: /* @__PURE__ */ p(Sr, {
|
|
3825
3851
|
onClose: () => {
|
|
3826
|
-
|
|
3852
|
+
G(!1), W([]);
|
|
3827
3853
|
},
|
|
3828
3854
|
queryKey: t,
|
|
3829
|
-
apiPath:
|
|
3855
|
+
apiPath: ue,
|
|
3830
3856
|
selectedRecords: U,
|
|
3831
|
-
confirmMessage:
|
|
3857
|
+
confirmMessage: R
|
|
3832
3858
|
})
|
|
3833
3859
|
}),
|
|
3834
|
-
/* @__PURE__ */ p(
|
|
3860
|
+
/* @__PURE__ */ p(M, {
|
|
3835
3861
|
opened: Fe,
|
|
3836
3862
|
onClose: () => {
|
|
3837
3863
|
Ie(!1);
|
|
3838
3864
|
},
|
|
3839
3865
|
title: e ?? "Anlegen",
|
|
3840
|
-
children: /* @__PURE__ */ p(
|
|
3866
|
+
children: /* @__PURE__ */ p(Wt, {
|
|
3841
3867
|
queryKey: t,
|
|
3842
|
-
apiPath:
|
|
3868
|
+
apiPath: ue,
|
|
3843
3869
|
onClose: () => {
|
|
3844
3870
|
Ie(!1);
|
|
3845
3871
|
},
|
|
@@ -3851,10 +3877,10 @@ function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3851
3877
|
}
|
|
3852
3878
|
//#endregion
|
|
3853
3879
|
//#region src/DataTable/DataTable.tsx
|
|
3854
|
-
function
|
|
3855
|
-
return /* @__PURE__ */ p(
|
|
3880
|
+
function Pr(e) {
|
|
3881
|
+
return /* @__PURE__ */ p(Nr, { ...e });
|
|
3856
3882
|
}
|
|
3857
3883
|
//#endregion
|
|
3858
|
-
export {
|
|
3884
|
+
export { Wt as CreateModal, Pr as DataTable, At as DataTableProvider, Sr as DeleteModal, jr as MobileCardList, xr as UpdateModal, Lt as api, It as createOne, Ft as deleteOne, Nt as getAll, Pt as getOne, jt as parseApiError, Dr as sortData, Rt as updateOne, Vt as useAddOne, Y as useDataTable, Ut as useDeleteOne, Bt as useGetAll, zt as useGetOne, Cr as usePersistentState, Ht as useUpdateOne };
|
|
3859
3885
|
|
|
3860
3886
|
//# sourceMappingURL=index.es.js.map
|