@espresso-lab/mantine-data-table 2.1.14 → 2.2.1
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/README.md +161 -4
- package/dist/DataTable/CreateModal.d.ts +1 -1
- package/dist/DataTable/DataTable.d.ts +88 -3
- package/dist/DataTable/EntityForm.d.ts +13 -0
- package/dist/DataTable/FieldCard.d.ts +11 -0
- package/dist/DataTable/MobileCardList.d.ts +2 -1
- package/dist/DataTable/SubTable.d.ts +9 -0
- package/dist/DataTable/UpdateModal.d.ts +1 -1
- package/dist/Hooks/useApi.d.ts +10 -0
- package/dist/Hooks/usePersistentState.d.ts +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.es.js +982 -913
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/utils/filter.d.ts +19 -0
- package/package.json +2 -3
- package/dist/DataTable/DataTableInner.d.ts +0 -104
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import t, { Fragment as n, createContext as r, createElement as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
-
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as P, Popover as F, PopoverDropdown as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { IconCaretDownFilled as ye,
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as P, Popover as F, PopoverDropdown as ee, PopoverTarget as I, ScrollArea as L, Select as R, Skeleton as te, Stack as z, Stepper as ne, Table as re, TableTd as ie, TableTfoot as ae, TableTh as oe, TableThead as se, TableTr as ce, Tabs as le, Text as B, TextInput as ue, Textarea as de, Title as fe, createSafeContext as pe, parseThemeColor as me, rem as V, useDirection as he, useMantineTheme as ge } from "@mantine/core";
|
|
5
|
+
import { DateInput as _e } from "@mantine/dates";
|
|
6
|
+
import { useForm as ve } from "@mantine/form";
|
|
7
|
+
import { IconCaretDownFilled as ye, IconChevronRight as be, IconDotsVertical as xe, IconFilter as Se, IconInfoCircle as Ce, IconPencil as we, IconRefresh as Te, IconSortAscending as Ee, IconSortDescending as De, IconTrash as Oe } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as ke, useDisclosure as Ae, useLocalStorage as je, useMediaQuery as H, useMergedRef as Me, useTimeout as Ne } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var U = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var Ne = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
}, Pe = new class extends
|
|
24
|
+
}, Pe = new class extends U {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var Ne = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), Fe = {
|
|
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
|
+
}, Ie = new class {
|
|
67
|
+
#e = Fe;
|
|
68
68
|
#t = !1;
|
|
69
69
|
setTimeoutProvider(e) {
|
|
70
70
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
|
|
@@ -85,87 +85,87 @@ var Ne = class {
|
|
|
85
85
|
this.#e.clearInterval(e);
|
|
86
86
|
}
|
|
87
87
|
}();
|
|
88
|
-
function
|
|
88
|
+
function Le(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 Re = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
+
function ze() {}
|
|
95
|
+
function Be(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Ve(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function He(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 G(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => qe(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var Ue = Object.prototype.hasOwnProperty;
|
|
111
|
+
function We(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 = Ke(e) && Ke(t);
|
|
115
|
+
if (!r && !(qe(e) && qe(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 : Ue.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 = We(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 Ge(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 Ke(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function qe(e) {
|
|
141
|
+
if (!Je(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 !(!Je(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Je(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Ye(e, t, n) {
|
|
151
151
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
152
|
if (n.structuralSharing !== !1) {
|
|
153
153
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
154
|
+
return We(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 We(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Xe(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 Ze = /* @__PURE__ */ (() => {
|
|
168
|
+
let e = () => Re;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
171
171
|
return e();
|
|
@@ -177,7 +177,7 @@ var Ye = /* @__PURE__ */ (() => {
|
|
|
177
177
|
})();
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
-
function
|
|
180
|
+
function Qe() {
|
|
181
181
|
let e, t, n = new Promise((n, r) => {
|
|
182
182
|
e = n, t = r;
|
|
183
183
|
});
|
|
@@ -199,13 +199,13 @@ function Xe() {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var $e = Le;
|
|
203
|
+
function et() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
206
206
|
}, r = (e) => {
|
|
207
207
|
e();
|
|
208
|
-
}, i =
|
|
208
|
+
}, i = $e, a = (r) => {
|
|
209
209
|
t ? e.push(r) : i(() => {
|
|
210
210
|
n(r);
|
|
211
211
|
});
|
|
@@ -247,7 +247,7 @@ function Qe() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var tt = et(), nt = new class extends U {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -281,16 +281,16 @@ var $e = Qe(), et = new class extends Ne {
|
|
|
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 rt(e) {
|
|
285
|
+
return (e ?? "online") === "online" ? nt.isOnline() : !0;
|
|
286
286
|
}
|
|
287
287
|
//#endregion
|
|
288
288
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
289
|
+
function it(e, t) {
|
|
290
290
|
return {
|
|
291
291
|
fetchFailureCount: 0,
|
|
292
292
|
fetchFailureReason: null,
|
|
293
|
-
fetchStatus:
|
|
293
|
+
fetchStatus: rt(t.networkMode) ? "fetching" : "paused",
|
|
294
294
|
...e === void 0 && {
|
|
295
295
|
error: null,
|
|
296
296
|
status: "pending"
|
|
@@ -299,9 +299,9 @@ function nt(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
302
|
+
var at = class extends U {
|
|
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 = Qe(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
306
306
|
#e;
|
|
307
307
|
#t = void 0;
|
|
@@ -322,36 +322,36 @@ var rt = class extends Ne {
|
|
|
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), st(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 ct(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
332
|
}
|
|
333
333
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
334
|
+
return ct(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 && !Ge(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 && lt(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || W(this.options.enabled, this.#t) !== W(t.enabled, this.#t) || He(this.options.staleTime, this.#t) !== He(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 dt(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 rt = class extends Ne {
|
|
|
381
381
|
#h(e) {
|
|
382
382
|
this.#S();
|
|
383
383
|
let t = this.#t.fetch(this.options, e);
|
|
384
|
-
return e?.throwOnError || (t = t.catch(
|
|
384
|
+
return e?.throwOnError || (t = t.catch(ze)), t;
|
|
385
385
|
}
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
|
-
let e =
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
391
|
-
this.#d =
|
|
388
|
+
let e = He(this.options.staleTime, this.#t);
|
|
389
|
+
if (Ze.isServer() || this.#r.isStale || !Be(e)) return;
|
|
390
|
+
let t = Ve(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
+
this.#d = Ie.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,7 +396,7 @@ var rt = class extends Ne {
|
|
|
396
396
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
397
397
|
}
|
|
398
398
|
#v(e) {
|
|
399
|
-
this.#x(), this.#p = e, !(
|
|
399
|
+
this.#x(), this.#p = e, !(Ze.isServer() || W(this.options.enabled, this.#t) === !1 || !Be(this.#p) || this.#p === 0) && (this.#f = Ie.setInterval(() => {
|
|
400
400
|
(this.options.refetchIntervalInBackground || Pe.isFocused()) && this.#h();
|
|
401
401
|
}, this.#p));
|
|
402
402
|
}
|
|
@@ -404,18 +404,18 @@ var rt = class extends Ne {
|
|
|
404
404
|
this.#g(), this.#v(this.#_());
|
|
405
405
|
}
|
|
406
406
|
#b() {
|
|
407
|
-
this.#d !== void 0 && (
|
|
407
|
+
this.#d !== void 0 && (Ie.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (Ie.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 && st(e, t), o = i && lt(e, n, t, r);
|
|
416
416
|
(a || o) && (l = {
|
|
417
417
|
...l,
|
|
418
|
-
...
|
|
418
|
+
...it(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 rt = class extends Ne {
|
|
|
423
423
|
let h = !1;
|
|
424
424
|
if (t.placeholderData !== void 0 && d === void 0 && m === "pending") {
|
|
425
425
|
let e;
|
|
426
|
-
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d =
|
|
426
|
+
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (e = i.data, h = !0) : e = typeof t.placeholderData == "function" ? t.placeholderData(this.#u?.state.data, this.#u) : t.placeholderData, e !== void 0 && (m = "success", d = Ye(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 = Ye(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 rt = class extends Ne {
|
|
|
455
455
|
isPaused: l.fetchStatus === "paused",
|
|
456
456
|
isPlaceholderData: u,
|
|
457
457
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
458
|
+
isStale: ut(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
|
-
i(this.#o = x.promise =
|
|
467
|
+
i(this.#o = x.promise = Qe());
|
|
468
468
|
}, o = this.#o;
|
|
469
469
|
switch (o.status) {
|
|
470
470
|
case "pending":
|
|
@@ -482,7 +482,7 @@ var rt = class extends Ne {
|
|
|
482
482
|
}
|
|
483
483
|
updateResult() {
|
|
484
484
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
485
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
485
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !Ge(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 rt = class extends Ne {
|
|
|
503
503
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
504
504
|
}
|
|
505
505
|
#C(e) {
|
|
506
|
-
|
|
506
|
+
tt.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 rt = class extends Ne {
|
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
|
-
function
|
|
517
|
-
return
|
|
516
|
+
function ot(e, t) {
|
|
517
|
+
return W(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && W(t.retryOnMount, e) === !1);
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function st(e, t) {
|
|
520
|
+
return ot(e, t) || e.state.data !== void 0 && ct(e, t, t.refetchOnMount);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
if (
|
|
522
|
+
function ct(e, t, n) {
|
|
523
|
+
if (W(t.enabled, e) !== !1 && He(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 && ut(e, t);
|
|
526
526
|
}
|
|
527
527
|
return !1;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
return (e !== t ||
|
|
529
|
+
function lt(e, t, n, r) {
|
|
530
|
+
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ut(e, n);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
return
|
|
532
|
+
function ut(e, t) {
|
|
533
|
+
return W(t.enabled, e) !== !1 && e.isStaleByTime(He(t.staleTime, e));
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
return !
|
|
535
|
+
function dt(e, t) {
|
|
536
|
+
return !Ge(e.getCurrentResult(), t);
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
540
|
-
function
|
|
540
|
+
function K() {
|
|
541
541
|
return {
|
|
542
542
|
context: void 0,
|
|
543
543
|
data: void 0,
|
|
@@ -552,7 +552,7 @@ function ut() {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var
|
|
555
|
+
var ft = class extends U {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var q = class extends Ne {
|
|
|
565
565
|
}
|
|
566
566
|
setOptions(e) {
|
|
567
567
|
let t = this.options;
|
|
568
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
568
|
+
this.options = this.#e.defaultMutationOptions(e), Ge(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 && G(t.mutationKey) !== G(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 q = class extends Ne {
|
|
|
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 ?? K();
|
|
591
591
|
this.#t = {
|
|
592
592
|
...e,
|
|
593
593
|
isPending: e.status === "pending",
|
|
@@ -599,7 +599,7 @@ var q = class extends Ne {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
#a(e) {
|
|
602
|
-
|
|
602
|
+
tt.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 q = class extends Ne {
|
|
|
635
635
|
});
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
},
|
|
639
|
-
let n = e.useContext(
|
|
638
|
+
}, q = e.createContext(void 0), pt = (t) => {
|
|
639
|
+
let n = e.useContext(q);
|
|
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
|
+
}, mt = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
644
644
|
t.unmount();
|
|
645
|
-
}), [t]), /* @__PURE__ */ p(
|
|
645
|
+
}), [t]), /* @__PURE__ */ p(q.Provider, {
|
|
646
646
|
value: t,
|
|
647
647
|
children: n
|
|
648
|
-
})),
|
|
649
|
-
|
|
648
|
+
})), ht = e.createContext(!1), gt = () => e.useContext(ht);
|
|
649
|
+
ht.Provider;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
652
|
-
function
|
|
652
|
+
function _t() {
|
|
653
653
|
let e = !1;
|
|
654
654
|
return {
|
|
655
655
|
clearReset: () => {
|
|
@@ -661,65 +661,65 @@ function ht() {
|
|
|
661
661
|
isReset: () => e
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
|
-
var
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
664
|
+
var vt = e.createContext(_t()), yt = () => e.useContext(vt), bt = (e, t, n) => {
|
|
665
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? Xe(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
666
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
|
-
},
|
|
667
|
+
}, xt = (t) => {
|
|
668
668
|
e.useEffect(() => {
|
|
669
669
|
t.clearReset();
|
|
670
670
|
}, [t]);
|
|
671
|
-
},
|
|
671
|
+
}, St = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Xe(n, [e.error, r])), Ct = (e) => {
|
|
672
672
|
if (e.suspense) {
|
|
673
673
|
let t = 1e3, n = (e) => e === "static" ? e : Math.max(e ?? t, t), r = e.staleTime;
|
|
674
674
|
e.staleTime = typeof r == "function" ? (...e) => n(r(...e)) : n(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, t));
|
|
675
675
|
}
|
|
676
|
-
},
|
|
676
|
+
}, wt = (e, t) => e.isLoading && e.isFetching && !t, Tt = (e, t) => e?.suspense && t.isPending, Et = (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 Dt(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 = gt(), a = yt(), o = pt(r), s = o.defaultQueryOptions(t);
|
|
684
684
|
o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);
|
|
685
685
|
let c = o.getQueryCache().get(s.queryHash);
|
|
686
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
687
|
let l = t.subscribed !== !1;
|
|
688
|
-
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0,
|
|
688
|
+
s._optimisticResults = i ? "isRestoring" : l ? "optimistic" : void 0, Ct(s), bt(s, a, c), xt(a);
|
|
689
689
|
let u = !o.getQueryCache().get(s.queryHash), [d] = e.useState(() => new n(o, s)), f = d.getOptimisticResult(s), p = !i && l;
|
|
690
690
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
691
|
-
let t = p ? d.subscribe(
|
|
691
|
+
let t = p ? d.subscribe(tt.batchCalls(e)) : ze;
|
|
692
692
|
return d.updateResult(), t;
|
|
693
693
|
}, [d, p]), () => d.getCurrentResult(), () => d.getCurrentResult()), e.useEffect(() => {
|
|
694
694
|
d.setOptions(s);
|
|
695
|
-
}, [s, d]),
|
|
696
|
-
if (
|
|
695
|
+
}, [s, d]), Tt(s, f)) throw Et(s, d, a);
|
|
696
|
+
if (St({
|
|
697
697
|
result: f,
|
|
698
698
|
errorResetBoundary: a,
|
|
699
699
|
throwOnError: s.throwOnError,
|
|
700
700
|
query: c,
|
|
701
701
|
suspense: s.suspense
|
|
702
702
|
})) throw f.error;
|
|
703
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !
|
|
703
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, f), s.experimental_prefetchInRender && !Ze.isServer() && wt(f, i) && (u ? Et(s, d, a) : c?.promise)?.catch(ze).finally(() => {
|
|
704
704
|
d.updateResult();
|
|
705
705
|
}), s.notifyOnChangeProps ? f : d.trackResult(f);
|
|
706
706
|
}
|
|
707
707
|
//#endregion
|
|
708
708
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
709
|
-
function
|
|
710
|
-
return
|
|
709
|
+
function Ot(e, t) {
|
|
710
|
+
return Dt(e, at, t);
|
|
711
711
|
}
|
|
712
712
|
//#endregion
|
|
713
713
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
714
|
-
function
|
|
715
|
-
let r =
|
|
714
|
+
function kt(t, n) {
|
|
715
|
+
let r = pt(n), [i] = e.useState(() => new ft(r, t));
|
|
716
716
|
e.useEffect(() => {
|
|
717
717
|
i.setOptions(t);
|
|
718
718
|
}, [i, t]);
|
|
719
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
720
|
-
i.mutate(e, t).catch(
|
|
719
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(tt.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
720
|
+
i.mutate(e, t).catch(ze);
|
|
721
721
|
}, [i]);
|
|
722
|
-
if (a.error &&
|
|
722
|
+
if (a.error && Xe(i.options.throwOnError, [a.error])) throw a.error;
|
|
723
723
|
return {
|
|
724
724
|
...a,
|
|
725
725
|
mutate: o,
|
|
@@ -728,15 +728,15 @@ function Dt(t, n) {
|
|
|
728
728
|
}
|
|
729
729
|
//#endregion
|
|
730
730
|
//#region src/Context/DataTableContext.tsx
|
|
731
|
-
var
|
|
732
|
-
function
|
|
733
|
-
return /* @__PURE__ */ p(
|
|
731
|
+
var At = r(void 0), jt = async () => ({ "Content-Type": "application/json" });
|
|
732
|
+
function Mt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = jt }) {
|
|
733
|
+
return /* @__PURE__ */ p(At.Provider, {
|
|
734
734
|
value: {
|
|
735
735
|
baseUrl: t,
|
|
736
736
|
queryClient: n,
|
|
737
737
|
getHeaders: r
|
|
738
738
|
},
|
|
739
|
-
children: /* @__PURE__ */ p(
|
|
739
|
+
children: /* @__PURE__ */ p(mt, {
|
|
740
740
|
client: n,
|
|
741
741
|
children: e
|
|
742
742
|
})
|
|
@@ -744,14 +744,24 @@ function At({ children: e, baseUrl: t, queryClient: n, getHeaders: r = kt }) {
|
|
|
744
744
|
}
|
|
745
745
|
//#endregion
|
|
746
746
|
//#region src/Hooks/useDataTable.ts
|
|
747
|
-
function
|
|
748
|
-
let e = o(
|
|
747
|
+
function J() {
|
|
748
|
+
let e = o(At);
|
|
749
749
|
if (!e) throw Error("useDataTable must be used within a DataTableProvider");
|
|
750
750
|
return e;
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/Hooks/useApi.ts
|
|
754
|
-
|
|
754
|
+
var Nt = class extends Error {
|
|
755
|
+
status;
|
|
756
|
+
violations;
|
|
757
|
+
constructor(e, t, n) {
|
|
758
|
+
super(e), this.name = "ApiError", this.status = t, this.violations = n;
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
function Pt(e) {
|
|
762
|
+
return e instanceof Nt ? e.violations : void 0;
|
|
763
|
+
}
|
|
764
|
+
function Ft(e) {
|
|
755
765
|
if (typeof e == "string") try {
|
|
756
766
|
let t = JSON.parse(e);
|
|
757
767
|
return {
|
|
@@ -764,236 +774,297 @@ function jt(e) {
|
|
|
764
774
|
}
|
|
765
775
|
return e instanceof Error ? { message: e.message } : { message: "Unbekannter Fehler" };
|
|
766
776
|
}
|
|
767
|
-
async function
|
|
777
|
+
async function It(e, t) {
|
|
768
778
|
let n = await fetch(e, t);
|
|
769
779
|
if (n.status >= 400) {
|
|
770
780
|
let e = await n.text();
|
|
771
|
-
if (!e) throw
|
|
781
|
+
if (!e) throw new Nt(`HTTP ${n.status}: ${n.statusText}`, n.status);
|
|
772
782
|
let t = null;
|
|
773
783
|
try {
|
|
774
784
|
t = JSON.parse(e);
|
|
775
785
|
} catch {
|
|
776
|
-
throw
|
|
786
|
+
throw new Nt(e, n.status);
|
|
777
787
|
}
|
|
778
|
-
|
|
788
|
+
let r = Array.isArray(t?.violations) ? t.violations.filter((e) => e?.field && e?.message).map((e) => ({
|
|
789
|
+
field: String(e.field),
|
|
790
|
+
message: String(e.message)
|
|
791
|
+
})) : void 0;
|
|
792
|
+
throw new Nt(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
|
|
779
793
|
}
|
|
780
794
|
return n;
|
|
781
795
|
}
|
|
782
|
-
|
|
783
|
-
|
|
796
|
+
var Y = (e) => e.map((e) => e.toString());
|
|
797
|
+
async function Lt(e, t) {
|
|
798
|
+
return (await It(e, {
|
|
784
799
|
method: "GET",
|
|
785
800
|
headers: await t()
|
|
786
801
|
})).json();
|
|
787
802
|
}
|
|
788
|
-
async function
|
|
789
|
-
return (await
|
|
803
|
+
async function Rt(e, t, n) {
|
|
804
|
+
return (await It(`${e}/${t}`, {
|
|
790
805
|
method: "GET",
|
|
791
806
|
headers: await n()
|
|
792
807
|
})).json();
|
|
793
808
|
}
|
|
794
|
-
async function
|
|
795
|
-
await
|
|
809
|
+
async function zt(e, t, n) {
|
|
810
|
+
await It(`${e}/${t}`, {
|
|
796
811
|
method: "DELETE",
|
|
797
812
|
headers: await n()
|
|
798
813
|
});
|
|
799
814
|
}
|
|
800
|
-
async function
|
|
801
|
-
let r = await
|
|
815
|
+
async function Bt(e, t, n) {
|
|
816
|
+
let r = await It(e, {
|
|
802
817
|
method: "POST",
|
|
803
818
|
headers: await n(),
|
|
804
819
|
body: JSON.stringify(t)
|
|
805
820
|
});
|
|
806
821
|
return r.status === 204 ? t : r.json();
|
|
807
822
|
}
|
|
808
|
-
async function
|
|
809
|
-
let i = await
|
|
823
|
+
async function Vt(e, t, n, r) {
|
|
824
|
+
let i = await It(t, {
|
|
810
825
|
method: e,
|
|
811
826
|
headers: await n(),
|
|
812
827
|
body: r ? JSON.stringify(r) : void 0
|
|
813
828
|
});
|
|
814
829
|
if (i.status !== 204) return i.json();
|
|
815
830
|
}
|
|
816
|
-
async function
|
|
817
|
-
let r = await
|
|
831
|
+
async function Ht(e, t, n) {
|
|
832
|
+
let r = await It(`${e}/${t.id}`, {
|
|
818
833
|
method: "PUT",
|
|
819
834
|
headers: await n(),
|
|
820
835
|
body: JSON.stringify(t)
|
|
821
836
|
});
|
|
822
837
|
return r.status === 204 ? t : r.json();
|
|
823
838
|
}
|
|
824
|
-
function
|
|
825
|
-
let { baseUrl: r, getHeaders: i } =
|
|
826
|
-
return
|
|
827
|
-
queryKey: [...t
|
|
828
|
-
queryFn: () =>
|
|
839
|
+
function Ut(e, t, n) {
|
|
840
|
+
let { baseUrl: r, getHeaders: i } = J();
|
|
841
|
+
return Ot({
|
|
842
|
+
queryKey: [...Y(t), String(n?.toString())],
|
|
843
|
+
queryFn: () => Rt(`${r}${e}`, n, i),
|
|
829
844
|
enabled: !!n
|
|
830
845
|
});
|
|
831
846
|
}
|
|
832
|
-
function
|
|
833
|
-
let { baseUrl: r, getHeaders: i } =
|
|
834
|
-
return
|
|
835
|
-
queryKey:
|
|
836
|
-
queryFn: () =>
|
|
847
|
+
function Wt(e, t, n = !0) {
|
|
848
|
+
let { baseUrl: r, getHeaders: i } = J();
|
|
849
|
+
return Ot({
|
|
850
|
+
queryKey: Y(t),
|
|
851
|
+
queryFn: () => Lt(`${r}${e}`, i),
|
|
837
852
|
enabled: n
|
|
838
853
|
});
|
|
839
854
|
}
|
|
840
|
-
function
|
|
841
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
842
|
-
return
|
|
843
|
-
mutationKey:
|
|
844
|
-
mutationFn: (t) =>
|
|
855
|
+
function Gt(e, t) {
|
|
856
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = J();
|
|
857
|
+
return kt({
|
|
858
|
+
mutationKey: Y(t),
|
|
859
|
+
mutationFn: (t) => Bt(`${n}${e}`, t, i),
|
|
845
860
|
onSettled() {
|
|
846
|
-
return r.invalidateQueries({ queryKey:
|
|
861
|
+
return r.invalidateQueries({ queryKey: Y(t) });
|
|
847
862
|
}
|
|
848
863
|
});
|
|
849
864
|
}
|
|
850
|
-
function
|
|
851
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
852
|
-
return
|
|
853
|
-
mutationKey:
|
|
854
|
-
mutationFn: (t) =>
|
|
865
|
+
function Kt(e, t) {
|
|
866
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = J();
|
|
867
|
+
return kt({
|
|
868
|
+
mutationKey: Y(t),
|
|
869
|
+
mutationFn: (t) => Ht(`${n}${e}`, t, i),
|
|
855
870
|
onSettled() {
|
|
856
|
-
return r.invalidateQueries({ queryKey:
|
|
871
|
+
return r.invalidateQueries({ queryKey: Y(t) });
|
|
857
872
|
}
|
|
858
873
|
});
|
|
859
874
|
}
|
|
860
|
-
function
|
|
861
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
862
|
-
return
|
|
863
|
-
mutationKey:
|
|
864
|
-
mutationFn: (t) =>
|
|
875
|
+
function qt(e, t) {
|
|
876
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = J();
|
|
877
|
+
return kt({
|
|
878
|
+
mutationKey: Y(t),
|
|
879
|
+
mutationFn: (t) => zt(`${n}${e}`, t, i),
|
|
865
880
|
onSettled() {
|
|
866
|
-
return r.invalidateQueries({ queryKey:
|
|
881
|
+
return r.invalidateQueries({ queryKey: Y(t) });
|
|
867
882
|
}
|
|
868
883
|
});
|
|
869
884
|
}
|
|
870
885
|
//#endregion
|
|
871
|
-
//#region src/DataTable/
|
|
872
|
-
function
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
886
|
+
//#region src/DataTable/EntityForm.tsx
|
|
887
|
+
function Jt(e, t) {
|
|
888
|
+
return typeof e.required == "function" ? e.required(t) : !!e.required;
|
|
889
|
+
}
|
|
890
|
+
function Yt(e) {
|
|
891
|
+
return e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {});
|
|
892
|
+
}
|
|
893
|
+
function Xt(e) {
|
|
894
|
+
return e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !Jt(t, n) || e ? null : "Pflichtfeld", e), {});
|
|
895
|
+
}
|
|
896
|
+
function Zt(e) {
|
|
897
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === "" ? void 0 : t]));
|
|
898
|
+
}
|
|
899
|
+
function Qt(e, t) {
|
|
900
|
+
let n = { ...e };
|
|
901
|
+
return t.forEach((e) => {
|
|
902
|
+
let t = e.id;
|
|
903
|
+
e.type === "boolean" && n[t] === null ? n[t] = !1 : e.type === "date" && n[t] ? n[t] = new Date(n[t]) : n[t] === null && (n[t] = "");
|
|
904
|
+
}), n;
|
|
905
|
+
}
|
|
906
|
+
var $t = (e) => e.split(".").pop() ?? e;
|
|
907
|
+
function en(e, t) {
|
|
908
|
+
return Object.fromEntries((Pt(e) ?? []).filter((e) => t.has($t(e.field))).map((e) => [$t(e.field), e.message]));
|
|
909
|
+
}
|
|
910
|
+
function tn(e, t) {
|
|
911
|
+
let n = Pt(e);
|
|
912
|
+
if (!n) return e?.message;
|
|
913
|
+
let r = n.filter((e) => !t.has($t(e.field)));
|
|
914
|
+
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
915
|
+
}
|
|
916
|
+
function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
917
|
+
let [u, h] = d(0), [g, v] = d(!1), b = ve({
|
|
878
918
|
mode: "uncontrolled",
|
|
879
|
-
initialValues:
|
|
880
|
-
validate:
|
|
919
|
+
initialValues: Yt(e),
|
|
920
|
+
validate: Xt(e)
|
|
881
921
|
});
|
|
882
|
-
|
|
883
|
-
|
|
922
|
+
s(() => {
|
|
923
|
+
if (r) {
|
|
924
|
+
let t = Qt(r, e);
|
|
925
|
+
b.initialize(t), b.setValues(t);
|
|
926
|
+
}
|
|
927
|
+
}, [r]);
|
|
928
|
+
let S = new Set(e.map((e) => String(e.id))), C = tn(o, S), w = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], E = w.length > 0, D = u === w.length - 1;
|
|
929
|
+
function O(e) {
|
|
930
|
+
let t = b.getValues();
|
|
884
931
|
if (e.conditional && !e.conditional(t)) return null;
|
|
885
|
-
let
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
label: e.column.title,
|
|
889
|
-
placeholder: e.placeholder ?? "",
|
|
890
|
-
...A.getInputProps(e.id),
|
|
891
|
-
type: e.id.includes("email") ? "email" : void 0,
|
|
892
|
-
required: r
|
|
893
|
-
}, A.key(e.id)),
|
|
894
|
-
e.type === "number" && /* @__PURE__ */ p(N, {
|
|
932
|
+
let n = Jt(e, t), r = b.getInputProps(e.id);
|
|
933
|
+
switch (e.type) {
|
|
934
|
+
case "number": return /* @__PURE__ */ p(N, {
|
|
895
935
|
decimalSeparator: ",",
|
|
936
|
+
thousandSeparator: ".",
|
|
896
937
|
label: e.column.title,
|
|
897
938
|
placeholder: e.placeholder ?? "",
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
},
|
|
901
|
-
|
|
902
|
-
label: e.column.title,
|
|
903
|
-
placeholder: e.placeholder ?? "",
|
|
939
|
+
required: n,
|
|
940
|
+
...r
|
|
941
|
+
}, b.key(e.id));
|
|
942
|
+
case "date": return /* @__PURE__ */ p(_e, {
|
|
904
943
|
valueFormat: "DD.MM.YYYY",
|
|
905
944
|
clearable: !0,
|
|
906
|
-
...A.getInputProps(e.id),
|
|
907
|
-
required: r
|
|
908
|
-
}, A.key(e.id)),
|
|
909
|
-
e.type === "boolean" && /* @__PURE__ */ p(x, {
|
|
910
|
-
mt: "md",
|
|
911
|
-
label: e.column.title,
|
|
912
|
-
...A.getInputProps(e.id, { type: "checkbox" }),
|
|
913
|
-
required: r
|
|
914
|
-
}, A.key(e.id)),
|
|
915
|
-
e.type === "textarea" && /* @__PURE__ */ p(ue, {
|
|
916
945
|
label: e.column.title,
|
|
917
946
|
placeholder: e.placeholder ?? "",
|
|
918
|
-
|
|
947
|
+
required: n,
|
|
948
|
+
...r
|
|
949
|
+
}, b.key(e.id));
|
|
950
|
+
case "boolean": return /* @__PURE__ */ p(x, {
|
|
951
|
+
mt: "md",
|
|
952
|
+
label: e.column.title,
|
|
953
|
+
required: n,
|
|
954
|
+
...b.getInputProps(e.id, { type: "checkbox" })
|
|
955
|
+
}, b.key(e.id));
|
|
956
|
+
case "textarea": return /* @__PURE__ */ p(de, {
|
|
919
957
|
minRows: 3,
|
|
920
958
|
autosize: !0,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
...
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
930
|
-
|
|
959
|
+
label: e.column.title,
|
|
960
|
+
placeholder: e.placeholder ?? "",
|
|
961
|
+
required: n,
|
|
962
|
+
...r
|
|
963
|
+
}, b.key(e.id));
|
|
964
|
+
case "custom": return e.render?.({
|
|
965
|
+
...t,
|
|
966
|
+
...i != null && { id: i }
|
|
967
|
+
}, b.setValues, v, {
|
|
968
|
+
error: r.error,
|
|
969
|
+
required: n
|
|
970
|
+
});
|
|
971
|
+
default: return /* @__PURE__ */ p(ue, {
|
|
972
|
+
type: e.id.includes("email") ? "email" : void 0,
|
|
973
|
+
label: e.column.title,
|
|
974
|
+
placeholder: e.placeholder ?? "",
|
|
975
|
+
required: n,
|
|
976
|
+
...r
|
|
977
|
+
}, b.key(e.id));
|
|
978
|
+
}
|
|
931
979
|
}
|
|
932
|
-
|
|
980
|
+
let k = (t) => (t === void 0 ? e : e.filter((e) => e.step === t)).map((e) => /* @__PURE__ */ p(n, { children: O(e) }, e.id));
|
|
981
|
+
return /* @__PURE__ */ m(f, { children: [C && /* @__PURE__ */ p(_, {
|
|
933
982
|
variant: "outline",
|
|
934
983
|
color: "red",
|
|
935
|
-
title:
|
|
984
|
+
title: "Fehler aufgetreten",
|
|
936
985
|
mb: "lg",
|
|
937
|
-
children:
|
|
986
|
+
children: C
|
|
938
987
|
}), /* @__PURE__ */ m("form", {
|
|
939
|
-
onSubmit:
|
|
940
|
-
let
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
g(e.id), o?.(e.id);
|
|
988
|
+
onSubmit: b.onSubmit(async (e) => {
|
|
989
|
+
let t = Zt(e);
|
|
990
|
+
try {
|
|
991
|
+
await c(t);
|
|
992
|
+
} catch (e) {
|
|
993
|
+
let t = en(e, S);
|
|
994
|
+
Object.keys(t).length > 0 && b.setErrors(t);
|
|
995
|
+
return;
|
|
948
996
|
}
|
|
949
|
-
|
|
997
|
+
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
950
998
|
}),
|
|
951
|
-
children: [
|
|
952
|
-
active:
|
|
999
|
+
children: [E ? /* @__PURE__ */ p(ne, {
|
|
1000
|
+
active: u,
|
|
953
1001
|
size: "sm",
|
|
954
|
-
children:
|
|
955
|
-
...
|
|
956
|
-
children:
|
|
957
|
-
},
|
|
958
|
-
}) :
|
|
1002
|
+
children: w.map((e) => /* @__PURE__ */ p(ne.Step, {
|
|
1003
|
+
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
1004
|
+
children: k(e)
|
|
1005
|
+
}, e))
|
|
1006
|
+
}) : k(), !g && /* @__PURE__ */ m(T, {
|
|
959
1007
|
mt: "md",
|
|
960
1008
|
justify: "end",
|
|
961
1009
|
children: [/* @__PURE__ */ p(y, {
|
|
962
|
-
onClick: () => O.length ? s === 0 ? t() : c(s - 1) : t(),
|
|
963
1010
|
variant: "outline",
|
|
964
|
-
|
|
1011
|
+
onClick: () => E && u > 0 ? h((e) => e - 1) : l(),
|
|
1012
|
+
children: E && u > 0 ? "Zurück" : "Abbrechen"
|
|
965
1013
|
}), /* @__PURE__ */ p(y, {
|
|
966
1014
|
type: "submit",
|
|
967
|
-
loading:
|
|
968
|
-
children:
|
|
1015
|
+
loading: a,
|
|
1016
|
+
children: E && !D ? "Weiter" : "Speichern"
|
|
969
1017
|
})]
|
|
970
1018
|
})]
|
|
971
1019
|
})] });
|
|
972
1020
|
}
|
|
973
1021
|
//#endregion
|
|
1022
|
+
//#region src/DataTable/CreateModal.tsx
|
|
1023
|
+
function rn({ fields: e, onClose: t, queryKey: n, apiPath: r, steps: i, onCreated: a }) {
|
|
1024
|
+
let [o, s] = d(), { mutateAsync: c, isPending: l, error: u } = Gt(r, n), { mutateAsync: f, isPending: m, error: h } = Kt(r, n);
|
|
1025
|
+
return /* @__PURE__ */ p(nn, {
|
|
1026
|
+
fields: e,
|
|
1027
|
+
steps: i,
|
|
1028
|
+
recordId: o,
|
|
1029
|
+
submitting: l || m,
|
|
1030
|
+
error: u ?? h,
|
|
1031
|
+
onPersist: async (e) => {
|
|
1032
|
+
if (o != null) await f({
|
|
1033
|
+
...e,
|
|
1034
|
+
id: o
|
|
1035
|
+
});
|
|
1036
|
+
else {
|
|
1037
|
+
let t = await c(e);
|
|
1038
|
+
s(t.id), a?.(t.id);
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
onClose: t
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
//#endregion
|
|
974
1045
|
//#region node_modules/clsx/dist/clsx.mjs
|
|
975
|
-
function
|
|
1046
|
+
function an(e) {
|
|
976
1047
|
var t, n, r = "";
|
|
977
1048
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
978
1049
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
979
1050
|
var i = e.length;
|
|
980
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
1051
|
+
for (t = 0; t < i; t++) e[t] && (n = an(e[t])) && (r && (r += " "), r += n);
|
|
981
1052
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
982
1053
|
return r;
|
|
983
1054
|
}
|
|
984
1055
|
function X() {
|
|
985
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
1056
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = an(e)) && (r && (r += " "), r += t);
|
|
986
1057
|
return r;
|
|
987
1058
|
}
|
|
988
1059
|
//#endregion
|
|
989
1060
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
990
1061
|
function Z(e, t, n) {
|
|
991
|
-
return e ?
|
|
1062
|
+
return e ? me({
|
|
992
1063
|
color: typeof e == "object" ? e[n] : e,
|
|
993
1064
|
theme: t
|
|
994
1065
|
}).value : void 0;
|
|
995
1066
|
}
|
|
996
|
-
function
|
|
1067
|
+
function on({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
997
1068
|
return {
|
|
998
1069
|
"--mantine-datatable-color-light": Z(t, e, "light"),
|
|
999
1070
|
"--mantine-datatable-color-dark": Z(t, e, "dark"),
|
|
@@ -1009,7 +1080,7 @@ function Kt({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor
|
|
|
1009
1080
|
"--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
|
|
1010
1081
|
};
|
|
1011
1082
|
}
|
|
1012
|
-
function
|
|
1083
|
+
function sn({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
1013
1084
|
return {
|
|
1014
1085
|
"--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
|
|
1015
1086
|
"--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
|
|
@@ -1017,7 +1088,7 @@ function qt({ theme: e, paginationActiveTextColor: t, paginationActiveBackground
|
|
|
1017
1088
|
"--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
|
|
1018
1089
|
};
|
|
1019
1090
|
}
|
|
1020
|
-
function
|
|
1091
|
+
function cn({ theme: e, color: t, backgroundColor: n }) {
|
|
1021
1092
|
return {
|
|
1022
1093
|
"--mantine-datatable-row-color-light": Z(t, e, "light"),
|
|
1023
1094
|
"--mantine-datatable-row-color-dark": Z(t, e, "dark"),
|
|
@@ -1025,9 +1096,9 @@ function Jt({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1025
1096
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1026
1097
|
};
|
|
1027
1098
|
}
|
|
1028
|
-
var [
|
|
1099
|
+
var [ln, un] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), dn = (e) => {
|
|
1029
1100
|
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("");
|
|
1030
|
-
return p(
|
|
1101
|
+
return p(ln, {
|
|
1031
1102
|
value: {
|
|
1032
1103
|
sourceColumn: y,
|
|
1033
1104
|
setSourceColumn: b,
|
|
@@ -1059,13 +1130,13 @@ var [Yt, Xt] = fe("useDataTableColumnsContext must be used within DataTableColum
|
|
|
1059
1130
|
children: t
|
|
1060
1131
|
});
|
|
1061
1132
|
};
|
|
1062
|
-
function
|
|
1133
|
+
function fn() {
|
|
1063
1134
|
return p("tr", {
|
|
1064
1135
|
className: "mantine-datatable-empty-row",
|
|
1065
1136
|
children: p("td", {})
|
|
1066
1137
|
});
|
|
1067
1138
|
}
|
|
1068
|
-
function
|
|
1139
|
+
function pn() {
|
|
1069
1140
|
return m("svg", {
|
|
1070
1141
|
width: "24",
|
|
1071
1142
|
height: "24",
|
|
@@ -1088,14 +1159,14 @@ function $t() {
|
|
|
1088
1159
|
]
|
|
1089
1160
|
});
|
|
1090
1161
|
}
|
|
1091
|
-
function
|
|
1162
|
+
function mn({ icon: e, text: t, active: n, children: r }) {
|
|
1092
1163
|
return p(b, {
|
|
1093
1164
|
className: "mantine-datatable-empty-state",
|
|
1094
1165
|
"data-active": n || void 0,
|
|
1095
1166
|
children: r || m(f, { children: [e || p("div", {
|
|
1096
1167
|
className: "mantine-datatable-empty-state-icon",
|
|
1097
|
-
children: p(
|
|
1098
|
-
}), p(
|
|
1168
|
+
children: p(pn, {})
|
|
1169
|
+
}), p(B, {
|
|
1099
1170
|
component: "div",
|
|
1100
1171
|
size: "sm",
|
|
1101
1172
|
c: "dimmed",
|
|
@@ -1103,13 +1174,13 @@ function en({ icon: e, text: t, active: n, children: r }) {
|
|
|
1103
1174
|
})] })
|
|
1104
1175
|
});
|
|
1105
1176
|
}
|
|
1106
|
-
function
|
|
1177
|
+
function hn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1107
1178
|
let r = l(() => t.map((e) => ({
|
|
1108
1179
|
accessor: e.accessor,
|
|
1109
1180
|
defaultPinned: e.pinned,
|
|
1110
1181
|
pinnable: !!e.pinnable,
|
|
1111
1182
|
pinned: e.pinned
|
|
1112
|
-
})), [t]), [i, a] =
|
|
1183
|
+
})), [t]), [i, a] = je({
|
|
1113
1184
|
key: e ? `${e}-columns-pinning` : "",
|
|
1114
1185
|
defaultValue: e ? r : void 0,
|
|
1115
1186
|
getInitialValueInEffect: n
|
|
@@ -1156,8 +1227,8 @@ function tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1156
1227
|
resetColumnsPinning: d
|
|
1157
1228
|
};
|
|
1158
1229
|
}
|
|
1159
|
-
function
|
|
1160
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1230
|
+
function gn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1231
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = je({
|
|
1161
1232
|
key: e ? `${e}-columns-order` : "",
|
|
1162
1233
|
defaultValue: e ? r : void 0,
|
|
1163
1234
|
getInitialValueInEffect: n
|
|
@@ -1199,8 +1270,8 @@ function nn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1199
1270
|
resetColumnsOrder: d
|
|
1200
1271
|
};
|
|
1201
1272
|
}
|
|
1202
|
-
function
|
|
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] =
|
|
1273
|
+
function _n({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1274
|
+
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = je({
|
|
1204
1275
|
key: e ? `${e}-columns-width` : "",
|
|
1205
1276
|
defaultValue: e ? o() : void 0,
|
|
1206
1277
|
getInitialValueInEffect: n
|
|
@@ -1288,13 +1359,13 @@ function rn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRe
|
|
|
1288
1359
|
endResize: S
|
|
1289
1360
|
};
|
|
1290
1361
|
}
|
|
1291
|
-
function
|
|
1362
|
+
function vn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1292
1363
|
let r = l(() => t?.map((e) => ({
|
|
1293
1364
|
accessor: e.accessor,
|
|
1294
1365
|
defaultToggle: e.defaultToggle || !0,
|
|
1295
1366
|
toggleable: e.toggleable,
|
|
1296
1367
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1297
|
-
})), [t]), [i, a] =
|
|
1368
|
+
})), [t]), [i, a] = je({
|
|
1298
1369
|
key: e ? `${e}-columns-toggle` : "",
|
|
1299
1370
|
defaultValue: e ? r : void 0,
|
|
1300
1371
|
getInitialValueInEffect: n
|
|
@@ -1341,20 +1412,20 @@ function an({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1341
1412
|
resetColumnsToggle: d
|
|
1342
1413
|
};
|
|
1343
1414
|
}
|
|
1344
|
-
var
|
|
1345
|
-
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } =
|
|
1415
|
+
var yn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1416
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = gn({
|
|
1346
1417
|
key: e,
|
|
1347
1418
|
columns: t,
|
|
1348
1419
|
getInitialValueInEffect: n
|
|
1349
|
-
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } =
|
|
1420
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = vn({
|
|
1350
1421
|
key: e,
|
|
1351
1422
|
columns: t,
|
|
1352
1423
|
getInitialValueInEffect: n
|
|
1353
|
-
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } =
|
|
1424
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = hn({
|
|
1354
1425
|
key: e,
|
|
1355
1426
|
columns: t,
|
|
1356
1427
|
getInitialValueInEffect: n
|
|
1357
|
-
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } =
|
|
1428
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = _n({
|
|
1358
1429
|
key: e,
|
|
1359
1430
|
columns: t,
|
|
1360
1431
|
getInitialValueInEffect: n,
|
|
@@ -1431,16 +1502,16 @@ var on = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef:
|
|
|
1431
1502
|
beginResize: w,
|
|
1432
1503
|
endResize: T
|
|
1433
1504
|
};
|
|
1434
|
-
},
|
|
1435
|
-
function
|
|
1505
|
+
}, bn = typeof window < "u" ? c : s;
|
|
1506
|
+
function xn(e) {
|
|
1436
1507
|
let t = u(e);
|
|
1437
1508
|
return t.current = e, t;
|
|
1438
1509
|
}
|
|
1439
|
-
var
|
|
1510
|
+
var Sn = "--mantine-datatable-header-height", Cn = "--mantine-datatable-footer-height", wn = "--mantine-datatable-selection-column-width", Tn = "--mantine-datatable-last-row-border-bottom";
|
|
1440
1511
|
function Q(e, t, n) {
|
|
1441
1512
|
e?.style.setProperty(t, n);
|
|
1442
1513
|
}
|
|
1443
|
-
function
|
|
1514
|
+
function En(e) {
|
|
1444
1515
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1445
1516
|
return t ? {
|
|
1446
1517
|
width: t.inlineSize,
|
|
@@ -1450,18 +1521,18 @@ function pn(e) {
|
|
|
1450
1521
|
height: e.contentRect.height
|
|
1451
1522
|
};
|
|
1452
1523
|
}
|
|
1453
|
-
function
|
|
1524
|
+
function Dn(e, t, n) {
|
|
1454
1525
|
if (e) {
|
|
1455
1526
|
let r = new ResizeObserver((e) => {
|
|
1456
1527
|
let n = e[0];
|
|
1457
|
-
n && t(
|
|
1528
|
+
n && t(En(n));
|
|
1458
1529
|
});
|
|
1459
1530
|
return r.observe(e), () => {
|
|
1460
1531
|
r.disconnect(), n();
|
|
1461
1532
|
};
|
|
1462
1533
|
}
|
|
1463
1534
|
}
|
|
1464
|
-
function
|
|
1535
|
+
function On({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1465
1536
|
let n = {
|
|
1466
1537
|
root: u(null),
|
|
1467
1538
|
table: u(null),
|
|
@@ -1469,16 +1540,16 @@ function hn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1469
1540
|
header: u(null),
|
|
1470
1541
|
footer: u(null),
|
|
1471
1542
|
selectionColumnHeader: u(null)
|
|
1472
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1543
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = xn({ withRowBorders: t }), p = xn(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1473
1544
|
p.current.onScroll?.(e), m.current();
|
|
1474
1545
|
}, []);
|
|
1475
|
-
return s(() =>
|
|
1476
|
-
Q(r.current,
|
|
1477
|
-
}, () => Q(r.current,
|
|
1478
|
-
Q(r.current,
|
|
1479
|
-
}, () => Q(r.current,
|
|
1480
|
-
Q(r.current,
|
|
1481
|
-
}, () => Q(r.current,
|
|
1546
|
+
return s(() => Dn(c.current, (e) => {
|
|
1547
|
+
Q(r.current, Sn, `${e.height}px`);
|
|
1548
|
+
}, () => Q(r.current, Sn, "0")), [c.current]), s(() => Dn(l.current, (e) => {
|
|
1549
|
+
Q(r.current, Cn, `${e.height}px`);
|
|
1550
|
+
}, () => Q(r.current, Cn, "0")), [l.current]), s(() => Dn(d.current, (e) => {
|
|
1551
|
+
Q(r.current, wn, `${e.width}px`);
|
|
1552
|
+
}, () => Q(r.current, wn, "0")), [d.current]), bn(() => {
|
|
1482
1553
|
if (typeof window > "u") return;
|
|
1483
1554
|
let e = {
|
|
1484
1555
|
top: !0,
|
|
@@ -1501,7 +1572,7 @@ function hn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1501
1572
|
Q(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), Q(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1502
1573
|
}
|
|
1503
1574
|
function c() {
|
|
1504
|
-
f.current.withRowBorders && t.height < n.height ? Q(r.current,
|
|
1575
|
+
f.current.withRowBorders && t.height < n.height ? Q(r.current, Tn, `${V("1px")} solid var(--mantine-datatable-border-color)`) : Q(r.current, Tn, "unset");
|
|
1505
1576
|
}
|
|
1506
1577
|
h.current = c;
|
|
1507
1578
|
function l() {
|
|
@@ -1519,10 +1590,10 @@ function hn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1519
1590
|
let u = new ResizeObserver((e) => {
|
|
1520
1591
|
for (let r of e) switch (r.target.tagName) {
|
|
1521
1592
|
case "TABLE":
|
|
1522
|
-
t =
|
|
1593
|
+
t = En(r);
|
|
1523
1594
|
break;
|
|
1524
1595
|
case "DIV":
|
|
1525
|
-
n =
|
|
1596
|
+
n = En(r);
|
|
1526
1597
|
break;
|
|
1527
1598
|
}
|
|
1528
1599
|
l(), s(), c();
|
|
@@ -1530,14 +1601,14 @@ function hn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1530
1601
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1531
1602
|
u.disconnect();
|
|
1532
1603
|
};
|
|
1533
|
-
}, []),
|
|
1604
|
+
}, []), bn(() => {
|
|
1534
1605
|
h.current();
|
|
1535
1606
|
}, [t]), {
|
|
1536
1607
|
refs: n,
|
|
1537
1608
|
onScroll: g
|
|
1538
1609
|
};
|
|
1539
1610
|
}
|
|
1540
|
-
function
|
|
1611
|
+
function kn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1541
1612
|
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1542
1613
|
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1543
1614
|
let a = t.current ?? n.current;
|
|
@@ -1619,13 +1690,13 @@ function gn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r,
|
|
|
1619
1690
|
t,
|
|
1620
1691
|
n,
|
|
1621
1692
|
f
|
|
1622
|
-
]),
|
|
1693
|
+
]), bn(f, [f]), {
|
|
1623
1694
|
pinnedMap: l,
|
|
1624
1695
|
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1625
1696
|
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1626
1697
|
};
|
|
1627
1698
|
}
|
|
1628
|
-
function
|
|
1699
|
+
function An(e) {
|
|
1629
1700
|
let [t, n] = d(null);
|
|
1630
1701
|
return s(() => {
|
|
1631
1702
|
n(null);
|
|
@@ -1634,7 +1705,7 @@ function _n(e) {
|
|
|
1634
1705
|
setLastSelectionChangeIndex: n
|
|
1635
1706
|
};
|
|
1636
1707
|
}
|
|
1637
|
-
function
|
|
1708
|
+
function jn(e, t) {
|
|
1638
1709
|
let n = () => {
|
|
1639
1710
|
t(e.map((e) => e.matches));
|
|
1640
1711
|
}, r = e.map((e) => {
|
|
@@ -1650,62 +1721,62 @@ function vn(e, t) {
|
|
|
1650
1721
|
});
|
|
1651
1722
|
};
|
|
1652
1723
|
}
|
|
1653
|
-
function
|
|
1724
|
+
function Mn(e, t) {
|
|
1654
1725
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1655
1726
|
}
|
|
1656
|
-
function
|
|
1657
|
-
let [r, i] = d(n ? t :
|
|
1727
|
+
function Nn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1728
|
+
let [r, i] = d(n ? t : Mn(e, t)), a = u(null);
|
|
1658
1729
|
return s(() => {
|
|
1659
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1730
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), jn(a.current, (e) => {
|
|
1660
1731
|
i(e);
|
|
1661
1732
|
});
|
|
1662
1733
|
}, [e]), r;
|
|
1663
1734
|
}
|
|
1664
|
-
function
|
|
1735
|
+
function Pn(e) {
|
|
1665
1736
|
let t = ge();
|
|
1666
|
-
return
|
|
1737
|
+
return Nn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1667
1738
|
}
|
|
1668
|
-
function
|
|
1739
|
+
function Fn(e) {
|
|
1669
1740
|
let t = ge();
|
|
1670
|
-
return
|
|
1741
|
+
return H((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1671
1742
|
}
|
|
1672
|
-
function
|
|
1743
|
+
function In(e) {
|
|
1673
1744
|
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1674
1745
|
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1675
1746
|
}
|
|
1676
|
-
function
|
|
1747
|
+
function Ln(e, t, n) {
|
|
1677
1748
|
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1678
1749
|
}
|
|
1679
|
-
function
|
|
1750
|
+
function Rn(e, t) {
|
|
1680
1751
|
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1681
1752
|
}
|
|
1682
|
-
function
|
|
1753
|
+
function zn(e, t) {
|
|
1683
1754
|
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1684
1755
|
}
|
|
1685
1756
|
function $(e, t) {
|
|
1686
|
-
return typeof t == "string" ?
|
|
1757
|
+
return typeof t == "string" ? zn(e, t) : t(e);
|
|
1687
1758
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 +
|
|
1759
|
+
function Bn(e) {
|
|
1760
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Bn(e.groups) : 1));
|
|
1690
1761
|
}
|
|
1691
|
-
function
|
|
1762
|
+
function Vn(e) {
|
|
1692
1763
|
let t = [];
|
|
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(...
|
|
1764
|
+
for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...Vn(n.groups));
|
|
1694
1765
|
return t.filter((e) => e != null);
|
|
1695
1766
|
}
|
|
1696
|
-
function
|
|
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 +
|
|
1767
|
+
function Hn(e, t) {
|
|
1768
|
+
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t ? t[n] !== !1 : !0).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + Hn(n, t), 0) : 0;
|
|
1698
1769
|
}
|
|
1699
|
-
function
|
|
1770
|
+
function Un(e, t, n = 0) {
|
|
1700
1771
|
if (n === t) return [...e];
|
|
1701
1772
|
let r = [];
|
|
1702
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...
|
|
1773
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...Un(i.groups, t, n + 1));
|
|
1703
1774
|
return r;
|
|
1704
1775
|
}
|
|
1705
|
-
function
|
|
1776
|
+
function Wn(e, t, n) {
|
|
1706
1777
|
return n ? !e || t : !1;
|
|
1707
1778
|
}
|
|
1708
|
-
function
|
|
1779
|
+
function Gn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1709
1780
|
let r = [];
|
|
1710
1781
|
if (e && t) {
|
|
1711
1782
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
@@ -1740,8 +1811,8 @@ function Mn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1740
1811
|
};
|
|
1741
1812
|
}
|
|
1742
1813
|
}
|
|
1743
|
-
function
|
|
1744
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1814
|
+
function Kn(e, t) {
|
|
1815
|
+
let [n, r] = d(e), [i, a] = d(e), o = Ne(() => r(!0), 0), c = Ne(() => a(!1), t || 200);
|
|
1745
1816
|
return s(() => {
|
|
1746
1817
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1747
1818
|
}, [
|
|
@@ -1753,17 +1824,17 @@ function Nn(e, t) {
|
|
|
1753
1824
|
visible: i
|
|
1754
1825
|
};
|
|
1755
1826
|
}
|
|
1756
|
-
var
|
|
1757
|
-
function
|
|
1758
|
-
return
|
|
1827
|
+
var qn = "mantine-datatable-nowrap", Jn = "mantine-datatable-ellipsis", Yn = "mantine-datatable-pointer-cursor", Xn = "mantine-datatable-context-menu-cursor", Zn = "mantine-datatable-text-selection-disabled", Qn = "mantine-datatable-text-align-left", $n = "mantine-datatable-text-align-center", er = "mantine-datatable-text-align-right";
|
|
1828
|
+
function tr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1829
|
+
return Fn(r) ? p(oe, {
|
|
1759
1830
|
"data-pinned": n?.position,
|
|
1760
1831
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1761
1832
|
className: X({
|
|
1762
|
-
[
|
|
1763
|
-
[
|
|
1764
|
-
[
|
|
1765
|
-
[
|
|
1766
|
-
[
|
|
1833
|
+
[qn]: a || o,
|
|
1834
|
+
[Jn]: o,
|
|
1835
|
+
[Qn]: s === "left",
|
|
1836
|
+
[$n]: s === "center",
|
|
1837
|
+
[er]: s === "right"
|
|
1767
1838
|
}, e),
|
|
1768
1839
|
style: [
|
|
1769
1840
|
{
|
|
@@ -1781,24 +1852,24 @@ function Hn({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1781
1852
|
children: i
|
|
1782
1853
|
}) : null;
|
|
1783
1854
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return p(
|
|
1855
|
+
function nr({ shadowVisible: e }) {
|
|
1856
|
+
return p(oe, {
|
|
1786
1857
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1787
1858
|
"data-shadow-visible": e || void 0
|
|
1788
1859
|
});
|
|
1789
1860
|
}
|
|
1790
|
-
function
|
|
1791
|
-
return p(
|
|
1861
|
+
function rr({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1862
|
+
return p(ae, {
|
|
1792
1863
|
ref: s,
|
|
1793
1864
|
className: X("mantine-datatable-footer", e),
|
|
1794
1865
|
style: t,
|
|
1795
|
-
children: m(
|
|
1866
|
+
children: m(ce, { children: [a && p(nr, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1796
1867
|
if (e) return null;
|
|
1797
1868
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1798
1869
|
...r,
|
|
1799
1870
|
...t
|
|
1800
1871
|
};
|
|
1801
|
-
return p(
|
|
1872
|
+
return p(tr, {
|
|
1802
1873
|
pinnedInfo: i.get(String(n)),
|
|
1803
1874
|
className: l,
|
|
1804
1875
|
style: u,
|
|
@@ -1812,8 +1883,8 @@ function Wn({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedM
|
|
|
1812
1883
|
})] })
|
|
1813
1884
|
});
|
|
1814
1885
|
}
|
|
1815
|
-
function
|
|
1816
|
-
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ?
|
|
1886
|
+
function ir({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, className: a, style: o }, pinnedInfo: s, maxDepth: c, currentDepth: u, previousGroups: d, isLastGroup: f, withColumnBorders: m = !1, totalTableColumns: h }) {
|
|
1887
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? Vn([{
|
|
1817
1888
|
id: e,
|
|
1818
1889
|
columns: t,
|
|
1819
1890
|
groups: n
|
|
@@ -1821,7 +1892,7 @@ function Gn({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1821
1892
|
t,
|
|
1822
1893
|
n,
|
|
1823
1894
|
e
|
|
1824
|
-
]), _ =
|
|
1895
|
+
]), _ = Pn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => Hn({
|
|
1825
1896
|
id: e,
|
|
1826
1897
|
columns: t,
|
|
1827
1898
|
groups: n
|
|
@@ -1830,16 +1901,16 @@ function Gn({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1830
1901
|
t,
|
|
1831
1902
|
n,
|
|
1832
1903
|
_
|
|
1833
|
-
]), y = l(() => d.reduce((e, t) => e +
|
|
1834
|
-
return v > 0 ? p(
|
|
1904
|
+
]), y = l(() => d.reduce((e, t) => e + Hn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Wn(f, y + v < h, m);
|
|
1905
|
+
return v > 0 ? p(oe, {
|
|
1835
1906
|
colSpan: v,
|
|
1836
1907
|
rowSpan: b > 1 ? b : void 0,
|
|
1837
1908
|
"data-pinned": s?.position,
|
|
1838
1909
|
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1839
1910
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1840
|
-
[
|
|
1841
|
-
[
|
|
1842
|
-
[
|
|
1911
|
+
[Qn]: i === "left",
|
|
1912
|
+
[$n]: i === "center",
|
|
1913
|
+
[er]: i === "right",
|
|
1843
1914
|
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1844
1915
|
}, a),
|
|
1845
1916
|
style: [o, s && {
|
|
@@ -1847,10 +1918,10 @@ function Gn({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1847
1918
|
[s.position]: s.offset,
|
|
1848
1919
|
overflow: "visible"
|
|
1849
1920
|
}],
|
|
1850
|
-
children: r ??
|
|
1921
|
+
children: r ?? In(e)
|
|
1851
1922
|
}) : null;
|
|
1852
1923
|
}
|
|
1853
|
-
function
|
|
1924
|
+
function ar() {
|
|
1854
1925
|
return m("svg", {
|
|
1855
1926
|
width: "14",
|
|
1856
1927
|
height: "14",
|
|
@@ -1867,7 +1938,7 @@ function Kn() {
|
|
|
1867
1938
|
}), 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" })]
|
|
1868
1939
|
});
|
|
1869
1940
|
}
|
|
1870
|
-
function
|
|
1941
|
+
function or() {
|
|
1871
1942
|
return m("svg", {
|
|
1872
1943
|
width: "14",
|
|
1873
1944
|
height: "14",
|
|
@@ -1888,8 +1959,8 @@ function qn() {
|
|
|
1888
1959
|
})]
|
|
1889
1960
|
});
|
|
1890
1961
|
}
|
|
1891
|
-
function
|
|
1892
|
-
let [i, { close: a, toggle: o }] =
|
|
1962
|
+
function sr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1963
|
+
let [i, { close: a, toggle: o }] = Ae(!1), s = t ? or : ar, c = ke(a);
|
|
1893
1964
|
return r && (c = void 0), m(F, {
|
|
1894
1965
|
withArrow: !0,
|
|
1895
1966
|
shadow: "md",
|
|
@@ -1898,7 +1969,7 @@ function Jn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1898
1969
|
opened: i,
|
|
1899
1970
|
onClose: a,
|
|
1900
1971
|
onDismiss: a,
|
|
1901
|
-
children: [p(
|
|
1972
|
+
children: [p(I, { children: p(g, {
|
|
1902
1973
|
className: "mantine-datatable-header-cell-filter-action-icon",
|
|
1903
1974
|
"data-active": t || void 0,
|
|
1904
1975
|
size: "sm",
|
|
@@ -1908,7 +1979,7 @@ function Jn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1908
1979
|
},
|
|
1909
1980
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1910
1981
|
children: p(s, {})
|
|
1911
|
-
}) }), p(
|
|
1982
|
+
}) }), p(ee, {
|
|
1912
1983
|
ref: c,
|
|
1913
1984
|
onClick: (e) => e.stopPropagation(),
|
|
1914
1985
|
onKeyDown: (e) => e.stopPropagation(),
|
|
@@ -1916,7 +1987,7 @@ function Jn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1916
1987
|
})]
|
|
1917
1988
|
});
|
|
1918
1989
|
}
|
|
1919
|
-
function
|
|
1990
|
+
function cr() {
|
|
1920
1991
|
return m("svg", {
|
|
1921
1992
|
width: "14",
|
|
1922
1993
|
height: "14",
|
|
@@ -1938,7 +2009,7 @@ function Yn() {
|
|
|
1938
2009
|
]
|
|
1939
2010
|
});
|
|
1940
2011
|
}
|
|
1941
|
-
function
|
|
2012
|
+
function lr() {
|
|
1942
2013
|
return m("svg", {
|
|
1943
2014
|
width: "14",
|
|
1944
2015
|
height: "14",
|
|
@@ -1960,7 +2031,7 @@ function Xn() {
|
|
|
1960
2031
|
]
|
|
1961
2032
|
});
|
|
1962
2033
|
}
|
|
1963
|
-
function
|
|
2034
|
+
function ur() {
|
|
1964
2035
|
return m("svg", {
|
|
1965
2036
|
width: "14",
|
|
1966
2037
|
height: "14",
|
|
@@ -1982,7 +2053,7 @@ function Zn() {
|
|
|
1982
2053
|
]
|
|
1983
2054
|
});
|
|
1984
2055
|
}
|
|
1985
|
-
function
|
|
2056
|
+
function dr() {
|
|
1986
2057
|
return m("svg", {
|
|
1987
2058
|
width: "14",
|
|
1988
2059
|
height: "14",
|
|
@@ -2003,14 +2074,14 @@ function Qn() {
|
|
|
2003
2074
|
]
|
|
2004
2075
|
});
|
|
2005
2076
|
}
|
|
2006
|
-
function
|
|
2077
|
+
function fr({ currentPinned: e, onPinChange: t }) {
|
|
2007
2078
|
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2008
2079
|
if (i.current) {
|
|
2009
2080
|
let e = getComputedStyle(i.current).direction;
|
|
2010
2081
|
c(e === "rtl");
|
|
2011
2082
|
}
|
|
2012
2083
|
}, []);
|
|
2013
|
-
|
|
2084
|
+
bn(() => {
|
|
2014
2085
|
l();
|
|
2015
2086
|
}, [l]), s(() => {
|
|
2016
2087
|
n && l();
|
|
@@ -2033,7 +2104,7 @@ function $n({ currentPinned: e, onPinChange: t }) {
|
|
|
2033
2104
|
size: "xs",
|
|
2034
2105
|
variant: "light",
|
|
2035
2106
|
onClick: (e) => e.stopPropagation(),
|
|
2036
|
-
children: p(
|
|
2107
|
+
children: p(ur, {})
|
|
2037
2108
|
})
|
|
2038
2109
|
}) }), p(F.Dropdown, {
|
|
2039
2110
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -2048,14 +2119,14 @@ function $n({ currentPinned: e, onPinChange: t }) {
|
|
|
2048
2119
|
variant: _ ? "filled" : "light",
|
|
2049
2120
|
onClick: () => t(_ ? void 0 : f),
|
|
2050
2121
|
"aria-label": "Pin left",
|
|
2051
|
-
children: p(
|
|
2122
|
+
children: p(cr, {})
|
|
2052
2123
|
}),
|
|
2053
2124
|
p(g, {
|
|
2054
2125
|
size: "sm",
|
|
2055
2126
|
variant: v ? "filled" : "light",
|
|
2056
2127
|
onClick: () => t(v ? void 0 : h),
|
|
2057
2128
|
"aria-label": "Pin right",
|
|
2058
|
-
children: p(
|
|
2129
|
+
children: p(lr, {})
|
|
2059
2130
|
}),
|
|
2060
2131
|
e && p(g, {
|
|
2061
2132
|
size: "sm",
|
|
@@ -2063,18 +2134,18 @@ function $n({ currentPinned: e, onPinChange: t }) {
|
|
|
2063
2134
|
color: "red",
|
|
2064
2135
|
onClick: () => t(void 0),
|
|
2065
2136
|
"aria-label": "Unpin",
|
|
2066
|
-
children: p(
|
|
2137
|
+
children: p(dr, {})
|
|
2067
2138
|
})
|
|
2068
2139
|
]
|
|
2069
2140
|
})
|
|
2070
2141
|
})]
|
|
2071
2142
|
});
|
|
2072
2143
|
}
|
|
2073
|
-
var
|
|
2144
|
+
var pr = 50, mr = (e) => {
|
|
2074
2145
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2075
2146
|
current: 0,
|
|
2076
2147
|
next: 0
|
|
2077
|
-
}), { dir: c } = he(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } =
|
|
2148
|
+
}), { dir: c } = he(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = un(), g = a((e) => {
|
|
2078
2149
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2079
2150
|
let r = n.current, a = r.nextElementSibling;
|
|
2080
2151
|
for (; a;) {
|
|
@@ -2093,7 +2164,7 @@ var er = 50, tr = (e) => {
|
|
|
2093
2164
|
let p = (e) => {
|
|
2094
2165
|
let n = e.clientX - o.current;
|
|
2095
2166
|
l && (n = -n);
|
|
2096
|
-
let r = s.current.current -
|
|
2167
|
+
let r = s.current.current - pr, i = s.current.next - pr, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
|
|
2097
2168
|
f([{
|
|
2098
2169
|
accessor: t,
|
|
2099
2170
|
width: `${u}px`
|
|
@@ -2140,7 +2211,7 @@ var er = 50, tr = (e) => {
|
|
|
2140
2211
|
title: "Drag to resize column, double-click to reset"
|
|
2141
2212
|
});
|
|
2142
2213
|
};
|
|
2143
|
-
function
|
|
2214
|
+
function hr() {
|
|
2144
2215
|
return m("svg", {
|
|
2145
2216
|
width: "14",
|
|
2146
2217
|
height: "14",
|
|
@@ -2162,7 +2233,7 @@ function nr() {
|
|
|
2162
2233
|
]
|
|
2163
2234
|
});
|
|
2164
2235
|
}
|
|
2165
|
-
function
|
|
2236
|
+
function gr() {
|
|
2166
2237
|
return m("svg", {
|
|
2167
2238
|
width: "14",
|
|
2168
2239
|
height: "14",
|
|
@@ -2184,7 +2255,7 @@ function rr() {
|
|
|
2184
2255
|
]
|
|
2185
2256
|
});
|
|
2186
2257
|
}
|
|
2187
|
-
function
|
|
2258
|
+
function _r() {
|
|
2188
2259
|
return m("svg", {
|
|
2189
2260
|
width: "14",
|
|
2190
2261
|
height: "14",
|
|
@@ -2209,37 +2280,37 @@ function ir() {
|
|
|
2209
2280
|
]
|
|
2210
2281
|
});
|
|
2211
2282
|
}
|
|
2212
|
-
function
|
|
2213
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning:
|
|
2214
|
-
if (!
|
|
2215
|
-
let
|
|
2283
|
+
function vr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
|
|
2284
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: F, setColumnsPinning: ee } = un(), [I, L] = d(!1), R = u(null), te = F?.find((e) => e.accessor === r)?.pinned;
|
|
2285
|
+
if (!Fn(i)) return null;
|
|
2286
|
+
let z = a ?? In(r), ne = typeof z == "string" ? z : void 0, re = o && S ? (e) => {
|
|
2216
2287
|
e?.defaultPrevented || S({
|
|
2217
2288
|
sortKey: k,
|
|
2218
2289
|
columnAccessor: r,
|
|
2219
2290
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2220
2291
|
});
|
|
2221
|
-
} : void 0,
|
|
2292
|
+
} : void 0, ie = (e) => {
|
|
2222
2293
|
e.stopPropagation(), A(r), L(!1);
|
|
2223
|
-
},
|
|
2294
|
+
}, ae = (e) => {
|
|
2224
2295
|
e.preventDefault(), j(r), L(!0);
|
|
2225
2296
|
}, se = () => {
|
|
2226
2297
|
j(r), L(!1), M();
|
|
2227
|
-
}, B = () => {
|
|
2228
|
-
L(!0);
|
|
2229
2298
|
}, ce = () => {
|
|
2299
|
+
L(!0);
|
|
2300
|
+
}, le = () => {
|
|
2230
2301
|
L(!1);
|
|
2231
|
-
},
|
|
2302
|
+
}, B = (e) => {
|
|
2232
2303
|
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
2233
2304
|
...e,
|
|
2234
2305
|
toggled: !1
|
|
2235
2306
|
} : e));
|
|
2236
|
-
},
|
|
2237
|
-
|
|
2307
|
+
}, ue = (e) => {
|
|
2308
|
+
ee((t) => t.map((t) => t.accessor === r ? {
|
|
2238
2309
|
...t,
|
|
2239
2310
|
pinned: e
|
|
2240
2311
|
} : t));
|
|
2241
2312
|
};
|
|
2242
|
-
return m(
|
|
2313
|
+
return m(oe, {
|
|
2243
2314
|
"data-accessor": r,
|
|
2244
2315
|
"data-pinned": n?.position,
|
|
2245
2316
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2266,8 +2337,8 @@ function ar({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2266
2337
|
],
|
|
2267
2338
|
role: o ? "button" : void 0,
|
|
2268
2339
|
tabIndex: o ? 0 : void 0,
|
|
2269
|
-
onClick:
|
|
2270
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
2340
|
+
onClick: re,
|
|
2341
|
+
onKeyDown: (e) => e.key === "Enter" && re?.(),
|
|
2271
2342
|
ref: R,
|
|
2272
2343
|
children: [m(T, {
|
|
2273
2344
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
@@ -2279,14 +2350,14 @@ function ar({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2279
2350
|
w: "100%",
|
|
2280
2351
|
className: X({
|
|
2281
2352
|
"mantine-datatable-header-cell-draggable": s,
|
|
2282
|
-
"mantine-datatable-header-cell-drag-over":
|
|
2353
|
+
"mantine-datatable-header-cell-drag-over": I
|
|
2283
2354
|
}),
|
|
2284
2355
|
draggable: s,
|
|
2285
|
-
onDragStart: s ?
|
|
2286
|
-
onDragEnter: s ?
|
|
2287
|
-
onDragOver: s ?
|
|
2356
|
+
onDragStart: s ? ie : void 0,
|
|
2357
|
+
onDragEnter: s ? ce : void 0,
|
|
2358
|
+
onDragOver: s ? ae : void 0,
|
|
2288
2359
|
onDrop: s ? se : void 0,
|
|
2289
|
-
onDragLeave: s ?
|
|
2360
|
+
onDragLeave: s ? le : void 0,
|
|
2290
2361
|
children: [s ? p(b, {
|
|
2291
2362
|
role: "img",
|
|
2292
2363
|
"aria-label": "Drag column",
|
|
@@ -2297,21 +2368,21 @@ function ar({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2297
2368
|
onClick: (e) => {
|
|
2298
2369
|
e.stopPropagation();
|
|
2299
2370
|
},
|
|
2300
|
-
children: p(
|
|
2371
|
+
children: p(_r, {})
|
|
2301
2372
|
})
|
|
2302
2373
|
}) : null, p(v, {
|
|
2303
2374
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
2304
|
-
[
|
|
2305
|
-
[
|
|
2306
|
-
[
|
|
2307
|
-
},
|
|
2308
|
-
title:
|
|
2309
|
-
children:
|
|
2375
|
+
[Qn]: _ === "left",
|
|
2376
|
+
[$n]: _ === "center",
|
|
2377
|
+
[er]: _ === "right"
|
|
2378
|
+
}, qn, Jn),
|
|
2379
|
+
title: ne,
|
|
2380
|
+
children: z
|
|
2310
2381
|
})]
|
|
2311
2382
|
}),
|
|
2312
|
-
l ? p(
|
|
2383
|
+
l ? p(fr, {
|
|
2313
2384
|
currentPinned: te,
|
|
2314
|
-
onPinChange:
|
|
2385
|
+
onPinChange: ue
|
|
2315
2386
|
}) : null,
|
|
2316
2387
|
c ? p(b, {
|
|
2317
2388
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2320,46 +2391,46 @@ function ar({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2320
2391
|
children: p(g, {
|
|
2321
2392
|
size: "xs",
|
|
2322
2393
|
variant: "light",
|
|
2323
|
-
onClick:
|
|
2324
|
-
children: p(
|
|
2394
|
+
onClick: B,
|
|
2395
|
+
children: p(dr, {})
|
|
2325
2396
|
})
|
|
2326
2397
|
}) : null,
|
|
2327
2398
|
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(b, {
|
|
2328
2399
|
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
2329
2400
|
role: "img",
|
|
2330
2401
|
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2331
|
-
children: h?.sorted || p(
|
|
2402
|
+
children: h?.sorted || p(gr, {})
|
|
2332
2403
|
}) : p(b, {
|
|
2333
2404
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
2334
2405
|
role: "img",
|
|
2335
2406
|
"aria-label": "Not sorted",
|
|
2336
|
-
children: h?.unsorted || p(
|
|
2407
|
+
children: h?.unsorted || p(hr, {})
|
|
2337
2408
|
}) : null,
|
|
2338
|
-
C ? p(
|
|
2409
|
+
C ? p(sr, {
|
|
2339
2410
|
filterPopoverProps: E,
|
|
2340
2411
|
isActive: !!O,
|
|
2341
2412
|
filterPopoverDisableClickOutside: D,
|
|
2342
2413
|
children: C
|
|
2343
2414
|
}) : null
|
|
2344
2415
|
]
|
|
2345
|
-
}), f && r !== "__selection__" ? p(
|
|
2416
|
+
}), f && r !== "__selection__" ? p(mr, {
|
|
2346
2417
|
accessor: r,
|
|
2347
2418
|
columnRef: R
|
|
2348
2419
|
}) : null]
|
|
2349
2420
|
});
|
|
2350
2421
|
}
|
|
2351
|
-
function
|
|
2422
|
+
function yr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2352
2423
|
let u = !o.disabled;
|
|
2353
|
-
return p(
|
|
2424
|
+
return p(oe, {
|
|
2354
2425
|
ref: l,
|
|
2355
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2426
|
+
className: X("mantine-datatable-header-selector-cell", { [Yn]: n === "cell" && u }, e),
|
|
2356
2427
|
style: t,
|
|
2357
2428
|
rowSpan: c,
|
|
2358
2429
|
"data-shadow-visible": r || void 0,
|
|
2359
2430
|
"data-accessor": "__selection__",
|
|
2360
2431
|
onClick: n === "cell" && u ? s : void 0,
|
|
2361
2432
|
children: p(x, {
|
|
2362
|
-
classNames: u ? { input:
|
|
2433
|
+
classNames: u ? { input: Yn } : void 0,
|
|
2363
2434
|
checked: i,
|
|
2364
2435
|
indeterminate: a,
|
|
2365
2436
|
onChange: s,
|
|
@@ -2368,7 +2439,7 @@ function or({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
2368
2439
|
})
|
|
2369
2440
|
});
|
|
2370
2441
|
}
|
|
2371
|
-
function
|
|
2442
|
+
function br(e, t) {
|
|
2372
2443
|
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2373
2444
|
if (r.length === 0 || r.length !== n.length) return;
|
|
2374
2445
|
let i = new Set(r.map((e) => e.logicalSide));
|
|
@@ -2381,8 +2452,8 @@ function sr(e, t) {
|
|
|
2381
2452
|
isBoundary: l?.isBoundary ?? !1
|
|
2382
2453
|
};
|
|
2383
2454
|
}
|
|
2384
|
-
function
|
|
2385
|
-
let E = c ?
|
|
2455
|
+
function xr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r, sortIcons: i, onSortStatusChange: a, columns: o, defaultColumnProps: s, groups: c, pinnedMap: l, selectionTrigger: u, selectionVisible: f, selectionChecked: h, selectionIndeterminate: g, onSelectionChange: _, selectionCheckboxProps: v, selectorCellShadowVisible: y, selectionColumnClassName: b, selectionColumnStyle: S, withColumnBorders: C = !1, ref: w }) {
|
|
2456
|
+
let E = c ? Bn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(yr, {
|
|
2386
2457
|
ref: e,
|
|
2387
2458
|
className: b,
|
|
2388
2459
|
style: S,
|
|
@@ -2393,7 +2464,7 @@ function cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2393
2464
|
checkboxProps: v,
|
|
2394
2465
|
onChange: _,
|
|
2395
2466
|
rowSpan: c ? D : void 0
|
|
2396
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } =
|
|
2467
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = un(), [j, M] = d(!1), N = o.some((e) => e.toggleable), P = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? In(String(e))])) : void 0, L = m(se, {
|
|
2397
2468
|
className: X("mantine-datatable-header", t),
|
|
2398
2469
|
style: n,
|
|
2399
2470
|
ref: w,
|
|
@@ -2401,10 +2472,10 @@ function cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2401
2472
|
e.preventDefault(), M((e) => !e);
|
|
2402
2473
|
} : void 0,
|
|
2403
2474
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2404
|
-
let n =
|
|
2405
|
-
return m(
|
|
2475
|
+
let n = Un(c, t);
|
|
2476
|
+
return m(ce, { children: [t === 0 && O, n.map((e, r) => p(ir, {
|
|
2406
2477
|
group: e,
|
|
2407
|
-
pinnedInfo:
|
|
2478
|
+
pinnedInfo: br(e, l),
|
|
2408
2479
|
maxDepth: E,
|
|
2409
2480
|
currentDepth: t,
|
|
2410
2481
|
previousGroups: n.slice(0, r),
|
|
@@ -2412,13 +2483,13 @@ function cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2412
2483
|
withColumnBorders: C,
|
|
2413
2484
|
totalTableColumns: o.length
|
|
2414
2485
|
}, e.id))] }, `group-depth-${t}`);
|
|
2415
|
-
}), m(
|
|
2486
|
+
}), m(ce, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2416
2487
|
if (e) return null;
|
|
2417
2488
|
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 } = {
|
|
2418
2489
|
...s,
|
|
2419
2490
|
...t
|
|
2420
2491
|
};
|
|
2421
|
-
return p(
|
|
2492
|
+
return p(vr, {
|
|
2422
2493
|
accessor: c,
|
|
2423
2494
|
pinnedInfo: l.get(String(c)),
|
|
2424
2495
|
className: b,
|
|
@@ -2449,7 +2520,7 @@ function cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2449
2520
|
shadow: "md",
|
|
2450
2521
|
opened: j,
|
|
2451
2522
|
onChange: M,
|
|
2452
|
-
children: [p(
|
|
2523
|
+
children: [p(I, { children: L }), p(ee, { children: p(z, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2453
2524
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2454
2525
|
size: "xs",
|
|
2455
2526
|
label: P[e.accessor],
|
|
@@ -2463,7 +2534,7 @@ function cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2463
2534
|
}) }, e.accessor)) }) })]
|
|
2464
2535
|
}) : L;
|
|
2465
2536
|
}
|
|
2466
|
-
function
|
|
2537
|
+
function Sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2467
2538
|
return p(b, {
|
|
2468
2539
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2469
2540
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
@@ -2474,7 +2545,7 @@ function lr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
|
|
|
2474
2545
|
}))
|
|
2475
2546
|
});
|
|
2476
2547
|
}
|
|
2477
|
-
function
|
|
2548
|
+
function Cr() {
|
|
2478
2549
|
return m("svg", {
|
|
2479
2550
|
width: "14",
|
|
2480
2551
|
height: "14",
|
|
@@ -2495,17 +2566,17 @@ function ur() {
|
|
|
2495
2566
|
]
|
|
2496
2567
|
});
|
|
2497
2568
|
}
|
|
2498
|
-
var
|
|
2499
|
-
xs:
|
|
2500
|
-
sm:
|
|
2501
|
-
md:
|
|
2502
|
-
lg:
|
|
2503
|
-
xl:
|
|
2569
|
+
var wr = {
|
|
2570
|
+
xs: V(22),
|
|
2571
|
+
sm: V(26),
|
|
2572
|
+
md: V(32),
|
|
2573
|
+
lg: V(38),
|
|
2574
|
+
xl: V(44)
|
|
2504
2575
|
};
|
|
2505
|
-
function
|
|
2576
|
+
function Tr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2506
2577
|
return m(T, {
|
|
2507
2578
|
gap: "xs",
|
|
2508
|
-
children: [p(
|
|
2579
|
+
children: [p(B, {
|
|
2509
2580
|
component: "div",
|
|
2510
2581
|
size: e,
|
|
2511
2582
|
children: t
|
|
@@ -2518,9 +2589,9 @@ function fr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2518
2589
|
size: e,
|
|
2519
2590
|
variant: "default",
|
|
2520
2591
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2521
|
-
rightSection: p(
|
|
2592
|
+
rightSection: p(Cr, {}),
|
|
2522
2593
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2523
|
-
height:
|
|
2594
|
+
height: wr[e],
|
|
2524
2595
|
paddingLeft: t.spacing[e],
|
|
2525
2596
|
paddingRight: t.spacing[e]
|
|
2526
2597
|
})],
|
|
@@ -2529,14 +2600,14 @@ function fr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2529
2600
|
let n = t === r;
|
|
2530
2601
|
return p(A, {
|
|
2531
2602
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2532
|
-
style: [{ height:
|
|
2603
|
+
style: [{ height: wr[e] }, n && (i || a) ? (e) => sn({
|
|
2533
2604
|
theme: e,
|
|
2534
2605
|
paginationActiveTextColor: i,
|
|
2535
2606
|
paginationActiveBackgroundColor: a
|
|
2536
2607
|
}) : void 0],
|
|
2537
2608
|
disabled: n,
|
|
2538
2609
|
onClick: () => o(t),
|
|
2539
|
-
children: p(
|
|
2610
|
+
children: p(B, {
|
|
2540
2611
|
component: "div",
|
|
2541
2612
|
size: e,
|
|
2542
2613
|
children: t
|
|
@@ -2546,7 +2617,7 @@ function fr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2546
2617
|
})]
|
|
2547
2618
|
});
|
|
2548
2619
|
}
|
|
2549
|
-
function
|
|
2620
|
+
function Er({ className: e, style: t, fetching: n, page: r, onPageChange: i, paginationWithEdges: a, paginationWithControls: o, paginationActiveTextColor: s, paginationActiveBackgroundColor: c, paginationSize: l, loadingText: u, noRecordsText: d, paginationText: h, totalRecords: g, recordsPerPage: _, onRecordsPerPageChange: y, recordsPerPageLabel: b, recordsPerPageOptions: x, recordsLength: S, horizontalSpacing: C, paginationWrapBreakpoint: w, getPaginationControlProps: T, getPaginationItemProps: E, renderPagination: D }) {
|
|
2550
2621
|
let O;
|
|
2551
2622
|
if (g) {
|
|
2552
2623
|
let e = (r - 1) * _ + 1;
|
|
@@ -2556,15 +2627,15 @@ function pr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2556
2627
|
totalRecords: g
|
|
2557
2628
|
});
|
|
2558
2629
|
} else O = n ? u : d;
|
|
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 = !
|
|
2560
|
-
Text: (e) => p(
|
|
2630
|
+
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !Fn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${V(w)}rem` : e[w] || w})`), N = {
|
|
2631
|
+
Text: (e) => p(B, {
|
|
2561
2632
|
component: "div",
|
|
2562
2633
|
className: "mantine-datatable-pagination-text",
|
|
2563
2634
|
size: l,
|
|
2564
2635
|
...e,
|
|
2565
2636
|
children: O
|
|
2566
2637
|
}),
|
|
2567
|
-
PageSizeSelector: (e) => x ? p(
|
|
2638
|
+
PageSizeSelector: (e) => x ? p(Tr, {
|
|
2568
2639
|
activeTextColor: s,
|
|
2569
2640
|
activeBackgroundColor: c,
|
|
2570
2641
|
size: l,
|
|
@@ -2579,7 +2650,7 @@ function pr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2579
2650
|
root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
|
|
2580
2651
|
control: "mantine-datatable-pagination-pages-control"
|
|
2581
2652
|
},
|
|
2582
|
-
style: s || c ? (e) =>
|
|
2653
|
+
style: s || c ? (e) => sn({
|
|
2583
2654
|
theme: e,
|
|
2584
2655
|
paginationActiveTextColor: s,
|
|
2585
2656
|
paginationActiveBackgroundColor: c
|
|
@@ -2625,18 +2696,18 @@ function pr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2625
2696
|
] })
|
|
2626
2697
|
});
|
|
2627
2698
|
}
|
|
2628
|
-
function
|
|
2629
|
-
return
|
|
2699
|
+
function Dr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
|
|
2700
|
+
return Fn(r) ? p(ie, {
|
|
2630
2701
|
"data-pinned": n?.position,
|
|
2631
2702
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2632
2703
|
className: X({
|
|
2633
|
-
[
|
|
2634
|
-
[
|
|
2635
|
-
[
|
|
2636
|
-
[
|
|
2637
|
-
[
|
|
2638
|
-
[
|
|
2639
|
-
[
|
|
2704
|
+
[qn]: l || u,
|
|
2705
|
+
[Jn]: u,
|
|
2706
|
+
[Yn]: o || s,
|
|
2707
|
+
[Xn]: c,
|
|
2708
|
+
[Qn]: d === "left",
|
|
2709
|
+
[$n]: d === "center",
|
|
2710
|
+
[er]: d === "right"
|
|
2640
2711
|
}, e),
|
|
2641
2712
|
style: [
|
|
2642
2713
|
{
|
|
@@ -2655,12 +2726,12 @@ function mr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2655
2726
|
onDoubleClick: s,
|
|
2656
2727
|
onContextMenu: c,
|
|
2657
2728
|
..._?.(i, a),
|
|
2658
|
-
children: h ? h(i, a) : g ? g(i, a, m) :
|
|
2729
|
+
children: h ? h(i, a) : g ? g(i, a, m) : zn(i, m)
|
|
2659
2730
|
}) : null;
|
|
2660
2731
|
}
|
|
2661
|
-
function
|
|
2662
|
-
let { expanded: i, visible: a } =
|
|
2663
|
-
return a ? m(f, { children: [p(
|
|
2732
|
+
function Or({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2733
|
+
let { expanded: i, visible: a } = Kn(e, r?.transitionDuration);
|
|
2734
|
+
return a ? m(f, { children: [p(ce, {}), p(ce, { children: p(ie, {
|
|
2664
2735
|
className: "mantine-datatable-row-expansion-cell",
|
|
2665
2736
|
colSpan: t,
|
|
2666
2737
|
children: p(S, {
|
|
@@ -2673,28 +2744,28 @@ function hr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2673
2744
|
})
|
|
2674
2745
|
}) })] }) : null;
|
|
2675
2746
|
}
|
|
2676
|
-
function
|
|
2747
|
+
function kr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2677
2748
|
let u = {
|
|
2678
2749
|
...s,
|
|
2679
2750
|
...c(n, r)
|
|
2680
2751
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2681
2752
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2682
2753
|
};
|
|
2683
|
-
return p(
|
|
2684
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2754
|
+
return p(ie, {
|
|
2755
|
+
className: X("mantine-datatable-row-selector-cell", { [Yn]: i === "cell" && d }, e),
|
|
2685
2756
|
style: t,
|
|
2686
2757
|
"data-shadow-visible": o || void 0,
|
|
2687
2758
|
onClick: f,
|
|
2688
2759
|
children: p(x, {
|
|
2689
|
-
classNames: d ? { input:
|
|
2760
|
+
classNames: d ? { input: Yn } : void 0,
|
|
2690
2761
|
onChange: a,
|
|
2691
2762
|
...l,
|
|
2692
2763
|
...u
|
|
2693
2764
|
})
|
|
2694
2765
|
});
|
|
2695
2766
|
}
|
|
2696
|
-
function
|
|
2697
|
-
let M = m(f, { children: [s && p(
|
|
2767
|
+
function Ar({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap: i, defaultColumnRender: a, selectionTrigger: o, selectionVisible: s, selectionChecked: c, onSelectionChange: l, isRecordSelectable: u, selectionCheckboxProps: d, getSelectionCheckboxProps: h, onClick: g, onDoubleClick: _, onContextMenu: v, onCellClick: y, onCellDoubleClick: b, onCellContextMenu: x, expansion: S, customAttributes: C, color: w, backgroundColor: T, className: E, style: D, selectorCellShadowVisible: O, selectionColumnClassName: k, selectionColumnStyle: A, rowFactory: j }) {
|
|
2768
|
+
let M = m(f, { children: [s && p(kr, {
|
|
2698
2769
|
className: k,
|
|
2699
2770
|
style: A,
|
|
2700
2771
|
record: e,
|
|
@@ -2712,7 +2783,7 @@ function _r({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2712
2783
|
...r,
|
|
2713
2784
|
...s
|
|
2714
2785
|
};
|
|
2715
|
-
return p(
|
|
2786
|
+
return p(Dr, {
|
|
2716
2787
|
pinnedInfo: i.get(String(l)),
|
|
2717
2788
|
className: typeof _ == "function" ? _(e, t) : _,
|
|
2718
2789
|
style: v?.(e, t),
|
|
@@ -2749,7 +2820,7 @@ function _r({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2749
2820
|
defaultRender: a,
|
|
2750
2821
|
customCellAttributes: S
|
|
2751
2822
|
}, l);
|
|
2752
|
-
})] }), N = S && p(
|
|
2823
|
+
})] }), N = S && p(Or, {
|
|
2753
2824
|
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2754
2825
|
open: S.isRowExpanded(e),
|
|
2755
2826
|
content: S.content({
|
|
@@ -2757,7 +2828,7 @@ function _r({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2757
2828
|
index: t
|
|
2758
2829
|
}),
|
|
2759
2830
|
collapseProps: S.collapseProps
|
|
2760
|
-
}), P =
|
|
2831
|
+
}), P = jr({
|
|
2761
2832
|
record: e,
|
|
2762
2833
|
index: t,
|
|
2763
2834
|
selectionChecked: c,
|
|
@@ -2777,17 +2848,17 @@ function _r({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2777
2848
|
rowProps: P,
|
|
2778
2849
|
children: M,
|
|
2779
2850
|
expandedElement: N
|
|
2780
|
-
}) : m(f, { children: [p(
|
|
2851
|
+
}) : m(f, { children: [p(ce, {
|
|
2781
2852
|
...P,
|
|
2782
2853
|
children: M
|
|
2783
2854
|
}), N] });
|
|
2784
2855
|
}
|
|
2785
|
-
function
|
|
2856
|
+
function jr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
|
|
2786
2857
|
return {
|
|
2787
|
-
className: X("mantine-datatable-row", { [
|
|
2858
|
+
className: X("mantine-datatable-row", { [Yn]: r || i || o?.isExpandable({
|
|
2788
2859
|
record: e,
|
|
2789
2860
|
index: t
|
|
2790
|
-
}) && o?.expandOnClick }, { [
|
|
2861
|
+
}) && o?.expandOnClick }, { [Xn]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2791
2862
|
"data-selected": n || void 0,
|
|
2792
2863
|
onClick: (n) => {
|
|
2793
2864
|
if (o) {
|
|
@@ -2815,7 +2886,7 @@ function vr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2815
2886
|
}) : void 0,
|
|
2816
2887
|
style: [c || l ? (n) => {
|
|
2817
2888
|
let r = c?.(e, t), i = l?.(e, t);
|
|
2818
|
-
return
|
|
2889
|
+
return cn({
|
|
2819
2890
|
theme: n,
|
|
2820
2891
|
color: r,
|
|
2821
2892
|
backgroundColor: i
|
|
@@ -2824,7 +2895,7 @@ function vr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2824
2895
|
...s?.(e, t) ?? {}
|
|
2825
2896
|
};
|
|
2826
2897
|
}
|
|
2827
|
-
function
|
|
2898
|
+
function Mr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2828
2899
|
return m(L, {
|
|
2829
2900
|
...a,
|
|
2830
2901
|
viewportRef: i,
|
|
@@ -2844,91 +2915,91 @@ function yr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2844
2915
|
]
|
|
2845
2916
|
});
|
|
2846
2917
|
}
|
|
2847
|
-
function
|
|
2848
|
-
let
|
|
2918
|
+
function Nr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: F, sortIcons: ee, onSortStatusChange: I, horizontalSpacing: L, page: R, onPageChange: te, totalRecords: z, recordsPerPage: ne, onRecordsPerPageChange: ie, recordsPerPageOptions: ae, recordsPerPageLabel: oe = "Records per page", paginationWithEdges: se, paginationWithControls: ce, paginationActiveTextColor: le, paginationActiveBackgroundColor: B, paginationSize: ue = "sm", paginationText: de = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: fe = "sm", getPaginationControlProps: pe = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: me, renderPagination: V, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: Oe, onRowContextMenu: ke, onCellClick: Ae, onCellDoubleClick: je, onCellContextMenu: H, onScroll: Ne, onScrollToTop: U, onScrollToBottom: Pe, onScrollToLeft: Fe, onScrollToRight: Ie, c: Le, backgroundColor: Re, borderColor: ze, rowBorderColor: Be, stripedColor: Ve, highlightOnHoverColor: He, rowColor: W, rowBackgroundColor: G, rowExpansion: Ue, rowClassName: We, rowStyle: Ge, customRowAttributes: Ke, scrollViewportRef: qe, scrollAreaProps: Je, tableRef: Ye, bodyRef: Xe, m: Ze, my: Qe, mx: $e, mt: et, mb: tt, ml: nt, mr: rt, className: it, classNames: at, style: ot, styles: st, rowFactory: ct, tableWrapper: lt, ...ut }) {
|
|
2919
|
+
let dt = l(() => y ? Vn(y) : g, [g, y]), { refs: K, onScroll: ft } = On({
|
|
2849
2920
|
scrollCallbacks: {
|
|
2850
2921
|
onScroll: Ne,
|
|
2851
|
-
onScrollToTop:
|
|
2852
|
-
onScrollToBottom:
|
|
2853
|
-
onScrollToLeft:
|
|
2854
|
-
onScrollToRight:
|
|
2922
|
+
onScrollToTop: U,
|
|
2923
|
+
onScrollToBottom: Pe,
|
|
2924
|
+
onScrollToLeft: Fe,
|
|
2925
|
+
onScrollToRight: Ie
|
|
2855
2926
|
},
|
|
2856
|
-
withRowBorders:
|
|
2857
|
-
}),
|
|
2927
|
+
withRowBorders: ut.withRowBorders
|
|
2928
|
+
}), q = yn({
|
|
2858
2929
|
key: _,
|
|
2859
|
-
columns:
|
|
2860
|
-
headerRef:
|
|
2861
|
-
scrollViewportRef:
|
|
2862
|
-
}),
|
|
2863
|
-
rowExpansion:
|
|
2930
|
+
columns: dt,
|
|
2931
|
+
headerRef: K.header,
|
|
2932
|
+
scrollViewportRef: K.scrollViewport
|
|
2933
|
+
}), pt = q.effectiveColumns, mt = Me(K.table, Ye), ht = Me(K.scrollViewport, qe), gt = u(null), _t = Me(gt, Xe), vt = Gn({
|
|
2934
|
+
rowExpansion: Ue,
|
|
2864
2935
|
records: T,
|
|
2865
2936
|
idAccessor: w
|
|
2866
|
-
}), { pinnedMap:
|
|
2867
|
-
columns:
|
|
2868
|
-
theadRef:
|
|
2869
|
-
tbodyRef:
|
|
2870
|
-
selectionColumnHeaderRef:
|
|
2937
|
+
}), { pinnedMap: yt, hasLeftPinned: bt, hasRightPinned: xt } = kn({
|
|
2938
|
+
columns: pt,
|
|
2939
|
+
theadRef: K.header,
|
|
2940
|
+
tbodyRef: gt,
|
|
2941
|
+
selectionColumnHeaderRef: K.selectionColumnHeader,
|
|
2871
2942
|
selectionVisible: !!D,
|
|
2872
2943
|
pinFirstColumn: b,
|
|
2873
2944
|
pinLastColumn: x
|
|
2874
|
-
}),
|
|
2875
|
-
|
|
2945
|
+
}), St = u(!1), Ct = u(R), wt = u(T), Tt = a((e) => {
|
|
2946
|
+
St.current = !0, wt.current = T, te(e);
|
|
2876
2947
|
}, [te, T]);
|
|
2877
2948
|
s(() => {
|
|
2878
|
-
|
|
2949
|
+
Ct.current !== R && (St.current = !0, wt.current = T, Ct.current = R);
|
|
2879
2950
|
}, [R, T]);
|
|
2880
|
-
let
|
|
2951
|
+
let Et = T?.length;
|
|
2881
2952
|
c(() => {
|
|
2882
|
-
if (!
|
|
2883
|
-
let e =
|
|
2953
|
+
if (!St.current || h || T === wt.current) return;
|
|
2954
|
+
let e = K.scrollViewport.current;
|
|
2884
2955
|
if (!e) return;
|
|
2885
2956
|
let t = requestAnimationFrame(() => {
|
|
2886
2957
|
e.scrollTo({
|
|
2887
2958
|
top: 0,
|
|
2888
2959
|
left: 0
|
|
2889
|
-
}),
|
|
2960
|
+
}), St.current = !1;
|
|
2890
2961
|
});
|
|
2891
2962
|
return () => cancelAnimationFrame(t);
|
|
2892
2963
|
}, [
|
|
2893
2964
|
h,
|
|
2894
2965
|
T,
|
|
2895
|
-
|
|
2966
|
+
K.scrollViewport
|
|
2896
2967
|
]);
|
|
2897
|
-
let
|
|
2898
|
-
D && O && O(
|
|
2968
|
+
let Dt = T?.map((e) => $(e, w)), Ot = !!D, kt = D?.map((e) => $(e, w)), At = Dt !== void 0 && kt !== void 0 && kt.length > 0, jt = j ? T?.filter(j) : T, Mt = jt?.map((e) => $(e, w)), J = At && Mt.every((e) => kt.includes(e)), Nt = At && Mt.some((e) => kt.includes(e)), Pt = a(() => {
|
|
2969
|
+
D && O && O(J ? D.filter((e) => !Mt.includes($(e, w))) : Rn([...D, ...jt], (e) => $(e, w)));
|
|
2899
2970
|
}, [
|
|
2900
|
-
|
|
2971
|
+
J,
|
|
2901
2972
|
w,
|
|
2902
2973
|
O,
|
|
2903
|
-
|
|
2904
|
-
|
|
2974
|
+
Mt,
|
|
2975
|
+
jt,
|
|
2905
2976
|
D
|
|
2906
|
-
]), { lastSelectionChangeIndex:
|
|
2907
|
-
m:
|
|
2908
|
-
my:
|
|
2909
|
-
mx:
|
|
2910
|
-
mt:
|
|
2911
|
-
mb:
|
|
2912
|
-
ml:
|
|
2913
|
-
mr:
|
|
2914
|
-
}, Rt = a(({ children: e }) =>
|
|
2915
|
-
return p(
|
|
2916
|
-
...
|
|
2917
|
-
pinnedMap:
|
|
2977
|
+
]), { lastSelectionChangeIndex: Ft, setLastSelectionChangeIndex: It } = An(Dt), Y = Ot && !bt, Lt = {
|
|
2978
|
+
m: Ze,
|
|
2979
|
+
my: Qe,
|
|
2980
|
+
mx: $e,
|
|
2981
|
+
mt: et,
|
|
2982
|
+
mb: tt,
|
|
2983
|
+
ml: nt,
|
|
2984
|
+
mr: rt
|
|
2985
|
+
}, Rt = a(({ children: e }) => lt ? lt({ children: e }) : e, [lt]);
|
|
2986
|
+
return p(dn, {
|
|
2987
|
+
...q,
|
|
2988
|
+
pinnedMap: yt,
|
|
2918
2989
|
children: m(v, {
|
|
2919
|
-
ref:
|
|
2990
|
+
ref: K.root,
|
|
2920
2991
|
...Lt,
|
|
2921
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2992
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, it, at?.root),
|
|
2922
2993
|
style: [
|
|
2923
2994
|
(e) => ({
|
|
2924
|
-
...
|
|
2995
|
+
...on({
|
|
2925
2996
|
theme: e,
|
|
2926
|
-
c:
|
|
2927
|
-
backgroundColor:
|
|
2928
|
-
borderColor:
|
|
2929
|
-
rowBorderColor:
|
|
2930
|
-
stripedColor:
|
|
2931
|
-
highlightOnHoverColor:
|
|
2997
|
+
c: Le,
|
|
2998
|
+
backgroundColor: Re,
|
|
2999
|
+
borderColor: ze,
|
|
3000
|
+
rowBorderColor: Be,
|
|
3001
|
+
stripedColor: Ve,
|
|
3002
|
+
highlightOnHoverColor: He
|
|
2932
3003
|
}),
|
|
2933
3004
|
borderRadius: e.radius[t] || t,
|
|
2934
3005
|
boxShadow: e.shadows[d] || d,
|
|
@@ -2936,87 +3007,87 @@ function br({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2936
3007
|
minHeight: i,
|
|
2937
3008
|
maxHeight: o
|
|
2938
3009
|
}),
|
|
2939
|
-
|
|
2940
|
-
|
|
3010
|
+
ot,
|
|
3011
|
+
st?.root,
|
|
2941
3012
|
{ position: "relative" }
|
|
2942
3013
|
],
|
|
2943
3014
|
children: [
|
|
2944
|
-
p(
|
|
2945
|
-
viewportRef:
|
|
2946
|
-
leftShadowBehind:
|
|
2947
|
-
rightShadowBehind:
|
|
2948
|
-
onScrollPositionChange:
|
|
2949
|
-
scrollAreaProps:
|
|
2950
|
-
children: p(Rt, { children: m(
|
|
2951
|
-
ref:
|
|
3015
|
+
p(Mr, {
|
|
3016
|
+
viewportRef: ht,
|
|
3017
|
+
leftShadowBehind: Ot || bt,
|
|
3018
|
+
rightShadowBehind: xt,
|
|
3019
|
+
onScrollPositionChange: ft,
|
|
3020
|
+
scrollAreaProps: Je,
|
|
3021
|
+
children: p(Rt, { children: m(re, {
|
|
3022
|
+
ref: mt,
|
|
2952
3023
|
horizontalSpacing: L,
|
|
2953
3024
|
className: X("mantine-datatable-table", {
|
|
2954
|
-
[
|
|
3025
|
+
[Zn]: n,
|
|
2955
3026
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
2956
3027
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
2957
|
-
"mantine-datatable-selection-column-visible":
|
|
2958
|
-
"mantine-datatable-resizable-columns":
|
|
2959
|
-
"mantine-datatable-resize-locked":
|
|
2960
|
-
"mantine-datatable-resizing":
|
|
2961
|
-
},
|
|
3028
|
+
"mantine-datatable-selection-column-visible": Ot,
|
|
3029
|
+
"mantine-datatable-resizable-columns": q.hasResizableColumns,
|
|
3030
|
+
"mantine-datatable-resize-locked": q.isLocked,
|
|
3031
|
+
"mantine-datatable-resizing": q.isResizing
|
|
3032
|
+
}, at?.table),
|
|
2962
3033
|
style: {
|
|
2963
|
-
...
|
|
2964
|
-
...
|
|
2965
|
-
...
|
|
3034
|
+
...st?.table,
|
|
3035
|
+
...q.isLocked ? { tableLayout: "fixed" } : null,
|
|
3036
|
+
...q.tableWidth == null ? null : { width: `${q.tableWidth}px` }
|
|
2966
3037
|
},
|
|
2967
|
-
"data-striped":
|
|
3038
|
+
"data-striped": Et && Te || void 0,
|
|
2968
3039
|
"data-highlight-on-hover": we || void 0,
|
|
2969
|
-
...
|
|
3040
|
+
...ut,
|
|
2970
3041
|
children: [
|
|
2971
|
-
Ee ? null : p(
|
|
2972
|
-
...
|
|
2973
|
-
pinnedMap:
|
|
2974
|
-
children: p(
|
|
2975
|
-
ref:
|
|
2976
|
-
selectionColumnHeaderRef:
|
|
2977
|
-
className:
|
|
2978
|
-
style:
|
|
2979
|
-
columns:
|
|
3042
|
+
Ee ? null : p(dn, {
|
|
3043
|
+
...q,
|
|
3044
|
+
pinnedMap: yt,
|
|
3045
|
+
children: p(xr, {
|
|
3046
|
+
ref: K.header,
|
|
3047
|
+
selectionColumnHeaderRef: K.selectionColumnHeader,
|
|
3048
|
+
className: at?.header,
|
|
3049
|
+
style: st?.header,
|
|
3050
|
+
columns: pt,
|
|
2980
3051
|
defaultColumnProps: S,
|
|
2981
3052
|
groups: y,
|
|
2982
|
-
pinnedMap:
|
|
3053
|
+
pinnedMap: yt,
|
|
2983
3054
|
sortStatus: F,
|
|
2984
|
-
sortIcons:
|
|
2985
|
-
onSortStatusChange:
|
|
3055
|
+
sortIcons: ee,
|
|
3056
|
+
onSortStatusChange: I,
|
|
2986
3057
|
selectionTrigger: E,
|
|
2987
|
-
selectionVisible:
|
|
2988
|
-
selectionChecked:
|
|
2989
|
-
selectionIndeterminate:
|
|
2990
|
-
onSelectionChange:
|
|
3058
|
+
selectionVisible: Ot,
|
|
3059
|
+
selectionChecked: J,
|
|
3060
|
+
selectionIndeterminate: Nt && !J,
|
|
3061
|
+
onSelectionChange: Pt,
|
|
2991
3062
|
selectionCheckboxProps: {
|
|
2992
3063
|
...M,
|
|
2993
3064
|
...N
|
|
2994
3065
|
},
|
|
2995
|
-
selectorCellShadowVisible:
|
|
3066
|
+
selectorCellShadowVisible: Y,
|
|
2996
3067
|
selectionColumnClassName: k,
|
|
2997
3068
|
selectionColumnStyle: A,
|
|
2998
|
-
withColumnBorders:
|
|
3069
|
+
withColumnBorders: ut.withColumnBorders
|
|
2999
3070
|
})
|
|
3000
3071
|
}),
|
|
3001
3072
|
p("tbody", {
|
|
3002
|
-
ref:
|
|
3003
|
-
children:
|
|
3004
|
-
let n = $(e, w), r =
|
|
3073
|
+
ref: _t,
|
|
3074
|
+
children: Et ? T.map((e, t) => {
|
|
3075
|
+
let n = $(e, w), r = kt?.includes(n) || !1, i;
|
|
3005
3076
|
return O && D && (i = (i) => {
|
|
3006
|
-
if (i.nativeEvent.shiftKey &&
|
|
3007
|
-
let e = T.filter(t >
|
|
3008
|
-
O(r ?
|
|
3009
|
-
} else O(r ? D.filter((e) => $(e, w) !== n) :
|
|
3010
|
-
|
|
3011
|
-
}), p(
|
|
3077
|
+
if (i.nativeEvent.shiftKey && Ft !== null) {
|
|
3078
|
+
let e = T.filter(t > Ft ? (e, n) => n >= Ft && n <= t && (j ? j(e, n) : !0) : (e, n) => n >= t && n <= Ft && (j ? j(e, n) : !0));
|
|
3079
|
+
O(r ? Ln(D, e, (e) => $(e, w)) : Rn([...D, ...e], (e) => $(e, w)));
|
|
3080
|
+
} else O(r ? D.filter((e) => $(e, w) !== n) : Rn([...D, e], (e) => $(e, w)));
|
|
3081
|
+
It(t);
|
|
3082
|
+
}), p(Ar, {
|
|
3012
3083
|
record: e,
|
|
3013
3084
|
index: t,
|
|
3014
|
-
columns:
|
|
3085
|
+
columns: pt,
|
|
3015
3086
|
defaultColumnProps: S,
|
|
3016
|
-
pinnedMap:
|
|
3087
|
+
pinnedMap: yt,
|
|
3017
3088
|
defaultColumnRender: C,
|
|
3018
3089
|
selectionTrigger: E,
|
|
3019
|
-
selectionVisible:
|
|
3090
|
+
selectionVisible: Ot,
|
|
3020
3091
|
selectionChecked: r,
|
|
3021
3092
|
onSelectionChange: i,
|
|
3022
3093
|
isRecordSelectable: j,
|
|
@@ -3024,64 +3095,64 @@ function br({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3024
3095
|
getSelectionCheckboxProps: P,
|
|
3025
3096
|
onClick: De,
|
|
3026
3097
|
onDoubleClick: Oe,
|
|
3027
|
-
onCellClick:
|
|
3028
|
-
onCellDoubleClick:
|
|
3098
|
+
onCellClick: Ae,
|
|
3099
|
+
onCellDoubleClick: je,
|
|
3029
3100
|
onContextMenu: ke,
|
|
3030
|
-
onCellContextMenu:
|
|
3031
|
-
expansion:
|
|
3032
|
-
color:
|
|
3033
|
-
backgroundColor:
|
|
3034
|
-
className:
|
|
3035
|
-
style:
|
|
3036
|
-
customAttributes:
|
|
3037
|
-
selectorCellShadowVisible:
|
|
3101
|
+
onCellContextMenu: H,
|
|
3102
|
+
expansion: vt,
|
|
3103
|
+
color: W,
|
|
3104
|
+
backgroundColor: G,
|
|
3105
|
+
className: We,
|
|
3106
|
+
style: Ge,
|
|
3107
|
+
customAttributes: Ke,
|
|
3108
|
+
selectorCellShadowVisible: Y,
|
|
3038
3109
|
selectionColumnClassName: k,
|
|
3039
3110
|
selectionColumnStyle: A,
|
|
3040
3111
|
idAccessor: w,
|
|
3041
|
-
rowFactory:
|
|
3112
|
+
rowFactory: ct
|
|
3042
3113
|
}, n);
|
|
3043
|
-
}) : p(
|
|
3114
|
+
}) : p(fn, {})
|
|
3044
3115
|
}),
|
|
3045
|
-
|
|
3046
|
-
ref:
|
|
3047
|
-
className:
|
|
3048
|
-
style:
|
|
3049
|
-
columns:
|
|
3116
|
+
pt.some(({ footer: e }) => e) && p(rr, {
|
|
3117
|
+
ref: K.footer,
|
|
3118
|
+
className: at?.footer,
|
|
3119
|
+
style: st?.footer,
|
|
3120
|
+
columns: pt,
|
|
3050
3121
|
defaultColumnProps: S,
|
|
3051
|
-
pinnedMap:
|
|
3052
|
-
selectionVisible:
|
|
3053
|
-
selectorCellShadowVisible:
|
|
3122
|
+
pinnedMap: yt,
|
|
3123
|
+
selectionVisible: Ot,
|
|
3124
|
+
selectorCellShadowVisible: Y
|
|
3054
3125
|
})
|
|
3055
3126
|
]
|
|
3056
3127
|
}) })
|
|
3057
3128
|
}),
|
|
3058
|
-
!!(R &&
|
|
3059
|
-
className:
|
|
3060
|
-
style:
|
|
3129
|
+
!!(R && Et) && p(Er, {
|
|
3130
|
+
className: at?.pagination,
|
|
3131
|
+
style: st?.pagination,
|
|
3061
3132
|
horizontalSpacing: L,
|
|
3062
3133
|
fetching: h,
|
|
3063
3134
|
page: R,
|
|
3064
|
-
onPageChange:
|
|
3065
|
-
totalRecords:
|
|
3066
|
-
recordsPerPage:
|
|
3067
|
-
onRecordsPerPageChange:
|
|
3068
|
-
recordsPerPageOptions:
|
|
3069
|
-
recordsPerPageLabel:
|
|
3135
|
+
onPageChange: Tt,
|
|
3136
|
+
totalRecords: z,
|
|
3137
|
+
recordsPerPage: ne,
|
|
3138
|
+
onRecordsPerPageChange: ie,
|
|
3139
|
+
recordsPerPageOptions: ae,
|
|
3140
|
+
recordsPerPageLabel: oe,
|
|
3070
3141
|
paginationWithEdges: se,
|
|
3071
|
-
paginationWithControls:
|
|
3072
|
-
paginationActiveTextColor:
|
|
3073
|
-
paginationActiveBackgroundColor:
|
|
3074
|
-
paginationSize:
|
|
3075
|
-
paginationText:
|
|
3076
|
-
paginationWrapBreakpoint:
|
|
3077
|
-
getPaginationControlProps:
|
|
3078
|
-
getPaginationItemProps:
|
|
3142
|
+
paginationWithControls: ce,
|
|
3143
|
+
paginationActiveTextColor: le,
|
|
3144
|
+
paginationActiveBackgroundColor: B,
|
|
3145
|
+
paginationSize: ue,
|
|
3146
|
+
paginationText: de,
|
|
3147
|
+
paginationWrapBreakpoint: fe,
|
|
3148
|
+
getPaginationControlProps: pe,
|
|
3149
|
+
getPaginationItemProps: me,
|
|
3079
3150
|
noRecordsText: Se,
|
|
3080
3151
|
loadingText: be,
|
|
3081
|
-
recordsLength:
|
|
3082
|
-
renderPagination:
|
|
3152
|
+
recordsLength: Et,
|
|
3153
|
+
renderPagination: V
|
|
3083
3154
|
}),
|
|
3084
|
-
p(
|
|
3155
|
+
p(Sr, {
|
|
3085
3156
|
fetching: h,
|
|
3086
3157
|
backgroundBlur: he,
|
|
3087
3158
|
customContent: ge,
|
|
@@ -3089,10 +3160,10 @@ function br({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3089
3160
|
type: ve,
|
|
3090
3161
|
color: ye
|
|
3091
3162
|
}),
|
|
3092
|
-
p(
|
|
3163
|
+
p(mn, {
|
|
3093
3164
|
icon: Ce,
|
|
3094
3165
|
text: Se,
|
|
3095
|
-
active: !h && !
|
|
3166
|
+
active: !h && !Et,
|
|
3096
3167
|
children: xe
|
|
3097
3168
|
})
|
|
3098
3169
|
]
|
|
@@ -3101,85 +3172,13 @@ function br({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3101
3172
|
}
|
|
3102
3173
|
//#endregion
|
|
3103
3174
|
//#region src/DataTable/UpdateModal.tsx
|
|
3104
|
-
function
|
|
3105
|
-
let
|
|
3106
|
-
|
|
3107
|
-
initialValues: e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {}),
|
|
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), {})
|
|
3109
|
-
});
|
|
3110
|
-
s(() => {
|
|
3111
|
-
if (g) {
|
|
3112
|
-
let t = { ...g };
|
|
3113
|
-
e.forEach((e) => {
|
|
3114
|
-
let n = e.id;
|
|
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] = "");
|
|
3116
|
-
}), D.initialize(t), D.setValues(t);
|
|
3117
|
-
}
|
|
3118
|
-
}, [g]);
|
|
3119
|
-
function O(e, t) {
|
|
3120
|
-
return typeof e.required == "function" ? e.required(t ?? {}) : !!e.required;
|
|
3121
|
-
}
|
|
3122
|
-
function k(e) {
|
|
3123
|
-
let t = D.getValues();
|
|
3124
|
-
if (e.conditional && !e.conditional(t)) return null;
|
|
3125
|
-
let r = O(e, t);
|
|
3126
|
-
return /* @__PURE__ */ m(n, { children: [
|
|
3127
|
-
(e.type === void 0 || e.type == "text") && /* @__PURE__ */ p(le, {
|
|
3128
|
-
label: e.column.title,
|
|
3129
|
-
placeholder: e.placeholder ?? "",
|
|
3130
|
-
...D.getInputProps(e.id),
|
|
3131
|
-
type: e.id.includes("email") ? "email" : void 0,
|
|
3132
|
-
required: r
|
|
3133
|
-
}, D.key(e.id)),
|
|
3134
|
-
e.type === "number" && /* @__PURE__ */ p(N, {
|
|
3135
|
-
decimalSeparator: ",",
|
|
3136
|
-
label: e.column.title,
|
|
3137
|
-
placeholder: e.placeholder ?? "",
|
|
3138
|
-
...D.getInputProps(e.id),
|
|
3139
|
-
required: r
|
|
3140
|
-
}, D.key(e.id)),
|
|
3141
|
-
e.type === "date" && /* @__PURE__ */ p(ve, {
|
|
3142
|
-
label: e.column.title,
|
|
3143
|
-
placeholder: e.placeholder ?? "",
|
|
3144
|
-
valueFormat: "DD.MM.YYYY",
|
|
3145
|
-
clearable: !0,
|
|
3146
|
-
...D.getInputProps(e.id),
|
|
3147
|
-
required: r
|
|
3148
|
-
}, D.key(e.id)),
|
|
3149
|
-
e.type === "boolean" && /* @__PURE__ */ p(x, {
|
|
3150
|
-
mt: "md",
|
|
3151
|
-
label: e.column.title,
|
|
3152
|
-
...D.getInputProps(e.id, { type: "checkbox" }),
|
|
3153
|
-
required: r
|
|
3154
|
-
}, D.key(e.id)),
|
|
3155
|
-
e.type === "textarea" && /* @__PURE__ */ p(ue, {
|
|
3156
|
-
label: e.column.title,
|
|
3157
|
-
placeholder: e.placeholder ?? "",
|
|
3158
|
-
...D.getInputProps(e.id),
|
|
3159
|
-
minRows: 3,
|
|
3160
|
-
autosize: !0,
|
|
3161
|
-
required: r
|
|
3162
|
-
}, D.key(e.id)),
|
|
3163
|
-
e.type === "custom" && e.render && e.render({
|
|
3164
|
-
...D.getValues(),
|
|
3165
|
-
id: a
|
|
3166
|
-
}, D.setValues, h, {
|
|
3167
|
-
error: D.getInputProps(e.id).error,
|
|
3168
|
-
required: r
|
|
3169
|
-
})
|
|
3170
|
-
] }, e.id);
|
|
3171
|
-
}
|
|
3172
|
-
return /* @__PURE__ */ m(f, { children: [S && /* @__PURE__ */ p(_, {
|
|
3173
|
-
variant: "outline",
|
|
3174
|
-
color: "red",
|
|
3175
|
-
title: C?.name ?? "Fehler aufgetreten",
|
|
3176
|
-
mb: "lg",
|
|
3177
|
-
children: C?.message ?? "Fehler aufgetreten"
|
|
3178
|
-
}), v ? /* @__PURE__ */ m(ne, {
|
|
3175
|
+
function Pr({ fields: e, onClose: t, queryKey: n, apiPath: r, id: i, steps: a }) {
|
|
3176
|
+
let { data: o, isLoading: s } = Ut(r, n, i), { mutateAsync: c, isPending: l, error: u } = Kt(r, n);
|
|
3177
|
+
return s || !o ? /* @__PURE__ */ m(z, {
|
|
3179
3178
|
gap: "md",
|
|
3180
3179
|
children: [
|
|
3181
3180
|
/* @__PURE__ */ p(te, { height: 40 }),
|
|
3182
|
-
Array(e.length).
|
|
3181
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(te, { height: 35 }, t)),
|
|
3183
3182
|
/* @__PURE__ */ m(T, {
|
|
3184
3183
|
mt: "md",
|
|
3185
3184
|
justify: "end",
|
|
@@ -3192,40 +3191,26 @@ function xr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
3192
3191
|
})]
|
|
3193
3192
|
})
|
|
3194
3193
|
]
|
|
3195
|
-
}) : /* @__PURE__ */
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
}) : e.map((e) => k(e)), !u && /* @__PURE__ */ m(T, {
|
|
3211
|
-
mt: "md",
|
|
3212
|
-
justify: "end",
|
|
3213
|
-
children: [/* @__PURE__ */ p(y, {
|
|
3214
|
-
onClick: () => E.length ? c === 0 ? t() : l(c - 1) : t(),
|
|
3215
|
-
variant: "outline",
|
|
3216
|
-
children: E.length ? c === 0 ? "Abbrechen" : "Zurück" : "Abbrechen"
|
|
3217
|
-
}), /* @__PURE__ */ p(y, {
|
|
3218
|
-
type: "submit",
|
|
3219
|
-
loading: w,
|
|
3220
|
-
children: E.length ? c === E.length - 1 ? "Speichern" : "Weiter" : "Speichern"
|
|
3221
|
-
})]
|
|
3222
|
-
})]
|
|
3223
|
-
})] });
|
|
3194
|
+
}) : /* @__PURE__ */ p(nn, {
|
|
3195
|
+
fields: e,
|
|
3196
|
+
steps: a,
|
|
3197
|
+
record: o,
|
|
3198
|
+
recordId: i,
|
|
3199
|
+
submitting: l,
|
|
3200
|
+
error: u,
|
|
3201
|
+
onPersist: async (e) => {
|
|
3202
|
+
await c({
|
|
3203
|
+
...e,
|
|
3204
|
+
id: i
|
|
3205
|
+
});
|
|
3206
|
+
},
|
|
3207
|
+
onClose: t
|
|
3208
|
+
});
|
|
3224
3209
|
}
|
|
3225
3210
|
//#endregion
|
|
3226
3211
|
//#region src/DataTable/DeleteModal.tsx
|
|
3227
|
-
function
|
|
3228
|
-
let { mutateAsync: a, isError: o, error: c, isPending: l } =
|
|
3212
|
+
function Fr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMessage: i }) {
|
|
3213
|
+
let { mutateAsync: a, isError: o, error: c, isPending: l } = qt(t, e), [u, h] = d(r), [g, v] = d(!1), b = g || l;
|
|
3229
3214
|
return s(() => {
|
|
3230
3215
|
u.length || n();
|
|
3231
3216
|
}, [n, u]), u.length ? /* @__PURE__ */ m(f, { children: [
|
|
@@ -3235,7 +3220,7 @@ function Sr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMe
|
|
|
3235
3220
|
title: c.name,
|
|
3236
3221
|
children: c.message
|
|
3237
3222
|
}),
|
|
3238
|
-
/* @__PURE__ */ p(
|
|
3223
|
+
/* @__PURE__ */ p(B, { 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
3224
|
/* @__PURE__ */ m(T, {
|
|
3240
3225
|
mt: "md",
|
|
3241
3226
|
justify: "end",
|
|
@@ -3262,23 +3247,30 @@ function Sr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r, confirmMe
|
|
|
3262
3247
|
}
|
|
3263
3248
|
//#endregion
|
|
3264
3249
|
//#region src/Hooks/usePersistentState.ts
|
|
3265
|
-
function
|
|
3266
|
-
let [
|
|
3267
|
-
|
|
3268
|
-
|
|
3250
|
+
function Ir(e, t) {
|
|
3251
|
+
let n = `use_persistent_storage_${t}`, [r, i] = d(() => {
|
|
3252
|
+
try {
|
|
3253
|
+
let t = localStorage.getItem(n);
|
|
3254
|
+
return t ? JSON.parse(t) : e;
|
|
3255
|
+
} catch {
|
|
3256
|
+
return e;
|
|
3257
|
+
}
|
|
3269
3258
|
});
|
|
3270
|
-
return [
|
|
3271
|
-
|
|
3259
|
+
return [r, (e) => {
|
|
3260
|
+
i((t) => {
|
|
3261
|
+
let r = e instanceof Function ? e(t) : e;
|
|
3262
|
+
return localStorage.setItem(n, JSON.stringify(r)), r;
|
|
3263
|
+
});
|
|
3272
3264
|
}];
|
|
3273
3265
|
}
|
|
3274
3266
|
//#endregion
|
|
3275
3267
|
//#region src/utils/sort.ts
|
|
3276
|
-
var
|
|
3268
|
+
var Lr = [
|
|
3277
3269
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
3278
3270
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
3279
3271
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
3280
3272
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
3281
|
-
],
|
|
3273
|
+
], Rr = (e, t) => {
|
|
3282
3274
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
3283
3275
|
if (n.length === 0) return "string";
|
|
3284
3276
|
let r = n.slice(0, 100), i = {
|
|
@@ -3294,7 +3286,7 @@ var wr = [
|
|
|
3294
3286
|
i.number++;
|
|
3295
3287
|
return;
|
|
3296
3288
|
}
|
|
3297
|
-
if (
|
|
3289
|
+
if (Lr.some((e) => e.test(t))) {
|
|
3298
3290
|
let e = new Date(t);
|
|
3299
3291
|
if (!isNaN(e.getTime())) {
|
|
3300
3292
|
i.date++;
|
|
@@ -3307,7 +3299,7 @@ var wr = [
|
|
|
3307
3299
|
let a = i.string + i.number + i.date;
|
|
3308
3300
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
3309
3301
|
};
|
|
3310
|
-
function
|
|
3302
|
+
function zr(e, t) {
|
|
3311
3303
|
switch (t) {
|
|
3312
3304
|
case "date":
|
|
3313
3305
|
if (typeof e == "string") {
|
|
@@ -3323,59 +3315,107 @@ function Er(e, t) {
|
|
|
3323
3315
|
default: return String(e).toLowerCase().trim();
|
|
3324
3316
|
}
|
|
3325
3317
|
}
|
|
3326
|
-
var
|
|
3318
|
+
var Br = (e, t, n = "asc") => {
|
|
3327
3319
|
if (!e || e.length === 0) return [];
|
|
3328
|
-
let r =
|
|
3320
|
+
let r = Rr(e, t);
|
|
3329
3321
|
return [...e].sort((e, i) => {
|
|
3330
3322
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
3331
3323
|
if (s && c) return 0;
|
|
3332
3324
|
if (s) return n === "asc" ? -1 : 1;
|
|
3333
3325
|
if (c) return n === "asc" ? 1 : -1;
|
|
3334
|
-
let l =
|
|
3326
|
+
let l = zr(a, r), u = zr(o, r);
|
|
3335
3327
|
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;
|
|
3336
3328
|
});
|
|
3337
3329
|
};
|
|
3338
3330
|
//#endregion
|
|
3331
|
+
//#region src/utils/filter.ts
|
|
3332
|
+
function Vr(e) {
|
|
3333
|
+
return !!e && typeof e == "object" && "id" in e;
|
|
3334
|
+
}
|
|
3335
|
+
function Hr(e, t) {
|
|
3336
|
+
if (typeof e == "string" || typeof e == "number") return t.includes(String(e));
|
|
3337
|
+
if (e && typeof e == "object") {
|
|
3338
|
+
let n = e;
|
|
3339
|
+
return Vr(n) && t.includes(n.id) ? !0 : Object.values(n).some((e) => typeof e == "string" && t.includes(e) || Vr(e) && t.includes(e.id));
|
|
3340
|
+
}
|
|
3341
|
+
return !1;
|
|
3342
|
+
}
|
|
3343
|
+
function Ur(e, t) {
|
|
3344
|
+
return Array.isArray(t) ? Array.isArray(e) ? e.some((e) => Hr(e, t)) : Vr(e) ? t.includes(e.id) : !1 : typeof e == "string" && e.includes(t);
|
|
3345
|
+
}
|
|
3346
|
+
function Wr(e, [t, n]) {
|
|
3347
|
+
if (!t && !n || typeof e != "string") return !0;
|
|
3348
|
+
let r = e.split(" ")[0];
|
|
3349
|
+
return t && n ? r >= t && r <= n : t ? r >= t : r <= n;
|
|
3350
|
+
}
|
|
3351
|
+
function Gr(e, t) {
|
|
3352
|
+
if (t.value === void 0) return !0;
|
|
3353
|
+
let n = e[t.id];
|
|
3354
|
+
switch (t.type) {
|
|
3355
|
+
case "query": return Ur(n, t.value);
|
|
3356
|
+
case "date": return Wr(n, t.value);
|
|
3357
|
+
case "boolean": return n === t.value;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
function Kr(e, t) {
|
|
3361
|
+
return !t || t.length === 0 ? e : e.filter((e) => t.every((t) => Gr(e, t)));
|
|
3362
|
+
}
|
|
3363
|
+
//#endregion
|
|
3364
|
+
//#region src/DataTable/FieldCard.tsx
|
|
3365
|
+
function qr({ rows: e }) {
|
|
3366
|
+
return /* @__PURE__ */ p(f, { children: e.map((e, t) => /* @__PURE__ */ m(v, { children: [t > 0 && /* @__PURE__ */ p(C, {}), /* @__PURE__ */ m(T, {
|
|
3367
|
+
wrap: "nowrap",
|
|
3368
|
+
justify: "space-between",
|
|
3369
|
+
align: "flex-start",
|
|
3370
|
+
gap: "md",
|
|
3371
|
+
py: "xs",
|
|
3372
|
+
px: "sm",
|
|
3373
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3374
|
+
fw: 700,
|
|
3375
|
+
fz: "sm",
|
|
3376
|
+
style: { flexShrink: 0 },
|
|
3377
|
+
children: e.label
|
|
3378
|
+
}), /* @__PURE__ */ p(v, {
|
|
3379
|
+
ta: "right",
|
|
3380
|
+
fz: "sm",
|
|
3381
|
+
style: { minWidth: 0 },
|
|
3382
|
+
children: e.value
|
|
3383
|
+
})]
|
|
3384
|
+
})] }, typeof e.label == "string" ? e.label : t)) });
|
|
3385
|
+
}
|
|
3386
|
+
function Jr({ rows: e }) {
|
|
3387
|
+
return /* @__PURE__ */ p(v, {
|
|
3388
|
+
bg: "var(--mantine-color-gray-light)",
|
|
3389
|
+
style: {
|
|
3390
|
+
borderRadius: "var(--mantine-radius-md)",
|
|
3391
|
+
overflow: "hidden"
|
|
3392
|
+
},
|
|
3393
|
+
children: /* @__PURE__ */ p(qr, { rows: e })
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
//#endregion
|
|
3339
3397
|
//#region src/DataTable/MobileCardList.tsx
|
|
3340
|
-
function
|
|
3398
|
+
function Yr(e, t) {
|
|
3341
3399
|
return t.split(".").reduce((e, t) => {
|
|
3342
3400
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
3343
3401
|
}, e);
|
|
3344
3402
|
}
|
|
3345
|
-
function
|
|
3403
|
+
function Xr(e, t) {
|
|
3346
3404
|
let n = t.column;
|
|
3347
3405
|
if (n.render) return n.render(e, 0);
|
|
3348
|
-
let r =
|
|
3349
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3406
|
+
let r = Yr(e, n.accessor ?? t.id);
|
|
3407
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
3350
3408
|
c: "dimmed",
|
|
3351
3409
|
children: "–"
|
|
3352
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3410
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
3353
3411
|
fz: "sm",
|
|
3354
3412
|
children: r ? "Ja" : "Nein"
|
|
3355
|
-
}) : /* @__PURE__ */ p(
|
|
3413
|
+
}) : /* @__PURE__ */ p(B, {
|
|
3356
3414
|
fz: "sm",
|
|
3357
3415
|
children: String(r)
|
|
3358
3416
|
});
|
|
3359
3417
|
}
|
|
3360
|
-
function
|
|
3361
|
-
return /* @__PURE__ */ m(T, {
|
|
3362
|
-
wrap: "nowrap",
|
|
3363
|
-
justify: "space-between",
|
|
3364
|
-
align: "center",
|
|
3365
|
-
py: "xs",
|
|
3366
|
-
px: "sm",
|
|
3367
|
-
children: [/* @__PURE__ */ p(V, {
|
|
3368
|
-
fw: 700,
|
|
3369
|
-
fz: "sm",
|
|
3370
|
-
children: e.column.title ?? e.id
|
|
3371
|
-
}), /* @__PURE__ */ p(v, {
|
|
3372
|
-
ta: "right",
|
|
3373
|
-
fz: "sm",
|
|
3374
|
-
children: kr(t, e)
|
|
3375
|
-
})]
|
|
3376
|
-
});
|
|
3377
|
-
}
|
|
3378
|
-
function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3418
|
+
function Zr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, canDelete: o, pagination: s, sort: c, rowExpansion: l }) {
|
|
3379
3419
|
let [u, _] = d(/* @__PURE__ */ new Set()), y = l?.expanded, b = (e) => y ? y.recordIds.includes(e) : u.has(e), x = (e) => {
|
|
3380
3420
|
if (y) {
|
|
3381
3421
|
let { recordIds: t, onRecordIdsChange: n } = y;
|
|
@@ -3384,29 +3424,29 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3384
3424
|
let n = new Set(t);
|
|
3385
3425
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
3386
3426
|
});
|
|
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),
|
|
3427
|
+
}, 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), ee = w.filter((e) => e.column.sortable !== !1).reduce((e, t) => {
|
|
3388
3428
|
let n = t.column.accessor ?? t.id;
|
|
3389
3429
|
return e.some((e) => e.value === n) || e.push({
|
|
3390
3430
|
value: n,
|
|
3391
3431
|
label: t.column.title ?? t.id
|
|
3392
3432
|
}), e;
|
|
3393
|
-
}, []),
|
|
3433
|
+
}, []), I = (e, t, n) => {
|
|
3394
3434
|
r?.({
|
|
3395
3435
|
record: e,
|
|
3396
3436
|
index: t,
|
|
3397
3437
|
event: n
|
|
3398
3438
|
});
|
|
3399
3439
|
};
|
|
3400
|
-
return /* @__PURE__ */ m(
|
|
3440
|
+
return /* @__PURE__ */ m(z, {
|
|
3401
3441
|
gap: "sm",
|
|
3402
3442
|
my: "md",
|
|
3403
3443
|
children: [
|
|
3404
|
-
(c &&
|
|
3444
|
+
(c && ee.length > 0 || D.length > 0) && /* @__PURE__ */ m(T, {
|
|
3405
3445
|
gap: "xs",
|
|
3406
3446
|
wrap: "nowrap",
|
|
3407
3447
|
justify: "flex-end",
|
|
3408
|
-
children: [c &&
|
|
3409
|
-
data:
|
|
3448
|
+
children: [c && ee.length > 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(R, {
|
|
3449
|
+
data: ee,
|
|
3410
3450
|
value: c.field,
|
|
3411
3451
|
onChange: (e) => e && c.onSortChange(e, c.direction),
|
|
3412
3452
|
allowDeselect: !1,
|
|
@@ -3415,7 +3455,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3415
3455
|
variant: "filled",
|
|
3416
3456
|
size: "input-sm",
|
|
3417
3457
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3418
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3458
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(Ee, { size: 18 }) : /* @__PURE__ */ p(De, { size: 18 })
|
|
3419
3459
|
})] }), D.length > 0 && /* @__PURE__ */ m(F, {
|
|
3420
3460
|
opened: M,
|
|
3421
3461
|
onChange: N,
|
|
@@ -3433,7 +3473,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3433
3473
|
size: "input-sm",
|
|
3434
3474
|
onClick: () => N((e) => !e),
|
|
3435
3475
|
"aria-label": "Filter",
|
|
3436
|
-
children: /* @__PURE__ */ p(
|
|
3476
|
+
children: /* @__PURE__ */ p(Se, { size: 18 })
|
|
3437
3477
|
})
|
|
3438
3478
|
}) }), /* @__PURE__ */ p(F.Dropdown, {
|
|
3439
3479
|
p: 0,
|
|
@@ -3448,7 +3488,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3448
3488
|
value: e.id,
|
|
3449
3489
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3450
3490
|
gap: "xs",
|
|
3451
|
-
children: [/* @__PURE__ */ p(
|
|
3491
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3452
3492
|
fw: 600,
|
|
3453
3493
|
fz: "sm",
|
|
3454
3494
|
children: e.column.title ?? e.id
|
|
@@ -3464,14 +3504,14 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3464
3504
|
})]
|
|
3465
3505
|
})]
|
|
3466
3506
|
}),
|
|
3467
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3507
|
+
e.length === 0 && /* @__PURE__ */ p(B, {
|
|
3468
3508
|
c: "dimmed",
|
|
3469
3509
|
ta: "center",
|
|
3470
3510
|
py: "xl",
|
|
3471
3511
|
children: "Keine Einträge gefunden"
|
|
3472
3512
|
}),
|
|
3473
3513
|
e.map((e, n) => {
|
|
3474
|
-
let s = e.id ?? n, c = b(s);
|
|
3514
|
+
let s = e.id ?? n, c = !!l && (!l.expandable || l.expandable(e)), u = c && b(s);
|
|
3475
3515
|
return /* @__PURE__ */ p(t.Fragment, { children: /* @__PURE__ */ m(v, {
|
|
3476
3516
|
bg: "var(--mantine-color-body)",
|
|
3477
3517
|
bd: "1px solid var(--mantine-color-default-border)",
|
|
@@ -3481,9 +3521,9 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3481
3521
|
},
|
|
3482
3522
|
children: [/* @__PURE__ */ m(v, {
|
|
3483
3523
|
w: "100%",
|
|
3484
|
-
style: { cursor: r ||
|
|
3524
|
+
style: { cursor: r || c ? "pointer" : "default" },
|
|
3485
3525
|
onClick: (t) => {
|
|
3486
|
-
|
|
3526
|
+
c && !r ? x(s) : I(e, n, t);
|
|
3487
3527
|
},
|
|
3488
3528
|
children: [i && i.length > 0 && /* @__PURE__ */ p(T, {
|
|
3489
3529
|
px: "sm",
|
|
@@ -3499,7 +3539,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3499
3539
|
color: "gray",
|
|
3500
3540
|
size: "sm",
|
|
3501
3541
|
onClick: (e) => e.stopPropagation(),
|
|
3502
|
-
children: /* @__PURE__ */ p(
|
|
3542
|
+
children: /* @__PURE__ */ p(xe, { size: 16 })
|
|
3503
3543
|
}) }), /* @__PURE__ */ p(O.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(O.Item, {
|
|
3504
3544
|
leftSection: t.icon,
|
|
3505
3545
|
onClick: (n) => {
|
|
@@ -3509,12 +3549,12 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3509
3549
|
}, `card_action_${n}`)) })]
|
|
3510
3550
|
});
|
|
3511
3551
|
})()
|
|
3512
|
-
}),
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
})
|
|
3516
|
-
}),
|
|
3517
|
-
expanded:
|
|
3552
|
+
}), /* @__PURE__ */ p(qr, { rows: w.map((t) => ({
|
|
3553
|
+
label: t.column.title ?? t.id,
|
|
3554
|
+
value: Xr(e, t)
|
|
3555
|
+
})) })]
|
|
3556
|
+
}), c && /* @__PURE__ */ m(S, {
|
|
3557
|
+
expanded: u,
|
|
3518
3558
|
children: [/* @__PURE__ */ p(C, {}), /* @__PURE__ */ p(v, {
|
|
3519
3559
|
px: "sm",
|
|
3520
3560
|
py: "sm",
|
|
@@ -3523,7 +3563,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3523
3563
|
})]
|
|
3524
3564
|
}) }, s);
|
|
3525
3565
|
}),
|
|
3526
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3566
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(z, {
|
|
3527
3567
|
gap: "xs",
|
|
3528
3568
|
mt: "sm",
|
|
3529
3569
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3537,7 +3577,7 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3537
3577
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3538
3578
|
justify: "center",
|
|
3539
3579
|
gap: "xs",
|
|
3540
|
-
children: [/* @__PURE__ */ p(
|
|
3580
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3541
3581
|
fz: "xs",
|
|
3542
3582
|
c: "dimmed",
|
|
3543
3583
|
children: "Einträge pro Seite:"
|
|
@@ -3558,88 +3598,95 @@ function jr({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3558
3598
|
});
|
|
3559
3599
|
}
|
|
3560
3600
|
//#endregion
|
|
3561
|
-
//#region src/DataTable/
|
|
3562
|
-
var
|
|
3601
|
+
//#region src/DataTable/DataTable.tsx
|
|
3602
|
+
var Qr = [
|
|
3563
3603
|
10,
|
|
3564
3604
|
15,
|
|
3565
3605
|
50,
|
|
3566
3606
|
100,
|
|
3567
3607
|
500
|
|
3568
3608
|
];
|
|
3569
|
-
function
|
|
3570
|
-
let [ae, oe] = d(
|
|
3571
|
-
|
|
3572
|
-
}, B =
|
|
3573
|
-
...
|
|
3574
|
-
...
|
|
3575
|
-
},
|
|
3609
|
+
function $r({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutationApiPath: a, buttons: o, fields: c, selection: l, pagination: u, filters: h, actions: b, steps: x, defaultSort: S, onSortChange: C, createButtonText: E, queryParams: D, tabs: k, defaultTab: A, activeTab: j, onActiveTabChange: N, canUpdate: P, canDelete: F, showRefresh: ee = !0, rowExpansion: I, onRowClick: L, mobileCards: R = !1, deleteConfirmMessage: ne, editRecordId: re, onEditRecordIdChange: ie }) {
|
|
3610
|
+
let [ae, oe] = d(A || (k && k.length > 0 ? k[0].value : null)), se = j === void 0 ? ae : j, ce = (e) => {
|
|
3611
|
+
j === void 0 && oe(e), N && N(e);
|
|
3612
|
+
}, B = k?.find((e) => e.value === se), ue = B?.queryParams || {}, de = B?.apiPath ?? r, pe = B?.mutationApiPath ?? a ?? de, me = {
|
|
3613
|
+
...D,
|
|
3614
|
+
...ue
|
|
3615
|
+
}, V = me ? "?" + Object.entries(me).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", he = se ? [...t, se] : t, { data: ge, isLoading: _e, isError: ve, isRefetching: xe, refetch: Se } = Wt(de + V, he), { queryClient: Ee } = J();
|
|
3576
3616
|
s(() => {
|
|
3577
|
-
!
|
|
3617
|
+
!ge || !Array.isArray(ge) || n?.forEach((e) => Ee.invalidateQueries({ queryKey: e }));
|
|
3578
3618
|
}, [
|
|
3579
|
-
|
|
3619
|
+
ge,
|
|
3580
3620
|
n,
|
|
3581
|
-
|
|
3621
|
+
Ee
|
|
3582
3622
|
]);
|
|
3583
|
-
let
|
|
3584
|
-
if (t.value === void 0) return !0;
|
|
3585
|
-
let n = t.id;
|
|
3586
|
-
if (t.type === "query") {
|
|
3587
|
-
let r = e[n];
|
|
3588
|
-
return Array.isArray(t.value) ? Array.isArray(r) ? r.some((e) => {
|
|
3589
|
-
if (typeof e == "string" || typeof e == "number") return t.value.includes(String(e));
|
|
3590
|
-
if (e && typeof e == "object") {
|
|
3591
|
-
let n = e;
|
|
3592
|
-
if ("id" in n && t.value.includes(n.id)) return !0;
|
|
3593
|
-
for (let e in n) {
|
|
3594
|
-
let r = n[e];
|
|
3595
|
-
if (typeof r == "string" && t.value.includes(r) || r && typeof r == "object" && "id" in r && t.value.includes(r.id)) return !0;
|
|
3596
|
-
}
|
|
3597
|
-
}
|
|
3598
|
-
return !1;
|
|
3599
|
-
}) : r && typeof r == "object" && "id" in r ? t.value.includes(r.id) : !1 : typeof r == "string" && r.includes(t.value);
|
|
3600
|
-
} else if (t.type === "date") {
|
|
3601
|
-
let r = t.value;
|
|
3602
|
-
if (!r) return !0;
|
|
3603
|
-
let [i, a] = r;
|
|
3604
|
-
if (!i && !a) return !0;
|
|
3605
|
-
let o = e[n];
|
|
3606
|
-
if (typeof o == "string") {
|
|
3607
|
-
let e = o.split(" ")[0];
|
|
3608
|
-
if (i && a) return e >= i && e <= a;
|
|
3609
|
-
if (i && !a) return e >= i;
|
|
3610
|
-
if (!i && a) return e <= a;
|
|
3611
|
-
}
|
|
3612
|
-
return !0;
|
|
3613
|
-
} else if (t.type === "boolean") return e[n] === t.value;
|
|
3614
|
-
return !0;
|
|
3615
|
-
})), [Ee, Oe] = d({
|
|
3623
|
+
let De = Kr(Array.isArray(ge) ? ge : [], h), [ke, Ae] = d({
|
|
3616
3624
|
columnAccessor: S?.field ?? c[0].id,
|
|
3617
3625
|
direction: S?.direction ?? "desc"
|
|
3618
|
-
}),
|
|
3619
|
-
|
|
3620
|
-
}, H =
|
|
3626
|
+
}), je = (e) => {
|
|
3627
|
+
Ae(e), C && C(String(e.columnAccessor), e.direction);
|
|
3628
|
+
}, H = Br(De, ke.columnAccessor, ke.direction), [Me, Ne] = Ir(Qr[1], "mantine-table-page-size"), [U, Pe] = d(1), Fe = u ? H.slice((U - 1) * Me, U * Me) : H, [Ie, Le] = d([]), Re = I?.expanded?.recordIds ?? Ie, ze = I?.expanded?.onRecordIdsChange ?? Le, Be = (e) => {
|
|
3629
|
+
Re.includes(e) ? ze(Re.filter((t) => t !== e)) : ze(I?.allowMultiple ? [...Re, e] : [e]);
|
|
3630
|
+
}, Ve = c.findIndex((e) => e.list && e.column && !e.column.hidden), He = I && Ve >= 0 ? c.map((e, t) => {
|
|
3631
|
+
if (t !== Ve) return e;
|
|
3632
|
+
let n = e.column.render;
|
|
3633
|
+
return {
|
|
3634
|
+
...e,
|
|
3635
|
+
column: {
|
|
3636
|
+
...e.column,
|
|
3637
|
+
render: (t, r) => /* @__PURE__ */ m(T, {
|
|
3638
|
+
gap: "xs",
|
|
3639
|
+
wrap: "nowrap",
|
|
3640
|
+
align: "center",
|
|
3641
|
+
children: [!I.expandable || I.expandable(t) ? /* @__PURE__ */ p(v, {
|
|
3642
|
+
component: "span",
|
|
3643
|
+
"aria-label": "Aufklappen",
|
|
3644
|
+
onClick: (e) => {
|
|
3645
|
+
e.stopPropagation(), Be(t.id);
|
|
3646
|
+
},
|
|
3647
|
+
style: {
|
|
3648
|
+
display: "inline-flex",
|
|
3649
|
+
flexShrink: 0,
|
|
3650
|
+
cursor: "pointer"
|
|
3651
|
+
},
|
|
3652
|
+
children: /* @__PURE__ */ p(be, {
|
|
3653
|
+
size: 16,
|
|
3654
|
+
style: {
|
|
3655
|
+
color: "var(--mantine-primary-color-filled)",
|
|
3656
|
+
transform: Re.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3657
|
+
transition: "transform 200ms ease"
|
|
3658
|
+
}
|
|
3659
|
+
})
|
|
3660
|
+
}) : /* @__PURE__ */ p(v, {
|
|
3661
|
+
w: 16,
|
|
3662
|
+
style: { flexShrink: 0 }
|
|
3663
|
+
}), n ? n(t, r) : String(zn(t, e.column.accessor) ?? "")]
|
|
3664
|
+
})
|
|
3665
|
+
}
|
|
3666
|
+
};
|
|
3667
|
+
}) : c, [W, G] = d([]);
|
|
3621
3668
|
s(() => {
|
|
3622
|
-
|
|
3623
|
-
}, [
|
|
3624
|
-
let [
|
|
3669
|
+
G([]);
|
|
3670
|
+
}, [se]);
|
|
3671
|
+
let [Ue, We] = d(!1), [Ge, Ke] = d(!1), [qe, Je] = d(!1);
|
|
3625
3672
|
s(() => {
|
|
3626
3673
|
if (re && H.length > 0) {
|
|
3627
3674
|
let e = H.find((e) => e.id === re);
|
|
3628
|
-
e && (
|
|
3675
|
+
e && (G([e]), Ke(!0), ie?.(null));
|
|
3629
3676
|
}
|
|
3630
3677
|
}, [re, H]);
|
|
3631
|
-
let
|
|
3632
|
-
return
|
|
3633
|
-
icon: /* @__PURE__ */ p(
|
|
3678
|
+
let Ye = c.some((e) => e.update), Xe = c.some((e) => e.delete), Ze = [];
|
|
3679
|
+
return Ye && Ze.push({
|
|
3680
|
+
icon: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3634
3681
|
label: "Bearbeiten",
|
|
3635
3682
|
onClick: (e) => {
|
|
3636
|
-
|
|
3683
|
+
G(e), Ke(!0);
|
|
3637
3684
|
}
|
|
3638
|
-
}), b &&
|
|
3639
|
-
icon: /* @__PURE__ */ p(
|
|
3685
|
+
}), b && Ze.push(...b), Xe && Ze.push({
|
|
3686
|
+
icon: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3640
3687
|
label: "Löschen",
|
|
3641
3688
|
onClick: (e) => {
|
|
3642
|
-
|
|
3689
|
+
G(e), Je(!0);
|
|
3643
3690
|
}
|
|
3644
3691
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3645
3692
|
/* @__PURE__ */ m(w, {
|
|
@@ -3654,7 +3701,7 @@ function Nr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3654
3701
|
},
|
|
3655
3702
|
justify: e ? "space-between" : "flex-end",
|
|
3656
3703
|
wrap: "wrap",
|
|
3657
|
-
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(
|
|
3704
|
+
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(fe, {
|
|
3658
3705
|
order: 4,
|
|
3659
3706
|
children: e
|
|
3660
3707
|
}) : e), /* @__PURE__ */ m(w, {
|
|
@@ -3677,39 +3724,39 @@ function Nr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3677
3724
|
sm: "auto"
|
|
3678
3725
|
},
|
|
3679
3726
|
children: [
|
|
3680
|
-
|
|
3727
|
+
ee && /* @__PURE__ */ p(g, {
|
|
3681
3728
|
variant: "subtle",
|
|
3682
|
-
onClick: () =>
|
|
3729
|
+
onClick: () => Se(),
|
|
3683
3730
|
"aria-label": "Neuladen",
|
|
3684
|
-
children: /* @__PURE__ */ p(
|
|
3731
|
+
children: /* @__PURE__ */ p(Te, {})
|
|
3685
3732
|
}),
|
|
3686
3733
|
(c.some((e) => e.update) || l) && (() => {
|
|
3687
|
-
let e = c.find((e) => e.update) && (!
|
|
3734
|
+
let e = c.find((e) => e.update) && (!P || W.length > 0 && P(W[0])), t = c.find((e) => e.delete) && (!F || W.length > 0 && F(W[0])), n = (b ?? []).length > 0, r = e || t || n;
|
|
3688
3735
|
return /* @__PURE__ */ p(v, {
|
|
3689
|
-
...
|
|
3736
|
+
...R ? { visibleFrom: "sm" } : {},
|
|
3690
3737
|
children: /* @__PURE__ */ m(O, {
|
|
3691
3738
|
shadow: "md",
|
|
3692
3739
|
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(y, {
|
|
3693
3740
|
variant: "outline",
|
|
3694
3741
|
rightSection: /* @__PURE__ */ p(ye, { size: 14 }),
|
|
3695
|
-
disabled: !
|
|
3742
|
+
disabled: !W.length || !r,
|
|
3696
3743
|
children: "Aktionen"
|
|
3697
3744
|
}) }), /* @__PURE__ */ m(O.Dropdown, { children: [
|
|
3698
3745
|
e && /* @__PURE__ */ p(O.Item, {
|
|
3699
|
-
leftSection: /* @__PURE__ */ p(
|
|
3700
|
-
onClick: () =>
|
|
3701
|
-
disabled:
|
|
3746
|
+
leftSection: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3747
|
+
onClick: () => Ke(!0),
|
|
3748
|
+
disabled: W.length !== 1,
|
|
3702
3749
|
children: "Bearbeiten"
|
|
3703
3750
|
}),
|
|
3704
3751
|
(b ?? []).map((e, t) => /* @__PURE__ */ i(O.Item, {
|
|
3705
3752
|
...e.icon && { leftSection: e.icon },
|
|
3706
3753
|
key: `custom_action_${t}`,
|
|
3707
|
-
onClick: () => e.onClick(
|
|
3708
|
-
disabled: e.disabled?.(
|
|
3754
|
+
onClick: () => e.onClick(W),
|
|
3755
|
+
disabled: e.disabled?.(W) ?? !1
|
|
3709
3756
|
}, e.label)),
|
|
3710
3757
|
t && /* @__PURE__ */ p(O.Item, {
|
|
3711
|
-
leftSection: /* @__PURE__ */ p(
|
|
3712
|
-
onClick: () =>
|
|
3758
|
+
leftSection: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3759
|
+
onClick: () => Je(!0),
|
|
3713
3760
|
color: "red",
|
|
3714
3761
|
children: "Löschen"
|
|
3715
3762
|
})
|
|
@@ -3718,33 +3765,33 @@ function Nr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3718
3765
|
});
|
|
3719
3766
|
})(),
|
|
3720
3767
|
c.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3721
|
-
onClick: () =>
|
|
3722
|
-
disabled:
|
|
3723
|
-
children:
|
|
3768
|
+
onClick: () => We(!0),
|
|
3769
|
+
disabled: _e,
|
|
3770
|
+
children: E ?? "Erstellen"
|
|
3724
3771
|
}),
|
|
3725
3772
|
o
|
|
3726
3773
|
]
|
|
3727
3774
|
})]
|
|
3728
3775
|
}),
|
|
3729
|
-
|
|
3730
|
-
value:
|
|
3731
|
-
onChange:
|
|
3776
|
+
k && k.length > 0 && /* @__PURE__ */ p(le, {
|
|
3777
|
+
value: se,
|
|
3778
|
+
onChange: ce,
|
|
3732
3779
|
mt: "md",
|
|
3733
|
-
children: /* @__PURE__ */ p(
|
|
3780
|
+
children: /* @__PURE__ */ p(le.List, { children: k.map((e) => /* @__PURE__ */ p(le.Tab, {
|
|
3734
3781
|
value: e.value,
|
|
3735
3782
|
leftSection: e.icon,
|
|
3736
3783
|
children: e.label
|
|
3737
3784
|
}, e.value)) })
|
|
3738
3785
|
}),
|
|
3739
|
-
|
|
3786
|
+
ve && /* @__PURE__ */ p(_, {
|
|
3740
3787
|
mt: "md",
|
|
3741
3788
|
variant: "light",
|
|
3742
3789
|
color: "red",
|
|
3743
3790
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3744
|
-
icon: /* @__PURE__ */ p(
|
|
3791
|
+
icon: /* @__PURE__ */ p(Ce, {}),
|
|
3745
3792
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3746
3793
|
}),
|
|
3747
|
-
(
|
|
3794
|
+
(_e || xe) && /* @__PURE__ */ m(z, {
|
|
3748
3795
|
my: "md",
|
|
3749
3796
|
children: [/* @__PURE__ */ p(te, { height: 40 }), [
|
|
3750
3797
|
,
|
|
@@ -3754,121 +3801,130 @@ function Nr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3754
3801
|
,
|
|
3755
3802
|
].fill(0).map((e, t) => /* @__PURE__ */ p(te, { height: 35 }, `skeleton-${t}`))]
|
|
3756
3803
|
}),
|
|
3757
|
-
!
|
|
3758
|
-
...
|
|
3759
|
-
children: /* @__PURE__ */ p(
|
|
3804
|
+
!_e && !xe && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3805
|
+
...R ? { visibleFrom: "sm" } : {},
|
|
3806
|
+
children: /* @__PURE__ */ p(Nr, {
|
|
3760
3807
|
my: "md",
|
|
3761
3808
|
striped: !0,
|
|
3762
3809
|
highlightOnHover: !0,
|
|
3763
3810
|
minHeight: 150,
|
|
3764
|
-
fetching:
|
|
3765
|
-
records:
|
|
3766
|
-
sortStatus:
|
|
3767
|
-
onSortStatusChange:
|
|
3811
|
+
fetching: ve,
|
|
3812
|
+
records: Fe,
|
|
3813
|
+
sortStatus: ke,
|
|
3814
|
+
onSortStatusChange: je,
|
|
3768
3815
|
...l && {
|
|
3769
|
-
selectedRecords:
|
|
3770
|
-
onSelectedRecordsChange:
|
|
3816
|
+
selectedRecords: W,
|
|
3817
|
+
onSelectedRecordsChange: G
|
|
3771
3818
|
},
|
|
3772
|
-
...u &&
|
|
3819
|
+
...u && Fe.length && {
|
|
3773
3820
|
totalRecords: H.length,
|
|
3774
|
-
recordsPerPage:
|
|
3775
|
-
onPageChange:
|
|
3776
|
-
page:
|
|
3777
|
-
recordsPerPageOptions:
|
|
3778
|
-
onRecordsPerPageChange:
|
|
3821
|
+
recordsPerPage: Me,
|
|
3822
|
+
onPageChange: Pe,
|
|
3823
|
+
page: U,
|
|
3824
|
+
recordsPerPageOptions: Qr,
|
|
3825
|
+
onRecordsPerPageChange: Ne,
|
|
3779
3826
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3780
3827
|
},
|
|
3781
3828
|
...I && { rowExpansion: {
|
|
3782
3829
|
allowMultiple: I.allowMultiple ?? !1,
|
|
3830
|
+
trigger: L ? "never" : "click",
|
|
3783
3831
|
content: ({ record: e }) => I.content(e, !1),
|
|
3784
|
-
|
|
3832
|
+
expanded: {
|
|
3833
|
+
recordIds: Re,
|
|
3834
|
+
onRecordIdsChange: ze
|
|
3835
|
+
},
|
|
3836
|
+
...I.expandable && { expandable: ({ record: e }) => I.expandable(e) }
|
|
3785
3837
|
} },
|
|
3786
|
-
columns:
|
|
3838
|
+
columns: He.map((e) => e.column),
|
|
3787
3839
|
noRecordsText: "Keine Einträge gefunden",
|
|
3788
|
-
onRowClick:
|
|
3789
|
-
...
|
|
3840
|
+
onRowClick: L,
|
|
3841
|
+
...L && { style: { cursor: "pointer" } }
|
|
3790
3842
|
})
|
|
3791
|
-
}),
|
|
3843
|
+
}), R && /* @__PURE__ */ p(v, {
|
|
3792
3844
|
hiddenFrom: "sm",
|
|
3793
|
-
children: /* @__PURE__ */ p(
|
|
3794
|
-
records:
|
|
3795
|
-
fields:
|
|
3796
|
-
onRowClick:
|
|
3845
|
+
children: /* @__PURE__ */ p(Zr, {
|
|
3846
|
+
records: Fe,
|
|
3847
|
+
fields: He,
|
|
3848
|
+
onRowClick: L,
|
|
3797
3849
|
sort: {
|
|
3798
|
-
field: String(
|
|
3799
|
-
direction:
|
|
3850
|
+
field: String(ke.columnAccessor),
|
|
3851
|
+
direction: ke.direction,
|
|
3800
3852
|
onSortChange: (e, t) => {
|
|
3801
|
-
|
|
3853
|
+
je({
|
|
3802
3854
|
columnAccessor: e,
|
|
3803
3855
|
direction: t
|
|
3804
3856
|
});
|
|
3805
3857
|
}
|
|
3806
3858
|
},
|
|
3807
|
-
...u &&
|
|
3859
|
+
...u && Fe.length && { pagination: {
|
|
3808
3860
|
totalRecords: H.length,
|
|
3809
|
-
recordsPerPage:
|
|
3810
|
-
page:
|
|
3811
|
-
onPageChange:
|
|
3812
|
-
recordsPerPageOptions:
|
|
3861
|
+
recordsPerPage: Me,
|
|
3862
|
+
page: U,
|
|
3863
|
+
onPageChange: Pe,
|
|
3864
|
+
recordsPerPageOptions: Qr,
|
|
3813
3865
|
onRecordsPerPageChange: (e) => {
|
|
3814
|
-
|
|
3866
|
+
Ne(e), Pe(1);
|
|
3815
3867
|
}
|
|
3816
3868
|
} },
|
|
3817
3869
|
...I && { rowExpansion: {
|
|
3818
3870
|
content: I.content,
|
|
3819
|
-
|
|
3871
|
+
expanded: {
|
|
3872
|
+
recordIds: Re,
|
|
3873
|
+
onRecordIdsChange: ze
|
|
3874
|
+
},
|
|
3875
|
+
...I.expandable && { expandable: I.expandable }
|
|
3820
3876
|
} },
|
|
3821
|
-
...
|
|
3822
|
-
actions:
|
|
3823
|
-
canUpdate:
|
|
3824
|
-
canDelete:
|
|
3877
|
+
...Ze.length > 0 && {
|
|
3878
|
+
actions: Ze,
|
|
3879
|
+
canUpdate: P,
|
|
3880
|
+
canDelete: F
|
|
3825
3881
|
}
|
|
3826
3882
|
})
|
|
3827
3883
|
})] }),
|
|
3828
3884
|
/* @__PURE__ */ p(M, {
|
|
3829
|
-
opened:
|
|
3885
|
+
opened: Ge,
|
|
3830
3886
|
onClose: () => {
|
|
3831
|
-
|
|
3887
|
+
Ke(!1), G([]);
|
|
3832
3888
|
},
|
|
3833
3889
|
title: e ?? "Bearbeiten",
|
|
3834
|
-
children:
|
|
3890
|
+
children: W.length > 0 && /* @__PURE__ */ p(Pr, {
|
|
3835
3891
|
fields: c.filter((e) => e.update),
|
|
3836
3892
|
queryKey: t,
|
|
3837
|
-
apiPath:
|
|
3838
|
-
id:
|
|
3893
|
+
apiPath: pe,
|
|
3894
|
+
id: W[0].id,
|
|
3839
3895
|
onClose: () => {
|
|
3840
|
-
|
|
3896
|
+
Ke(!1), G([]);
|
|
3841
3897
|
},
|
|
3842
3898
|
steps: x
|
|
3843
3899
|
})
|
|
3844
3900
|
}),
|
|
3845
|
-
|
|
3846
|
-
opened:
|
|
3901
|
+
W.length > 0 && /* @__PURE__ */ p(M, {
|
|
3902
|
+
opened: qe,
|
|
3847
3903
|
onClose: () => {
|
|
3848
|
-
|
|
3904
|
+
Je(!1), G([]);
|
|
3849
3905
|
},
|
|
3850
3906
|
title: e ?? "Löschen",
|
|
3851
|
-
children: /* @__PURE__ */ p(
|
|
3907
|
+
children: /* @__PURE__ */ p(Fr, {
|
|
3852
3908
|
onClose: () => {
|
|
3853
|
-
|
|
3909
|
+
Je(!1), G([]);
|
|
3854
3910
|
},
|
|
3855
3911
|
queryKey: t,
|
|
3856
|
-
apiPath:
|
|
3857
|
-
selectedRecords:
|
|
3858
|
-
confirmMessage:
|
|
3912
|
+
apiPath: pe,
|
|
3913
|
+
selectedRecords: W,
|
|
3914
|
+
confirmMessage: ne
|
|
3859
3915
|
})
|
|
3860
3916
|
}),
|
|
3861
3917
|
/* @__PURE__ */ p(M, {
|
|
3862
|
-
opened:
|
|
3918
|
+
opened: Ue,
|
|
3863
3919
|
onClose: () => {
|
|
3864
|
-
|
|
3920
|
+
We(!1);
|
|
3865
3921
|
},
|
|
3866
3922
|
title: e ?? "Anlegen",
|
|
3867
|
-
children: /* @__PURE__ */ p(
|
|
3923
|
+
children: /* @__PURE__ */ p(rn, {
|
|
3868
3924
|
queryKey: t,
|
|
3869
|
-
apiPath:
|
|
3925
|
+
apiPath: pe,
|
|
3870
3926
|
onClose: () => {
|
|
3871
|
-
|
|
3927
|
+
We(!1);
|
|
3872
3928
|
},
|
|
3873
3929
|
fields: c.filter((e) => e.create),
|
|
3874
3930
|
steps: x
|
|
@@ -3877,11 +3933,24 @@ function Nr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3877
3933
|
] });
|
|
3878
3934
|
}
|
|
3879
3935
|
//#endregion
|
|
3880
|
-
//#region src/DataTable/
|
|
3881
|
-
function
|
|
3882
|
-
return /* @__PURE__ */ p(
|
|
3936
|
+
//#region src/DataTable/SubTable.tsx
|
|
3937
|
+
function ei({ mobile: e, columns: t, ...n }) {
|
|
3938
|
+
return e ? /* @__PURE__ */ p(z, {
|
|
3939
|
+
gap: "sm",
|
|
3940
|
+
style: { fontVariantNumeric: "tabular-nums" },
|
|
3941
|
+
children: (n.records ?? []).map((e, r) => {
|
|
3942
|
+
let i = t.filter((t) => !t.hidden && !t.hideOnMobile?.(e)).map((t) => ({
|
|
3943
|
+
label: t.title ?? In(String(t.accessor)),
|
|
3944
|
+
value: t.render ? t.render(e, r) : zn(e, t.accessor)
|
|
3945
|
+
})), a = n.idAccessor ? $(e, n.idAccessor) : r;
|
|
3946
|
+
return /* @__PURE__ */ p(Jr, { rows: i }, a);
|
|
3947
|
+
})
|
|
3948
|
+
}) : /* @__PURE__ */ p(Nr, {
|
|
3949
|
+
columns: t,
|
|
3950
|
+
...n
|
|
3951
|
+
});
|
|
3883
3952
|
}
|
|
3884
3953
|
//#endregion
|
|
3885
|
-
export {
|
|
3954
|
+
export { rn as CreateModal, $r as DataTable, Mt as DataTableProvider, Fr as DeleteModal, Jr as FieldCard, Zr as MobileCardList, ei as SubTable, Pr as UpdateModal, Vt as api, Bt as createOne, zt as deleteOne, Lt as getAll, Rt as getOne, Ft as parseApiError, Br as sortData, Ht as updateOne, Gt as useAddOne, J as useDataTable, qt as useDeleteOne, Wt as useGetAll, Ut as useGetOne, Ir as usePersistentState, Kt as useUpdateOne };
|
|
3886
3955
|
|
|
3887
3956
|
//# sourceMappingURL=index.es.js.map
|