@espresso-lab/mantine-data-table 2.1.5 → 2.1.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/index.es.js +1428 -1046
- 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 +19 -19
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 { ActionIcon as h, Alert as g, Box as _, Button as v, Center as y, Checkbox as b, Collapse as x, Divider as S, Flex as C, Group as w, Loader as T, Menu as E, MenuDropdown as D, MenuItem as O, MenuTarget as k, Modal as A, NumberInput as j, Pagination as M, Popover as N, PopoverDropdown as P, PopoverTarget as ee, ScrollArea as F, Select as
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { DateInput as
|
|
7
|
-
import { IconCaretDownFilled as
|
|
8
|
-
import { useClickOutside as
|
|
4
|
+
import { ActionIcon as h, Alert as g, Box as _, Button as v, Center as y, Checkbox as b, Collapse as x, Divider as S, Flex as C, Group as w, Loader as T, Menu as E, MenuDropdown as D, MenuItem as O, MenuTarget as k, Modal as A, NumberInput as j, Pagination as M, Popover as N, PopoverDropdown as P, PopoverTarget as ee, ScrollArea as F, Select as te, Skeleton as I, Stack as L, Stepper as R, Table as ne, TableTd as re, TableTfoot as ie, TableTh as ae, TableThead as oe, TableTr as z, Tabs as se, Text as B, TextInput as ce, Textarea as le, Title as ue, createSafeContext as de, parseThemeColor as fe, rem as V, useDirection as pe, useMantineTheme as me } from "@mantine/core";
|
|
5
|
+
import { useForm as he } from "@mantine/form";
|
|
6
|
+
import { DateInput as ge } from "@mantine/dates";
|
|
7
|
+
import { IconCaretDownFilled as _e, IconChevronDown as ve, IconDotsVertical as ye, IconInfoCircle as be, IconPencil as xe, IconRefresh as Se, IconSortAscending as Ce, IconSortDescending as we, IconTrash as Te } from "@tabler/icons-react";
|
|
8
|
+
import { useClickOutside as Ee, useDisclosure as De, useLocalStorage as H, useMediaQuery as Oe, useMergedRef as ke, useTimeout as Ae } from "@mantine/hooks";
|
|
9
9
|
//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
10
10
|
var U = class {
|
|
11
11
|
constructor() {
|
|
@@ -91,80 +91,80 @@ function Me(e) {
|
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region node_modules/@tanstack/query-core/build/modern/utils.js
|
|
93
93
|
var Ne = typeof window > "u" || "Deno" in globalThis;
|
|
94
|
-
function
|
|
95
|
-
function
|
|
94
|
+
function Pe() {}
|
|
95
|
+
function Fe(e) {
|
|
96
96
|
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Ie(e, t) {
|
|
99
99
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Le(e, t) {
|
|
102
102
|
return typeof e == "function" ? e(t) : e;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function K(e, t) {
|
|
105
105
|
return typeof e == "function" ? e(t) : e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return JSON.stringify(e, (e, t) =>
|
|
107
|
+
function Re(e) {
|
|
108
|
+
return JSON.stringify(e, (e, t) => Ue(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var ze = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Be(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 = He(e) && He(t);
|
|
115
|
+
if (!r && !(Ue(e) && Ue(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 : ze.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 = Be(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 Ve(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 He(e) {
|
|
138
138
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!
|
|
140
|
+
function Ue(e) {
|
|
141
|
+
if (!We(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 !(!We(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function We(e) {
|
|
148
148
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Ge(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 Be(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 Be(e, t);
|
|
159
159
|
}
|
|
160
160
|
return t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Ke(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 qe = /* @__PURE__ */ (() => {
|
|
168
168
|
let e = () => Ne;
|
|
169
169
|
return {
|
|
170
170
|
isServer() {
|
|
@@ -177,7 +177,7 @@ var Ke = /* @__PURE__ */ (() => {
|
|
|
177
177
|
})();
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
180
|
-
function
|
|
180
|
+
function Je() {
|
|
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 Ye = Me;
|
|
203
|
+
function Xe() {
|
|
204
204
|
let e = [], t = 0, n = (e) => {
|
|
205
205
|
e();
|
|
206
206
|
}, r = (e) => {
|
|
207
207
|
e();
|
|
208
|
-
}, i =
|
|
208
|
+
}, i = Ye, a = (r) => {
|
|
209
209
|
t ? e.push(r) : i(() => {
|
|
210
210
|
n(r);
|
|
211
211
|
});
|
|
@@ -247,7 +247,7 @@ function Ye() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var Ze = Xe(), Qe = new class extends U {
|
|
251
251
|
#e = !0;
|
|
252
252
|
#t;
|
|
253
253
|
#n;
|
|
@@ -281,16 +281,16 @@ var Xe = Ye(), Ze = 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 $e(e) {
|
|
285
|
+
return (e ?? "online") === "online" ? Qe.isOnline() : !0;
|
|
286
286
|
}
|
|
287
287
|
//#endregion
|
|
288
288
|
//#region node_modules/@tanstack/query-core/build/modern/query.js
|
|
289
|
-
function
|
|
289
|
+
function et(e, t) {
|
|
290
290
|
return {
|
|
291
291
|
fetchFailureCount: 0,
|
|
292
292
|
fetchFailureReason: null,
|
|
293
|
-
fetchStatus:
|
|
293
|
+
fetchStatus: $e(t.networkMode) ? "fetching" : "paused",
|
|
294
294
|
...e === void 0 && {
|
|
295
295
|
error: null,
|
|
296
296
|
status: "pending"
|
|
@@ -299,9 +299,9 @@ function $e(e, t) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
302
|
-
var
|
|
302
|
+
var tt = class extends U {
|
|
303
303
|
constructor(e, t) {
|
|
304
|
-
super(), this.options = t, this.#e = e, this.#s = null, this.#o =
|
|
304
|
+
super(), this.options = t, this.#e = e, this.#s = null, this.#o = Je(), this.bindMethods(), this.setOptions(t);
|
|
305
305
|
}
|
|
306
306
|
#e;
|
|
307
307
|
#t = void 0;
|
|
@@ -322,36 +322,36 @@ var et = 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), rt(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 it(this.#t, this.options, this.options.refetchOnReconnect);
|
|
332
332
|
}
|
|
333
333
|
shouldFetchOnWindowFocus() {
|
|
334
|
-
return
|
|
334
|
+
return it(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
335
335
|
}
|
|
336
336
|
destroy() {
|
|
337
337
|
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
338
338
|
}
|
|
339
339
|
setOptions(e) {
|
|
340
340
|
let t = this.options, n = this.#t;
|
|
341
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
342
|
-
this.#S(), this.#t.setOptions(this.options), t._defaulted && !
|
|
341
|
+
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof K(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
342
|
+
this.#S(), this.#t.setOptions(this.options), t._defaulted && !Ve(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 && at(this.#t, n, this.options, t) && this.#h(), this.updateResult(), r && (this.#t !== n || K(this.options.enabled, this.#t) !== K(t.enabled, this.#t) || Le(this.options.staleTime, this.#t) !== Le(t.staleTime, this.#t)) && this.#g();
|
|
349
349
|
let i = this.#_();
|
|
350
|
-
r && (this.#t !== n ||
|
|
350
|
+
r && (this.#t !== n || K(this.options.enabled, this.#t) !== K(t.enabled, this.#t) || i !== this.#p) && this.#v(i);
|
|
351
351
|
}
|
|
352
352
|
getOptimisticResult(e) {
|
|
353
353
|
let t = this.#e.getQueryCache().build(this.#e, e), n = this.createResult(t, e);
|
|
354
|
-
return
|
|
354
|
+
return st(this, n) && (this.#r = n, this.#a = this.options, this.#i = this.#t.state), n;
|
|
355
355
|
}
|
|
356
356
|
getCurrentResult() {
|
|
357
357
|
return this.#r;
|
|
@@ -381,13 +381,13 @@ var et = class extends U {
|
|
|
381
381
|
#h(e) {
|
|
382
382
|
this.#S();
|
|
383
383
|
let t = this.#t.fetch(this.options, e);
|
|
384
|
-
return e?.throwOnError || (t = t.catch(
|
|
384
|
+
return e?.throwOnError || (t = t.catch(Pe)), t;
|
|
385
385
|
}
|
|
386
386
|
#g() {
|
|
387
387
|
this.#b();
|
|
388
|
-
let e =
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
388
|
+
let e = Le(this.options.staleTime, this.#t);
|
|
389
|
+
if (qe.isServer() || this.#r.isStale || !Fe(e)) return;
|
|
390
|
+
let t = Ie(this.#r.dataUpdatedAt, e) + 1;
|
|
391
391
|
this.#d = je.setTimeout(() => {
|
|
392
392
|
this.#r.isStale || this.updateResult();
|
|
393
393
|
}, t);
|
|
@@ -396,7 +396,7 @@ var et = 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, !(
|
|
399
|
+
this.#x(), this.#p = e, !(qe.isServer() || K(this.options.enabled, this.#t) === !1 || !Fe(this.#p) || this.#p === 0) && (this.#f = je.setInterval(() => {
|
|
400
400
|
(this.options.refetchIntervalInBackground || W.isFocused()) && this.#h();
|
|
401
401
|
}, this.#p));
|
|
402
402
|
}
|
|
@@ -404,18 +404,18 @@ var et = class extends U {
|
|
|
404
404
|
this.#g(), this.#v(this.#_());
|
|
405
405
|
}
|
|
406
406
|
#b() {
|
|
407
|
-
this.#d
|
|
407
|
+
this.#d !== void 0 && (je.clearTimeout(this.#d), this.#d = void 0);
|
|
408
408
|
}
|
|
409
409
|
#x() {
|
|
410
|
-
this.#f
|
|
410
|
+
this.#f !== void 0 && (je.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 && rt(e, t), o = i && at(e, n, t, r);
|
|
416
416
|
(a || o) && (l = {
|
|
417
417
|
...l,
|
|
418
|
-
|
|
418
|
+
...et(c.data, e.options)
|
|
419
419
|
}), t._optimisticResults === "isRestoring" && (l.fetchStatus = "idle");
|
|
420
420
|
}
|
|
421
421
|
let { error: f, errorUpdatedAt: p, status: m } = l;
|
|
@@ -423,11 +423,11 @@ var et = class extends 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 = Ge(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 = Ge(i?.data, d, t), this.#l = d, this.#s = null;
|
|
431
431
|
} catch (e) {
|
|
432
432
|
this.#s = e;
|
|
433
433
|
}
|
|
@@ -455,16 +455,16 @@ var et = class extends U {
|
|
|
455
455
|
isPaused: l.fetchStatus === "paused",
|
|
456
456
|
isPlaceholderData: u,
|
|
457
457
|
isRefetchError: v && b,
|
|
458
|
-
isStale:
|
|
458
|
+
isStale: ot(e, t),
|
|
459
459
|
refetch: this.refetch,
|
|
460
460
|
promise: this.#o,
|
|
461
|
-
isEnabled:
|
|
461
|
+
isEnabled: K(t.enabled, e) !== !1
|
|
462
462
|
};
|
|
463
463
|
if (this.options.experimental_prefetchInRender) {
|
|
464
464
|
let t = x.data !== void 0, r = x.status === "error" && !t, i = (e) => {
|
|
465
465
|
r ? e.reject(x.error) : t && e.resolve(x.data);
|
|
466
466
|
}, a = () => {
|
|
467
|
-
i(this.#o = x.promise =
|
|
467
|
+
i(this.#o = x.promise = Je());
|
|
468
468
|
}, o = this.#o;
|
|
469
469
|
switch (o.status) {
|
|
470
470
|
case "pending":
|
|
@@ -482,7 +482,7 @@ var et = 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), !Ve(t, e) && (this.#r = t, this.#C({ listeners: (() => {
|
|
486
486
|
if (!e) return !0;
|
|
487
487
|
let { notifyOnChangeProps: t } = this.options, n = typeof t == "function" ? t() : t;
|
|
488
488
|
if (n === "all" || !n && !this.#m.size) return !0;
|
|
@@ -503,7 +503,7 @@ var et = class extends U {
|
|
|
503
503
|
this.updateResult(), this.hasListeners() && this.#y();
|
|
504
504
|
}
|
|
505
505
|
#C(e) {
|
|
506
|
-
|
|
506
|
+
Ze.batch(() => {
|
|
507
507
|
e.listeners && this.listeners.forEach((e) => {
|
|
508
508
|
e(this.#r);
|
|
509
509
|
}), this.#e.getQueryCache().notify({
|
|
@@ -513,31 +513,31 @@ var et = class extends U {
|
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
|
-
function tt(e, t) {
|
|
517
|
-
return q(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
518
|
-
}
|
|
519
516
|
function nt(e, t) {
|
|
520
|
-
return
|
|
517
|
+
return K(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && K(t.retryOnMount, e) === !1);
|
|
518
|
+
}
|
|
519
|
+
function rt(e, t) {
|
|
520
|
+
return nt(e, t) || e.state.data !== void 0 && it(e, t, t.refetchOnMount);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
if (
|
|
522
|
+
function it(e, t, n) {
|
|
523
|
+
if (K(t.enabled, e) !== !1 && Le(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 && ot(e, t);
|
|
526
526
|
}
|
|
527
527
|
return !1;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
return (e !== t ||
|
|
531
|
-
}
|
|
532
|
-
function at(e, t) {
|
|
533
|
-
return q(t.enabled, e) !== !1 && e.isStaleByTime(Ie(t.staleTime, e));
|
|
529
|
+
function at(e, t, n, r) {
|
|
530
|
+
return (e !== t || K(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && ot(e, n);
|
|
534
531
|
}
|
|
535
532
|
function ot(e, t) {
|
|
536
|
-
return
|
|
533
|
+
return K(t.enabled, e) !== !1 && e.isStaleByTime(Le(t.staleTime, e));
|
|
534
|
+
}
|
|
535
|
+
function st(e, t) {
|
|
536
|
+
return !Ve(e.getCurrentResult(), t);
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
540
|
-
function
|
|
540
|
+
function ct() {
|
|
541
541
|
return {
|
|
542
542
|
context: void 0,
|
|
543
543
|
data: void 0,
|
|
@@ -552,7 +552,7 @@ function st() {
|
|
|
552
552
|
}
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
555
|
-
var
|
|
555
|
+
var lt = class extends U {
|
|
556
556
|
#e;
|
|
557
557
|
#t = void 0;
|
|
558
558
|
#n;
|
|
@@ -565,11 +565,11 @@ var ct = 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), Ve(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 && Re(t.mutationKey) !== Re(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
573
573
|
}
|
|
574
574
|
onUnsubscribe() {
|
|
575
575
|
this.hasListeners() || this.#n?.removeObserver(this);
|
|
@@ -587,7 +587,7 @@ var ct = class extends 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 ?? ct();
|
|
591
591
|
this.#t = {
|
|
592
592
|
...e,
|
|
593
593
|
isPending: e.status === "pending",
|
|
@@ -599,7 +599,7 @@ var ct = class extends U {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
#a(e) {
|
|
602
|
-
|
|
602
|
+
Ze.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,18 +635,18 @@ var ct = class extends U {
|
|
|
635
635
|
});
|
|
636
636
|
});
|
|
637
637
|
}
|
|
638
|
-
},
|
|
639
|
-
let n = e.useContext(
|
|
638
|
+
}, ut = e.createContext(void 0), q = (t) => {
|
|
639
|
+
let n = e.useContext(ut);
|
|
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
|
}, dt = ({ client: t, children: n }) => (e.useEffect(() => (t.mount(), () => {
|
|
644
644
|
t.unmount();
|
|
645
|
-
}), [t]), /* @__PURE__ */ p(
|
|
645
|
+
}), [t]), /* @__PURE__ */ p(ut.Provider, {
|
|
646
646
|
value: t,
|
|
647
647
|
children: n
|
|
648
|
-
})),
|
|
649
|
-
|
|
648
|
+
})), J = e.createContext(!1), ft = () => e.useContext(J);
|
|
649
|
+
J.Provider;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
652
652
|
function pt() {
|
|
@@ -662,13 +662,13 @@ function pt() {
|
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
664
|
var mt = e.createContext(pt()), ht = () => e.useContext(mt), gt = (e, t, n) => {
|
|
665
|
-
let r = n?.state.error && typeof e.throwOnError == "function" ?
|
|
665
|
+
let r = n?.state.error && typeof e.throwOnError == "function" ? Ke(e.throwOnError, [n.state.error, n]) : e.throwOnError;
|
|
666
666
|
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
667
667
|
}, _t = (t) => {
|
|
668
668
|
e.useEffect(() => {
|
|
669
669
|
t.clearReset();
|
|
670
670
|
}, [t]);
|
|
671
|
-
}, vt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 ||
|
|
671
|
+
}, vt = ({ result: e, errorResetBoundary: t, throwOnError: n, query: r, suspense: i }) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || Ke(n, [e.error, r])), yt = (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));
|
|
@@ -680,13 +680,13 @@ var mt = e.createContext(pt()), ht = () => e.useContext(mt), gt = (e, t, n) => {
|
|
|
680
680
|
//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
681
681
|
function Ct(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 = ft(), a = ht(), o = q(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`)), s._optimisticResults = i ? "isRestoring" : "optimistic", yt(s), gt(s, a, c), _t(a);
|
|
687
687
|
let l = !o.getQueryCache().get(s.queryHash), [u] = e.useState(() => new n(o, s)), d = u.getOptimisticResult(s), f = !i && t.subscribed !== !1;
|
|
688
688
|
if (e.useSyncExternalStore(e.useCallback((e) => {
|
|
689
|
-
let t = f ? u.subscribe(
|
|
689
|
+
let t = f ? u.subscribe(Ze.batchCalls(e)) : Pe;
|
|
690
690
|
return u.updateResult(), t;
|
|
691
691
|
}, [u, f]), () => u.getCurrentResult(), () => u.getCurrentResult()), e.useEffect(() => {
|
|
692
692
|
u.setOptions(s);
|
|
@@ -698,26 +698,26 @@ function Ct(t, n, r) {
|
|
|
698
698
|
query: c,
|
|
699
699
|
suspense: s.suspense
|
|
700
700
|
})) throw d.error;
|
|
701
|
-
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, d), s.experimental_prefetchInRender && !
|
|
701
|
+
return o.getDefaultOptions().queries?._experimental_afterQuery?.(s, d), s.experimental_prefetchInRender && !qe.isServer() && bt(d, i) && (l ? St(s, u, a) : c?.promise)?.catch(Pe).finally(() => {
|
|
702
702
|
u.updateResult();
|
|
703
703
|
}), s.notifyOnChangeProps ? d : u.trackResult(d);
|
|
704
704
|
}
|
|
705
705
|
//#endregion
|
|
706
706
|
//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
707
707
|
function wt(e, t) {
|
|
708
|
-
return Ct(e,
|
|
708
|
+
return Ct(e, tt, t);
|
|
709
709
|
}
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
712
712
|
function Tt(t, n) {
|
|
713
|
-
let r =
|
|
713
|
+
let r = q(n), [i] = e.useState(() => new lt(r, t));
|
|
714
714
|
e.useEffect(() => {
|
|
715
715
|
i.setOptions(t);
|
|
716
716
|
}, [i, t]);
|
|
717
|
-
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(
|
|
718
|
-
i.mutate(e, t).catch(
|
|
717
|
+
let a = e.useSyncExternalStore(e.useCallback((e) => i.subscribe(Ze.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), o = e.useCallback((e, t) => {
|
|
718
|
+
i.mutate(e, t).catch(Pe);
|
|
719
719
|
}, [i]);
|
|
720
|
-
if (a.error &&
|
|
720
|
+
if (a.error && Ke(i.options.throwOnError, [a.error])) throw a.error;
|
|
721
721
|
return {
|
|
722
722
|
...a,
|
|
723
723
|
mutate: o,
|
|
@@ -742,14 +742,14 @@ function Ot({ children: e, baseUrl: t, queryClient: n, getHeaders: r = Dt }) {
|
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/Hooks/useDataTable.ts
|
|
745
|
-
function
|
|
745
|
+
function kt() {
|
|
746
746
|
let e = o(Et);
|
|
747
747
|
if (!e) throw Error("useDataTable must be used within a DataTableProvider");
|
|
748
748
|
return e;
|
|
749
749
|
}
|
|
750
750
|
//#endregion
|
|
751
751
|
//#region src/Hooks/useApi.ts
|
|
752
|
-
function
|
|
752
|
+
function At(e) {
|
|
753
753
|
if (typeof e == "string") try {
|
|
754
754
|
let t = JSON.parse(e);
|
|
755
755
|
return {
|
|
@@ -762,7 +762,7 @@ function kt(e) {
|
|
|
762
762
|
}
|
|
763
763
|
return e instanceof Error ? { message: e.message } : { message: "Unbekannter Fehler" };
|
|
764
764
|
}
|
|
765
|
-
async function
|
|
765
|
+
async function Y(e, t) {
|
|
766
766
|
let n = await fetch(e, t);
|
|
767
767
|
if (n.status >= 400) {
|
|
768
768
|
let e = await n.text();
|
|
@@ -778,25 +778,25 @@ async function At(e, t) {
|
|
|
778
778
|
return n;
|
|
779
779
|
}
|
|
780
780
|
async function jt(e, t) {
|
|
781
|
-
return (await
|
|
781
|
+
return (await Y(e, {
|
|
782
782
|
method: "GET",
|
|
783
783
|
headers: await t()
|
|
784
784
|
})).json();
|
|
785
785
|
}
|
|
786
786
|
async function Mt(e, t, n) {
|
|
787
|
-
return (await
|
|
787
|
+
return (await Y(`${e}/${t}`, {
|
|
788
788
|
method: "GET",
|
|
789
789
|
headers: await n()
|
|
790
790
|
})).json();
|
|
791
791
|
}
|
|
792
792
|
async function Nt(e, t, n) {
|
|
793
|
-
await
|
|
793
|
+
await Y(`${e}/${t}`, {
|
|
794
794
|
method: "DELETE",
|
|
795
795
|
headers: await n()
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
async function Pt(e, t, n) {
|
|
799
|
-
let r = await
|
|
799
|
+
let r = await Y(e, {
|
|
800
800
|
method: "POST",
|
|
801
801
|
headers: await n(),
|
|
802
802
|
body: JSON.stringify(t)
|
|
@@ -804,7 +804,7 @@ async function Pt(e, t, n) {
|
|
|
804
804
|
return r.status === 204 ? t : r.json();
|
|
805
805
|
}
|
|
806
806
|
async function Ft(e, t, n, r) {
|
|
807
|
-
let i = await
|
|
807
|
+
let i = await Y(t, {
|
|
808
808
|
method: e,
|
|
809
809
|
headers: await n(),
|
|
810
810
|
body: r ? JSON.stringify(r) : void 0
|
|
@@ -812,7 +812,7 @@ async function Ft(e, t, n, r) {
|
|
|
812
812
|
if (i.status !== 204) return i.json();
|
|
813
813
|
}
|
|
814
814
|
async function It(e, t, n) {
|
|
815
|
-
let r = await
|
|
815
|
+
let r = await Y(`${e}/${t.id}`, {
|
|
816
816
|
method: "PUT",
|
|
817
817
|
headers: await n(),
|
|
818
818
|
body: JSON.stringify(t)
|
|
@@ -820,7 +820,7 @@ async function It(e, t, n) {
|
|
|
820
820
|
return r.status === 204 ? t : r.json();
|
|
821
821
|
}
|
|
822
822
|
function Lt(e, t, n) {
|
|
823
|
-
let { baseUrl: r, getHeaders: i } =
|
|
823
|
+
let { baseUrl: r, getHeaders: i } = kt();
|
|
824
824
|
return wt({
|
|
825
825
|
queryKey: [...t.map((e) => e.toString()), String(n?.toString())],
|
|
826
826
|
queryFn: () => Mt(`${r}${e}`, n, i),
|
|
@@ -828,7 +828,7 @@ function Lt(e, t, n) {
|
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
function Rt(e, t, n = !0) {
|
|
831
|
-
let { baseUrl: r, getHeaders: i } =
|
|
831
|
+
let { baseUrl: r, getHeaders: i } = kt();
|
|
832
832
|
return wt({
|
|
833
833
|
queryKey: [...t.map((e) => e.toString())],
|
|
834
834
|
queryFn: () => jt(`${r}${e}`, i),
|
|
@@ -836,7 +836,7 @@ function Rt(e, t, n = !0) {
|
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
function zt(e, t) {
|
|
839
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
839
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = kt();
|
|
840
840
|
return Tt({
|
|
841
841
|
mutationKey: [...t.map((e) => e.toString())],
|
|
842
842
|
mutationFn: (t) => Pt(`${n}${e}`, t, i),
|
|
@@ -846,7 +846,7 @@ function zt(e, t) {
|
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
function Bt(e, t) {
|
|
849
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
849
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = kt();
|
|
850
850
|
return Tt({
|
|
851
851
|
mutationKey: [...t.map((e) => e.toString())],
|
|
852
852
|
mutationFn: (t) => It(`${n}${e}`, t, i),
|
|
@@ -856,7 +856,7 @@ function Bt(e, t) {
|
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
858
|
function Vt(e, t) {
|
|
859
|
-
let { baseUrl: n, queryClient: r, getHeaders: i } =
|
|
859
|
+
let { baseUrl: n, queryClient: r, getHeaders: i } = kt();
|
|
860
860
|
return Tt({
|
|
861
861
|
mutationKey: [...t.map((e) => e.toString())],
|
|
862
862
|
mutationFn: (t) => Nt(`${n}${e}`, t, i),
|
|
@@ -872,7 +872,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
872
872
|
function k(e, t) {
|
|
873
873
|
return typeof e.required == "function" ? e.required(t ?? {}) : !!e.required;
|
|
874
874
|
}
|
|
875
|
-
let A =
|
|
875
|
+
let A = he({
|
|
876
876
|
mode: "uncontrolled",
|
|
877
877
|
initialValues: e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? !1 : t.defaultValue ?? "", e), {}),
|
|
878
878
|
validate: e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !k(t, n) || e ? null : "Pflichtfeld", e), {})
|
|
@@ -882,7 +882,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
882
882
|
if (e.conditional && !e.conditional(t)) return null;
|
|
883
883
|
let r = k(e, t);
|
|
884
884
|
return /* @__PURE__ */ m(n, { children: [
|
|
885
|
-
(e.type === void 0 || e.type == "text") && /* @__PURE__ */ p(
|
|
885
|
+
(e.type === void 0 || e.type == "text") && /* @__PURE__ */ p(ce, {
|
|
886
886
|
label: e.column.title,
|
|
887
887
|
placeholder: e.placeholder ?? "",
|
|
888
888
|
...A.getInputProps(e.id),
|
|
@@ -896,7 +896,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
896
896
|
...A.getInputProps(e.id),
|
|
897
897
|
required: r
|
|
898
898
|
}, A.key(e.id)),
|
|
899
|
-
e.type === "date" && /* @__PURE__ */ p(
|
|
899
|
+
e.type === "date" && /* @__PURE__ */ p(ge, {
|
|
900
900
|
label: e.column.title,
|
|
901
901
|
placeholder: e.placeholder ?? "",
|
|
902
902
|
valueFormat: "DD.MM.YYYY",
|
|
@@ -910,7 +910,7 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
910
910
|
...A.getInputProps(e.id, { type: "checkbox" }),
|
|
911
911
|
required: r
|
|
912
912
|
}, A.key(e.id)),
|
|
913
|
-
e.type === "textarea" && /* @__PURE__ */ p(
|
|
913
|
+
e.type === "textarea" && /* @__PURE__ */ p(le, {
|
|
914
914
|
label: e.column.title,
|
|
915
915
|
placeholder: e.placeholder ?? "",
|
|
916
916
|
...A.getInputProps(e.id),
|
|
@@ -946,10 +946,10 @@ function Ht({ fields: e, onClose: t, queryKey: r, apiPath: i, steps: a, onCreate
|
|
|
946
946
|
}
|
|
947
947
|
O.length && s < O.length - 1 ? x || c(s + 1) : x || (A.setInitialValues(n), A.reset(), t());
|
|
948
948
|
}),
|
|
949
|
-
children: [O.length ? /* @__PURE__ */ p(
|
|
949
|
+
children: [O.length ? /* @__PURE__ */ p(R, {
|
|
950
950
|
active: s,
|
|
951
951
|
size: "sm",
|
|
952
|
-
children: O.map((t) => /* @__PURE__ */ p(
|
|
952
|
+
children: O.map((t) => /* @__PURE__ */ p(R.Step, {
|
|
953
953
|
...a && a[t - 1] ? { label: a[t - 1].label } : {},
|
|
954
954
|
children: e.filter((e) => e.step === t).map((e) => M(e))
|
|
955
955
|
}, t))
|
|
@@ -985,40 +985,85 @@ function X() {
|
|
|
985
985
|
}
|
|
986
986
|
//#endregion
|
|
987
987
|
//#region node_modules/mantine-datatable/dist/index.mjs
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
988
|
+
function Z(e, t, n) {
|
|
989
|
+
return e ? fe({
|
|
990
|
+
color: typeof e == "object" ? e[n] : e,
|
|
991
|
+
theme: t
|
|
992
|
+
}).value : void 0;
|
|
993
|
+
}
|
|
994
|
+
function Wt({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
995
|
+
return {
|
|
996
|
+
"--mantine-datatable-color-light": Z(t, e, "light"),
|
|
997
|
+
"--mantine-datatable-color-dark": Z(t, e, "dark"),
|
|
998
|
+
"--mantine-datatable-background-color-light": Z(n, e, "light"),
|
|
999
|
+
"--mantine-datatable-background-color-dark": Z(n, e, "dark"),
|
|
1000
|
+
"--mantine-datatable-border-color-light": Z(r, e, "light"),
|
|
1001
|
+
"--mantine-datatable-border-color-dark": Z(r, e, "dark"),
|
|
1002
|
+
"--mantine-datatable-row-border-color-light": Z(i, e, "light"),
|
|
1003
|
+
"--mantine-datatable-row-border-color-dark": Z(i, e, "dark"),
|
|
1004
|
+
"--mantine-datatable-striped-color-light": Z(a, e, "light"),
|
|
1005
|
+
"--mantine-datatable-striped-color-dark": Z(a, e, "dark"),
|
|
1006
|
+
"--mantine-datatable-highlight-on-hover-color-light": Z(o, e, "light"),
|
|
1007
|
+
"--mantine-datatable-highlight-on-hover-color-dark": Z(o, e, "dark")
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
function Gt({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
1011
|
+
return {
|
|
1012
|
+
"--mantine-datatable-pagination-active-text-color-light": Z(t, e, "light"),
|
|
1013
|
+
"--mantine-datatable-pagination-active-text-color-dark": Z(t, e, "dark"),
|
|
1014
|
+
"--mantine-datatable-pagination-active-background-color-light": Z(n, e, "light"),
|
|
1015
|
+
"--mantine-datatable-pagination-active-background-color-dark": Z(n, e, "dark")
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
function Kt({ theme: e, color: t, backgroundColor: n }) {
|
|
1019
|
+
return {
|
|
1020
|
+
"--mantine-datatable-row-color-light": Z(t, e, "light"),
|
|
1021
|
+
"--mantine-datatable-row-color-dark": Z(t, e, "dark"),
|
|
1022
|
+
"--mantine-datatable-row-background-color-light": Z(n, e, "light"),
|
|
1023
|
+
"--mantine-datatable-row-background-color-dark": Z(n, e, "dark")
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
var [qt, Jt] = de("useDataTableColumnsContext must be used within DataTableColumnProvider"), Yt = (e) => {
|
|
1027
|
+
let { children: t, columnsOrder: n, setColumnsOrder: r, columnsToggle: i, setColumnsToggle: a, columnsPinning: o, setColumnsPinning: s, resetColumnsOrder: c, resetColumnsToggle: l, resetColumnsPinning: u, setColumnWidth: f, setMultipleColumnWidths: m, resetColumnsWidth: h, beginResize: g, endResize: _, pinnedMap: v } = e, [y, b] = d(""), [x, S] = d("");
|
|
1028
|
+
return p(qt, {
|
|
991
1029
|
value: {
|
|
992
|
-
sourceColumn:
|
|
993
|
-
setSourceColumn:
|
|
994
|
-
targetColumn:
|
|
995
|
-
setTargetColumn:
|
|
1030
|
+
sourceColumn: y,
|
|
1031
|
+
setSourceColumn: b,
|
|
1032
|
+
targetColumn: x,
|
|
1033
|
+
setTargetColumn: S,
|
|
996
1034
|
columnsToggle: i,
|
|
997
1035
|
setColumnsToggle: a,
|
|
1036
|
+
columnsPinning: o,
|
|
1037
|
+
setColumnsPinning: s,
|
|
998
1038
|
swapColumns: () => {
|
|
999
|
-
if (!n || !r || !
|
|
1000
|
-
let e =
|
|
1001
|
-
if (e !==
|
|
1002
|
-
|
|
1003
|
-
|
|
1039
|
+
if (!n || !r || !y || !x) return;
|
|
1040
|
+
let e = v.get(y), t = v.get(x);
|
|
1041
|
+
if (e?.logicalSide !== t?.logicalSide) return;
|
|
1042
|
+
let i = n.indexOf(y), a = n.indexOf(x);
|
|
1043
|
+
if (i !== -1 && a !== -1) {
|
|
1044
|
+
let e = [...n], [t] = e.splice(i, 1);
|
|
1045
|
+
e.splice(a, 0, t), r(e);
|
|
1004
1046
|
}
|
|
1005
1047
|
},
|
|
1006
|
-
resetColumnsOrder:
|
|
1007
|
-
resetColumnsToggle:
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1048
|
+
resetColumnsOrder: c,
|
|
1049
|
+
resetColumnsToggle: l,
|
|
1050
|
+
resetColumnsPinning: u,
|
|
1051
|
+
setColumnWidth: f,
|
|
1052
|
+
setMultipleColumnWidths: m,
|
|
1053
|
+
resetColumnsWidth: h,
|
|
1054
|
+
beginResize: g,
|
|
1055
|
+
endResize: _
|
|
1011
1056
|
},
|
|
1012
1057
|
children: t
|
|
1013
1058
|
});
|
|
1014
1059
|
};
|
|
1015
|
-
function
|
|
1060
|
+
function Xt() {
|
|
1016
1061
|
return p("tr", {
|
|
1017
1062
|
className: "mantine-datatable-empty-row",
|
|
1018
1063
|
children: p("td", {})
|
|
1019
1064
|
});
|
|
1020
1065
|
}
|
|
1021
|
-
function
|
|
1066
|
+
function Zt() {
|
|
1022
1067
|
return m("svg", {
|
|
1023
1068
|
width: "24",
|
|
1024
1069
|
height: "24",
|
|
@@ -1041,14 +1086,14 @@ function Jt() {
|
|
|
1041
1086
|
]
|
|
1042
1087
|
});
|
|
1043
1088
|
}
|
|
1044
|
-
function
|
|
1089
|
+
function Qt({ icon: e, text: t, active: n, children: r }) {
|
|
1045
1090
|
return p(y, {
|
|
1046
1091
|
className: "mantine-datatable-empty-state",
|
|
1047
1092
|
"data-active": n || void 0,
|
|
1048
1093
|
children: r || m(f, { children: [e || p("div", {
|
|
1049
1094
|
className: "mantine-datatable-empty-state-icon",
|
|
1050
|
-
children: p(
|
|
1051
|
-
}), p(
|
|
1095
|
+
children: p(Zt, {})
|
|
1096
|
+
}), p(B, {
|
|
1052
1097
|
component: "div",
|
|
1053
1098
|
size: "sm",
|
|
1054
1099
|
c: "dimmed",
|
|
@@ -1056,258 +1101,344 @@ function Yt({ icon: e, text: t, active: n, children: r }) {
|
|
|
1056
1101
|
})] })
|
|
1057
1102
|
});
|
|
1058
1103
|
}
|
|
1059
|
-
function
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
let i = t && t.map((e) => e.accessor) || [], [a, o] = De({
|
|
1069
|
-
key: e ? `${e}-columns-order` : "",
|
|
1070
|
-
defaultValue: e ? i : void 0,
|
|
1104
|
+
function $t({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1105
|
+
let r = l(() => t.map((e) => ({
|
|
1106
|
+
accessor: e.accessor,
|
|
1107
|
+
defaultPinned: e.pinned,
|
|
1108
|
+
pinnable: !!e.pinnable,
|
|
1109
|
+
pinned: e.pinned
|
|
1110
|
+
})), [t]), [i, a] = H({
|
|
1111
|
+
key: e ? `${e}-columns-pinning` : "",
|
|
1112
|
+
defaultValue: e ? r : void 0,
|
|
1071
1113
|
getInitialValueInEffect: n
|
|
1072
|
-
});
|
|
1073
|
-
function
|
|
1074
|
-
e &&
|
|
1075
|
-
}
|
|
1076
|
-
let
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
};
|
|
1090
|
-
}
|
|
1091
|
-
function Zt({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, onFixedLayoutChange: i }) {
|
|
1092
|
-
let o = u(!1), c = u({}), [f, p] = d(!0), m = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), h = l(() => t.filter((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), g = l(() => h.some((e) => e.width === void 0 || e.width === "" || e.width === "initial"), [h]), _ = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [v, y] = De({
|
|
1093
|
-
key: e ? `${e}-columns-width` : "",
|
|
1094
|
-
defaultValue: e ? _() : void 0,
|
|
1095
|
-
getInitialValueInEffect: !1
|
|
1096
|
-
}), [b, x] = d(() => _());
|
|
1097
|
-
s(() => {
|
|
1098
|
-
p(!1);
|
|
1099
|
-
}, []);
|
|
1100
|
-
let S = a(() => {
|
|
1101
|
-
if (!r?.current || f) return {};
|
|
1102
|
-
let e = r.current, t = Array.from(e.querySelectorAll("th[data-accessor]")), n = {};
|
|
1103
|
-
return t.forEach((e) => {
|
|
1104
|
-
let t = e.getAttribute("data-accessor");
|
|
1105
|
-
if (!t || t === "__selection__") return;
|
|
1106
|
-
let r = h.find((e) => e.accessor === t);
|
|
1107
|
-
if (r && (r.width === void 0 || r.width === "" || r.width === "initial")) {
|
|
1108
|
-
let r = e.getBoundingClientRect();
|
|
1109
|
-
n[t] = Math.round(r.width);
|
|
1110
|
-
}
|
|
1111
|
-
}), n;
|
|
1114
|
+
}), o = i ?? r;
|
|
1115
|
+
function c(t) {
|
|
1116
|
+
e && a(typeof t == "function" ? (e) => t(e ?? r) : t);
|
|
1117
|
+
}
|
|
1118
|
+
let u = l(() => {
|
|
1119
|
+
if (!o) return r;
|
|
1120
|
+
let e = [];
|
|
1121
|
+
return o.forEach((n) => {
|
|
1122
|
+
t.find((e) => e.accessor === n.accessor) && e.push(n);
|
|
1123
|
+
}), t.forEach((t) => {
|
|
1124
|
+
e.find((e) => e.accessor === t.accessor) || e.push({
|
|
1125
|
+
accessor: t.accessor,
|
|
1126
|
+
defaultPinned: t.pinned,
|
|
1127
|
+
pinnable: !!t.pinnable,
|
|
1128
|
+
pinned: t.pinned
|
|
1129
|
+
});
|
|
1130
|
+
}), e;
|
|
1112
1131
|
}, [
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
])
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
return r ? { [t]: r.width } : e;
|
|
1120
|
-
});
|
|
1121
|
-
x(r), e && y(r);
|
|
1132
|
+
o,
|
|
1133
|
+
t,
|
|
1134
|
+
r
|
|
1135
|
+
]);
|
|
1136
|
+
s(() => {
|
|
1137
|
+
e && o && JSON.stringify(u) !== JSON.stringify(o) && a(u);
|
|
1122
1138
|
}, [
|
|
1123
|
-
b,
|
|
1124
1139
|
e,
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1140
|
+
u,
|
|
1141
|
+
o,
|
|
1142
|
+
a
|
|
1143
|
+
]);
|
|
1144
|
+
let d = () => {
|
|
1145
|
+
c(r);
|
|
1146
|
+
};
|
|
1147
|
+
return e ? {
|
|
1148
|
+
columnsPinning: u,
|
|
1149
|
+
setColumnsPinning: c,
|
|
1150
|
+
resetColumnsPinning: d
|
|
1151
|
+
} : {
|
|
1152
|
+
columnsPinning: r,
|
|
1153
|
+
setColumnsPinning: c,
|
|
1154
|
+
resetColumnsPinning: d
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function en({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1158
|
+
let r = l(() => t ? t.map((e) => e.accessor) : [], [t]), [i, a] = H({
|
|
1159
|
+
key: e ? `${e}-columns-order` : "",
|
|
1160
|
+
defaultValue: e ? r : void 0,
|
|
1161
|
+
getInitialValueInEffect: n
|
|
1162
|
+
}), o = i ?? r;
|
|
1163
|
+
function c(t) {
|
|
1164
|
+
e && a(t);
|
|
1165
|
+
}
|
|
1166
|
+
let u = l(() => {
|
|
1167
|
+
if (!o) return r;
|
|
1168
|
+
let e = [];
|
|
1169
|
+
return o.forEach((n) => {
|
|
1170
|
+
t.find((e) => e.accessor === n) && e.push(n);
|
|
1171
|
+
}), t.forEach((t) => {
|
|
1172
|
+
e.includes(t.accessor) || e.push(t.accessor);
|
|
1173
|
+
}), e;
|
|
1145
1174
|
}, [
|
|
1146
|
-
|
|
1147
|
-
i,
|
|
1148
|
-
f,
|
|
1149
|
-
g,
|
|
1150
|
-
S,
|
|
1175
|
+
o,
|
|
1151
1176
|
t,
|
|
1152
|
-
|
|
1153
|
-
])
|
|
1177
|
+
r
|
|
1178
|
+
]);
|
|
1154
1179
|
s(() => {
|
|
1155
|
-
|
|
1156
|
-
i?.(!1);
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
o.current = !1;
|
|
1160
|
-
let e = setTimeout(() => {
|
|
1161
|
-
T();
|
|
1162
|
-
}, 50);
|
|
1163
|
-
return () => clearTimeout(e);
|
|
1180
|
+
e && o && JSON.stringify(u) !== JSON.stringify(o) && a(u);
|
|
1164
1181
|
}, [
|
|
1165
|
-
m,
|
|
1166
|
-
i,
|
|
1167
|
-
f,
|
|
1168
|
-
T
|
|
1169
|
-
]), s(() => {
|
|
1170
|
-
f || !e || !n || v && v.length > 0 && x(v);
|
|
1171
|
-
}, [
|
|
1172
|
-
f,
|
|
1173
1182
|
e,
|
|
1174
|
-
|
|
1175
|
-
|
|
1183
|
+
u,
|
|
1184
|
+
o,
|
|
1185
|
+
a
|
|
1176
1186
|
]);
|
|
1177
|
-
let
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1187
|
+
let d = () => {
|
|
1188
|
+
c(r);
|
|
1189
|
+
};
|
|
1190
|
+
return e ? {
|
|
1191
|
+
columnsOrder: u,
|
|
1192
|
+
setColumnsOrder: c,
|
|
1193
|
+
resetColumnsOrder: d
|
|
1194
|
+
} : {
|
|
1195
|
+
columnsOrder: o,
|
|
1196
|
+
setColumnsOrder: c,
|
|
1197
|
+
resetColumnsOrder: d
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
function tn({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r }) {
|
|
1201
|
+
let i = l(() => t.some((e) => e.resizable && !e.hidden && e.accessor !== "__selection__"), [t]), o = a(() => t.filter((e) => e.accessor !== "__selection__").map((e) => ({ [e.accessor]: e.width ?? "auto" })), [t]), [c, f] = H({
|
|
1202
|
+
key: e ? `${e}-columns-width` : "",
|
|
1203
|
+
defaultValue: e ? o() : void 0,
|
|
1204
|
+
getInitialValueInEffect: n
|
|
1205
|
+
}), [p, m] = d(() => e && c && c.length > 0 ? c : o()), [h, g] = d(!1), _ = u(!1);
|
|
1206
|
+
s(() => {
|
|
1207
|
+
e && (!c || c.length === 0 || m(c));
|
|
1208
|
+
}, [e, c]), s(() => {
|
|
1209
|
+
m((e) => {
|
|
1210
|
+
let n = new Set(t.filter((e) => e.accessor !== "__selection__").map((e) => String(e.accessor))), r = e.filter((e) => n.has(Object.keys(e)[0])), i = new Set(r.map((e) => Object.keys(e)[0])), a = !1;
|
|
1211
|
+
for (let e of t) {
|
|
1212
|
+
if (e.accessor === "__selection__") continue;
|
|
1213
|
+
let t = String(e.accessor);
|
|
1214
|
+
i.has(t) || (r.push({ [t]: e.width ?? "auto" }), a = !0);
|
|
1215
|
+
}
|
|
1216
|
+
return r.length !== e.length || a ? r : e;
|
|
1217
|
+
});
|
|
1218
|
+
}, [t]);
|
|
1219
|
+
let v = a((e) => {
|
|
1220
|
+
let t = e.filter((e) => e.accessor !== "__selection__");
|
|
1221
|
+
t.length !== 0 && (_.current = !0, m((e) => e.map((e) => {
|
|
1222
|
+
let n = Object.keys(e)[0], r = t.find((e) => e.accessor === n);
|
|
1223
|
+
return r ? { [n]: r.width } : e;
|
|
1224
|
+
})));
|
|
1225
|
+
}, []);
|
|
1226
|
+
s(() => {
|
|
1227
|
+
!e || !_.current || h || (_.current = !1, f(p));
|
|
1181
1228
|
}, [
|
|
1182
1229
|
e,
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
T
|
|
1230
|
+
p,
|
|
1231
|
+
h,
|
|
1232
|
+
f
|
|
1187
1233
|
]);
|
|
1234
|
+
let y = a((e, t) => {
|
|
1235
|
+
v([{
|
|
1236
|
+
accessor: e,
|
|
1237
|
+
width: t
|
|
1238
|
+
}]);
|
|
1239
|
+
}, [v]), b = a((e) => {
|
|
1240
|
+
v(e);
|
|
1241
|
+
}, [v]), x = a(() => {
|
|
1242
|
+
g(!0);
|
|
1243
|
+
let e = r?.current;
|
|
1244
|
+
if (!e) return;
|
|
1245
|
+
let t = Array.from(e.querySelectorAll("th[data-accessor]"));
|
|
1246
|
+
if (t.length === 0) return;
|
|
1247
|
+
let n = [];
|
|
1248
|
+
for (let e of t) {
|
|
1249
|
+
let t = e.getAttribute("data-accessor");
|
|
1250
|
+
if (!t || t === "__selection__") continue;
|
|
1251
|
+
let r = Math.round(e.getBoundingClientRect().width);
|
|
1252
|
+
n.push({ [t]: `${r}px` });
|
|
1253
|
+
}
|
|
1254
|
+
_.current = !0, m(n);
|
|
1255
|
+
}, [r]), S = a(() => {
|
|
1256
|
+
g(!1);
|
|
1257
|
+
}, []);
|
|
1188
1258
|
return {
|
|
1189
|
-
columnsWidth:
|
|
1190
|
-
setColumnsWidth:
|
|
1191
|
-
setColumnWidth:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
}, [
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1259
|
+
columnsWidth: p,
|
|
1260
|
+
setColumnsWidth: v,
|
|
1261
|
+
setColumnWidth: y,
|
|
1262
|
+
setMultipleColumnWidths: b,
|
|
1263
|
+
resetColumnsWidth: a(() => {
|
|
1264
|
+
let e = o();
|
|
1265
|
+
_.current = !0, m(e), g(!1);
|
|
1266
|
+
}, [o]),
|
|
1267
|
+
hasResizableColumns: i,
|
|
1268
|
+
allResizableWidthsInitial: l(() => {
|
|
1269
|
+
if (!i) return !1;
|
|
1270
|
+
let e = t.filter((e) => e.resizable && !e.hidden && e.accessor !== "__selection__");
|
|
1271
|
+
return p.filter((t) => {
|
|
1272
|
+
let n = Object.keys(t)[0];
|
|
1273
|
+
return e.some((e) => e.accessor === n);
|
|
1274
|
+
}).every((e) => {
|
|
1275
|
+
let t = Object.values(e)[0];
|
|
1276
|
+
return t === "auto" || t === "initial";
|
|
1277
|
+
});
|
|
1278
|
+
}, [
|
|
1279
|
+
i,
|
|
1280
|
+
t,
|
|
1281
|
+
p
|
|
1210
1282
|
]),
|
|
1211
|
-
measureAndSetColumnWidths:
|
|
1283
|
+
measureAndSetColumnWidths: a(() => {}, []),
|
|
1284
|
+
isResizing: h,
|
|
1285
|
+
beginResize: x,
|
|
1286
|
+
endResize: S
|
|
1212
1287
|
};
|
|
1213
1288
|
}
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1216
|
-
let n = [];
|
|
1217
|
-
return e.forEach((e) => {
|
|
1218
|
-
t.find((t) => t.accessor === e.accessor) && n.push(e);
|
|
1219
|
-
}), t.forEach((e) => {
|
|
1220
|
-
n.find((t) => t.accessor === e.accessor) || n.push({
|
|
1221
|
-
accessor: e.accessor,
|
|
1222
|
-
defaultToggle: e.defaultToggle || !0,
|
|
1223
|
-
toggleable: e.toggleable,
|
|
1224
|
-
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1225
|
-
});
|
|
1226
|
-
}), n;
|
|
1227
|
-
}
|
|
1228
|
-
let i = t && t.map((e) => ({
|
|
1289
|
+
function nn({ key: e, columns: t = [], getInitialValueInEffect: n = !0 }) {
|
|
1290
|
+
let r = l(() => t?.map((e) => ({
|
|
1229
1291
|
accessor: e.accessor,
|
|
1230
1292
|
defaultToggle: e.defaultToggle || !0,
|
|
1231
1293
|
toggleable: e.toggleable,
|
|
1232
1294
|
toggled: e.defaultToggle === void 0 ? !0 : e.defaultToggle
|
|
1233
|
-
})), [
|
|
1295
|
+
})), [t]), [i, a] = H({
|
|
1234
1296
|
key: e ? `${e}-columns-toggle` : "",
|
|
1235
|
-
defaultValue: e ?
|
|
1297
|
+
defaultValue: e ? r : void 0,
|
|
1236
1298
|
getInitialValueInEffect: n
|
|
1237
|
-
});
|
|
1238
|
-
function
|
|
1239
|
-
e &&
|
|
1240
|
-
}
|
|
1241
|
-
let
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1299
|
+
}), o = i ?? r;
|
|
1300
|
+
function c(t) {
|
|
1301
|
+
e && a(t);
|
|
1302
|
+
}
|
|
1303
|
+
let u = l(() => {
|
|
1304
|
+
if (!o) return r;
|
|
1305
|
+
let e = [];
|
|
1306
|
+
return o.forEach((n) => {
|
|
1307
|
+
t.find((e) => e.accessor === n.accessor) && e.push(n);
|
|
1308
|
+
}), t.forEach((t) => {
|
|
1309
|
+
e.find((e) => e.accessor === t.accessor) || e.push({
|
|
1310
|
+
accessor: t.accessor,
|
|
1311
|
+
defaultToggle: t.defaultToggle || !0,
|
|
1312
|
+
toggleable: t.toggleable,
|
|
1313
|
+
toggled: t.defaultToggle === void 0 ? !0 : t.defaultToggle
|
|
1314
|
+
});
|
|
1315
|
+
}), e;
|
|
1316
|
+
}, [
|
|
1317
|
+
o,
|
|
1318
|
+
t,
|
|
1319
|
+
r
|
|
1320
|
+
]);
|
|
1321
|
+
s(() => {
|
|
1322
|
+
e && o && JSON.stringify(u) !== JSON.stringify(o) && a(u);
|
|
1323
|
+
}, [
|
|
1324
|
+
e,
|
|
1325
|
+
u,
|
|
1326
|
+
o,
|
|
1327
|
+
a
|
|
1328
|
+
]);
|
|
1329
|
+
let d = () => {
|
|
1330
|
+
c(r);
|
|
1248
1331
|
};
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1332
|
+
return e ? {
|
|
1333
|
+
columnsToggle: u,
|
|
1334
|
+
setColumnsToggle: c,
|
|
1335
|
+
resetColumnsToggle: d
|
|
1336
|
+
} : {
|
|
1337
|
+
columnsToggle: o,
|
|
1338
|
+
setColumnsToggle: c,
|
|
1339
|
+
resetColumnsToggle: d
|
|
1254
1340
|
};
|
|
1255
1341
|
}
|
|
1256
|
-
var
|
|
1257
|
-
let { columnsOrder:
|
|
1342
|
+
var rn = ({ key: e, columns: t = [], getInitialValueInEffect: n = !0, headerRef: r, scrollViewportRef: i }) => {
|
|
1343
|
+
let { columnsOrder: a, setColumnsOrder: o, resetColumnsOrder: s } = en({
|
|
1258
1344
|
key: e,
|
|
1259
1345
|
columns: t,
|
|
1260
1346
|
getInitialValueInEffect: n
|
|
1261
|
-
}), { columnsToggle:
|
|
1347
|
+
}), { columnsToggle: c, setColumnsToggle: u, resetColumnsToggle: d } = nn({
|
|
1262
1348
|
key: e,
|
|
1263
1349
|
columns: t,
|
|
1264
1350
|
getInitialValueInEffect: n
|
|
1265
|
-
}), {
|
|
1351
|
+
}), { columnsPinning: f, setColumnsPinning: p, resetColumnsPinning: m } = $t({
|
|
1352
|
+
key: e,
|
|
1353
|
+
columns: t,
|
|
1354
|
+
getInitialValueInEffect: n
|
|
1355
|
+
}), { columnsWidth: h, setColumnsWidth: g, setColumnWidth: _, setMultipleColumnWidths: v, resetColumnsWidth: y, hasResizableColumns: b, allResizableWidthsInitial: x, measureAndSetColumnWidths: S, isResizing: C, beginResize: w, endResize: T } = tn({
|
|
1266
1356
|
key: e,
|
|
1267
1357
|
columns: t,
|
|
1268
1358
|
getInitialValueInEffect: n,
|
|
1269
1359
|
headerRef: r,
|
|
1270
|
-
scrollViewportRef: i
|
|
1271
|
-
|
|
1272
|
-
|
|
1360
|
+
scrollViewportRef: i
|
|
1361
|
+
}), E = l(() => {
|
|
1362
|
+
let e;
|
|
1363
|
+
e = a ? a.map((e) => t.find((t) => t.accessor === e)).map((e) => {
|
|
1364
|
+
let t = f.find((t) => t.accessor === e?.accessor), n = e?.pinnable ? t?.pinned : e?.pinned;
|
|
1365
|
+
return {
|
|
1366
|
+
...e,
|
|
1367
|
+
hidden: e?.hidden || !c.find((t) => t.accessor === e?.accessor)?.toggled,
|
|
1368
|
+
pinned: n
|
|
1369
|
+
};
|
|
1370
|
+
}) : t;
|
|
1371
|
+
let n = e.filter((e) => e.pinned === "left"), r = e.filter((e) => !e.pinned), i = e.filter((e) => e.pinned === "right");
|
|
1372
|
+
return [
|
|
1373
|
+
...n,
|
|
1374
|
+
...r,
|
|
1375
|
+
...i
|
|
1376
|
+
].map((e) => {
|
|
1377
|
+
if (e?.accessor === "__selection__") return e;
|
|
1378
|
+
let t = e?.accessor, n = h.find((e) => t in e);
|
|
1379
|
+
if (!n) return e;
|
|
1380
|
+
let r = n[t];
|
|
1381
|
+
return r === void 0 || r === "auto" || r === "initial" ? e : {
|
|
1382
|
+
...e,
|
|
1383
|
+
width: r
|
|
1384
|
+
};
|
|
1385
|
+
});
|
|
1386
|
+
}, [
|
|
1387
|
+
t,
|
|
1388
|
+
a,
|
|
1389
|
+
c,
|
|
1390
|
+
f,
|
|
1391
|
+
h
|
|
1392
|
+
]), D = l(() => {
|
|
1393
|
+
let e = E.filter((e) => !e.hidden && e.accessor !== "__selection__");
|
|
1394
|
+
return e.length === 0 ? !1 : e.every((e) => typeof e.width == "string" && /px$/.test(e.width));
|
|
1395
|
+
}, [E]);
|
|
1273
1396
|
return {
|
|
1274
|
-
effectiveColumns:
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1397
|
+
effectiveColumns: E,
|
|
1398
|
+
setColumnsOrder: o,
|
|
1399
|
+
columnsOrder: a,
|
|
1400
|
+
resetColumnsOrder: s,
|
|
1401
|
+
columnsToggle: c,
|
|
1402
|
+
setColumnsToggle: u,
|
|
1403
|
+
resetColumnsToggle: d,
|
|
1404
|
+
columnsPinning: f,
|
|
1405
|
+
setColumnsPinning: p,
|
|
1406
|
+
resetColumnsPinning: m,
|
|
1407
|
+
columnsWidth: h,
|
|
1408
|
+
setColumnsWidth: g,
|
|
1409
|
+
setColumnWidth: _,
|
|
1410
|
+
setMultipleColumnWidths: v,
|
|
1411
|
+
resetColumnsWidth: y,
|
|
1412
|
+
hasResizableColumns: b,
|
|
1413
|
+
allResizableWidthsInitial: x,
|
|
1414
|
+
measureAndSetColumnWidths: S,
|
|
1415
|
+
isResizing: C,
|
|
1416
|
+
isLocked: D,
|
|
1417
|
+
tableWidth: l(() => {
|
|
1418
|
+
if (!D) return null;
|
|
1419
|
+
let e = 0;
|
|
1420
|
+
for (let t of E) {
|
|
1421
|
+
if (t.hidden || t.accessor === "__selection__") continue;
|
|
1422
|
+
let n = t.width;
|
|
1423
|
+
if (typeof n != "string") continue;
|
|
1424
|
+
let r = parseInt(n, 10);
|
|
1425
|
+
Number.isNaN(r) || (e += r);
|
|
1426
|
+
}
|
|
1427
|
+
return e > 0 ? e : null;
|
|
1428
|
+
}, [D, E]),
|
|
1429
|
+
beginResize: w,
|
|
1430
|
+
endResize: T
|
|
1300
1431
|
};
|
|
1301
|
-
},
|
|
1302
|
-
function
|
|
1432
|
+
}, an = typeof window < "u" ? c : s;
|
|
1433
|
+
function on(e) {
|
|
1303
1434
|
let t = u(e);
|
|
1304
1435
|
return t.current = e, t;
|
|
1305
1436
|
}
|
|
1306
|
-
var
|
|
1307
|
-
function
|
|
1437
|
+
var sn = "--mantine-datatable-header-height", cn = "--mantine-datatable-footer-height", ln = "--mantine-datatable-selection-column-width", un = "--mantine-datatable-last-row-border-bottom";
|
|
1438
|
+
function Q(e, t, n) {
|
|
1308
1439
|
e?.style.setProperty(t, n);
|
|
1309
1440
|
}
|
|
1310
|
-
function
|
|
1441
|
+
function dn(e) {
|
|
1311
1442
|
let t = e.borderBoxSize?.[0] || e.contentBoxSize?.[0];
|
|
1312
1443
|
return t ? {
|
|
1313
1444
|
width: t.inlineSize,
|
|
@@ -1317,18 +1448,18 @@ function sn(e) {
|
|
|
1317
1448
|
height: e.contentRect.height
|
|
1318
1449
|
};
|
|
1319
1450
|
}
|
|
1320
|
-
function
|
|
1451
|
+
function fn(e, t, n) {
|
|
1321
1452
|
if (e) {
|
|
1322
1453
|
let r = new ResizeObserver((e) => {
|
|
1323
1454
|
let n = e[0];
|
|
1324
|
-
n && t(
|
|
1455
|
+
n && t(dn(n));
|
|
1325
1456
|
});
|
|
1326
1457
|
return r.observe(e), () => {
|
|
1327
1458
|
r.disconnect(), n();
|
|
1328
1459
|
};
|
|
1329
1460
|
}
|
|
1330
1461
|
}
|
|
1331
|
-
function
|
|
1462
|
+
function pn({ scrollCallbacks: e, withRowBorders: t }) {
|
|
1332
1463
|
let n = {
|
|
1333
1464
|
root: u(null),
|
|
1334
1465
|
table: u(null),
|
|
@@ -1336,16 +1467,17 @@ function ln({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1336
1467
|
header: u(null),
|
|
1337
1468
|
footer: u(null),
|
|
1338
1469
|
selectionColumnHeader: u(null)
|
|
1339
|
-
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f =
|
|
1470
|
+
}, { root: r, table: i, scrollViewport: o, header: c, footer: l, selectionColumnHeader: d } = n, f = on({ withRowBorders: t }), p = on(e), m = u(() => {}), h = u(() => {}), g = a((e) => {
|
|
1340
1471
|
p.current.onScroll?.(e), m.current();
|
|
1341
1472
|
}, []);
|
|
1342
|
-
return s(() =>
|
|
1343
|
-
|
|
1344
|
-
}, () =>
|
|
1345
|
-
|
|
1346
|
-
}, () =>
|
|
1347
|
-
|
|
1348
|
-
}, () =>
|
|
1473
|
+
return s(() => fn(c.current, (e) => {
|
|
1474
|
+
Q(r.current, sn, `${e.height}px`);
|
|
1475
|
+
}, () => Q(r.current, sn, "0")), [c.current]), s(() => fn(l.current, (e) => {
|
|
1476
|
+
Q(r.current, cn, `${e.height}px`);
|
|
1477
|
+
}, () => Q(r.current, cn, "0")), [l.current]), s(() => fn(d.current, (e) => {
|
|
1478
|
+
Q(r.current, ln, `${e.width}px`);
|
|
1479
|
+
}, () => Q(r.current, ln, "0")), [d.current]), an(() => {
|
|
1480
|
+
if (typeof window > "u") return;
|
|
1349
1481
|
let e = {
|
|
1350
1482
|
top: !0,
|
|
1351
1483
|
bottom: !0,
|
|
@@ -1360,14 +1492,14 @@ function ln({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1360
1492
|
};
|
|
1361
1493
|
function a(t, n) {
|
|
1362
1494
|
let i = e[t];
|
|
1363
|
-
return e[t] = n,
|
|
1495
|
+
return e[t] = n, Q(r.current, `--mantine-datatable-${t}-shadow-opacity`, n ? "0" : "1"), i;
|
|
1364
1496
|
}
|
|
1365
1497
|
function s() {
|
|
1366
1498
|
let e = t.height - n.height, i = e < 0;
|
|
1367
|
-
|
|
1499
|
+
Q(r.current, "--mantine-datatable-footer-position", i ? "relative" : "sticky"), Q(r.current, "--mantine-datatable-footer-bottom", i ? `${e}px` : "0");
|
|
1368
1500
|
}
|
|
1369
1501
|
function c() {
|
|
1370
|
-
f.current.withRowBorders && t.height < n.height ?
|
|
1502
|
+
f.current.withRowBorders && t.height < n.height ? Q(r.current, un, `${V("1px")} solid var(--mantine-datatable-border-color)`) : Q(r.current, un, "unset");
|
|
1371
1503
|
}
|
|
1372
1504
|
h.current = c;
|
|
1373
1505
|
function l() {
|
|
@@ -1385,10 +1517,10 @@ function ln({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1385
1517
|
let u = new ResizeObserver((e) => {
|
|
1386
1518
|
for (let r of e) switch (r.target.tagName) {
|
|
1387
1519
|
case "TABLE":
|
|
1388
|
-
t =
|
|
1520
|
+
t = dn(r);
|
|
1389
1521
|
break;
|
|
1390
1522
|
case "DIV":
|
|
1391
|
-
n =
|
|
1523
|
+
n = dn(r);
|
|
1392
1524
|
break;
|
|
1393
1525
|
}
|
|
1394
1526
|
l(), s(), c();
|
|
@@ -1396,14 +1528,102 @@ function ln({ scrollCallbacks: e, withRowBorders: t }) {
|
|
|
1396
1528
|
return u.observe(i.current), u.observe(o.current), () => {
|
|
1397
1529
|
u.disconnect();
|
|
1398
1530
|
};
|
|
1399
|
-
}, []),
|
|
1531
|
+
}, []), an(() => {
|
|
1400
1532
|
h.current();
|
|
1401
1533
|
}, [t]), {
|
|
1402
1534
|
refs: n,
|
|
1403
1535
|
onScroll: g
|
|
1404
1536
|
};
|
|
1405
1537
|
}
|
|
1406
|
-
function
|
|
1538
|
+
function mn({ columns: e, theadRef: t, tbodyRef: n, selectionColumnHeaderRef: r, selectionVisible: i, pinFirstColumn: o, pinLastColumn: c }) {
|
|
1539
|
+
let [l, u] = d(/* @__PURE__ */ new Map()), f = a(() => {
|
|
1540
|
+
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1541
|
+
let a = t.current ?? n.current;
|
|
1542
|
+
if (!a) return;
|
|
1543
|
+
let s = !!t.current, l = s ? a.querySelector("tr:last-of-type") : a.querySelector("tr:first-of-type");
|
|
1544
|
+
if (!l) return;
|
|
1545
|
+
let d = getComputedStyle(a).direction === "rtl", f = /* @__PURE__ */ new Map();
|
|
1546
|
+
if (s) l.querySelectorAll("th[data-accessor]").forEach((e) => {
|
|
1547
|
+
let t = e.dataset.accessor;
|
|
1548
|
+
if (t) {
|
|
1549
|
+
let n = e.getBoundingClientRect().width;
|
|
1550
|
+
n > 0 && f.set(t, n);
|
|
1551
|
+
}
|
|
1552
|
+
});
|
|
1553
|
+
else {
|
|
1554
|
+
let t = e.filter((e) => !e.hidden);
|
|
1555
|
+
l.querySelectorAll("td:not(.mantine-datatable-row-selector-cell):not(.mantine-datatable-row-expansion-cell)").forEach((e, n) => {
|
|
1556
|
+
if (t[n]) {
|
|
1557
|
+
let r = e.getBoundingClientRect().width;
|
|
1558
|
+
r > 0 && f.set(String(t[n].accessor), r);
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
let p = 0;
|
|
1563
|
+
if (i) {
|
|
1564
|
+
let e = r.current ?? a.querySelector(s ? ".mantine-datatable-header-selector-cell" : ".mantine-datatable-row-selector-cell");
|
|
1565
|
+
e && (p = e.getBoundingClientRect().width);
|
|
1566
|
+
}
|
|
1567
|
+
let m = e.filter((e) => !e.hidden && f.has(String(e.accessor))).map((e) => String(e.accessor)), h = /* @__PURE__ */ new Map();
|
|
1568
|
+
for (let t of e) {
|
|
1569
|
+
let e = String(t.accessor);
|
|
1570
|
+
m.includes(e) && (t.pinned ? h.set(e, t.pinned) : o && e === m[0] && !h.has(e) ? h.set(e, "left") : c && e === m[m.length - 1] && !h.has(e) && h.set(e, "right"));
|
|
1571
|
+
}
|
|
1572
|
+
let g = m.filter((e) => h.get(e) === "left"), _ = m.filter((e) => h.get(e) === "right"), v = /* @__PURE__ */ new Map(), y = p;
|
|
1573
|
+
g.forEach((e, t) => {
|
|
1574
|
+
v.set(e, {
|
|
1575
|
+
position: d ? "right" : "left",
|
|
1576
|
+
logicalSide: "left",
|
|
1577
|
+
offset: y,
|
|
1578
|
+
isBoundary: t === g.length - 1
|
|
1579
|
+
}), y += f.get(e) || 0;
|
|
1580
|
+
});
|
|
1581
|
+
let b = -.4, x = [..._].reverse();
|
|
1582
|
+
x.forEach((e, t) => {
|
|
1583
|
+
v.set(e, {
|
|
1584
|
+
position: d ? "left" : "right",
|
|
1585
|
+
logicalSide: "right",
|
|
1586
|
+
offset: b,
|
|
1587
|
+
isBoundary: t === x.length - 1
|
|
1588
|
+
}), b += f.get(e) || 0;
|
|
1589
|
+
}), u((e) => {
|
|
1590
|
+
if (e.size !== v.size) return v;
|
|
1591
|
+
for (let [t, n] of v) {
|
|
1592
|
+
let r = e.get(t);
|
|
1593
|
+
if (!r || r.position !== n.position || r.logicalSide !== n.logicalSide || r.offset !== n.offset || r.isBoundary !== n.isBoundary) return v;
|
|
1594
|
+
}
|
|
1595
|
+
return e;
|
|
1596
|
+
});
|
|
1597
|
+
}, [
|
|
1598
|
+
e,
|
|
1599
|
+
i,
|
|
1600
|
+
t,
|
|
1601
|
+
n,
|
|
1602
|
+
r,
|
|
1603
|
+
o,
|
|
1604
|
+
c
|
|
1605
|
+
]);
|
|
1606
|
+
return s(() => {
|
|
1607
|
+
if (!o && !c && !e.some((e) => e.pinned)) return;
|
|
1608
|
+
let r = t.current ?? n.current;
|
|
1609
|
+
if (!r) return;
|
|
1610
|
+
let i = !!t.current, a = i ? r.querySelector("tr:last-of-type") : r.querySelector("tr:first-of-type");
|
|
1611
|
+
if (!a) return;
|
|
1612
|
+
let s = new ResizeObserver(f);
|
|
1613
|
+
return a.querySelectorAll(i ? "th" : "td").forEach((e) => {
|
|
1614
|
+
s.observe(e);
|
|
1615
|
+
}), () => s.disconnect();
|
|
1616
|
+
}, [
|
|
1617
|
+
t,
|
|
1618
|
+
n,
|
|
1619
|
+
f
|
|
1620
|
+
]), an(f, [f]), {
|
|
1621
|
+
pinnedMap: l,
|
|
1622
|
+
hasLeftPinned: [...l.values()].some((e) => e.logicalSide === "left"),
|
|
1623
|
+
hasRightPinned: [...l.values()].some((e) => e.logicalSide === "right")
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
function hn(e) {
|
|
1407
1627
|
let [t, n] = d(null);
|
|
1408
1628
|
return s(() => {
|
|
1409
1629
|
n(null);
|
|
@@ -1412,7 +1632,7 @@ function un(e) {
|
|
|
1412
1632
|
setLastSelectionChangeIndex: n
|
|
1413
1633
|
};
|
|
1414
1634
|
}
|
|
1415
|
-
function
|
|
1635
|
+
function gn(e, t) {
|
|
1416
1636
|
let n = () => {
|
|
1417
1637
|
t(e.map((e) => e.matches));
|
|
1418
1638
|
}, r = e.map((e) => {
|
|
@@ -1423,87 +1643,89 @@ function dn(e, t) {
|
|
|
1423
1643
|
}
|
|
1424
1644
|
});
|
|
1425
1645
|
return () => {
|
|
1426
|
-
r.forEach((e) =>
|
|
1646
|
+
r.forEach((e) => {
|
|
1647
|
+
e();
|
|
1648
|
+
});
|
|
1427
1649
|
};
|
|
1428
1650
|
}
|
|
1429
|
-
function
|
|
1651
|
+
function _n(e, t) {
|
|
1430
1652
|
return t || (typeof window < "u" && "matchMedia" in window ? e.map((e) => window.matchMedia(e).matches) : e.map(() => !1));
|
|
1431
1653
|
}
|
|
1432
|
-
function
|
|
1433
|
-
let [r, i] = d(n ? t :
|
|
1654
|
+
function vn(e, t, { getInitialValueInEffect: n } = { getInitialValueInEffect: !0 }) {
|
|
1655
|
+
let [r, i] = d(n ? t : _n(e, t)), a = u(null);
|
|
1434
1656
|
return s(() => {
|
|
1435
|
-
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)),
|
|
1657
|
+
if ("matchMedia" in window) return a.current = e.map((e) => window.matchMedia(e)), i(a.current.map((e) => e.matches)), gn(a.current, (e) => {
|
|
1436
1658
|
i(e);
|
|
1437
1659
|
});
|
|
1438
1660
|
}, [e]), r;
|
|
1439
1661
|
}
|
|
1440
|
-
function
|
|
1441
|
-
let t =
|
|
1442
|
-
return
|
|
1662
|
+
function yn(e) {
|
|
1663
|
+
let t = me();
|
|
1664
|
+
return vn(l(() => e.map((e) => (typeof e == "function" ? e(t) : e) ?? ""), [e, t]), l(() => e.map(() => !0), [e]));
|
|
1443
1665
|
}
|
|
1444
|
-
function
|
|
1445
|
-
let t =
|
|
1666
|
+
function bn(e) {
|
|
1667
|
+
let t = me();
|
|
1446
1668
|
return Oe((typeof e == "function" ? e(t) : e) || "", !0);
|
|
1447
1669
|
}
|
|
1448
|
-
function
|
|
1670
|
+
function xn(e) {
|
|
1449
1671
|
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
1450
1672
|
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1451
1673
|
}
|
|
1452
|
-
function
|
|
1674
|
+
function Sn(e, t, n) {
|
|
1453
1675
|
return e.filter((e) => !t.map(n).includes(n(e)));
|
|
1454
1676
|
}
|
|
1455
|
-
function
|
|
1677
|
+
function Cn(e, t) {
|
|
1456
1678
|
return e.filter((e, n, r) => n === r.findIndex((n) => t(e) === t(n)));
|
|
1457
1679
|
}
|
|
1458
|
-
function
|
|
1680
|
+
function wn(e, t) {
|
|
1459
1681
|
return t ? t.match(/([^[.\]])+/g).reduce((e, t) => e && e[t], e) : void 0;
|
|
1460
1682
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return typeof t == "string" ?
|
|
1683
|
+
function $(e, t) {
|
|
1684
|
+
return typeof t == "string" ? wn(e, t) : t(e);
|
|
1463
1685
|
}
|
|
1464
|
-
function
|
|
1465
|
-
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 +
|
|
1686
|
+
function Tn(e) {
|
|
1687
|
+
return !e || e.length === 0 ? 0 : Math.max(...e.map((e) => e.groups && e.groups.length > 0 ? 1 + Tn(e.groups) : 1));
|
|
1466
1688
|
}
|
|
1467
|
-
function
|
|
1689
|
+
function En(e) {
|
|
1468
1690
|
let t = [];
|
|
1469
|
-
for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...
|
|
1691
|
+
for (let n of e) n.columns && n.columns.length > 0 ? t.push(...n.columns.filter((e) => e != null)) : n.groups && n.groups.length > 0 && t.push(...En(n.groups));
|
|
1470
1692
|
return t.filter((e) => e != null);
|
|
1471
1693
|
}
|
|
1472
|
-
function
|
|
1473
|
-
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t ? t[n] !== !1 : !0).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e +
|
|
1694
|
+
function Dn(e, t) {
|
|
1695
|
+
return e.columns && e.columns.length > 0 ? e.columns.filter((e, n) => e.hidden ? !1 : t ? t[n] !== !1 : !0).length : e.groups && e.groups.length > 0 ? e.groups.reduce((e, n) => e + Dn(n, t), 0) : 0;
|
|
1474
1696
|
}
|
|
1475
|
-
function
|
|
1697
|
+
function On(e, t, n = 0) {
|
|
1476
1698
|
if (n === t) return [...e];
|
|
1477
1699
|
let r = [];
|
|
1478
|
-
for (let i of e) i.groups && i.groups.length > 0 && r.push(...
|
|
1700
|
+
for (let i of e) i.groups && i.groups.length > 0 && r.push(...On(i.groups, t, n + 1));
|
|
1479
1701
|
return r;
|
|
1480
1702
|
}
|
|
1481
|
-
function
|
|
1703
|
+
function kn(e, t, n) {
|
|
1482
1704
|
return n ? !e || t : !1;
|
|
1483
1705
|
}
|
|
1484
|
-
function
|
|
1706
|
+
function An({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
1485
1707
|
let r = [];
|
|
1486
1708
|
if (e && t) {
|
|
1487
1709
|
let { trigger: i, allowMultiple: a, initiallyExpanded: o } = e;
|
|
1488
|
-
t && i === "always" ? r = t.map((e) =>
|
|
1710
|
+
t && i === "always" ? r = t.map((e) => $(e, n)) : o && (r = t.filter((e, t) => o({
|
|
1489
1711
|
record: e,
|
|
1490
1712
|
index: t
|
|
1491
|
-
})).map((e) =>
|
|
1713
|
+
})).map((e) => $(e, n)), a || (r = [r[0]]));
|
|
1492
1714
|
}
|
|
1493
1715
|
let i, a, o = d(r);
|
|
1494
1716
|
if (e) {
|
|
1495
1717
|
let { expandable: t, trigger: r, allowMultiple: s, collapseProps: c, content: l } = e;
|
|
1496
1718
|
e.expanded ? {recordIds: i, onRecordIdsChange: a} = e.expanded : [i, a] = o;
|
|
1497
|
-
let u = (e) => a?.(i.filter((t) => t !==
|
|
1719
|
+
let u = (e) => a?.(i.filter((t) => t !== $(e, n)));
|
|
1498
1720
|
return {
|
|
1499
1721
|
expandOnClick: r !== "always" && r !== "never",
|
|
1500
|
-
isRowExpanded: (e) => r === "always" ? !0 : i.includes(
|
|
1722
|
+
isRowExpanded: (e) => r === "always" ? !0 : i.includes($(e, n)),
|
|
1501
1723
|
isExpandable: ({ record: e, index: n }) => t ? t({
|
|
1502
1724
|
record: e,
|
|
1503
1725
|
index: n
|
|
1504
1726
|
}) : !0,
|
|
1505
1727
|
expandRow: (e) => {
|
|
1506
|
-
let t =
|
|
1728
|
+
let t = $(e, n);
|
|
1507
1729
|
a?.(s ? [...i, t] : [t]);
|
|
1508
1730
|
},
|
|
1509
1731
|
collapseRow: u,
|
|
@@ -1516,7 +1738,7 @@ function Tn({ rowExpansion: e, records: t, idAccessor: n }) {
|
|
|
1516
1738
|
};
|
|
1517
1739
|
}
|
|
1518
1740
|
}
|
|
1519
|
-
function
|
|
1741
|
+
function jn(e, t) {
|
|
1520
1742
|
let [n, r] = d(e), [i, a] = d(e), o = Ae(() => r(!0), 0), c = Ae(() => a(!1), t || 200);
|
|
1521
1743
|
return s(() => {
|
|
1522
1744
|
e ? (c.clear(), a(!0), o.start()) : (o.clear(), r(!1), c.start());
|
|
@@ -1529,56 +1751,67 @@ function En(e, t) {
|
|
|
1529
1751
|
visible: i
|
|
1530
1752
|
};
|
|
1531
1753
|
}
|
|
1532
|
-
var
|
|
1533
|
-
function
|
|
1534
|
-
return
|
|
1754
|
+
var Mn = "mantine-datatable-nowrap", Nn = "mantine-datatable-ellipsis", Pn = "mantine-datatable-pointer-cursor", Fn = "mantine-datatable-context-menu-cursor", In = "mantine-datatable-text-selection-disabled", Ln = "mantine-datatable-text-align-left", Rn = "mantine-datatable-text-align-center", zn = "mantine-datatable-text-align-right";
|
|
1755
|
+
function Bn({ className: e, style: t, pinnedInfo: n, visibleMediaQuery: r, title: i, noWrap: a, ellipsis: o, textAlign: s, width: c }) {
|
|
1756
|
+
return bn(r) ? p(ae, {
|
|
1757
|
+
"data-pinned": n?.position,
|
|
1758
|
+
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1535
1759
|
className: X({
|
|
1536
|
-
[
|
|
1537
|
-
[
|
|
1538
|
-
[
|
|
1539
|
-
[
|
|
1540
|
-
[
|
|
1760
|
+
[Mn]: a || o,
|
|
1761
|
+
[Nn]: o,
|
|
1762
|
+
[Ln]: s === "left",
|
|
1763
|
+
[Rn]: s === "center",
|
|
1764
|
+
[zn]: s === "right"
|
|
1541
1765
|
}, e),
|
|
1542
|
-
style: [
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1766
|
+
style: [
|
|
1767
|
+
{
|
|
1768
|
+
width: c,
|
|
1769
|
+
minWidth: c,
|
|
1770
|
+
maxWidth: c
|
|
1771
|
+
},
|
|
1772
|
+
t,
|
|
1773
|
+
n && {
|
|
1774
|
+
position: "sticky",
|
|
1775
|
+
[n.position]: n.offset,
|
|
1776
|
+
overflow: "visible"
|
|
1777
|
+
}
|
|
1778
|
+
],
|
|
1779
|
+
children: i
|
|
1548
1780
|
}) : null;
|
|
1549
1781
|
}
|
|
1550
|
-
function
|
|
1551
|
-
return p(
|
|
1782
|
+
function Vn({ shadowVisible: e }) {
|
|
1783
|
+
return p(ae, {
|
|
1552
1784
|
className: "mantine-datatable-footer-selector-placeholder-cell",
|
|
1553
1785
|
"data-shadow-visible": e || void 0
|
|
1554
1786
|
});
|
|
1555
1787
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return p(
|
|
1558
|
-
ref:
|
|
1788
|
+
function Hn({ className: e, style: t, columns: n, defaultColumnProps: r, pinnedMap: i, selectionVisible: a, selectorCellShadowVisible: o, ref: s }) {
|
|
1789
|
+
return p(ie, {
|
|
1790
|
+
ref: s,
|
|
1559
1791
|
className: X("mantine-datatable-footer", e),
|
|
1560
1792
|
style: t,
|
|
1561
|
-
children: m(
|
|
1793
|
+
children: m(z, { children: [a && p(Vn, { shadowVisible: o }), n.map(({ hidden: e, ...t }) => {
|
|
1562
1794
|
if (e) return null;
|
|
1563
|
-
let { accessor: n, visibleMediaQuery:
|
|
1795
|
+
let { accessor: n, visibleMediaQuery: a, textAlign: o, width: s, footer: c, footerClassName: l, footerStyle: u, noWrap: d, ellipsis: f } = {
|
|
1564
1796
|
...r,
|
|
1565
1797
|
...t
|
|
1566
1798
|
};
|
|
1567
|
-
return p(
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1799
|
+
return p(Bn, {
|
|
1800
|
+
pinnedInfo: i.get(String(n)),
|
|
1801
|
+
className: l,
|
|
1802
|
+
style: u,
|
|
1803
|
+
visibleMediaQuery: a,
|
|
1804
|
+
textAlign: o,
|
|
1805
|
+
width: s,
|
|
1806
|
+
title: c,
|
|
1807
|
+
noWrap: d,
|
|
1808
|
+
ellipsis: f
|
|
1576
1809
|
}, n);
|
|
1577
1810
|
})] })
|
|
1578
1811
|
});
|
|
1579
1812
|
}
|
|
1580
|
-
function
|
|
1581
|
-
let
|
|
1813
|
+
function Un({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, className: a, style: o }, pinnedInfo: s, maxDepth: c, currentDepth: u, previousGroups: d, isLastGroup: f, withColumnBorders: m = !1, totalTableColumns: h }) {
|
|
1814
|
+
let g = l(() => t && t.length > 0 ? t : n && n.length > 0 ? En([{
|
|
1582
1815
|
id: e,
|
|
1583
1816
|
columns: t,
|
|
1584
1817
|
groups: n
|
|
@@ -1586,30 +1819,36 @@ function Rn({ group: { id: e, columns: t, groups: n, title: r, textAlign: i, cla
|
|
|
1586
1819
|
t,
|
|
1587
1820
|
n,
|
|
1588
1821
|
e
|
|
1589
|
-
]),
|
|
1822
|
+
]), _ = yn(l(() => g.map(({ visibleMediaQuery: e }) => e), [g])), v = l(() => Dn({
|
|
1590
1823
|
id: e,
|
|
1591
1824
|
columns: t,
|
|
1592
1825
|
groups: n
|
|
1593
|
-
},
|
|
1826
|
+
}, _), [
|
|
1594
1827
|
e,
|
|
1595
1828
|
t,
|
|
1596
1829
|
n,
|
|
1597
|
-
|
|
1598
|
-
]),
|
|
1599
|
-
return
|
|
1600
|
-
colSpan:
|
|
1601
|
-
rowSpan:
|
|
1830
|
+
_
|
|
1831
|
+
]), y = l(() => d.reduce((e, t) => e + Dn(t, _), 0), [d, _]), b = n && n.length > 0 ? 1 : c - u, x = kn(f, y + v < h, m);
|
|
1832
|
+
return v > 0 ? p(ae, {
|
|
1833
|
+
colSpan: v,
|
|
1834
|
+
rowSpan: b > 1 ? b : void 0,
|
|
1835
|
+
"data-pinned": s?.position,
|
|
1836
|
+
"data-pinned-shadow": s?.isBoundary ? s.position : void 0,
|
|
1602
1837
|
className: X("mantine-datatable-column-group-header-cell", {
|
|
1603
|
-
[
|
|
1604
|
-
[
|
|
1605
|
-
[
|
|
1606
|
-
"mantine-datatable-column-group-header-cell--needs-border":
|
|
1838
|
+
[Ln]: i === "left",
|
|
1839
|
+
[Rn]: i === "center",
|
|
1840
|
+
[zn]: i === "right",
|
|
1841
|
+
"mantine-datatable-column-group-header-cell--needs-border": x
|
|
1607
1842
|
}, a),
|
|
1608
|
-
style: o,
|
|
1609
|
-
|
|
1843
|
+
style: [o, s && {
|
|
1844
|
+
position: "sticky",
|
|
1845
|
+
[s.position]: s.offset,
|
|
1846
|
+
overflow: "visible"
|
|
1847
|
+
}],
|
|
1848
|
+
children: r ?? xn(e)
|
|
1610
1849
|
}) : null;
|
|
1611
1850
|
}
|
|
1612
|
-
function
|
|
1851
|
+
function Wn() {
|
|
1613
1852
|
return m("svg", {
|
|
1614
1853
|
width: "14",
|
|
1615
1854
|
height: "14",
|
|
@@ -1626,7 +1865,7 @@ function zn() {
|
|
|
1626
1865
|
}), p("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })]
|
|
1627
1866
|
});
|
|
1628
1867
|
}
|
|
1629
|
-
function
|
|
1868
|
+
function Gn() {
|
|
1630
1869
|
return m("svg", {
|
|
1631
1870
|
width: "14",
|
|
1632
1871
|
height: "14",
|
|
@@ -1647,15 +1886,16 @@ function Bn() {
|
|
|
1647
1886
|
})]
|
|
1648
1887
|
});
|
|
1649
1888
|
}
|
|
1650
|
-
function
|
|
1651
|
-
let [i, { close: a, toggle: o }] =
|
|
1889
|
+
function Kn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisableClickOutside: r }) {
|
|
1890
|
+
let [i, { close: a, toggle: o }] = De(!1), s = t ? Gn : Wn, c = Ee(a);
|
|
1652
1891
|
return r && (c = void 0), m(N, {
|
|
1653
1892
|
withArrow: !0,
|
|
1654
1893
|
shadow: "md",
|
|
1655
|
-
opened: i,
|
|
1656
|
-
onClose: a,
|
|
1657
1894
|
trapFocus: !0,
|
|
1658
1895
|
...n,
|
|
1896
|
+
opened: i,
|
|
1897
|
+
onClose: a,
|
|
1898
|
+
onDismiss: a,
|
|
1659
1899
|
children: [p(ee, { children: p(h, {
|
|
1660
1900
|
className: "mantine-datatable-header-cell-filter-action-icon",
|
|
1661
1901
|
"data-active": t || void 0,
|
|
@@ -1674,11 +1914,165 @@ function Vn({ children: e, isActive: t, filterPopoverProps: n, filterPopoverDisa
|
|
|
1674
1914
|
})]
|
|
1675
1915
|
});
|
|
1676
1916
|
}
|
|
1677
|
-
|
|
1917
|
+
function qn() {
|
|
1918
|
+
return m("svg", {
|
|
1919
|
+
width: "14",
|
|
1920
|
+
height: "14",
|
|
1921
|
+
viewBox: "0 0 24 24",
|
|
1922
|
+
strokeWidth: "2",
|
|
1923
|
+
stroke: "currentColor",
|
|
1924
|
+
fill: "none",
|
|
1925
|
+
strokeLinecap: "round",
|
|
1926
|
+
strokeLinejoin: "round",
|
|
1927
|
+
children: [
|
|
1928
|
+
p("path", {
|
|
1929
|
+
stroke: "none",
|
|
1930
|
+
d: "M0 0h24v24H0z",
|
|
1931
|
+
fill: "none"
|
|
1932
|
+
}),
|
|
1933
|
+
p("path", { d: "M5 12l14 0" }),
|
|
1934
|
+
p("path", { d: "M5 12l6 6" }),
|
|
1935
|
+
p("path", { d: "M5 12l6 -6" })
|
|
1936
|
+
]
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
function Jn() {
|
|
1940
|
+
return m("svg", {
|
|
1941
|
+
width: "14",
|
|
1942
|
+
height: "14",
|
|
1943
|
+
viewBox: "0 0 24 24",
|
|
1944
|
+
strokeWidth: "2",
|
|
1945
|
+
stroke: "currentColor",
|
|
1946
|
+
fill: "none",
|
|
1947
|
+
strokeLinecap: "round",
|
|
1948
|
+
strokeLinejoin: "round",
|
|
1949
|
+
children: [
|
|
1950
|
+
p("path", {
|
|
1951
|
+
stroke: "none",
|
|
1952
|
+
d: "M0 0h24v24H0z",
|
|
1953
|
+
fill: "none"
|
|
1954
|
+
}),
|
|
1955
|
+
p("path", { d: "M5 12l14 0" }),
|
|
1956
|
+
p("path", { d: "M19 12l-6 6" }),
|
|
1957
|
+
p("path", { d: "M19 12l-6 -6" })
|
|
1958
|
+
]
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
function Yn() {
|
|
1962
|
+
return m("svg", {
|
|
1963
|
+
width: "14",
|
|
1964
|
+
height: "14",
|
|
1965
|
+
viewBox: "0 0 24 24",
|
|
1966
|
+
strokeWidth: "2",
|
|
1967
|
+
stroke: "currentColor",
|
|
1968
|
+
fill: "none",
|
|
1969
|
+
strokeLinecap: "round",
|
|
1970
|
+
strokeLinejoin: "round",
|
|
1971
|
+
children: [
|
|
1972
|
+
p("path", {
|
|
1973
|
+
stroke: "none",
|
|
1974
|
+
d: "M0 0h24v24H0z",
|
|
1975
|
+
fill: "none"
|
|
1976
|
+
}),
|
|
1977
|
+
p("path", { d: "M9 4v6l-2 4v2h10v-2l-2-4v-6" }),
|
|
1978
|
+
p("path", { d: "M12 16v5" }),
|
|
1979
|
+
p("path", { d: "M8 4h8" })
|
|
1980
|
+
]
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
function Xn() {
|
|
1984
|
+
return m("svg", {
|
|
1985
|
+
width: "14",
|
|
1986
|
+
height: "14",
|
|
1987
|
+
viewBox: "0 0 24 24",
|
|
1988
|
+
strokeWidth: "2",
|
|
1989
|
+
stroke: "currentColor",
|
|
1990
|
+
fill: "none",
|
|
1991
|
+
strokeLinecap: "round",
|
|
1992
|
+
strokeLinejoin: "round",
|
|
1993
|
+
children: [
|
|
1994
|
+
p("path", {
|
|
1995
|
+
stroke: "none",
|
|
1996
|
+
d: "M0 0h24v24H0z",
|
|
1997
|
+
fill: "none"
|
|
1998
|
+
}),
|
|
1999
|
+
p("path", { d: "M18 6l-12 12" }),
|
|
2000
|
+
p("path", { d: "M6 6l12 12" })
|
|
2001
|
+
]
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
function Zn({ currentPinned: e, onPinChange: t }) {
|
|
2005
|
+
let [n, r] = d(!1), i = u(null), [o, c] = d(!1), l = a(() => {
|
|
2006
|
+
if (i.current) {
|
|
2007
|
+
let e = getComputedStyle(i.current).direction;
|
|
2008
|
+
c(e === "rtl");
|
|
2009
|
+
}
|
|
2010
|
+
}, []);
|
|
2011
|
+
an(() => {
|
|
2012
|
+
l();
|
|
2013
|
+
}, [l]), s(() => {
|
|
2014
|
+
n && l();
|
|
2015
|
+
}, [n, l]);
|
|
2016
|
+
let f = o ? "right" : "left", g = o ? "left" : "right", _ = e === f, v = e === g;
|
|
2017
|
+
return m(N, {
|
|
2018
|
+
opened: n,
|
|
2019
|
+
onChange: r,
|
|
2020
|
+
position: "bottom",
|
|
2021
|
+
withArrow: !0,
|
|
2022
|
+
shadow: "sm",
|
|
2023
|
+
children: [p(N.Target, { children: p(y, {
|
|
2024
|
+
ref: i,
|
|
2025
|
+
className: "mantine-datatable-header-cell-pinnable-icon",
|
|
2026
|
+
role: "button",
|
|
2027
|
+
"aria-label": "Pin column",
|
|
2028
|
+
onMouseEnter: () => r(!0),
|
|
2029
|
+
onMouseLeave: () => r(!1),
|
|
2030
|
+
children: p(h, {
|
|
2031
|
+
size: "xs",
|
|
2032
|
+
variant: "light",
|
|
2033
|
+
onClick: (e) => e.stopPropagation(),
|
|
2034
|
+
children: p(Yn, {})
|
|
2035
|
+
})
|
|
2036
|
+
}) }), p(N.Dropdown, {
|
|
2037
|
+
onClick: (e) => e.stopPropagation(),
|
|
2038
|
+
onMouseEnter: () => r(!0),
|
|
2039
|
+
onMouseLeave: () => r(!1),
|
|
2040
|
+
className: "mantine-datatable-pinnable-dropdown",
|
|
2041
|
+
children: m(w, {
|
|
2042
|
+
gap: 4,
|
|
2043
|
+
children: [
|
|
2044
|
+
p(h, {
|
|
2045
|
+
size: "sm",
|
|
2046
|
+
variant: _ ? "filled" : "light",
|
|
2047
|
+
onClick: () => t(_ ? void 0 : f),
|
|
2048
|
+
"aria-label": "Pin left",
|
|
2049
|
+
children: p(qn, {})
|
|
2050
|
+
}),
|
|
2051
|
+
p(h, {
|
|
2052
|
+
size: "sm",
|
|
2053
|
+
variant: v ? "filled" : "light",
|
|
2054
|
+
onClick: () => t(v ? void 0 : g),
|
|
2055
|
+
"aria-label": "Pin right",
|
|
2056
|
+
children: p(Jn, {})
|
|
2057
|
+
}),
|
|
2058
|
+
e && p(h, {
|
|
2059
|
+
size: "sm",
|
|
2060
|
+
variant: "light",
|
|
2061
|
+
color: "red",
|
|
2062
|
+
onClick: () => t(void 0),
|
|
2063
|
+
"aria-label": "Unpin",
|
|
2064
|
+
children: p(Xn, {})
|
|
2065
|
+
})
|
|
2066
|
+
]
|
|
2067
|
+
})
|
|
2068
|
+
})]
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
var Qn = 50, $n = (e) => {
|
|
1678
2072
|
let { accessor: t, columnRef: n } = e, [r, i] = d(!1), o = u(0), s = u({
|
|
1679
2073
|
current: 0,
|
|
1680
2074
|
next: 0
|
|
1681
|
-
}), { dir: c } =
|
|
2075
|
+
}), { dir: c } = pe(), l = c === "rtl", { setMultipleColumnWidths: f, beginResize: m, endResize: h } = Jt(), g = a((e) => {
|
|
1682
2076
|
if (e.preventDefault(), e.stopPropagation(), !n.current) return;
|
|
1683
2077
|
let r = n.current, a = r.nextElementSibling;
|
|
1684
2078
|
for (; a;) {
|
|
@@ -1689,63 +2083,47 @@ var Hn = (e) => {
|
|
|
1689
2083
|
if (!a) return;
|
|
1690
2084
|
let c = a.getAttribute("data-accessor");
|
|
1691
2085
|
if (!c) return;
|
|
1692
|
-
let u =
|
|
1693
|
-
i(!0), o.current = e.clientX, s.current = {
|
|
1694
|
-
current:
|
|
1695
|
-
next:
|
|
2086
|
+
let u = r.offsetWidth, d = a.offsetWidth;
|
|
2087
|
+
m(), i(!0), o.current = e.clientX, s.current = {
|
|
2088
|
+
current: u,
|
|
2089
|
+
next: d
|
|
1696
2090
|
};
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
l && (i = -i);
|
|
1703
|
-
let a = s.current.current - 50, c = s.current.next - 50, u = Math.max(-a, Math.min(i, c)), d = s.current.current + u, f = s.current.next - u;
|
|
1704
|
-
t.style.width = `${d}px`, r.style.width = `${f}px`, t.style.minWidth = `${d}px`, t.style.maxWidth = `${d}px`, r.style.minWidth = `${f}px`, r.style.maxWidth = `${f}px`;
|
|
1705
|
-
}, p = () => {
|
|
1706
|
-
if (!n.current) return;
|
|
1707
|
-
let e = n.current, r = e.nextElementSibling;
|
|
1708
|
-
i(!1), document.body.style.cursor = "initial", document.body.style.userSelect = "initial";
|
|
1709
|
-
let a = parseInt(e.style.width) || e.offsetWidth, o = r ? parseInt(r.style.width) || r.offsetWidth : 0, s = [{
|
|
2091
|
+
let p = (e) => {
|
|
2092
|
+
let n = e.clientX - o.current;
|
|
2093
|
+
l && (n = -n);
|
|
2094
|
+
let r = s.current.current - Qn, i = s.current.next - Qn, a = Math.max(-r, Math.min(n, i)), u = s.current.current + a, d = s.current.next - a;
|
|
2095
|
+
f([{
|
|
1710
2096
|
accessor: t,
|
|
1711
|
-
width: `${
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
setTimeout(() => {
|
|
1721
|
-
f(s);
|
|
1722
|
-
}, 0), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", p);
|
|
2097
|
+
width: `${u}px`
|
|
2098
|
+
}, {
|
|
2099
|
+
accessor: c,
|
|
2100
|
+
width: `${d}px`
|
|
2101
|
+
}]);
|
|
2102
|
+
}, g = () => {
|
|
2103
|
+
i(!1), document.body.style.cursor = "initial", document.body.style.userSelect = "initial", h(), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
|
|
1723
2104
|
};
|
|
1724
|
-
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove",
|
|
2105
|
+
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", p), document.addEventListener("mouseup", g);
|
|
1725
2106
|
}, [
|
|
1726
2107
|
t,
|
|
1727
2108
|
n,
|
|
1728
2109
|
l,
|
|
1729
|
-
f
|
|
1730
|
-
|
|
2110
|
+
f,
|
|
2111
|
+
m,
|
|
2112
|
+
h
|
|
2113
|
+
]), _ = a(() => {
|
|
1731
2114
|
if (!n.current) return;
|
|
1732
|
-
let e = n.current, r =
|
|
1733
|
-
e.style.width = "", e.style.minWidth = "", e.style.maxWidth = "";
|
|
1734
|
-
let i = [{
|
|
2115
|
+
let e = n.current.nextElementSibling, r = [{
|
|
1735
2116
|
accessor: t,
|
|
1736
2117
|
width: "auto"
|
|
1737
2118
|
}];
|
|
1738
|
-
if (
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
accessor: e,
|
|
2119
|
+
if (e) {
|
|
2120
|
+
let t = e.getAttribute("data-accessor");
|
|
2121
|
+
t && t !== "__selection__" && r.push({
|
|
2122
|
+
accessor: t,
|
|
1743
2123
|
width: "auto"
|
|
1744
2124
|
});
|
|
1745
2125
|
}
|
|
1746
|
-
|
|
1747
|
-
f(i);
|
|
1748
|
-
}, 0);
|
|
2126
|
+
f(r);
|
|
1749
2127
|
}, [
|
|
1750
2128
|
t,
|
|
1751
2129
|
n,
|
|
@@ -1754,13 +2132,13 @@ var Hn = (e) => {
|
|
|
1754
2132
|
return p("div", {
|
|
1755
2133
|
className: "mantine-datatable-header-resizable-handle",
|
|
1756
2134
|
style: { cursor: r ? "col-resize" : void 0 },
|
|
1757
|
-
onMouseDown:
|
|
1758
|
-
onDoubleClick:
|
|
2135
|
+
onMouseDown: g,
|
|
2136
|
+
onDoubleClick: _,
|
|
1759
2137
|
onClick: (e) => e.stopPropagation(),
|
|
1760
2138
|
title: "Drag to resize column, double-click to reset"
|
|
1761
2139
|
});
|
|
1762
2140
|
};
|
|
1763
|
-
function
|
|
2141
|
+
function er() {
|
|
1764
2142
|
return m("svg", {
|
|
1765
2143
|
width: "14",
|
|
1766
2144
|
height: "14",
|
|
@@ -1776,13 +2154,13 @@ function Un() {
|
|
|
1776
2154
|
d: "M0 0h24v24H0z",
|
|
1777
2155
|
fill: "none"
|
|
1778
2156
|
}),
|
|
1779
|
-
p("path", { d: "
|
|
1780
|
-
p("path", { d: "
|
|
1781
|
-
p("path", { d: "
|
|
2157
|
+
p("path", { d: "M8 7l4 -4l4 4" }),
|
|
2158
|
+
p("path", { d: "M8 17l4 4l4 -4" }),
|
|
2159
|
+
p("path", { d: "M12 3l0 18" })
|
|
1782
2160
|
]
|
|
1783
2161
|
});
|
|
1784
2162
|
}
|
|
1785
|
-
function
|
|
2163
|
+
function tr() {
|
|
1786
2164
|
return m("svg", {
|
|
1787
2165
|
width: "14",
|
|
1788
2166
|
height: "14",
|
|
@@ -1798,13 +2176,13 @@ function Wn() {
|
|
|
1798
2176
|
d: "M0 0h24v24H0z",
|
|
1799
2177
|
fill: "none"
|
|
1800
2178
|
}),
|
|
1801
|
-
p("path", { d: "
|
|
1802
|
-
p("path", { d: "
|
|
1803
|
-
p("path", { d: "
|
|
2179
|
+
p("path", { d: "M12 5l0 14" }),
|
|
2180
|
+
p("path", { d: "M16 9l-4 -4" }),
|
|
2181
|
+
p("path", { d: "M8 9l4 -4" })
|
|
1804
2182
|
]
|
|
1805
2183
|
});
|
|
1806
2184
|
}
|
|
1807
|
-
function
|
|
2185
|
+
function nr() {
|
|
1808
2186
|
return m("svg", {
|
|
1809
2187
|
width: "14",
|
|
1810
2188
|
height: "14",
|
|
@@ -1829,71 +2207,66 @@ function Gn() {
|
|
|
1829
2207
|
]
|
|
1830
2208
|
});
|
|
1831
2209
|
}
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
strokeLinecap: "round",
|
|
1841
|
-
strokeLinejoin: "round",
|
|
1842
|
-
children: [
|
|
1843
|
-
p("path", {
|
|
1844
|
-
stroke: "none",
|
|
1845
|
-
d: "M0 0h24v24H0z",
|
|
1846
|
-
fill: "none"
|
|
1847
|
-
}),
|
|
1848
|
-
p("path", { d: "M18 6l-12 12" }),
|
|
1849
|
-
p("path", { d: "M6 6l12 12" })
|
|
1850
|
-
]
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1853
|
-
function qn({ className: e, style: t, accessor: n, visibleMediaQuery: r, title: i, sortable: a, draggable: o, toggleable: s, resizable: c, sortIcons: l, textAlign: g, width: v, sortStatus: b, onSortStatusChange: x, filter: S, filterPopoverProps: T, filterPopoverDisableClickOutside: E, filtering: D, sortKey: O }) {
|
|
1854
|
-
let { setSourceColumn: k, setTargetColumn: A, swapColumns: j, setColumnsToggle: M } = Gt(), [N, P] = d(!1), ee = u(null);
|
|
1855
|
-
if (!hn(r)) return null;
|
|
1856
|
-
let F = i ?? gn(n), I = typeof F == "string" ? F : void 0, L = a && x ? (e) => {
|
|
1857
|
-
e?.defaultPrevented || x({
|
|
1858
|
-
sortKey: O,
|
|
1859
|
-
columnAccessor: n,
|
|
1860
|
-
direction: b?.columnAccessor === n ? b.direction === "asc" ? "desc" : "asc" : b?.direction ?? "asc"
|
|
2210
|
+
function rr({ className: e, style: t, pinnedInfo: n, accessor: r, visibleMediaQuery: i, title: a, sortable: o, draggable: s, toggleable: c, pinnable: l, resizable: f, sortIcons: g, textAlign: v, width: b, sortStatus: x, onSortStatusChange: S, filter: T, filterPopoverProps: E, filterPopoverDisableClickOutside: D, filtering: O, sortKey: k }) {
|
|
2211
|
+
let { setSourceColumn: A, setTargetColumn: j, swapColumns: M, columnsToggle: N, setColumnsToggle: P, columnsPinning: ee, setColumnsPinning: F } = Jt(), [te, I] = d(!1), L = u(null), R = ee?.find((e) => e.accessor === r)?.pinned;
|
|
2212
|
+
if (!bn(i)) return null;
|
|
2213
|
+
let ne = a ?? xn(r), re = typeof ne == "string" ? ne : void 0, ie = o && S ? (e) => {
|
|
2214
|
+
e?.defaultPrevented || S({
|
|
2215
|
+
sortKey: k,
|
|
2216
|
+
columnAccessor: r,
|
|
2217
|
+
direction: x?.columnAccessor === r ? x.direction === "asc" ? "desc" : "asc" : x?.direction ?? "asc"
|
|
1861
2218
|
});
|
|
1862
|
-
} : void 0,
|
|
1863
|
-
e.stopPropagation(),
|
|
2219
|
+
} : void 0, oe = (e) => {
|
|
2220
|
+
e.stopPropagation(), A(r), I(!1);
|
|
1864
2221
|
}, z = (e) => {
|
|
1865
|
-
e.preventDefault(),
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1868
|
-
},
|
|
1869
|
-
|
|
1870
|
-
},
|
|
1871
|
-
|
|
1872
|
-
},
|
|
1873
|
-
e.stopPropagation(),
|
|
2222
|
+
e.preventDefault(), j(r), I(!0);
|
|
2223
|
+
}, se = () => {
|
|
2224
|
+
j(r), I(!1), M();
|
|
2225
|
+
}, B = () => {
|
|
2226
|
+
I(!0);
|
|
2227
|
+
}, ce = () => {
|
|
2228
|
+
I(!1);
|
|
2229
|
+
}, le = (e) => {
|
|
2230
|
+
e.stopPropagation(), P(N.map((e) => e.accessor === r ? {
|
|
1874
2231
|
...e,
|
|
1875
2232
|
toggled: !1
|
|
1876
2233
|
} : e));
|
|
2234
|
+
}, ue = (e) => {
|
|
2235
|
+
F((t) => t.map((t) => t.accessor === r ? {
|
|
2236
|
+
...t,
|
|
2237
|
+
pinned: e
|
|
2238
|
+
} : t));
|
|
1877
2239
|
};
|
|
1878
|
-
return m(
|
|
1879
|
-
"data-accessor":
|
|
2240
|
+
return m(ae, {
|
|
2241
|
+
"data-accessor": r,
|
|
2242
|
+
"data-pinned": n?.position,
|
|
2243
|
+
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
1880
2244
|
className: X({
|
|
1881
|
-
"mantine-datatable-header-cell-sortable":
|
|
1882
|
-
"mantine-datatable-header-cell-toggleable":
|
|
1883
|
-
"mantine-datatable-header-cell-
|
|
2245
|
+
"mantine-datatable-header-cell-sortable": o,
|
|
2246
|
+
"mantine-datatable-header-cell-toggleable": c,
|
|
2247
|
+
"mantine-datatable-header-cell-pinnable": l,
|
|
2248
|
+
"mantine-datatable-header-cell-resizable": f
|
|
1884
2249
|
}, e),
|
|
1885
|
-
style: [
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2250
|
+
style: [
|
|
2251
|
+
{
|
|
2252
|
+
width: b,
|
|
2253
|
+
...f ? {} : {
|
|
2254
|
+
minWidth: b,
|
|
2255
|
+
maxWidth: b
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
t,
|
|
2259
|
+
n && {
|
|
2260
|
+
position: "sticky",
|
|
2261
|
+
[n.position]: n.offset,
|
|
2262
|
+
overflow: "visible"
|
|
1890
2263
|
}
|
|
1891
|
-
|
|
1892
|
-
role:
|
|
1893
|
-
tabIndex:
|
|
1894
|
-
onClick:
|
|
1895
|
-
onKeyDown: (e) => e.key === "Enter" &&
|
|
1896
|
-
ref:
|
|
2264
|
+
],
|
|
2265
|
+
role: o ? "button" : void 0,
|
|
2266
|
+
tabIndex: o ? 0 : void 0,
|
|
2267
|
+
onClick: ie,
|
|
2268
|
+
onKeyDown: (e) => e.key === "Enter" && ie?.(),
|
|
2269
|
+
ref: L,
|
|
1897
2270
|
children: [m(w, {
|
|
1898
2271
|
className: "mantine-datatable-header-cell-sortable-group",
|
|
1899
2272
|
justify: "space-between",
|
|
@@ -1903,16 +2276,16 @@ function qn({ className: e, style: t, accessor: n, visibleMediaQuery: r, title:
|
|
|
1903
2276
|
align: "center",
|
|
1904
2277
|
w: "100%",
|
|
1905
2278
|
className: X({
|
|
1906
|
-
"mantine-datatable-header-cell-draggable":
|
|
1907
|
-
"mantine-datatable-header-cell-drag-over":
|
|
2279
|
+
"mantine-datatable-header-cell-draggable": s,
|
|
2280
|
+
"mantine-datatable-header-cell-drag-over": te
|
|
1908
2281
|
}),
|
|
1909
|
-
draggable:
|
|
1910
|
-
onDragStart:
|
|
1911
|
-
onDragEnter:
|
|
1912
|
-
onDragOver:
|
|
1913
|
-
onDrop:
|
|
1914
|
-
onDragLeave:
|
|
1915
|
-
children: [
|
|
2282
|
+
draggable: s,
|
|
2283
|
+
onDragStart: s ? oe : void 0,
|
|
2284
|
+
onDragEnter: s ? B : void 0,
|
|
2285
|
+
onDragOver: s ? z : void 0,
|
|
2286
|
+
onDrop: s ? se : void 0,
|
|
2287
|
+
onDragLeave: s ? ce : void 0,
|
|
2288
|
+
children: [s ? p(y, {
|
|
1916
2289
|
role: "img",
|
|
1917
2290
|
"aria-label": "Drag column",
|
|
1918
2291
|
children: p(h, {
|
|
@@ -1922,65 +2295,69 @@ function qn({ className: e, style: t, accessor: n, visibleMediaQuery: r, title:
|
|
|
1922
2295
|
onClick: (e) => {
|
|
1923
2296
|
e.stopPropagation();
|
|
1924
2297
|
},
|
|
1925
|
-
children: p(
|
|
2298
|
+
children: p(nr, {})
|
|
1926
2299
|
})
|
|
1927
2300
|
}) : null, p(_, {
|
|
1928
2301
|
className: X("mantine-datatable-header-cell-sortable-text", {
|
|
1929
|
-
[
|
|
1930
|
-
[
|
|
1931
|
-
[
|
|
1932
|
-
},
|
|
1933
|
-
title:
|
|
1934
|
-
children:
|
|
2302
|
+
[Ln]: v === "left",
|
|
2303
|
+
[Rn]: v === "center",
|
|
2304
|
+
[zn]: v === "right"
|
|
2305
|
+
}, Mn, Nn),
|
|
2306
|
+
title: re,
|
|
2307
|
+
children: ne
|
|
1935
2308
|
})]
|
|
1936
2309
|
}),
|
|
1937
|
-
|
|
2310
|
+
l ? p(Zn, {
|
|
2311
|
+
currentPinned: R,
|
|
2312
|
+
onPinChange: ue
|
|
2313
|
+
}) : null,
|
|
2314
|
+
c ? p(y, {
|
|
1938
2315
|
className: "mantine-datatable-header-cell-toggleable-icon",
|
|
1939
2316
|
role: "img",
|
|
1940
2317
|
"aria-label": "Toggle column",
|
|
1941
2318
|
children: p(h, {
|
|
1942
2319
|
size: "xs",
|
|
1943
2320
|
variant: "light",
|
|
1944
|
-
onClick:
|
|
1945
|
-
children: p(
|
|
2321
|
+
onClick: le,
|
|
2322
|
+
children: p(Xn, {})
|
|
1946
2323
|
})
|
|
1947
2324
|
}) : null,
|
|
1948
|
-
|
|
1949
|
-
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed":
|
|
2325
|
+
o || x?.columnAccessor === r ? x?.columnAccessor === r ? p(y, {
|
|
2326
|
+
className: X("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": x.direction === "desc" }),
|
|
1950
2327
|
role: "img",
|
|
1951
|
-
"aria-label": `Sorted ${
|
|
1952
|
-
children:
|
|
2328
|
+
"aria-label": `Sorted ${x.direction === "desc" ? "descending" : "ascending"}`,
|
|
2329
|
+
children: g?.sorted || p(tr, {})
|
|
1953
2330
|
}) : p(y, {
|
|
1954
2331
|
className: "mantine-datatable-header-cell-sortable-unsorted-icon",
|
|
1955
2332
|
role: "img",
|
|
1956
2333
|
"aria-label": "Not sorted",
|
|
1957
|
-
children:
|
|
1958
|
-
})
|
|
1959
|
-
|
|
1960
|
-
filterPopoverProps:
|
|
1961
|
-
isActive: !!
|
|
1962
|
-
filterPopoverDisableClickOutside:
|
|
1963
|
-
children:
|
|
2334
|
+
children: g?.unsorted || p(er, {})
|
|
2335
|
+
}) : null,
|
|
2336
|
+
T ? p(Kn, {
|
|
2337
|
+
filterPopoverProps: E,
|
|
2338
|
+
isActive: !!O,
|
|
2339
|
+
filterPopoverDisableClickOutside: D,
|
|
2340
|
+
children: T
|
|
1964
2341
|
}) : null
|
|
1965
2342
|
]
|
|
1966
|
-
}),
|
|
1967
|
-
accessor:
|
|
1968
|
-
columnRef:
|
|
2343
|
+
}), f && r !== "__selection__" ? p($n, {
|
|
2344
|
+
accessor: r,
|
|
2345
|
+
columnRef: L
|
|
1969
2346
|
}) : null]
|
|
1970
2347
|
});
|
|
1971
2348
|
}
|
|
1972
|
-
function
|
|
2349
|
+
function ir({ className: e, style: t, trigger: n, shadowVisible: r, checked: i, indeterminate: a, checkboxProps: o, onChange: s, rowSpan: c, ref: l }) {
|
|
1973
2350
|
let u = !o.disabled;
|
|
1974
|
-
return p(
|
|
2351
|
+
return p(ae, {
|
|
1975
2352
|
ref: l,
|
|
1976
|
-
className: X("mantine-datatable-header-selector-cell", { [
|
|
2353
|
+
className: X("mantine-datatable-header-selector-cell", { [Pn]: n === "cell" && u }, e),
|
|
1977
2354
|
style: t,
|
|
1978
2355
|
rowSpan: c,
|
|
1979
2356
|
"data-shadow-visible": r || void 0,
|
|
1980
2357
|
"data-accessor": "__selection__",
|
|
1981
2358
|
onClick: n === "cell" && u ? s : void 0,
|
|
1982
2359
|
children: p(b, {
|
|
1983
|
-
classNames: u ? { input:
|
|
2360
|
+
classNames: u ? { input: Pn } : void 0,
|
|
1984
2361
|
checked: i,
|
|
1985
2362
|
indeterminate: a,
|
|
1986
2363
|
onChange: s,
|
|
@@ -1989,78 +2366,94 @@ function Jn({ className: e, style: t, trigger: n, shadowVisible: r, checked: i,
|
|
|
1989
2366
|
})
|
|
1990
2367
|
});
|
|
1991
2368
|
}
|
|
1992
|
-
function
|
|
1993
|
-
let
|
|
2369
|
+
function ar(e, t) {
|
|
2370
|
+
let n = (e.columns ?? []).filter((e) => !e.hidden).map((e) => String(e.accessor)), r = n.map((e) => t.get(e)).filter(Boolean);
|
|
2371
|
+
if (r.length === 0 || r.length !== n.length) return;
|
|
2372
|
+
let i = new Set(r.map((e) => e.logicalSide));
|
|
2373
|
+
if (i.size > 1) return;
|
|
2374
|
+
let a = [...i][0], o = a === "left" ? n[0] : n[n.length - 1], s = t.get(o);
|
|
2375
|
+
if (!s) return;
|
|
2376
|
+
let c = a === "left" ? n[n.length - 1] : n[0], l = t.get(c);
|
|
2377
|
+
return {
|
|
2378
|
+
...s,
|
|
2379
|
+
isBoundary: l?.isBoundary ?? !1
|
|
2380
|
+
};
|
|
2381
|
+
}
|
|
2382
|
+
function or({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r, sortIcons: i, onSortStatusChange: a, columns: o, defaultColumnProps: s, groups: c, pinnedMap: l, selectionTrigger: u, selectionVisible: f, selectionChecked: h, selectionIndeterminate: g, onSelectionChange: _, selectionCheckboxProps: v, selectorCellShadowVisible: y, selectionColumnClassName: x, selectionColumnStyle: S, withColumnBorders: C = !1, ref: T }) {
|
|
2383
|
+
let E = c ? Tn(c) : 0, D = E > 0 ? E + 1 : 1, O = f ? p(ir, {
|
|
1994
2384
|
ref: e,
|
|
1995
|
-
className:
|
|
1996
|
-
style:
|
|
1997
|
-
trigger:
|
|
1998
|
-
shadowVisible:
|
|
1999
|
-
checked:
|
|
2000
|
-
indeterminate:
|
|
2001
|
-
checkboxProps:
|
|
2002
|
-
onChange:
|
|
2003
|
-
rowSpan: c ?
|
|
2004
|
-
}) : null, { columnsToggle:
|
|
2385
|
+
className: x,
|
|
2386
|
+
style: S,
|
|
2387
|
+
trigger: u,
|
|
2388
|
+
shadowVisible: y,
|
|
2389
|
+
checked: h,
|
|
2390
|
+
indeterminate: g,
|
|
2391
|
+
checkboxProps: v,
|
|
2392
|
+
onChange: _,
|
|
2393
|
+
rowSpan: c ? D : void 0
|
|
2394
|
+
}) : null, { columnsToggle: k, setColumnsToggle: A } = Jt(), [j, M] = d(!1), F = o.some((e) => e.toggleable), te = F ? Object.fromEntries(o.map(({ accessor: e, title: t }) => [e, t ?? xn(String(e))])) : void 0, I = m(oe, {
|
|
2005
2395
|
className: X("mantine-datatable-header", t),
|
|
2006
2396
|
style: n,
|
|
2007
|
-
ref:
|
|
2008
|
-
onContextMenu:
|
|
2009
|
-
e.preventDefault(),
|
|
2397
|
+
ref: T,
|
|
2398
|
+
onContextMenu: F ? (e) => {
|
|
2399
|
+
e.preventDefault(), M((e) => !e);
|
|
2010
2400
|
} : void 0,
|
|
2011
|
-
children: [c && Array.from({ length:
|
|
2012
|
-
let n =
|
|
2013
|
-
return m(
|
|
2401
|
+
children: [c && Array.from({ length: E }, (e, t) => {
|
|
2402
|
+
let n = On(c, t);
|
|
2403
|
+
return m(z, { children: [t === 0 && O, n.map((e, r) => p(Un, {
|
|
2014
2404
|
group: e,
|
|
2015
|
-
|
|
2405
|
+
pinnedInfo: ar(e, l),
|
|
2406
|
+
maxDepth: E,
|
|
2016
2407
|
currentDepth: t,
|
|
2017
2408
|
previousGroups: n.slice(0, r),
|
|
2018
2409
|
isLastGroup: r === n.length - 1,
|
|
2019
|
-
withColumnBorders:
|
|
2410
|
+
withColumnBorders: C,
|
|
2020
2411
|
totalTableColumns: o.length
|
|
2021
2412
|
}, e.id))] }, `group-depth-${t}`);
|
|
2022
|
-
}), m(
|
|
2413
|
+
}), m(z, { children: [!c && O, o.map(({ hidden: e, ...t }, n) => {
|
|
2023
2414
|
if (e) return null;
|
|
2024
|
-
let { accessor: c, visibleMediaQuery:
|
|
2415
|
+
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 } = {
|
|
2025
2416
|
...s,
|
|
2026
2417
|
...t
|
|
2027
2418
|
};
|
|
2028
|
-
return p(
|
|
2419
|
+
return p(rr, {
|
|
2029
2420
|
accessor: c,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2421
|
+
pinnedInfo: l.get(String(c)),
|
|
2422
|
+
className: b,
|
|
2423
|
+
style: x,
|
|
2424
|
+
visibleMediaQuery: u,
|
|
2425
|
+
textAlign: d,
|
|
2426
|
+
width: f,
|
|
2427
|
+
title: m,
|
|
2428
|
+
sortable: h,
|
|
2429
|
+
draggable: g,
|
|
2430
|
+
toggleable: _,
|
|
2431
|
+
pinnable: v,
|
|
2432
|
+
resizable: y && n < o.length - 1,
|
|
2040
2433
|
sortStatus: r,
|
|
2041
2434
|
sortIcons: i,
|
|
2042
|
-
sortKey:
|
|
2435
|
+
sortKey: E,
|
|
2043
2436
|
onSortStatusChange: a,
|
|
2044
|
-
filter:
|
|
2045
|
-
filterPopoverProps:
|
|
2046
|
-
filterPopoverDisableClickOutside:
|
|
2047
|
-
filtering:
|
|
2437
|
+
filter: S,
|
|
2438
|
+
filterPopoverProps: C,
|
|
2439
|
+
filterPopoverDisableClickOutside: w,
|
|
2440
|
+
filtering: T
|
|
2048
2441
|
}, c);
|
|
2049
2442
|
})] })]
|
|
2050
2443
|
});
|
|
2051
|
-
return
|
|
2444
|
+
return F ? m(N, {
|
|
2052
2445
|
position: "bottom",
|
|
2053
2446
|
withArrow: !0,
|
|
2054
2447
|
shadow: "md",
|
|
2055
|
-
opened:
|
|
2056
|
-
onChange:
|
|
2057
|
-
children: [p(ee, { children: I }), p(P, { children: p(
|
|
2448
|
+
opened: j,
|
|
2449
|
+
onChange: M,
|
|
2450
|
+
children: [p(ee, { children: I }), p(P, { children: p(L, { children: k.filter((e) => e.toggleable).map((e) => p(w, { children: p(b, {
|
|
2058
2451
|
classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" },
|
|
2059
2452
|
size: "xs",
|
|
2060
|
-
label:
|
|
2453
|
+
label: te[e.accessor],
|
|
2061
2454
|
checked: e.toggled,
|
|
2062
2455
|
onChange: (t) => {
|
|
2063
|
-
k
|
|
2456
|
+
A(k.map((n) => n.accessor === e.accessor ? {
|
|
2064
2457
|
...n,
|
|
2065
2458
|
toggled: t.currentTarget.checked
|
|
2066
2459
|
} : n));
|
|
@@ -2068,7 +2461,7 @@ function Yn({ selectionColumnHeaderRef: e, className: t, style: n, sortStatus: r
|
|
|
2068
2461
|
}) }, e.accessor)) }) })]
|
|
2069
2462
|
}) : I;
|
|
2070
2463
|
}
|
|
2071
|
-
function
|
|
2464
|
+
function sr({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i, color: a }) {
|
|
2072
2465
|
return p(y, {
|
|
2073
2466
|
className: X("mantine-datatable-loader", { "mantine-datatable-loader-fetching": e }),
|
|
2074
2467
|
style: [{ backdropFilter: n ? `blur(${n}px)` : void 0 }],
|
|
@@ -2079,45 +2472,7 @@ function Xn({ fetching: e, customContent: t, backgroundBlur: n, size: r, type: i
|
|
|
2079
2472
|
}))
|
|
2080
2473
|
});
|
|
2081
2474
|
}
|
|
2082
|
-
function
|
|
2083
|
-
return e ? de({
|
|
2084
|
-
color: typeof e == "object" ? e[n] : e,
|
|
2085
|
-
theme: t
|
|
2086
|
-
}).value : void 0;
|
|
2087
|
-
}
|
|
2088
|
-
function Zn({ theme: e, c: t, backgroundColor: n, borderColor: r, rowBorderColor: i, stripedColor: a, highlightOnHoverColor: o }) {
|
|
2089
|
-
return {
|
|
2090
|
-
"--mantine-datatable-color-light": $(t, e, "light"),
|
|
2091
|
-
"--mantine-datatable-color-dark": $(t, e, "dark"),
|
|
2092
|
-
"--mantine-datatable-background-color-light": $(n, e, "light"),
|
|
2093
|
-
"--mantine-datatable-background-color-dark": $(n, e, "dark"),
|
|
2094
|
-
"--mantine-datatable-border-color-light": $(r, e, "light"),
|
|
2095
|
-
"--mantine-datatable-border-color-dark": $(r, e, "dark"),
|
|
2096
|
-
"--mantine-datatable-row-border-color-light": $(i, e, "light"),
|
|
2097
|
-
"--mantine-datatable-row-border-color-dark": $(i, e, "dark"),
|
|
2098
|
-
"--mantine-datatable-striped-color-light": $(a, e, "light"),
|
|
2099
|
-
"--mantine-datatable-striped-color-dark": $(a, e, "dark"),
|
|
2100
|
-
"--mantine-datatable-highlight-on-hover-color-light": $(o, e, "light"),
|
|
2101
|
-
"--mantine-datatable-highlight-on-hover-color-dark": $(o, e, "dark")
|
|
2102
|
-
};
|
|
2103
|
-
}
|
|
2104
|
-
function Qn({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: n }) {
|
|
2105
|
-
return {
|
|
2106
|
-
"--mantine-datatable-pagination-active-text-color-light": $(t, e, "light"),
|
|
2107
|
-
"--mantine-datatable-pagination-active-text-color-dark": $(t, e, "dark"),
|
|
2108
|
-
"--mantine-datatable-pagination-active-background-color-light": $(n, e, "light"),
|
|
2109
|
-
"--mantine-datatable-pagination-active-background-color-dark": $(n, e, "dark")
|
|
2110
|
-
};
|
|
2111
|
-
}
|
|
2112
|
-
function $n({ theme: e, color: t, backgroundColor: n }) {
|
|
2113
|
-
return {
|
|
2114
|
-
"--mantine-datatable-row-color-light": $(t, e, "light"),
|
|
2115
|
-
"--mantine-datatable-row-color-dark": $(t, e, "dark"),
|
|
2116
|
-
"--mantine-datatable-row-background-color-light": $(n, e, "light"),
|
|
2117
|
-
"--mantine-datatable-row-background-color-dark": $(n, e, "dark")
|
|
2118
|
-
};
|
|
2119
|
-
}
|
|
2120
|
-
function er() {
|
|
2475
|
+
function cr() {
|
|
2121
2476
|
return m("svg", {
|
|
2122
2477
|
width: "14",
|
|
2123
2478
|
height: "14",
|
|
@@ -2138,17 +2493,17 @@ function er() {
|
|
|
2138
2493
|
]
|
|
2139
2494
|
});
|
|
2140
2495
|
}
|
|
2141
|
-
var
|
|
2142
|
-
xs:
|
|
2143
|
-
sm:
|
|
2144
|
-
md:
|
|
2145
|
-
lg:
|
|
2146
|
-
xl:
|
|
2496
|
+
var lr = {
|
|
2497
|
+
xs: V(22),
|
|
2498
|
+
sm: V(26),
|
|
2499
|
+
md: V(32),
|
|
2500
|
+
lg: V(38),
|
|
2501
|
+
xl: V(44)
|
|
2147
2502
|
};
|
|
2148
|
-
function
|
|
2503
|
+
function ur({ size: e, label: t, values: n, value: r, activeTextColor: i, activeBackgroundColor: a, onChange: o }) {
|
|
2149
2504
|
return m(w, {
|
|
2150
2505
|
gap: "xs",
|
|
2151
|
-
children: [p(
|
|
2506
|
+
children: [p(B, {
|
|
2152
2507
|
component: "div",
|
|
2153
2508
|
size: e,
|
|
2154
2509
|
children: t
|
|
@@ -2161,9 +2516,9 @@ function nr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2161
2516
|
size: e,
|
|
2162
2517
|
variant: "default",
|
|
2163
2518
|
classNames: { section: "mantine-datatable-page-size-selector-button-icon" },
|
|
2164
|
-
rightSection: p(
|
|
2519
|
+
rightSection: p(cr, {}),
|
|
2165
2520
|
style: [{ fontWeight: "normal" }, (t) => ({
|
|
2166
|
-
height:
|
|
2521
|
+
height: lr[e],
|
|
2167
2522
|
paddingLeft: t.spacing[e],
|
|
2168
2523
|
paddingRight: t.spacing[e]
|
|
2169
2524
|
})],
|
|
@@ -2172,14 +2527,14 @@ function nr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2172
2527
|
let n = t === r;
|
|
2173
2528
|
return p(O, {
|
|
2174
2529
|
className: X({ "mantine-datatable-page-size-selector-active": n }),
|
|
2175
|
-
style: [{ height:
|
|
2530
|
+
style: [{ height: lr[e] }, n && (i || a) ? (e) => Gt({
|
|
2176
2531
|
theme: e,
|
|
2177
2532
|
paginationActiveTextColor: i,
|
|
2178
2533
|
paginationActiveBackgroundColor: a
|
|
2179
2534
|
}) : void 0],
|
|
2180
2535
|
disabled: n,
|
|
2181
2536
|
onClick: () => o(t),
|
|
2182
|
-
children: p(
|
|
2537
|
+
children: p(B, {
|
|
2183
2538
|
component: "div",
|
|
2184
2539
|
size: e,
|
|
2185
2540
|
children: t
|
|
@@ -2189,7 +2544,7 @@ function nr({ size: e, label: t, values: n, value: r, activeTextColor: i, active
|
|
|
2189
2544
|
})]
|
|
2190
2545
|
});
|
|
2191
2546
|
}
|
|
2192
|
-
function
|
|
2547
|
+
function dr({ className: e, style: t, fetching: n, page: r, onPageChange: i, paginationWithEdges: a, paginationWithControls: o, paginationActiveTextColor: s, paginationActiveBackgroundColor: c, paginationSize: l, loadingText: u, noRecordsText: d, paginationText: h, totalRecords: g, recordsPerPage: v, onRecordsPerPageChange: y, recordsPerPageLabel: b, recordsPerPageOptions: x, recordsLength: S, horizontalSpacing: C, paginationWrapBreakpoint: w, getPaginationControlProps: T, getPaginationItemProps: E, renderPagination: D }) {
|
|
2193
2548
|
let O;
|
|
2194
2549
|
if (g) {
|
|
2195
2550
|
let e = (r - 1) * v + 1;
|
|
@@ -2199,15 +2554,15 @@ function rr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2199
2554
|
totalRecords: g
|
|
2200
2555
|
});
|
|
2201
2556
|
} else O = n ? u : d;
|
|
2202
|
-
let k = g && v ? Math.max(1, Math.ceil(g / v)) : 1, A = g ? (r - 1) * (v ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, N = !
|
|
2203
|
-
Text: (e) => p(
|
|
2557
|
+
let k = g && v ? Math.max(1, Math.ceil(g / v)) : 1, A = g ? (r - 1) * (v ?? 0) + 1 : void 0, j = g ? (A ?? 1) + (S ?? 0) - 1 : void 0, N = !bn(({ breakpoints: e }) => `(min-width: ${typeof w == "number" ? `${V(w)}rem` : e[w] || w})`), P = {
|
|
2558
|
+
Text: (e) => p(B, {
|
|
2204
2559
|
component: "div",
|
|
2205
2560
|
className: "mantine-datatable-pagination-text",
|
|
2206
2561
|
size: l,
|
|
2207
2562
|
...e,
|
|
2208
2563
|
children: O
|
|
2209
2564
|
}),
|
|
2210
|
-
PageSizeSelector: (e) => x ? p(
|
|
2565
|
+
PageSizeSelector: (e) => x ? p(ur, {
|
|
2211
2566
|
activeTextColor: s,
|
|
2212
2567
|
activeBackgroundColor: c,
|
|
2213
2568
|
size: l,
|
|
@@ -2216,13 +2571,13 @@ function rr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2216
2571
|
value: v,
|
|
2217
2572
|
onChange: y,
|
|
2218
2573
|
...e
|
|
2219
|
-
}) :
|
|
2574
|
+
}) : null,
|
|
2220
2575
|
Pagination: (e) => p(M, {
|
|
2221
2576
|
classNames: {
|
|
2222
2577
|
root: X("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !S }),
|
|
2223
2578
|
control: "mantine-datatable-pagination-pages-control"
|
|
2224
2579
|
},
|
|
2225
|
-
style: s || c ? (e) =>
|
|
2580
|
+
style: s || c ? (e) => Gt({
|
|
2226
2581
|
theme: e,
|
|
2227
2582
|
paginationActiveTextColor: s,
|
|
2228
2583
|
paginationActiveBackgroundColor: c
|
|
@@ -2268,36 +2623,46 @@ function rr({ className: e, style: t, fetching: n, page: r, onPageChange: i, pag
|
|
|
2268
2623
|
] })
|
|
2269
2624
|
});
|
|
2270
2625
|
}
|
|
2271
|
-
function
|
|
2272
|
-
return
|
|
2626
|
+
function fr({ 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: _ }) {
|
|
2627
|
+
return bn(r) ? p(re, {
|
|
2628
|
+
"data-pinned": n?.position,
|
|
2629
|
+
"data-pinned-shadow": n?.isBoundary ? n.position : void 0,
|
|
2273
2630
|
className: X({
|
|
2274
|
-
[
|
|
2275
|
-
[
|
|
2276
|
-
[
|
|
2277
|
-
[
|
|
2278
|
-
[
|
|
2279
|
-
[
|
|
2280
|
-
[
|
|
2631
|
+
[Mn]: l || u,
|
|
2632
|
+
[Nn]: u,
|
|
2633
|
+
[Pn]: o || s,
|
|
2634
|
+
[Fn]: c,
|
|
2635
|
+
[Ln]: d === "left",
|
|
2636
|
+
[Rn]: d === "center",
|
|
2637
|
+
[zn]: d === "right"
|
|
2281
2638
|
}, e),
|
|
2282
|
-
style: [
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2639
|
+
style: [
|
|
2640
|
+
{
|
|
2641
|
+
width: f,
|
|
2642
|
+
minWidth: f,
|
|
2643
|
+
maxWidth: f
|
|
2644
|
+
},
|
|
2645
|
+
t,
|
|
2646
|
+
n && {
|
|
2647
|
+
position: "sticky",
|
|
2648
|
+
[n.position]: n.offset,
|
|
2649
|
+
overflow: "visible"
|
|
2650
|
+
}
|
|
2651
|
+
],
|
|
2652
|
+
onClick: o,
|
|
2653
|
+
onDoubleClick: s,
|
|
2654
|
+
onContextMenu: c,
|
|
2655
|
+
..._?.(i, a),
|
|
2656
|
+
children: h ? h(i, a) : g ? g(i, a, m) : wn(i, m)
|
|
2292
2657
|
}) : null;
|
|
2293
2658
|
}
|
|
2294
|
-
function
|
|
2295
|
-
let { expanded: i, visible: a } =
|
|
2296
|
-
return a ? m(f, { children: [p(
|
|
2659
|
+
function pr({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
2660
|
+
let { expanded: i, visible: a } = jn(e, r?.transitionDuration);
|
|
2661
|
+
return a ? m(f, { children: [p(z, {}), p(z, { children: p(re, {
|
|
2297
2662
|
className: "mantine-datatable-row-expansion-cell",
|
|
2298
2663
|
colSpan: t,
|
|
2299
2664
|
children: p(x, {
|
|
2300
|
-
|
|
2665
|
+
expanded: i,
|
|
2301
2666
|
...r,
|
|
2302
2667
|
children: p("div", {
|
|
2303
2668
|
className: "mantine-datatable-row-expansion-cell-content",
|
|
@@ -2306,120 +2671,121 @@ function ar({ open: e, colSpan: t, content: n, collapseProps: r }) {
|
|
|
2306
2671
|
})
|
|
2307
2672
|
}) })] }) : null;
|
|
2308
2673
|
}
|
|
2309
|
-
function
|
|
2674
|
+
function mr({ className: e, style: t, record: n, index: r, trigger: i, onChange: a, withRightShadow: o, checkboxProps: s, getCheckboxProps: c, ...l }) {
|
|
2310
2675
|
let u = {
|
|
2311
2676
|
...s,
|
|
2312
2677
|
...c(n, r)
|
|
2313
2678
|
}, d = !l.disabled && !u.disabled, f = (e) => {
|
|
2314
2679
|
e.stopPropagation(), i === "cell" && d && a?.(e);
|
|
2315
2680
|
};
|
|
2316
|
-
return p(
|
|
2317
|
-
className: X("mantine-datatable-row-selector-cell", { [
|
|
2681
|
+
return p(re, {
|
|
2682
|
+
className: X("mantine-datatable-row-selector-cell", { [Pn]: i === "cell" && d }, e),
|
|
2318
2683
|
style: t,
|
|
2319
2684
|
"data-shadow-visible": o || void 0,
|
|
2320
2685
|
onClick: f,
|
|
2321
2686
|
children: p(b, {
|
|
2322
|
-
classNames: d ? { input:
|
|
2687
|
+
classNames: d ? { input: Pn } : void 0,
|
|
2323
2688
|
onChange: a,
|
|
2324
2689
|
...l,
|
|
2325
2690
|
...u
|
|
2326
2691
|
})
|
|
2327
2692
|
});
|
|
2328
2693
|
}
|
|
2329
|
-
function
|
|
2330
|
-
let
|
|
2331
|
-
className:
|
|
2332
|
-
style:
|
|
2694
|
+
function hr({ record: e, index: t, columns: n, defaultColumnProps: r, pinnedMap: i, defaultColumnRender: a, selectionTrigger: o, selectionVisible: s, selectionChecked: c, onSelectionChange: l, isRecordSelectable: u, selectionCheckboxProps: d, getSelectionCheckboxProps: h, onClick: g, onDoubleClick: _, onContextMenu: v, onCellClick: y, onCellDoubleClick: b, onCellContextMenu: x, expansion: S, customAttributes: C, color: w, backgroundColor: T, className: E, style: D, selectorCellShadowVisible: O, selectionColumnClassName: k, selectionColumnStyle: A, rowFactory: j }) {
|
|
2695
|
+
let M = m(f, { children: [s && p(mr, {
|
|
2696
|
+
className: k,
|
|
2697
|
+
style: A,
|
|
2333
2698
|
record: e,
|
|
2334
2699
|
index: t,
|
|
2335
|
-
trigger:
|
|
2336
|
-
withRightShadow:
|
|
2337
|
-
checked:
|
|
2338
|
-
disabled: !
|
|
2339
|
-
onChange:
|
|
2340
|
-
checkboxProps:
|
|
2341
|
-
getCheckboxProps:
|
|
2342
|
-
}), n.map(({ hidden: n, hiddenContent:
|
|
2343
|
-
if (n ||
|
|
2344
|
-
let { accessor:
|
|
2700
|
+
trigger: o,
|
|
2701
|
+
withRightShadow: O,
|
|
2702
|
+
checked: c,
|
|
2703
|
+
disabled: !l || (u ? !u(e, t) : !1),
|
|
2704
|
+
onChange: l,
|
|
2705
|
+
checkboxProps: d,
|
|
2706
|
+
getCheckboxProps: h
|
|
2707
|
+
}), n.map(({ hidden: n, hiddenContent: o, ...s }, c) => {
|
|
2708
|
+
if (n || o) return null;
|
|
2709
|
+
let { accessor: l, visibleMediaQuery: u, textAlign: d, noWrap: f, ellipsis: m, width: h, render: g, cellsClassName: _, cellsStyle: v, customCellAttributes: S } = {
|
|
2345
2710
|
...r,
|
|
2346
|
-
...
|
|
2711
|
+
...s
|
|
2347
2712
|
};
|
|
2348
|
-
return p(
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2713
|
+
return p(fr, {
|
|
2714
|
+
pinnedInfo: i.get(String(l)),
|
|
2715
|
+
className: typeof _ == "function" ? _(e, t) : _,
|
|
2716
|
+
style: v?.(e, t),
|
|
2717
|
+
visibleMediaQuery: u,
|
|
2352
2718
|
record: e,
|
|
2353
2719
|
index: t,
|
|
2354
|
-
onClick:
|
|
2720
|
+
onClick: y ? (n) => y({
|
|
2355
2721
|
event: n,
|
|
2356
2722
|
record: e,
|
|
2357
2723
|
index: t,
|
|
2358
|
-
column:
|
|
2359
|
-
columnIndex:
|
|
2724
|
+
column: s,
|
|
2725
|
+
columnIndex: c
|
|
2360
2726
|
}) : void 0,
|
|
2361
|
-
onDoubleClick:
|
|
2727
|
+
onDoubleClick: b ? (n) => b({
|
|
2362
2728
|
event: n,
|
|
2363
2729
|
record: e,
|
|
2364
2730
|
index: t,
|
|
2365
|
-
column:
|
|
2366
|
-
columnIndex:
|
|
2731
|
+
column: s,
|
|
2732
|
+
columnIndex: c
|
|
2367
2733
|
}) : void 0,
|
|
2368
|
-
onContextMenu:
|
|
2734
|
+
onContextMenu: x ? (n) => x({
|
|
2369
2735
|
event: n,
|
|
2370
2736
|
record: e,
|
|
2371
2737
|
index: t,
|
|
2372
|
-
column:
|
|
2373
|
-
columnIndex:
|
|
2738
|
+
column: s,
|
|
2739
|
+
columnIndex: c
|
|
2374
2740
|
}) : void 0,
|
|
2375
|
-
accessor:
|
|
2376
|
-
textAlign:
|
|
2377
|
-
noWrap:
|
|
2378
|
-
ellipsis:
|
|
2379
|
-
width:
|
|
2380
|
-
render:
|
|
2381
|
-
defaultRender:
|
|
2382
|
-
customCellAttributes:
|
|
2383
|
-
},
|
|
2384
|
-
})] }),
|
|
2385
|
-
colSpan: n.filter(({ hidden: e }) => !e).length + +!!
|
|
2386
|
-
open:
|
|
2387
|
-
content:
|
|
2741
|
+
accessor: l,
|
|
2742
|
+
textAlign: d,
|
|
2743
|
+
noWrap: f,
|
|
2744
|
+
ellipsis: m,
|
|
2745
|
+
width: h,
|
|
2746
|
+
render: g,
|
|
2747
|
+
defaultRender: a,
|
|
2748
|
+
customCellAttributes: S
|
|
2749
|
+
}, l);
|
|
2750
|
+
})] }), N = S && p(pr, {
|
|
2751
|
+
colSpan: n.filter(({ hidden: e }) => !e).length + +!!s,
|
|
2752
|
+
open: S.isRowExpanded(e),
|
|
2753
|
+
content: S.content({
|
|
2388
2754
|
record: e,
|
|
2389
2755
|
index: t
|
|
2390
2756
|
}),
|
|
2391
|
-
collapseProps:
|
|
2392
|
-
}),
|
|
2757
|
+
collapseProps: S.collapseProps
|
|
2758
|
+
}), P = gr({
|
|
2393
2759
|
record: e,
|
|
2394
2760
|
index: t,
|
|
2395
|
-
selectionChecked:
|
|
2396
|
-
onClick:
|
|
2397
|
-
onDoubleClick:
|
|
2398
|
-
onContextMenu:
|
|
2399
|
-
expansion:
|
|
2400
|
-
customAttributes:
|
|
2401
|
-
color:
|
|
2402
|
-
backgroundColor:
|
|
2403
|
-
className:
|
|
2404
|
-
style:
|
|
2761
|
+
selectionChecked: c,
|
|
2762
|
+
onClick: g,
|
|
2763
|
+
onDoubleClick: _,
|
|
2764
|
+
onContextMenu: v,
|
|
2765
|
+
expansion: S,
|
|
2766
|
+
customAttributes: C,
|
|
2767
|
+
color: w,
|
|
2768
|
+
backgroundColor: T,
|
|
2769
|
+
className: E,
|
|
2770
|
+
style: D
|
|
2405
2771
|
});
|
|
2406
|
-
return
|
|
2772
|
+
return j ? j({
|
|
2407
2773
|
record: e,
|
|
2408
2774
|
index: t,
|
|
2409
|
-
rowProps:
|
|
2410
|
-
children:
|
|
2411
|
-
expandedElement:
|
|
2412
|
-
}) : m(f, { children: [p(
|
|
2413
|
-
...
|
|
2414
|
-
children:
|
|
2415
|
-
}),
|
|
2416
|
-
}
|
|
2417
|
-
function
|
|
2775
|
+
rowProps: P,
|
|
2776
|
+
children: M,
|
|
2777
|
+
expandedElement: N
|
|
2778
|
+
}) : m(f, { children: [p(z, {
|
|
2779
|
+
...P,
|
|
2780
|
+
children: M
|
|
2781
|
+
}), N] });
|
|
2782
|
+
}
|
|
2783
|
+
function gr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClick: i, onContextMenu: a, expansion: o, customAttributes: s, color: c, backgroundColor: l, className: u, style: d }) {
|
|
2418
2784
|
return {
|
|
2419
|
-
className: X("mantine-datatable-row", { [
|
|
2785
|
+
className: X("mantine-datatable-row", { [Pn]: r || i || o?.isExpandable({
|
|
2420
2786
|
record: e,
|
|
2421
2787
|
index: t
|
|
2422
|
-
}) && o?.expandOnClick }, { [
|
|
2788
|
+
}) && o?.expandOnClick }, { [Fn]: a }, typeof u == "function" ? u(e, t) : u),
|
|
2423
2789
|
"data-selected": n || void 0,
|
|
2424
2790
|
onClick: (n) => {
|
|
2425
2791
|
if (o) {
|
|
@@ -2447,7 +2813,7 @@ function cr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2447
2813
|
}) : void 0,
|
|
2448
2814
|
style: [c || l ? (n) => {
|
|
2449
2815
|
let r = c?.(e, t), i = l?.(e, t);
|
|
2450
|
-
return
|
|
2816
|
+
return Kt({
|
|
2451
2817
|
theme: n,
|
|
2452
2818
|
color: r,
|
|
2453
2819
|
backgroundColor: i
|
|
@@ -2456,7 +2822,7 @@ function cr({ record: e, index: t, selectionChecked: n, onClick: r, onDoubleClic
|
|
|
2456
2822
|
...s?.(e, t) ?? {}
|
|
2457
2823
|
};
|
|
2458
2824
|
}
|
|
2459
|
-
function
|
|
2825
|
+
function _r({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange: n, children: r, viewportRef: i, scrollAreaProps: a }) {
|
|
2460
2826
|
return m(F, {
|
|
2461
2827
|
...a,
|
|
2462
2828
|
viewportRef: i,
|
|
@@ -2476,59 +2842,66 @@ function lr({ leftShadowBehind: e, rightShadowBehind: t, onScrollPositionChange:
|
|
|
2476
2842
|
]
|
|
2477
2843
|
});
|
|
2478
2844
|
}
|
|
2479
|
-
function
|
|
2480
|
-
let ut = l(() =>
|
|
2845
|
+
function vr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, height: r = "100%", minHeight: i, maxHeight: o, shadow: d, verticalAlign: f = "center", fetching: h, columns: g, storeColumnsKey: v, groups: y, pinFirstColumn: b, pinLastColumn: x, defaultColumnProps: S, defaultColumnRender: C, idAccessor: w = "id", records: T, selectionTrigger: E = "checkbox", selectedRecords: D, onSelectedRecordsChange: O, selectionColumnClassName: k, selectionColumnStyle: A, isRecordSelectable: j, selectionCheckboxProps: M, allRecordsSelectionCheckboxProps: N = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: P = (e, t) => ({ "aria-label": `Select record ${t + 1}` }), sortStatus: ee, sortIcons: F, onSortStatusChange: te, horizontalSpacing: I, page: L, onPageChange: R, totalRecords: re, recordsPerPage: ie, onRecordsPerPageChange: ae, recordsPerPageOptions: oe, recordsPerPageLabel: z = "Records per page", paginationWithEdges: se, paginationWithControls: B, paginationActiveTextColor: ce, paginationActiveBackgroundColor: le, paginationSize: ue = "sm", paginationText: de = ({ from: e, to: t, totalRecords: n }) => `${e} - ${t} / ${n}`, paginationWrapBreakpoint: fe = "sm", getPaginationControlProps: V = (e) => e === "previous" ? { "aria-label": "Previous page" } : e === "next" ? { "aria-label": "Next page" } : {}, getPaginationItemProps: pe, renderPagination: me, loaderBackgroundBlur: he, customLoader: ge, loaderSize: _e, loaderType: ve, loaderColor: ye, loadingText: be = "...", emptyState: xe, noRecordsText: Se = "No records", noRecordsIcon: Ce, highlightOnHover: we, striped: Te, noHeader: Ee, onRowClick: De, onRowDoubleClick: H, onRowContextMenu: Oe, onCellClick: Ae, onCellDoubleClick: U, onCellContextMenu: W, onScroll: G, onScrollToTop: je, onScrollToBottom: Me, onScrollToLeft: Ne, onScrollToRight: Pe, c: Fe, backgroundColor: Ie, borderColor: Le, rowBorderColor: K, stripedColor: Re, highlightOnHoverColor: ze, rowColor: Be, rowBackgroundColor: Ve, rowExpansion: He, rowClassName: Ue, rowStyle: We, customRowAttributes: Ge, scrollViewportRef: Ke, scrollAreaProps: qe, tableRef: Je, bodyRef: Ye, m: Xe, my: Ze, mx: Qe, mt: $e, mb: et, ml: tt, mr: nt, className: rt, classNames: it, style: at, styles: ot, rowFactory: st, tableWrapper: ct, ...lt }) {
|
|
2846
|
+
let ut = l(() => y ? En(y) : g, [g, y]), { refs: q, onScroll: dt } = pn({
|
|
2481
2847
|
scrollCallbacks: {
|
|
2482
|
-
onScroll:
|
|
2483
|
-
onScrollToTop:
|
|
2484
|
-
onScrollToBottom:
|
|
2485
|
-
onScrollToLeft:
|
|
2848
|
+
onScroll: G,
|
|
2849
|
+
onScrollToTop: je,
|
|
2850
|
+
onScrollToBottom: Me,
|
|
2851
|
+
onScrollToLeft: Ne,
|
|
2486
2852
|
onScrollToRight: Pe
|
|
2487
2853
|
},
|
|
2488
2854
|
withRowBorders: lt.withRowBorders
|
|
2489
|
-
}),
|
|
2490
|
-
key:
|
|
2855
|
+
}), J = rn({
|
|
2856
|
+
key: v,
|
|
2491
2857
|
columns: ut,
|
|
2492
|
-
headerRef:
|
|
2493
|
-
scrollViewportRef:
|
|
2494
|
-
|
|
2495
|
-
}), ht = ke(J.table, Je), gt = ke(J.scrollViewport, Ke), _t = Tn({
|
|
2858
|
+
headerRef: q.header,
|
|
2859
|
+
scrollViewportRef: q.scrollViewport
|
|
2860
|
+
}), ft = J.effectiveColumns, pt = ke(q.table, Je), mt = ke(q.scrollViewport, Ke), ht = u(null), gt = ke(ht, Ye), _t = An({
|
|
2496
2861
|
rowExpansion: He,
|
|
2497
|
-
records:
|
|
2498
|
-
idAccessor:
|
|
2499
|
-
}),
|
|
2500
|
-
|
|
2501
|
-
|
|
2862
|
+
records: T,
|
|
2863
|
+
idAccessor: w
|
|
2864
|
+
}), { pinnedMap: vt, hasLeftPinned: yt, hasRightPinned: bt } = mn({
|
|
2865
|
+
columns: ft,
|
|
2866
|
+
theadRef: q.header,
|
|
2867
|
+
tbodyRef: ht,
|
|
2868
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
2869
|
+
selectionVisible: !!D,
|
|
2870
|
+
pinFirstColumn: b,
|
|
2871
|
+
pinLastColumn: x
|
|
2872
|
+
}), xt = u(!1), St = u(L), Ct = u(T), wt = a((e) => {
|
|
2873
|
+
xt.current = !0, Ct.current = T, R(e);
|
|
2874
|
+
}, [R, T]);
|
|
2502
2875
|
s(() => {
|
|
2503
|
-
|
|
2504
|
-
}, [
|
|
2505
|
-
let
|
|
2876
|
+
St.current !== L && (xt.current = !0, Ct.current = T, St.current = L);
|
|
2877
|
+
}, [L, T]);
|
|
2878
|
+
let Tt = T?.length;
|
|
2506
2879
|
c(() => {
|
|
2507
|
-
if (!
|
|
2508
|
-
let e =
|
|
2880
|
+
if (!xt.current || h || T === Ct.current) return;
|
|
2881
|
+
let e = q.scrollViewport.current;
|
|
2509
2882
|
if (!e) return;
|
|
2510
2883
|
let t = requestAnimationFrame(() => {
|
|
2511
2884
|
e.scrollTo({
|
|
2512
2885
|
top: 0,
|
|
2513
2886
|
left: 0
|
|
2514
|
-
}),
|
|
2887
|
+
}), xt.current = !1;
|
|
2515
2888
|
});
|
|
2516
2889
|
return () => cancelAnimationFrame(t);
|
|
2517
2890
|
}, [
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2891
|
+
h,
|
|
2892
|
+
T,
|
|
2893
|
+
q.scrollViewport
|
|
2521
2894
|
]);
|
|
2522
|
-
let
|
|
2523
|
-
|
|
2895
|
+
let Et = T?.map((e) => $(e, w)), Dt = !!D, Ot = D?.map((e) => $(e, w)), kt = Et !== void 0 && Ot !== void 0 && Ot.length > 0, At = j ? T?.filter(j) : T, Y = At?.map((e) => $(e, w)), jt = kt && Y.every((e) => Ot.includes(e)), Mt = kt && Y.some((e) => Ot.includes(e)), Nt = a(() => {
|
|
2896
|
+
D && O && O(jt ? D.filter((e) => !Y.includes($(e, w))) : Cn([...D, ...At], (e) => $(e, w)));
|
|
2524
2897
|
}, [
|
|
2898
|
+
jt,
|
|
2899
|
+
w,
|
|
2900
|
+
O,
|
|
2525
2901
|
Y,
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
Dt,
|
|
2530
|
-
O
|
|
2531
|
-
]), { lastSelectionChangeIndex: jt, setLastSelectionChangeIndex: Mt } = un(Ct), Nt = wt && !x, Pt = {
|
|
2902
|
+
At,
|
|
2903
|
+
D
|
|
2904
|
+
]), { lastSelectionChangeIndex: Pt, setLastSelectionChangeIndex: Ft } = hn(Et), It = Dt && !yt, Lt = {
|
|
2532
2905
|
m: Xe,
|
|
2533
2906
|
my: Ze,
|
|
2534
2907
|
mx: Qe,
|
|
@@ -2536,26 +2909,27 @@ function ur({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2536
2909
|
mb: et,
|
|
2537
2910
|
ml: tt,
|
|
2538
2911
|
mr: nt
|
|
2539
|
-
},
|
|
2540
|
-
return p(
|
|
2541
|
-
...
|
|
2912
|
+
}, Rt = a(({ children: e }) => ct ? ct({ children: e }) : e, [ct]);
|
|
2913
|
+
return p(Yt, {
|
|
2914
|
+
...J,
|
|
2915
|
+
pinnedMap: vt,
|
|
2542
2916
|
children: m(_, {
|
|
2543
|
-
ref:
|
|
2544
|
-
...
|
|
2917
|
+
ref: q.root,
|
|
2918
|
+
...Lt,
|
|
2545
2919
|
className: X("mantine-datatable", { "mantine-datatable-with-border": e }, rt, it?.root),
|
|
2546
2920
|
style: [
|
|
2547
2921
|
(e) => ({
|
|
2548
|
-
...
|
|
2922
|
+
...Wt({
|
|
2549
2923
|
theme: e,
|
|
2550
2924
|
c: Fe,
|
|
2551
2925
|
backgroundColor: Ie,
|
|
2552
|
-
borderColor:
|
|
2553
|
-
rowBorderColor:
|
|
2926
|
+
borderColor: Le,
|
|
2927
|
+
rowBorderColor: K,
|
|
2554
2928
|
stripedColor: Re,
|
|
2555
2929
|
highlightOnHoverColor: ze
|
|
2556
2930
|
}),
|
|
2557
2931
|
borderRadius: e.radius[t] || t,
|
|
2558
|
-
boxShadow: e.shadows[
|
|
2932
|
+
boxShadow: e.shadows[d] || d,
|
|
2559
2933
|
height: r,
|
|
2560
2934
|
minHeight: i,
|
|
2561
2935
|
maxHeight: o
|
|
@@ -2565,150 +2939,158 @@ function ur({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2565
2939
|
{ position: "relative" }
|
|
2566
2940
|
],
|
|
2567
2941
|
children: [
|
|
2568
|
-
p(
|
|
2569
|
-
viewportRef:
|
|
2570
|
-
leftShadowBehind:
|
|
2571
|
-
rightShadowBehind:
|
|
2572
|
-
onScrollPositionChange:
|
|
2942
|
+
p(_r, {
|
|
2943
|
+
viewportRef: mt,
|
|
2944
|
+
leftShadowBehind: Dt || yt,
|
|
2945
|
+
rightShadowBehind: bt,
|
|
2946
|
+
onScrollPositionChange: dt,
|
|
2573
2947
|
scrollAreaProps: qe,
|
|
2574
|
-
children: p(
|
|
2575
|
-
ref:
|
|
2576
|
-
horizontalSpacing:
|
|
2948
|
+
children: p(Rt, { children: m(ne, {
|
|
2949
|
+
ref: pt,
|
|
2950
|
+
horizontalSpacing: I,
|
|
2577
2951
|
className: X("mantine-datatable-table", {
|
|
2578
|
-
[
|
|
2579
|
-
"mantine-datatable-vertical-align-top":
|
|
2580
|
-
"mantine-datatable-vertical-align-bottom":
|
|
2581
|
-
"mantine-datatable-
|
|
2582
|
-
"mantine-datatable-
|
|
2583
|
-
"mantine-datatable-
|
|
2584
|
-
"mantine-datatable-
|
|
2952
|
+
[In]: n,
|
|
2953
|
+
"mantine-datatable-vertical-align-top": f === "top",
|
|
2954
|
+
"mantine-datatable-vertical-align-bottom": f === "bottom",
|
|
2955
|
+
"mantine-datatable-selection-column-visible": Dt,
|
|
2956
|
+
"mantine-datatable-resizable-columns": J.hasResizableColumns,
|
|
2957
|
+
"mantine-datatable-resize-locked": J.isLocked,
|
|
2958
|
+
"mantine-datatable-resizing": J.isResizing
|
|
2585
2959
|
}, it?.table),
|
|
2586
|
-
style: {
|
|
2587
|
-
|
|
2960
|
+
style: {
|
|
2961
|
+
...ot?.table,
|
|
2962
|
+
...J.isLocked ? { tableLayout: "fixed" } : null,
|
|
2963
|
+
...J.tableWidth == null ? null : { width: `${J.tableWidth}px` }
|
|
2964
|
+
},
|
|
2965
|
+
"data-striped": Tt && Te || void 0,
|
|
2588
2966
|
"data-highlight-on-hover": we || void 0,
|
|
2589
2967
|
...lt,
|
|
2590
2968
|
children: [
|
|
2591
|
-
Ee ? null : p(
|
|
2592
|
-
...
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2969
|
+
Ee ? null : p(Yt, {
|
|
2970
|
+
...J,
|
|
2971
|
+
pinnedMap: vt,
|
|
2972
|
+
children: p(or, {
|
|
2973
|
+
ref: q.header,
|
|
2974
|
+
selectionColumnHeaderRef: q.selectionColumnHeader,
|
|
2596
2975
|
className: it?.header,
|
|
2597
2976
|
style: ot?.header,
|
|
2598
|
-
columns:
|
|
2599
|
-
defaultColumnProps:
|
|
2600
|
-
groups:
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2977
|
+
columns: ft,
|
|
2978
|
+
defaultColumnProps: S,
|
|
2979
|
+
groups: y,
|
|
2980
|
+
pinnedMap: vt,
|
|
2981
|
+
sortStatus: ee,
|
|
2982
|
+
sortIcons: F,
|
|
2983
|
+
onSortStatusChange: te,
|
|
2984
|
+
selectionTrigger: E,
|
|
2985
|
+
selectionVisible: Dt,
|
|
2986
|
+
selectionChecked: jt,
|
|
2987
|
+
selectionIndeterminate: Mt && !jt,
|
|
2988
|
+
onSelectionChange: Nt,
|
|
2609
2989
|
selectionCheckboxProps: {
|
|
2610
|
-
...
|
|
2611
|
-
...
|
|
2990
|
+
...M,
|
|
2991
|
+
...N
|
|
2612
2992
|
},
|
|
2613
|
-
selectorCellShadowVisible:
|
|
2614
|
-
selectionColumnClassName:
|
|
2615
|
-
selectionColumnStyle:
|
|
2993
|
+
selectorCellShadowVisible: It,
|
|
2994
|
+
selectionColumnClassName: k,
|
|
2995
|
+
selectionColumnStyle: A,
|
|
2616
2996
|
withColumnBorders: lt.withColumnBorders
|
|
2617
2997
|
})
|
|
2618
2998
|
}),
|
|
2619
2999
|
p("tbody", {
|
|
2620
|
-
ref:
|
|
2621
|
-
children:
|
|
2622
|
-
let n =
|
|
2623
|
-
return
|
|
2624
|
-
if (i.nativeEvent.shiftKey &&
|
|
2625
|
-
let e =
|
|
2626
|
-
|
|
2627
|
-
} else
|
|
2628
|
-
|
|
2629
|
-
}), p(
|
|
3000
|
+
ref: gt,
|
|
3001
|
+
children: Tt ? T.map((e, t) => {
|
|
3002
|
+
let n = $(e, w), r = Ot?.includes(n) || !1, i;
|
|
3003
|
+
return O && D && (i = (i) => {
|
|
3004
|
+
if (i.nativeEvent.shiftKey && Pt !== null) {
|
|
3005
|
+
let e = T.filter(t > Pt ? (e, n) => n >= Pt && n <= t && (j ? j(e, n) : !0) : (e, n) => n >= t && n <= Pt && (j ? j(e, n) : !0));
|
|
3006
|
+
O(r ? Sn(D, e, (e) => $(e, w)) : Cn([...D, ...e], (e) => $(e, w)));
|
|
3007
|
+
} else O(r ? D.filter((e) => $(e, w) !== n) : Cn([...D, e], (e) => $(e, w)));
|
|
3008
|
+
Ft(t);
|
|
3009
|
+
}), p(hr, {
|
|
2630
3010
|
record: e,
|
|
2631
3011
|
index: t,
|
|
2632
|
-
columns:
|
|
2633
|
-
defaultColumnProps:
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
3012
|
+
columns: ft,
|
|
3013
|
+
defaultColumnProps: S,
|
|
3014
|
+
pinnedMap: vt,
|
|
3015
|
+
defaultColumnRender: C,
|
|
3016
|
+
selectionTrigger: E,
|
|
3017
|
+
selectionVisible: Dt,
|
|
2637
3018
|
selectionChecked: r,
|
|
2638
3019
|
onSelectionChange: i,
|
|
2639
|
-
isRecordSelectable:
|
|
2640
|
-
selectionCheckboxProps:
|
|
2641
|
-
getSelectionCheckboxProps:
|
|
3020
|
+
isRecordSelectable: j,
|
|
3021
|
+
selectionCheckboxProps: M,
|
|
3022
|
+
getSelectionCheckboxProps: P,
|
|
2642
3023
|
onClick: De,
|
|
2643
|
-
onDoubleClick:
|
|
2644
|
-
onCellClick:
|
|
2645
|
-
onCellDoubleClick:
|
|
2646
|
-
onContextMenu:
|
|
2647
|
-
onCellContextMenu:
|
|
3024
|
+
onDoubleClick: H,
|
|
3025
|
+
onCellClick: Ae,
|
|
3026
|
+
onCellDoubleClick: U,
|
|
3027
|
+
onContextMenu: Oe,
|
|
3028
|
+
onCellContextMenu: W,
|
|
2648
3029
|
expansion: _t,
|
|
2649
3030
|
color: Be,
|
|
2650
3031
|
backgroundColor: Ve,
|
|
2651
3032
|
className: Ue,
|
|
2652
3033
|
style: We,
|
|
2653
3034
|
customAttributes: Ge,
|
|
2654
|
-
selectorCellShadowVisible:
|
|
2655
|
-
selectionColumnClassName:
|
|
2656
|
-
selectionColumnStyle:
|
|
2657
|
-
idAccessor:
|
|
3035
|
+
selectorCellShadowVisible: It,
|
|
3036
|
+
selectionColumnClassName: k,
|
|
3037
|
+
selectionColumnStyle: A,
|
|
3038
|
+
idAccessor: w,
|
|
2658
3039
|
rowFactory: st
|
|
2659
3040
|
}, n);
|
|
2660
|
-
}) : p(
|
|
3041
|
+
}) : p(Xt, {})
|
|
2661
3042
|
}),
|
|
2662
|
-
|
|
2663
|
-
ref:
|
|
3043
|
+
ft.some(({ footer: e }) => e) && p(Hn, {
|
|
3044
|
+
ref: q.footer,
|
|
2664
3045
|
className: it?.footer,
|
|
2665
3046
|
style: ot?.footer,
|
|
2666
|
-
columns:
|
|
2667
|
-
defaultColumnProps:
|
|
2668
|
-
|
|
2669
|
-
|
|
3047
|
+
columns: ft,
|
|
3048
|
+
defaultColumnProps: S,
|
|
3049
|
+
pinnedMap: vt,
|
|
3050
|
+
selectionVisible: Dt,
|
|
3051
|
+
selectorCellShadowVisible: It
|
|
2670
3052
|
})
|
|
2671
3053
|
]
|
|
2672
3054
|
}) })
|
|
2673
3055
|
}),
|
|
2674
|
-
!!(
|
|
3056
|
+
!!(L && Tt) && p(dr, {
|
|
2675
3057
|
className: it?.pagination,
|
|
2676
3058
|
style: ot?.pagination,
|
|
2677
|
-
horizontalSpacing:
|
|
2678
|
-
fetching:
|
|
2679
|
-
page:
|
|
2680
|
-
onPageChange:
|
|
3059
|
+
horizontalSpacing: I,
|
|
3060
|
+
fetching: h,
|
|
3061
|
+
page: L,
|
|
3062
|
+
onPageChange: wt,
|
|
2681
3063
|
totalRecords: re,
|
|
2682
3064
|
recordsPerPage: ie,
|
|
2683
3065
|
onRecordsPerPageChange: ae,
|
|
2684
|
-
recordsPerPageOptions:
|
|
2685
|
-
recordsPerPageLabel:
|
|
2686
|
-
paginationWithEdges:
|
|
2687
|
-
paginationWithControls:
|
|
3066
|
+
recordsPerPageOptions: oe,
|
|
3067
|
+
recordsPerPageLabel: z,
|
|
3068
|
+
paginationWithEdges: se,
|
|
3069
|
+
paginationWithControls: B,
|
|
2688
3070
|
paginationActiveTextColor: ce,
|
|
2689
3071
|
paginationActiveBackgroundColor: le,
|
|
2690
3072
|
paginationSize: ue,
|
|
2691
3073
|
paginationText: de,
|
|
2692
|
-
paginationWrapBreakpoint:
|
|
2693
|
-
getPaginationControlProps:
|
|
3074
|
+
paginationWrapBreakpoint: fe,
|
|
3075
|
+
getPaginationControlProps: V,
|
|
2694
3076
|
getPaginationItemProps: pe,
|
|
2695
3077
|
noRecordsText: Se,
|
|
2696
3078
|
loadingText: be,
|
|
2697
|
-
recordsLength:
|
|
3079
|
+
recordsLength: Tt,
|
|
2698
3080
|
renderPagination: me
|
|
2699
3081
|
}),
|
|
2700
|
-
p(
|
|
2701
|
-
fetching:
|
|
3082
|
+
p(sr, {
|
|
3083
|
+
fetching: h,
|
|
2702
3084
|
backgroundBlur: he,
|
|
2703
3085
|
customContent: ge,
|
|
2704
3086
|
size: _e,
|
|
2705
3087
|
type: ve,
|
|
2706
3088
|
color: ye
|
|
2707
3089
|
}),
|
|
2708
|
-
p(
|
|
3090
|
+
p(Qt, {
|
|
2709
3091
|
icon: Ce,
|
|
2710
3092
|
text: Se,
|
|
2711
|
-
active: !
|
|
3093
|
+
active: !h && !Tt,
|
|
2712
3094
|
children: xe
|
|
2713
3095
|
})
|
|
2714
3096
|
]
|
|
@@ -2717,8 +3099,8 @@ function ur({ withTableBorder: e, borderRadius: t, textSelectionDisabled: n, hei
|
|
|
2717
3099
|
}
|
|
2718
3100
|
//#endregion
|
|
2719
3101
|
//#region src/DataTable/UpdateModal.tsx
|
|
2720
|
-
function
|
|
2721
|
-
let [c, l] = d(0), [u, h] = d(!1), { data: _, isLoading: y } = Lt(i, r, a), { mutateAsync: x, isError: S, error: C, isPending: T } = Bt(i, r), E = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], D =
|
|
3102
|
+
function yr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o }) {
|
|
3103
|
+
let [c, l] = d(0), [u, h] = d(!1), { data: _, isLoading: y } = Lt(i, r, a), { mutateAsync: x, isError: S, error: C, isPending: T } = Bt(i, r), E = [...new Set(e.filter((e) => typeof e.step == "number").map((e) => e.step))], D = he({
|
|
2722
3104
|
mode: "uncontrolled",
|
|
2723
3105
|
initialValues: e.reduce((e, t) => (e[t.id] = t.type === "boolean" ? t.defaultValue ?? !1 : t.defaultValue ?? "", e), {}),
|
|
2724
3106
|
validate: e.filter((e) => e.required).reduce((e, t) => (e[t.id] = (e, n) => t.conditional && !t.conditional(n) || !(typeof t.required == "function" ? t.required(n) : t.required) || e ? null : "Pflichtfeld", e), {})
|
|
@@ -2740,7 +3122,7 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2740
3122
|
if (e.conditional && !e.conditional(t)) return null;
|
|
2741
3123
|
let r = O(e, t);
|
|
2742
3124
|
return /* @__PURE__ */ m(n, { children: [
|
|
2743
|
-
(e.type === void 0 || e.type == "text") && /* @__PURE__ */ p(
|
|
3125
|
+
(e.type === void 0 || e.type == "text") && /* @__PURE__ */ p(ce, {
|
|
2744
3126
|
label: e.column.title,
|
|
2745
3127
|
placeholder: e.placeholder ?? "",
|
|
2746
3128
|
...D.getInputProps(e.id),
|
|
@@ -2754,7 +3136,7 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2754
3136
|
...D.getInputProps(e.id),
|
|
2755
3137
|
required: r
|
|
2756
3138
|
}, D.key(e.id)),
|
|
2757
|
-
e.type === "date" && /* @__PURE__ */ p(
|
|
3139
|
+
e.type === "date" && /* @__PURE__ */ p(ge, {
|
|
2758
3140
|
label: e.column.title,
|
|
2759
3141
|
placeholder: e.placeholder ?? "",
|
|
2760
3142
|
valueFormat: "DD.MM.YYYY",
|
|
@@ -2768,7 +3150,7 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2768
3150
|
...D.getInputProps(e.id, { type: "checkbox" }),
|
|
2769
3151
|
required: r
|
|
2770
3152
|
}, D.key(e.id)),
|
|
2771
|
-
e.type === "textarea" && /* @__PURE__ */ p(
|
|
3153
|
+
e.type === "textarea" && /* @__PURE__ */ p(le, {
|
|
2772
3154
|
label: e.column.title,
|
|
2773
3155
|
placeholder: e.placeholder ?? "",
|
|
2774
3156
|
...D.getInputProps(e.id),
|
|
@@ -2791,18 +3173,18 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2791
3173
|
title: C?.name ?? "Fehler aufgetreten",
|
|
2792
3174
|
mb: "lg",
|
|
2793
3175
|
children: C?.message ?? "Fehler aufgetreten"
|
|
2794
|
-
}), y ? /* @__PURE__ */ m(
|
|
3176
|
+
}), y ? /* @__PURE__ */ m(L, {
|
|
2795
3177
|
gap: "md",
|
|
2796
3178
|
children: [
|
|
2797
|
-
/* @__PURE__ */ p(
|
|
2798
|
-
Array(e.length).fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3179
|
+
/* @__PURE__ */ p(I, { height: 40 }),
|
|
3180
|
+
Array(e.length).fill(0).map((e, t) => /* @__PURE__ */ p(I, { height: 35 }, `skeleton-field-${t}`)),
|
|
2799
3181
|
/* @__PURE__ */ m(w, {
|
|
2800
3182
|
mt: "md",
|
|
2801
3183
|
justify: "end",
|
|
2802
|
-
children: [/* @__PURE__ */ p(
|
|
3184
|
+
children: [/* @__PURE__ */ p(I, {
|
|
2803
3185
|
width: 100,
|
|
2804
3186
|
height: 36
|
|
2805
|
-
}), /* @__PURE__ */ p(
|
|
3187
|
+
}), /* @__PURE__ */ p(I, {
|
|
2806
3188
|
width: 100,
|
|
2807
3189
|
height: 36
|
|
2808
3190
|
})]
|
|
@@ -2816,10 +3198,10 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2816
3198
|
id: a
|
|
2817
3199
|
}), E.length && c < E.length - 1 ? S || l(c + 1) : S || (D.setInitialValues(n), D.reset(), t());
|
|
2818
3200
|
}),
|
|
2819
|
-
children: [E.length ? /* @__PURE__ */ p(
|
|
3201
|
+
children: [E.length ? /* @__PURE__ */ p(R, {
|
|
2820
3202
|
active: c,
|
|
2821
3203
|
size: "sm",
|
|
2822
|
-
children: E.map((t) => /* @__PURE__ */ p(
|
|
3204
|
+
children: E.map((t) => /* @__PURE__ */ p(R.Step, {
|
|
2823
3205
|
...o && o[t - 1] ? { label: o[t - 1].label } : {},
|
|
2824
3206
|
children: e.filter((e) => e.step === t).map((e) => k(e))
|
|
2825
3207
|
}, t))
|
|
@@ -2840,7 +3222,7 @@ function dr({ fields: e, onClose: t, queryKey: r, apiPath: i, id: a, steps: o })
|
|
|
2840
3222
|
}
|
|
2841
3223
|
//#endregion
|
|
2842
3224
|
//#region src/DataTable/DeleteModal.tsx
|
|
2843
|
-
function
|
|
3225
|
+
function br({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r }) {
|
|
2844
3226
|
let { mutateAsync: i, isError: a, error: o, isPending: c } = Vt(t, e), [l, u] = d(r), [h, _] = d(!1), y = h || c;
|
|
2845
3227
|
return s(() => {
|
|
2846
3228
|
l.length || n();
|
|
@@ -2851,7 +3233,7 @@ function fr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r }) {
|
|
|
2851
3233
|
title: o.name,
|
|
2852
3234
|
children: o.message
|
|
2853
3235
|
}),
|
|
2854
|
-
/* @__PURE__ */ p(
|
|
3236
|
+
/* @__PURE__ */ p(B, { children: l.length === 1 ? `Soll ${l.length} Eintrag wirklich gelöscht werden?` : `Sollen ${l.length} Einträge wirklich gelöscht werden?` }),
|
|
2855
3237
|
/* @__PURE__ */ m(w, {
|
|
2856
3238
|
mt: "md",
|
|
2857
3239
|
justify: "end",
|
|
@@ -2878,7 +3260,7 @@ function fr({ queryKey: e, apiPath: t, onClose: n, selectedRecords: r }) {
|
|
|
2878
3260
|
}
|
|
2879
3261
|
//#endregion
|
|
2880
3262
|
//#region src/Hooks/usePersistentState.ts
|
|
2881
|
-
function
|
|
3263
|
+
function xr(e, t) {
|
|
2882
3264
|
let [n, r] = d(() => {
|
|
2883
3265
|
let n = localStorage.getItem(`use_persistent_storage_${t}`);
|
|
2884
3266
|
return n ? JSON.parse(n) : e;
|
|
@@ -2889,12 +3271,12 @@ function pr(e, t) {
|
|
|
2889
3271
|
}
|
|
2890
3272
|
//#endregion
|
|
2891
3273
|
//#region src/utils/sort.ts
|
|
2892
|
-
var
|
|
3274
|
+
var Sr = [
|
|
2893
3275
|
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,
|
|
2894
3276
|
/^\d{4}-\d{2}-\d{2}$/,
|
|
2895
3277
|
/^\d{1,2}\/\d{1,2}\/\d{4}$/,
|
|
2896
3278
|
/^\d{1,2}\.\d{1,2}\.\d{4}$/
|
|
2897
|
-
],
|
|
3279
|
+
], Cr = (e, t) => {
|
|
2898
3280
|
let n = e.map((e) => e[t]).filter((e) => e != null && e !== "");
|
|
2899
3281
|
if (n.length === 0) return "string";
|
|
2900
3282
|
let r = n.slice(0, 100), i = {
|
|
@@ -2910,7 +3292,7 @@ var mr = [
|
|
|
2910
3292
|
i.number++;
|
|
2911
3293
|
return;
|
|
2912
3294
|
}
|
|
2913
|
-
if (
|
|
3295
|
+
if (Sr.some((e) => e.test(t))) {
|
|
2914
3296
|
let e = new Date(t);
|
|
2915
3297
|
if (!isNaN(e.getTime())) {
|
|
2916
3298
|
i.date++;
|
|
@@ -2923,7 +3305,7 @@ var mr = [
|
|
|
2923
3305
|
let a = i.string + i.number + i.date;
|
|
2924
3306
|
return i.date / a >= .6 ? "date" : i.number / a >= .6 ? "number" : i.string / a >= .6 ? "string" : "mixed";
|
|
2925
3307
|
};
|
|
2926
|
-
function
|
|
3308
|
+
function wr(e, t) {
|
|
2927
3309
|
switch (t) {
|
|
2928
3310
|
case "date":
|
|
2929
3311
|
if (typeof e == "string") {
|
|
@@ -2939,59 +3321,59 @@ function gr(e, t) {
|
|
|
2939
3321
|
default: return String(e).toLowerCase().trim();
|
|
2940
3322
|
}
|
|
2941
3323
|
}
|
|
2942
|
-
var
|
|
3324
|
+
var Tr = (e, t, n = "asc") => {
|
|
2943
3325
|
if (!e || e.length === 0) return [];
|
|
2944
|
-
let r =
|
|
3326
|
+
let r = Cr(e, t);
|
|
2945
3327
|
return [...e].sort((e, i) => {
|
|
2946
3328
|
let a = e[t], o = i[t], s = a == null || a === "", c = o == null || o === "";
|
|
2947
3329
|
if (s && c) return 0;
|
|
2948
3330
|
if (s) return n === "asc" ? -1 : 1;
|
|
2949
3331
|
if (c) return n === "asc" ? 1 : -1;
|
|
2950
|
-
let l =
|
|
3332
|
+
let l = wr(a, r), u = wr(o, r);
|
|
2951
3333
|
return l === null && u === null ? 0 : l === null ? n === "asc" ? 1 : -1 : u === null || l < u ? n === "asc" ? -1 : 1 : l > u ? n === "asc" ? 1 : -1 : 0;
|
|
2952
3334
|
});
|
|
2953
3335
|
};
|
|
2954
3336
|
//#endregion
|
|
2955
3337
|
//#region src/DataTable/MobileCardList.tsx
|
|
2956
|
-
function
|
|
3338
|
+
function Er(e, t) {
|
|
2957
3339
|
return t.split(".").reduce((e, t) => {
|
|
2958
3340
|
if (e && typeof e == "object" && t in e) return e[t];
|
|
2959
3341
|
}, e);
|
|
2960
3342
|
}
|
|
2961
|
-
function
|
|
3343
|
+
function Dr(e, t) {
|
|
2962
3344
|
let n = t.column;
|
|
2963
3345
|
if (n.render) return n.render(e, 0);
|
|
2964
|
-
let r =
|
|
2965
|
-
return r == null ? /* @__PURE__ */ p(
|
|
3346
|
+
let r = Er(e, n.accessor ?? t.id);
|
|
3347
|
+
return r == null ? /* @__PURE__ */ p(B, {
|
|
2966
3348
|
c: "dimmed",
|
|
2967
3349
|
children: "–"
|
|
2968
|
-
}) : typeof r == "boolean" ? /* @__PURE__ */ p(
|
|
3350
|
+
}) : typeof r == "boolean" ? /* @__PURE__ */ p(B, {
|
|
2969
3351
|
fz: "sm",
|
|
2970
3352
|
children: r ? "Ja" : "Nein"
|
|
2971
|
-
}) : /* @__PURE__ */ p(
|
|
3353
|
+
}) : /* @__PURE__ */ p(B, {
|
|
2972
3354
|
fz: "sm",
|
|
2973
3355
|
children: String(r)
|
|
2974
3356
|
});
|
|
2975
3357
|
}
|
|
2976
|
-
function
|
|
3358
|
+
function Or({ field: e, record: t }) {
|
|
2977
3359
|
return /* @__PURE__ */ m(w, {
|
|
2978
3360
|
wrap: "nowrap",
|
|
2979
3361
|
justify: "space-between",
|
|
2980
3362
|
align: "center",
|
|
2981
3363
|
py: "xs",
|
|
2982
3364
|
px: "sm",
|
|
2983
|
-
children: [/* @__PURE__ */ p(
|
|
3365
|
+
children: [/* @__PURE__ */ p(B, {
|
|
2984
3366
|
fw: 700,
|
|
2985
3367
|
fz: "sm",
|
|
2986
3368
|
children: e.column.title ?? e.id
|
|
2987
3369
|
}), /* @__PURE__ */ p(_, {
|
|
2988
3370
|
ta: "right",
|
|
2989
3371
|
fz: "sm",
|
|
2990
|
-
children:
|
|
3372
|
+
children: Dr(t, e)
|
|
2991
3373
|
})]
|
|
2992
3374
|
});
|
|
2993
3375
|
}
|
|
2994
|
-
function
|
|
3376
|
+
function kr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSelectedRecordsChange: a, onRowClick: o, actions: s, canUpdate: c, canDelete: l, pagination: u, sort: f, rowExpansion: g }) {
|
|
2995
3377
|
let [v, y] = d(/* @__PURE__ */ new Set()), C = (e) => {
|
|
2996
3378
|
y((t) => {
|
|
2997
3379
|
let n = new Set(t);
|
|
@@ -3012,19 +3394,19 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3012
3394
|
event: n
|
|
3013
3395
|
}) : r && k(e);
|
|
3014
3396
|
};
|
|
3015
|
-
return e.length === 0 ? /* @__PURE__ */ p(
|
|
3397
|
+
return e.length === 0 ? /* @__PURE__ */ p(B, {
|
|
3016
3398
|
c: "dimmed",
|
|
3017
3399
|
ta: "center",
|
|
3018
3400
|
py: "xl",
|
|
3019
3401
|
children: "Keine Einträge gefunden"
|
|
3020
|
-
}) : /* @__PURE__ */ m(
|
|
3402
|
+
}) : /* @__PURE__ */ m(L, {
|
|
3021
3403
|
gap: "sm",
|
|
3022
3404
|
my: "md",
|
|
3023
3405
|
children: [
|
|
3024
3406
|
f && D.length > 0 && /* @__PURE__ */ m(w, {
|
|
3025
3407
|
gap: "xs",
|
|
3026
3408
|
wrap: "nowrap",
|
|
3027
|
-
children: [/* @__PURE__ */ p(
|
|
3409
|
+
children: [/* @__PURE__ */ p(te, {
|
|
3028
3410
|
data: D,
|
|
3029
3411
|
value: f.field,
|
|
3030
3412
|
onChange: (e) => e && f.onSortChange(e, f.direction),
|
|
@@ -3034,7 +3416,7 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3034
3416
|
variant: "filled",
|
|
3035
3417
|
size: "input-sm",
|
|
3036
3418
|
onClick: () => f.onSortChange(f.field, f.direction === "asc" ? "desc" : "asc"),
|
|
3037
|
-
children: f.direction === "asc" ? /* @__PURE__ */ p(
|
|
3419
|
+
children: f.direction === "asc" ? /* @__PURE__ */ p(Ce, { size: 18 }) : /* @__PURE__ */ p(we, { size: 18 })
|
|
3038
3420
|
})]
|
|
3039
3421
|
}),
|
|
3040
3422
|
e.map((e, n) => {
|
|
@@ -3068,7 +3450,7 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3068
3450
|
onClick: (e) => {
|
|
3069
3451
|
e.stopPropagation(), C(u);
|
|
3070
3452
|
},
|
|
3071
|
-
children: /* @__PURE__ */ p(
|
|
3453
|
+
children: /* @__PURE__ */ p(ve, {
|
|
3072
3454
|
size: 16,
|
|
3073
3455
|
style: {
|
|
3074
3456
|
transform: d ? "rotate(0deg)" : "rotate(-90deg)",
|
|
@@ -3090,7 +3472,7 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3090
3472
|
color: "gray",
|
|
3091
3473
|
size: "sm",
|
|
3092
3474
|
onClick: (e) => e.stopPropagation(),
|
|
3093
|
-
children: /* @__PURE__ */ p(
|
|
3475
|
+
children: /* @__PURE__ */ p(ye, { size: 16 })
|
|
3094
3476
|
}) }), /* @__PURE__ */ p(E.Dropdown, { children: t.map((t, n) => /* @__PURE__ */ p(E.Item, {
|
|
3095
3477
|
leftSection: t.icon,
|
|
3096
3478
|
onClick: (n) => {
|
|
@@ -3100,7 +3482,7 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3100
3482
|
}, `card_action_${n}`)) })]
|
|
3101
3483
|
});
|
|
3102
3484
|
})()]
|
|
3103
|
-
}), T.map((n, r) => /* @__PURE__ */ m(t.Fragment, { children: [r > 0 && /* @__PURE__ */ p(S, {}), /* @__PURE__ */ p(
|
|
3485
|
+
}), T.map((n, r) => /* @__PURE__ */ m(t.Fragment, { children: [r > 0 && /* @__PURE__ */ p(S, {}), /* @__PURE__ */ p(Or, {
|
|
3104
3486
|
field: n,
|
|
3105
3487
|
record: e
|
|
3106
3488
|
})] }, n.id))]
|
|
@@ -3114,7 +3496,7 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3114
3496
|
})]
|
|
3115
3497
|
}) }, u);
|
|
3116
3498
|
}),
|
|
3117
|
-
u && u.totalRecords > u.recordsPerPage && /* @__PURE__ */ m(
|
|
3499
|
+
u && u.totalRecords > u.recordsPerPage && /* @__PURE__ */ m(L, {
|
|
3118
3500
|
gap: "xs",
|
|
3119
3501
|
mt: "sm",
|
|
3120
3502
|
children: [/* @__PURE__ */ p(w, {
|
|
@@ -3128,11 +3510,11 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3128
3510
|
}), u.recordsPerPageOptions && u.onRecordsPerPageChange && /* @__PURE__ */ m(w, {
|
|
3129
3511
|
justify: "center",
|
|
3130
3512
|
gap: "xs",
|
|
3131
|
-
children: [/* @__PURE__ */ p(
|
|
3513
|
+
children: [/* @__PURE__ */ p(B, {
|
|
3132
3514
|
fz: "xs",
|
|
3133
3515
|
c: "dimmed",
|
|
3134
3516
|
children: "Einträge pro Seite:"
|
|
3135
|
-
}), /* @__PURE__ */ p(
|
|
3517
|
+
}), /* @__PURE__ */ p(te, {
|
|
3136
3518
|
data: u.recordsPerPageOptions.map((e) => ({
|
|
3137
3519
|
value: String(e),
|
|
3138
3520
|
label: String(e)
|
|
@@ -3150,28 +3532,28 @@ function xr({ records: e, fields: n, selection: r, selectedRecords: i = [], onSe
|
|
|
3150
3532
|
}
|
|
3151
3533
|
//#endregion
|
|
3152
3534
|
//#region src/DataTable/DataTableInner.tsx
|
|
3153
|
-
var
|
|
3535
|
+
var Ar = [
|
|
3154
3536
|
10,
|
|
3155
3537
|
15,
|
|
3156
3538
|
50,
|
|
3157
3539
|
100,
|
|
3158
3540
|
500
|
|
3159
3541
|
];
|
|
3160
|
-
function
|
|
3161
|
-
let [
|
|
3162
|
-
j === void 0 &&
|
|
3163
|
-
},
|
|
3542
|
+
function jr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutationApiPath: a, buttons: o, fields: c, selection: l, pagination: u, filters: y, actions: b, steps: x, defaultSort: S, onSortChange: C, createButtonText: T, queryParams: D, tabs: O, defaultTab: k, activeTab: j, onActiveTabChange: M, canUpdate: N, canDelete: P, showRefresh: ee = !0, rowExpansion: F, onRowClick: te, mobileCards: R = !1 }) {
|
|
3543
|
+
let [ne, re] = d(k || (O && O.length > 0 ? O[0].value : null)), ie = j === void 0 ? ne : j, ae = (e) => {
|
|
3544
|
+
j === void 0 && re(e), M && M(e);
|
|
3545
|
+
}, oe = O?.find((e) => e.value === ie), z = oe?.queryParams || {}, B = oe?.apiPath ?? r, ce = oe?.mutationApiPath ?? a ?? B, le = {
|
|
3164
3546
|
...D,
|
|
3165
|
-
...
|
|
3166
|
-
},
|
|
3547
|
+
...z
|
|
3548
|
+
}, de = le ? "?" + Object.entries(le).filter(([, e]) => e != null).map(([e, t]) => `${e}=${encodeURIComponent(t ?? "")}`).join("&") : "", fe = ie ? [...t, ie] : t, { data: V, isLoading: pe, isError: me, isRefetching: he, refetch: ge } = Rt(B + de, fe), { queryClient: ve } = kt();
|
|
3167
3549
|
s(() => {
|
|
3168
|
-
!
|
|
3550
|
+
!V || !Array.isArray(V) || n?.forEach((e) => ve.invalidateQueries({ queryKey: e }));
|
|
3169
3551
|
}, [
|
|
3170
|
-
|
|
3552
|
+
V,
|
|
3171
3553
|
n,
|
|
3172
|
-
|
|
3554
|
+
ve
|
|
3173
3555
|
]);
|
|
3174
|
-
let
|
|
3556
|
+
let ye = !V || !Array.isArray(V) ? [] : !y || y.length === 0 ? V : V.filter((e) => y.every((t) => {
|
|
3175
3557
|
if (t.value === void 0) return !0;
|
|
3176
3558
|
let n = t.id;
|
|
3177
3559
|
if (t.type === "query") {
|
|
@@ -3203,27 +3585,27 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3203
3585
|
return !0;
|
|
3204
3586
|
} else if (t.type === "boolean") return e[n] === t.value;
|
|
3205
3587
|
return !0;
|
|
3206
|
-
})), [
|
|
3588
|
+
})), [Ce, we] = d({
|
|
3207
3589
|
columnAccessor: S?.field ?? c[0].id,
|
|
3208
3590
|
direction: S?.direction ?? "desc"
|
|
3209
|
-
}),
|
|
3210
|
-
|
|
3211
|
-
},
|
|
3591
|
+
}), Ee = (e) => {
|
|
3592
|
+
we(e), C && C(String(e.columnAccessor), e.direction);
|
|
3593
|
+
}, De = Tr(ye, Ce.columnAccessor, Ce.direction), [H, Oe] = xr(Ar[1], "mantine-table-page-size"), [ke, Ae] = d(1), U = u ? De.slice((ke - 1) * H, ke * H) : De, [W, G] = d([]);
|
|
3212
3594
|
s(() => {
|
|
3213
3595
|
G([]);
|
|
3214
|
-
}, [
|
|
3215
|
-
let [je, Me] = d(!1), [Ne,
|
|
3216
|
-
return
|
|
3217
|
-
icon: /* @__PURE__ */ p(
|
|
3596
|
+
}, [ie]);
|
|
3597
|
+
let [je, Me] = d(!1), [Ne, Pe] = d(!1), [Fe, Ie] = d(!1), Le = c.some((e) => e.update), K = c.some((e) => e.delete), Re = [];
|
|
3598
|
+
return Le && Re.push({
|
|
3599
|
+
icon: /* @__PURE__ */ p(xe, { size: 14 }),
|
|
3218
3600
|
label: "Bearbeiten",
|
|
3219
3601
|
onClick: (e) => {
|
|
3220
|
-
G(e),
|
|
3602
|
+
G(e), Pe(!0);
|
|
3221
3603
|
}
|
|
3222
|
-
}), b &&
|
|
3223
|
-
icon: /* @__PURE__ */ p(
|
|
3604
|
+
}), b && Re.push(...b), K && Re.push({
|
|
3605
|
+
icon: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3224
3606
|
label: "Löschen",
|
|
3225
3607
|
onClick: (e) => {
|
|
3226
|
-
G(e),
|
|
3608
|
+
G(e), Ie(!0);
|
|
3227
3609
|
}
|
|
3228
3610
|
}), /* @__PURE__ */ m(f, { children: [
|
|
3229
3611
|
/* @__PURE__ */ m(w, {
|
|
@@ -3231,7 +3613,7 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3231
3613
|
justify: e ? "space-between" : "end",
|
|
3232
3614
|
align: "center",
|
|
3233
3615
|
wrap: "wrap",
|
|
3234
|
-
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(
|
|
3616
|
+
children: [e && (typeof e == "string" ? /* @__PURE__ */ p(ue, {
|
|
3235
3617
|
order: 4,
|
|
3236
3618
|
children: e
|
|
3237
3619
|
}) : e), /* @__PURE__ */ m(w, {
|
|
@@ -3243,25 +3625,25 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3243
3625
|
children: [
|
|
3244
3626
|
ee && /* @__PURE__ */ p(h, {
|
|
3245
3627
|
variant: "subtle",
|
|
3246
|
-
onClick: () =>
|
|
3628
|
+
onClick: () => ge(),
|
|
3247
3629
|
"aria-label": "Neuladen",
|
|
3248
|
-
children: /* @__PURE__ */ p(
|
|
3630
|
+
children: /* @__PURE__ */ p(Se, {})
|
|
3249
3631
|
}),
|
|
3250
3632
|
(c.some((e) => e.update) || l) && (() => {
|
|
3251
3633
|
let e = c.find((e) => e.update) && (!N || W.length > 0 && N(W[0])), t = c.find((e) => e.delete) && (!P || W.length > 0 && P(W[0])), n = (b ?? []).length > 0, r = e || t || n;
|
|
3252
3634
|
return /* @__PURE__ */ p(_, {
|
|
3253
|
-
...
|
|
3635
|
+
...R ? { visibleFrom: "sm" } : {},
|
|
3254
3636
|
children: /* @__PURE__ */ m(E, {
|
|
3255
3637
|
shadow: "md",
|
|
3256
3638
|
children: [/* @__PURE__ */ p(E.Target, { children: /* @__PURE__ */ p(v, {
|
|
3257
3639
|
variant: "outline",
|
|
3258
|
-
rightSection: /* @__PURE__ */ p(
|
|
3640
|
+
rightSection: /* @__PURE__ */ p(_e, { size: 14 }),
|
|
3259
3641
|
disabled: !W.length || !r,
|
|
3260
3642
|
children: "Aktionen"
|
|
3261
3643
|
}) }), /* @__PURE__ */ m(E.Dropdown, { children: [
|
|
3262
3644
|
e && /* @__PURE__ */ p(E.Item, {
|
|
3263
|
-
leftSection: /* @__PURE__ */ p(
|
|
3264
|
-
onClick: () =>
|
|
3645
|
+
leftSection: /* @__PURE__ */ p(xe, { size: 14 }),
|
|
3646
|
+
onClick: () => Pe(!0),
|
|
3265
3647
|
disabled: W.length !== 1,
|
|
3266
3648
|
children: "Bearbeiten"
|
|
3267
3649
|
}),
|
|
@@ -3272,8 +3654,8 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3272
3654
|
disabled: e.disabled?.(W) ?? !1
|
|
3273
3655
|
}, e.label)),
|
|
3274
3656
|
t && /* @__PURE__ */ p(E.Item, {
|
|
3275
|
-
leftSection: /* @__PURE__ */ p(
|
|
3276
|
-
onClick: () =>
|
|
3657
|
+
leftSection: /* @__PURE__ */ p(Te, { size: 14 }),
|
|
3658
|
+
onClick: () => Ie(!0),
|
|
3277
3659
|
color: "red",
|
|
3278
3660
|
children: "Löschen"
|
|
3279
3661
|
})
|
|
@@ -3283,62 +3665,62 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3283
3665
|
})(),
|
|
3284
3666
|
c.find((e) => e.create) && /* @__PURE__ */ p(v, {
|
|
3285
3667
|
onClick: () => Me(!0),
|
|
3286
|
-
disabled:
|
|
3668
|
+
disabled: pe,
|
|
3287
3669
|
children: T ?? "Erstellen"
|
|
3288
3670
|
}),
|
|
3289
3671
|
o
|
|
3290
3672
|
]
|
|
3291
3673
|
})]
|
|
3292
3674
|
}),
|
|
3293
|
-
O && O.length > 0 && /* @__PURE__ */ p(
|
|
3294
|
-
value:
|
|
3295
|
-
onChange:
|
|
3675
|
+
O && O.length > 0 && /* @__PURE__ */ p(se, {
|
|
3676
|
+
value: ie,
|
|
3677
|
+
onChange: ae,
|
|
3296
3678
|
mt: "md",
|
|
3297
|
-
children: /* @__PURE__ */ p(
|
|
3679
|
+
children: /* @__PURE__ */ p(se.List, { children: O.map((e) => /* @__PURE__ */ p(se.Tab, {
|
|
3298
3680
|
value: e.value,
|
|
3299
3681
|
leftSection: e.icon,
|
|
3300
3682
|
children: e.label
|
|
3301
3683
|
}, e.value)) })
|
|
3302
3684
|
}),
|
|
3303
|
-
|
|
3685
|
+
me && /* @__PURE__ */ p(g, {
|
|
3304
3686
|
mt: "md",
|
|
3305
3687
|
variant: "light",
|
|
3306
3688
|
color: "red",
|
|
3307
3689
|
title: "Es ist ein Fehler aufgetreten.",
|
|
3308
|
-
icon: /* @__PURE__ */ p(
|
|
3690
|
+
icon: /* @__PURE__ */ p(be, {}),
|
|
3309
3691
|
children: "Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."
|
|
3310
3692
|
}),
|
|
3311
|
-
(
|
|
3693
|
+
(pe || he) && /* @__PURE__ */ m(L, {
|
|
3312
3694
|
my: "md",
|
|
3313
|
-
children: [/* @__PURE__ */ p(
|
|
3695
|
+
children: [/* @__PURE__ */ p(I, { height: 40 }), [
|
|
3314
3696
|
,
|
|
3315
3697
|
,
|
|
3316
3698
|
,
|
|
3317
3699
|
,
|
|
3318
3700
|
,
|
|
3319
|
-
].fill(0).map((e, t) => /* @__PURE__ */ p(
|
|
3701
|
+
].fill(0).map((e, t) => /* @__PURE__ */ p(I, { height: 35 }, `skeleton-${t}`))]
|
|
3320
3702
|
}),
|
|
3321
|
-
!
|
|
3322
|
-
...
|
|
3323
|
-
children: /* @__PURE__ */ p(
|
|
3703
|
+
!pe && !he && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(_, {
|
|
3704
|
+
...R ? { visibleFrom: "sm" } : {},
|
|
3705
|
+
children: /* @__PURE__ */ p(vr, {
|
|
3324
3706
|
my: "md",
|
|
3325
3707
|
striped: !0,
|
|
3326
3708
|
highlightOnHover: !0,
|
|
3327
3709
|
minHeight: 150,
|
|
3328
|
-
fetching:
|
|
3710
|
+
fetching: me,
|
|
3329
3711
|
records: U,
|
|
3330
|
-
sortStatus:
|
|
3331
|
-
onSortStatusChange:
|
|
3712
|
+
sortStatus: Ce,
|
|
3713
|
+
onSortStatusChange: Ee,
|
|
3332
3714
|
...l && {
|
|
3333
3715
|
selectedRecords: W,
|
|
3334
3716
|
onSelectedRecordsChange: G
|
|
3335
3717
|
},
|
|
3336
3718
|
...u && U.length && {
|
|
3337
|
-
totalRecords:
|
|
3338
|
-
recordsPerPage:
|
|
3719
|
+
totalRecords: De.length,
|
|
3720
|
+
recordsPerPage: H,
|
|
3339
3721
|
onPageChange: Ae,
|
|
3340
3722
|
page: ke,
|
|
3341
|
-
recordsPerPageOptions:
|
|
3723
|
+
recordsPerPageOptions: Ar,
|
|
3342
3724
|
onRecordsPerPageChange: Oe,
|
|
3343
3725
|
recordsPerPageLabel: "Einträge pro Seite"
|
|
3344
3726
|
},
|
|
@@ -3349,41 +3731,41 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3349
3731
|
} },
|
|
3350
3732
|
columns: c.map((e) => e.column),
|
|
3351
3733
|
noRecordsText: "Keine Einträge gefunden",
|
|
3352
|
-
onRowClick:
|
|
3353
|
-
...
|
|
3734
|
+
onRowClick: te,
|
|
3735
|
+
...te && { style: { cursor: "pointer" } }
|
|
3354
3736
|
})
|
|
3355
|
-
}),
|
|
3737
|
+
}), R && /* @__PURE__ */ p(_, {
|
|
3356
3738
|
hiddenFrom: "sm",
|
|
3357
|
-
children: /* @__PURE__ */ p(
|
|
3739
|
+
children: /* @__PURE__ */ p(kr, {
|
|
3358
3740
|
records: U,
|
|
3359
3741
|
fields: c,
|
|
3360
3742
|
selection: l,
|
|
3361
3743
|
selectedRecords: W,
|
|
3362
3744
|
onSelectedRecordsChange: G,
|
|
3363
|
-
onRowClick:
|
|
3745
|
+
onRowClick: te,
|
|
3364
3746
|
sort: {
|
|
3365
|
-
field: String(
|
|
3366
|
-
direction:
|
|
3747
|
+
field: String(Ce.columnAccessor),
|
|
3748
|
+
direction: Ce.direction,
|
|
3367
3749
|
onSortChange: (e, t) => {
|
|
3368
|
-
|
|
3750
|
+
Ee({
|
|
3369
3751
|
columnAccessor: e,
|
|
3370
3752
|
direction: t
|
|
3371
3753
|
});
|
|
3372
3754
|
}
|
|
3373
3755
|
},
|
|
3374
3756
|
...u && U.length && { pagination: {
|
|
3375
|
-
totalRecords:
|
|
3376
|
-
recordsPerPage:
|
|
3757
|
+
totalRecords: De.length,
|
|
3758
|
+
recordsPerPage: H,
|
|
3377
3759
|
page: ke,
|
|
3378
3760
|
onPageChange: Ae,
|
|
3379
|
-
recordsPerPageOptions:
|
|
3761
|
+
recordsPerPageOptions: Ar,
|
|
3380
3762
|
onRecordsPerPageChange: (e) => {
|
|
3381
3763
|
Oe(e), Ae(1);
|
|
3382
3764
|
}
|
|
3383
3765
|
} },
|
|
3384
3766
|
...F && { rowExpansion: { content: F.content } },
|
|
3385
|
-
...
|
|
3386
|
-
actions:
|
|
3767
|
+
...Re.length > 0 && {
|
|
3768
|
+
actions: Re,
|
|
3387
3769
|
canUpdate: N,
|
|
3388
3770
|
canDelete: P
|
|
3389
3771
|
}
|
|
@@ -3392,32 +3774,32 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3392
3774
|
/* @__PURE__ */ p(A, {
|
|
3393
3775
|
opened: Ne,
|
|
3394
3776
|
onClose: () => {
|
|
3395
|
-
|
|
3777
|
+
Pe(!1), G([]);
|
|
3396
3778
|
},
|
|
3397
3779
|
title: e ?? "Bearbeiten",
|
|
3398
|
-
children: W.length > 0 && /* @__PURE__ */ p(
|
|
3780
|
+
children: W.length > 0 && /* @__PURE__ */ p(yr, {
|
|
3399
3781
|
fields: c.filter((e) => e.update),
|
|
3400
3782
|
queryKey: t,
|
|
3401
|
-
apiPath:
|
|
3783
|
+
apiPath: ce,
|
|
3402
3784
|
id: W[0].id,
|
|
3403
3785
|
onClose: () => {
|
|
3404
|
-
|
|
3786
|
+
Pe(!1), G([]);
|
|
3405
3787
|
},
|
|
3406
3788
|
steps: x
|
|
3407
3789
|
})
|
|
3408
3790
|
}),
|
|
3409
3791
|
W.length > 0 && /* @__PURE__ */ p(A, {
|
|
3410
|
-
opened:
|
|
3792
|
+
opened: Fe,
|
|
3411
3793
|
onClose: () => {
|
|
3412
|
-
|
|
3794
|
+
Ie(!1), G([]);
|
|
3413
3795
|
},
|
|
3414
3796
|
title: e ?? "Löschen",
|
|
3415
|
-
children: /* @__PURE__ */ p(
|
|
3797
|
+
children: /* @__PURE__ */ p(br, {
|
|
3416
3798
|
onClose: () => {
|
|
3417
|
-
|
|
3799
|
+
Ie(!1), G([]);
|
|
3418
3800
|
},
|
|
3419
3801
|
queryKey: t,
|
|
3420
|
-
apiPath:
|
|
3802
|
+
apiPath: ce,
|
|
3421
3803
|
selectedRecords: W
|
|
3422
3804
|
})
|
|
3423
3805
|
}),
|
|
@@ -3429,7 +3811,7 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3429
3811
|
title: e ?? "Anlegen",
|
|
3430
3812
|
children: /* @__PURE__ */ p(Ht, {
|
|
3431
3813
|
queryKey: t,
|
|
3432
|
-
apiPath:
|
|
3814
|
+
apiPath: ce,
|
|
3433
3815
|
onClose: () => {
|
|
3434
3816
|
Me(!1);
|
|
3435
3817
|
},
|
|
@@ -3441,10 +3823,10 @@ function Cr({ title: e, queryKey: t, connectedQueryKeys: n, apiPath: r, mutation
|
|
|
3441
3823
|
}
|
|
3442
3824
|
//#endregion
|
|
3443
3825
|
//#region src/DataTable/DataTable.tsx
|
|
3444
|
-
function
|
|
3445
|
-
return /* @__PURE__ */ p(
|
|
3826
|
+
function Mr(e) {
|
|
3827
|
+
return /* @__PURE__ */ p(jr, { ...e });
|
|
3446
3828
|
}
|
|
3447
3829
|
//#endregion
|
|
3448
|
-
export { Ht as CreateModal,
|
|
3830
|
+
export { Ht as CreateModal, Mr as DataTable, Ot as DataTableProvider, br as DeleteModal, kr as MobileCardList, yr as UpdateModal, Ft as api, Pt as createOne, Nt as deleteOne, jt as getAll, Mt as getOne, At as parseApiError, Tr as sortData, It as updateOne, zt as useAddOne, kt as useDataTable, Vt as useDeleteOne, Rt as useGetAll, Lt as useGetOne, xr as usePersistentState, Bt as useUpdateOne };
|
|
3449
3831
|
|
|
3450
3832
|
//# sourceMappingURL=index.es.js.map
|