dgz-ui-shared 1.2.30 → 1.2.32

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.
@@ -1,394 +1,401 @@
1
- import { jsx as e, jsxs as N, Fragment as O } from "react/jsx-runtime";
2
- import { y as ee, f as te } from "../../chunks/index-E1NtSoNr.es.js";
3
- import { Button as Q } from "dgz-ui/button";
4
- import { DropdownMenu as le, DropdownMenuTrigger as de, DropdownMenuContent as se, DropdownMenuItem as fe, DropdownMenuSeparator as ie, DropdownMenuCheckboxItem as re } from "dgz-ui/dropdown";
5
- import { cn as o } from "dgz-ui/utils";
6
- import { l as z } from "../../chunks/lodash-CRDOWzbs.es.js";
7
- import { XIcon as h, ArrowDownWideNarrow as pe, ArrowUpWideNarrow as Ne, ArrowUpDown as xe, RefreshCw as ce } from "lucide-react";
8
- import { memo as me, useMemo as we, useEffect as Y, useState as ge } from "react";
1
+ import { jsx as e, jsxs as m, Fragment as O } from "react/jsx-runtime";
2
+ import { y as C, f as P } from "../../chunks/index-E1NtSoNr.es.js";
3
+ import { Button as q } from "dgz-ui/button";
4
+ import { DropdownMenu as ee, DropdownMenuTrigger as te, DropdownMenuContent as le, DropdownMenuItem as de, DropdownMenuSeparator as se, DropdownMenuCheckboxItem as ie } from "dgz-ui/dropdown";
5
+ import { cn as z } from "dgz-ui/utils";
6
+ import { l as A } from "../../chunks/lodash-CRDOWzbs.es.js";
7
+ import { XIcon as Z, ArrowDownWideNarrow as fe, ArrowUpWideNarrow as re, ArrowUpDown as pe, RefreshCw as Ne } from "lucide-react";
8
+ import { memo as ce, useMemo as h, useEffect as Q, useState as xe } from "react";
9
9
  import { useTranslation as b } from "react-i18next";
10
- import { u as ne, a as Ee, b as Te } from "../../chunks/useSortable-BXNk8Wth.es.js";
11
- import { A as De } from "../../chunks/Actions-Du8iQ3WR.es.js";
12
- import { E as ve } from "../../chunks/ExportData-CwotVgye.es.js";
13
- import { S as Ae, F as Me } from "../../chunks/Search-BtiKC-dt.es.js";
14
- import { ButtonGroup as ze } from "dgz-ui";
15
- import { L as ke } from "../../chunks/Loader-zvzAi0F6.es.js";
16
- import { D as I, M as Le, a as Re } from "../../chunks/MyPagination-B0czoGZK.es.js";
10
+ import { u as me, a as we, b as ge } from "../../chunks/useSortable-BXNk8Wth.es.js";
11
+ import { A as ne } from "../../chunks/Actions-Du8iQ3WR.es.js";
12
+ import { E as Ee } from "../../chunks/ExportData-CwotVgye.es.js";
13
+ import { S as Te, F as Ae } from "../../chunks/Search-BtiKC-dt.es.js";
14
+ import { ButtonGroup as De } from "dgz-ui";
15
+ import { L as ve } from "../../chunks/Loader-zvzAi0F6.es.js";
16
+ import { D as I, M as Me, a as ze } from "../../chunks/MyPagination-B0czoGZK.es.js";
17
17
  import { Checkbox as U } from "dgz-ui/form";
18
- import { Table as oe, TableHeader as We, TableRow as X, TableHead as q, TableBody as Be, TableCell as J } from "dgz-ui/table";
18
+ import { Table as ke, TableHeader as Le, TableRow as G, TableHead as X, TableBody as Re, TableCell as $ } from "dgz-ui/table";
19
19
  import { S as j } from "../../chunks/SortOrder-CwuehjY1.es.js";
20
- import { E as $e } from "../../chunks/Empty-BReVQKje.es.js";
21
- const He = me(function({
22
- filters: m,
23
- params: E,
20
+ import { E as oe } from "../../chunks/Empty-BReVQKje.es.js";
21
+ const We = ce(function({
22
+ filters: g,
23
+ params: n,
24
24
  onFilter: x,
25
25
  className: w,
26
- ...k
26
+ ...M
27
27
  }) {
28
- const { t: T } = b(), s = we(
28
+ const { t } = b(), f = h(
29
29
  () => Object.fromEntries(
30
- (m == null ? void 0 : m.map((f) => {
31
- var c;
30
+ (g == null ? void 0 : g.map((p) => {
31
+ var N;
32
32
  return [
33
- f.name,
33
+ p.name,
34
34
  Object.fromEntries(
35
- ((c = f.options) == null ? void 0 : c.map(({ label: t, value: n }) => [n, t])) || []
35
+ ((N = p.options) == null ? void 0 : N.map(({ label: v, value: c }) => [c, v])) || []
36
36
  )
37
37
  ];
38
38
  })) || []
39
39
  ),
40
- [m]
40
+ [g]
41
+ ), D = h(
42
+ () => Object.entries(n || {}).filter(
43
+ ([p, N]) => !!(f != null && f[p]) && !A.isEmpty(N)
44
+ ),
45
+ [f, n]
41
46
  );
42
- return /* @__PURE__ */ e("div", { ...k, className: o("flex flex-wrap gap-2", w), children: Object.entries(E || {}).filter(([f, c]) => !!(s != null && s[f]) && !z.isEmpty(c)).map(
43
- ([f, c]) => {
44
- var t;
45
- return Array.isArray(c) ? /* @__PURE__ */ e(ze, { children: c.filter((n) => {
46
- var L;
47
- return ((L = s == null ? void 0 : s[f]) == null ? void 0 : L[n]) && n;
48
- }).map((n, L) => {
49
- var p;
50
- return /* @__PURE__ */ N(
51
- Q,
47
+ return !A.isEmpty(D) && /* @__PURE__ */ e("div", { ...M, className: z("flex flex-wrap gap-2", w), children: D.map(
48
+ ([p, N]) => {
49
+ var v;
50
+ return Array.isArray(N) ? /* @__PURE__ */ e(De, { children: N.filter((c) => {
51
+ var s;
52
+ return ((s = f == null ? void 0 : f[p]) == null ? void 0 : s[c]) && c;
53
+ }).map((c, s) => {
54
+ var k;
55
+ return /* @__PURE__ */ m(
56
+ q,
52
57
  {
53
58
  size: "sm",
54
59
  onClick: () => {
55
60
  x == null || x({
56
- ...E,
57
- [f]: c.filter((M) => M !== n)
61
+ ...n,
62
+ [p]: N.filter((E) => E !== c)
58
63
  });
59
64
  },
60
65
  children: [
61
- T(String(((p = s == null ? void 0 : s[f]) == null ? void 0 : p[n]) || "")),
66
+ t(String(((k = f == null ? void 0 : f[p]) == null ? void 0 : k[c]) || "")),
62
67
  " ",
63
- /* @__PURE__ */ e(h, {})
68
+ /* @__PURE__ */ e(Z, {})
64
69
  ]
65
70
  },
66
- L
71
+ s
67
72
  );
68
- }) }, f) : /* @__PURE__ */ N(
69
- Q,
73
+ }) }, p) : /* @__PURE__ */ m(
74
+ q,
70
75
  {
71
76
  size: "sm",
72
77
  onClick: () => {
73
- x == null || x(z.omit(E, f));
78
+ x == null || x(A.omit(n, p));
74
79
  },
75
80
  children: [
76
- T(String(((t = s == null ? void 0 : s[f]) == null ? void 0 : t[c]) || "")),
81
+ t(String(((v = f == null ? void 0 : f[p]) == null ? void 0 : v[N]) || "")),
77
82
  " ",
78
- /* @__PURE__ */ e(h, {})
83
+ /* @__PURE__ */ e(Z, {})
79
84
  ]
80
85
  }
81
86
  );
82
87
  }
83
88
  ) });
84
- }), Je = ({
85
- rows: l = [],
86
- columns: m,
87
- onRowClick: E,
89
+ }), Be = ({
90
+ rows: d = [],
91
+ columns: g,
92
+ onRowClick: n,
88
93
  rowKey: x,
89
94
  params: w = {
90
95
  page: 1,
91
96
  limit: I
92
97
  },
93
- hasNumbers: k = !1,
94
- hasCheckbox: T = !1,
95
- selectedItems: s,
96
- onSelectedItemsChange: f,
97
- onSortOrderChange: c,
98
- isStickyHeader: t,
99
- className: n,
100
- ...L
98
+ hasNumbers: M = !1,
99
+ hasCheckbox: t = !1,
100
+ selectedItems: f,
101
+ onSelectedItemsChange: D,
102
+ onSortOrderChange: p,
103
+ isStickyHeader: N,
104
+ className: v,
105
+ ...c
101
106
  }) => {
102
- const { sortObject: p, handleSort: M } = ne({
107
+ const { sortObject: s, handleSort: k } = me({
103
108
  sortField: w == null ? void 0 : w.sortField,
104
109
  sortOrder: w == null ? void 0 : w.sortOrder,
105
- onSortOrderChange: c
110
+ onSortOrderChange: p
106
111
  }), {
107
- selectedRows: R,
108
- isRowSelected: D,
109
- isAllRowsSelected: v,
110
- handleSelectAllRows: _,
111
- handleSelectRow: W
112
- } = Ee({ rows: l, defaultSelectedRows: s });
113
- return Y(() => {
114
- JSON.stringify(s) !== JSON.stringify(R) && R && (f == null || f(R));
115
- }, [R, s, f]), /* @__PURE__ */ N(oe, { ...L, className: o("relative", n), children: [
112
+ selectedRows: E,
113
+ isRowSelected: R,
114
+ isAllRowsSelected: y,
115
+ handleSelectAllRows: L,
116
+ handleSelectRow: H
117
+ } = we({ rows: d, defaultSelectedRows: f });
118
+ return Q(() => {
119
+ JSON.stringify(f) !== JSON.stringify(E) && E && (D == null || D(E));
120
+ }, [E, f, D]), /* @__PURE__ */ m(ke, { ...c, children: [
116
121
  /* @__PURE__ */ e(
117
- We,
122
+ Le,
118
123
  {
119
- className: o("bg-bg", t && "sticky top-0 z-1"),
120
- children: /* @__PURE__ */ N(X, { children: [
121
- T && /* @__PURE__ */ e(q, { className: "w-12 p-3", children: /* @__PURE__ */ e(
124
+ className: z("bg-bg", N && "sticky top-0 z-1"),
125
+ children: /* @__PURE__ */ m(G, { children: [
126
+ t && /* @__PURE__ */ e(X, { className: "w-12 p-3", children: /* @__PURE__ */ e(
122
127
  U,
123
128
  {
124
129
  className: "mt-1",
125
- checked: v(x),
126
- onCheckedChange: (d) => _(x, !!d),
130
+ checked: y(x),
131
+ onCheckedChange: (i) => L(x, !!i),
127
132
  "aria-label": "Select all"
128
133
  }
129
134
  ) }),
130
- k && /* @__PURE__ */ e(q, { className: "w-12 p-2", children: "#" }),
131
- m.filter((d) => !d.hidden).map((d) => /* @__PURE__ */ e(
132
- q,
135
+ M && /* @__PURE__ */ e(X, { className: "w-12 p-2", children: "#" }),
136
+ g.filter((i) => !i.hidden).map((i) => /* @__PURE__ */ e(
137
+ X,
133
138
  {
134
- style: d.styles,
135
- className: o("p-2", d.sortable && "cursor-pointer"),
136
- onClick: () => d.sortable && M(d.dataIndex),
137
- children: /* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
138
- d.name,
139
+ style: i.styles,
140
+ className: z("p-2", i.sortable && "cursor-pointer"),
141
+ onClick: () => i.sortable && k(i.dataIndex),
142
+ children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
143
+ i.name,
139
144
  " ",
140
- d.sortable && ((p == null ? void 0 : p.sortField) === d.key ? /* @__PURE__ */ N(O, { children: [
141
- (p == null ? void 0 : p.sortOrder) === j.DESC && /* @__PURE__ */ e(pe, { size: 15 }),
142
- (p == null ? void 0 : p.sortOrder) === j.ASC && /* @__PURE__ */ e(Ne, { size: 15 })
143
- ] }) : /* @__PURE__ */ e(xe, { size: 15 }))
145
+ i.sortable && ((s == null ? void 0 : s.sortField) === i.key ? /* @__PURE__ */ m(O, { children: [
146
+ (s == null ? void 0 : s.sortOrder) === j.DESC && /* @__PURE__ */ e(fe, { size: 15 }),
147
+ (s == null ? void 0 : s.sortOrder) === j.ASC && /* @__PURE__ */ e(re, { size: 15 })
148
+ ] }) : /* @__PURE__ */ e(pe, { size: 15 }))
144
149
  ] })
145
150
  },
146
- d.key
151
+ i.key
147
152
  ))
148
153
  ] })
149
154
  }
150
155
  ),
151
- /* @__PURE__ */ e(Be, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: l.length ? l.map((d, B) => /* @__PURE__ */ N(
152
- X,
156
+ /* @__PURE__ */ e(Re, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: d.length ? d.map((i, o) => /* @__PURE__ */ m(
157
+ G,
153
158
  {
154
- onClick: () => E == null ? void 0 : E(d),
155
- className: o(E && "cursor-pointer"),
156
- "data-state": D(d[x]) && "selected",
159
+ onClick: () => n == null ? void 0 : n(i),
160
+ className: z(n && "cursor-pointer"),
161
+ "data-state": R(i[x]) && "selected",
157
162
  children: [
158
- T && /* @__PURE__ */ e(
159
- J,
163
+ t && /* @__PURE__ */ e(
164
+ $,
160
165
  {
161
166
  className: "w-12 p-3",
162
- onClick: (r) => r.stopPropagation(),
167
+ onClick: (l) => l.stopPropagation(),
163
168
  children: /* @__PURE__ */ e(
164
169
  U,
165
170
  {
166
171
  className: "mt-1",
167
- checked: D(d[x]),
168
- onCheckedChange: (r) => W(d[x], !!r),
172
+ checked: R(i[x]),
173
+ onCheckedChange: (l) => H(i[x], !!l),
169
174
  "aria-label": "Select row"
170
175
  }
171
176
  )
172
177
  }
173
178
  ),
174
- k && /* @__PURE__ */ e(J, { className: "w-12 p-2", children: (w.page - 1) * (w.limit || I) + B + 1 }),
175
- m.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ e(
176
- J,
179
+ M && /* @__PURE__ */ e($, { className: "w-12 p-2", children: (w.page - 1) * (w.limit || I) + o + 1 }),
180
+ g.filter((l) => !l.hidden).map((l) => /* @__PURE__ */ e(
181
+ $,
177
182
  {
178
183
  className: "text-body-xs-medium max-w-xs p-2",
179
- style: r.styles,
180
- children: r.render ? r.render(z.get(d, r.dataIndex), d) : z.get(d, r.dataIndex, "")
184
+ style: l.styles,
185
+ children: l.render ? l.render(A.get(i, l.dataIndex), i) : A.get(i, l.dataIndex, "")
181
186
  },
182
- `${B}-${r.key}`
187
+ `${o}-${l.key}`
183
188
  ))
184
189
  ]
185
190
  },
186
- `${d[x]}`
187
- )) : /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(
188
- J,
191
+ `${i[x]}`
192
+ )) : /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
193
+ $,
189
194
  {
190
- colSpan: k ? T ? m.length + 2 : m.length + 1 : m.length,
191
- children: /* @__PURE__ */ e($e, {})
195
+ colSpan: M ? t ? g.length + 2 : g.length + 1 : g.length,
196
+ children: /* @__PURE__ */ e(oe, {})
192
197
  }
193
198
  ) }) })
194
199
  ] });
195
- }, Ce = ({
196
- dataSource: l,
197
- columns: m,
198
- onRowClick: E,
199
- rowKey: x,
200
- hasNumbers: w,
201
- hasSearch: k,
202
- exportOptions: T,
203
- hasCheckbox: s,
204
- hasPagination: f,
205
- isStickyHeader: c,
200
+ }, Ve = ({
201
+ dataSource: d,
202
+ columns: g,
203
+ rowKey: n,
204
+ hasSearch: x,
205
+ exportOptions: w,
206
+ hasPagination: M,
206
207
  onParamChange: t,
207
- dataKey: n = "docs",
208
- loading: L,
208
+ dataKey: f = "docs",
209
+ loading: D,
209
210
  tableKey: p,
210
- filters: M,
211
- actions: R,
212
- handleFilterChange: D,
213
- params: v,
214
- exportLoading: _ = !1,
215
- onColumnsUpdate: W,
216
- hasColumnsVisibilityDropdown: d,
217
- showAppliedFilters: B = !1,
218
- onSelectedItemsChange: r,
219
- actionProps: K,
220
- filterWrapperProps: F,
221
- exportOptionsProps: S,
222
- columnsVisibilityProps: g,
223
- paginationProps: V,
224
- searchProps: A,
225
- ...u
211
+ filters: N,
212
+ actions: v,
213
+ handleFilterChange: c,
214
+ params: s,
215
+ exportLoading: k = !1,
216
+ onColumnsUpdate: E,
217
+ hasColumnsVisibilityDropdown: R,
218
+ showAppliedFilters: y = !1,
219
+ onSelectedItemsChange: L,
220
+ actionProps: H,
221
+ filterWrapperProps: i,
222
+ exportOptionsProps: o,
223
+ columnsVisibilityProps: l,
224
+ paginationProps: K,
225
+ searchProps: T,
226
+ className: F,
227
+ ...S
226
228
  }) => {
227
- var Z;
228
- const { t: y } = b(), [$, a] = ge([]), { formattedColumns: H, handleColumnsChange: C, resetColumns: P } = Te({ key: p, columns: m });
229
- return Y(() => {
230
- W == null || W(H);
231
- }, [H, W]), Y(() => {
232
- r == null || r($);
233
- }, [$, r]), /* @__PURE__ */ N(
229
+ var Y;
230
+ const { t: J } = b(), [W, V] = xe([]), { formattedColumns: B, handleColumnsChange: u, resetColumns: a } = ge({ key: p, columns: g });
231
+ return Q(() => {
232
+ E == null || E(B);
233
+ }, [B, E]), Q(() => {
234
+ L == null || L(W);
235
+ }, [W, L]), /* @__PURE__ */ m(
234
236
  "div",
235
237
  {
236
238
  className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
237
239
  children: [
238
- /* @__PURE__ */ N("div", { className: "flex flex-col gap-4 p-4", children: [
239
- (k || d && p || !z.isEmpty(T) || !z.isEmpty(M)) && /* @__PURE__ */ N("div", { className: "flex flex-col justify-between gap-3 lg:flex-row lg:items-center", children: [
240
- /* @__PURE__ */ e("div", { className: "grow", children: k && /* @__PURE__ */ e(
241
- Ae,
240
+ /* @__PURE__ */ m("div", { className: "flex flex-col gap-4 p-4", children: [
241
+ (x || R && p || !A.isEmpty(w) || !A.isEmpty(N)) && /* @__PURE__ */ m("div", { className: "flex flex-col justify-between gap-3 lg:flex-row lg:items-center", children: [
242
+ /* @__PURE__ */ e("div", { className: "grow", children: x && /* @__PURE__ */ e(
243
+ Te,
242
244
  {
243
- ...A,
245
+ ...T,
244
246
  inputProps: {
245
- ...A == null ? void 0 : A.inputProps,
246
- className: o(
247
+ ...T == null ? void 0 : T.inputProps,
248
+ className: z(
247
249
  "h-8 grow",
248
- (Z = A == null ? void 0 : A.inputProps) == null ? void 0 : Z.className
250
+ (Y = T == null ? void 0 : T.inputProps) == null ? void 0 : Y.className
249
251
  )
250
252
  },
251
- className: o(
252
- "max-w-full lg:max-w-80 [&_button]:-top-1",
253
- A == null ? void 0 : A.className
253
+ className: z(
254
+ "max-w-full lg:max-w-80! [&_button]:-top-1",
255
+ T == null ? void 0 : T.className
254
256
  ),
255
- defaultValue: z.get(v, "search", ""),
256
- onSearchChange: (i) => t == null ? void 0 : t({ ...v, search: i, page: 1 })
257
+ defaultValue: A.get(s, "search", ""),
258
+ onSearchChange: (r) => t == null ? void 0 : t({ ...s, search: r, page: 1 })
257
259
  }
258
260
  ) }),
259
- /* @__PURE__ */ N("div", { className: "flex items-center justify-end gap-3", children: [
260
- T && /* @__PURE__ */ e(
261
- ve,
261
+ /* @__PURE__ */ m("div", { className: "flex items-center justify-end gap-3", children: [
262
+ w && /* @__PURE__ */ e(
263
+ Ee,
262
264
  {
263
- ...S,
264
- options: T,
265
- loading: _
265
+ ...o,
266
+ options: w,
267
+ loading: k
266
268
  }
267
269
  ),
268
- d && p && /* @__PURE__ */ N(le, { children: [
270
+ R && p && /* @__PURE__ */ m(ee, { children: [
269
271
  /* @__PURE__ */ e(
270
- de,
272
+ te,
271
273
  {
272
274
  asChild: !0,
273
275
  className: "grow",
274
- ...g == null ? void 0 : g.triggerProps,
276
+ ...l == null ? void 0 : l.triggerProps,
275
277
  children: /* @__PURE__ */ e(
276
- Q,
278
+ q,
277
279
  {
278
280
  variant: "secondary",
279
281
  size: "sm",
280
282
  className: "ml-auto rounded-lg px-3",
281
- children: (g == null ? void 0 : g.title) || /* @__PURE__ */ N(O, { children: [
282
- /* @__PURE__ */ e(ee, {}),
283
+ children: (l == null ? void 0 : l.title) || /* @__PURE__ */ m(O, { children: [
284
+ /* @__PURE__ */ e(C, {}),
283
285
  " ",
284
- /* @__PURE__ */ e("span", { className: "hidden md:inline!", children: y("Customize columns") }),
285
- /* @__PURE__ */ e(te, {})
286
+ /* @__PURE__ */ e("span", { className: "hidden md:inline!", children: J("Customize columns") }),
287
+ /* @__PURE__ */ e(P, {})
286
288
  ] })
287
289
  }
288
290
  )
289
291
  }
290
292
  ),
291
- /* @__PURE__ */ N(
292
- se,
293
+ /* @__PURE__ */ m(
294
+ le,
293
295
  {
294
296
  align: "end",
295
- ...g == null ? void 0 : g.contentProps,
297
+ ...l == null ? void 0 : l.contentProps,
296
298
  children: [
297
- /* @__PURE__ */ N(
298
- fe,
299
+ /* @__PURE__ */ m(
300
+ de,
299
301
  {
300
302
  className: "capitalize",
301
- onClick: P,
303
+ onClick: a,
302
304
  children: [
303
- /* @__PURE__ */ e(ce, {}),
305
+ /* @__PURE__ */ e(Ne, {}),
304
306
  " ",
305
- (g == null ? void 0 : g.resetText) || y("Reset columns")
307
+ (l == null ? void 0 : l.resetText) || J("Reset columns")
306
308
  ]
307
309
  }
308
310
  ),
309
- /* @__PURE__ */ e(ie, {}),
310
- H.map((i) => /* @__PURE__ */ e(
311
- re,
311
+ /* @__PURE__ */ e(se, {}),
312
+ B.map((r) => /* @__PURE__ */ e(
313
+ ie,
312
314
  {
313
315
  className: "capitalize",
314
- checked: !i.hidden,
315
- onCheckedChange: (G) => C(i, !G),
316
- children: i.name
316
+ checked: !r.hidden,
317
+ onCheckedChange: (_) => u(r, !_),
318
+ children: r.name
317
319
  },
318
- i.key
320
+ r.key
319
321
  ))
320
322
  ]
321
323
  }
322
324
  )
323
325
  ] }),
324
- R && /* @__PURE__ */ e(De, { ...K, actions: R }),
325
- M && /* @__PURE__ */ e(
326
- Me,
326
+ v && /* @__PURE__ */ e(ne, { ...H, actions: v }),
327
+ N && /* @__PURE__ */ e(
328
+ Ae,
327
329
  {
328
- ...F,
329
- filters: M,
330
- params: v,
331
- onChange: D,
332
- onFilter: (i) => {
333
- t == null || t({ ...i, page: 1 }), D == null || D(i);
330
+ ...i,
331
+ filters: N,
332
+ params: s,
333
+ onChange: c,
334
+ onFilter: (r) => {
335
+ t == null || t({ ...r, page: 1 }), c == null || c(r);
334
336
  }
335
337
  }
336
338
  )
337
339
  ] })
338
340
  ] }),
339
- B && !z.isEmpty(M) && /* @__PURE__ */ e(
340
- He,
341
+ y && !A.isEmpty(N) && /* @__PURE__ */ e(
342
+ We,
341
343
  {
342
- filters: M,
343
- params: v,
344
- onFilter: (i) => {
345
- t == null || t({ ...i, page: 1 }), D == null || D(i);
344
+ filters: N,
345
+ params: s,
346
+ onFilter: (r) => {
347
+ t == null || t({ ...r, page: 1 }), c == null || c(r);
346
348
  }
347
349
  }
348
350
  )
349
351
  ] }),
350
- /* @__PURE__ */ e("div", { className: "flex flex-col overflow-auto border-y", children: L ? /* @__PURE__ */ e(ke, {}) : /* @__PURE__ */ e(
351
- Je,
352
+ /* @__PURE__ */ e(
353
+ "div",
352
354
  {
353
- ...u,
354
- params: {
355
- page: (l == null ? void 0 : l.page) || 1,
356
- limit: l == null ? void 0 : l.limit,
357
- ...v
358
- },
359
- rows: z.get(l, n, []),
360
- rowKey: x,
361
- selectedItems: $,
362
- isStickyHeader: c,
363
- columns: H,
364
- hasCheckbox: s,
365
- hasNumbers: w,
366
- onRowClick: E,
367
- onSelectedItemsChange: a,
368
- onSortOrderChange: ({ sortField: i, sortOrder: G }) => {
369
- t == null || t({ ...v, sortField: i, sortOrder: G });
370
- }
355
+ className: z(
356
+ "relative flex flex-col overflow-auto border-y",
357
+ F
358
+ ),
359
+ children: D ? /* @__PURE__ */ e(ve, {}) : /* @__PURE__ */ e(
360
+ Be,
361
+ {
362
+ ...S,
363
+ params: {
364
+ page: (d == null ? void 0 : d.page) || 1,
365
+ limit: d == null ? void 0 : d.limit,
366
+ ...s
367
+ },
368
+ rows: A.get(d, f, []),
369
+ rowKey: n,
370
+ selectedItems: W,
371
+ columns: B,
372
+ onSelectedItemsChange: V,
373
+ onSortOrderChange: ({ sortField: r, sortOrder: _ }) => {
374
+ t == null || t({ ...s, sortField: r, sortOrder: _ });
375
+ }
376
+ }
377
+ )
371
378
  }
372
- ) }),
373
- f && /* @__PURE__ */ N("div", { className: "flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between", children: [
379
+ ),
380
+ M && /* @__PURE__ */ m("div", { className: "flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between", children: [
374
381
  /* @__PURE__ */ e("div", { className: "text-sm", children: /* @__PURE__ */ e(
375
- Le,
382
+ Me,
376
383
  {
377
- onLimitChange: (i) => t == null ? void 0 : t({ ...v, limit: i, page: 1 }),
378
- defaultValue: l == null ? void 0 : l.limit
384
+ onLimitChange: (r) => t == null ? void 0 : t({ ...s, limit: r, page: 1 }),
385
+ defaultValue: d == null ? void 0 : d.limit
379
386
  }
380
387
  ) }),
381
- /* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: y("{{selectedCount}} of {{total}} row(s) selected", {
382
- selectedCount: $.length,
383
- total: (l == null ? void 0 : l.total) || 0
388
+ /* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: J("{{selectedCount}} of {{total}} row(s) selected", {
389
+ selectedCount: W.length,
390
+ total: (d == null ? void 0 : d.total) || 0
384
391
  }) }),
385
392
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
386
- Re,
393
+ ze,
387
394
  {
388
- ...V,
389
- onPageChange: (i) => t == null ? void 0 : t({ ...v, page: i }),
390
- currentPage: l == null ? void 0 : l.page,
391
- totalPages: l == null ? void 0 : l.totalPages
395
+ ...K,
396
+ onPageChange: (r) => t == null ? void 0 : t({ ...s, page: r }),
397
+ currentPage: d == null ? void 0 : d.page,
398
+ totalPages: d == null ? void 0 : d.totalPages
392
399
  }
393
400
  ) })
394
401
  ] })
@@ -397,7 +404,7 @@ const He = me(function({
397
404
  );
398
405
  };
399
406
  export {
400
- Ce as DataTable,
401
- Je as MyTable
407
+ Ve as DataTable,
408
+ Be as MyTable
402
409
  };
403
410
  //# sourceMappingURL=index.es.js.map