@cryptlex/web-components 5.0.0 → 5.1.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.
Files changed (41) hide show
  1. package/dist/components/data-table/data-table-filter.es.js +46 -44
  2. package/dist/components/data-table/data-table-filter.es.js.map +1 -1
  3. package/dist/components/data-table/data-table.es.js +160 -159
  4. package/dist/components/data-table/data-table.es.js.map +1 -1
  5. package/dist/components/data-table/table-commons.es.js +51 -217
  6. package/dist/components/data-table/table-commons.es.js.map +1 -1
  7. package/dist/components/inputs/date-picker.es.js +61 -41
  8. package/dist/components/inputs/date-picker.es.js.map +1 -1
  9. package/dist/components/inputs/datefield.es.js +9 -9
  10. package/dist/components/inputs/datefield.es.js.map +1 -1
  11. package/dist/components/inputs/field.es.js +36 -35
  12. package/dist/components/inputs/field.es.js.map +1 -1
  13. package/dist/components/inputs/id-search.es.js +36 -33
  14. package/dist/components/inputs/id-search.es.js.map +1 -1
  15. package/dist/components/inputs/multi-select.es.js +32 -39
  16. package/dist/components/inputs/multi-select.es.js.map +1 -1
  17. package/dist/components/inputs/{country-select.es.js → select-options.es.js} +26 -24
  18. package/dist/components/inputs/select-options.es.js.map +1 -0
  19. package/dist/components/inputs/select.es.js +46 -45
  20. package/dist/components/inputs/select.es.js.map +1 -1
  21. package/dist/components/ui/button.es.js +22 -24
  22. package/dist/components/ui/button.es.js.map +1 -1
  23. package/dist/components/ui/menu.es.js +44 -43
  24. package/dist/components/ui/menu.es.js.map +1 -1
  25. package/dist/components/ui/popover.es.js +1 -1
  26. package/dist/components/ui/popover.es.js.map +1 -1
  27. package/dist/index.es.d.ts +44 -54
  28. package/dist/index.es.js +206 -207
  29. package/dist/node_modules/.pnpm/@internationalized_date@3.8.2/node_modules/@internationalized/date/dist/CalendarDate.es.js +13 -13
  30. package/dist/node_modules/.pnpm/@internationalized_date@3.8.2/node_modules/@internationalized/date/dist/conversion.es.js +5 -5
  31. package/dist/node_modules/.pnpm/@internationalized_date@3.8.2/node_modules/@internationalized/date/dist/string.es.js +48 -39
  32. package/dist/node_modules/.pnpm/@internationalized_date@3.8.2/node_modules/@internationalized/date/dist/string.es.js.map +1 -1
  33. package/dist/utils/form-hook.es.js +10 -14
  34. package/dist/utils/form-hook.es.js.map +1 -1
  35. package/dist/utils/primitives.es.js.map +1 -1
  36. package/dist/utils/resource-names.es.js +182 -0
  37. package/dist/utils/resource-names.es.js.map +1 -0
  38. package/package.json +1 -1
  39. package/dist/components/inputs/country-select.es.js.map +0 -1
  40. package/dist/components/inputs/license-type-select.es.js +0 -31
  41. package/dist/components/inputs/license-type-select.es.js.map +0 -1
@@ -1,25 +1,26 @@
1
1
  "use client";
2
- import { jsx as e, Fragment as w, jsxs as s } from "react/jsx-runtime";
3
- import { useQuery as ie, keepPreviousData as oe } from "@tanstack/react-query";
4
- import { createColumnHelper as le, useReactTable as se, getCoreRowModel as ce, flexRender as M } from "@tanstack/react-table";
5
- import { Info as de, RotateCw as ue, Columns3 as me, GripVertical as ge, ChevronFirst as fe, ChevronLeft as pe, ChevronRight as he, ChevronLast as be, ArrowDownNarrowWide as Se, ArrowDownWideNarrow as Ce, ArrowUpDown as ye } from "lucide-react";
6
- import { createContext as ve, useId as xe, useState as v, useMemo as O, useEffect as K, useContext as we } from "react";
7
- import { sortableKeyboardCoordinates as Ne, SortableContext as Te, verticalListSortingStrategy as De, arrayMove as Pe, useSortable as Ae } from "@dnd-kit/sortable";
8
- import { DataTableFilter as Ie } from "./data-table-filter.es.js";
9
- import { EasyMenu as X, MenuItem as F } from "../ui/menu.es.js";
10
- import { Table as ze, TableHeader as Me, TableRow as Q, TableHead as Oe, TableBody as Fe, TableCell as Le } from "../ui/table.es.js";
11
- import { useSensors as Re, useSensor as $, PointerSensor as ke, KeyboardSensor as Ee, DndContext as _e, closestCenter as Ve, DragOverlay as He } from "@dnd-kit/core";
2
+ import { jsx as e, Fragment as N, jsxs as s } from "react/jsx-runtime";
3
+ import { useQuery as re, keepPreviousData as oe } from "@tanstack/react-query";
4
+ import { createColumnHelper as ie, useReactTable as le, getCoreRowModel as se, flexRender as F } from "@tanstack/react-table";
5
+ import { Info as ce, RotateCw as de, Columns3 as ue, GripVertical as me, ChevronFirst as ge, ChevronLeft as fe, ChevronRight as pe, ChevronLast as he, ArrowDownNarrowWide as be, ArrowDownWideNarrow as Se, ArrowUpDown as Ce } from "lucide-react";
6
+ import { createContext as ye, useId as ve, useState as x, useMemo as O, useEffect as Q, useContext as xe } from "react";
7
+ import { sortableKeyboardCoordinates as we, SortableContext as Ne, verticalListSortingStrategy as Te, arrayMove as De, useSortable as Pe } from "@dnd-kit/sortable";
8
+ import { DataTableFilter as Ae } from "./data-table-filter.es.js";
9
+ import { EasyMenu as X, MenuItem as L } from "../ui/menu.es.js";
10
+ import { Table as Ie, TableHeader as ze, TableRow as $, TableHead as Me, TableBody as Fe, TableCell as Oe } from "../ui/table.es.js";
11
+ import { useResourceFormatter as Le } from "../../utils/resource-names.es.js";
12
+ import { useSensors as Re, useSensor as W, PointerSensor as ke, KeyboardSensor as Ee, DndContext as _e, closestCenter as Ve, DragOverlay as He } from "@dnd-kit/core";
12
13
  import { CSS as Ue } from "@dnd-kit/utilities";
13
14
  import { merge as je } from "lodash-es";
14
- import { TABLE_CHECK_BOX_COLUMN as qe, TABLE_ID_COLUMN as Be, TABLE_DEFAULT_DATE_COLUMNS as Ke, getResourceDisplayName as W } from "./table-commons.es.js";
15
- import { Loader as Qe } from "../ui/loader.es.js";
16
- import { SearchField as $e } from "../inputs/searchfield.es.js";
17
- import { cn as x } from "../../utils/primitives.es.js";
18
- import { Button as b } from "../ui/button.es.js";
19
- const L = "tableActions";
20
- function bt({ columns: t, fetchFn: i, columnsToHideByDefault: o = {}, allowSelection: r = !1, filterConfig: a }) {
21
- var V, H, U;
22
- const u = xe(), [l, c] = v({
15
+ import { TABLE_CHECK_BOX_COLUMN as qe, TABLE_ID_COLUMN as Be, TABLE_DEFAULT_DATE_COLUMNS as Ke } from "./table-commons.es.js";
16
+ import { SearchField as Qe } from "../inputs/searchfield.es.js";
17
+ import { cn as w } from "../../utils/primitives.es.js";
18
+ import { Loader as $e } from "../ui/loader.es.js";
19
+ import { Button as S } from "../ui/button.es.js";
20
+ const R = "tableActions";
21
+ function St({ columns: t, fetchFn: o, columnsToHideByDefault: i = {}, allowSelection: r = !1, filterConfig: a }) {
22
+ var H, U, j;
23
+ const d = ve(), [C, l] = x({
23
24
  /** TODO Reflect in URL */
24
25
  pagination: { pageIndex: 0, pageSize: 20 },
25
26
  // Pagination state
@@ -28,72 +29,72 @@ function bt({ columns: t, fetchFn: i, columnsToHideByDefault: o = {}, allowSelec
28
29
  /** Ephemeral */
29
30
  rowSelection: {}
30
31
  // Row selection state
31
- }), [d, h] = v(""), [S, C] = v([]), [T, J] = v({
32
+ }), [c, m] = x(""), [f, y] = x([]), [b, z] = x({
32
33
  id: !1,
33
34
  updatedAt: !1,
34
- ...o
35
- }), [z, ee] = v([]), R = O(() => z.reduce((n, f) => je(n, f), {}), [z]), P = (n) => {
36
- c((f) => ({ ...f, ...n }));
35
+ ...i
36
+ }), [M, J] = x([]), k = O(() => M.reduce((n, p) => je(n, p), {}), [M]), P = (n) => {
37
+ l((p) => ({ ...p, ...n }));
37
38
  }, {
38
39
  sorting: A,
39
- rowSelection: k,
40
+ rowSelection: E,
40
41
  pagination: I
41
- } = l, y = ie({
42
- queryKey: [u, I, A, d],
43
- queryFn: () => i(I, A, d, R),
42
+ } = C, v = re({
43
+ queryKey: [d, I, A, c],
44
+ queryFn: () => o(I, A, c, k),
44
45
  placeholderData: oe,
45
46
  // Keep previous data while loading new data
46
47
  retry: 0,
47
48
  refetchOnWindowFocus: !1
48
49
  });
49
- K(() => {
50
- }, [T]);
51
- const te = O(() => le(), []), E = O(() => {
52
- var q;
53
- const n = (q = y.data) == null ? void 0 : q.data;
50
+ Q(() => {
51
+ }, [b]);
52
+ const ee = O(() => ie(), []), _ = O(() => {
53
+ var B;
54
+ const n = (B = v.data) == null ? void 0 : B.data;
54
55
  if (!(n != null && n.length)) return [];
55
- const f = (m) => m != null && typeof m == "object" && "metadata" in m && Array.isArray(m.metadata), j = n.filter(
56
- f
56
+ const p = (u) => u != null && typeof u == "object" && "metadata" in u && Array.isArray(u.metadata), q = n.filter(
57
+ p
57
58
  );
58
- return j.length === 0 ? [] : Array.from(new Set(j.flatMap((m) => {
59
+ return q.length === 0 ? [] : Array.from(new Set(q.flatMap((u) => {
59
60
  var g;
60
- return ((g = m.metadata) == null ? void 0 : g.map((p) => p.key)) ?? [];
61
- }))).map((m) => te.accessor(
61
+ return ((g = u.metadata) == null ? void 0 : g.map((h) => h.key)) ?? [];
62
+ }))).map((u) => ee.accessor(
62
63
  (g) => {
63
- var p, B;
64
- return f(g) ? ((B = (p = g == null ? void 0 : g.metadata) == null ? void 0 : p.find((re) => re.key === m)) == null ? void 0 : B.value) ?? "" : "";
64
+ var h, K;
65
+ return p(g) ? ((K = (h = g == null ? void 0 : g.metadata) == null ? void 0 : h.find((ae) => ae.key === u)) == null ? void 0 : K.value) ?? "" : "";
65
66
  },
66
67
  {
67
- id: m,
68
- header: m,
68
+ id: u,
69
+ header: u,
69
70
  // tooltip header
70
71
  enableSorting: !1,
71
72
  cell: (g) => {
72
- const p = g.getValue();
73
- return p == null ? "" : String(p);
73
+ const h = g.getValue();
74
+ return h == null ? "" : String(h);
74
75
  }
75
76
  }
76
77
  ));
77
- }, [(V = y.data) == null ? void 0 : V.data]), ne = [
78
+ }, [(H = v.data) == null ? void 0 : H.data]), te = [
78
79
  ...r ? qe : [],
79
80
  ...Be,
80
- ...t.filter((n) => n.id !== L),
81
- ...E.length ? E : [],
81
+ ...t.filter((n) => n.id !== R),
82
+ ..._.length ? _ : [],
82
83
  ...Ke,
83
84
  // Actions column
84
- ...t.filter((n) => n.id === L)
85
+ ...t.filter((n) => n.id === R)
85
86
  ];
86
- function ae(n) {
87
+ function ne(n) {
87
88
  return typeof n == "function";
88
89
  }
89
- function D(n, f) {
90
- return ae(n) ? n(f) : n;
90
+ function D(n, p) {
91
+ return ne(n) ? n(p) : n;
91
92
  }
92
- const _ = se({
93
- data: ((H = y.data) == null ? void 0 : H.data) ?? [],
94
- columns: ne,
95
- getCoreRowModel: ce(),
96
- rowCount: (U = y.data) == null ? void 0 : U.total,
93
+ const V = le({
94
+ data: ((U = v.data) == null ? void 0 : U.data) ?? [],
95
+ columns: te,
96
+ getCoreRowModel: se(),
97
+ rowCount: (j = v.data) == null ? void 0 : j.total,
97
98
  manualPagination: !0,
98
99
  // Handle pagination manually since pagination is done server side for data tables
99
100
  onPaginationChange: (n) => {
@@ -107,55 +108,55 @@ function bt({ columns: t, fetchFn: i, columnsToHideByDefault: o = {}, allowSelec
107
108
  manualFiltering: !0,
108
109
  // Handle filtering manually since filtering is done server side for data tables
109
110
  onColumnVisibilityChange: (n) => {
110
- J(D(n, T));
111
+ z(D(n, b));
111
112
  },
112
113
  onRowSelectionChange: (n) => {
113
- P({ rowSelection: D(n, k) });
114
+ P({ rowSelection: D(n, E) });
114
115
  },
115
116
  onColumnOrderChange: (n) => {
116
- C(D(n, S));
117
+ y(D(n, f));
117
118
  },
118
119
  state: {
119
120
  sorting: A,
120
- columnVisibility: T,
121
+ columnVisibility: b,
121
122
  pagination: I,
122
- rowSelection: k,
123
- columnOrder: S
123
+ rowSelection: E,
124
+ columnOrder: f
124
125
  },
125
126
  meta: {
126
- refetch: y.refetch
127
+ refetch: v.refetch
127
128
  }
128
129
  });
129
- return K(() => {
130
- C([..._.getAllLeafColumns().map((n) => n.id)]);
131
- }, []), { tableState: l, updateTableState: P, query: y, setSearchQuery: h, searchQuery: d, tanTable: _, mergedFilters: R, filters: z, setFilters: ee, filterConfig: a };
130
+ return Q(() => {
131
+ y([...V.getAllLeafColumns().map((n) => n.id)]);
132
+ }, []), { tableState: C, updateTableState: P, query: v, setSearchQuery: m, searchQuery: c, tanTable: V, mergedFilters: k, filters: M, setFilters: J, filterConfig: a };
132
133
  }
133
- const Y = ve(null), N = () => {
134
- const t = we(Y);
134
+ const Y = ye(null), T = () => {
135
+ const t = xe(Y);
135
136
  if (!t)
136
137
  throw Error("DataTable should be used within DataTableProvider.");
137
138
  return t;
138
139
  };
139
- function St({ children: t, ...i }) {
140
- return /* @__PURE__ */ e(Y.Provider, { value: i, children: t });
140
+ function Ct({ children: t, ...o }) {
141
+ return /* @__PURE__ */ e(Y.Provider, { value: o, children: t });
141
142
  }
142
- function Ct({
143
+ function yt({
143
144
  tableActions: t,
144
- className: i,
145
- ...o
145
+ className: o,
146
+ ...i
146
147
  // filterableFields,
147
148
  }) {
148
- var u;
149
- const { query: r, tanTable: a } = N();
150
- return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ s("section", { ...o, className: x("flex flex-col bg-card", i), children: [
149
+ var d;
150
+ const { query: r, tanTable: a } = T();
151
+ return /* @__PURE__ */ e(N, { children: /* @__PURE__ */ s("section", { ...i, className: w("flex flex-col bg-card", o), children: [
151
152
  /* @__PURE__ */ e(Ye, { tableActions: t }),
152
153
  /* @__PURE__ */ s("div", { className: "w-full overflow-auto border-x grow min-h-table relative", tabIndex: 0, children: [
153
- r.isLoading && /* @__PURE__ */ e(G, { className: "cursor-wait", children: /* @__PURE__ */ e(Qe, {}) }),
154
+ r.isLoading && /* @__PURE__ */ e(G, { className: "cursor-wait", children: /* @__PURE__ */ e($e, {}) }),
154
155
  !r.isLoading && a.getRowModel().rows.length === 0 && // Empty table
155
156
  /* @__PURE__ */ e(G, { className: "cursor-not-allowed", children: !r.isFetching && (r.isError ? /* @__PURE__ */ s("span", { className: "flex gap-3 justify-center items-center", children: [
156
- /* @__PURE__ */ e(de, {}),
157
+ /* @__PURE__ */ e(ce, {}),
157
158
  /* @__PURE__ */ e("span", { children: "You don't have the required permissions. Please contact your admin." })
158
- ] }) : (u = r.data) != null && u.data ? /* @__PURE__ */ e(w, { children: "Unknown error. Please contact customer support." }) : /* @__PURE__ */ e(w, { children: "No results found." })) }),
159
+ ] }) : (d = r.data) != null && d.data ? /* @__PURE__ */ e(N, { children: "Unknown error. Please contact customer support." }) : /* @__PURE__ */ e(N, { children: "No results found." })) }),
159
160
  !r.isLoading && a.getRowModel().rows.length !== 0 && /* @__PURE__ */ e(Ze, { className: "size-full" })
160
161
  ] }),
161
162
  /* @__PURE__ */ s("div", { className: "flex w-full justify-between border gap-icon p-icon overflow-x-auto", children: [
@@ -169,14 +170,14 @@ function Ct({
169
170
  }
170
171
  function G({
171
172
  children: t,
172
- className: i
173
+ className: o
173
174
  }) {
174
- return /* @__PURE__ */ s(w, { children: [
175
+ return /* @__PURE__ */ s(N, { children: [
175
176
  /* @__PURE__ */ e(
176
177
  "span",
177
178
  {
178
- className: x(
179
- i,
179
+ className: w(
180
+ o,
180
181
  "absolute top-0 bg-card z-20 size-full text-sm flex items-center justify-center"
181
182
  ),
182
183
  children: t
@@ -186,76 +187,76 @@ function G({
186
187
  ] });
187
188
  }
188
189
  function We() {
189
- const { tanTable: t, tableState: i } = N(), [o, r] = v(null), a = Re(
190
- $(ke),
191
- $(Ee, {
192
- coordinateGetter: Ne
190
+ const { tanTable: t, tableState: o } = T(), [i, r] = x(null), a = Le(), d = Re(
191
+ W(ke),
192
+ W(Ee, {
193
+ coordinateGetter: we
193
194
  })
194
195
  );
195
196
  return /* @__PURE__ */ e(
196
197
  _e,
197
198
  {
198
- sensors: a,
199
+ sensors: d,
199
200
  collisionDetection: Ve,
200
201
  onDragStart: (l) => {
201
202
  const { active: c } = l;
202
203
  r(c.id.toString());
203
204
  },
204
205
  onDragEnd: (l) => {
205
- const { active: c, over: d } = l;
206
- if (d && c.id !== d.id) {
207
- const h = t.getState().columnOrder, S = h.indexOf(c.id.toString()), C = h.indexOf(d.id.toString());
208
- t.setColumnOrder([...Pe(h, S, C)]);
206
+ const { active: c, over: m } = l;
207
+ if (m && c.id !== m.id) {
208
+ const f = t.getState().columnOrder, y = f.indexOf(c.id.toString()), b = f.indexOf(m.id.toString());
209
+ t.setColumnOrder([...De(f, y, b)]);
209
210
  }
210
211
  r(null);
211
212
  },
212
213
  children: /* @__PURE__ */ s(
213
- Te,
214
+ Ne,
214
215
  {
215
216
  items: t.getState().columnOrder,
216
- strategy: De,
217
+ strategy: Te,
217
218
  children: [
218
- /* @__PURE__ */ s(X, { label: /* @__PURE__ */ s(w, { children: [
219
- /* @__PURE__ */ e(me, {}),
219
+ /* @__PURE__ */ s(X, { label: /* @__PURE__ */ s(N, { children: [
220
+ /* @__PURE__ */ e(ue, {}),
220
221
  "Columns"
221
222
  ] }), selectionMode: "multiple", items: t.getAllFlatColumns(), selectedKeys: t.getIsAllColumnsVisible() ? "all" : t.getVisibleFlatColumns().map((l) => l.id), children: [
222
- /* @__PURE__ */ e(F, { onAction: () => t.toggleAllColumnsVisible(), className: "italic", children: "(select all)" }),
223
+ /* @__PURE__ */ e(L, { onAction: () => t.toggleAllColumnsVisible(), className: "italic", children: "(select all)" }),
223
224
  t.getState().columnOrder.map((l) => {
224
- const c = t.getAllFlatColumns().find((d) => d.id === l);
225
- return c ? /* @__PURE__ */ e(u, { column: c }, c.id) : null;
225
+ const c = t.getAllFlatColumns().find((m) => m.id === l);
226
+ return c ? /* @__PURE__ */ e(C, { column: c }, c.id) : null;
226
227
  })
227
228
  ] }),
228
- /* @__PURE__ */ e(He, { children: o ? /* @__PURE__ */ e("div", { className: "dropdown-item opacity-70 border-2 border-primary", children: W(o, "admin-portal") }) : null })
229
+ /* @__PURE__ */ e(He, { children: i ? /* @__PURE__ */ e("div", { className: "dropdown-item opacity-70 border-2 border-primary", children: a(i) }) : null })
229
230
  ]
230
231
  }
231
232
  )
232
233
  }
233
234
  );
234
- function u({ column: l }) {
235
+ function C({ column: l }) {
235
236
  const {
236
237
  attributes: c,
237
- listeners: d,
238
- setNodeRef: h,
239
- transform: S,
240
- transition: C
241
- } = Ae({ id: l.id }), T = {
242
- transform: Ue.Transform.toString(S),
243
- transition: C,
238
+ listeners: m,
239
+ setNodeRef: f,
240
+ transform: y,
241
+ transition: b
242
+ } = Pe({ id: l.id }), z = {
243
+ transform: Ue.Transform.toString(y),
244
+ transition: b,
244
245
  zIndex: "999"
245
246
  };
246
247
  return /* @__PURE__ */ s(
247
- F,
248
+ L,
248
249
  {
249
- ref: h,
250
- style: T,
250
+ ref: f,
251
+ style: z,
251
252
  ...c,
252
253
  id: l.id,
253
254
  onAction: () => l.toggleVisibility(),
254
255
  isDisabled: !l.getCanHide(),
255
256
  className: "flex items-center",
256
257
  children: [
257
- /* @__PURE__ */ e(ge, { ...d, className: "size-icon cursor-grab" }),
258
- W(l.id, "admin-portal"),
258
+ /* @__PURE__ */ e(me, { ...m, className: "size-icon cursor-grab" }),
259
+ a(l.id),
259
260
  l.getIsSorted() && /* @__PURE__ */ e(Z, { className: "size-icon", direction: l.getIsSorted() })
260
261
  ]
261
262
  }
@@ -264,110 +265,110 @@ function We() {
264
265
  }
265
266
  function Ge() {
266
267
  var r;
267
- const { tanTable: t, query: i } = N(), o = ((r = i.data) == null ? void 0 : r.total) ?? 0;
268
+ const { tanTable: t, query: o } = T(), i = ((r = o.data) == null ? void 0 : r.total) ?? 0;
268
269
  return /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
269
270
  /* @__PURE__ */ e("span", { className: "whitespace-nowrap caption text-muted", children: `${t.getState().pagination.pageIndex * t.getState().pagination.pageSize + 1} - ${Math.min(
270
271
  (t.getState().pagination.pageIndex + 1) * t.getState().pagination.pageSize,
271
- o
272
- )} of ${o == null ? void 0 : o.toLocaleString()}` }),
272
+ i
273
+ )} of ${i == null ? void 0 : i.toLocaleString()}` }),
273
274
  /* @__PURE__ */ e(
274
- b,
275
+ S,
275
276
  {
276
277
  onPress: () => t.firstPage(),
277
278
  isDisabled: !t.getCanPreviousPage(),
278
279
  variant: "neutral",
279
280
  size: "icon",
280
- children: /* @__PURE__ */ e(fe, {})
281
+ children: /* @__PURE__ */ e(ge, {})
281
282
  }
282
283
  ),
283
284
  /* @__PURE__ */ e(
284
- b,
285
+ S,
285
286
  {
286
287
  onPress: () => t.previousPage(),
287
288
  isDisabled: !t.getCanPreviousPage(),
288
289
  variant: "neutral",
289
290
  size: "icon",
290
- children: /* @__PURE__ */ e(pe, {})
291
+ children: /* @__PURE__ */ e(fe, {})
291
292
  }
292
293
  ),
293
294
  /* @__PURE__ */ e(
294
- b,
295
+ S,
295
296
  {
296
297
  onPress: () => t.nextPage(),
297
298
  isDisabled: !t.getCanNextPage(),
298
299
  variant: "neutral",
299
300
  size: "icon",
300
- children: /* @__PURE__ */ e(he, {})
301
+ children: /* @__PURE__ */ e(pe, {})
301
302
  }
302
303
  ),
303
304
  /* @__PURE__ */ e(
304
- b,
305
+ S,
305
306
  {
306
307
  onClick: () => t.lastPage(),
307
308
  isDisabled: !t.getCanNextPage(),
308
309
  variant: "neutral",
309
310
  size: "icon",
310
- children: /* @__PURE__ */ e(be, {})
311
+ children: /* @__PURE__ */ e(he, {})
311
312
  }
312
313
  )
313
314
  ] });
314
315
  }
315
316
  function Xe() {
316
- const { tanTable: t } = N(), i = [10, 20, 30, 40, 50];
317
- return /* @__PURE__ */ e(X, { label: t.getState().pagination.pageSize.toString(), selectionMode: "single", selectedKeys: [t.getState().pagination.pageSize.toString()], items: i.map((o) => ({ id: o.toString(), value: o })), children: (o) => /* @__PURE__ */ e(F, { onAction: () => t.setPageSize(o.value), children: o.value }) });
317
+ const { tanTable: t } = T(), o = [10, 20, 30, 40, 50];
318
+ return /* @__PURE__ */ e(X, { label: t.getState().pagination.pageSize.toString(), selectionMode: "single", selectedKeys: [t.getState().pagination.pageSize.toString()], items: o.map((i) => ({ id: i.toString(), value: i })), children: (i) => /* @__PURE__ */ e(L, { onAction: () => t.setPageSize(i.value), children: i.value }) });
318
319
  }
319
320
  function Ye({ tableActions: t }) {
320
- const { query: i, tanTable: o, searchQuery: r, setSearchQuery: a } = N();
321
+ const { query: o, tanTable: i, searchQuery: r, setSearchQuery: a } = T();
321
322
  return /* @__PURE__ */ s("section", { className: "flex bg-card justify-between my-0 p-icon border gap-icon overflow-auto", children: [
322
323
  /* @__PURE__ */ s("div", { className: "flex gap-icon", children: [
323
324
  /* @__PURE__ */ e(
324
- b,
325
+ S,
325
326
  {
326
- isPending: i.isFetching,
327
- onClick: () => i.refetch(),
327
+ isPending: o.isFetching,
328
+ onClick: () => o.refetch(),
328
329
  variant: "neutral",
329
330
  size: "icon",
330
- children: /* @__PURE__ */ e(ue, {})
331
+ children: /* @__PURE__ */ e(de, {})
331
332
  }
332
333
  ),
333
- t.filter((u) => u.bulk === o.getSelectedRowModel().rows.length > 0).map(
334
- (u, l) => {
335
- const c = u.icon;
336
- return /* @__PURE__ */ e(b, { type: "button", isDisabled: i.isFetching, className: "animate-in fade-in slide-in-from-left-15 duration-300 transition-transform", onPress: (d) => {
337
- u.onClick(d, o);
338
- }, size: "icon", children: /* @__PURE__ */ e(c, {}) }, `${l}-${u.bulk}`);
334
+ t.filter((d) => d.bulk === i.getSelectedRowModel().rows.length > 0).map(
335
+ (d, C) => {
336
+ const l = d.icon;
337
+ return /* @__PURE__ */ e(S, { type: "button", isDisabled: o.isFetching, className: "animate-in fade-in slide-in-from-left-15 duration-300 transition-transform", onPress: (c) => {
338
+ d.onClick(c, i);
339
+ }, size: "icon", children: /* @__PURE__ */ e(l, {}) }, `${C}-${d.bulk}`);
339
340
  }
340
341
  )
341
342
  ] }),
342
343
  /* @__PURE__ */ s("div", { className: "flex gap-icon", children: [
343
- /* @__PURE__ */ e(Ie, {}),
344
- /* @__PURE__ */ e($e, { value: r, onChange: a })
344
+ /* @__PURE__ */ e(Ae, {}),
345
+ /* @__PURE__ */ e(Qe, { value: r, onChange: a })
345
346
  ] })
346
347
  ] });
347
348
  }
348
- function Z({ direction: t, ...i }) {
349
- return t === "asc" ? /* @__PURE__ */ e(Se, { ...i }) : t === "desc" ? /* @__PURE__ */ e(Ce, { ...i }) : /* @__PURE__ */ e(ye, { ...i });
349
+ function Z({ direction: t, ...o }) {
350
+ return t === "asc" ? /* @__PURE__ */ e(be, { ...o }) : t === "desc" ? /* @__PURE__ */ e(Se, { ...o }) : /* @__PURE__ */ e(Ce, { ...o });
350
351
  }
351
352
  function Ze({ className: t }) {
352
- const { tanTable: i } = N(), o = (r, a) => x("animate-in fade-in slide-in-from-top-10", "px-icon py-2 text-left text-sm font-medium whitespace-nowrap", r && "bg-card sticky right-0 z-50 text-center", a);
353
- return /* @__PURE__ */ s(ze, { className: x(t), children: [
354
- /* @__PURE__ */ e(Me, { className: "sticky top-0 z-10", children: i.getHeaderGroups().map((r) => /* @__PURE__ */ e(Q, { className: x("h-input"), children: r.headers.map((a) => /* @__PURE__ */ s(
355
- Oe,
353
+ const { tanTable: o } = T(), i = (r, a) => w("animate-in fade-in slide-in-from-top-10", "px-icon py-2 text-left text-sm font-medium whitespace-nowrap", r && "bg-card sticky right-0 z-50 text-center", a);
354
+ return /* @__PURE__ */ s(Ie, { className: w(t), children: [
355
+ /* @__PURE__ */ e(ze, { className: "sticky top-0 z-10", children: o.getHeaderGroups().map((r) => /* @__PURE__ */ e($, { className: w("h-input"), children: r.headers.map((a) => /* @__PURE__ */ s(
356
+ Me,
356
357
  {
357
- className: o(!1, "bg-card"),
358
+ className: i(!1, "bg-card"),
358
359
  children: [
359
- !a.column.getCanSort() && !a.isPlaceholder && /* @__PURE__ */ e(w, { children: M(
360
+ !a.column.getCanSort() && !a.isPlaceholder && /* @__PURE__ */ e(N, { children: F(
360
361
  a.column.columnDef.header,
361
362
  a.getContext()
362
363
  ) }),
363
364
  a.column.getCanSort() && /* @__PURE__ */ s(
364
- b,
365
+ S,
365
366
  {
366
367
  variant: "ghost",
367
368
  className: "w-full !justify-start !px-1.5",
368
369
  onPress: a.column.getToggleSortingHandler(),
369
370
  children: [
370
- M(
371
+ F(
371
372
  a.column.columnDef.header,
372
373
  a.getContext()
373
374
  ),
@@ -379,16 +380,16 @@ function Ze({ className: t }) {
379
380
  },
380
381
  a.id
381
382
  )) }, r.id)) }),
382
- /* @__PURE__ */ e(Fe, { className: "flex-1 overflow-y-auto relative", children: i.getRowModel().rows.map((r) => /* @__PURE__ */ e(
383
- Q,
383
+ /* @__PURE__ */ e(Fe, { className: "flex-1 overflow-y-auto relative", children: o.getRowModel().rows.map((r) => /* @__PURE__ */ e(
384
+ $,
384
385
  {
385
- className: x("h-input transition-colors data-[selected=true]:bg-primary/10 hover:bg-muted-foreground/20"),
386
+ className: w("h-input transition-colors data-[selected=true]:bg-primary/10 hover:bg-muted-foreground/20"),
386
387
  "data-selected": r.getIsSelected(),
387
388
  children: r.getVisibleCells().map((a) => /* @__PURE__ */ e(
388
- Le,
389
+ Oe,
389
390
  {
390
- className: o(a.column.id === L),
391
- children: M(
391
+ className: i(a.column.id === R),
392
+ children: F(
392
393
  a.column.columnDef.cell,
393
394
  a.getContext()
394
395
  )
@@ -401,11 +402,11 @@ function Ze({ className: t }) {
401
402
  ] });
402
403
  }
403
404
  export {
404
- L as ACTIONS_COLUMN_ID,
405
- Ct as DataTable,
405
+ R as ACTIONS_COLUMN_ID,
406
+ yt as DataTable,
406
407
  Y as DataTableContext,
407
- St as DataTableProvider,
408
- N as useDataTable,
409
- bt as useDataTableState
408
+ Ct as DataTableProvider,
409
+ T as useDataTable,
410
+ St as useDataTableState
410
411
  };
411
412
  //# sourceMappingURL=data-table.es.js.map