@espresso-lab/mantine-data-table 2.1.14 → 2.2.0

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