@espresso-lab/mantine-data-table 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTable.d.ts +3 -1
- package/dist/index.es.js +515 -493
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import t, { Fragment as n, createContext as r, createElement as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
-
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as ee, Popover as P, PopoverDropdown as
|
|
5
|
-
import { DateInput as
|
|
6
|
-
import { useForm as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { Accordion as h, ActionIcon as g, Alert as _, Box as v, Button as y, Center as b, Checkbox as x, Collapse as S, Divider as C, Flex as w, Group as T, Indicator as E, Loader as D, Menu as O, MenuDropdown as k, MenuItem as A, MenuTarget as j, Modal as M, NumberInput as N, Pagination as ee, Popover as P, PopoverDropdown as te, PopoverTarget as ne, ScrollArea as F, Select as I, Skeleton as re, Stack as L, Stepper as R, Table as ie, TableTd as ae, TableTfoot as oe, TableTh as z, 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 Me, useMergedRef as Ne, useTimeout as Pe } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
|
-
var
|
|
10
|
+
var H = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ var U = class {
|
|
|
21
21
|
}
|
|
22
22
|
onSubscribe() {}
|
|
23
23
|
onUnsubscribe() {}
|
|
24
|
-
},
|
|
24
|
+
}, Fe = new class extends H {
|
|
25
25
|
#e;
|
|
26
26
|
#t;
|
|
27
27
|
#n;
|
|
@@ -58,13 +58,13 @@ var U = class {
|
|
|
58
58
|
isFocused() {
|
|
59
59
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
60
60
|
}
|
|
61
|
-
}(),
|
|
61
|
+
}(), Ie = {
|
|
62
62
|
setTimeout: (e, t) => setTimeout(e, t),
|
|
63
63
|
clearTimeout: (e) => clearTimeout(e),
|
|
64
64
|
setInterval: (e, t) => setInterval(e, t),
|
|
65
65
|
clearInterval: (e) => clearInterval(e)
|
|
66
|
-
},
|
|
67
|
-
#e =
|
|
66
|
+
}, U = new class {
|
|
67
|
+
#e = Ie;
|
|
68
68
|
#t = !1;
|
|
69
69
|
setTimeoutProvider(e) {
|
|
70
70
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
|
|
@@ -104,67 +104,67 @@ function He(e, t) {
|
|
|
104
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 Ue(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => G(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var We = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Ge(e, t, n = 0) {
|
|
112
112
|
if (e === t) return e;
|
|
113
113
|
if (n > 500) return t;
|
|
114
|
-
let r =
|
|
115
|
-
if (!r && !(
|
|
114
|
+
let r = qe(e) && qe(t);
|
|
115
|
+
if (!r && !(G(e) && G(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 : We.call(e, o)) && c++;
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
if (u === null || d === null || typeof u != "object" || typeof d != "object") {
|
|
124
124
|
s[o] = d;
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
let f =
|
|
127
|
+
let f = Ge(u, d, n + 1);
|
|
128
128
|
s[o] = f, f === u && c++;
|
|
129
129
|
}
|
|
130
130
|
return i === o && c === i ? e : s;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Ke(e, t) {
|
|
133
133
|
if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
134
134
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
135
135
|
return !0;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function qe(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function G(e) {
|
|
141
|
+
if (!K(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 !(!K(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function K(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Je(e, t, n) {
|
|
151
151
|
if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
|
|
152
152
|
if (n.structuralSharing !== !1) {
|
|
153
153
|
if (process.env.NODE_ENV !== "production") try {
|
|
154
|
-
return
|
|
154
|
+
return Ge(e, t);
|
|
155
155
|
} catch (e) {
|
|
156
156
|
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return Ge(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Ye(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
|
|
167
|
+
var Xe = /* @__PURE__ */ (() => {
|
|
168
168
|
let e = () => Re;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
@@ -177,7 +177,7 @@ var Ze = /* @__PURE__ */ (() => {
|
|
|
177
177
|
})();
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
-
function
|
|
180
|
+
function Ze() {
|
|
181
181
|
let e, t, n = new Promise((n, r) => {
|
|
182
182
|
e = n, t = r;
|
|
183
183
|
});
|
|
@@ -199,13 +199,13 @@ function Qe() {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var Qe = Le;
|
|
203
|
+
function $e() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
206
206
|
}, r = (e) => {
|
|
207
207
|
e();
|
|
208
|
-
}, i =
|
|
208
|
+
}, i = Qe, a = (r) => {
|
|
209
209
|
t ? e.push(r) : i(() => {
|
|
210
210
|
n(r);
|
|
211
211
|
});
|
|
@@ -247,7 +247,7 @@ function et() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var et = $e(), tt = new class extends H {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -281,16 +281,16 @@ var tt = et(), nt = new class extends U {
|
|
|
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 nt(e) {
|
|
285
|
+
return (e ?? "online") === "online" ? tt.isOnline() : !0;
|
|
286
286
|
}
|
|
287
287
|
//#endregion
|
|
288
288
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
289
|
+
function rt(e, t) {
|
|
290
290
|
return {
|
|
291
291
|
fetchFailureCount: 0,
|
|
292
292
|
fetchFailureReason: null,
|
|
293
|
-
fetchStatus:
|
|
293
|
+
fetchStatus: nt(t.networkMode) ? "fetching" : "paused",
|
|
294
294
|
...e === void 0 && {
|
|
295
295
|
error: null,
|
|
296
296
|
status: "pending"
|
|
@@ -299,9 +299,9 @@ function it(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
302
|
+
var it = class extends H {
|
|
303
303
|
constructor(e, t) {
|
|
304
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
304
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Ze(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
306
306
|
#e;
|
|
307
307
|
#t = void 0;
|
|
@@ -322,16 +322,16 @@ var at = class extends U {
|
|
|
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), ot(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 st(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
332
|
}
|
|
333
333
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
334
|
+
return st(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
335
335
|
}
|
|
336
336
|
destroy() {
|
|
337
337
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
@@ -339,19 +339,19 @@ var at = class extends U {
|
|
|
339
339
|
setOptions(e) {
|
|
340
340
|
let t = this.options, n = this.#t;
|
|
341
341
|
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof W(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !Ke(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 && ct(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
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 ut(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;
|
|
@@ -386,9 +386,9 @@ var at = class extends U {
|
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
388
|
let e = He(this.options.staleTime, this.#t);
|
|
389
|
-
if (
|
|
389
|
+
if (Xe.isServer() || this.#r.isStale || !Be(e)) return;
|
|
390
390
|
let t = Ve(this.#r.dataUpdatedAt, e) + 1;
|
|
391
|
-
this.#d =
|
|
391
|
+
this.#d = U.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
394
394
|
}
|
|
@@ -396,26 +396,26 @@ var at = class extends U {
|
|
|
396
396
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
397
397
|
}
|
|
398
398
|
#v(e) {
|
|
399
|
-
this.#x(), this.#p = e, !(
|
|
400
|
-
(this.options.refetchIntervalInBackground ||
|
|
399
|
+
this.#x(), this.#p = e, !(Xe.isServer() || W(this.options.enabled, this.#t) === !1 || !Be(this.#p) || this.#p === 0) && (this.#f = U.setInterval(() => {
|
|
400
|
+
(this.options.refetchIntervalInBackground || Fe.isFocused()) && this.#h();
|
|
401
401
|
}, this.#p));
|
|
402
402
|
}
|
|
403
403
|
#y() {
|
|
404
404
|
this.#g(), this.#v(this.#_());
|
|
405
405
|
}
|
|
406
406
|
#b() {
|
|
407
|
-
this.#d !== void 0 && (
|
|
407
|
+
this.#d !== void 0 && (U.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f !== void 0 && (
|
|
410
|
+
this.#f !== void 0 && (U.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 && ot(e, t), o = i && ct(e, n, t, r);
|
|
416
416
|
(a || o) && (l = {
|
|
417
417
|
...l,
|
|
418
|
-
...
|
|
418
|
+
...rt(c.data, e.options)
|
|
419
419
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
420
420
|
}
|
|
421
421
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -423,11 +423,11 @@ var at = class extends U {
|
|
|
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 = Je(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 = Je(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
431
|
} catch (e) {
|
|
432
432
|
this.#s = e;
|
|
433
433
|
}
|
|
@@ -455,7 +455,7 @@ var at = class extends U {
|
|
|
455
455
|
isPaused: l.fetchStatus === "paused",
|
|
456
456
|
isPlaceholderData: u,
|
|
457
457
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
458
|
+
isStale: lt(e, t),
|
|
459
459
|
refetch: this.refetch,
|
|
460
460
|
promise: this.#o,
|
|
461
461
|
isEnabled: W(t.enabled, e) !== !1
|
|
@@ -464,7 +464,7 @@ var at = class extends U {
|
|
|
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 = Ze());
|
|
468
468
|
}, o = this.#o;
|
|
469
469
|
switch (o.status) {
|
|
470
470
|
case "pending":
|
|
@@ -482,7 +482,7 @@ var at = class extends U {
|
|
|
482
482
|
}
|
|
483
483
|
updateResult() {
|
|
484
484
|
let e = this.#r, t = this.createResult(this.#t, this.options);
|
|
485
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !
|
|
485
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !Ke(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 at = class extends U {
|
|
|
503
503
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
504
504
|
}
|
|
505
505
|
#C(e) {
|
|
506
|
-
|
|
506
|
+
et.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 at = class extends U {
|
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
|
-
function
|
|
516
|
+
function at(e, t) {
|
|
517
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 ot(e, t) {
|
|
520
|
+
return at(e, t) || e.state.data !== void 0 && st(e, t, t.refetchOnMount);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function st(e, t, n) {
|
|
523
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 && lt(e, t);
|
|
526
526
|
}
|
|
527
527
|
return !1;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") &&
|
|
529
|
+
function ct(e, t, n, r) {
|
|
530
|
+
return (e !== t || W(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && lt(e, n);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function lt(e, t) {
|
|
533
533
|
return W(t.enabled, e) !== !1 && e.isStaleByTime(He(t.staleTime, e));
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
return !
|
|
535
|
+
function ut(e, t) {
|
|
536
|
+
return !Ke(e.getCurrentResult(), t);
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
540
|
-
function
|
|
540
|
+
function q() {
|
|
541
541
|
return {
|
|
542
542
|
context: void 0,
|
|
543
543
|
data: void 0,
|
|
@@ -552,7 +552,7 @@ function K() {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var
|
|
555
|
+
var dt = class extends H {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var ft = class extends U {
|
|
|
565
565
|
}
|
|
566
566
|
setOptions(e) {
|
|
567
567
|
let t = this.options;
|
|
568
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
568
|
+
this.options = this.#e.defaultMutationOptions(e), Ke(this.options, t) || this.#e.getMutationCache().notify({
|
|
569
569
|
type: "observerOptionsUpdated",
|
|
570
570
|
mutation: this.#n,
|
|
571
571
|
observer: this
|
|
572
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
572
|
+
}), t?.mutationKey && this.options.mutationKey && Ue(t.mutationKey) !== Ue(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
573
573
|
}
|
|
574
574
|
onUnsubscribe() {
|
|
575
575
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -587,7 +587,7 @@ var ft = class extends U {
|
|
|
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 ?? q();
|
|
591
591
|
this.#t = {
|
|
592
592
|
...e,
|
|
593
593
|
isPending: e.status === "pending",
|
|
@@ -599,7 +599,7 @@ var ft = class extends U {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
#a(e) {
|
|
602
|
-
|
|
602
|
+
et.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 ft = class extends U {
|
|
|
635
635
|
});
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
},
|
|
639
|
-
let n = e.useContext(
|
|
638
|
+
}, J = e.createContext(void 0), ft = (t) => {
|
|
639
|
+
let n = e.useContext(J);
|
|
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
|
+
}, pt = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
644
644
|
t.unmount();
|
|
645
|
-
}), [t]), /* @__PURE__ */ p(
|
|
645
|
+
}), [t]), /* @__PURE__ */ p(J.Provider, {
|
|
646
646
|
value: t,
|
|
647
647
|
children: n
|
|
648
|
-
})),
|
|
649
|
-
|
|
648
|
+
})), mt = e.createContext(!1), ht = () => e.useContext(mt);
|
|
649
|
+
mt.Provider;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
652
|
-
function
|
|
652
|
+
function gt() {
|
|
653
653
|
let e = !1;
|
|
654
654
|
return {
|
|
655
655
|
clearReset: () => {
|
|
@@ -661,65 +661,65 @@ function _t() {
|
|
|
661
661
|
isReset: () => e
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
|
-
var
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
664
|
+
var _t = e.createContext(gt()), vt = () => e.useContext(_t), yt = (e, t, n) => {
|
|
665
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? Ye(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
666
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
|
-
},
|
|
667
|
+
}, bt = (t) => {
|
|
668
668
|
e.useEffect(() => {
|
|
669
669
|
t.clearReset();
|
|
670
670
|
}, [t]);
|
|
671
|
-
},
|
|
671
|
+
}, xt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Ye(n, [e.error, r])), St = (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
|
+
}, Ct = (e, t) => e.isLoading && e.isFetching && !t, wt = (e, t) => e?.suspense && t.isPending, Tt = (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 Et(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 = ht(), a = vt(), o = ft(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, St(s), yt(s, a, c), bt(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(et.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]), wt(s, f)) throw Tt(s, d, a);
|
|
696
|
+
if (xt({
|
|
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 && !Xe.isServer() && Ct(f, i) && (u ? Tt(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 Dt(e, t) {
|
|
710
|
+
return Et(e, it, 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 Ot(t, n) {
|
|
715
|
+
let r = ft(n), [i] = e.useState(() => new dt(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(
|
|
719
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(et.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
720
720
|
i.mutate(e, t).catch(ze);
|
|
721
721
|
}, [i]);
|
|
722
|
-
if (a.error &&
|
|
722
|
+
if (a.error && Ye(i.options.throwOnError, [a.error])) throw a.error;
|
|
723
723
|
return {
|
|
724
724
|
...a,
|
|
725
725
|
mutate: o,
|
|
@@ -728,15 +728,15 @@ function kt(t, n) {
|
|
|
728
728
|
}
|
|
729
729
|
//#endregion
|
|
730
730
|
//#region src/Context/DataTableContext.tsx
|
|
731
|
-
var
|
|
732
|
-
function
|
|
733
|
-
return /* @__PURE__ */ p(
|
|
731
|
+
var kt = r(void 0), At = async () => ({ "Content-Type": "application/json" });
|
|
732
|
+
function jt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = At }) {
|
|
733
|
+
return /* @__PURE__ */ p(kt.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(pt, {
|
|
740
740
|
client: n,
|
|
741
741
|
children: e
|
|
742
742
|
})
|
|
@@ -744,63 +744,63 @@ function Mt({ children: e, baseUrl: t, queryClient: n, getHeaders: r = jt }) {
|
|
|
744
744
|
}
|
|
745
745
|
//#endregion
|
|
746
746
|
//#region src/Hooks/useDataTable.ts
|
|
747
|
-
function
|
|
748
|
-
let e = o(
|
|
747
|
+
function Y() {
|
|
748
|
+
let e = o(kt);
|
|
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
|
-
var
|
|
754
|
+
var Mt = class extends Error {
|
|
755
755
|
status;
|
|
756
756
|
violations;
|
|
757
757
|
constructor(e, t, n) {
|
|
758
758
|
super(e), this.name = "ApiError", this.status = t, this.violations = n;
|
|
759
759
|
}
|
|
760
760
|
};
|
|
761
|
-
function
|
|
762
|
-
return e instanceof
|
|
761
|
+
function Nt(e) {
|
|
762
|
+
return e instanceof Mt ? e.violations : void 0;
|
|
763
763
|
}
|
|
764
|
-
async function
|
|
764
|
+
async function Pt(e, t) {
|
|
765
765
|
let n = await fetch(e, t);
|
|
766
766
|
if (n.status >= 400) {
|
|
767
767
|
let e = await n.text();
|
|
768
|
-
if (!e) throw new
|
|
768
|
+
if (!e) throw new Mt(`HTTP ${n.status}: ${n.statusText}`, n.status);
|
|
769
769
|
let t = null;
|
|
770
770
|
try {
|
|
771
771
|
t = JSON.parse(e);
|
|
772
772
|
} catch {
|
|
773
|
-
throw new
|
|
773
|
+
throw new Mt(e, n.status);
|
|
774
774
|
}
|
|
775
775
|
let r = Array.isArray(t?.violations) ? t.violations.filter((e) => e?.field && e?.message).map((e) => ({
|
|
776
776
|
field: String(e.field),
|
|
777
777
|
message: String(e.message)
|
|
778
778
|
})) : void 0;
|
|
779
|
-
throw new
|
|
779
|
+
throw new Mt(t?.message ?? t?.error ?? t?.title ?? e, n.status, r);
|
|
780
780
|
}
|
|
781
781
|
return n;
|
|
782
782
|
}
|
|
783
783
|
var Ft = (e) => e.map((e) => e.toString());
|
|
784
784
|
async function It(e, t) {
|
|
785
|
-
return (await
|
|
785
|
+
return (await Pt(e, {
|
|
786
786
|
method: "GET",
|
|
787
787
|
headers: await t()
|
|
788
788
|
})).json();
|
|
789
789
|
}
|
|
790
790
|
async function Lt(e, t, n) {
|
|
791
|
-
return (await
|
|
791
|
+
return (await Pt(`${e}/${t}`, {
|
|
792
792
|
method: "GET",
|
|
793
793
|
headers: await n()
|
|
794
794
|
})).json();
|
|
795
795
|
}
|
|
796
796
|
async function Rt(e, t, n) {
|
|
797
|
-
await
|
|
797
|
+
await Pt(`${e}/${t}`, {
|
|
798
798
|
method: "DELETE",
|
|
799
799
|
headers: await n()
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
802
|
async function zt(e, t, n) {
|
|
803
|
-
let r = await
|
|
803
|
+
let r = await Pt(e, {
|
|
804
804
|
method: "POST",
|
|
805
805
|
headers: await n(),
|
|
806
806
|
body: JSON.stringify(t)
|
|
@@ -808,7 +808,7 @@ async function zt(e, t, n) {
|
|
|
808
808
|
return r.status === 204 ? t : r.json();
|
|
809
809
|
}
|
|
810
810
|
async function Bt(e, t, n, r) {
|
|
811
|
-
let i = await
|
|
811
|
+
let i = await Pt(t, {
|
|
812
812
|
method: e,
|
|
813
813
|
headers: await n(),
|
|
814
814
|
body: r ? JSON.stringify(r) : void 0
|
|
@@ -816,7 +816,7 @@ async function Bt(e, t, n, r) {
|
|
|
816
816
|
if (i.status !== 204) return i.json();
|
|
817
817
|
}
|
|
818
818
|
async function Vt(e, t, n) {
|
|
819
|
-
let r = await
|
|
819
|
+
let r = await Pt(`${e}/${t.id}`, {
|
|
820
820
|
method: "PUT",
|
|
821
821
|
headers: await n(),
|
|
822
822
|
body: JSON.stringify(t)
|
|
@@ -824,16 +824,16 @@ async function Vt(e, t, n) {
|
|
|
824
824
|
return r.status === 204 ? t : r.json();
|
|
825
825
|
}
|
|
826
826
|
function Ht(e, t, n) {
|
|
827
|
-
let { baseUrl: r, getHeaders: i } =
|
|
828
|
-
return
|
|
827
|
+
let { baseUrl: r, getHeaders: i } = Y();
|
|
828
|
+
return Dt({
|
|
829
829
|
queryKey: [...Ft(t), String(n?.toString())],
|
|
830
830
|
queryFn: () => Lt(`${r}${e}`, n, i),
|
|
831
831
|
enabled: !!n
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
function Ut(e, t, n = !0) {
|
|
835
|
-
let { baseUrl: r, getHeaders: i } =
|
|
836
|
-
return
|
|
835
|
+
let { baseUrl: r, getHeaders: i } = Y();
|
|
836
|
+
return Dt({
|
|
837
837
|
queryKey: Ft(t),
|
|
838
838
|
queryFn: () => It(`${r}${e}`, i),
|
|
839
839
|
enabled: n
|
|
@@ -843,24 +843,24 @@ function Wt(e, t, n) {
|
|
|
843
843
|
return Promise.all([e.invalidateQueries({ queryKey: Ft(t) }), ...(n ?? []).map((t) => e.invalidateQueries({ queryKey: t }))]);
|
|
844
844
|
}
|
|
845
845
|
function Gt(e, t, n) {
|
|
846
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } =
|
|
847
|
-
return
|
|
846
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = Y();
|
|
847
|
+
return Ot({
|
|
848
848
|
mutationKey: Ft(t),
|
|
849
849
|
mutationFn: (t) => zt(`${r}${e}`, t, a),
|
|
850
850
|
onSettled: () => Wt(i, t, n)
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
853
|
function Kt(e, t, n) {
|
|
854
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } =
|
|
855
|
-
return
|
|
854
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = Y();
|
|
855
|
+
return Ot({
|
|
856
856
|
mutationKey: Ft(t),
|
|
857
857
|
mutationFn: (t) => Vt(`${r}${e}`, t, a),
|
|
858
858
|
onSettled: () => Wt(i, t, n)
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
861
|
function qt(e, t, n) {
|
|
862
|
-
let { baseUrl: r, queryClient: i, getHeaders: a } =
|
|
863
|
-
return
|
|
862
|
+
let { baseUrl: r, queryClient: i, getHeaders: a } = Y();
|
|
863
|
+
return Ot({
|
|
864
864
|
mutationKey: Ft(t),
|
|
865
865
|
mutationFn: (t) => Rt(`${r}${e}`, t, a),
|
|
866
866
|
onSettled: () => Wt(i, t, n)
|
|
@@ -889,16 +889,16 @@ function Qt(e, t) {
|
|
|
889
889
|
}
|
|
890
890
|
var $t = (e) => e.split(".").pop() ?? e;
|
|
891
891
|
function en(e, t) {
|
|
892
|
-
return Object.fromEntries((
|
|
892
|
+
return Object.fromEntries((Nt(e) ?? []).filter((e) => t.has($t(e.field))).map((e) => [$t(e.field), e.message]));
|
|
893
893
|
}
|
|
894
894
|
function tn(e, t) {
|
|
895
|
-
let n =
|
|
895
|
+
let n = Nt(e);
|
|
896
896
|
if (!n) return e?.message;
|
|
897
897
|
let r = n.filter((e) => !t.has($t(e.field)));
|
|
898
898
|
return r.length > 0 ? r.map((e) => e.message).join(", ") : void 0;
|
|
899
899
|
}
|
|
900
900
|
function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error: o, onPersist: c, onClose: l }) {
|
|
901
|
-
let [u, h] = d(0), [g, v] = d(!1), b =
|
|
901
|
+
let [u, h] = d(0), [g, v] = d(!1), b = ve({
|
|
902
902
|
mode: "uncontrolled",
|
|
903
903
|
initialValues: Yt(e),
|
|
904
904
|
validate: Xt(e)
|
|
@@ -923,7 +923,7 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
923
923
|
required: n,
|
|
924
924
|
...r
|
|
925
925
|
}, b.key(e.id));
|
|
926
|
-
case "date": return /* @__PURE__ */ p(
|
|
926
|
+
case "date": return /* @__PURE__ */ p(_e, {
|
|
927
927
|
valueFormat: "DD.MM.YYYY",
|
|
928
928
|
clearable: !0,
|
|
929
929
|
label: e.column.title,
|
|
@@ -937,7 +937,7 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
937
937
|
required: n,
|
|
938
938
|
...b.getInputProps(e.id, { type: "checkbox" })
|
|
939
939
|
}, b.key(e.id));
|
|
940
|
-
case "textarea": return /* @__PURE__ */ p(
|
|
940
|
+
case "textarea": return /* @__PURE__ */ p(de, {
|
|
941
941
|
minRows: 3,
|
|
942
942
|
autosize: !0,
|
|
943
943
|
label: e.column.title,
|
|
@@ -952,7 +952,7 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
952
952
|
error: r.error,
|
|
953
953
|
required: n
|
|
954
954
|
});
|
|
955
|
-
default: return /* @__PURE__ */ p(
|
|
955
|
+
default: return /* @__PURE__ */ p(ue, {
|
|
956
956
|
type: e.id.includes("email") ? "email" : void 0,
|
|
957
957
|
label: e.column.title,
|
|
958
958
|
placeholder: e.placeholder ?? "",
|
|
@@ -980,10 +980,10 @@ function nn({ fields: e, steps: t, record: r, recordId: i, submitting: a, error:
|
|
|
980
980
|
}
|
|
981
981
|
E && !D ? h((e) => e + 1) : (b.setInitialValues(t), b.reset(), l());
|
|
982
982
|
}),
|
|
983
|
-
children: [E ? /* @__PURE__ */ p(
|
|
983
|
+
children: [E ? /* @__PURE__ */ p(R, {
|
|
984
984
|
active: u,
|
|
985
985
|
size: "sm",
|
|
986
|
-
children: w.map((e) => /* @__PURE__ */ p(
|
|
986
|
+
children: w.map((e) => /* @__PURE__ */ p(R.Step, {
|
|
987
987
|
...t?.[e - 1] ? { label: t[e - 1].label } : {},
|
|
988
988
|
children: k(e)
|
|
989
989
|
}, e))
|
|
@@ -1043,7 +1043,7 @@ function X() {
|
|
|
1043
1043
|
//#endregion
|
|
1044
1044
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
1045
1045
|
function Z(e, t, n) {
|
|
1046
|
-
return e ?
|
|
1046
|
+
return e ? me({
|
|
1047
1047
|
color: typeof e == "object" ? e[n] : e,
|
|
1048
1048
|
theme: t
|
|
1049
1049
|
}).value : void 0;
|
|
@@ -1080,7 +1080,7 @@ function cn({ theme: e, color: t, backgroundColor: n }) {
|
|
|
1080
1080
|
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
var [ln, un] =
|
|
1083
|
+
var [ln, un] = pe("useDataTableColumnsContext must be used within DataTableColumnProvider"), dn = (e) => {
|
|
1084
1084
|
let { children: t, columnsOrder: n, setColumnsOrder: r, columnsToggle: i, setColumnsToggle: a, columnsPinning: o, setColumnsPinning: s, resetColumnsOrder: c, resetColumnsToggle: l, resetColumnsPinning: u, setColumnWidth: f, setMultipleColumnWidths: m, resetColumnsWidth: h, beginResize: g, endResize: _, pinnedMap: v } = e, [y, b] = d(""), [x, S] = d("");
|
|
1085
1085
|
return p(ln, {
|
|
1086
1086
|
value: {
|
|
@@ -1150,7 +1150,7 @@ function mn({ icon: e, text: t, active: n, children: r }) {
|
|
|
1150
1150
|
children: r || m(f, { children: [e || p("div", {
|
|
1151
1151
|
className: "mantine-datatable-empty-state-icon",
|
|
1152
1152
|
children: p(pn, {})
|
|
1153
|
-
}), p(
|
|
1153
|
+
}), p(B, {
|
|
1154
1154
|
component: "div",
|
|
1155
1155
|
size: "sm",
|
|
1156
1156
|
c: "dimmed",
|
|
@@ -1206,7 +1206,7 @@ function En({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1206
1206
|
defaultPinned: e.pinned,
|
|
1207
1207
|
pinnable: !!e.pinnable,
|
|
1208
1208
|
pinned: e.pinned
|
|
1209
|
-
})), [t]), [i, a] =
|
|
1209
|
+
})), [t]), [i, a] = je({
|
|
1210
1210
|
key: e ? `${e}-columns-pinning` : "",
|
|
1211
1211
|
defaultValue: e ? r : void 0,
|
|
1212
1212
|
getInitialValueInEffect: n
|
|
@@ -1254,7 +1254,7 @@ function En({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
1256
|
function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1257
|
-
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] =
|
|
1257
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = je({
|
|
1258
1258
|
key: e ? `${e}-columns-order` : "",
|
|
1259
1259
|
defaultValue: e ? r : void 0,
|
|
1260
1260
|
getInitialValueInEffect: n
|
|
@@ -1297,7 +1297,7 @@ function Dn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1297
1297
|
};
|
|
1298
1298
|
}
|
|
1299
1299
|
function On({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1300
|
-
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] =
|
|
1300
|
+
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = je({
|
|
1301
1301
|
key: e ? `${e}-columns-width` : "",
|
|
1302
1302
|
defaultValue: e ? o() : void 0,
|
|
1303
1303
|
getInitialValueInEffect: n
|
|
@@ -1391,7 +1391,7 @@ function kn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
|
1391
1391
|
defaultToggle: e.defaultToggle || !0,
|
|
1392
1392
|
toggleable: e.toggleable,
|
|
1393
1393
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1394
|
-
})), [t]), [i, a] =
|
|
1394
|
+
})), [t]), [i, a] = je({
|
|
1395
1395
|
key: e ? `${e}-columns-toggle` : "",
|
|
1396
1396
|
defaultValue: e ? r : void 0,
|
|
1397
1397
|
getInitialValueInEffect: n
|
|
@@ -1598,7 +1598,7 @@ function zn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1598
1598
|
$(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), $(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1599
1599
|
}
|
|
1600
1600
|
function c() {
|
|
1601
|
-
f.current.withRowBorders && t.height < n.height ? $(r.current, In, `${
|
|
1601
|
+
f.current.withRowBorders && t.height < n.height ? $(r.current, In, `${V("1px")} solid var(--mantine-datatable-border-color)`) : $(r.current, In, "unset");
|
|
1602
1602
|
}
|
|
1603
1603
|
h.current = c;
|
|
1604
1604
|
function l() {
|
|
@@ -1759,12 +1759,12 @@ function Wn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0
|
|
|
1759
1759
|
}, [e]), r;
|
|
1760
1760
|
}
|
|
1761
1761
|
function Gn(e) {
|
|
1762
|
-
let t =
|
|
1762
|
+
let t = ge();
|
|
1763
1763
|
return Wn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1764
1764
|
}
|
|
1765
1765
|
function Kn(e) {
|
|
1766
|
-
let t =
|
|
1767
|
-
return
|
|
1766
|
+
let t = ge();
|
|
1767
|
+
return Me((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1768
1768
|
}
|
|
1769
1769
|
function qn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1770
1770
|
let r = [];
|
|
@@ -1802,7 +1802,7 @@ function qn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
1804
|
function Jn(e, t) {
|
|
1805
|
-
let [n, r] = d(e), [i, a] = d(e), o =
|
|
1805
|
+
let [n, r] = d(e), [i, a] = d(e), o = Pe(() => r(!0), 0), c = Pe(() => a(!1), t || 200);
|
|
1806
1806
|
return s(() => {
|
|
1807
1807
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
1808
1808
|
}, [
|
|
@@ -1816,7 +1816,7 @@ function Jn(e, t) {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
var Yn = "mantine-datatable-nowrap", Xn = "mantine-datatable-ellipsis", Zn = "mantine-datatable-pointer-cursor", Qn = "mantine-datatable-context-menu-cursor", $n = "mantine-datatable-text-selection-disabled", er = "mantine-datatable-text-align-left", tr = "mantine-datatable-text-align-center", nr = "mantine-datatable-text-align-right";
|
|
1818
1818
|
function rr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1819
|
-
return Kn(r) ? p(
|
|
1819
|
+
return Kn(r) ? p(z, {
|
|
1820
1820
|
"data-pinned": n?.position,
|
|
1821
1821
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1822
1822
|
className: X({
|
|
@@ -1843,17 +1843,17 @@ function rr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title
|
|
|
1843
1843
|
}) : null;
|
|
1844
1844
|
}
|
|
1845
1845
|
function ir({ shadowVisible: e }) {
|
|
1846
|
-
return p(
|
|
1846
|
+
return p(z, {
|
|
1847
1847
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1848
1848
|
"data-shadow-visible": e || void 0
|
|
1849
1849
|
});
|
|
1850
1850
|
}
|
|
1851
1851
|
function ar({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1852
|
-
return p(
|
|
1852
|
+
return p(oe, {
|
|
1853
1853
|
ref: s,
|
|
1854
1854
|
className: X("mantine-datatable-footer", e),
|
|
1855
1855
|
style: t,
|
|
1856
|
-
children: m(
|
|
1856
|
+
children: m(ce, { children: [a && p(ir, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1857
1857
|
if (e) return null;
|
|
1858
1858
|
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1859
1859
|
...r,
|
|
@@ -1892,7 +1892,7 @@ function or({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1892
1892
|
n,
|
|
1893
1893
|
_
|
|
1894
1894
|
]), y = l(() => d.reduce((e, t) => e + Cn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = Tn(f, y + v < h, m);
|
|
1895
|
-
return v > 0 ? p(
|
|
1895
|
+
return v > 0 ? p(z, {
|
|
1896
1896
|
colSpan: v,
|
|
1897
1897
|
rowSpan: b > 1 ? b : void 0,
|
|
1898
1898
|
"data-pinned": s?.position,
|
|
@@ -1950,7 +1950,7 @@ function cr() {
|
|
|
1950
1950
|
});
|
|
1951
1951
|
}
|
|
1952
1952
|
function lr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1953
|
-
let [i, { close: a, toggle: o }] =
|
|
1953
|
+
let [i, { close: a, toggle: o }] = Ae(!1), s = t ? cr : sr, c = ke(a);
|
|
1954
1954
|
return r && (c = void 0), m(P, {
|
|
1955
1955
|
withArrow: !0,
|
|
1956
1956
|
shadow: "md",
|
|
@@ -1959,7 +1959,7 @@ function lr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1959
1959
|
opened: i,
|
|
1960
1960
|
onClose: a,
|
|
1961
1961
|
onDismiss: a,
|
|
1962
|
-
children: [p(
|
|
1962
|
+
children: [p(ne, { children: p(g, {
|
|
1963
1963
|
className: "mantine-datatable-header-cell-filter-action-icon",
|
|
1964
1964
|
"data-active": t || void 0,
|
|
1965
1965
|
size: "sm",
|
|
@@ -1969,7 +1969,7 @@ function lr({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1969
1969
|
},
|
|
1970
1970
|
onKeyDown: (e) => e.stopPropagation(),
|
|
1971
1971
|
children: p(s, {})
|
|
1972
|
-
}) }), p(
|
|
1972
|
+
}) }), p(te, {
|
|
1973
1973
|
ref: c,
|
|
1974
1974
|
onClick: (e) => e.stopPropagation(),
|
|
1975
1975
|
onKeyDown: (e) => e.stopPropagation(),
|
|
@@ -2135,7 +2135,7 @@ var hr = 50, gr = (e) => {
|
|
|
2135
2135
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
2136
2136
|
current: 0,
|
|
2137
2137
|
next: 0
|
|
2138
|
-
}), { dir: c } =
|
|
2138
|
+
}), { dir: c } = he(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = un(), g = a((e) => {
|
|
2139
2139
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
2140
2140
|
let r = n.current, a = r.nextElementSibling;
|
|
2141
2141
|
for (; a;) {
|
|
@@ -2271,36 +2271,36 @@ function yr() {
|
|
|
2271
2271
|
});
|
|
2272
2272
|
}
|
|
2273
2273
|
function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: h, textAlign: _, width: y, sortStatus: x, onSortStatusChange: S, filter: C, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
|
|
2274
|
-
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: ee, columnsPinning: P, setColumnsPinning:
|
|
2274
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: ee, columnsPinning: P, setColumnsPinning: te } = un(), [ne, F] = d(!1), I = u(null), re = P?.find((e) => e.accessor === r)?.pinned;
|
|
2275
2275
|
if (!Kn(i)) return null;
|
|
2276
|
-
let
|
|
2276
|
+
let L = a ?? hn(r), R = typeof L == "string" ? L : void 0, ie = o && S ? (e) => {
|
|
2277
2277
|
e?.defaultPrevented || S({
|
|
2278
2278
|
sortKey: k,
|
|
2279
2279
|
columnAccessor: r,
|
|
2280
2280
|
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
2281
2281
|
});
|
|
2282
|
-
} : void 0,
|
|
2283
|
-
e.stopPropagation(), A(r),
|
|
2284
|
-
},
|
|
2285
|
-
e.preventDefault(), j(r),
|
|
2282
|
+
} : void 0, ae = (e) => {
|
|
2283
|
+
e.stopPropagation(), A(r), F(!1);
|
|
2284
|
+
}, oe = (e) => {
|
|
2285
|
+
e.preventDefault(), j(r), F(!0);
|
|
2286
2286
|
}, se = () => {
|
|
2287
|
-
j(r),
|
|
2288
|
-
}, B = () => {
|
|
2289
|
-
I(!0);
|
|
2287
|
+
j(r), F(!1), M();
|
|
2290
2288
|
}, ce = () => {
|
|
2291
|
-
|
|
2292
|
-
},
|
|
2289
|
+
F(!0);
|
|
2290
|
+
}, le = () => {
|
|
2291
|
+
F(!1);
|
|
2292
|
+
}, B = (e) => {
|
|
2293
2293
|
e.stopPropagation(), ee(N.map((e) => e.accessor === r ? {
|
|
2294
2294
|
...e,
|
|
2295
2295
|
toggled: !1
|
|
2296
2296
|
} : e));
|
|
2297
|
-
},
|
|
2298
|
-
|
|
2297
|
+
}, ue = (e) => {
|
|
2298
|
+
te((t) => t.map((t) => t.accessor === r ? {
|
|
2299
2299
|
...t,
|
|
2300
2300
|
pinned: e
|
|
2301
2301
|
} : t));
|
|
2302
2302
|
};
|
|
2303
|
-
return m(
|
|
2303
|
+
return m(z, {
|
|
2304
2304
|
"data-accessor": r,
|
|
2305
2305
|
"data-pinned": n?.position,
|
|
2306
2306
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
@@ -2329,7 +2329,7 @@ function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2329
2329
|
tabIndex: o ? 0 : void 0,
|
|
2330
2330
|
onClick: ie,
|
|
2331
2331
|
onKeyDown: (e) => e.key === "Enter" && ie?.(),
|
|
2332
|
-
ref:
|
|
2332
|
+
ref: I,
|
|
2333
2333
|
children: [m(T, {
|
|
2334
2334
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
2335
2335
|
justify: "space-between",
|
|
@@ -2340,14 +2340,14 @@ function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2340
2340
|
w: "100%",
|
|
2341
2341
|
className: X({
|
|
2342
2342
|
"mantine-datatable-header-cell-draggable": s,
|
|
2343
|
-
"mantine-datatable-header-cell-drag-over":
|
|
2343
|
+
"mantine-datatable-header-cell-drag-over": ne
|
|
2344
2344
|
}),
|
|
2345
2345
|
draggable: s,
|
|
2346
|
-
onDragStart: s ?
|
|
2347
|
-
onDragEnter: s ?
|
|
2348
|
-
onDragOver: s ?
|
|
2346
|
+
onDragStart: s ? ae : void 0,
|
|
2347
|
+
onDragEnter: s ? ce : void 0,
|
|
2348
|
+
onDragOver: s ? oe : void 0,
|
|
2349
2349
|
onDrop: s ? se : void 0,
|
|
2350
|
-
onDragLeave: s ?
|
|
2350
|
+
onDragLeave: s ? le : void 0,
|
|
2351
2351
|
children: [s ? p(b, {
|
|
2352
2352
|
role: "img",
|
|
2353
2353
|
"aria-label": "Drag column",
|
|
@@ -2366,13 +2366,13 @@ function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2366
2366
|
[tr]: _ === "center",
|
|
2367
2367
|
[nr]: _ === "right"
|
|
2368
2368
|
}, Yn, Xn),
|
|
2369
|
-
title:
|
|
2370
|
-
children:
|
|
2369
|
+
title: R,
|
|
2370
|
+
children: L
|
|
2371
2371
|
})]
|
|
2372
2372
|
}),
|
|
2373
2373
|
l ? p(mr, {
|
|
2374
|
-
currentPinned:
|
|
2375
|
-
onPinChange:
|
|
2374
|
+
currentPinned: re,
|
|
2375
|
+
onPinChange: ue
|
|
2376
2376
|
}) : null,
|
|
2377
2377
|
c ? p(b, {
|
|
2378
2378
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
@@ -2381,7 +2381,7 @@ function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2381
2381
|
children: p(g, {
|
|
2382
2382
|
size: "xs",
|
|
2383
2383
|
variant: "light",
|
|
2384
|
-
onClick:
|
|
2384
|
+
onClick: B,
|
|
2385
2385
|
children: p(pr, {})
|
|
2386
2386
|
})
|
|
2387
2387
|
}) : null,
|
|
@@ -2405,13 +2405,13 @@ function br({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQu
|
|
|
2405
2405
|
]
|
|
2406
2406
|
}), f && r !== "__selection__" ? p(gr, {
|
|
2407
2407
|
accessor: r,
|
|
2408
|
-
columnRef:
|
|
2408
|
+
columnRef: I
|
|
2409
2409
|
}) : null]
|
|
2410
2410
|
});
|
|
2411
2411
|
}
|
|
2412
2412
|
function xr({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
2413
2413
|
let u = !o.disabled;
|
|
2414
|
-
return p(
|
|
2414
|
+
return p(z, {
|
|
2415
2415
|
ref: l,
|
|
2416
2416
|
className: X("mantine-datatable-header-selector-cell", { [Zn]: n === "cell" && u }, e),
|
|
2417
2417
|
style: t,
|
|
@@ -2454,7 +2454,7 @@ function Cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2454
2454
|
checkboxProps: v,
|
|
2455
2455
|
onChange: _,
|
|
2456
2456
|
rowSpan: c ? D : void 0
|
|
2457
|
-
}) : null, { columnsToggle: k, setColumnsToggle: A } = un(), [j, M] = d(!1), N = o.some((e) => e.toggleable), ee = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? hn(String(e))])) : void 0,
|
|
2457
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = un(), [j, M] = d(!1), N = o.some((e) => e.toggleable), ee = N ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? hn(String(e))])) : void 0, F = m(se, {
|
|
2458
2458
|
className: X("mantine-datatable-header", t),
|
|
2459
2459
|
style: n,
|
|
2460
2460
|
ref: w,
|
|
@@ -2463,7 +2463,7 @@ function Cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2463
2463
|
} : void 0,
|
|
2464
2464
|
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2465
2465
|
let n = wn(c, t);
|
|
2466
|
-
return m(
|
|
2466
|
+
return m(ce, { children: [t === 0 && O, n.map((e, r) => p(or, {
|
|
2467
2467
|
group: e,
|
|
2468
2468
|
pinnedInfo: Sr(e, l),
|
|
2469
2469
|
maxDepth: E,
|
|
@@ -2473,7 +2473,7 @@ function Cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2473
2473
|
withColumnBorders: C,
|
|
2474
2474
|
totalTableColumns: o.length
|
|
2475
2475
|
}, e.id))] }, `group-depth-${t}`);
|
|
2476
|
-
}), m(
|
|
2476
|
+
}), m(ce, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2477
2477
|
if (e) return null;
|
|
2478
2478
|
let { accessor: c, visibleMediaQuery: u, textAlign: d, width: f, title: m, sortable: h, draggable: g, toggleable: _, pinnable: v, resizable: y, titleClassName: b, titleStyle: x, filter: S, filterPopoverProps: C, filterPopoverDisableClickOutside: w, filtering: T, sortKey: E } = {
|
|
2479
2479
|
...s,
|
|
@@ -2510,7 +2510,7 @@ function Cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2510
2510
|
shadow: "md",
|
|
2511
2511
|
opened: j,
|
|
2512
2512
|
onChange: M,
|
|
2513
|
-
children: [p(
|
|
2513
|
+
children: [p(ne, { children: F }), p(te, { children: p(L, { children: k.filter((e) => e.toggleable).map((e) => p(T, { children: p(x, {
|
|
2514
2514
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2515
2515
|
size: "xs",
|
|
2516
2516
|
label: ee[e.accessor],
|
|
@@ -2522,7 +2522,7 @@ function Cr({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2522
2522
|
} : n));
|
|
2523
2523
|
}
|
|
2524
2524
|
}) }, e.accessor)) }) })]
|
|
2525
|
-
}) :
|
|
2525
|
+
}) : F;
|
|
2526
2526
|
}
|
|
2527
2527
|
function wr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2528
2528
|
return p(b, {
|
|
@@ -2557,16 +2557,16 @@ function Tr() {
|
|
|
2557
2557
|
});
|
|
2558
2558
|
}
|
|
2559
2559
|
var Er = {
|
|
2560
|
-
xs:
|
|
2561
|
-
sm:
|
|
2562
|
-
md:
|
|
2563
|
-
lg:
|
|
2564
|
-
xl:
|
|
2560
|
+
xs: V(22),
|
|
2561
|
+
sm: V(26),
|
|
2562
|
+
md: V(32),
|
|
2563
|
+
lg: V(38),
|
|
2564
|
+
xl: V(44)
|
|
2565
2565
|
};
|
|
2566
2566
|
function Dr({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2567
2567
|
return m(T, {
|
|
2568
2568
|
gap: "xs",
|
|
2569
|
-
children: [p(
|
|
2569
|
+
children: [p(B, {
|
|
2570
2570
|
component: "div",
|
|
2571
2571
|
size: e,
|
|
2572
2572
|
children: t
|
|
@@ -2597,7 +2597,7 @@ function Dr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2597
2597
|
}) : void 0],
|
|
2598
2598
|
disabled: n,
|
|
2599
2599
|
onClick: () => o(t),
|
|
2600
|
-
children: p(
|
|
2600
|
+
children: p(B, {
|
|
2601
2601
|
component: "div",
|
|
2602
2602
|
size: e,
|
|
2603
2603
|
children: t
|
|
@@ -2617,8 +2617,8 @@ function Or({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2617
2617
|
totalRecords: g
|
|
2618
2618
|
});
|
|
2619
2619
|
} else O = n ? u : d;
|
|
2620
|
-
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !Kn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${
|
|
2621
|
-
Text: (e) => p(
|
|
2620
|
+
let k = g && _ ? Math.max(1, Math.ceil(g / _)) : 1, A = g ? (r - 1) * (_ ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, M = !Kn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${V(w)}rem` : e[w] || w})`), N = {
|
|
2621
|
+
Text: (e) => p(B, {
|
|
2622
2622
|
component: "div",
|
|
2623
2623
|
className: "mantine-datatable-pagination-text",
|
|
2624
2624
|
size: l,
|
|
@@ -2687,7 +2687,7 @@ function Or({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2687
2687
|
});
|
|
2688
2688
|
}
|
|
2689
2689
|
function kr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, record: i, index: a, onClick: o, onDoubleClick: s, onContextMenu: c, noWrap: l, ellipsis: u, textAlign: d, width: f, accessor: m, render: h, defaultRender: g, customCellAttributes: _ }) {
|
|
2690
|
-
return Kn(r) ? p(
|
|
2690
|
+
return Kn(r) ? p(ae, {
|
|
2691
2691
|
"data-pinned": n?.position,
|
|
2692
2692
|
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2693
2693
|
className: X({
|
|
@@ -2721,7 +2721,7 @@ function kr({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, recor
|
|
|
2721
2721
|
}
|
|
2722
2722
|
function Ar({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2723
2723
|
let { expanded: i, visible: a } = Jn(e, r?.transitionDuration);
|
|
2724
|
-
return a ? m(f, { children: [p(
|
|
2724
|
+
return a ? m(f, { children: [p(ce, {}), p(ce, { children: p(ae, {
|
|
2725
2725
|
className: "mantine-datatable-row-expansion-cell",
|
|
2726
2726
|
colSpan: t,
|
|
2727
2727
|
children: p(S, {
|
|
@@ -2741,7 +2741,7 @@ function jr({ className: e, style: t, record: n, index: r, trigger: i, onChange:
|
|
|
2741
2741
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2742
2742
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2743
2743
|
};
|
|
2744
|
-
return p(
|
|
2744
|
+
return p(ae, {
|
|
2745
2745
|
className: X("mantine-datatable-row-selector-cell", { [Zn]: i === "cell" && d }, e),
|
|
2746
2746
|
style: t,
|
|
2747
2747
|
"data-shadow-visible": o || void 0,
|
|
@@ -2838,7 +2838,7 @@ function Mr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap:
|
|
|
2838
2838
|
rowProps: ee,
|
|
2839
2839
|
children: M,
|
|
2840
2840
|
expandedElement: N
|
|
2841
|
-
}) : m(f, { children: [p(
|
|
2841
|
+
}) : m(f, { children: [p(ce, {
|
|
2842
2842
|
...ee,
|
|
2843
2843
|
children: M
|
|
2844
2844
|
}), N] });
|
|
@@ -2886,7 +2886,7 @@ function Nr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2886
2886
|
};
|
|
2887
2887
|
}
|
|
2888
2888
|
function Pr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2889
|
-
return m(
|
|
2889
|
+
return m(F, {
|
|
2890
2890
|
...a,
|
|
2891
2891
|
viewportRef: i,
|
|
2892
2892
|
classNames: {
|
|
@@ -2905,81 +2905,81 @@ function Pr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2905
2905
|
]
|
|
2906
2906
|
});
|
|
2907
2907
|
}
|
|
2908
|
-
function Fr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: ee = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: P, sortIcons:
|
|
2909
|
-
let
|
|
2908
|
+
function Fr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: _, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: ee = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: P, sortIcons: te, onSortStatusChange: ne, horizontalSpacing: F, page: I, onPageChange: re, totalRecords: L, recordsPerPage: R, onRecordsPerPageChange: ae, recordsPerPageOptions: oe, recordsPerPageLabel: z = "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: Me, onScroll: Pe, onScrollToTop: H, onScrollToBottom: Fe, onScrollToLeft: Ie, onScrollToRight: U, c: Le, backgroundColor: Re, borderColor: ze, rowBorderColor: Be, stripedColor: Ve, highlightOnHoverColor: He, rowColor: W, rowBackgroundColor: Ue, rowExpansion: We, rowClassName: Ge, rowStyle: Ke, customRowAttributes: qe, scrollViewportRef: G, scrollAreaProps: K, tableRef: Je, bodyRef: Ye, m: Xe, my: Ze, mx: Qe, mt: $e, mb: et, ml: tt, mr: nt, className: rt, classNames: it, style: at, styles: ot, rowFactory: st, tableWrapper: ct, ...lt }) {
|
|
2909
|
+
let ut = l(() => y ? Sn(y) : g, [g, y]), { refs: q, onScroll: dt } = zn({
|
|
2910
2910
|
scrollCallbacks: {
|
|
2911
|
-
onScroll:
|
|
2912
|
-
onScrollToTop:
|
|
2913
|
-
onScrollToBottom:
|
|
2914
|
-
onScrollToLeft:
|
|
2915
|
-
onScrollToRight:
|
|
2911
|
+
onScroll: Pe,
|
|
2912
|
+
onScrollToTop: H,
|
|
2913
|
+
onScrollToBottom: Fe,
|
|
2914
|
+
onScrollToLeft: Ie,
|
|
2915
|
+
onScrollToRight: U
|
|
2916
2916
|
},
|
|
2917
|
-
withRowBorders:
|
|
2918
|
-
}),
|
|
2917
|
+
withRowBorders: lt.withRowBorders
|
|
2918
|
+
}), J = An({
|
|
2919
2919
|
key: _,
|
|
2920
|
-
columns:
|
|
2921
|
-
headerRef:
|
|
2922
|
-
scrollViewportRef:
|
|
2923
|
-
}),
|
|
2924
|
-
rowExpansion:
|
|
2920
|
+
columns: ut,
|
|
2921
|
+
headerRef: q.header,
|
|
2922
|
+
scrollViewportRef: q.scrollViewport
|
|
2923
|
+
}), ft = J.effectiveColumns, pt = Ne(q.table, Je), mt = Ne(q.scrollViewport, G), ht = u(null), gt = Ne(ht, Ye), _t = qn({
|
|
2924
|
+
rowExpansion: We,
|
|
2925
2925
|
records: T,
|
|
2926
2926
|
idAccessor: w
|
|
2927
|
-
}), { pinnedMap:
|
|
2928
|
-
columns:
|
|
2929
|
-
theadRef:
|
|
2930
|
-
tbodyRef:
|
|
2931
|
-
selectionColumnHeaderRef:
|
|
2927
|
+
}), { pinnedMap: vt, hasLeftPinned: yt, hasRightPinned: bt } = Bn({
|
|
2928
|
+
columns: ft,
|
|
2929
|
+
theadRef: q.header,
|
|
2930
|
+
tbodyRef: ht,
|
|
2931
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
2932
2932
|
selectionVisible: !!D,
|
|
2933
2933
|
pinFirstColumn: b,
|
|
2934
2934
|
pinLastColumn: x
|
|
2935
|
-
}),
|
|
2936
|
-
|
|
2937
|
-
}, [
|
|
2935
|
+
}), xt = u(!1), St = u(I), Ct = u(T), wt = a((e) => {
|
|
2936
|
+
xt.current = !0, Ct.current = T, re(e);
|
|
2937
|
+
}, [re, T]);
|
|
2938
2938
|
s(() => {
|
|
2939
|
-
|
|
2940
|
-
}, [
|
|
2941
|
-
let
|
|
2939
|
+
St.current !== I && (xt.current = !0, Ct.current = T, St.current = I);
|
|
2940
|
+
}, [I, T]);
|
|
2941
|
+
let Tt = T?.length;
|
|
2942
2942
|
c(() => {
|
|
2943
|
-
if (!
|
|
2944
|
-
let e =
|
|
2943
|
+
if (!xt.current || h || T === Ct.current) return;
|
|
2944
|
+
let e = q.scrollViewport.current;
|
|
2945
2945
|
if (!e) return;
|
|
2946
2946
|
let t = requestAnimationFrame(() => {
|
|
2947
2947
|
e.scrollTo({
|
|
2948
2948
|
top: 0,
|
|
2949
2949
|
left: 0
|
|
2950
|
-
}),
|
|
2950
|
+
}), xt.current = !1;
|
|
2951
2951
|
});
|
|
2952
2952
|
return () => cancelAnimationFrame(t);
|
|
2953
2953
|
}, [
|
|
2954
2954
|
h,
|
|
2955
2955
|
T,
|
|
2956
|
-
|
|
2956
|
+
q.scrollViewport
|
|
2957
2957
|
]);
|
|
2958
|
-
let
|
|
2959
|
-
D && O && O(
|
|
2958
|
+
let Et = T?.map((e) => Q(e, w)), Dt = !!D, Ot = D?.map((e) => Q(e, w)), kt = Et !== void 0 && Ot !== void 0 && Ot.length > 0, At = j ? T?.filter(j) : T, jt = At?.map((e) => Q(e, w)), Y = kt && jt.every((e) => Ot.includes(e)), Mt = kt && jt.some((e) => Ot.includes(e)), Nt = a(() => {
|
|
2959
|
+
D && O && O(Y ? D.filter((e) => !jt.includes(Q(e, w))) : yn([...D, ...At], (e) => Q(e, w)));
|
|
2960
2960
|
}, [
|
|
2961
|
-
|
|
2961
|
+
Y,
|
|
2962
2962
|
w,
|
|
2963
2963
|
O,
|
|
2964
|
-
Mt,
|
|
2965
2964
|
jt,
|
|
2965
|
+
At,
|
|
2966
2966
|
D
|
|
2967
|
-
]), { lastSelectionChangeIndex:
|
|
2968
|
-
m:
|
|
2969
|
-
my:
|
|
2970
|
-
mx:
|
|
2971
|
-
mt:
|
|
2972
|
-
mb:
|
|
2973
|
-
ml:
|
|
2974
|
-
mr:
|
|
2975
|
-
}, Rt = a(({ children: e }) =>
|
|
2967
|
+
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = Vn(Et), It = Dt && !yt, Lt = {
|
|
2968
|
+
m: Xe,
|
|
2969
|
+
my: Ze,
|
|
2970
|
+
mx: Qe,
|
|
2971
|
+
mt: $e,
|
|
2972
|
+
mb: et,
|
|
2973
|
+
ml: tt,
|
|
2974
|
+
mr: nt
|
|
2975
|
+
}, Rt = a(({ children: e }) => ct ? ct({ children: e }) : e, [ct]);
|
|
2976
2976
|
return p(dn, {
|
|
2977
|
-
...
|
|
2978
|
-
pinnedMap:
|
|
2977
|
+
...J,
|
|
2978
|
+
pinnedMap: vt,
|
|
2979
2979
|
children: m(v, {
|
|
2980
|
-
ref:
|
|
2980
|
+
ref: q.root,
|
|
2981
2981
|
...Lt,
|
|
2982
|
-
className: X("mantine-datatable", { "mantine-datatable-with-border": e },
|
|
2982
|
+
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, rt, it?.root),
|
|
2983
2983
|
style: [
|
|
2984
2984
|
(e) => ({
|
|
2985
2985
|
...on({
|
|
@@ -2997,58 +2997,58 @@ function Fr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2997
2997
|
minHeight: i,
|
|
2998
2998
|
maxHeight: o
|
|
2999
2999
|
}),
|
|
3000
|
-
|
|
3001
|
-
|
|
3000
|
+
at,
|
|
3001
|
+
ot?.root,
|
|
3002
3002
|
{ position: "relative" }
|
|
3003
3003
|
],
|
|
3004
3004
|
children: [
|
|
3005
3005
|
p(Pr, {
|
|
3006
|
-
viewportRef:
|
|
3007
|
-
leftShadowBehind:
|
|
3008
|
-
rightShadowBehind:
|
|
3009
|
-
onScrollPositionChange:
|
|
3010
|
-
scrollAreaProps:
|
|
3006
|
+
viewportRef: mt,
|
|
3007
|
+
leftShadowBehind: Dt || yt,
|
|
3008
|
+
rightShadowBehind: bt,
|
|
3009
|
+
onScrollPositionChange: dt,
|
|
3010
|
+
scrollAreaProps: K,
|
|
3011
3011
|
children: p(Rt, { children: m(ie, {
|
|
3012
|
-
ref:
|
|
3013
|
-
horizontalSpacing:
|
|
3012
|
+
ref: pt,
|
|
3013
|
+
horizontalSpacing: F,
|
|
3014
3014
|
className: X("mantine-datatable-table", {
|
|
3015
3015
|
[$n]: n,
|
|
3016
3016
|
"mantine-datatable-vertical-align-top": f === "top",
|
|
3017
3017
|
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
3018
|
-
"mantine-datatable-selection-column-visible":
|
|
3019
|
-
"mantine-datatable-resizable-columns":
|
|
3020
|
-
"mantine-datatable-resize-locked":
|
|
3021
|
-
"mantine-datatable-resizing":
|
|
3022
|
-
},
|
|
3018
|
+
"mantine-datatable-selection-column-visible": Dt,
|
|
3019
|
+
"mantine-datatable-resizable-columns": J.hasResizableColumns,
|
|
3020
|
+
"mantine-datatable-resize-locked": J.isLocked,
|
|
3021
|
+
"mantine-datatable-resizing": J.isResizing
|
|
3022
|
+
}, it?.table),
|
|
3023
3023
|
style: {
|
|
3024
|
-
...
|
|
3025
|
-
...
|
|
3026
|
-
...
|
|
3024
|
+
...ot?.table,
|
|
3025
|
+
...J.isLocked ? { tableLayout: "fixed" } : null,
|
|
3026
|
+
...J.tableWidth == null ? null : { width: `${J.tableWidth}px` }
|
|
3027
3027
|
},
|
|
3028
|
-
"data-striped":
|
|
3029
|
-
"data-highlight-on-hover":
|
|
3030
|
-
...
|
|
3028
|
+
"data-striped": Tt && Te || void 0,
|
|
3029
|
+
"data-highlight-on-hover": we || void 0,
|
|
3030
|
+
...lt,
|
|
3031
3031
|
children: [
|
|
3032
|
-
|
|
3033
|
-
...
|
|
3034
|
-
pinnedMap:
|
|
3032
|
+
Ee ? null : p(dn, {
|
|
3033
|
+
...J,
|
|
3034
|
+
pinnedMap: vt,
|
|
3035
3035
|
children: p(Cr, {
|
|
3036
|
-
ref:
|
|
3037
|
-
selectionColumnHeaderRef:
|
|
3038
|
-
className:
|
|
3039
|
-
style:
|
|
3040
|
-
columns:
|
|
3036
|
+
ref: q.header,
|
|
3037
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
3038
|
+
className: it?.header,
|
|
3039
|
+
style: ot?.header,
|
|
3040
|
+
columns: ft,
|
|
3041
3041
|
defaultColumnProps: S,
|
|
3042
3042
|
groups: y,
|
|
3043
|
-
pinnedMap:
|
|
3043
|
+
pinnedMap: vt,
|
|
3044
3044
|
sortStatus: P,
|
|
3045
|
-
sortIcons:
|
|
3046
|
-
onSortStatusChange:
|
|
3045
|
+
sortIcons: te,
|
|
3046
|
+
onSortStatusChange: ne,
|
|
3047
3047
|
selectionTrigger: E,
|
|
3048
|
-
selectionVisible:
|
|
3049
|
-
selectionChecked:
|
|
3050
|
-
selectionIndeterminate:
|
|
3051
|
-
onSelectionChange:
|
|
3048
|
+
selectionVisible: Dt,
|
|
3049
|
+
selectionChecked: Y,
|
|
3050
|
+
selectionIndeterminate: Mt && !Y,
|
|
3051
|
+
onSelectionChange: Nt,
|
|
3052
3052
|
selectionCheckboxProps: {
|
|
3053
3053
|
...M,
|
|
3054
3054
|
...N
|
|
@@ -3056,105 +3056,105 @@ function Fr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3056
3056
|
selectorCellShadowVisible: It,
|
|
3057
3057
|
selectionColumnClassName: k,
|
|
3058
3058
|
selectionColumnStyle: A,
|
|
3059
|
-
withColumnBorders:
|
|
3059
|
+
withColumnBorders: lt.withColumnBorders
|
|
3060
3060
|
})
|
|
3061
3061
|
}),
|
|
3062
3062
|
p("tbody", {
|
|
3063
|
-
ref:
|
|
3064
|
-
children:
|
|
3065
|
-
let n = Q(e, w), r =
|
|
3063
|
+
ref: gt,
|
|
3064
|
+
children: Tt ? T.map((e, t) => {
|
|
3065
|
+
let n = Q(e, w), r = Ot?.includes(n) || !1, i;
|
|
3066
3066
|
return O && D && (i = (i) => {
|
|
3067
|
-
if (i.nativeEvent.shiftKey &&
|
|
3068
|
-
let e = T.filter(t >
|
|
3067
|
+
if (i.nativeEvent.shiftKey && Pt !== null) {
|
|
3068
|
+
let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (j ? j(e, n) : !0) : (e, n) => n >= t && n <= Pt && (j ? j(e, n) : !0));
|
|
3069
3069
|
O(r ? vn(D, e, (e) => Q(e, w)) : yn([...D, ...e], (e) => Q(e, w)));
|
|
3070
3070
|
} else O(r ? D.filter((e) => Q(e, w) !== n) : yn([...D, e], (e) => Q(e, w)));
|
|
3071
3071
|
Ft(t);
|
|
3072
3072
|
}), p(Mr, {
|
|
3073
3073
|
record: e,
|
|
3074
3074
|
index: t,
|
|
3075
|
-
columns:
|
|
3075
|
+
columns: ft,
|
|
3076
3076
|
defaultColumnProps: S,
|
|
3077
|
-
pinnedMap:
|
|
3077
|
+
pinnedMap: vt,
|
|
3078
3078
|
defaultColumnRender: C,
|
|
3079
3079
|
selectionTrigger: E,
|
|
3080
|
-
selectionVisible:
|
|
3080
|
+
selectionVisible: Dt,
|
|
3081
3081
|
selectionChecked: r,
|
|
3082
3082
|
onSelectionChange: i,
|
|
3083
3083
|
isRecordSelectable: j,
|
|
3084
3084
|
selectionCheckboxProps: M,
|
|
3085
3085
|
getSelectionCheckboxProps: ee,
|
|
3086
|
-
onClick:
|
|
3087
|
-
onDoubleClick:
|
|
3088
|
-
onCellClick:
|
|
3089
|
-
onCellDoubleClick:
|
|
3090
|
-
onContextMenu:
|
|
3091
|
-
onCellContextMenu:
|
|
3092
|
-
expansion:
|
|
3086
|
+
onClick: De,
|
|
3087
|
+
onDoubleClick: Oe,
|
|
3088
|
+
onCellClick: Ae,
|
|
3089
|
+
onCellDoubleClick: je,
|
|
3090
|
+
onContextMenu: ke,
|
|
3091
|
+
onCellContextMenu: Me,
|
|
3092
|
+
expansion: _t,
|
|
3093
3093
|
color: W,
|
|
3094
|
-
backgroundColor:
|
|
3095
|
-
className:
|
|
3096
|
-
style:
|
|
3097
|
-
customAttributes:
|
|
3094
|
+
backgroundColor: Ue,
|
|
3095
|
+
className: Ge,
|
|
3096
|
+
style: Ke,
|
|
3097
|
+
customAttributes: qe,
|
|
3098
3098
|
selectorCellShadowVisible: It,
|
|
3099
3099
|
selectionColumnClassName: k,
|
|
3100
3100
|
selectionColumnStyle: A,
|
|
3101
3101
|
idAccessor: w,
|
|
3102
|
-
rowFactory:
|
|
3102
|
+
rowFactory: st
|
|
3103
3103
|
}, n);
|
|
3104
3104
|
}) : p(fn, {})
|
|
3105
3105
|
}),
|
|
3106
|
-
|
|
3107
|
-
ref:
|
|
3108
|
-
className:
|
|
3109
|
-
style:
|
|
3110
|
-
columns:
|
|
3106
|
+
ft.some(({ footer: e }) => e) && p(ar, {
|
|
3107
|
+
ref: q.footer,
|
|
3108
|
+
className: it?.footer,
|
|
3109
|
+
style: ot?.footer,
|
|
3110
|
+
columns: ft,
|
|
3111
3111
|
defaultColumnProps: S,
|
|
3112
|
-
pinnedMap:
|
|
3113
|
-
selectionVisible:
|
|
3112
|
+
pinnedMap: vt,
|
|
3113
|
+
selectionVisible: Dt,
|
|
3114
3114
|
selectorCellShadowVisible: It
|
|
3115
3115
|
})
|
|
3116
3116
|
]
|
|
3117
3117
|
}) })
|
|
3118
3118
|
}),
|
|
3119
|
-
!!(
|
|
3120
|
-
className:
|
|
3121
|
-
style:
|
|
3122
|
-
horizontalSpacing:
|
|
3119
|
+
!!(I && Tt) && p(Or, {
|
|
3120
|
+
className: it?.pagination,
|
|
3121
|
+
style: ot?.pagination,
|
|
3122
|
+
horizontalSpacing: F,
|
|
3123
3123
|
fetching: h,
|
|
3124
|
-
page:
|
|
3125
|
-
onPageChange:
|
|
3126
|
-
totalRecords:
|
|
3127
|
-
recordsPerPage:
|
|
3128
|
-
onRecordsPerPageChange:
|
|
3129
|
-
recordsPerPageOptions:
|
|
3130
|
-
recordsPerPageLabel:
|
|
3124
|
+
page: I,
|
|
3125
|
+
onPageChange: wt,
|
|
3126
|
+
totalRecords: L,
|
|
3127
|
+
recordsPerPage: R,
|
|
3128
|
+
onRecordsPerPageChange: ae,
|
|
3129
|
+
recordsPerPageOptions: oe,
|
|
3130
|
+
recordsPerPageLabel: z,
|
|
3131
3131
|
paginationWithEdges: se,
|
|
3132
|
-
paginationWithControls:
|
|
3133
|
-
paginationActiveTextColor:
|
|
3134
|
-
paginationActiveBackgroundColor:
|
|
3135
|
-
paginationSize:
|
|
3136
|
-
paginationText:
|
|
3137
|
-
paginationWrapBreakpoint:
|
|
3138
|
-
getPaginationControlProps:
|
|
3139
|
-
getPaginationItemProps:
|
|
3140
|
-
noRecordsText:
|
|
3141
|
-
loadingText:
|
|
3142
|
-
recordsLength:
|
|
3143
|
-
renderPagination:
|
|
3132
|
+
paginationWithControls: ce,
|
|
3133
|
+
paginationActiveTextColor: le,
|
|
3134
|
+
paginationActiveBackgroundColor: B,
|
|
3135
|
+
paginationSize: ue,
|
|
3136
|
+
paginationText: de,
|
|
3137
|
+
paginationWrapBreakpoint: fe,
|
|
3138
|
+
getPaginationControlProps: pe,
|
|
3139
|
+
getPaginationItemProps: me,
|
|
3140
|
+
noRecordsText: Se,
|
|
3141
|
+
loadingText: be,
|
|
3142
|
+
recordsLength: Tt,
|
|
3143
|
+
renderPagination: V
|
|
3144
3144
|
}),
|
|
3145
3145
|
p(wr, {
|
|
3146
3146
|
fetching: h,
|
|
3147
|
-
backgroundBlur:
|
|
3148
|
-
customContent:
|
|
3149
|
-
size:
|
|
3150
|
-
type:
|
|
3151
|
-
color:
|
|
3147
|
+
backgroundBlur: he,
|
|
3148
|
+
customContent: ge,
|
|
3149
|
+
size: _e,
|
|
3150
|
+
type: ve,
|
|
3151
|
+
color: ye
|
|
3152
3152
|
}),
|
|
3153
3153
|
p(mn, {
|
|
3154
|
-
icon:
|
|
3155
|
-
text:
|
|
3156
|
-
active: !h && !
|
|
3157
|
-
children:
|
|
3154
|
+
icon: Ce,
|
|
3155
|
+
text: Se,
|
|
3156
|
+
active: !h && !Tt,
|
|
3157
|
+
children: xe
|
|
3158
3158
|
})
|
|
3159
3159
|
]
|
|
3160
3160
|
})
|
|
@@ -3164,18 +3164,18 @@ function Fr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
3164
3164
|
//#region src/DataTable/UpdateModal.tsx
|
|
3165
3165
|
function Ir({ fields: e, onClose: t, queryKey: n, connectedQueryKeys: r, apiPath: i, id: a, steps: o }) {
|
|
3166
3166
|
let { data: s, isLoading: c } = Ht(i, n, a), { mutateAsync: l, isPending: u, error: d } = Kt(i, n, r);
|
|
3167
|
-
return c || !s ? /* @__PURE__ */ m(
|
|
3167
|
+
return c || !s ? /* @__PURE__ */ m(L, {
|
|
3168
3168
|
gap: "md",
|
|
3169
3169
|
children: [
|
|
3170
|
-
/* @__PURE__ */ p(
|
|
3171
|
-
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(
|
|
3170
|
+
/* @__PURE__ */ p(re, { height: 40 }),
|
|
3171
|
+
Array.from({ length: e.length }).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, t)),
|
|
3172
3172
|
/* @__PURE__ */ m(T, {
|
|
3173
3173
|
mt: "md",
|
|
3174
3174
|
justify: "end",
|
|
3175
|
-
children: [/* @__PURE__ */ p(
|
|
3175
|
+
children: [/* @__PURE__ */ p(re, {
|
|
3176
3176
|
width: 100,
|
|
3177
3177
|
height: 36
|
|
3178
|
-
}), /* @__PURE__ */ p(
|
|
3178
|
+
}), /* @__PURE__ */ p(re, {
|
|
3179
3179
|
width: 100,
|
|
3180
3180
|
height: 36
|
|
3181
3181
|
})]
|
|
@@ -3210,7 +3210,7 @@ function Lr({ queryKey: e, connectedQueryKeys: t, apiPath: n, onClose: r, select
|
|
|
3210
3210
|
title: l.name,
|
|
3211
3211
|
children: l.message
|
|
3212
3212
|
}),
|
|
3213
|
-
/* @__PURE__ */ p(
|
|
3213
|
+
/* @__PURE__ */ p(B, { children: a ? a(h) : h.length === 1 ? `Soll ${h.length} Eintrag wirklich gelöscht werden?` : `Sollen ${h.length} Einträge wirklich gelöscht werden?` }),
|
|
3214
3214
|
/* @__PURE__ */ m(T, {
|
|
3215
3215
|
mt: "md",
|
|
3216
3216
|
justify: "end",
|
|
@@ -3360,7 +3360,7 @@ function Yr({ rows: e }) {
|
|
|
3360
3360
|
gap: "md",
|
|
3361
3361
|
py: "xs",
|
|
3362
3362
|
px: "sm",
|
|
3363
|
-
children: [/* @__PURE__ */ p(
|
|
3363
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3364
3364
|
fw: 700,
|
|
3365
3365
|
fz: "sm",
|
|
3366
3366
|
style: { flexShrink: 0 },
|
|
@@ -3394,13 +3394,13 @@ function Qr(e, t) {
|
|
|
3394
3394
|
let n = t.column;
|
|
3395
3395
|
if (n.render) return n.render(e, 0);
|
|
3396
3396
|
let r = Zr(e, n.accessor ?? t.id);
|
|
3397
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3397
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
3398
3398
|
c: "dimmed",
|
|
3399
3399
|
children: "–"
|
|
3400
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3400
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
3401
3401
|
fz: "sm",
|
|
3402
3402
|
children: r ? "Ja" : "Nein"
|
|
3403
|
-
}) : /* @__PURE__ */ p(
|
|
3403
|
+
}) : /* @__PURE__ */ p(B, {
|
|
3404
3404
|
fz: "sm",
|
|
3405
3405
|
children: String(r)
|
|
3406
3406
|
});
|
|
@@ -3414,29 +3414,29 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3414
3414
|
let n = new Set(t);
|
|
3415
3415
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
3416
3416
|
});
|
|
3417
|
-
}, 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),
|
|
3417
|
+
}, 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), te = w.filter((e) => e.column.sortable !== !1).reduce((e, t) => {
|
|
3418
3418
|
let n = t.column.accessor ?? t.id;
|
|
3419
3419
|
return e.some((e) => e.value === n) || e.push({
|
|
3420
3420
|
value: n,
|
|
3421
3421
|
label: t.column.title ?? t.id
|
|
3422
3422
|
}), e;
|
|
3423
|
-
}, []),
|
|
3423
|
+
}, []), ne = (e, t, n) => {
|
|
3424
3424
|
r?.({
|
|
3425
3425
|
record: e,
|
|
3426
3426
|
index: t,
|
|
3427
3427
|
event: n
|
|
3428
3428
|
});
|
|
3429
3429
|
};
|
|
3430
|
-
return /* @__PURE__ */ m(
|
|
3430
|
+
return /* @__PURE__ */ m(L, {
|
|
3431
3431
|
gap: "sm",
|
|
3432
3432
|
my: "md",
|
|
3433
3433
|
children: [
|
|
3434
|
-
(c &&
|
|
3434
|
+
(c && te.length > 0 || D.length > 0) && /* @__PURE__ */ m(T, {
|
|
3435
3435
|
gap: "xs",
|
|
3436
3436
|
wrap: "nowrap",
|
|
3437
3437
|
justify: "flex-end",
|
|
3438
|
-
children: [c &&
|
|
3439
|
-
data:
|
|
3438
|
+
children: [c && te.length > 0 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(I, {
|
|
3439
|
+
data: te,
|
|
3440
3440
|
value: c.field,
|
|
3441
3441
|
onChange: (e) => e && c.onSortChange(e, c.direction),
|
|
3442
3442
|
allowDeselect: !1,
|
|
@@ -3445,7 +3445,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3445
3445
|
variant: "filled",
|
|
3446
3446
|
size: "input-sm",
|
|
3447
3447
|
onClick: () => c.onSortChange(c.field, c.direction === "asc" ? "desc" : "asc"),
|
|
3448
|
-
children: c.direction === "asc" ? /* @__PURE__ */ p(
|
|
3448
|
+
children: c.direction === "asc" ? /* @__PURE__ */ p(Ee, { size: 18 }) : /* @__PURE__ */ p(De, { size: 18 })
|
|
3449
3449
|
})] }), D.length > 0 && /* @__PURE__ */ m(P, {
|
|
3450
3450
|
opened: M,
|
|
3451
3451
|
onChange: N,
|
|
@@ -3463,7 +3463,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3463
3463
|
size: "input-sm",
|
|
3464
3464
|
onClick: () => N((e) => !e),
|
|
3465
3465
|
"aria-label": "Filter",
|
|
3466
|
-
children: /* @__PURE__ */ p(
|
|
3466
|
+
children: /* @__PURE__ */ p(Se, { size: 18 })
|
|
3467
3467
|
})
|
|
3468
3468
|
}) }), /* @__PURE__ */ p(P.Dropdown, {
|
|
3469
3469
|
p: 0,
|
|
@@ -3478,7 +3478,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3478
3478
|
value: e.id,
|
|
3479
3479
|
children: [/* @__PURE__ */ p(h.Control, { children: /* @__PURE__ */ m(T, {
|
|
3480
3480
|
gap: "xs",
|
|
3481
|
-
children: [/* @__PURE__ */ p(
|
|
3481
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3482
3482
|
fw: 600,
|
|
3483
3483
|
fz: "sm",
|
|
3484
3484
|
children: e.column.title ?? e.id
|
|
@@ -3494,7 +3494,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3494
3494
|
})]
|
|
3495
3495
|
})]
|
|
3496
3496
|
}),
|
|
3497
|
-
e.length === 0 && /* @__PURE__ */ p(
|
|
3497
|
+
e.length === 0 && /* @__PURE__ */ p(B, {
|
|
3498
3498
|
c: "dimmed",
|
|
3499
3499
|
ta: "center",
|
|
3500
3500
|
py: "xl",
|
|
@@ -3513,7 +3513,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3513
3513
|
w: "100%",
|
|
3514
3514
|
style: { cursor: r || c ? "pointer" : "default" },
|
|
3515
3515
|
onClick: (t) => {
|
|
3516
|
-
c && !r ? x(s) :
|
|
3516
|
+
c && !r ? x(s) : ne(e, n, t);
|
|
3517
3517
|
},
|
|
3518
3518
|
children: [i && i.length > 0 && /* @__PURE__ */ p(T, {
|
|
3519
3519
|
px: "sm",
|
|
@@ -3529,7 +3529,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3529
3529
|
color: "gray",
|
|
3530
3530
|
size: "sm",
|
|
3531
3531
|
onClick: (e) => e.stopPropagation(),
|
|
3532
|
-
children: /* @__PURE__ */ p(
|
|
3532
|
+
children: /* @__PURE__ */ p(xe, { size: 16 })
|
|
3533
3533
|
}) }), /* @__PURE__ */ p(O.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(O.Item, {
|
|
3534
3534
|
leftSection: t.icon,
|
|
3535
3535
|
onClick: (n) => {
|
|
@@ -3553,7 +3553,7 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3553
3553
|
})]
|
|
3554
3554
|
}) }, s);
|
|
3555
3555
|
}),
|
|
3556
|
-
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(
|
|
3556
|
+
s && s.totalRecords > s.recordsPerPage && /* @__PURE__ */ m(L, {
|
|
3557
3557
|
gap: "xs",
|
|
3558
3558
|
mt: "sm",
|
|
3559
3559
|
children: [/* @__PURE__ */ p(T, {
|
|
@@ -3567,11 +3567,11 @@ function $r({ records: e, fields: n, onRowClick: r, actions: i, canUpdate: a, ca
|
|
|
3567
3567
|
}), s.recordsPerPageOptions && s.onRecordsPerPageChange && /* @__PURE__ */ m(T, {
|
|
3568
3568
|
justify: "center",
|
|
3569
3569
|
gap: "xs",
|
|
3570
|
-
children: [/* @__PURE__ */ p(
|
|
3570
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3571
3571
|
fz: "xs",
|
|
3572
3572
|
c: "dimmed",
|
|
3573
3573
|
children: "Einträge pro Seite:"
|
|
3574
|
-
}), /* @__PURE__ */ p(
|
|
3574
|
+
}), /* @__PURE__ */ p(I, {
|
|
3575
3575
|
data: s.recordsPerPageOptions.map((e) => ({
|
|
3576
3576
|
value: String(e),
|
|
3577
3577
|
label: String(e)
|
|
@@ -3596,21 +3596,33 @@ var ei = [
|
|
|
3596
3596
|
100,
|
|
3597
3597
|
500
|
|
3598
3598
|
];
|
|
3599
|
-
function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutationApiPath: a, buttons: o, fields: c, selection: l, pagination: h, filters: b, actions: x, steps: S, defaultSort: C, onSortChange: E, createButtonText: D, queryParams: k, tabs: A, defaultTab: j, activeTab: N, onActiveTabChange: ee, canUpdate: P, canDelete:
|
|
3600
|
-
let [
|
|
3601
|
-
N === void 0 &&
|
|
3602
|
-
},
|
|
3599
|
+
function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutationApiPath: a, buttons: o, fields: c, selection: l, pagination: h, filters: b, actions: x, steps: S, defaultSort: C, onSortChange: E, createButtonText: D, queryParams: k, tabs: A, defaultTab: j, activeTab: N, onActiveTabChange: ee, canUpdate: P, canDelete: te, showRefresh: ne = !0, onRefresh: F, autoPoll: I, rowExpansion: R, onRowClick: ie, mobileCards: ae = !1, deleteConfirmMessage: oe, editRecordId: z, onEditRecordIdChange: se }) {
|
|
3600
|
+
let [ce, B] = d(j || (A && A.length > 0 ? A[0].value : null)), ue = N === void 0 ? ce : N, de = (e) => {
|
|
3601
|
+
N === void 0 && B(e), ee && ee(e);
|
|
3602
|
+
}, pe = A?.find((e) => e.value === ue), me = pe?.queryParams || {}, V = pe?.apiPath ?? r, he = pe?.mutationApiPath ?? a ?? V, ge = {
|
|
3603
3603
|
...k,
|
|
3604
|
-
...
|
|
3605
|
-
},
|
|
3604
|
+
...me
|
|
3605
|
+
}, _e = ge ? "?" + Object.entries(ge).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", ve = ue ? [...t, ue] : t, { data: xe, isLoading: Se, isError: Ee, isRefetching: De, refetch: ke } = Ut(V + _e, ve), Ae = Jr(Array.isArray(xe) ? xe : [], b), [je, Me] = d(!1), Ne = u(() => {});
|
|
3606
|
+
s(() => {
|
|
3607
|
+
Ne.current = F ?? (() => ke());
|
|
3608
|
+
});
|
|
3609
|
+
let Pe = typeof I == "function" ? I(Array.isArray(xe) ? xe : []) : I ?? !1;
|
|
3610
|
+
s(() => {
|
|
3611
|
+
if (!Pe) return;
|
|
3612
|
+
let e = setInterval(() => {
|
|
3613
|
+
Promise.resolve(Ne.current()).catch(() => {});
|
|
3614
|
+
}, Pe);
|
|
3615
|
+
return () => clearInterval(e);
|
|
3616
|
+
}, [Pe]);
|
|
3617
|
+
let [H, Fe] = d({
|
|
3606
3618
|
columnAccessor: C?.field ?? c[0].id,
|
|
3607
3619
|
direction: C?.direction ?? "desc"
|
|
3608
|
-
}),
|
|
3609
|
-
|
|
3610
|
-
},
|
|
3611
|
-
|
|
3612
|
-
},
|
|
3613
|
-
if (t !==
|
|
3620
|
+
}), Ie = (e) => {
|
|
3621
|
+
Fe(e), E && E(String(e.columnAccessor), e.direction);
|
|
3622
|
+
}, U = Hr(Ae, H.columnAccessor, H.direction), [Le, Re] = Rr(ei[1], "mantine-table-page-size"), [ze, Be] = d(1), Ve = h ? U.slice((ze - 1) * Le, ze * Le) : U, [He, W] = d([]), Ue = R?.expanded?.recordIds ?? He, We = R?.expanded?.onRecordIdsChange ?? W, Ge = (e) => {
|
|
3623
|
+
Ue.includes(e) ? We(Ue.filter((t) => t !== e)) : We(R?.allowMultiple ? [...Ue, e] : [e]);
|
|
3624
|
+
}, Ke = c.findIndex((e) => e.list && e.column && !e.column.hidden), qe = R && Ke >= 0 ? c.map((e, t) => {
|
|
3625
|
+
if (t !== Ke) return e;
|
|
3614
3626
|
let n = e.column.render;
|
|
3615
3627
|
return {
|
|
3616
3628
|
...e,
|
|
@@ -3620,22 +3632,22 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3620
3632
|
gap: "xs",
|
|
3621
3633
|
wrap: "nowrap",
|
|
3622
3634
|
align: "center",
|
|
3623
|
-
children: [!
|
|
3635
|
+
children: [!R.expandable || R.expandable(t) ? /* @__PURE__ */ p(v, {
|
|
3624
3636
|
component: "span",
|
|
3625
3637
|
"aria-label": "Aufklappen",
|
|
3626
3638
|
onClick: (e) => {
|
|
3627
|
-
e.stopPropagation(),
|
|
3639
|
+
e.stopPropagation(), Ge(t.id);
|
|
3628
3640
|
},
|
|
3629
3641
|
style: {
|
|
3630
3642
|
display: "inline-flex",
|
|
3631
3643
|
flexShrink: 0,
|
|
3632
3644
|
cursor: "pointer"
|
|
3633
3645
|
},
|
|
3634
|
-
children: /* @__PURE__ */ p(
|
|
3646
|
+
children: /* @__PURE__ */ p(be, {
|
|
3635
3647
|
size: 16,
|
|
3636
3648
|
style: {
|
|
3637
3649
|
color: "var(--mantine-primary-color-filled)",
|
|
3638
|
-
transform:
|
|
3650
|
+
transform: Ue.includes(t.id) ? "rotate(90deg)" : void 0,
|
|
3639
3651
|
transition: "transform 200ms ease"
|
|
3640
3652
|
}
|
|
3641
3653
|
})
|
|
@@ -3646,32 +3658,32 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3646
3658
|
})
|
|
3647
3659
|
}
|
|
3648
3660
|
};
|
|
3649
|
-
}) : c, [
|
|
3661
|
+
}) : c, [G, K] = d([]);
|
|
3650
3662
|
s(() => {
|
|
3651
|
-
|
|
3652
|
-
}, [
|
|
3653
|
-
let [
|
|
3663
|
+
K([]);
|
|
3664
|
+
}, [ue]);
|
|
3665
|
+
let [Je, Ye] = d(!1), [Xe, Ze] = d(!1), [Qe, $e] = d(!1), et = u(null);
|
|
3654
3666
|
s(() => {
|
|
3655
3667
|
if (!z) {
|
|
3656
|
-
|
|
3668
|
+
et.current = null;
|
|
3657
3669
|
return;
|
|
3658
3670
|
}
|
|
3659
|
-
if (
|
|
3660
|
-
let e =
|
|
3661
|
-
e && (
|
|
3662
|
-
}, [z,
|
|
3663
|
-
let
|
|
3664
|
-
return
|
|
3665
|
-
icon: /* @__PURE__ */ p(
|
|
3671
|
+
if (et.current === z) return;
|
|
3672
|
+
let e = U.find((e) => e.id === z);
|
|
3673
|
+
e && (et.current = z, K([e]), Ze(!0), se?.(null));
|
|
3674
|
+
}, [z, U]);
|
|
3675
|
+
let tt = c.some((e) => e.update), nt = c.some((e) => e.delete), rt = [];
|
|
3676
|
+
return tt && rt.push({
|
|
3677
|
+
icon: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3666
3678
|
label: "Bearbeiten",
|
|
3667
3679
|
onClick: (e) => {
|
|
3668
|
-
|
|
3680
|
+
K(e), Ze(!0);
|
|
3669
3681
|
}
|
|
3670
|
-
}), x &&
|
|
3671
|
-
icon: /* @__PURE__ */ p(
|
|
3682
|
+
}), x && rt.push(...x), nt && rt.push({
|
|
3683
|
+
icon: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3672
3684
|
label: "Löschen",
|
|
3673
3685
|
onClick: (e) => {
|
|
3674
|
-
|
|
3686
|
+
K(e), $e(!0);
|
|
3675
3687
|
}
|
|
3676
3688
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3677
3689
|
/* @__PURE__ */ m(w, {
|
|
@@ -3686,7 +3698,7 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3686
3698
|
},
|
|
3687
3699
|
justify: e ? "space-between" : "flex-end",
|
|
3688
3700
|
wrap: "wrap",
|
|
3689
|
-
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(
|
|
3701
|
+
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(fe, {
|
|
3690
3702
|
order: 4,
|
|
3691
3703
|
children: e
|
|
3692
3704
|
}) : e), /* @__PURE__ */ m(w, {
|
|
@@ -3709,39 +3721,49 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3709
3721
|
sm: "auto"
|
|
3710
3722
|
},
|
|
3711
3723
|
children: [
|
|
3712
|
-
|
|
3724
|
+
ne && /* @__PURE__ */ p(g, {
|
|
3713
3725
|
variant: "subtle",
|
|
3714
|
-
|
|
3726
|
+
loading: je,
|
|
3727
|
+
onClick: async () => {
|
|
3728
|
+
if (F) {
|
|
3729
|
+
Me(!0);
|
|
3730
|
+
try {
|
|
3731
|
+
await F();
|
|
3732
|
+
} finally {
|
|
3733
|
+
Me(!1);
|
|
3734
|
+
}
|
|
3735
|
+
} else ke();
|
|
3736
|
+
},
|
|
3715
3737
|
"aria-label": "Neuladen",
|
|
3716
|
-
children: /* @__PURE__ */ p(
|
|
3738
|
+
children: /* @__PURE__ */ p(Te, {})
|
|
3717
3739
|
}),
|
|
3718
3740
|
(c.some((e) => e.update) || l) && (() => {
|
|
3719
|
-
let e = c.find((e) => e.update) && (!P ||
|
|
3741
|
+
let e = c.find((e) => e.update) && (!P || G.length > 0 && P(G[0])), t = c.find((e) => e.delete) && (!te || G.length > 0 && te(G[0])), n = (x ?? []).length > 0, r = e || t || n;
|
|
3720
3742
|
return /* @__PURE__ */ p(v, {
|
|
3721
|
-
...
|
|
3743
|
+
...ae ? { visibleFrom: "sm" } : {},
|
|
3722
3744
|
children: /* @__PURE__ */ m(O, {
|
|
3723
3745
|
shadow: "md",
|
|
3724
3746
|
children: [/* @__PURE__ */ p(O.Target, { children: /* @__PURE__ */ p(y, {
|
|
3725
3747
|
variant: "outline",
|
|
3726
|
-
rightSection: /* @__PURE__ */ p(
|
|
3727
|
-
disabled: !
|
|
3748
|
+
rightSection: /* @__PURE__ */ p(ye, { size: 14 }),
|
|
3749
|
+
disabled: !G.length || !r,
|
|
3728
3750
|
children: "Aktionen"
|
|
3729
3751
|
}) }), /* @__PURE__ */ m(O.Dropdown, { children: [
|
|
3730
3752
|
e && /* @__PURE__ */ p(O.Item, {
|
|
3731
|
-
leftSection: /* @__PURE__ */ p(
|
|
3732
|
-
onClick: () =>
|
|
3733
|
-
disabled:
|
|
3753
|
+
leftSection: /* @__PURE__ */ p(we, { size: 14 }),
|
|
3754
|
+
onClick: () => Ze(!0),
|
|
3755
|
+
disabled: G.length !== 1,
|
|
3734
3756
|
children: "Bearbeiten"
|
|
3735
3757
|
}),
|
|
3736
3758
|
(x ?? []).map((e, t) => /* @__PURE__ */ i(O.Item, {
|
|
3737
3759
|
...e.icon && { leftSection: e.icon },
|
|
3738
3760
|
key: `custom_action_${t}`,
|
|
3739
|
-
onClick: () => e.onClick(
|
|
3740
|
-
disabled: e.disabled?.(
|
|
3761
|
+
onClick: () => e.onClick(G),
|
|
3762
|
+
disabled: e.disabled?.(G) ?? !1
|
|
3741
3763
|
}, e.label)),
|
|
3742
3764
|
t && /* @__PURE__ */ p(O.Item, {
|
|
3743
|
-
leftSection: /* @__PURE__ */ p(
|
|
3744
|
-
onClick: () =>
|
|
3765
|
+
leftSection: /* @__PURE__ */ p(Oe, { size: 14 }),
|
|
3766
|
+
onClick: () => $e(!0),
|
|
3745
3767
|
color: "red",
|
|
3746
3768
|
children: "Löschen"
|
|
3747
3769
|
})
|
|
@@ -3750,169 +3772,169 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3750
3772
|
});
|
|
3751
3773
|
})(),
|
|
3752
3774
|
c.find((e) => e.create) && /* @__PURE__ */ p(y, {
|
|
3753
|
-
onClick: () =>
|
|
3754
|
-
disabled:
|
|
3775
|
+
onClick: () => Ye(!0),
|
|
3776
|
+
disabled: Se,
|
|
3755
3777
|
children: D ?? "Erstellen"
|
|
3756
3778
|
}),
|
|
3757
3779
|
o
|
|
3758
3780
|
]
|
|
3759
3781
|
})]
|
|
3760
3782
|
}),
|
|
3761
|
-
A && A.length > 0 && /* @__PURE__ */ p(
|
|
3762
|
-
value:
|
|
3763
|
-
onChange:
|
|
3783
|
+
A && A.length > 0 && /* @__PURE__ */ p(le, {
|
|
3784
|
+
value: ue,
|
|
3785
|
+
onChange: de,
|
|
3764
3786
|
mt: "md",
|
|
3765
|
-
children: /* @__PURE__ */ p(
|
|
3787
|
+
children: /* @__PURE__ */ p(le.List, { children: A.map((e) => /* @__PURE__ */ p(le.Tab, {
|
|
3766
3788
|
value: e.value,
|
|
3767
3789
|
leftSection: e.icon,
|
|
3768
3790
|
children: e.label
|
|
3769
3791
|
}, e.value)) })
|
|
3770
3792
|
}),
|
|
3771
|
-
|
|
3793
|
+
Ee && /* @__PURE__ */ p(_, {
|
|
3772
3794
|
mt: "md",
|
|
3773
3795
|
variant: "light",
|
|
3774
3796
|
color: "red",
|
|
3775
3797
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3776
|
-
icon: /* @__PURE__ */ p(
|
|
3798
|
+
icon: /* @__PURE__ */ p(Ce, {}),
|
|
3777
3799
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3778
3800
|
}),
|
|
3779
|
-
(
|
|
3801
|
+
(Se || De) && /* @__PURE__ */ m(L, {
|
|
3780
3802
|
my: "md",
|
|
3781
|
-
children: [/* @__PURE__ */ p(
|
|
3803
|
+
children: [/* @__PURE__ */ p(re, { height: 40 }), [
|
|
3782
3804
|
,
|
|
3783
3805
|
,
|
|
3784
3806
|
,
|
|
3785
3807
|
,
|
|
3786
3808
|
,
|
|
3787
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3809
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(re, { height: 35 }, `skeleton-${t}`))]
|
|
3788
3810
|
}),
|
|
3789
|
-
!
|
|
3790
|
-
...
|
|
3811
|
+
!Se && !De && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(v, {
|
|
3812
|
+
...ae ? { visibleFrom: "sm" } : {},
|
|
3791
3813
|
children: /* @__PURE__ */ p(Fr, {
|
|
3792
3814
|
my: "md",
|
|
3793
3815
|
striped: !0,
|
|
3794
3816
|
highlightOnHover: !0,
|
|
3795
3817
|
minHeight: 150,
|
|
3796
|
-
fetching:
|
|
3797
|
-
records:
|
|
3798
|
-
sortStatus:
|
|
3799
|
-
onSortStatusChange:
|
|
3818
|
+
fetching: Ee,
|
|
3819
|
+
records: Ve,
|
|
3820
|
+
sortStatus: H,
|
|
3821
|
+
onSortStatusChange: Ie,
|
|
3800
3822
|
...l && {
|
|
3801
|
-
selectedRecords:
|
|
3802
|
-
onSelectedRecordsChange:
|
|
3823
|
+
selectedRecords: G,
|
|
3824
|
+
onSelectedRecordsChange: K
|
|
3803
3825
|
},
|
|
3804
|
-
...h &&
|
|
3805
|
-
totalRecords:
|
|
3806
|
-
recordsPerPage:
|
|
3807
|
-
onPageChange:
|
|
3808
|
-
page:
|
|
3826
|
+
...h && Ve.length && {
|
|
3827
|
+
totalRecords: U.length,
|
|
3828
|
+
recordsPerPage: Le,
|
|
3829
|
+
onPageChange: Be,
|
|
3830
|
+
page: ze,
|
|
3809
3831
|
recordsPerPageOptions: ei,
|
|
3810
|
-
onRecordsPerPageChange:
|
|
3832
|
+
onRecordsPerPageChange: Re,
|
|
3811
3833
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3812
3834
|
},
|
|
3813
|
-
...
|
|
3814
|
-
allowMultiple:
|
|
3815
|
-
trigger:
|
|
3816
|
-
content: ({ record: e }) =>
|
|
3835
|
+
...R && { rowExpansion: {
|
|
3836
|
+
allowMultiple: R.allowMultiple ?? !1,
|
|
3837
|
+
trigger: ie ? "never" : "click",
|
|
3838
|
+
content: ({ record: e }) => R.content(e, !1),
|
|
3817
3839
|
expanded: {
|
|
3818
|
-
recordIds:
|
|
3819
|
-
onRecordIdsChange:
|
|
3840
|
+
recordIds: Ue,
|
|
3841
|
+
onRecordIdsChange: We
|
|
3820
3842
|
},
|
|
3821
|
-
...
|
|
3843
|
+
...R.expandable && { expandable: ({ record: e }) => R.expandable(e) }
|
|
3822
3844
|
} },
|
|
3823
|
-
columns:
|
|
3845
|
+
columns: qe.map((e) => e.column),
|
|
3824
3846
|
noRecordsText: "Keine Einträge gefunden",
|
|
3825
|
-
onRowClick:
|
|
3826
|
-
...
|
|
3847
|
+
onRowClick: ie,
|
|
3848
|
+
...ie && { style: { cursor: "pointer" } }
|
|
3827
3849
|
})
|
|
3828
|
-
}),
|
|
3850
|
+
}), ae && /* @__PURE__ */ p(v, {
|
|
3829
3851
|
hiddenFrom: "sm",
|
|
3830
3852
|
children: /* @__PURE__ */ p($r, {
|
|
3831
|
-
records:
|
|
3832
|
-
fields:
|
|
3833
|
-
onRowClick:
|
|
3853
|
+
records: Ve,
|
|
3854
|
+
fields: qe,
|
|
3855
|
+
onRowClick: ie,
|
|
3834
3856
|
sort: {
|
|
3835
|
-
field: String(
|
|
3836
|
-
direction:
|
|
3857
|
+
field: String(H.columnAccessor),
|
|
3858
|
+
direction: H.direction,
|
|
3837
3859
|
onSortChange: (e, t) => {
|
|
3838
|
-
|
|
3860
|
+
Ie({
|
|
3839
3861
|
columnAccessor: e,
|
|
3840
3862
|
direction: t
|
|
3841
3863
|
});
|
|
3842
3864
|
}
|
|
3843
3865
|
},
|
|
3844
|
-
...h &&
|
|
3845
|
-
totalRecords:
|
|
3846
|
-
recordsPerPage:
|
|
3847
|
-
page:
|
|
3848
|
-
onPageChange:
|
|
3866
|
+
...h && Ve.length && { pagination: {
|
|
3867
|
+
totalRecords: U.length,
|
|
3868
|
+
recordsPerPage: Le,
|
|
3869
|
+
page: ze,
|
|
3870
|
+
onPageChange: Be,
|
|
3849
3871
|
recordsPerPageOptions: ei,
|
|
3850
3872
|
onRecordsPerPageChange: (e) => {
|
|
3851
|
-
|
|
3873
|
+
Re(e), Be(1);
|
|
3852
3874
|
}
|
|
3853
3875
|
} },
|
|
3854
|
-
...
|
|
3855
|
-
content:
|
|
3876
|
+
...R && { rowExpansion: {
|
|
3877
|
+
content: R.content,
|
|
3856
3878
|
expanded: {
|
|
3857
|
-
recordIds:
|
|
3858
|
-
onRecordIdsChange:
|
|
3879
|
+
recordIds: Ue,
|
|
3880
|
+
onRecordIdsChange: We
|
|
3859
3881
|
},
|
|
3860
|
-
...
|
|
3882
|
+
...R.expandable && { expandable: R.expandable }
|
|
3861
3883
|
} },
|
|
3862
|
-
...
|
|
3863
|
-
actions:
|
|
3884
|
+
...rt.length > 0 && {
|
|
3885
|
+
actions: rt,
|
|
3864
3886
|
canUpdate: P,
|
|
3865
|
-
canDelete:
|
|
3887
|
+
canDelete: te
|
|
3866
3888
|
}
|
|
3867
3889
|
})
|
|
3868
3890
|
})] }),
|
|
3869
3891
|
/* @__PURE__ */ p(M, {
|
|
3870
|
-
opened:
|
|
3892
|
+
opened: Xe,
|
|
3871
3893
|
onClose: () => {
|
|
3872
|
-
|
|
3894
|
+
Ze(!1), K([]);
|
|
3873
3895
|
},
|
|
3874
3896
|
title: e ?? "Bearbeiten",
|
|
3875
|
-
children:
|
|
3897
|
+
children: G.length > 0 && /* @__PURE__ */ p(Ir, {
|
|
3876
3898
|
fields: c.filter((e) => e.update),
|
|
3877
3899
|
queryKey: t,
|
|
3878
3900
|
connectedQueryKeys: n,
|
|
3879
|
-
apiPath:
|
|
3880
|
-
id:
|
|
3901
|
+
apiPath: he,
|
|
3902
|
+
id: G[0].id,
|
|
3881
3903
|
onClose: () => {
|
|
3882
|
-
|
|
3904
|
+
Ze(!1), K([]);
|
|
3883
3905
|
},
|
|
3884
3906
|
steps: S
|
|
3885
3907
|
})
|
|
3886
3908
|
}),
|
|
3887
|
-
|
|
3888
|
-
opened:
|
|
3909
|
+
G.length > 0 && /* @__PURE__ */ p(M, {
|
|
3910
|
+
opened: Qe,
|
|
3889
3911
|
onClose: () => {
|
|
3890
|
-
|
|
3912
|
+
$e(!1), K([]);
|
|
3891
3913
|
},
|
|
3892
3914
|
title: e ?? "Löschen",
|
|
3893
3915
|
children: /* @__PURE__ */ p(Lr, {
|
|
3894
3916
|
onClose: () => {
|
|
3895
|
-
|
|
3917
|
+
$e(!1), K([]);
|
|
3896
3918
|
},
|
|
3897
3919
|
queryKey: t,
|
|
3898
3920
|
connectedQueryKeys: n,
|
|
3899
|
-
apiPath:
|
|
3900
|
-
selectedRecords:
|
|
3901
|
-
confirmMessage:
|
|
3921
|
+
apiPath: he,
|
|
3922
|
+
selectedRecords: G,
|
|
3923
|
+
confirmMessage: oe
|
|
3902
3924
|
})
|
|
3903
3925
|
}),
|
|
3904
3926
|
/* @__PURE__ */ p(M, {
|
|
3905
|
-
opened:
|
|
3927
|
+
opened: Je,
|
|
3906
3928
|
onClose: () => {
|
|
3907
|
-
|
|
3929
|
+
Ye(!1);
|
|
3908
3930
|
},
|
|
3909
3931
|
title: e ?? "Anlegen",
|
|
3910
3932
|
children: /* @__PURE__ */ p(rn, {
|
|
3911
3933
|
queryKey: t,
|
|
3912
3934
|
connectedQueryKeys: n,
|
|
3913
|
-
apiPath:
|
|
3935
|
+
apiPath: he,
|
|
3914
3936
|
onClose: () => {
|
|
3915
|
-
|
|
3937
|
+
Ye(!1);
|
|
3916
3938
|
},
|
|
3917
3939
|
fields: c.filter((e) => e.create),
|
|
3918
3940
|
steps: S
|
|
@@ -3923,7 +3945,7 @@ function ti({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3923
3945
|
//#endregion
|
|
3924
3946
|
//#region src/DataTable/SubTable.tsx
|
|
3925
3947
|
function ni({ mobile: e, columns: t, ...n }) {
|
|
3926
|
-
return e ? /* @__PURE__ */ p(
|
|
3948
|
+
return e ? /* @__PURE__ */ p(L, {
|
|
3927
3949
|
gap: "sm",
|
|
3928
3950
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
3929
3951
|
children: (n.records ?? []).map((e, r) => {
|
|
@@ -3939,6 +3961,6 @@ function ni({ mobile: e, columns: t, ...n }) {
|
|
|
3939
3961
|
});
|
|
3940
3962
|
}
|
|
3941
3963
|
//#endregion
|
|
3942
|
-
export { rn as CreateModal, ti as DataTable,
|
|
3964
|
+
export { rn as CreateModal, ti as DataTable, jt as DataTableProvider, Lr as DeleteModal, Xr as FieldCard, $r as MobileCardList, ni as SubTable, Ir as UpdateModal, Bt as api, zt as createOne, Rt as deleteOne, It as getAll, Lt as getOne, Hr as sortData, Vt as updateOne, Gt as useAddOne, Y as useDataTable, qt as useDeleteOne, Ut as useGetAll, Ht as useGetOne, Rr as usePersistentState, Kt as useUpdateOne };
|
|
3943
3965
|
|
|
3944
3966
|
//# sourceMappingURL=index.es.js.map
|