@ethanhann/mantine-dataview 0.1.1 → 0.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.js CHANGED
@@ -1,38 +1,38 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./serializer-u2zq_sU7.js";
2
- import { createColumnHelper as a, flexRender as o, functionalUpdate as s, getCoreRowModel as c, useReactTable as l } from "@tanstack/react-table";
3
- import { ActionIcon as u, Anchor as d, Badge as f, Box as p, Button as m, Card as h, Center as g, Checkbox as _, CloseButton as ee, Drawer as te, Group as v, Input as y, Menu as b, MultiSelect as x, NumberInput as S, Pagination as C, Paper as w, Popover as T, RangeSlider as E, SegmentedControl as D, Select as O, SimpleGrid as ne, Skeleton as k, Stack as A, Table as j, Text as M, TextInput as N, UnstyledButton as P, useMantineTheme as F } from "@mantine/core";
2
+ import { createColumnHelper as a, createColumnHelper as o, flexRender as s, functionalUpdate as c, getCoreRowModel as l, useReactTable as u } from "@tanstack/react-table";
3
+ import { ActionIcon as d, Anchor as f, Badge as p, Box as m, Button as h, Card as g, Center as _, Checkbox as v, CloseButton as ee, Drawer as y, Group as b, Input as x, Menu as S, MultiSelect as te, NumberInput as C, Pagination as w, Paper as T, Popover as E, RangeSlider as ne, SegmentedControl as D, Select as O, SimpleGrid as re, Skeleton as k, Stack as A, Table as j, Text as M, TextInput as N, UnstyledButton as P, useMantineTheme as F } from "@mantine/core";
4
4
  import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
5
- import { Fragment as re, createContext as ie, useCallback as z, useContext as ae, useEffect as B, useMemo as V, useRef as H, useState as U } from "react";
6
- import { useDisclosure as W, useMediaQuery as G } from "@mantine/hooks";
5
+ import { Fragment as ie, createContext as ae, useCallback as z, useContext as B, useEffect as V, useMemo as H, useRef as U, useState as W } from "react";
6
+ import { useDisclosure as oe, useMediaQuery as G } from "@mantine/hooks";
7
7
  import { DatePickerInput as K } from "@mantine/dates";
8
8
  import "@mantine/dates/styles.css";
9
9
  //#region src/components/DataBulkActions/DataBulkActions.tsx
10
10
  function q({ view: e, slots: t, ...n }) {
11
11
  let { selection: r } = e;
12
- return r.count === 0 ? null : /* @__PURE__ */ L(w, {
12
+ return r.count === 0 ? null : /* @__PURE__ */ L(T, {
13
13
  withBorder: !0,
14
14
  p: "xs",
15
15
  radius: "sm",
16
16
  role: "region",
17
17
  "aria-label": "Bulk actions",
18
18
  ...n,
19
- children: /* @__PURE__ */ R(v, {
19
+ children: /* @__PURE__ */ R(b, {
20
20
  justify: "space-between",
21
21
  wrap: "wrap",
22
22
  gap: "sm",
23
- children: [/* @__PURE__ */ R(v, {
23
+ children: [/* @__PURE__ */ R(b, {
24
24
  gap: "sm",
25
25
  children: [/* @__PURE__ */ R(M, {
26
26
  size: "sm",
27
27
  fw: 500,
28
28
  children: [r.count, " selected"]
29
- }), /* @__PURE__ */ L(m, {
29
+ }), /* @__PURE__ */ L(h, {
30
30
  variant: "subtle",
31
31
  size: "xs",
32
32
  onClick: r.clear,
33
33
  children: "Clear"
34
34
  })]
35
- }), t?.BulkActions && /* @__PURE__ */ L(v, {
35
+ }), t?.BulkActions && /* @__PURE__ */ L(b, {
36
36
  gap: "xs",
37
37
  children: t.BulkActions(r)
38
38
  })]
@@ -45,7 +45,7 @@ function J(e) {
45
45
  let { meta: t, header: n } = e.columnDef;
46
46
  return t?.label ? t.label : typeof n == "string" ? n : e.id;
47
47
  }
48
- function oe(e, t, n) {
48
+ function se(e, t, n) {
49
49
  return t ? t === "hidden" ? null : t : e.accessorFn == null || n === "hidden" ? null : n;
50
50
  }
51
51
  function Y(e, t = {}) {
@@ -57,7 +57,7 @@ function Y(e, t = {}) {
57
57
  meta: []
58
58
  };
59
59
  e.getVisibleLeafColumns().forEach((e, t) => {
60
- let i = e.columnDef.meta?.card, a = oe(e, i?.role, n);
60
+ let i = e.columnDef.meta?.card, a = se(e, i?.role, n);
61
61
  a && r[a].push({
62
62
  order: i?.order ?? t,
63
63
  index: t,
@@ -80,10 +80,10 @@ function Y(e, t = {}) {
80
80
  }
81
81
  //#endregion
82
82
  //#region src/components/StateMessage.tsx
83
- function se(e) {
83
+ function ce(e) {
84
84
  e.resetColumnFilters(), e.setGlobalFilter("");
85
85
  }
86
- function ce({ view: e, slots: t }) {
86
+ function le({ view: e, slots: t }) {
87
87
  return t?.ErrorState ? /* @__PURE__ */ L(I, { children: t.ErrorState({
88
88
  error: e.error,
89
89
  retry: e.refetch
@@ -93,7 +93,7 @@ function ce({ view: e, slots: t }) {
93
93
  children: [/* @__PURE__ */ L(M, {
94
94
  c: "red",
95
95
  children: "Something went wrong."
96
- }), /* @__PURE__ */ L(m, {
96
+ }), /* @__PURE__ */ L(h, {
97
97
  variant: "light",
98
98
  size: "xs",
99
99
  onClick: e.refetch,
@@ -101,8 +101,8 @@ function ce({ view: e, slots: t }) {
101
101
  })]
102
102
  });
103
103
  }
104
- function le({ view: e, slots: t }) {
105
- let n = e.renderStatus.phase === "empty-filtered", r = () => se(e.table);
104
+ function ue({ view: e, slots: t }) {
105
+ let n = e.renderStatus.phase === "empty-filtered", r = () => ce(e.table);
106
106
  return t?.Empty ? /* @__PURE__ */ L(I, { children: t.Empty({
107
107
  filtered: n,
108
108
  clearFilters: r
@@ -112,7 +112,7 @@ function le({ view: e, slots: t }) {
112
112
  children: [/* @__PURE__ */ L(M, {
113
113
  c: "dimmed",
114
114
  children: "No matches."
115
- }), /* @__PURE__ */ L(m, {
115
+ }), /* @__PURE__ */ L(h, {
116
116
  variant: "subtle",
117
117
  size: "xs",
118
118
  onClick: r,
@@ -125,20 +125,20 @@ function le({ view: e, slots: t }) {
125
125
  }
126
126
  //#endregion
127
127
  //#region src/components/DataCards/DataCards.tsx
128
- var ue = {
128
+ var de = {
129
129
  base: 1,
130
130
  sm: 2,
131
131
  lg: 3
132
132
  };
133
- function de({ view: e, slots: t, renderCard: n, fallbackRole: r, enableSelection: i, loadingCardCount: a, cols: o = ue, ...s }) {
133
+ function fe({ view: e, slots: t, renderCard: n, fallbackRole: r, enableSelection: i, loadingCardCount: a, cols: o = de, ...s }) {
134
134
  let { table: c, renderStatus: l } = e, u = i ?? c.options.enableRowSelection !== !1, d = a ?? Math.min(e.state.pagination.pageSize, 6), f = {
135
135
  cols: o,
136
136
  ...s
137
137
  };
138
138
  switch (l.phase) {
139
- case "loading": return t?.LoadingCards ? t.LoadingCards() : /* @__PURE__ */ L(ne, {
139
+ case "loading": return t?.LoadingCards ? t.LoadingCards() : /* @__PURE__ */ L(re, {
140
140
  ...f,
141
- children: Array.from({ length: d }, (e, t) => /* @__PURE__ */ L(h, {
141
+ children: Array.from({ length: d }, (e, t) => /* @__PURE__ */ L(g, {
142
142
  withBorder: !0,
143
143
  padding: "md",
144
144
  children: /* @__PURE__ */ R(A, {
@@ -157,24 +157,24 @@ function de({ view: e, slots: t, renderCard: n, fallbackRole: r, enableSelection
157
157
  })
158
158
  }, t))
159
159
  });
160
- case "error": return /* @__PURE__ */ L(g, {
160
+ case "error": return /* @__PURE__ */ L(_, {
161
161
  p: "xl",
162
- children: /* @__PURE__ */ L(ce, {
162
+ children: /* @__PURE__ */ L(le, {
163
163
  view: e,
164
164
  slots: t
165
165
  })
166
166
  });
167
167
  case "empty":
168
- case "empty-filtered": return /* @__PURE__ */ L(g, {
168
+ case "empty-filtered": return /* @__PURE__ */ L(_, {
169
169
  p: "xl",
170
- children: /* @__PURE__ */ L(le, {
170
+ children: /* @__PURE__ */ L(ue, {
171
171
  view: e,
172
172
  slots: t
173
173
  })
174
174
  });
175
175
  default: {
176
176
  let e = Y(c, { fallbackRole: r });
177
- return /* @__PURE__ */ L(ne, {
177
+ return /* @__PURE__ */ L(re, {
178
178
  ...f,
179
179
  children: c.getRowModel().rows.map((r) => {
180
180
  let i = r.getIsSelected(), a = {
@@ -183,16 +183,16 @@ function de({ view: e, slots: t, renderCard: n, fallbackRole: r, enableSelection
183
183
  selected: i,
184
184
  toggleSelected: () => r.toggleSelected()
185
185
  };
186
- if (n) return /* @__PURE__ */ L(fe, { children: n(a) }, r.id);
187
- let o = /* @__PURE__ */ L(pe, {
186
+ if (n) return /* @__PURE__ */ L(pe, { children: n(a) }, r.id);
187
+ let o = /* @__PURE__ */ L(me, {
188
188
  row: r,
189
189
  layout: e,
190
190
  selectionEnabled: u
191
191
  });
192
- return t?.Card ? /* @__PURE__ */ L(fe, { children: t.Card({
192
+ return t?.Card ? /* @__PURE__ */ L(pe, { children: t.Card({
193
193
  ...a,
194
194
  children: o
195
- }) }, r.id) : /* @__PURE__ */ L(h, {
195
+ }) }, r.id) : /* @__PURE__ */ L(g, {
196
196
  withBorder: !0,
197
197
  padding: "lg",
198
198
  pos: "relative",
@@ -204,16 +204,16 @@ function de({ view: e, slots: t, renderCard: n, fallbackRole: r, enableSelection
204
204
  }
205
205
  }
206
206
  }
207
- function fe({ children: e }) {
207
+ function pe({ children: e }) {
208
208
  return /* @__PURE__ */ L(I, { children: e });
209
209
  }
210
- function pe({ row: e, layout: t, selectionEnabled: n }) {
210
+ function me({ row: e, layout: t, selectionEnabled: n }) {
211
211
  let r = new Map(e.getAllCells().map((e) => [e.column.id, e])), i = (e) => {
212
212
  let t = r.get(e.id);
213
- return t ? o(t.column.columnDef.cell, t.getContext()) : null;
213
+ return t ? s(t.column.columnDef.cell, t.getContext()) : null;
214
214
  };
215
215
  return /* @__PURE__ */ R(I, { children: [
216
- n && /* @__PURE__ */ L(_, {
216
+ n && /* @__PURE__ */ L(v, {
217
217
  "aria-label": "Select card",
218
218
  checked: e.getIsSelected(),
219
219
  disabled: !e.getCanSelect(),
@@ -225,9 +225,9 @@ function pe({ row: e, layout: t, selectionEnabled: n }) {
225
225
  zIndex: 1
226
226
  }
227
227
  }),
228
- t.media.length > 0 && /* @__PURE__ */ L(h.Section, {
228
+ t.media.length > 0 && /* @__PURE__ */ L(g.Section, {
229
229
  mb: "xs",
230
- children: t.media.map((e) => /* @__PURE__ */ L(p, { children: i(e) }, e.id))
230
+ children: t.media.map((e) => /* @__PURE__ */ L(m, { children: i(e) }, e.id))
231
231
  }),
232
232
  /* @__PURE__ */ R(A, {
233
233
  gap: "md",
@@ -246,13 +246,13 @@ function pe({ row: e, layout: t, selectionEnabled: n }) {
246
246
  children: i(e)
247
247
  }, e.id))]
248
248
  }),
249
- t.badge.length > 0 && /* @__PURE__ */ L(v, {
249
+ t.badge.length > 0 && /* @__PURE__ */ L(b, {
250
250
  gap: "xs",
251
- children: t.badge.map((e) => /* @__PURE__ */ L(re, { children: i(e) }, e.id))
251
+ children: t.badge.map((e) => /* @__PURE__ */ L(ie, { children: i(e) }, e.id))
252
252
  }),
253
253
  t.meta.length > 0 && /* @__PURE__ */ L(A, {
254
254
  gap: 4,
255
- children: t.meta.map((e) => /* @__PURE__ */ R(v, {
255
+ children: t.meta.map((e) => /* @__PURE__ */ R(b, {
256
256
  justify: "space-between",
257
257
  gap: "xs",
258
258
  wrap: "nowrap",
@@ -272,14 +272,14 @@ function pe({ row: e, layout: t, selectionEnabled: n }) {
272
272
  }
273
273
  //#endregion
274
274
  //#region src/components/DataPagination/DataPagination.tsx
275
- function me({ view: e, pageSizeOptions: t, showPageSize: n = !0, showRange: r = !0, pageSizeLabel: i = "Rows per page", ...a }) {
275
+ function he({ view: e, pageSizeOptions: t, showPageSize: n = !0, showRange: r = !0, pageSizeLabel: i = "Rows per page", ...a }) {
276
276
  let { table: o } = e, { pageIndex: s, pageSize: c } = e.state.pagination, l = o.getRowCount(), u = o.getPageCount(), d = t ?? e.pageSizeOptions, f = l === 0 ? 0 : s * c + 1, p = Math.min((s + 1) * c, l);
277
- return /* @__PURE__ */ R(v, {
277
+ return /* @__PURE__ */ R(b, {
278
278
  justify: "space-between",
279
279
  wrap: "wrap",
280
280
  gap: "sm",
281
281
  ...a,
282
- children: [/* @__PURE__ */ R(v, {
282
+ children: [/* @__PURE__ */ R(b, {
283
283
  gap: "sm",
284
284
  wrap: "wrap",
285
285
  children: [n && /* @__PURE__ */ L(O, {
@@ -300,7 +300,7 @@ function me({ view: e, pageSizeOptions: t, showPageSize: n = !0, showRange: r =
300
300
  l
301
301
  ]
302
302
  })]
303
- }), /* @__PURE__ */ L(C, {
303
+ }), /* @__PURE__ */ L(w, {
304
304
  value: s + 1,
305
305
  total: Math.max(u, 1),
306
306
  onChange: (e) => o.setPageIndex(e - 1),
@@ -310,7 +310,7 @@ function me({ view: e, pageSizeOptions: t, showPageSize: n = !0, showRange: r =
310
310
  }
311
311
  //#endregion
312
312
  //#region src/components/icons.tsx
313
- function he({ direction: e }) {
313
+ function ge({ direction: e }) {
314
314
  return /* @__PURE__ */ R("svg", {
315
315
  width: "14",
316
316
  height: "14",
@@ -356,37 +356,37 @@ function X({ d: e, title: t }) {
356
356
  children: [/* @__PURE__ */ L("title", { children: t }), /* @__PURE__ */ L("path", { d: e })]
357
357
  });
358
358
  }
359
- function ge() {
359
+ function _e() {
360
360
  return /* @__PURE__ */ L(X, {
361
361
  title: "search",
362
362
  d: "M21 21l-4.3-4.3M11 19a8 8 0 110-16 8 8 0 010 16z"
363
363
  });
364
364
  }
365
- function _e() {
365
+ function ve() {
366
366
  return /* @__PURE__ */ L(X, {
367
367
  title: "filter",
368
368
  d: "M3 5h18M7 12h10M10 19h4"
369
369
  });
370
370
  }
371
- function ve() {
371
+ function ye() {
372
372
  return /* @__PURE__ */ L(X, {
373
373
  title: "open",
374
374
  d: "M6 9l6 6 6-6"
375
375
  });
376
376
  }
377
- function ye() {
377
+ function be() {
378
378
  return /* @__PURE__ */ L(X, {
379
379
  title: "close",
380
380
  d: "M18 6L6 18M6 6l12 12"
381
381
  });
382
382
  }
383
- function be() {
383
+ function xe() {
384
384
  return /* @__PURE__ */ L(X, {
385
385
  title: "pin left",
386
386
  d: "M4 4v16M9 8h8M9 12h6M9 16h8"
387
387
  });
388
388
  }
389
- function xe() {
389
+ function Se() {
390
390
  return /* @__PURE__ */ L(X, {
391
391
  title: "pin right",
392
392
  d: "M20 4v16M7 8h8M9 12h6M7 16h8"
@@ -394,7 +394,7 @@ function xe() {
394
394
  }
395
395
  //#endregion
396
396
  //#region src/components/DataTable/DataTable.tsx
397
- function Se(e) {
397
+ function Ce(e) {
398
398
  let t = e.getIsPinned();
399
399
  if (t) return {
400
400
  position: "sticky",
@@ -403,30 +403,30 @@ function Se(e) {
403
403
  backgroundColor: "var(--mantine-color-body)"
404
404
  };
405
405
  }
406
- function Ce({ view: e, slots: t, enableSelection: n, loadingRowCount: r, ...i }) {
407
- let { table: a, renderStatus: s } = e, c = a.getVisibleLeafColumns(), l = n ?? a.options.enableRowSelection !== !1, u = c.length + +!!l, d = r ?? Math.min(e.state.pagination.pageSize, 8), f = () => {
408
- switch (s.phase) {
406
+ function we({ view: e, slots: t, enableSelection: n, loadingRowCount: r, ...i }) {
407
+ let { table: a, renderStatus: o } = e, c = a.getVisibleLeafColumns(), l = n ?? a.options.enableRowSelection !== !1, u = c.length + +!!l, d = r ?? Math.min(e.state.pagination.pageSize, 8), f = () => {
408
+ switch (o.phase) {
409
409
  case "loading": return t?.LoadingTable ? t.LoadingTable() : /* @__PURE__ */ L(j.Tbody, { children: Array.from({ length: d }, (e, t) => /* @__PURE__ */ R(j.Tr, { children: [l && /* @__PURE__ */ L(j.Td, { children: /* @__PURE__ */ L(k, {
410
410
  height: 16,
411
411
  width: 16
412
412
  }) }), c.map((e) => /* @__PURE__ */ L(j.Td, { children: /* @__PURE__ */ L(k, { height: 12 }) }, e.id))] }, t)) });
413
- case "error": return /* @__PURE__ */ L(Te, {
413
+ case "error": return /* @__PURE__ */ L(Ee, {
414
414
  colSpan: u,
415
- children: /* @__PURE__ */ L(ce, {
415
+ children: /* @__PURE__ */ L(le, {
416
416
  view: e,
417
417
  slots: t
418
418
  })
419
419
  });
420
420
  case "empty":
421
- case "empty-filtered": return /* @__PURE__ */ L(Te, {
421
+ case "empty-filtered": return /* @__PURE__ */ L(Ee, {
422
422
  colSpan: u,
423
- children: /* @__PURE__ */ L(le, {
423
+ children: /* @__PURE__ */ L(ue, {
424
424
  view: e,
425
425
  slots: t
426
426
  })
427
427
  });
428
428
  default: return /* @__PURE__ */ L(j.Tbody, { children: a.getRowModel().rows.map((e) => {
429
- let n = /* @__PURE__ */ R(I, { children: [l && /* @__PURE__ */ L(j.Td, { children: /* @__PURE__ */ L(_, {
429
+ let n = /* @__PURE__ */ R(I, { children: [l && /* @__PURE__ */ L(j.Td, { children: /* @__PURE__ */ L(v, {
430
430
  "aria-label": "Select row",
431
431
  checked: e.getIsSelected(),
432
432
  disabled: !e.getCanSelect(),
@@ -436,13 +436,13 @@ function Ce({ view: e, slots: t, enableSelection: n, loadingRowCount: r, ...i })
436
436
  let t = e.column.columnDef.meta?.align;
437
437
  return /* @__PURE__ */ L(j.Td, {
438
438
  style: {
439
- ...Se(e.column),
439
+ ...Ce(e.column),
440
440
  ...t ? { textAlign: t } : void 0
441
441
  },
442
- children: o(e.column.columnDef.cell, e.getContext())
442
+ children: s(e.column.columnDef.cell, e.getContext())
443
443
  }, e.id);
444
444
  })] });
445
- return t?.Row ? /* @__PURE__ */ L(we, { children: t.Row({
445
+ return t?.Row ? /* @__PURE__ */ L(Te, { children: t.Row({
446
446
  row: e,
447
447
  cells: n
448
448
  }) }, e.id) : /* @__PURE__ */ L(j.Tr, {
@@ -459,33 +459,33 @@ function Ce({ view: e, slots: t, enableSelection: n, loadingRowCount: r, ...i })
459
459
  ...i,
460
460
  children: [/* @__PURE__ */ L(j.Thead, { children: a.getHeaderGroups().map((e) => /* @__PURE__ */ R(j.Tr, { children: [l && /* @__PURE__ */ L(j.Th, {
461
461
  style: { width: 40 },
462
- children: /* @__PURE__ */ L(_, {
462
+ children: /* @__PURE__ */ L(v, {
463
463
  "aria-label": "Select all rows on this page",
464
464
  checked: a.getIsAllPageRowsSelected(),
465
465
  indeterminate: a.getIsSomePageRowsSelected() && !a.getIsAllPageRowsSelected(),
466
466
  onChange: a.getToggleAllPageRowsSelectedHandler()
467
467
  })
468
- }), e.headers.map((e) => /* @__PURE__ */ L(Ee, { header: e }, e.id))] }, e.id)) }), f()]
468
+ }), e.headers.map((e) => /* @__PURE__ */ L(De, { header: e }, e.id))] }, e.id)) }), f()]
469
469
  })
470
470
  });
471
471
  }
472
- function we({ children: e }) {
472
+ function Te({ children: e }) {
473
473
  return /* @__PURE__ */ L(I, { children: e });
474
474
  }
475
- function Te({ colSpan: e, children: t }) {
475
+ function Ee({ colSpan: e, children: t }) {
476
476
  return /* @__PURE__ */ L(j.Tbody, { children: /* @__PURE__ */ L(j.Tr, { children: /* @__PURE__ */ L(j.Td, {
477
477
  colSpan: e,
478
- children: /* @__PURE__ */ L(g, {
478
+ children: /* @__PURE__ */ L(_, {
479
479
  p: "xl",
480
480
  children: t
481
481
  })
482
482
  }) }) });
483
483
  }
484
- function Ee({ header: e }) {
485
- let { column: t } = e, n = t.columnDef.meta?.align, r = t.getIsSorted(), i = t.getSortIndex(), a = i > 0, s = e.isPlaceholder ? null : o(t.columnDef.header, e.getContext());
484
+ function De({ header: e }) {
485
+ let { column: t } = e, n = t.columnDef.meta?.align, r = t.getIsSorted(), i = t.getSortIndex(), a = i > 0, o = e.isPlaceholder ? null : s(t.columnDef.header, e.getContext());
486
486
  return /* @__PURE__ */ L(j.Th, {
487
487
  style: {
488
- ...Se(t),
488
+ ...Ce(t),
489
489
  ...n ? { textAlign: n } : void 0
490
490
  },
491
491
  "aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : void 0,
@@ -498,8 +498,8 @@ function Ee({ header: e }) {
498
498
  font: "inherit"
499
499
  },
500
500
  children: [
501
- s,
502
- /* @__PURE__ */ L(he, { direction: r }),
501
+ o,
502
+ /* @__PURE__ */ L(ge, { direction: r }),
503
503
  a && /* @__PURE__ */ L("span", {
504
504
  role: "note",
505
505
  style: {
@@ -510,25 +510,25 @@ function Ee({ header: e }) {
510
510
  children: i + 1
511
511
  })
512
512
  ]
513
- }) : s
513
+ }) : o
514
514
  });
515
515
  }
516
516
  //#endregion
517
517
  //#region src/core/useForceCards.ts
518
- var De = "(max-width: 0px)";
519
- function Oe(e) {
518
+ var Oe = "(max-width: 0px)";
519
+ function ke(e) {
520
520
  let t = /^([\d.]+)(\D*)$/.exec(e.trim());
521
521
  if (!t) return `(max-width: ${e})`;
522
522
  let n = Number(t[1]), r = t[2] || "px";
523
523
  return `(max-width: ${n - (r === "em" || r === "rem" ? .01 : .1)}${r})`;
524
524
  }
525
- function ke(e) {
526
- let t = F(), n = e?.forceCardsBelow, r = n ? t.breakpoints[n] : void 0, i = G(r ? Oe(r) : De, !1);
525
+ function Ae(e) {
526
+ let t = F(), n = e?.forceCardsBelow, r = n ? t.breakpoints[n] : void 0, i = G(r ? ke(r) : Oe, !1);
527
527
  return !!r && !!i;
528
528
  }
529
529
  //#endregion
530
530
  //#region src/core/formatValue.ts
531
- var Ae = {
531
+ var je = {
532
532
  text: (e) => e == null ? "" : String(e),
533
533
  number: (e) => e == null ? "" : new Intl.NumberFormat().format(Number(e)),
534
534
  currency: (e) => e == null ? "" : new Intl.NumberFormat(void 0, {
@@ -542,7 +542,7 @@ var Ae = {
542
542
  },
543
543
  boolean: (e) => e == null ? "" : e ? "Yes" : "No"
544
544
  };
545
- function je(e, t) {
545
+ function Me(e, t) {
546
546
  if (e === "number" || e === "currency") {
547
547
  let n = new Intl.NumberFormat(void 0, e === "currency" ? {
548
548
  style: "currency",
@@ -558,15 +558,15 @@ function je(e, t) {
558
558
  return Number.isNaN(n.getTime()) ? String(t) : e.format(n);
559
559
  };
560
560
  }
561
- return Ae[e];
561
+ return je[e];
562
562
  }
563
- function Me(e, t, n) {
563
+ function Ne(e, t, n) {
564
564
  let r = t ?? n?.[e];
565
- return r ? typeof r == "function" ? r : je(e, r) : Ae[e];
565
+ return r ? typeof r == "function" ? r : Me(e, r) : je[e];
566
566
  }
567
567
  //#endregion
568
568
  //#region src/components/DataToolbar/FacetBuckets.tsx
569
- function Ne({ facet: e, value: t, onChange: n }) {
569
+ function Pe({ facet: e, value: t, onChange: n }) {
570
570
  let r = Array.isArray(t) ? t : null;
571
571
  return /* @__PURE__ */ L(A, {
572
572
  gap: 4,
@@ -579,14 +579,14 @@ function Ne({ facet: e, value: t, onChange: n }) {
579
579
  borderRadius: 4,
580
580
  background: t ? "var(--mantine-color-blue-light)" : void 0
581
581
  },
582
- children: /* @__PURE__ */ R(v, {
582
+ children: /* @__PURE__ */ R(b, {
583
583
  gap: "xs",
584
584
  justify: "space-between",
585
585
  wrap: "nowrap",
586
586
  children: [/* @__PURE__ */ L(M, {
587
587
  size: "sm",
588
588
  children: e.label
589
- }), /* @__PURE__ */ L(f, {
589
+ }), /* @__PURE__ */ L(p, {
590
590
  size: "sm",
591
591
  variant: "light",
592
592
  color: e.count === 0 ? "gray" : "blue",
@@ -599,15 +599,15 @@ function Ne({ facet: e, value: t, onChange: n }) {
599
599
  }
600
600
  //#endregion
601
601
  //#region src/components/DataToolbar/FilterControl.tsx
602
- function Pe({ label: e, onClear: t }) {
603
- return /* @__PURE__ */ R(v, {
602
+ function Fe({ label: e, onClear: t }) {
603
+ return /* @__PURE__ */ R(b, {
604
604
  justify: "space-between",
605
605
  wrap: "nowrap",
606
606
  children: [/* @__PURE__ */ L(M, {
607
607
  size: "sm",
608
608
  fw: 500,
609
609
  children: e
610
- }), /* @__PURE__ */ L(d, {
610
+ }), /* @__PURE__ */ L(f, {
611
611
  component: "button",
612
612
  type: "button",
613
613
  size: "xs",
@@ -617,26 +617,26 @@ function Pe({ label: e, onClear: t }) {
617
617
  })]
618
618
  });
619
619
  }
620
- function Fe(e) {
620
+ function Ie(e) {
621
621
  return e ? typeof e == "string" ? e : e.toISOString().split("T")[0] ?? null : null;
622
622
  }
623
- function Ie(e) {
623
+ function Le(e) {
624
624
  return Array.isArray(e) ? [e[0], e[1]] : [null, null];
625
625
  }
626
- function Le(e, t) {
626
+ function Re(e, t) {
627
627
  return e.values.length > 0 ? e.values.map((e) => ({
628
628
  value: e.value,
629
629
  label: `${e.label ?? e.value} (${e.count})`,
630
630
  disabled: e.count === 0
631
631
  })) : t ?? [];
632
632
  }
633
- function Re({ column: e, facet: t }) {
633
+ function ze({ column: e, facet: t }) {
634
634
  let n = e.columnDef.meta?.filter;
635
635
  if (!n) return null;
636
636
  let r = J(e), i = n.placeholder ?? r, a = e.getFilterValue(), o = (t) => e.setFilterValue(t);
637
637
  if (n.component) {
638
638
  let t = n.component;
639
- return /* @__PURE__ */ L(y.Wrapper, {
639
+ return /* @__PURE__ */ L(x.Wrapper, {
640
640
  label: r,
641
641
  children: /* @__PURE__ */ L(t, {
642
642
  value: a,
@@ -651,20 +651,20 @@ function Re({ column: e, facet: t }) {
651
651
  label: r,
652
652
  placeholder: i,
653
653
  clearable: !0,
654
- data: s ? Le(s, n.options) : n.options ?? [],
654
+ data: s ? Re(s, n.options) : n.options ?? [],
655
655
  value: a ?? null,
656
656
  onChange: (e) => o(e ?? void 0)
657
657
  });
658
- case "multiselect": return /* @__PURE__ */ L(x, {
658
+ case "multiselect": return /* @__PURE__ */ L(te, {
659
659
  label: r,
660
660
  placeholder: i,
661
- data: s ? Le(s, n.options) : n.options ?? [],
661
+ data: s ? Re(s, n.options) : n.options ?? [],
662
662
  value: a ?? [],
663
663
  onChange: (e) => o(e.length > 0 ? e : void 0)
664
664
  });
665
665
  case "boolean": {
666
666
  let e = a == null ? "all" : a ? "yes" : "no", t = s?.values.find((e) => e.value === "true"), n = s?.values.find((e) => e.value === "false"), i = t ? `Yes (${t.count})` : "Yes", c = n ? `No (${n.count})` : "No";
667
- return /* @__PURE__ */ L(y.Wrapper, {
667
+ return /* @__PURE__ */ L(x.Wrapper, {
668
668
  label: r,
669
669
  children: /* @__PURE__ */ L(D, {
670
670
  fullWidth: !0,
@@ -691,21 +691,21 @@ function Re({ column: e, facet: t }) {
691
691
  });
692
692
  }
693
693
  case "numberRange": {
694
- let [t, i] = Ie(a), s = n.min ?? c?.min, l = n.max ?? c?.max, u = s != null && l != null, d = a != null, f = c ? /* @__PURE__ */ L(Ne, {
694
+ let [t, i] = Le(a), s = n.min ?? c?.min, l = n.max ?? c?.max, u = s != null && l != null, d = a != null, f = c ? /* @__PURE__ */ L(Pe, {
695
695
  facet: c,
696
696
  value: a,
697
697
  onChange: o
698
- }) : null, p = d ? /* @__PURE__ */ L(Pe, {
698
+ }) : null, p = d ? /* @__PURE__ */ L(Fe, {
699
699
  label: r,
700
700
  onClear: () => o(void 0)
701
701
  }) : r;
702
702
  if (u) {
703
- let a = [t ?? s, i ?? l], c = e.columnDef.meta?.dataType, u = c ? Me(c, e.columnDef.meta?.format, void 0) : (e) => String(e);
704
- return /* @__PURE__ */ L(y.Wrapper, {
703
+ let a = [t ?? s, i ?? l], c = e.columnDef.meta?.dataType, u = c ? Ne(c, e.columnDef.meta?.format, void 0) : (e) => String(e);
704
+ return /* @__PURE__ */ L(x.Wrapper, {
705
705
  label: p,
706
706
  children: /* @__PURE__ */ R(A, {
707
707
  gap: "xs",
708
- children: [f, /* @__PURE__ */ L(E, {
708
+ children: [f, /* @__PURE__ */ L(ne, {
709
709
  min: s,
710
710
  max: l,
711
711
  step: n.step ?? 1,
@@ -720,23 +720,23 @@ function Re({ column: e, facet: t }) {
720
720
  })
721
721
  });
722
722
  }
723
- if (f) return /* @__PURE__ */ L(y.Wrapper, {
723
+ if (f) return /* @__PURE__ */ L(x.Wrapper, {
724
724
  label: p,
725
725
  children: f
726
726
  });
727
727
  let m = (e) => o(e[0] == null && e[1] == null ? void 0 : e), h = (e) => e === "" || e == null ? null : Number(e);
728
- return /* @__PURE__ */ L(y.Wrapper, {
728
+ return /* @__PURE__ */ L(x.Wrapper, {
729
729
  label: r,
730
- children: /* @__PURE__ */ R(v, {
730
+ children: /* @__PURE__ */ R(b, {
731
731
  gap: 4,
732
732
  wrap: "nowrap",
733
- children: [/* @__PURE__ */ L(S, {
733
+ children: [/* @__PURE__ */ L(C, {
734
734
  "aria-label": `${r} minimum`,
735
735
  placeholder: "Min",
736
736
  value: t ?? "",
737
737
  onChange: (e) => m([h(e), i]),
738
738
  w: 90
739
- }), /* @__PURE__ */ L(S, {
739
+ }), /* @__PURE__ */ L(C, {
740
740
  "aria-label": `${r} maximum`,
741
741
  placeholder: "Max",
742
742
  value: i ?? "",
@@ -752,18 +752,18 @@ function Re({ column: e, facet: t }) {
752
752
  clearable: !0,
753
753
  popoverProps: { withinPortal: !1 },
754
754
  value: a ? new Date(a) : null,
755
- onChange: (e) => o(Fe(e) ?? void 0)
755
+ onChange: (e) => o(Ie(e) ?? void 0)
756
756
  });
757
757
  case "dateRange": {
758
- let [e, t] = Ie(a), n = [e ? new Date(e) : null, t ? new Date(t) : null], s = a == null ? r : /* @__PURE__ */ L(Pe, {
758
+ let [e, t] = Le(a), n = [e ? new Date(e) : null, t ? new Date(t) : null], s = a == null ? r : /* @__PURE__ */ L(Fe, {
759
759
  label: r,
760
760
  onClear: () => o(void 0)
761
761
  });
762
- return /* @__PURE__ */ L(y.Wrapper, {
762
+ return /* @__PURE__ */ L(x.Wrapper, {
763
763
  label: s,
764
764
  children: /* @__PURE__ */ R(A, {
765
765
  gap: "xs",
766
- children: [c && /* @__PURE__ */ L(Ne, {
766
+ children: [c && /* @__PURE__ */ L(Pe, {
767
767
  facet: c,
768
768
  value: a,
769
769
  onChange: o
@@ -774,7 +774,7 @@ function Re({ column: e, facet: t }) {
774
774
  clearable: !0,
775
775
  value: n,
776
776
  onChange: ([e, t]) => {
777
- let n = Fe(e), r = Fe(t);
777
+ let n = Ie(e), r = Ie(t);
778
778
  o(n == null && r == null ? void 0 : [n, r]);
779
779
  }
780
780
  })]
@@ -791,59 +791,59 @@ function Re({ column: e, facet: t }) {
791
791
  }
792
792
  //#endregion
793
793
  //#region src/components/DataToolbar/FilterControls.tsx
794
- function ze({ view: e }) {
795
- return e.state.columnFilters.length > 0 ? /* @__PURE__ */ L(m, {
794
+ function Be({ view: e }) {
795
+ return e.state.columnFilters.length > 0 ? /* @__PURE__ */ L(h, {
796
796
  variant: "subtle",
797
797
  size: "compact-sm",
798
798
  color: "gray",
799
- leftSection: /* @__PURE__ */ L(ye, {}),
799
+ leftSection: /* @__PURE__ */ L(be, {}),
800
800
  onClick: () => e.table.resetColumnFilters(),
801
801
  children: "Reset filters"
802
802
  }) : null;
803
803
  }
804
- function Be(e) {
804
+ function Ve(e) {
805
805
  return e > 0 ? `Filters (${e})` : "Filters";
806
806
  }
807
- function Ve({ view: e, controls: t }) {
807
+ function He({ view: e, controls: t }) {
808
808
  return /* @__PURE__ */ R(A, {
809
809
  gap: "sm",
810
810
  style: { minWidth: 240 },
811
- children: [t, /* @__PURE__ */ L(v, {
811
+ children: [t, /* @__PURE__ */ L(b, {
812
812
  justify: "flex-end",
813
- children: /* @__PURE__ */ L(ze, { view: e })
813
+ children: /* @__PURE__ */ L(Be, { view: e })
814
814
  })]
815
815
  });
816
816
  }
817
- function He({ view: e, inlineThreshold: t }) {
818
- let n = e.filterableColumns, r = G(Oe(F().breakpoints.sm), !1), [i, { open: a, close: o }] = W(!1);
817
+ function Ue({ view: e, inlineThreshold: t }) {
818
+ let n = e.filterableColumns, r = G(ke(F().breakpoints.sm), !1), [i, { open: a, close: o }] = oe(!1);
819
819
  if (n.length === 0) return null;
820
- let s = n.map((t) => /* @__PURE__ */ L(Re, {
820
+ let s = n.map((t) => /* @__PURE__ */ L(ze, {
821
821
  column: t,
822
822
  facet: e.facets[t.id]
823
823
  }, t.id)), c = e.state.columnFilters.length;
824
- return r ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(m, {
824
+ return r ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(h, {
825
825
  variant: "default",
826
- leftSection: /* @__PURE__ */ L(_e, {}),
826
+ leftSection: /* @__PURE__ */ L(ve, {}),
827
827
  onClick: a,
828
- children: Be(c)
829
- }), /* @__PURE__ */ L(te, {
828
+ children: Ve(c)
829
+ }), /* @__PURE__ */ L(y, {
830
830
  opened: i,
831
831
  onClose: o,
832
832
  title: "Filters",
833
833
  position: "bottom",
834
834
  size: "auto",
835
- children: /* @__PURE__ */ L(Ve, {
835
+ children: /* @__PURE__ */ L(He, {
836
836
  view: e,
837
837
  controls: s
838
838
  })
839
- })] }) : n.length <= t ? /* @__PURE__ */ R(I, { children: [s, /* @__PURE__ */ L(ze, { view: e })] }) : /* @__PURE__ */ R(T, {
839
+ })] }) : n.length <= t ? /* @__PURE__ */ R(I, { children: [s, /* @__PURE__ */ L(Be, { view: e })] }) : /* @__PURE__ */ R(E, {
840
840
  position: "bottom-start",
841
841
  closeOnClickOutside: !1,
842
- children: [/* @__PURE__ */ L(T.Target, { children: /* @__PURE__ */ L(m, {
842
+ children: [/* @__PURE__ */ L(E.Target, { children: /* @__PURE__ */ L(h, {
843
843
  variant: "default",
844
- leftSection: /* @__PURE__ */ L(_e, {}),
845
- children: Be(c)
846
- }) }), /* @__PURE__ */ L(T.Dropdown, { children: /* @__PURE__ */ L(Ve, {
844
+ leftSection: /* @__PURE__ */ L(ve, {}),
845
+ children: Ve(c)
846
+ }) }), /* @__PURE__ */ L(E.Dropdown, { children: /* @__PURE__ */ L(He, {
847
847
  view: e,
848
848
  controls: s
849
849
  }) })]
@@ -851,9 +851,9 @@ function He({ view: e, inlineThreshold: t }) {
851
851
  }
852
852
  //#endregion
853
853
  //#region src/components/DataToolbar/SortControl.tsx
854
- function Ue({ view: e }) {
854
+ function We({ view: e }) {
855
855
  let { sortableColumns: t, state: n, table: r } = e, i = n.sorting[0];
856
- return /* @__PURE__ */ R(v, {
856
+ return /* @__PURE__ */ R(b, {
857
857
  gap: 4,
858
858
  wrap: "nowrap",
859
859
  children: [/* @__PURE__ */ L(O, {
@@ -869,7 +869,7 @@ function Ue({ view: e }) {
869
869
  id: e,
870
870
  desc: i?.desc ?? !1
871
871
  }] : [])
872
- }), /* @__PURE__ */ L(u, {
872
+ }), /* @__PURE__ */ L(d, {
873
873
  "aria-label": "Toggle sort direction",
874
874
  variant: "default",
875
875
  size: "lg",
@@ -878,13 +878,13 @@ function Ue({ view: e }) {
878
878
  id: i.id,
879
879
  desc: !i.desc
880
880
  }]),
881
- children: /* @__PURE__ */ L(he, { direction: i ? i.desc ? "desc" : "asc" : !1 })
881
+ children: /* @__PURE__ */ L(ge, { direction: i ? i.desc ? "desc" : "asc" : !1 })
882
882
  })]
883
883
  });
884
884
  }
885
885
  //#endregion
886
886
  //#region src/components/DataToolbar/ViewSwitcher.tsx
887
- function We({ view: e, lockSwitcherOnMobile: t }) {
887
+ function Ge({ view: e, lockSwitcherOnMobile: t }) {
888
888
  return e.isMobileForced && t ? null : /* @__PURE__ */ L(D, {
889
889
  "aria-label": "View",
890
890
  value: e.view,
@@ -903,71 +903,71 @@ function We({ view: e, lockSwitcherOnMobile: t }) {
903
903
  }
904
904
  //#endregion
905
905
  //#region src/components/DataToolbar/VisibilityMenu.tsx
906
- function Ge({ column: e }) {
906
+ function Ke({ column: e }) {
907
907
  if (!e.getCanPin()) return null;
908
908
  let t = e.getIsPinned();
909
- return /* @__PURE__ */ R(v, {
909
+ return /* @__PURE__ */ R(b, {
910
910
  gap: 2,
911
- children: [/* @__PURE__ */ L(u, {
911
+ children: [/* @__PURE__ */ L(d, {
912
912
  size: "xs",
913
913
  variant: t === "left" ? "filled" : "subtle",
914
914
  color: t === "left" ? "blue" : "gray",
915
915
  "aria-label": `Pin ${J(e)} left`,
916
916
  onClick: () => e.pin(t === "left" ? !1 : "left"),
917
- children: /* @__PURE__ */ L(be, {})
918
- }), /* @__PURE__ */ L(u, {
917
+ children: /* @__PURE__ */ L(xe, {})
918
+ }), /* @__PURE__ */ L(d, {
919
919
  size: "xs",
920
920
  variant: t === "right" ? "filled" : "subtle",
921
921
  color: t === "right" ? "blue" : "gray",
922
922
  "aria-label": `Pin ${J(e)} right`,
923
923
  onClick: () => e.pin(t === "right" ? !1 : "right"),
924
- children: /* @__PURE__ */ L(xe, {})
924
+ children: /* @__PURE__ */ L(Se, {})
925
925
  })]
926
926
  });
927
927
  }
928
- function Ke({ view: e }) {
928
+ function qe({ view: e }) {
929
929
  let t = e.table.getAllLeafColumns().filter((e) => e.getCanHide());
930
- return t.length === 0 ? null : /* @__PURE__ */ R(b, {
930
+ return t.length === 0 ? null : /* @__PURE__ */ R(S, {
931
931
  closeOnItemClick: !1,
932
932
  withinPortal: !0,
933
933
  position: "bottom-end",
934
- children: [/* @__PURE__ */ L(b.Target, { children: /* @__PURE__ */ L(m, {
934
+ children: [/* @__PURE__ */ L(S.Target, { children: /* @__PURE__ */ L(h, {
935
935
  variant: "default",
936
- rightSection: /* @__PURE__ */ L(ve, {}),
936
+ rightSection: /* @__PURE__ */ L(ye, {}),
937
937
  children: "Columns"
938
- }) }), /* @__PURE__ */ L(b.Dropdown, { children: /* @__PURE__ */ L(A, {
938
+ }) }), /* @__PURE__ */ L(S.Dropdown, { children: /* @__PURE__ */ L(A, {
939
939
  gap: "xs",
940
940
  p: "xs",
941
- children: t.map((e) => /* @__PURE__ */ R(v, {
941
+ children: t.map((e) => /* @__PURE__ */ R(b, {
942
942
  gap: "xs",
943
943
  justify: "space-between",
944
944
  wrap: "nowrap",
945
- children: [/* @__PURE__ */ L(_, {
945
+ children: [/* @__PURE__ */ L(v, {
946
946
  label: J(e),
947
947
  checked: e.getIsVisible(),
948
948
  onChange: (t) => e.toggleVisibility(t.currentTarget.checked)
949
- }), /* @__PURE__ */ L(Ge, { column: e })]
949
+ }), /* @__PURE__ */ L(Ke, { column: e })]
950
950
  }, e.id))
951
951
  }) })]
952
952
  });
953
953
  }
954
954
  //#endregion
955
955
  //#region src/components/DataToolbar/DataToolbar.tsx
956
- function qe({ view: e, searchPlaceholder: t = "Search…", filterInlineThreshold: n = 3, lockSwitcherOnMobile: r, showSearch: i, showFilters: a, showSort: o, showVisibility: s, showViewSwitcher: c, ...l }) {
956
+ function Je({ view: e, searchPlaceholder: t = "Search…", filterInlineThreshold: n = 3, lockSwitcherOnMobile: r, showSearch: i, showFilters: a, showSort: o, showVisibility: s, showViewSwitcher: c, ...l }) {
957
957
  let { table: u, state: d } = e, f = i ?? u.options.enableGlobalFilter !== !1, p = a ?? e.filterableColumns.length > 0, m = o ?? e.sortableColumns.length > 0, h = s ?? !0, g = c ?? !0;
958
- return /* @__PURE__ */ R(v, {
958
+ return /* @__PURE__ */ R(b, {
959
959
  justify: "space-between",
960
960
  wrap: "wrap",
961
961
  gap: "sm",
962
962
  ...l,
963
- children: [/* @__PURE__ */ R(v, {
963
+ children: [/* @__PURE__ */ R(b, {
964
964
  wrap: "wrap",
965
965
  gap: "sm",
966
966
  children: [
967
967
  f && /* @__PURE__ */ L(N, {
968
968
  "aria-label": "Search",
969
969
  placeholder: t,
970
- leftSection: /* @__PURE__ */ L(ge, {}),
970
+ leftSection: /* @__PURE__ */ L(_e, {}),
971
971
  value: d.globalFilter,
972
972
  onChange: (e) => u.setGlobalFilter(e.currentTarget.value),
973
973
  rightSection: d.globalFilter ? /* @__PURE__ */ L(ee, {
@@ -976,16 +976,16 @@ function qe({ view: e, searchPlaceholder: t = "Search…", filterInlineThreshold
976
976
  onClick: () => u.setGlobalFilter("")
977
977
  }) : void 0
978
978
  }),
979
- p && /* @__PURE__ */ L(He, {
979
+ p && /* @__PURE__ */ L(Ue, {
980
980
  view: e,
981
981
  inlineThreshold: n
982
982
  }),
983
- m && /* @__PURE__ */ L(Ue, { view: e })
983
+ m && /* @__PURE__ */ L(We, { view: e })
984
984
  ]
985
- }), /* @__PURE__ */ R(v, {
985
+ }), /* @__PURE__ */ R(b, {
986
986
  wrap: "wrap",
987
987
  gap: "sm",
988
- children: [h && /* @__PURE__ */ L(Ke, { view: e }), g && /* @__PURE__ */ L(We, {
988
+ children: [h && /* @__PURE__ */ L(qe, { view: e }), g && /* @__PURE__ */ L(Ge, {
989
989
  view: e,
990
990
  lockSwitcherOnMobile: r
991
991
  })]
@@ -994,17 +994,17 @@ function qe({ view: e, searchPlaceholder: t = "Search…", filterInlineThreshold
994
994
  }
995
995
  //#endregion
996
996
  //#region src/components/DataView/context.tsx
997
- var Je = ie(null), Ye = Je.Provider;
997
+ var Ye = ae(null), Xe = Ye.Provider;
998
998
  function Z() {
999
- let e = ae(Je);
999
+ let e = B(Ye);
1000
1000
  if (!e) throw Error("DataView.Toolbar / DataView.Body / DataView.Pagination must be rendered inside <DataView>.");
1001
1001
  return e;
1002
1002
  }
1003
1003
  //#endregion
1004
1004
  //#region src/components/DataView/DataView.tsx
1005
1005
  function Q({ view: e, slots: t, renderCard: n, fallbackRole: r, lockSwitcherOnMobile: i, children: a, ...o }) {
1006
- return /* @__PURE__ */ L(Ye, {
1007
- value: V(() => ({
1006
+ return /* @__PURE__ */ L(Xe, {
1007
+ value: H(() => ({
1008
1008
  view: e,
1009
1009
  slots: t,
1010
1010
  renderCard: n,
@@ -1020,44 +1020,44 @@ function Q({ view: e, slots: t, renderCard: n, fallbackRole: r, lockSwitcherOnMo
1020
1020
  children: /* @__PURE__ */ L(A, {
1021
1021
  ...o,
1022
1022
  children: a ?? /* @__PURE__ */ R(I, { children: [
1023
- /* @__PURE__ */ L(Xe, {}),
1024
- /* @__PURE__ */ L($e, {}),
1025
1023
  /* @__PURE__ */ L(Ze, {}),
1026
- /* @__PURE__ */ L(Qe, {})
1024
+ /* @__PURE__ */ L(et, {}),
1025
+ /* @__PURE__ */ L(Qe, {}),
1026
+ /* @__PURE__ */ L($e, {})
1027
1027
  ] })
1028
1028
  })
1029
1029
  });
1030
1030
  }
1031
- function Xe(e) {
1031
+ function Ze(e) {
1032
1032
  let { view: t, lockSwitcherOnMobile: n } = Z();
1033
- return /* @__PURE__ */ L(qe, {
1033
+ return /* @__PURE__ */ L(Je, {
1034
1034
  view: t,
1035
1035
  lockSwitcherOnMobile: n,
1036
1036
  ...e
1037
1037
  });
1038
1038
  }
1039
- function Ze({ tableProps: e, cardsProps: t }) {
1039
+ function Qe({ tableProps: e, cardsProps: t }) {
1040
1040
  let { view: n, slots: r, renderCard: i, fallbackRole: a } = Z();
1041
- return n.view === "cards" ? /* @__PURE__ */ L(de, {
1041
+ return n.view === "cards" ? /* @__PURE__ */ L(fe, {
1042
1042
  view: n,
1043
1043
  slots: r,
1044
1044
  renderCard: i,
1045
1045
  fallbackRole: a,
1046
1046
  ...t
1047
- }) : /* @__PURE__ */ L(Ce, {
1047
+ }) : /* @__PURE__ */ L(we, {
1048
1048
  view: n,
1049
1049
  slots: r,
1050
1050
  ...e
1051
1051
  });
1052
1052
  }
1053
- function Qe(e) {
1053
+ function $e(e) {
1054
1054
  let { view: t } = Z();
1055
- return /* @__PURE__ */ L(me, {
1055
+ return /* @__PURE__ */ L(he, {
1056
1056
  view: t,
1057
1057
  ...e
1058
1058
  });
1059
1059
  }
1060
- function $e(e) {
1060
+ function et(e) {
1061
1061
  let { view: t, slots: n } = Z();
1062
1062
  return /* @__PURE__ */ L(q, {
1063
1063
  view: t,
@@ -1065,23 +1065,120 @@ function $e(e) {
1065
1065
  ...e
1066
1066
  });
1067
1067
  }
1068
- Q.Toolbar = Xe, Q.BulkActions = $e, Q.Body = Ze, Q.Pagination = Qe;
1068
+ Q.Toolbar = Ze, Q.BulkActions = et, Q.Body = Qe, Q.Pagination = $e;
1069
+ //#endregion
1070
+ //#region src/core/colBuilder.ts
1071
+ function tt(e) {
1072
+ return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase());
1073
+ }
1074
+ var nt = {
1075
+ text: {
1076
+ dataType: "text",
1077
+ filterVariant: "text"
1078
+ },
1079
+ number: {
1080
+ dataType: "number",
1081
+ filterVariant: "numberRange",
1082
+ align: "right"
1083
+ },
1084
+ currency: {
1085
+ dataType: "currency",
1086
+ filterVariant: "numberRange",
1087
+ align: "right"
1088
+ },
1089
+ date: {
1090
+ dataType: "date",
1091
+ filterVariant: "dateRange"
1092
+ },
1093
+ boolean: {
1094
+ dataType: "boolean",
1095
+ filterVariant: "boolean"
1096
+ },
1097
+ select: { filterVariant: "select" },
1098
+ multiselect: { filterVariant: "multiselect" }
1099
+ }, rt = class {
1100
+ cols = [];
1101
+ helper = o();
1102
+ add(e, t, n) {
1103
+ let r = nt[e];
1104
+ if (!r) throw Error(`Unknown preset: ${e}`);
1105
+ let i = n?.header ?? tt(t), a = n?.align ?? r.align, o;
1106
+ if (n?.filter === !1) o = void 0;
1107
+ else {
1108
+ let e = {
1109
+ variant: r.filterVariant,
1110
+ ...n?.options ? { options: n.options } : {}
1111
+ };
1112
+ o = n?.filter ? {
1113
+ ...e,
1114
+ ...n.filter
1115
+ } : e;
1116
+ }
1117
+ let s = this.helper.accessor(t, {
1118
+ header: i,
1119
+ ...n?.cell ? { cell: n.cell } : {},
1120
+ ...n?.enableSorting === !1 ? { enableSorting: !1 } : {},
1121
+ meta: {
1122
+ label: i,
1123
+ ...r.dataType ? { dataType: r.dataType } : {},
1124
+ ...a ? { align: a } : {},
1125
+ ...o ? { filter: o } : {},
1126
+ ...n?.format ? { format: n.format } : {},
1127
+ ...n?.card ? { card: {
1128
+ role: n.card,
1129
+ ...n.cardOrder == null ? {} : { order: n.cardOrder }
1130
+ } } : {}
1131
+ }
1132
+ });
1133
+ return this.cols.push(s), this;
1134
+ }
1135
+ text(e, t) {
1136
+ return this.add("text", e, t);
1137
+ }
1138
+ number(e, t) {
1139
+ return this.add("number", e, t);
1140
+ }
1141
+ currency(e, t) {
1142
+ return this.add("currency", e, t);
1143
+ }
1144
+ date(e, t) {
1145
+ return this.add("date", e, t);
1146
+ }
1147
+ boolean(e, t) {
1148
+ return this.add("boolean", e, t);
1149
+ }
1150
+ select(e, t) {
1151
+ return this.add("select", e, t);
1152
+ }
1153
+ multiselect(e, t) {
1154
+ return this.add("multiselect", e, t);
1155
+ }
1156
+ custom(e) {
1157
+ return this.cols.push(e), this;
1158
+ }
1159
+ build() {
1160
+ return this.cols;
1161
+ }
1162
+ };
1163
+ function it() {
1164
+ return new rt();
1165
+ }
1069
1166
  //#endregion
1070
1167
  //#region src/core/exportCsv.ts
1071
- function et(e) {
1168
+ function at(e) {
1072
1169
  let t = e == null ? "" : String(e);
1073
1170
  return t.includes(",") || t.includes("\"") || t.includes("\n") ? `"${t.replace(/"/g, "\"\"")}"` : t;
1074
1171
  }
1075
- function tt(e, t) {
1076
- let { filename: n = "export.csv", separator: r = ",", formatted: i = !1, formatDefaults: a } = t ?? {}, o = e.getVisibleLeafColumns().filter((e) => e.id !== "_select"), s = [o.map((e) => et(J(e))), ...e.getRowModel().rows.map((e) => o.map((t) => {
1172
+ function ot(e, t) {
1173
+ let { filename: n = "export.csv", separator: r = ",", formatted: i = !1, formatDefaults: a } = t ?? {}, o = e.getVisibleLeafColumns().filter((e) => e.id !== "_select"), s = [o.map((e) => at(J(e))), ...e.getRowModel().rows.map((e) => o.map((t) => {
1077
1174
  let n = e.getAllCells().find((e) => e.column.id === t.id)?.getValue();
1078
- return i && t.columnDef.meta?.dataType ? et(Me(t.columnDef.meta.dataType, t.columnDef.meta.format, a)(n)) : et(n);
1175
+ return i && t.columnDef.meta?.dataType ? at(Ne(t.columnDef.meta.dataType, t.columnDef.meta.format, a)(n)) : at(n);
1079
1176
  }))].map((e) => e.join(r)).join("\n"), c = new Blob([s], { type: "text/csv;charset=utf-8;" }), l = URL.createObjectURL(c), u = document.createElement("a");
1080
1177
  u.href = l, u.download = n, u.click(), URL.revokeObjectURL(l);
1081
1178
  }
1082
1179
  //#endregion
1083
1180
  //#region src/url/useUrlSync.ts
1084
- function nt(e) {
1181
+ function st(e) {
1085
1182
  return e ? {
1086
1183
  adapter: e.adapter,
1087
1184
  serializer: {
@@ -1091,7 +1188,7 @@ function nt(e) {
1091
1188
  include: r(e.include)
1092
1189
  } : null;
1093
1190
  }
1094
- function rt(e, t, r) {
1191
+ function ct(e, t, r) {
1095
1192
  if (!e) return {};
1096
1193
  try {
1097
1194
  return n(e.adapter.read(), {
@@ -1104,21 +1201,21 @@ function rt(e, t, r) {
1104
1201
  return {};
1105
1202
  }
1106
1203
  }
1107
- function it({ config: r, state: i, applyPatch: a, getFilterMeta: o }) {
1108
- let s = H(i);
1204
+ function lt({ config: r, state: i, applyPatch: a, getFilterMeta: o }) {
1205
+ let s = U(i);
1109
1206
  s.current = i;
1110
- let c = H(a);
1207
+ let c = U(a);
1111
1208
  c.current = a;
1112
- let l = H(o);
1209
+ let l = U(o);
1113
1210
  l.current = o;
1114
- let u = H(r);
1211
+ let u = U(r);
1115
1212
  u.current = r;
1116
1213
  let d = r ? t(i, {
1117
1214
  serializer: r.serializer,
1118
1215
  include: r.include,
1119
1216
  getFilterMeta: o
1120
1217
  }) : null;
1121
- B(() => {
1218
+ V(() => {
1122
1219
  let t = u.current;
1123
1220
  if (!t || !d) return;
1124
1221
  let n = e(t.adapter.read(), t.serializer, t.include);
@@ -1126,7 +1223,7 @@ function it({ config: r, state: i, applyPatch: a, getFilterMeta: o }) {
1126
1223
  ...n,
1127
1224
  ...d
1128
1225
  }, { replace: !0 });
1129
- }, [d ? JSON.stringify(d) : ""]), B(() => {
1226
+ }, [d ? JSON.stringify(d) : ""]), V(() => {
1130
1227
  if (!r) return;
1131
1228
  let { adapter: e, serializer: t, include: i } = r;
1132
1229
  return e.subscribe?.(() => {
@@ -1142,24 +1239,24 @@ function it({ config: r, state: i, applyPatch: a, getFilterMeta: o }) {
1142
1239
  }
1143
1240
  //#endregion
1144
1241
  //#region src/core/resolveStatus.ts
1145
- function at(e) {
1242
+ function ut(e) {
1146
1243
  return e.columnFilters.length > 0 || e.globalFilter.trim() !== "";
1147
1244
  }
1148
- function ot({ status: e, error: t, pageRowCount: n, state: r }) {
1245
+ function dt({ status: e, error: t, pageRowCount: n, state: r }) {
1149
1246
  return e === "error" ? {
1150
1247
  phase: "error",
1151
1248
  error: t
1152
- } : e === "loading" || e === "idle" ? { phase: "loading" } : n === 0 ? at(r) ? { phase: "empty-filtered" } : { phase: "empty" } : { phase: "ready" };
1249
+ } : e === "loading" || e === "idle" ? { phase: "loading" } : n === 0 ? ut(r) ? { phase: "empty-filtered" } : { phase: "empty" } : { phase: "ready" };
1153
1250
  }
1154
1251
  //#endregion
1155
1252
  //#region src/core/useDataView.ts
1156
- var $ = 300, st = [
1253
+ var $ = 300, ft = [
1157
1254
  10,
1158
1255
  25,
1159
1256
  50,
1160
1257
  100
1161
- ], ct = 10;
1162
- function lt(e) {
1258
+ ], pt = 10;
1259
+ function mt(e) {
1163
1260
  return e == null ? {
1164
1261
  globalFilter: $,
1165
1262
  columnFilters: $
@@ -1171,23 +1268,23 @@ function lt(e) {
1171
1268
  columnFilters: e.columnFilters ?? $
1172
1269
  };
1173
1270
  }
1174
- function ut(e) {
1271
+ function ht(e) {
1175
1272
  if (e.id) return e.id;
1176
1273
  if ("accessorKey" in e && e.accessorKey != null) return String(e.accessorKey);
1177
1274
  }
1178
- function dt(e) {
1275
+ function gt(e) {
1179
1276
  let t = /* @__PURE__ */ new Map();
1180
1277
  for (let n of e) {
1181
- let e = ut(n), r = n.meta?.filter;
1278
+ let e = ht(n), r = n.meta?.filter;
1182
1279
  e && r && t.set(e, r);
1183
1280
  }
1184
1281
  return (e) => t.get(e);
1185
1282
  }
1186
- function ft(e) {
1283
+ function _t(e) {
1187
1284
  return {
1188
1285
  pagination: {
1189
1286
  pageIndex: 0,
1190
- pageSize: e.pageSizeOptions?.[0] ?? ct
1287
+ pageSize: e.pageSizeOptions?.[0] ?? pt
1191
1288
  },
1192
1289
  sorting: [],
1193
1290
  columnFilters: [],
@@ -1202,28 +1299,28 @@ function ft(e) {
1202
1299
  ...e.initialState
1203
1300
  };
1204
1301
  }
1205
- function pt(e) {
1206
- let { columns: t, rows: n, rowCount: r, status: i, error: a, getRowId: o, onRequestChange: u, state: d, onStateChange: f, enableRowSelection: p, enableGlobalFilter: m = !0, debounce: h, responsive: g, formatDefaults: _, facets: ee } = e, te = ee ?? {}, v = V(() => t.map((e) => {
1302
+ function vt(e) {
1303
+ let { columns: t, rows: n, rowCount: r, status: i, error: a, getRowId: o, onRequestChange: s, state: d, onStateChange: f, enableRowSelection: p, enableGlobalFilter: m = !0, debounce: h, responsive: g, formatDefaults: _, facets: v } = e, ee = v ?? {}, y = H(() => t.map((e) => {
1207
1304
  let t = e.meta?.dataType;
1208
1305
  if (!t || e.cell) return e;
1209
- let n = Me(t, e.meta?.format, _);
1306
+ let n = Ne(t, e.meta?.format, _);
1210
1307
  return {
1211
1308
  ...e,
1212
1309
  cell: (e) => n(e.getValue())
1213
1310
  };
1214
- }), [t, _]), y = V(() => dt(v), [v]), b = V(() => nt(e.urlSync), [e.urlSync]), [x, S] = U(() => {
1215
- let t = ft(e);
1311
+ }), [t, _]), b = H(() => gt(y), [y]), x = H(() => st(e.urlSync), [e.urlSync]), [S, te] = W(() => {
1312
+ let t = _t(e);
1216
1313
  return {
1217
1314
  ...t,
1218
- ...rt(b, t, y)
1315
+ ...ct(x, t, b)
1219
1316
  };
1220
- }), C = V(() => ({
1221
- ...x,
1317
+ }), C = H(() => ({
1318
+ ...S,
1222
1319
  ...d
1223
- }), [x, d]), w = H(C);
1320
+ }), [S, d]), w = U(C);
1224
1321
  w.current = C;
1225
1322
  let T = z((e) => {
1226
- S((t) => ({
1323
+ te((t) => ({
1227
1324
  ...t,
1228
1325
  ...e
1229
1326
  })), f?.({
@@ -1231,42 +1328,42 @@ function pt(e) {
1231
1328
  ...e
1232
1329
  });
1233
1330
  }, [f]);
1234
- it({
1235
- config: b,
1331
+ lt({
1332
+ config: x,
1236
1333
  state: C,
1237
1334
  applyPatch: T,
1238
- getFilterMeta: y
1335
+ getFilterMeta: b
1239
1336
  });
1240
1337
  let E = z(() => ({
1241
1338
  ...w.current.pagination,
1242
1339
  pageIndex: 0
1243
- }), []), D = z((e) => {
1244
- T({ pagination: s(e, w.current.pagination) });
1245
- }, [T]), O = z((e) => {
1340
+ }), []), ne = z((e) => {
1341
+ T({ pagination: c(e, w.current.pagination) });
1342
+ }, [T]), D = z((e) => {
1246
1343
  T({
1247
- sorting: s(e, w.current.sorting),
1344
+ sorting: c(e, w.current.sorting),
1248
1345
  pagination: E()
1249
1346
  });
1250
- }, [T, E]), ne = z((e) => {
1347
+ }, [T, E]), O = z((e) => {
1251
1348
  T({
1252
- columnFilters: s(e, w.current.columnFilters),
1349
+ columnFilters: c(e, w.current.columnFilters),
1253
1350
  pagination: E()
1254
1351
  });
1255
- }, [T, E]), k = z((e) => {
1352
+ }, [T, E]), re = z((e) => {
1256
1353
  T({
1257
- globalFilter: s(e, w.current.globalFilter),
1354
+ globalFilter: c(e, w.current.globalFilter),
1258
1355
  pagination: E()
1259
1356
  });
1260
- }, [T, E]), A = z((e) => {
1261
- T({ rowSelection: s(e, w.current.rowSelection) });
1357
+ }, [T, E]), k = z((e) => {
1358
+ T({ rowSelection: c(e, w.current.rowSelection) });
1359
+ }, [T]), A = z((e) => {
1360
+ T({ columnVisibility: c(e, w.current.columnVisibility) });
1262
1361
  }, [T]), j = z((e) => {
1263
- T({ columnVisibility: s(e, w.current.columnVisibility) });
1264
- }, [T]), M = z((e) => {
1265
- T({ columnPinning: s(e, w.current.columnPinning) });
1266
- }, [T]), N = l({
1362
+ T({ columnPinning: c(e, w.current.columnPinning) });
1363
+ }, [T]), M = u({
1267
1364
  data: n,
1268
- columns: v,
1269
- getCoreRowModel: c(),
1365
+ columns: y,
1366
+ getCoreRowModel: l(),
1270
1367
  manualPagination: !0,
1271
1368
  manualSorting: !0,
1272
1369
  manualFiltering: !0,
@@ -1284,14 +1381,14 @@ function pt(e) {
1284
1381
  columnVisibility: C.columnVisibility,
1285
1382
  columnPinning: C.columnPinning
1286
1383
  },
1287
- onPaginationChange: D,
1288
- onSortingChange: O,
1289
- onColumnFiltersChange: ne,
1290
- onGlobalFilterChange: k,
1291
- onRowSelectionChange: A,
1292
- onColumnVisibilityChange: j,
1293
- onColumnPinningChange: M
1294
- }), P = V(() => ({
1384
+ onPaginationChange: ne,
1385
+ onSortingChange: D,
1386
+ onColumnFiltersChange: O,
1387
+ onGlobalFilterChange: re,
1388
+ onRowSelectionChange: k,
1389
+ onColumnVisibilityChange: A,
1390
+ onColumnPinningChange: j
1391
+ }), N = H(() => ({
1295
1392
  pagination: C.pagination,
1296
1393
  sorting: C.sorting,
1297
1394
  filters: C.columnFilters,
@@ -1301,24 +1398,24 @@ function pt(e) {
1301
1398
  C.sorting,
1302
1399
  C.columnFilters,
1303
1400
  C.globalFilter
1304
- ]), F = H(u);
1305
- F.current = u;
1306
- let I = H(lt(h));
1307
- I.current = lt(h);
1308
- let L = H(null), R = H(void 0);
1309
- B(() => {
1310
- let e = L.current, t = e === null, n = !e || e.globalFilter !== P.globalFilter, r = !e || e.filters !== P.filters, i = () => {
1311
- L.current = P, F.current?.(P);
1401
+ ]), P = U(s);
1402
+ P.current = s;
1403
+ let F = U(mt(h));
1404
+ F.current = mt(h);
1405
+ let I = U(null), L = U(void 0);
1406
+ V(() => {
1407
+ let e = I.current, t = e === null, n = !e || e.globalFilter !== N.globalFilter, r = !e || e.filters !== N.filters, i = () => {
1408
+ I.current = N, P.current?.(N);
1312
1409
  }, a = 0;
1313
- n && (a = Math.max(a, I.current.globalFilter)), r && (a = Math.max(a, I.current.columnFilters));
1410
+ n && (a = Math.max(a, F.current.globalFilter)), r && (a = Math.max(a, F.current.columnFilters));
1314
1411
  let o = !t && (n || r) && a > 0;
1315
- return clearTimeout(R.current), o ? R.current = setTimeout(i, a) : i(), () => clearTimeout(R.current);
1316
- }, [P]);
1317
- let re = H(P);
1318
- re.current = P;
1412
+ return clearTimeout(L.current), o ? L.current = setTimeout(i, a) : i(), () => clearTimeout(L.current);
1413
+ }, [N]);
1414
+ let R = U(N);
1415
+ R.current = N;
1319
1416
  let ie = z(() => {
1320
- F.current?.(re.current);
1321
- }, []), ae = V(() => ot({
1417
+ P.current?.(R.current);
1418
+ }, []), ae = H(() => dt({
1322
1419
  status: i,
1323
1420
  error: a,
1324
1421
  pageRowCount: n.length,
@@ -1328,68 +1425,73 @@ function pt(e) {
1328
1425
  a,
1329
1426
  n.length,
1330
1427
  C
1331
- ]), W = ke(g), G = W ? "cards" : C.view, K = z((e) => T({ view: e }), [T]), q = e.pageSizeOptions ?? st, J = N.getAllColumns(), oe = J.filter((e) => e.getCanSort()), Y = J.filter((e) => e.columnDef.meta?.filter != null), se = z(() => T({ rowSelection: {} }), [T]);
1428
+ ]), B = Ae(g), oe = B ? "cards" : C.view, G = z((e) => T({ view: e }), [T]), K = e.pageSizeOptions ?? ft, q = M.getAllColumns(), J = q.filter((e) => e.getCanSort()), se = q.filter((e) => e.columnDef.meta?.filter != null), Y = z(() => T({ rowSelection: {} }), [T]);
1332
1429
  return {
1333
- table: N,
1334
- request: P,
1430
+ table: M,
1431
+ request: N,
1335
1432
  state: C,
1336
- view: G,
1337
- setView: K,
1338
- isMobileForced: W,
1433
+ view: oe,
1434
+ setView: G,
1435
+ isMobileForced: B,
1339
1436
  status: i,
1340
1437
  error: a,
1341
1438
  renderStatus: ae,
1342
1439
  refetch: ie,
1343
- pageSizeOptions: q,
1344
- sortableColumns: oe,
1345
- filterableColumns: Y,
1346
- selection: V(() => {
1440
+ pageSizeOptions: K,
1441
+ sortableColumns: J,
1442
+ filterableColumns: se,
1443
+ selection: H(() => {
1347
1444
  let e = C.rowSelection, t = Object.keys(e).filter((t) => e[t]), r = n.filter((t) => e[o(t)] === !0);
1348
1445
  return {
1349
1446
  count: t.length,
1350
1447
  ids: t,
1351
1448
  rows: r,
1352
- clear: se
1449
+ clear: Y
1353
1450
  };
1354
1451
  }, [
1355
1452
  C.rowSelection,
1356
1453
  n,
1357
1454
  o,
1358
- se
1455
+ Y
1359
1456
  ]),
1360
- exportCsv: z((e) => tt(N, e), [N]),
1361
- facets: te
1457
+ exportCsv: z((e) => ot(M, e), [M]),
1458
+ facets: ee,
1459
+ resetFilter: z((e) => M.getColumn(e)?.setFilterValue(void 0), [M]),
1460
+ resetAllFilters: z(() => M.resetColumnFilters(), [M])
1362
1461
  };
1363
1462
  }
1364
1463
  //#endregion
1365
1464
  //#region src/core/useDataViewFetcher.ts
1366
- function mt({ fetcher: e, ...t }) {
1367
- let [n, r] = U({
1465
+ function yt({ fetcher: e, deps: t, ...n }) {
1466
+ let [r, i] = W({
1368
1467
  rows: [],
1369
1468
  rowCount: 0
1370
- }), [i, a] = U("idle"), [o, s] = U(void 0), c = H(e);
1371
- c.current = e;
1372
- let l = H(0), u = z(async (e) => {
1373
- let t = ++l.current;
1374
- a("loading");
1469
+ }), [a, o] = W("idle"), [s, c] = W(void 0), l = U(e);
1470
+ l.current = e;
1471
+ let u = U(0), d = U(null), f = z(async (e) => {
1472
+ d.current = e;
1473
+ let t = ++u.current;
1474
+ o("loading");
1375
1475
  try {
1376
- let n = await c.current(e);
1377
- t === l.current && (r(n), s(void 0), a("success"));
1476
+ let n = await l.current(e);
1477
+ t === u.current && (i(n), c(void 0), o("success"));
1378
1478
  } catch (e) {
1379
- t === l.current && (s(e), a("error"));
1479
+ t === u.current && (c(e), o("error"));
1380
1480
  }
1381
- }, []);
1382
- return pt({
1383
- ...t,
1384
- rows: n.rows,
1385
- rowCount: n.rowCount,
1386
- facets: n.facets,
1387
- status: i,
1388
- error: o,
1389
- onRequestChange: u
1481
+ }, []), p = t ? JSON.stringify(t) : "", m = U(p);
1482
+ return V(() => {
1483
+ m.current !== p && (m.current = p, d.current && f(d.current));
1484
+ }), vt({
1485
+ ...n,
1486
+ rows: r.rows,
1487
+ rowCount: r.rowCount,
1488
+ facets: r.facets,
1489
+ status: a,
1490
+ error: s,
1491
+ onRequestChange: f
1390
1492
  });
1391
1493
  }
1392
1494
  //#endregion
1393
- export { q as DataBulkActions, de as DataCards, me as DataPagination, Ce as DataTable, qe as DataToolbar, Q as DataView, Re as FilterControl, Y as composeCardLayout, a as createColumnHelper, tt as exportCsv, J as resolveColumnLabel, pt as useDataView, Z as useDataViewContext, mt as useDataViewFetcher };
1495
+ export { rt as ColumnBuilder, q as DataBulkActions, fe as DataCards, he as DataPagination, we as DataTable, Je as DataToolbar, Q as DataView, ze as FilterControl, it as col, Y as composeCardLayout, a as createColumnHelper, ot as exportCsv, J as resolveColumnLabel, vt as useDataView, Z as useDataViewContext, yt as useDataViewFetcher };
1394
1496
 
1395
1497
  //# sourceMappingURL=index.js.map