@espresso-lab/mantine-data-table 2.2.10 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTable.d.ts +2 -1
- package/dist/index.es.js +415 -411
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import t, { Fragment as n, createContext as r, createElement as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
-
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, HoverCard as E, Indicator as D, Loader as O, Menu as k, MenuDropdown as A, MenuItem as j, MenuTarget as M, Modal as N, NumberInput as P, Pagination as ee, Popover as F, PopoverDropdown as te, PopoverTarget as I, ScrollArea as L, Select as ne, Skeleton as
|
|
5
|
-
import { DateInput as
|
|
6
|
-
import { useForm as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, HoverCard as E, Indicator as D, Loader as O, Menu as k, MenuDropdown as A, MenuItem as j, MenuTarget as M, Modal as N, NumberInput as P, Pagination as ee, Popover as F, PopoverDropdown as te, PopoverTarget as I, ScrollArea as L, Select as ne, Skeleton as re, Stack as ie, Stepper as ae, Table as oe, TableTd as R, TableTfoot as se, TableTh as ce, TableThead as le, TableTr as z, Tabs as ue, Text as B, TextInput as de, Textarea as fe, Title as pe, createSafeContext as me, parseThemeColor as he, rem as ge, useDirection as _e, useMantineTheme as ve } from "@mantine/core";
|
|
5
|
+
import { DateInput as ye } from "@mantine/dates";
|
|
6
|
+
import { useForm as be } from "@mantine/form";
|
|
7
|
+
import { IconCaretDownFilled as xe, IconChevronRight as Se, IconDotsVertical as Ce, IconFilter as we, IconInfoCircle as Te, IconPencil as Ee, IconRefresh as De, IconSortAscending as Oe, IconSortDescending as ke, IconTrash as Ae } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as je, useDisclosure as Me, useLocalStorage as Ne, useMediaQuery as Pe, useMergedRef as Fe, useTimeout as Ie } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var Le = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var Fe = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
},
|
|
24
|
+
}, Re = new class extends Le {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var Fe = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), ze = {
|
|
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
|
+
}, V = new class {
|
|
67
|
+
#e = ze;
|
|
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,77 +85,77 @@ var Fe = class {
|
|
|
85
85
|
this.#e.clearInterval(e);
|
|
86
86
|
}
|
|
87
87
|
}();
|
|
88
|
-
function
|
|
88
|
+
function Be(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
|
|
93
|
+
var Ve = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function H() {}
|
|
95
95
|
function He(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
98
|
function Ue(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function U(e, t) {
|
|
102
102
|
return typeof e == "function" ? e(t) : e;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function W(e, t) {
|
|
105
105
|
return typeof e == "function" ? e(t) : e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function We(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Je(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var Ge = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Ke(e, t, n = 0) {
|
|
112
112
|
if (e === t) return e;
|
|
113
113
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
114
|
+
let r = qe(e) && qe(t);
|
|
115
|
+
if (!r && !(Je(e) && Je(t))) return t;
|
|
116
116
|
let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
|
|
117
117
|
for (let l = 0; l < o; l++) {
|
|
118
118
|
let o = r ? l : a[l], u = e[o], d = t[o];
|
|
119
119
|
if (u === d) {
|
|
120
|
-
s[o] = u, (r ? l < i :
|
|
120
|
+
s[o] = u, (r ? l < i : Ge.call(e, o)) && c++;
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
124
124
|
s[o] = d;
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
let f =
|
|
127
|
+
let f = Ke(u, d, n + 1);
|
|
128
128
|
s[o] = f, f === u && c++;
|
|
129
129
|
}
|
|
130
130
|
return i === o && c === i ? e : s;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function G(e, t) {
|
|
133
133
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
134
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
135
|
return !0;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function qe(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function Je(e) {
|
|
141
|
+
if (!Ye(e)) return !1;
|
|
142
142
|
let t = e.constructor;
|
|
143
143
|
if (t === void 0) return !0;
|
|
144
144
|
let n = t.prototype;
|
|
145
|
-
return !(!
|
|
145
|
+
return !(!Ye(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Ye(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Xe(e, t, n) {
|
|
151
151
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
152
|
if (n.structuralSharing !== !1) {
|
|
153
153
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
154
|
+
return Ke(e, t);
|
|
155
155
|
} catch (e) {
|
|
156
156
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return Ke(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
@@ -164,8 +164,8 @@ function K(e, t) {
|
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
167
|
-
var
|
|
168
|
-
let e = () =>
|
|
167
|
+
var q = /* @__PURE__ */ (() => {
|
|
168
|
+
let e = () => Ve;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
171
171
|
return e();
|
|
@@ -177,7 +177,7 @@ var Ze = /* @__PURE__ */ (() => {
|
|
|
177
177
|
})();
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
-
function
|
|
180
|
+
function Ze() {
|
|
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 Qe = Be;
|
|
203
|
+
function $e() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
206
206
|
}, r = (e) => {
|
|
207
207
|
e();
|
|
208
|
-
}, i =
|
|
208
|
+
}, i = Qe, a = (r) => {
|
|
209
209
|
t ? e.push(r) : i(() => {
|
|
210
210
|
n(r);
|
|
211
211
|
});
|
|
@@ -247,7 +247,7 @@ function et() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var J = $e(), et = new class extends Le {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -281,16 +281,16 @@ var tt = et(), nt = new class extends Fe {
|
|
|
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();
|
|
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 it(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 Le {
|
|
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 = Ze(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
306
306
|
#e;
|
|
307
307
|
#t = void 0;
|
|
@@ -322,36 +322,36 @@ var at = class extends Fe {
|
|
|
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);
|
|
338
338
|
}
|
|
339
339
|
setOptions(e) {
|
|
340
340
|
let t = this.options, n = this.#t;
|
|
341
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
341
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof W(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !G(this.options, t) && this.#e.getQueryCache().notify({
|
|
343
343
|
type: "observerOptionsUpdated",
|
|
344
344
|
query: this.#t,
|
|
345
345
|
observer: this
|
|
346
346
|
});
|
|
347
347
|
let r = this.hasListeners();
|
|
348
|
-
r &&
|
|
348
|
+
r && st(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || U(this.options.staleTime, this.#t) !== U(t.staleTime, this.#t)) && this.#g();
|
|
349
349
|
let i = this.#_();
|
|
350
|
-
r && (this.#t !== n ||
|
|
350
|
+
r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(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 Y(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 at = class extends Fe {
|
|
|
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(H)), t;
|
|
385
385
|
}
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
|
-
let e =
|
|
389
|
-
if (
|
|
388
|
+
let e = U(this.options.staleTime, this.#t);
|
|
389
|
+
if (q.isServer() || this.#r.isStale || !He(e)) return;
|
|
390
390
|
let t = Ue(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
-
this.#d =
|
|
391
|
+
this.#d = V.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,26 +396,26 @@ var at = class extends Fe {
|
|
|
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, !(q.isServer() || W(this.options.enabled, this.#t) === !1 || !He(this.#p) || this.#p === 0) && (this.#f = V.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Re.isFocused()) && this.#h();
|
|
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 && (V.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (V.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 at = class extends Fe {
|
|
|
423
423
|
let h = !1;
|
|
424
424
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
425
|
let e;
|
|
426
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
426
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = Xe(i?.data, e, t), u = !0);
|
|
427
427
|
}
|
|
428
428
|
if (t.select && d !== void 0 && !h) if (i && d === a?.data && t.select === this.#c) d = this.#l;
|
|
429
429
|
else try {
|
|
430
|
-
this.#c = t.select, d = t.select(d), d =
|
|
430
|
+
this.#c = t.select, d = t.select(d), d = Xe(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
431
|
} catch (e) {
|
|
432
432
|
this.#s = e;
|
|
433
433
|
}
|
|
@@ -455,16 +455,16 @@ var at = class extends Fe {
|
|
|
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
|
-
isEnabled:
|
|
461
|
+
isEnabled: W(t.enabled, e) !== !1
|
|
462
462
|
};
|
|
463
463
|
if (this.options.experimental_prefetchInRender) {
|
|
464
464
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
465
465
|
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
466
466
|
}, a = () => {
|
|
467
|
-
let e = this.#o = x.promise =
|
|
467
|
+
let e = this.#o = x.promise = Ze();
|
|
468
468
|
i(e);
|
|
469
469
|
}, o = this.#o;
|
|
470
470
|
switch (o.status) {
|
|
@@ -483,7 +483,7 @@ var at = class extends Fe {
|
|
|
483
483
|
}
|
|
484
484
|
updateResult() {
|
|
485
485
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
486
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
486
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !G(t, e) && (this.#r = t, this.#C({ listeners: (() => {
|
|
487
487
|
if (!e) return !0;
|
|
488
488
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
489
489
|
if (n === "all" || !n && !this.#m.size) return !0;
|
|
@@ -504,7 +504,7 @@ var at = class extends Fe {
|
|
|
504
504
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
505
505
|
}
|
|
506
506
|
#C(e) {
|
|
507
|
-
|
|
507
|
+
J.batch(() => {
|
|
508
508
|
e.listeners && this.listeners.forEach((e) => {
|
|
509
509
|
e(this.#r);
|
|
510
510
|
}), this.#e.getQueryCache().notify({
|
|
@@ -514,31 +514,31 @@ var at = class extends Fe {
|
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
|
-
function
|
|
518
|
-
return
|
|
517
|
+
function it(e, t) {
|
|
518
|
+
return W(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && W(t.retryOnMount, e) === !1);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
520
|
+
function at(e, t) {
|
|
521
|
+
return it(e, t) || e.state.data !== void 0 && ot(e, t, t.refetchOnMount);
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
523
|
+
function ot(e, t, n) {
|
|
524
|
+
if (W(t.enabled, e) !== !1 && U(t.staleTime, e) !== "static") {
|
|
525
525
|
let r = typeof n == "function" ? n(e) : n;
|
|
526
|
-
return r === "always" || r !== !1 &&
|
|
526
|
+
return r === "always" || r !== !1 && ct(e, t);
|
|
527
527
|
}
|
|
528
528
|
return !1;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return (e !== t ||
|
|
530
|
+
function st(e, t, n, r) {
|
|
531
|
+
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ct(e, n);
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
return
|
|
533
|
+
function ct(e, t) {
|
|
534
|
+
return W(t.enabled, e) !== !1 && e.isStaleByTime(U(t.staleTime, e));
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return !
|
|
536
|
+
function Y(e, t) {
|
|
537
|
+
return !G(e.getCurrentResult(), t);
|
|
538
538
|
}
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
541
|
-
function
|
|
541
|
+
function lt() {
|
|
542
542
|
return {
|
|
543
543
|
context: void 0,
|
|
544
544
|
data: void 0,
|
|
@@ -553,7 +553,7 @@ function ut() {
|
|
|
553
553
|
}
|
|
554
554
|
//#endregion
|
|
555
555
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
556
|
-
var
|
|
556
|
+
var ut = class extends Le {
|
|
557
557
|
#e;
|
|
558
558
|
#t = void 0;
|
|
559
559
|
#n;
|
|
@@ -566,11 +566,11 @@ var Y = class extends Fe {
|
|
|
566
566
|
}
|
|
567
567
|
setOptions(e) {
|
|
568
568
|
let t = this.options;
|
|
569
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
569
|
+
this.options = this.#e.defaultMutationOptions(e), G(this.options, t) || this.#e.getMutationCache().notify({
|
|
570
570
|
type: "observerOptionsUpdated",
|
|
571
571
|
mutation: this.#n,
|
|
572
572
|
observer: this
|
|
573
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
573
|
+
}), t?.mutationKey && this.options.mutationKey && We(t.mutationKey) !== We(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
574
574
|
}
|
|
575
575
|
onUnsubscribe() {
|
|
576
576
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -588,7 +588,7 @@ var Y = class extends Fe {
|
|
|
588
588
|
return this.#r = t, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
589
589
|
}
|
|
590
590
|
#i() {
|
|
591
|
-
let e = this.#n?.state ??
|
|
591
|
+
let e = this.#n?.state ?? lt();
|
|
592
592
|
this.#t = {
|
|
593
593
|
...e,
|
|
594
594
|
isPending: e.status === "pending",
|
|
@@ -600,7 +600,7 @@ var Y = class extends Fe {
|
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
#a(e) {
|
|
603
|
-
|
|
603
|
+
J.batch(() => {
|
|
604
604
|
if (this.#r && this.hasListeners()) {
|
|
605
605
|
let t = this.#t.variables, n = this.#t.context, r = {
|
|
606
606
|
client: this.#e,
|
|
@@ -689,7 +689,7 @@ function Et(t, n, r) {
|
|
|
689
689
|
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, St(s), yt(s, a, c), bt(a);
|
|
690
690
|
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
691
691
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
692
|
-
let t = p ? d.subscribe(
|
|
692
|
+
let t = p ? d.subscribe(J.batchCalls(e)) : H;
|
|
693
693
|
return d.updateResult(), t;
|
|
694
694
|
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
695
695
|
d.setOptions(s);
|
|
@@ -701,24 +701,24 @@ function Et(t, n, r) {
|
|
|
701
701
|
query: c,
|
|
702
702
|
suspense: s.suspense
|
|
703
703
|
})) throw f.error;
|
|
704
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !
|
|
704
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !q.isServer() && Ct(f, i) && (u ? Tt(s, d, a) : c?.promise)?.catch(H).finally(() => {
|
|
705
705
|
d.updateResult();
|
|
706
706
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
707
707
|
}
|
|
708
708
|
//#endregion
|
|
709
709
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
710
710
|
function Dt(e, t) {
|
|
711
|
-
return Et(e,
|
|
711
|
+
return Et(e, rt, t);
|
|
712
712
|
}
|
|
713
713
|
//#endregion
|
|
714
714
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
715
715
|
function Ot(t, n) {
|
|
716
|
-
let r = ft(n), [i] = e.useState(() => new
|
|
716
|
+
let r = ft(n), [i] = e.useState(() => new ut(r, t));
|
|
717
717
|
e.useEffect(() => {
|
|
718
718
|
i.setOptions(t);
|
|
719
719
|
}, [i, t]);
|
|
720
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
721
|
-
i.mutate(e, t).catch(
|
|
720
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(J.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
721
|
+
i.mutate(e, t).catch(H);
|
|
722
722
|
}, [i]);
|
|
723
723
|
if (a.error && K(i.options.throwOnError, [a.error])) throw a.error;
|
|
724
724
|
return {
|
|
@@ -899,7 +899,7 @@ function nn(e, t) {
|
|
|
899
899
|
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
900
900
|
}
|
|
901
901
|
function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
902
|
-
let [u, h] = d(0), [g, v] = d(!1), b =
|
|
902
|
+
let [u, h] = d(0), [g, v] = d(!1), b = be({
|
|
903
903
|
mode: "uncontrolled",
|
|
904
904
|
initialValues: Xt(e),
|
|
905
905
|
validate: Zt(e)
|
|
@@ -924,7 +924,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
924
924
|
required: n,
|
|
925
925
|
...r
|
|
926
926
|
}, b.key(e.id));
|
|
927
|
-
case "date": return /* @__PURE__ */ p(
|
|
927
|
+
case "date": return /* @__PURE__ */ p(ye, {
|
|
928
928
|
valueFormat: "DD.MM.YYYY",
|
|
929
929
|
clearable: !0,
|
|
930
930
|
label: e.column.title,
|
|
@@ -938,7 +938,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
938
938
|
required: n,
|
|
939
939
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
940
940
|
}, b.key(e.id));
|
|
941
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
941
|
+
case "textarea": return /* @__PURE__ */ p(fe, {
|
|
942
942
|
minRows: 3,
|
|
943
943
|
autosize: !0,
|
|
944
944
|
label: e.column.title,
|
|
@@ -953,7 +953,7 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
953
953
|
error: r.error,
|
|
954
954
|
required: n
|
|
955
955
|
});
|
|
956
|
-
default: return /* @__PURE__ */ p(
|
|
956
|
+
default: return /* @__PURE__ */ p(de, {
|
|
957
957
|
type: e.id.includes("email") ? "email" : void 0,
|
|
958
958
|
label: e.column.title,
|
|
959
959
|
placeholder: e.placeholder ?? "",
|
|
@@ -981,10 +981,10 @@ function rn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
981
981
|
}
|
|
982
982
|
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
983
983
|
}),
|
|
984
|
-
children: [E ? /* @__PURE__ */ p(
|
|
984
|
+
children: [E ? /* @__PURE__ */ p(ae, {
|
|
985
985
|
active: u,
|
|
986
986
|
size: "sm",
|
|
987
|
-
children: w.map((e) => /* @__PURE__ */ p(
|
|
987
|
+
children: w.map((e) => /* @__PURE__ */ p(ae.Step, {
|
|
988
988
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
989
989
|
children: k(e)
|
|
990
990
|
}, e))
|
|
@@ -1044,7 +1044,7 @@ function X() {
|
|
|
1044
1044
|
//#endregion
|
|
1045
1045
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1046
1046
|
function Z(e, t, n) {
|
|
1047
|
-
return e ?
|
|
1047
|
+
return e ? he({
|
|
1048
1048
|
color: typeof e == "object" ? e[n] : e,
|
|
1049
1049
|
theme: t
|
|
1050
1050
|
}).value : void 0;
|
|
@@ -1081,7 +1081,7 @@ function ln({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1081
1081
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
|
-
var [un, dn] =
|
|
1084
|
+
var [un, dn] = me("useDataTableColumnsContext must be used within DataTableColumnProvider"), fn = (e) => {
|
|
1085
1085
|
let { children: t, columnsOrder: n, setColumnsOrder: r, columnsToggle: i, setColumnsToggle: a, columnsPinning: o, setColumnsPinning: s, resetColumnsOrder: c, resetColumnsToggle: l, resetColumnsPinning: u, setColumnWidth: f, setMultipleColumnWidths: m, resetColumnsWidth: h, beginResize: g, endResize: _, pinnedMap: v } = e, [y, b] = d(""), [x, S] = d("");
|
|
1086
1086
|
return p(un, {
|
|
1087
1087
|
value: {
|
|
@@ -1151,7 +1151,7 @@ function hn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1151
1151
|
children: r || m(f, { children: [e || p("div", {
|
|
1152
1152
|
className: "mantine-datatable-empty-state-icon",
|
|
1153
1153
|
children: p(mn, {})
|
|
1154
|
-
}), p(
|
|
1154
|
+
}), p(B, {
|
|
1155
1155
|
component: "div",
|
|
1156
1156
|
size: "sm",
|
|
1157
1157
|
c: "dimmed",
|
|
@@ -1207,7 +1207,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1207
1207
|
defaultPinned: e.pinned,
|
|
1208
1208
|
pinnable: !!e.pinnable,
|
|
1209
1209
|
pinned: e.pinned
|
|
1210
|
-
})), [t]), [i, a] =
|
|
1210
|
+
})), [t]), [i, a] = Ne({
|
|
1211
1211
|
key: e ? `${e}-columns-pinning` : "",
|
|
1212
1212
|
defaultValue: e ? r : void 0,
|
|
1213
1213
|
getInitialValueInEffect: n
|
|
@@ -1255,7 +1255,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1255
1255
|
};
|
|
1256
1256
|
}
|
|
1257
1257
|
function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1258
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1258
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = Ne({
|
|
1259
1259
|
key: e ? `${e}-columns-order` : "",
|
|
1260
1260
|
defaultValue: e ? r : void 0,
|
|
1261
1261
|
getInitialValueInEffect: n
|
|
@@ -1298,7 +1298,7 @@ function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1298
1298
|
};
|
|
1299
1299
|
}
|
|
1300
1300
|
function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1301
|
-
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] =
|
|
1301
|
+
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = Ne({
|
|
1302
1302
|
key: e ? `${e}-columns-width` : "",
|
|
1303
1303
|
defaultValue: e ? o() : void 0,
|
|
1304
1304
|
getInitialValueInEffect: n
|
|
@@ -1392,7 +1392,7 @@ function An({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1392
1392
|
defaultToggle: e.defaultToggle || !0,
|
|
1393
1393
|
toggleable: e.toggleable,
|
|
1394
1394
|
toggled: e.defaultToggle === void 0 || e.defaultToggle
|
|
1395
|
-
})), [t]), [i, a] =
|
|
1395
|
+
})), [t]), [i, a] = Ne({
|
|
1396
1396
|
key: e ? `${e}-columns-toggle` : "",
|
|
1397
1397
|
defaultValue: e ? r : void 0,
|
|
1398
1398
|
getInitialValueInEffect: n
|
|
@@ -1599,7 +1599,7 @@ function Bn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1599
1599
|
$(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1600
1600
|
}
|
|
1601
1601
|
function c() {
|
|
1602
|
-
f.current.withRowBorders && t.height < n.height ? $(r.current, Ln, `${
|
|
1602
|
+
f.current.withRowBorders && t.height < n.height ? $(r.current, Ln, `${ge("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, Ln, "unset");
|
|
1603
1603
|
}
|
|
1604
1604
|
h.current = c;
|
|
1605
1605
|
function l() {
|
|
@@ -1760,12 +1760,12 @@ function Gn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0
|
|
|
1760
1760
|
}, [e]), r;
|
|
1761
1761
|
}
|
|
1762
1762
|
function Kn(e) {
|
|
1763
|
-
let t =
|
|
1763
|
+
let t = ve();
|
|
1764
1764
|
return Gn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1765
1765
|
}
|
|
1766
1766
|
function qn(e) {
|
|
1767
|
-
let t =
|
|
1768
|
-
return
|
|
1767
|
+
let t = ve();
|
|
1768
|
+
return Pe((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1769
1769
|
}
|
|
1770
1770
|
function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1771
1771
|
let r = [];
|
|
@@ -1803,7 +1803,7 @@ function Jn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
function Yn(e, t) {
|
|
1806
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1806
|
+
let [n, r] = d(e), [i, a] = d(e), o = Ie(() => r(!0), 0), c = Ie(() => a(!1), t || 200);
|
|
1807
1807
|
return s(() => {
|
|
1808
1808
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1809
1809
|
}, [
|
|
@@ -1817,7 +1817,7 @@ function Yn(e, t) {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
var Xn = "mantine-datatable-nowrap", Zn = "mantine-datatable-ellipsis", Qn = "mantine-datatable-pointer-cursor", $n = "mantine-datatable-context-menu-cursor", er = "mantine-datatable-text-selection-disabled", tr = "mantine-datatable-text-align-left", nr = "mantine-datatable-text-align-center", rr = "mantine-datatable-text-align-right";
|
|
1819
1819
|
function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1820
|
-
return qn(r) ? p(
|
|
1820
|
+
return qn(r) ? p(ce, {
|
|
1821
1821
|
"data-pinned": n?.position,
|
|
1822
1822
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1823
1823
|
className: X({
|
|
@@ -1844,17 +1844,17 @@ function ir({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1844
1844
|
}) : null;
|
|
1845
1845
|
}
|
|
1846
1846
|
function ar({ shadowVisible: e }) {
|
|
1847
|
-
return p(
|
|
1847
|
+
return p(ce, {
|
|
1848
1848
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1849
1849
|
"data-shadow-visible": e || void 0
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
function or({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1853
|
-
return p(
|
|
1853
|
+
return p(se, {
|
|
1854
1854
|
ref: s,
|
|
1855
1855
|
className: X("mantine-datatable-footer", e),
|
|
1856
1856
|
style: t,
|
|
1857
|
-
children: m(
|
|
1857
|
+
children: m(z, { children: [a && p(ar, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1858
1858
|
if (e) return null;
|
|
1859
1859
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1860
1860
|
...r,
|
|
@@ -1893,7 +1893,7 @@ function sr({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1893
1893
|
n,
|
|
1894
1894
|
_
|
|
1895
1895
|
]), y = l(() => d.reduce((e, t) => e + wn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = En(f, y + v < h, m);
|
|
1896
|
-
return v > 0 ? p(
|
|
1896
|
+
return v > 0 ? p(ce, {
|
|
1897
1897
|
colSpan: v,
|
|
1898
1898
|
rowSpan: b > 1 ? b : void 0,
|
|
1899
1899
|
"data-pinned": s?.position,
|
|
@@ -1951,7 +1951,7 @@ function lr() {
|
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
function ur({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1954
|
-
let [i, { close: a, toggle: o }] =
|
|
1954
|
+
let [i, { close: a, toggle: o }] = Me(!1), s = t ? lr : cr, c = je(a);
|
|
1955
1955
|
return r && (c = void 0), m(F, {
|
|
1956
1956
|
withArrow: !0,
|
|
1957
1957
|
shadow: "md",
|
|
@@ -2136,7 +2136,7 @@ var gr = 50, _r = (e) => {
|
|
|
2136
2136
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2137
2137
|
current: 0,
|
|
2138
2138
|
next: 0
|
|
2139
|
-
}), { dir: c } =
|
|
2139
|
+
}), { dir: c } = _e(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = dn(), g = a((e) => {
|
|
2140
2140
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2141
2141
|
let r = n.current, a = r.nextElementSibling;
|
|
2142
2142
|
for (; a;) {
|
|
@@ -2274,34 +2274,34 @@ function br() {
|
|
|
2274
2274
|
function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
|
|
2275
2275
|
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = dn(), [te, I] = d(!1), L = u(null), ne = ee?.find((e) => e.accessor === r)?.pinned;
|
|
2276
2276
|
if (!qn(i)) return null;
|
|
2277
|
-
let
|
|
2277
|
+
let re = a ?? gn(r), ie = typeof re == "string" ? re : void 0, ae = o && S ? (e) => {
|
|
2278
2278
|
e?.defaultPrevented || S({
|
|
2279
2279
|
sortKey: k,
|
|
2280
2280
|
columnAccessor: r,
|
|
2281
2281
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2282
2282
|
});
|
|
2283
|
-
} : void 0,
|
|
2283
|
+
} : void 0, oe = (e) => {
|
|
2284
2284
|
e.stopPropagation(), A(r), I(!1);
|
|
2285
|
-
},
|
|
2285
|
+
}, R = (e) => {
|
|
2286
2286
|
e.preventDefault(), j(r), I(!0);
|
|
2287
|
-
}, ae = () => {
|
|
2288
|
-
j(r), I(!1), M();
|
|
2289
2287
|
}, se = () => {
|
|
2288
|
+
j(r), I(!1), M();
|
|
2289
|
+
}, le = () => {
|
|
2290
2290
|
I(!0);
|
|
2291
|
-
},
|
|
2291
|
+
}, z = () => {
|
|
2292
2292
|
I(!1);
|
|
2293
|
-
},
|
|
2293
|
+
}, ue = (e) => {
|
|
2294
2294
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2295
2295
|
...e,
|
|
2296
2296
|
toggled: !1
|
|
2297
2297
|
} : e));
|
|
2298
|
-
},
|
|
2298
|
+
}, B = (e) => {
|
|
2299
2299
|
F((t) => t.map((t) => t.accessor === r ? {
|
|
2300
2300
|
...t,
|
|
2301
2301
|
pinned: e
|
|
2302
2302
|
} : t));
|
|
2303
2303
|
};
|
|
2304
|
-
return m(
|
|
2304
|
+
return m(ce, {
|
|
2305
2305
|
"data-accessor": r,
|
|
2306
2306
|
"data-pinned": n?.position,
|
|
2307
2307
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2328,8 +2328,8 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2328
2328
|
],
|
|
2329
2329
|
role: o ? "button" : void 0,
|
|
2330
2330
|
tabIndex: o ? 0 : void 0,
|
|
2331
|
-
onClick:
|
|
2332
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2331
|
+
onClick: ae,
|
|
2332
|
+
onKeyDown: (e) => e.key === "Enter" && ae?.(),
|
|
2333
2333
|
ref: L,
|
|
2334
2334
|
children: [m(T, {
|
|
2335
2335
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
@@ -2344,11 +2344,11 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2344
2344
|
"mantine-datatable-header-cell-drag-over": te
|
|
2345
2345
|
}),
|
|
2346
2346
|
draggable: s,
|
|
2347
|
-
onDragStart: s ?
|
|
2348
|
-
onDragEnter: s ?
|
|
2349
|
-
onDragOver: s ?
|
|
2350
|
-
onDrop: s ?
|
|
2351
|
-
onDragLeave: s ?
|
|
2347
|
+
onDragStart: s ? oe : void 0,
|
|
2348
|
+
onDragEnter: s ? le : void 0,
|
|
2349
|
+
onDragOver: s ? R : void 0,
|
|
2350
|
+
onDrop: s ? se : void 0,
|
|
2351
|
+
onDragLeave: s ? z : void 0,
|
|
2352
2352
|
children: [s ? p(b, {
|
|
2353
2353
|
role: "img",
|
|
2354
2354
|
"aria-label": "Drag column",
|
|
@@ -2367,13 +2367,13 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2367
2367
|
[nr]: _ === "center",
|
|
2368
2368
|
[rr]: _ === "right"
|
|
2369
2369
|
}, Xn, Zn),
|
|
2370
|
-
title:
|
|
2371
|
-
children:
|
|
2370
|
+
title: ie,
|
|
2371
|
+
children: re
|
|
2372
2372
|
})]
|
|
2373
2373
|
}),
|
|
2374
2374
|
l ? p(hr, {
|
|
2375
2375
|
currentPinned: ne,
|
|
2376
|
-
onPinChange:
|
|
2376
|
+
onPinChange: B
|
|
2377
2377
|
}) : null,
|
|
2378
2378
|
c ? p(b, {
|
|
2379
2379
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2382,7 +2382,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2382
2382
|
children: p(g, {
|
|
2383
2383
|
size: "xs",
|
|
2384
2384
|
variant: "light",
|
|
2385
|
-
onClick:
|
|
2385
|
+
onClick: ue,
|
|
2386
2386
|
children: p(mr, {})
|
|
2387
2387
|
})
|
|
2388
2388
|
}) : null,
|
|
@@ -2412,7 +2412,7 @@ function xr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2412
2412
|
}
|
|
2413
2413
|
function Sr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2414
2414
|
let u = !o.disabled;
|
|
2415
|
-
return p(
|
|
2415
|
+
return p(ce, {
|
|
2416
2416
|
ref: l,
|
|
2417
2417
|
className: X("mantine-datatable-header-selector-cell", { [Qn]: n === "cell" && u }, e),
|
|
2418
2418
|
style: t,
|
|
@@ -2455,7 +2455,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2455
2455
|
checkboxProps: v,
|
|
2456
2456
|
onChange: _,
|
|
2457
2457
|
rowSpan: c ? D : void 0
|
|
2458
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } = dn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? gn(String(e))])) : void 0, ee = m(
|
|
2458
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = dn(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? gn(String(e))])) : void 0, ee = m(le, {
|
|
2459
2459
|
className: X("mantine-datatable-header", t),
|
|
2460
2460
|
style: n,
|
|
2461
2461
|
ref: w,
|
|
@@ -2464,7 +2464,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2464
2464
|
} : void 0,
|
|
2465
2465
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2466
2466
|
let n = Tn(c, t);
|
|
2467
|
-
return m(
|
|
2467
|
+
return m(z, { children: [t === 0 && O, n.map((e, r) => p(sr, {
|
|
2468
2468
|
group: e,
|
|
2469
2469
|
pinnedInfo: Cr(e, l),
|
|
2470
2470
|
maxDepth: E,
|
|
@@ -2474,7 +2474,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2474
2474
|
withColumnBorders: C,
|
|
2475
2475
|
totalTableColumns: o.length
|
|
2476
2476
|
}, e.id))] }, `group-depth-${t}`);
|
|
2477
|
-
}), m(
|
|
2477
|
+
}), m(z, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2478
2478
|
if (e) return null;
|
|
2479
2479
|
let { accessor: c, visibleMediaQuery: u, textAlign: d, width: f, title: m, sortable: h, draggable: g, toggleable: _, pinnable: v, resizable: y, titleClassName: b, titleStyle: x, filter: S, filterPopoverProps: C, filterPopoverDisableClickOutside: w, filtering: T, sortKey: E } = {
|
|
2480
2480
|
...s,
|
|
@@ -2511,7 +2511,7 @@ function wr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2511
2511
|
shadow: "md",
|
|
2512
2512
|
opened: j,
|
|
2513
2513
|
onChange: M,
|
|
2514
|
-
children: [p(I, { children: ee }), p(te, { children: p(
|
|
2514
|
+
children: [p(I, { children: ee }), p(te, { children: p(ie, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2515
2515
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2516
2516
|
size: "xs",
|
|
2517
2517
|
label: P[e.accessor],
|
|
@@ -2558,16 +2558,16 @@ function Er() {
|
|
|
2558
2558
|
});
|
|
2559
2559
|
}
|
|
2560
2560
|
var Dr = {
|
|
2561
|
-
xs:
|
|
2562
|
-
sm:
|
|
2563
|
-
md:
|
|
2564
|
-
lg:
|
|
2565
|
-
xl:
|
|
2561
|
+
xs: ge(22),
|
|
2562
|
+
sm: ge(26),
|
|
2563
|
+
md: ge(32),
|
|
2564
|
+
lg: ge(38),
|
|
2565
|
+
xl: ge(44)
|
|
2566
2566
|
};
|
|
2567
2567
|
function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2568
2568
|
return m(T, {
|
|
2569
2569
|
gap: "xs",
|
|
2570
|
-
children: [p(
|
|
2570
|
+
children: [p(B, {
|
|
2571
2571
|
component: "div",
|
|
2572
2572
|
size: e,
|
|
2573
2573
|
children: t
|
|
@@ -2598,7 +2598,7 @@ function Or({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2598
2598
|
}) : void 0],
|
|
2599
2599
|
disabled: n,
|
|
2600
2600
|
onClick: () => o(t),
|
|
2601
|
-
children: p(
|
|
2601
|
+
children: p(B, {
|
|
2602
2602
|
component: "div",
|
|
2603
2603
|
size: e,
|
|
2604
2604
|
children: t
|
|
@@ -2618,8 +2618,8 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2618
2618
|
totalRecords: g
|
|
2619
2619
|
});
|
|
2620
2620
|
} else O = n ? u : d;
|
|
2621
|
-
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !qn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${
|
|
2622
|
-
Text: (e) => p(
|
|
2621
|
+
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !qn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${ge(w)}rem` : e[w] || w})`), N = {
|
|
2622
|
+
Text: (e) => p(B, {
|
|
2623
2623
|
component: "div",
|
|
2624
2624
|
className: "mantine-datatable-pagination-text",
|
|
2625
2625
|
size: l,
|
|
@@ -2688,7 +2688,7 @@ function kr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
2690
2690
|
function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
|
|
2691
|
-
return qn(r) ? p(
|
|
2691
|
+
return qn(r) ? p(R, {
|
|
2692
2692
|
"data-pinned": n?.position,
|
|
2693
2693
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2694
2694
|
className: X({
|
|
@@ -2722,7 +2722,7 @@ function Ar({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2722
2722
|
}
|
|
2723
2723
|
function jr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2724
2724
|
let { expanded: i, visible: a } = Yn(e, r?.transitionDuration);
|
|
2725
|
-
return a ? m(f, { children: [p(
|
|
2725
|
+
return a ? m(f, { children: [p(z, {}), p(z, { children: p(R, {
|
|
2726
2726
|
className: "mantine-datatable-row-expansion-cell",
|
|
2727
2727
|
colSpan: t,
|
|
2728
2728
|
children: p(S, {
|
|
@@ -2742,7 +2742,7 @@ function Mr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
|
|
|
2742
2742
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2743
2743
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2744
2744
|
};
|
|
2745
|
-
return p(
|
|
2745
|
+
return p(R, {
|
|
2746
2746
|
className: X("mantine-datatable-row-selector-cell", { [Qn]: i === "cell" && d }, e),
|
|
2747
2747
|
style: t,
|
|
2748
2748
|
"data-shadow-visible": o || void 0,
|
|
@@ -2839,7 +2839,7 @@ function Nr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2839
2839
|
rowProps: P,
|
|
2840
2840
|
children: M,
|
|
2841
2841
|
expandedElement: N
|
|
2842
|
-
}) : m(f, { children: [p(
|
|
2842
|
+
}) : m(f, { children: [p(z, {
|
|
2843
2843
|
...P,
|
|
2844
2844
|
children: M
|
|
2845
2845
|
}), N] });
|
|
@@ -2906,30 +2906,30 @@ function Fr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2906
2906
|
]
|
|
2907
2907
|
});
|
|
2908
2908
|
}
|
|
2909
|
-
function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords:
|
|
2910
|
-
let
|
|
2909
|
+
function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: ne, totalRecords: re, recordsPerPage: ie, onRecordsPerPageChange: ae, recordsPerPageOptions: R, recordsPerPageLabel: se = "Records per page", paginationWithEdges: ce, paginationWithControls: le, paginationActiveTextColor: z, paginationActiveBackgroundColor: ue, paginationSize: B = "sm", paginationText: de = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: fe = "sm", getPaginationControlProps: pe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: me, renderPagination: he, loaderBackgroundBlur: ge, customLoader: _e, loaderSize: ve, loaderType: ye, loaderColor: be, loadingText: xe = "...", emptyState: Se, noRecordsText: Ce = "No records", noRecordsIcon: we, highlightOnHover: Te, striped: Ee, noHeader: De, onRowClick: Oe, onRowDoubleClick: ke, onRowContextMenu: Ae, onCellClick: je, onCellDoubleClick: Me, onCellContextMenu: Ne, onScroll: Pe, onScrollToTop: Ie, onScrollToBottom: Le, onScrollToLeft: Re, onScrollToRight: ze, c: V, backgroundColor: Be, borderColor: Ve, rowBorderColor: H, stripedColor: He, highlightOnHoverColor: Ue, rowColor: U, rowBackgroundColor: W, rowExpansion: We, rowClassName: Ge, rowStyle: Ke, customRowAttributes: G, scrollViewportRef: qe, scrollAreaProps: Je, tableRef: Ye, bodyRef: Xe, m: K, my: q, mx: Ze, mt: Qe, mb: $e, ml: J, mr: et, className: tt, classNames: nt, style: rt, styles: it, rowFactory: at, tableWrapper: ot, ...st }) {
|
|
2910
|
+
let ct = l(() => y ? Cn(y) : g, [g, y]), { refs: Y, onScroll: lt } = Bn({
|
|
2911
2911
|
scrollCallbacks: {
|
|
2912
|
-
onScroll:
|
|
2913
|
-
onScrollToTop:
|
|
2914
|
-
onScrollToBottom:
|
|
2915
|
-
onScrollToLeft:
|
|
2916
|
-
onScrollToRight:
|
|
2912
|
+
onScroll: Pe,
|
|
2913
|
+
onScrollToTop: Ie,
|
|
2914
|
+
onScrollToBottom: Le,
|
|
2915
|
+
onScrollToLeft: Re,
|
|
2916
|
+
onScrollToRight: ze
|
|
2917
2917
|
},
|
|
2918
|
-
withRowBorders:
|
|
2919
|
-
}),
|
|
2918
|
+
withRowBorders: st.withRowBorders
|
|
2919
|
+
}), ut = jn({
|
|
2920
2920
|
key: _,
|
|
2921
|
-
columns:
|
|
2922
|
-
headerRef:
|
|
2923
|
-
scrollViewportRef:
|
|
2924
|
-
}), dt =
|
|
2925
|
-
rowExpansion:
|
|
2921
|
+
columns: ct,
|
|
2922
|
+
headerRef: Y.header,
|
|
2923
|
+
scrollViewportRef: Y.scrollViewport
|
|
2924
|
+
}), dt = ut.effectiveColumns, ft = Fe(Y.table, Ye), pt = Fe(Y.scrollViewport, qe), mt = u(null), ht = Fe(mt, Xe), gt = Jn({
|
|
2925
|
+
rowExpansion: We,
|
|
2926
2926
|
records: T,
|
|
2927
2927
|
idAccessor: w
|
|
2928
2928
|
}), { pinnedMap: _t, hasLeftPinned: vt, hasRightPinned: yt } = Vn({
|
|
2929
2929
|
columns: dt,
|
|
2930
|
-
theadRef:
|
|
2930
|
+
theadRef: Y.header,
|
|
2931
2931
|
tbodyRef: mt,
|
|
2932
|
-
selectionColumnHeaderRef:
|
|
2932
|
+
selectionColumnHeaderRef: Y.selectionColumnHeader,
|
|
2933
2933
|
selectionVisible: !!D,
|
|
2934
2934
|
pinFirstColumn: b,
|
|
2935
2935
|
pinLastColumn: x
|
|
@@ -2942,7 +2942,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2942
2942
|
let wt = T?.length;
|
|
2943
2943
|
c(() => {
|
|
2944
2944
|
if (!bt.current || h || T === St.current) return;
|
|
2945
|
-
let e =
|
|
2945
|
+
let e = Y.scrollViewport.current;
|
|
2946
2946
|
if (!e) return;
|
|
2947
2947
|
let t = requestAnimationFrame(() => {
|
|
2948
2948
|
e.scrollTo({
|
|
@@ -2954,7 +2954,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2954
2954
|
}, [
|
|
2955
2955
|
h,
|
|
2956
2956
|
T,
|
|
2957
|
-
|
|
2957
|
+
Y.scrollViewport
|
|
2958
2958
|
]);
|
|
2959
2959
|
let Tt = T?.map((e) => Q(e, w)), Et = !!D, Dt = D?.map((e) => Q(e, w)), Ot = Tt !== void 0 && Dt !== void 0 && Dt.length > 0, kt = j ? T?.filter(j) : T, At = kt?.map((e) => Q(e, w)), jt = Ot && At.every((e) => Dt.includes(e)), Mt = Ot && At.some((e) => Dt.includes(e)), Nt = a(() => {
|
|
2960
2960
|
D && O && O(jt ? D.filter((e) => !At.includes(Q(e, w))) : bn([...D, ...kt], (e) => Q(e, w)));
|
|
@@ -2967,28 +2967,28 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2967
2967
|
D
|
|
2968
2968
|
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = Hn(Tt), It = Et && !vt, Lt = {
|
|
2969
2969
|
m: K,
|
|
2970
|
-
my:
|
|
2971
|
-
mx:
|
|
2972
|
-
mt:
|
|
2973
|
-
mb:
|
|
2974
|
-
ml:
|
|
2975
|
-
mr:
|
|
2976
|
-
}, Rt = a(({ children: e }) =>
|
|
2970
|
+
my: q,
|
|
2971
|
+
mx: Ze,
|
|
2972
|
+
mt: Qe,
|
|
2973
|
+
mb: $e,
|
|
2974
|
+
ml: J,
|
|
2975
|
+
mr: et
|
|
2976
|
+
}, Rt = a(({ children: e }) => ot ? ot({ children: e }) : e, [ot]);
|
|
2977
2977
|
return p(fn, {
|
|
2978
|
-
...
|
|
2978
|
+
...ut,
|
|
2979
2979
|
pinnedMap: _t,
|
|
2980
2980
|
children: m(v, {
|
|
2981
|
-
ref:
|
|
2981
|
+
ref: Y.root,
|
|
2982
2982
|
...Lt,
|
|
2983
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2983
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, tt, nt?.root),
|
|
2984
2984
|
style: [
|
|
2985
2985
|
(e) => ({
|
|
2986
2986
|
...sn({
|
|
2987
2987
|
theme: e,
|
|
2988
|
-
c:
|
|
2989
|
-
backgroundColor:
|
|
2990
|
-
borderColor:
|
|
2991
|
-
rowBorderColor:
|
|
2988
|
+
c: V,
|
|
2989
|
+
backgroundColor: Be,
|
|
2990
|
+
borderColor: Ve,
|
|
2991
|
+
rowBorderColor: H,
|
|
2992
2992
|
stripedColor: He,
|
|
2993
2993
|
highlightOnHoverColor: Ue
|
|
2994
2994
|
}),
|
|
@@ -2998,8 +2998,8 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2998
2998
|
minHeight: i,
|
|
2999
2999
|
maxHeight: o
|
|
3000
3000
|
}),
|
|
3001
|
-
|
|
3002
|
-
|
|
3001
|
+
rt,
|
|
3002
|
+
it?.root,
|
|
3003
3003
|
{ position: "relative" }
|
|
3004
3004
|
],
|
|
3005
3005
|
children: [
|
|
@@ -3007,9 +3007,9 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3007
3007
|
viewportRef: pt,
|
|
3008
3008
|
leftShadowBehind: Et || vt,
|
|
3009
3009
|
rightShadowBehind: yt,
|
|
3010
|
-
onScrollPositionChange:
|
|
3011
|
-
scrollAreaProps:
|
|
3012
|
-
children: p(Rt, { children: m(
|
|
3010
|
+
onScrollPositionChange: lt,
|
|
3011
|
+
scrollAreaProps: Je,
|
|
3012
|
+
children: p(Rt, { children: m(oe, {
|
|
3013
3013
|
ref: ft,
|
|
3014
3014
|
horizontalSpacing: I,
|
|
3015
3015
|
className: X("mantine-datatable-table", {
|
|
@@ -3017,27 +3017,27 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3017
3017
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3018
3018
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3019
3019
|
"mantine-datatable-selection-column-visible": Et,
|
|
3020
|
-
"mantine-datatable-resizable-columns":
|
|
3021
|
-
"mantine-datatable-resize-locked":
|
|
3022
|
-
"mantine-datatable-resizing":
|
|
3023
|
-
},
|
|
3020
|
+
"mantine-datatable-resizable-columns": ut.hasResizableColumns,
|
|
3021
|
+
"mantine-datatable-resize-locked": ut.isLocked,
|
|
3022
|
+
"mantine-datatable-resizing": ut.isResizing
|
|
3023
|
+
}, nt?.table),
|
|
3024
3024
|
style: {
|
|
3025
|
-
...
|
|
3026
|
-
...
|
|
3027
|
-
...
|
|
3025
|
+
...it?.table,
|
|
3026
|
+
...ut.isLocked ? { tableLayout: "fixed" } : null,
|
|
3027
|
+
...ut.tableWidth == null ? null : { width: `${ut.tableWidth}px` }
|
|
3028
3028
|
},
|
|
3029
|
-
"data-striped": wt &&
|
|
3030
|
-
"data-highlight-on-hover":
|
|
3031
|
-
...
|
|
3029
|
+
"data-striped": wt && Ee || void 0,
|
|
3030
|
+
"data-highlight-on-hover": Te || void 0,
|
|
3031
|
+
...st,
|
|
3032
3032
|
children: [
|
|
3033
|
-
|
|
3034
|
-
...
|
|
3033
|
+
De ? null : p(fn, {
|
|
3034
|
+
...ut,
|
|
3035
3035
|
pinnedMap: _t,
|
|
3036
3036
|
children: p(wr, {
|
|
3037
|
-
ref:
|
|
3038
|
-
selectionColumnHeaderRef:
|
|
3039
|
-
className:
|
|
3040
|
-
style:
|
|
3037
|
+
ref: Y.header,
|
|
3038
|
+
selectionColumnHeaderRef: Y.selectionColumnHeader,
|
|
3039
|
+
className: nt?.header,
|
|
3040
|
+
style: it?.header,
|
|
3041
3041
|
columns: dt,
|
|
3042
3042
|
defaultColumnProps: S,
|
|
3043
3043
|
groups: y,
|
|
@@ -3057,7 +3057,7 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3057
3057
|
selectorCellShadowVisible: It,
|
|
3058
3058
|
selectionColumnClassName: k,
|
|
3059
3059
|
selectionColumnStyle: A,
|
|
3060
|
-
withColumnBorders:
|
|
3060
|
+
withColumnBorders: st.withColumnBorders
|
|
3061
3061
|
})
|
|
3062
3062
|
}),
|
|
3063
3063
|
p("tbody", {
|
|
@@ -3084,30 +3084,30 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3084
3084
|
isRecordSelectable: j,
|
|
3085
3085
|
selectionCheckboxProps: M,
|
|
3086
3086
|
getSelectionCheckboxProps: P,
|
|
3087
|
-
onClick:
|
|
3088
|
-
onDoubleClick:
|
|
3089
|
-
onCellClick:
|
|
3090
|
-
onCellDoubleClick:
|
|
3091
|
-
onContextMenu:
|
|
3092
|
-
onCellContextMenu:
|
|
3087
|
+
onClick: Oe,
|
|
3088
|
+
onDoubleClick: ke,
|
|
3089
|
+
onCellClick: je,
|
|
3090
|
+
onCellDoubleClick: Me,
|
|
3091
|
+
onContextMenu: Ae,
|
|
3092
|
+
onCellContextMenu: Ne,
|
|
3093
3093
|
expansion: gt,
|
|
3094
|
-
color:
|
|
3095
|
-
backgroundColor:
|
|
3096
|
-
className:
|
|
3097
|
-
style:
|
|
3098
|
-
customAttributes:
|
|
3094
|
+
color: U,
|
|
3095
|
+
backgroundColor: W,
|
|
3096
|
+
className: Ge,
|
|
3097
|
+
style: Ke,
|
|
3098
|
+
customAttributes: G,
|
|
3099
3099
|
selectorCellShadowVisible: It,
|
|
3100
3100
|
selectionColumnClassName: k,
|
|
3101
3101
|
selectionColumnStyle: A,
|
|
3102
3102
|
idAccessor: w,
|
|
3103
|
-
rowFactory:
|
|
3103
|
+
rowFactory: at
|
|
3104
3104
|
}, n);
|
|
3105
3105
|
}) : p(pn, {})
|
|
3106
3106
|
}),
|
|
3107
3107
|
dt.some(({ footer: e }) => e) && p(or, {
|
|
3108
|
-
ref:
|
|
3109
|
-
className:
|
|
3110
|
-
style:
|
|
3108
|
+
ref: Y.footer,
|
|
3109
|
+
className: nt?.footer,
|
|
3110
|
+
style: it?.footer,
|
|
3111
3111
|
columns: dt,
|
|
3112
3112
|
defaultColumnProps: S,
|
|
3113
3113
|
pinnedMap: _t,
|
|
@@ -3118,44 +3118,44 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3118
3118
|
}) })
|
|
3119
3119
|
}),
|
|
3120
3120
|
!!(L && wt) && p(kr, {
|
|
3121
|
-
className:
|
|
3122
|
-
style:
|
|
3121
|
+
className: nt?.pagination,
|
|
3122
|
+
style: it?.pagination,
|
|
3123
3123
|
horizontalSpacing: I,
|
|
3124
3124
|
fetching: h,
|
|
3125
3125
|
page: L,
|
|
3126
3126
|
onPageChange: Ct,
|
|
3127
|
-
totalRecords:
|
|
3128
|
-
recordsPerPage:
|
|
3129
|
-
onRecordsPerPageChange:
|
|
3130
|
-
recordsPerPageOptions:
|
|
3131
|
-
recordsPerPageLabel:
|
|
3132
|
-
paginationWithEdges:
|
|
3133
|
-
paginationWithControls:
|
|
3134
|
-
paginationActiveTextColor:
|
|
3135
|
-
paginationActiveBackgroundColor:
|
|
3136
|
-
paginationSize:
|
|
3137
|
-
paginationText:
|
|
3138
|
-
paginationWrapBreakpoint:
|
|
3139
|
-
getPaginationControlProps:
|
|
3140
|
-
getPaginationItemProps:
|
|
3141
|
-
noRecordsText:
|
|
3142
|
-
loadingText:
|
|
3127
|
+
totalRecords: re,
|
|
3128
|
+
recordsPerPage: ie,
|
|
3129
|
+
onRecordsPerPageChange: ae,
|
|
3130
|
+
recordsPerPageOptions: R,
|
|
3131
|
+
recordsPerPageLabel: se,
|
|
3132
|
+
paginationWithEdges: ce,
|
|
3133
|
+
paginationWithControls: le,
|
|
3134
|
+
paginationActiveTextColor: z,
|
|
3135
|
+
paginationActiveBackgroundColor: ue,
|
|
3136
|
+
paginationSize: B,
|
|
3137
|
+
paginationText: de,
|
|
3138
|
+
paginationWrapBreakpoint: fe,
|
|
3139
|
+
getPaginationControlProps: pe,
|
|
3140
|
+
getPaginationItemProps: me,
|
|
3141
|
+
noRecordsText: Ce,
|
|
3142
|
+
loadingText: xe,
|
|
3143
3143
|
recordsLength: wt,
|
|
3144
|
-
renderPagination:
|
|
3144
|
+
renderPagination: he
|
|
3145
3145
|
}),
|
|
3146
3146
|
p(Tr, {
|
|
3147
3147
|
fetching: h,
|
|
3148
|
-
backgroundBlur:
|
|
3149
|
-
customContent:
|
|
3150
|
-
size:
|
|
3151
|
-
type:
|
|
3152
|
-
color:
|
|
3148
|
+
backgroundBlur: ge,
|
|
3149
|
+
customContent: _e,
|
|
3150
|
+
size: ve,
|
|
3151
|
+
type: ye,
|
|
3152
|
+
color: be
|
|
3153
3153
|
}),
|
|
3154
3154
|
p(hn, {
|
|
3155
|
-
icon:
|
|
3156
|
-
text:
|
|
3155
|
+
icon: we,
|
|
3156
|
+
text: Ce,
|
|
3157
3157
|
active: !h && !wt,
|
|
3158
|
-
children:
|
|
3158
|
+
children: Se
|
|
3159
3159
|
})
|
|
3160
3160
|
]
|
|
3161
3161
|
})
|
|
@@ -3165,18 +3165,18 @@ function Ir({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3165
3165
|
//#region src/DataTable/UpdateModal.tsx
|
|
3166
3166
|
function Lr({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3167
3167
|
let { data: s, isLoading: c } = Ut(i, n, a), { mutateAsync: l, isPending: u, error: d } = qt(i, n, r);
|
|
3168
|
-
return c || !s ? /* @__PURE__ */ m(
|
|
3168
|
+
return c || !s ? /* @__PURE__ */ m(ie, {
|
|
3169
3169
|
gap: "md",
|
|
3170
3170
|
children: [
|
|
3171
|
-
/* @__PURE__ */ p(
|
|
3172
|
-
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(
|
|
3171
|
+
/* @__PURE__ */ p(re, { height: 40 }),
|
|
3172
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, t)),
|
|
3173
3173
|
/* @__PURE__ */ m(T, {
|
|
3174
3174
|
mt: "md",
|
|
3175
3175
|
justify: "end",
|
|
3176
|
-
children: [/* @__PURE__ */ p(
|
|
3176
|
+
children: [/* @__PURE__ */ p(re, {
|
|
3177
3177
|
width: 100,
|
|
3178
3178
|
height: 36
|
|
3179
|
-
}), /* @__PURE__ */ p(
|
|
3179
|
+
}), /* @__PURE__ */ p(re, {
|
|
3180
3180
|
width: 100,
|
|
3181
3181
|
height: 36
|
|
3182
3182
|
})]
|
|
@@ -3211,7 +3211,7 @@ function Rr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
|
|
|
3211
3211
|
title: l.name,
|
|
3212
3212
|
children: l.message
|
|
3213
3213
|
}),
|
|
3214
|
-
/* @__PURE__ */ p(
|
|
3214
|
+
/* @__PURE__ */ p(B, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3215
3215
|
/* @__PURE__ */ m(T, {
|
|
3216
3216
|
mt: "md",
|
|
3217
3217
|
justify: "end",
|
|
@@ -3361,7 +3361,7 @@ function Xr({ rows: e }) {
|
|
|
3361
3361
|
gap: "md",
|
|
3362
3362
|
py: "xs",
|
|
3363
3363
|
px: "sm",
|
|
3364
|
-
children: [/* @__PURE__ */ p(
|
|
3364
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3365
3365
|
fw: 700,
|
|
3366
3366
|
fz: "sm",
|
|
3367
3367
|
style: { flexShrink: 0 },
|
|
@@ -3395,13 +3395,13 @@ function $r(e, t) {
|
|
|
3395
3395
|
let n = t.column;
|
|
3396
3396
|
if (n.render) return n.render(e, 0);
|
|
3397
3397
|
let r = Qr(e, n.accessor ?? t.id);
|
|
3398
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3398
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
3399
3399
|
c: "dimmed",
|
|
3400
3400
|
children: "–"
|
|
3401
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3401
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
3402
3402
|
fz: "sm",
|
|
3403
3403
|
children: r ? "Ja" : "Nein"
|
|
3404
|
-
}) : /* @__PURE__ */ p(
|
|
3404
|
+
}) : /* @__PURE__ */ p(B, {
|
|
3405
3405
|
fz: "sm",
|
|
3406
3406
|
children: String(r)
|
|
3407
3407
|
});
|
|
@@ -3428,7 +3428,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3428
3428
|
event: n
|
|
3429
3429
|
});
|
|
3430
3430
|
};
|
|
3431
|
-
return /* @__PURE__ */ m(
|
|
3431
|
+
return /* @__PURE__ */ m(ie, {
|
|
3432
3432
|
gap: "sm",
|
|
3433
3433
|
my: "md",
|
|
3434
3434
|
children: [
|
|
@@ -3446,7 +3446,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3446
3446
|
variant: "filled",
|
|
3447
3447
|
size: "input-sm",
|
|
3448
3448
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3449
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3449
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(Oe, { size: 18 }) : /* @__PURE__ */ p(ke, { size: 18 })
|
|
3450
3450
|
})] }), E.length > 0 && /* @__PURE__ */ m(F, {
|
|
3451
3451
|
opened: M,
|
|
3452
3452
|
onChange: N,
|
|
@@ -3464,7 +3464,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3464
3464
|
size: "input-sm",
|
|
3465
3465
|
onClick: () => N((e) => !e),
|
|
3466
3466
|
"aria-label": "Filter",
|
|
3467
|
-
children: /* @__PURE__ */ p(
|
|
3467
|
+
children: /* @__PURE__ */ p(we, { size: 18 })
|
|
3468
3468
|
})
|
|
3469
3469
|
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3470
3470
|
p: 0,
|
|
@@ -3479,7 +3479,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3479
3479
|
value: e.id,
|
|
3480
3480
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3481
3481
|
gap: "xs",
|
|
3482
|
-
children: [/* @__PURE__ */ p(
|
|
3482
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3483
3483
|
fw: 600,
|
|
3484
3484
|
fz: "sm",
|
|
3485
3485
|
children: e.column.title ?? e.id
|
|
@@ -3495,7 +3495,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3495
3495
|
})]
|
|
3496
3496
|
})]
|
|
3497
3497
|
}),
|
|
3498
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3498
|
+
e.length === 0 && /* @__PURE__ */ p(B, {
|
|
3499
3499
|
c: "dimmed",
|
|
3500
3500
|
ta: "center",
|
|
3501
3501
|
py: "xl",
|
|
@@ -3530,7 +3530,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3530
3530
|
color: "gray",
|
|
3531
3531
|
size: "sm",
|
|
3532
3532
|
onClick: (e) => e.stopPropagation(),
|
|
3533
|
-
children: /* @__PURE__ */ p(
|
|
3533
|
+
children: /* @__PURE__ */ p(Ce, { size: 16 })
|
|
3534
3534
|
}) }), /* @__PURE__ */ p(k.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(k.Item, {
|
|
3535
3535
|
leftSection: t.icon,
|
|
3536
3536
|
onClick: (n) => {
|
|
@@ -3554,7 +3554,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3554
3554
|
})]
|
|
3555
3555
|
}) }, s);
|
|
3556
3556
|
}),
|
|
3557
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3557
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(ie, {
|
|
3558
3558
|
gap: "xs",
|
|
3559
3559
|
mt: "sm",
|
|
3560
3560
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3568,7 +3568,7 @@ function ei({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3568
3568
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3569
3569
|
justify: "center",
|
|
3570
3570
|
gap: "xs",
|
|
3571
|
-
children: [/* @__PURE__ */ p(
|
|
3571
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3572
3572
|
fz: "xs",
|
|
3573
3573
|
c: "dimmed",
|
|
3574
3574
|
children: "Einträge pro Seite:"
|
|
@@ -3597,32 +3597,32 @@ var ti = [
|
|
|
3597
3597
|
100,
|
|
3598
3598
|
500
|
|
3599
3599
|
];
|
|
3600
|
-
function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c,
|
|
3601
|
-
let [
|
|
3602
|
-
|
|
3603
|
-
},
|
|
3604
|
-
...
|
|
3605
|
-
...
|
|
3606
|
-
},
|
|
3600
|
+
function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPath: a, mutationApiPath: o, buttons: c, topContent: l, fields: h, selection: b, pagination: x, filters: S, actions: C, steps: D, defaultSort: O, onSortChange: A, createButtonText: j, queryParams: M, tabs: P, defaultTab: ee, activeTab: F, onActiveTabChange: te, canUpdate: I, canDelete: L, showRefresh: ne = !0, onRefresh: ae, autoPoll: oe, rowExpansion: R, onRowClick: se, mobileCards: ce = !1, deleteConfirmMessage: le, editRecordId: z, onEditRecordIdChange: de }) {
|
|
3601
|
+
let [fe, me] = d(ee || (P && P.length > 0 ? P[0].value : null)), he = F === void 0 ? fe : F, ge = (e) => {
|
|
3602
|
+
F === void 0 && me(e), te && te(e);
|
|
3603
|
+
}, _e = P?.find((e) => e.value === he), ve = _e?.queryParams || {}, ye = _e?.apiPath ?? a, be = _e?.mutationApiPath ?? o ?? ye, Ce = {
|
|
3604
|
+
...M,
|
|
3605
|
+
...ve
|
|
3606
|
+
}, we = Ce ? "?" + Object.entries(Ce).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", Oe = he ? [...n, he] : n, { data: ke, isLoading: je, isError: Me, isRefetching: Ne, refetch: Pe } = Wt(ye + we, Oe), Fe = Yr(Array.isArray(ke) ? ke : [], S), [Ie, Le] = d(!1), Re = u(() => {});
|
|
3607
3607
|
s(() => {
|
|
3608
|
-
|
|
3608
|
+
Re.current = ae ?? (() => Pe());
|
|
3609
3609
|
});
|
|
3610
|
-
let
|
|
3610
|
+
let ze = typeof oe == "function" ? oe(Array.isArray(ke) ? ke : []) : oe ?? !1;
|
|
3611
3611
|
s(() => {
|
|
3612
|
-
if (!
|
|
3612
|
+
if (!ze) return;
|
|
3613
3613
|
let e = setInterval(() => {
|
|
3614
|
-
Promise.resolve(
|
|
3615
|
-
},
|
|
3614
|
+
Promise.resolve(Re.current()).catch(() => {});
|
|
3615
|
+
}, ze);
|
|
3616
3616
|
return () => clearInterval(e);
|
|
3617
|
-
}, [
|
|
3618
|
-
let [
|
|
3619
|
-
columnAccessor:
|
|
3620
|
-
direction:
|
|
3621
|
-
}),
|
|
3622
|
-
|
|
3623
|
-
},
|
|
3624
|
-
|
|
3625
|
-
}, Ye =
|
|
3617
|
+
}, [ze]);
|
|
3618
|
+
let [V, Be] = d({
|
|
3619
|
+
columnAccessor: O?.field ?? h[0].id,
|
|
3620
|
+
direction: O?.direction ?? "desc"
|
|
3621
|
+
}), Ve = (e) => {
|
|
3622
|
+
Be(e), A && A(String(e.columnAccessor), e.direction);
|
|
3623
|
+
}, H = Ur(Fe, V.columnAccessor, V.direction), [He, Ue] = zr(ti[1], "mantine-table-page-size"), [U, W] = d(1), We = x ? H.slice((U - 1) * He, U * He) : H, [Ge, Ke] = d([]), G = R?.expanded?.recordIds ?? Ge, qe = R?.expanded?.onRecordIdsChange ?? Ke, Je = (e) => {
|
|
3624
|
+
G.includes(e) ? qe(G.filter((t) => t !== e)) : qe(R?.allowMultiple ? [...G, e] : [e]);
|
|
3625
|
+
}, Ye = h.findIndex((e) => e.list && e.column && !e.column.hidden), Xe = R && Ye >= 0 ? h.map((e, t) => {
|
|
3626
3626
|
if (t !== Ye) return e;
|
|
3627
3627
|
let n = e.column.render;
|
|
3628
3628
|
return {
|
|
@@ -3633,7 +3633,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3633
3633
|
gap: "xs",
|
|
3634
3634
|
wrap: "nowrap",
|
|
3635
3635
|
align: "center",
|
|
3636
|
-
children: [!
|
|
3636
|
+
children: [!R.expandable || R.expandable(t) ? /* @__PURE__ */ p(v, {
|
|
3637
3637
|
component: "span",
|
|
3638
3638
|
"aria-label": "Aufklappen",
|
|
3639
3639
|
onClick: (e) => {
|
|
@@ -3644,11 +3644,11 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3644
3644
|
flexShrink: 0,
|
|
3645
3645
|
cursor: "pointer"
|
|
3646
3646
|
},
|
|
3647
|
-
children: /* @__PURE__ */ p(
|
|
3647
|
+
children: /* @__PURE__ */ p(Se, {
|
|
3648
3648
|
size: 16,
|
|
3649
3649
|
style: {
|
|
3650
3650
|
color: "var(--mantine-primary-color-filled)",
|
|
3651
|
-
transform:
|
|
3651
|
+
transform: G.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3652
3652
|
transition: "transform 200ms ease"
|
|
3653
3653
|
}
|
|
3654
3654
|
})
|
|
@@ -3659,32 +3659,32 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3659
3659
|
})
|
|
3660
3660
|
}
|
|
3661
3661
|
};
|
|
3662
|
-
}) :
|
|
3662
|
+
}) : h, [K, q] = d([]);
|
|
3663
3663
|
s(() => {
|
|
3664
|
-
|
|
3665
|
-
}, [
|
|
3666
|
-
let [Ze, Qe] = d(!1), [$e,
|
|
3664
|
+
q([]);
|
|
3665
|
+
}, [he]);
|
|
3666
|
+
let [Ze, Qe] = d(!1), [$e, J] = d(!1), [et, tt] = d(!1), nt = u(null);
|
|
3667
3667
|
s(() => {
|
|
3668
|
-
if (!
|
|
3669
|
-
|
|
3668
|
+
if (!z) {
|
|
3669
|
+
nt.current = null;
|
|
3670
3670
|
return;
|
|
3671
3671
|
}
|
|
3672
|
-
if (
|
|
3673
|
-
let e =
|
|
3674
|
-
e && (
|
|
3675
|
-
}, [
|
|
3676
|
-
let
|
|
3677
|
-
return
|
|
3678
|
-
icon: /* @__PURE__ */ p(
|
|
3672
|
+
if (nt.current === z) return;
|
|
3673
|
+
let e = H.find((e) => e.id === z);
|
|
3674
|
+
e && (nt.current = z, q([e]), J(!0), de?.(null));
|
|
3675
|
+
}, [z, H]);
|
|
3676
|
+
let rt = h.some((e) => e.update), it = h.some((e) => e.delete), at = [];
|
|
3677
|
+
return rt && at.push({
|
|
3678
|
+
icon: /* @__PURE__ */ p(Ee, { size: 14 }),
|
|
3679
3679
|
label: "Bearbeiten",
|
|
3680
3680
|
onClick: (e) => {
|
|
3681
|
-
|
|
3681
|
+
q(e), J(!0);
|
|
3682
3682
|
}
|
|
3683
|
-
}),
|
|
3684
|
-
icon: /* @__PURE__ */ p(
|
|
3683
|
+
}), C && at.push(...C), it && at.push({
|
|
3684
|
+
icon: /* @__PURE__ */ p(Ae, { size: 14 }),
|
|
3685
3685
|
label: "Löschen",
|
|
3686
3686
|
onClick: (e) => {
|
|
3687
|
-
|
|
3687
|
+
q(e), tt(!0);
|
|
3688
3688
|
}
|
|
3689
3689
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3690
3690
|
/* @__PURE__ */ m(w, {
|
|
@@ -3703,7 +3703,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3703
3703
|
gap: 6,
|
|
3704
3704
|
align: "center",
|
|
3705
3705
|
wrap: "nowrap",
|
|
3706
|
-
children: [typeof e == "string" ? /* @__PURE__ */ p(
|
|
3706
|
+
children: [typeof e == "string" ? /* @__PURE__ */ p(pe, {
|
|
3707
3707
|
order: 4,
|
|
3708
3708
|
children: e
|
|
3709
3709
|
}) : e, t != null && /* @__PURE__ */ m(E, {
|
|
@@ -3719,8 +3719,8 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3719
3719
|
size: "sm",
|
|
3720
3720
|
radius: "xl",
|
|
3721
3721
|
"aria-label": "Mehr Informationen",
|
|
3722
|
-
children: /* @__PURE__ */ p(
|
|
3723
|
-
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(
|
|
3722
|
+
children: /* @__PURE__ */ p(Te, { size: 16 })
|
|
3723
|
+
}) }), /* @__PURE__ */ p(E.Dropdown, { children: /* @__PURE__ */ p(B, {
|
|
3724
3724
|
component: "div",
|
|
3725
3725
|
size: "sm",
|
|
3726
3726
|
c: "dimmed",
|
|
@@ -3747,49 +3747,49 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3747
3747
|
sm: "auto"
|
|
3748
3748
|
},
|
|
3749
3749
|
children: [
|
|
3750
|
-
|
|
3750
|
+
ne && /* @__PURE__ */ p(g, {
|
|
3751
3751
|
variant: "subtle",
|
|
3752
|
-
loading:
|
|
3752
|
+
loading: Ie,
|
|
3753
3753
|
onClick: async () => {
|
|
3754
|
-
if (
|
|
3755
|
-
|
|
3754
|
+
if (ae) {
|
|
3755
|
+
Le(!0);
|
|
3756
3756
|
try {
|
|
3757
|
-
await
|
|
3757
|
+
await ae();
|
|
3758
3758
|
} finally {
|
|
3759
|
-
|
|
3759
|
+
Le(!1);
|
|
3760
3760
|
}
|
|
3761
|
-
} else
|
|
3761
|
+
} else Pe();
|
|
3762
3762
|
},
|
|
3763
3763
|
"aria-label": "Neuladen",
|
|
3764
|
-
children: /* @__PURE__ */ p(
|
|
3764
|
+
children: /* @__PURE__ */ p(De, {})
|
|
3765
3765
|
}),
|
|
3766
|
-
(
|
|
3767
|
-
let e =
|
|
3766
|
+
(h.some((e) => e.update) || b) && (() => {
|
|
3767
|
+
let e = h.find((e) => e.update) && (!I || K.length > 0 && I(K[0])), t = h.find((e) => e.delete) && (!L || K.length > 0 && L(K[0])), n = (C ?? []).length > 0, r = e || t || n;
|
|
3768
3768
|
return /* @__PURE__ */ p(v, {
|
|
3769
|
-
...
|
|
3769
|
+
...ce ? { visibleFrom: "sm" } : {},
|
|
3770
3770
|
children: /* @__PURE__ */ m(k, {
|
|
3771
3771
|
shadow: "md",
|
|
3772
3772
|
children: [/* @__PURE__ */ p(k.Target, { children: /* @__PURE__ */ p(y, {
|
|
3773
3773
|
variant: "outline",
|
|
3774
|
-
rightSection: /* @__PURE__ */ p(
|
|
3775
|
-
disabled: !
|
|
3774
|
+
rightSection: /* @__PURE__ */ p(xe, { size: 14 }),
|
|
3775
|
+
disabled: !K.length || !r,
|
|
3776
3776
|
children: "Aktionen"
|
|
3777
3777
|
}) }), /* @__PURE__ */ m(k.Dropdown, { children: [
|
|
3778
3778
|
e && /* @__PURE__ */ p(k.Item, {
|
|
3779
|
-
leftSection: /* @__PURE__ */ p(
|
|
3780
|
-
onClick: () =>
|
|
3781
|
-
disabled:
|
|
3779
|
+
leftSection: /* @__PURE__ */ p(Ee, { size: 14 }),
|
|
3780
|
+
onClick: () => J(!0),
|
|
3781
|
+
disabled: K.length !== 1,
|
|
3782
3782
|
children: "Bearbeiten"
|
|
3783
3783
|
}),
|
|
3784
|
-
(
|
|
3784
|
+
(C ?? []).map((e, t) => /* @__PURE__ */ i(k.Item, {
|
|
3785
3785
|
...e.icon && { leftSection: e.icon },
|
|
3786
3786
|
key: `custom_action_${t}`,
|
|
3787
|
-
onClick: () => e.onClick(
|
|
3788
|
-
disabled: e.disabled?.(
|
|
3787
|
+
onClick: () => e.onClick(K),
|
|
3788
|
+
disabled: e.disabled?.(K) ?? !1
|
|
3789
3789
|
}, e.label)),
|
|
3790
3790
|
t && /* @__PURE__ */ p(k.Item, {
|
|
3791
|
-
leftSection: /* @__PURE__ */ p(
|
|
3792
|
-
onClick: () =>
|
|
3791
|
+
leftSection: /* @__PURE__ */ p(Ae, { size: 14 }),
|
|
3792
|
+
onClick: () => tt(!0),
|
|
3793
3793
|
color: "red",
|
|
3794
3794
|
children: "Löschen"
|
|
3795
3795
|
})
|
|
@@ -3797,156 +3797,160 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3797
3797
|
})
|
|
3798
3798
|
});
|
|
3799
3799
|
})(),
|
|
3800
|
-
|
|
3800
|
+
h.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3801
3801
|
onClick: () => Qe(!0),
|
|
3802
|
-
disabled:
|
|
3803
|
-
children:
|
|
3802
|
+
disabled: je,
|
|
3803
|
+
children: j ?? "Erstellen"
|
|
3804
3804
|
}),
|
|
3805
3805
|
c
|
|
3806
3806
|
]
|
|
3807
3807
|
})]
|
|
3808
3808
|
}),
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3809
|
+
l,
|
|
3810
|
+
P && P.length > 0 && /* @__PURE__ */ p(ue, {
|
|
3811
|
+
value: he,
|
|
3812
|
+
onChange: ge,
|
|
3812
3813
|
mt: "md",
|
|
3813
|
-
children: /* @__PURE__ */ p(
|
|
3814
|
+
children: /* @__PURE__ */ p(ue.List, { children: P.map((e) => /* @__PURE__ */ p(ue.Tab, {
|
|
3814
3815
|
value: e.value,
|
|
3815
3816
|
leftSection: e.icon,
|
|
3816
3817
|
children: e.label
|
|
3817
3818
|
}, e.value)) })
|
|
3818
3819
|
}),
|
|
3819
|
-
|
|
3820
|
+
Me && /* @__PURE__ */ p(_, {
|
|
3820
3821
|
mt: "md",
|
|
3821
3822
|
variant: "light",
|
|
3822
3823
|
color: "red",
|
|
3823
3824
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3824
|
-
icon: /* @__PURE__ */ p(
|
|
3825
|
+
icon: /* @__PURE__ */ p(Te, {}),
|
|
3825
3826
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3826
3827
|
}),
|
|
3827
|
-
(
|
|
3828
|
+
(je || Ne) && /* @__PURE__ */ m(ie, {
|
|
3828
3829
|
my: "md",
|
|
3829
|
-
children: [/* @__PURE__ */ p(
|
|
3830
|
+
children: [/* @__PURE__ */ p(re, { height: 40 }), [
|
|
3830
3831
|
,
|
|
3831
3832
|
,
|
|
3832
3833
|
,
|
|
3833
3834
|
,
|
|
3834
3835
|
,
|
|
3835
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3836
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, `skeleton-${t}`))]
|
|
3836
3837
|
}),
|
|
3837
|
-
!
|
|
3838
|
-
...
|
|
3838
|
+
!je && !Ne && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3839
|
+
...ce ? { visibleFrom: "sm" } : {},
|
|
3839
3840
|
children: /* @__PURE__ */ p(Ir, {
|
|
3840
3841
|
my: "md",
|
|
3841
|
-
|
|
3842
|
+
withTableBorder: !0,
|
|
3843
|
+
borderRadius: "md",
|
|
3842
3844
|
highlightOnHover: !0,
|
|
3845
|
+
verticalSpacing: "sm",
|
|
3846
|
+
horizontalSpacing: "md",
|
|
3843
3847
|
minHeight: 150,
|
|
3844
|
-
fetching:
|
|
3845
|
-
records:
|
|
3846
|
-
sortStatus:
|
|
3847
|
-
onSortStatusChange:
|
|
3848
|
-
...
|
|
3849
|
-
selectedRecords:
|
|
3850
|
-
onSelectedRecordsChange:
|
|
3848
|
+
fetching: Me,
|
|
3849
|
+
records: We,
|
|
3850
|
+
sortStatus: V,
|
|
3851
|
+
onSortStatusChange: Ve,
|
|
3852
|
+
...b && {
|
|
3853
|
+
selectedRecords: K,
|
|
3854
|
+
onSelectedRecordsChange: q
|
|
3851
3855
|
},
|
|
3852
|
-
...
|
|
3853
|
-
totalRecords:
|
|
3854
|
-
recordsPerPage:
|
|
3855
|
-
onPageChange:
|
|
3856
|
-
page:
|
|
3856
|
+
...x && We.length && {
|
|
3857
|
+
totalRecords: H.length,
|
|
3858
|
+
recordsPerPage: He,
|
|
3859
|
+
onPageChange: W,
|
|
3860
|
+
page: U,
|
|
3857
3861
|
recordsPerPageOptions: ti,
|
|
3858
|
-
onRecordsPerPageChange:
|
|
3862
|
+
onRecordsPerPageChange: Ue,
|
|
3859
3863
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3860
3864
|
},
|
|
3861
|
-
...
|
|
3862
|
-
allowMultiple:
|
|
3863
|
-
trigger:
|
|
3864
|
-
content: ({ record: e }) =>
|
|
3865
|
+
...R && { rowExpansion: {
|
|
3866
|
+
allowMultiple: R.allowMultiple ?? !1,
|
|
3867
|
+
trigger: se ? "never" : "click",
|
|
3868
|
+
content: ({ record: e }) => R.content(e, !1),
|
|
3865
3869
|
expanded: {
|
|
3866
|
-
recordIds:
|
|
3870
|
+
recordIds: G,
|
|
3867
3871
|
onRecordIdsChange: qe
|
|
3868
3872
|
},
|
|
3869
|
-
...
|
|
3873
|
+
...R.expandable && { expandable: ({ record: e }) => R.expandable(e) }
|
|
3870
3874
|
} },
|
|
3871
3875
|
columns: Xe.map((e) => e.column),
|
|
3872
3876
|
noRecordsText: "Keine Einträge gefunden",
|
|
3873
|
-
onRowClick:
|
|
3874
|
-
...
|
|
3877
|
+
onRowClick: se,
|
|
3878
|
+
...se && { style: { cursor: "pointer" } }
|
|
3875
3879
|
})
|
|
3876
|
-
}),
|
|
3880
|
+
}), ce && /* @__PURE__ */ p(v, {
|
|
3877
3881
|
hiddenFrom: "sm",
|
|
3878
3882
|
children: /* @__PURE__ */ p(ei, {
|
|
3879
|
-
records:
|
|
3883
|
+
records: We,
|
|
3880
3884
|
fields: Xe,
|
|
3881
|
-
onRowClick:
|
|
3885
|
+
onRowClick: se,
|
|
3882
3886
|
sort: {
|
|
3883
|
-
field: String(
|
|
3884
|
-
direction:
|
|
3887
|
+
field: String(V.columnAccessor),
|
|
3888
|
+
direction: V.direction,
|
|
3885
3889
|
onSortChange: (e, t) => {
|
|
3886
|
-
|
|
3890
|
+
Ve({
|
|
3887
3891
|
columnAccessor: e,
|
|
3888
3892
|
direction: t
|
|
3889
3893
|
});
|
|
3890
3894
|
}
|
|
3891
3895
|
},
|
|
3892
|
-
...
|
|
3893
|
-
totalRecords:
|
|
3894
|
-
recordsPerPage:
|
|
3895
|
-
page:
|
|
3896
|
-
onPageChange:
|
|
3896
|
+
...x && We.length && { pagination: {
|
|
3897
|
+
totalRecords: H.length,
|
|
3898
|
+
recordsPerPage: He,
|
|
3899
|
+
page: U,
|
|
3900
|
+
onPageChange: W,
|
|
3897
3901
|
recordsPerPageOptions: ti,
|
|
3898
3902
|
onRecordsPerPageChange: (e) => {
|
|
3899
|
-
|
|
3903
|
+
Ue(e), W(1);
|
|
3900
3904
|
}
|
|
3901
3905
|
} },
|
|
3902
|
-
...
|
|
3903
|
-
content:
|
|
3906
|
+
...R && { rowExpansion: {
|
|
3907
|
+
content: R.content,
|
|
3904
3908
|
expanded: {
|
|
3905
|
-
recordIds:
|
|
3909
|
+
recordIds: G,
|
|
3906
3910
|
onRecordIdsChange: qe
|
|
3907
3911
|
},
|
|
3908
|
-
...
|
|
3912
|
+
...R.expandable && { expandable: R.expandable }
|
|
3909
3913
|
} },
|
|
3910
|
-
...
|
|
3911
|
-
actions:
|
|
3912
|
-
canUpdate:
|
|
3913
|
-
canDelete:
|
|
3914
|
+
...at.length > 0 && {
|
|
3915
|
+
actions: at,
|
|
3916
|
+
canUpdate: I,
|
|
3917
|
+
canDelete: L
|
|
3914
3918
|
}
|
|
3915
3919
|
})
|
|
3916
3920
|
})] }),
|
|
3917
3921
|
/* @__PURE__ */ p(N, {
|
|
3918
3922
|
opened: $e,
|
|
3919
3923
|
onClose: () => {
|
|
3920
|
-
|
|
3924
|
+
J(!1), q([]);
|
|
3921
3925
|
},
|
|
3922
3926
|
title: e ?? "Bearbeiten",
|
|
3923
|
-
children:
|
|
3924
|
-
fields:
|
|
3927
|
+
children: K.length > 0 && /* @__PURE__ */ p(Lr, {
|
|
3928
|
+
fields: h.filter((e) => e.update),
|
|
3925
3929
|
queryKey: n,
|
|
3926
3930
|
connectedQueryKeys: r,
|
|
3927
|
-
apiPath:
|
|
3928
|
-
id:
|
|
3931
|
+
apiPath: be,
|
|
3932
|
+
id: K[0].id,
|
|
3929
3933
|
onClose: () => {
|
|
3930
|
-
|
|
3934
|
+
J(!1), q([]);
|
|
3931
3935
|
},
|
|
3932
|
-
steps:
|
|
3936
|
+
steps: D
|
|
3933
3937
|
})
|
|
3934
3938
|
}),
|
|
3935
|
-
|
|
3936
|
-
opened:
|
|
3939
|
+
K.length > 0 && /* @__PURE__ */ p(N, {
|
|
3940
|
+
opened: et,
|
|
3937
3941
|
onClose: () => {
|
|
3938
|
-
|
|
3942
|
+
tt(!1), q([]);
|
|
3939
3943
|
},
|
|
3940
3944
|
title: e ?? "Löschen",
|
|
3941
3945
|
children: /* @__PURE__ */ p(Rr, {
|
|
3942
3946
|
onClose: () => {
|
|
3943
|
-
|
|
3947
|
+
tt(!1), q([]);
|
|
3944
3948
|
},
|
|
3945
3949
|
queryKey: n,
|
|
3946
3950
|
connectedQueryKeys: r,
|
|
3947
|
-
apiPath:
|
|
3948
|
-
selectedRecords:
|
|
3949
|
-
confirmMessage:
|
|
3951
|
+
apiPath: be,
|
|
3952
|
+
selectedRecords: K,
|
|
3953
|
+
confirmMessage: le
|
|
3950
3954
|
})
|
|
3951
3955
|
}),
|
|
3952
3956
|
/* @__PURE__ */ p(N, {
|
|
@@ -3958,12 +3962,12 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3958
3962
|
children: /* @__PURE__ */ p(an, {
|
|
3959
3963
|
queryKey: n,
|
|
3960
3964
|
connectedQueryKeys: r,
|
|
3961
|
-
apiPath:
|
|
3965
|
+
apiPath: be,
|
|
3962
3966
|
onClose: () => {
|
|
3963
3967
|
Qe(!1);
|
|
3964
3968
|
},
|
|
3965
|
-
fields:
|
|
3966
|
-
steps:
|
|
3969
|
+
fields: h.filter((e) => e.create),
|
|
3970
|
+
steps: D
|
|
3967
3971
|
})
|
|
3968
3972
|
})
|
|
3969
3973
|
] });
|
|
@@ -3971,7 +3975,7 @@ function ni({ title: e, titleHint: t, queryKey: n, connectedQueryKeys: r, apiPat
|
|
|
3971
3975
|
//#endregion
|
|
3972
3976
|
//#region src/DataTable/SubTable.tsx
|
|
3973
3977
|
function ri({ mobile: e, columns: t, ...n }) {
|
|
3974
|
-
return e ? /* @__PURE__ */ p(
|
|
3978
|
+
return e ? /* @__PURE__ */ p(ie, {
|
|
3975
3979
|
gap: "sm",
|
|
3976
3980
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
3977
3981
|
children: (n.records ?? []).map((e, r) => {
|