dgz-ui-shared 1.2.26 → 1.2.27

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