@krosoft/react 0.0.251 → 0.0.253

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 (51) hide show
  1. package/dist/{AppActions-C_0YI75w.js → AppActions-BMq9aQrB.js} +1 -1
  2. package/dist/{AppSubTitle-tqqV9nuT.js → AppSubTitle-DIQetGjl.js} +1 -1
  3. package/dist/{ErrorAlert-BDqDHUUc.js → ErrorAlert-DClCk3Ey.js} +1 -1
  4. package/dist/{GenericForm-CWXT5wiv.js → GenericForm-D1TP41Gp.js} +6 -6
  5. package/dist/{ImageInput-CN2ozjpc.js → ImageInput-DnoBhP4X.js} +2 -2
  6. package/dist/{MultiSelect-BF0zL0B0.js → MultiSelect-O9AljNco.js} +2 -2
  7. package/dist/{SearchInput-BQyRXzCv.js → SearchInput-BEqCjP6R.js} +3 -3
  8. package/dist/{behavior-D3JNfIVJ.js → behavior-DDtrNBAq.js} +1 -1
  9. package/dist/{cards-Bkwz7WQM.js → cards-3sbUuHR0.js} +1 -1
  10. package/dist/{charts-CXhVUqLH.js → charts-CwT9AFWj.js} +1 -1
  11. package/dist/components/core/cards/index.js +1 -1
  12. package/dist/components/core/charts/index.js +1 -1
  13. package/dist/components/core/dialogs/index.js +3 -3
  14. package/dist/components/core/filters/index.js +5 -5
  15. package/dist/components/core/forms/index.js +1 -1
  16. package/dist/components/core/index.js +17 -17
  17. package/dist/components/core/inputs/index.js +3 -3
  18. package/dist/components/core/language/index.js +1 -1
  19. package/dist/components/core/layouts/index.js +5 -5
  20. package/dist/components/core/navbar/index.js +1 -1
  21. package/dist/components/core/states/index.js +2 -2
  22. package/dist/components/core/table/DataTable.d.ts +2 -1
  23. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  24. package/dist/components/core/table/TableBody.d.ts +2 -1
  25. package/dist/components/core/table/TableBody.d.ts.map +1 -1
  26. package/dist/components/core/table/index.js +1 -1
  27. package/dist/components/core/tabs/index.js +4 -4
  28. package/dist/components/core/theme/index.js +1 -1
  29. package/dist/components/index.js +17 -17
  30. package/dist/components/ui/index.js +2 -2
  31. package/dist/{dialogs-BGHSClsq.js → dialogs-CVA3y-o4.js} +5 -5
  32. package/dist/hooks/behavior/index.js +1 -1
  33. package/dist/hooks/index.js +4 -4
  34. package/dist/hooks/ui/index.js +3 -3
  35. package/dist/hooks/ui/useLanguage.d.ts.map +1 -1
  36. package/dist/i18n/index.js +1 -1
  37. package/dist/i18n/krosoftLocales.d.ts +4 -0
  38. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  39. package/dist/{i18n-Dw99bRmg.js → i18n-DW5zKBEK.js} +6 -2
  40. package/dist/{language-BQpuOau0.js → language-Cn7U026J.js} +2 -2
  41. package/dist/{navbar-G9FexEW-.js → navbar-DLxNVUU9.js} +3 -3
  42. package/dist/{sheet-CRrYTZrl.js → sheet-B8mCfCPe.js} +1 -1
  43. package/dist/{states-N8-LjFng.js → states-BusGNKku.js} +2 -2
  44. package/dist/{table-DhdShTkb.js → table-BGKIqR2y.js} +144 -135
  45. package/dist/{theme-BGakUJ9c.js → theme-Ck_D5xtg.js} +2 -2
  46. package/dist/{ui-CmUIUFnk.js → ui-Dg7lq9J8.js} +2 -2
  47. package/dist/{ui-CiX0E_bn.js → ui-hvA1osvS.js} +1 -1
  48. package/dist/useLanguage-B1dusDJk.js +23 -0
  49. package/dist/{useTheme-DVfcJ-Qd.js → useTheme-D1APOG9I.js} +1 -1
  50. package/package.json +1 -1
  51. package/dist/useLanguage-DN3CuBv5.js +0 -19
@@ -1,22 +1,23 @@
1
- import { Ft as e, Gt as t, Mt as n, Nt as r, bn as i, jt as a } from "./ui-CiX0E_bn.js";
1
+ import { Ft as e, Gt as t, Mt as n, Nt as r, bn as i, jt as a } from "./ui-hvA1osvS.js";
2
2
  import { s as o } from "./tooltip-B2dzyfs9.js";
3
- import { t as s } from "./i18n-Dw99bRmg.js";
3
+ import { t as s } from "./i18n-DW5zKBEK.js";
4
4
  import { i as c, l, n as u, t as d, u as f } from "./select-ULiTPOr5.js";
5
5
  import { n as p, t as m } from "./useFixedColumns-DnzqhbfT.js";
6
6
  import "react";
7
7
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
8
  import { AlertTriangleIcon as v, ArrowDownIcon as y, ArrowUpDownIcon as b, ArrowUpIcon as x, ChevronLeftIcon as S, ChevronRightIcon as C, GripVerticalIcon as w, Loader2Icon as T, MoreVerticalIcon as E, SettingsIcon as D } from "lucide-react";
9
+ import { useNavigate as O } from "react-router-dom";
9
10
  //#region src/constants/datatable.ts
10
- var O = [
11
+ var k = [
11
12
  5,
12
13
  10,
13
14
  30,
14
15
  50,
15
16
  100
16
- ], k = O[1];
17
+ ], A = k[1];
17
18
  //#endregion
18
19
  //#region src/components/core/table/TableActions.tsx
19
- function A({ actions: n, row: i }) {
20
+ function j({ actions: n, row: i }) {
20
21
  let s = n.filter((e) => e.visible === void 0 || e.visible(i));
21
22
  if (s.length === 0) return null;
22
23
  let c = s.filter((e) => e.overflow !== !0), l = s.filter((e) => e.overflow === !0);
@@ -66,26 +67,26 @@ function A({ actions: n, row: i }) {
66
67
  }
67
68
  //#endregion
68
69
  //#region src/components/core/table/columnAlignment.ts
69
- var j = {
70
+ var M = {
70
71
  left: "text-left",
71
72
  center: "text-center",
72
73
  right: "text-right"
73
74
  };
74
- function M(e) {
75
+ function N(e) {
75
76
  if (e.align !== void 0) return e.align;
76
77
  let t = (e.className ?? "").split(/\s+/);
77
78
  return t.includes("text-right") ? "right" : t.includes("text-center") ? "center" : "left";
78
79
  }
79
- function N(e) {
80
- return j[e];
80
+ function P(e) {
81
+ return M[e];
81
82
  }
82
83
  //#endregion
83
84
  //#region src/components/core/table/fixedColumns.ts
84
- var P = "__selection__", F = "__actions__", I = {
85
+ var F = "__selection__", I = "__actions__", L = {
85
86
  left: "border-r border-gray-200 dark:border-gray-800",
86
87
  right: "border-l border-gray-200 dark:border-gray-800"
87
88
  };
88
- function L(e, t) {
89
+ function R(e, t) {
89
90
  if (e === void 0) return {
90
91
  className: "relative",
91
92
  style: {}
@@ -97,16 +98,16 @@ function L(e, t) {
97
98
  n ? "z-20" : "z-10",
98
99
  "before:absolute before:inset-0 before:-z-10 before:pointer-events-none",
99
100
  n ? "before:bg-muted/50 dark:before:bg-gray-900/50" : "group-hover:before:bg-muted/50 dark:group-hover:before:bg-gray-900/50",
100
- e.isEdge ? I[e.side] : ""
101
+ e.isEdge ? L[e.side] : ""
101
102
  ].filter(Boolean).join(" "),
102
103
  style: e.side === "left" ? { left: e.offset } : { right: e.offset }
103
104
  };
104
105
  }
105
106
  //#endregion
106
107
  //#region src/components/core/table/TableBody.tsx
107
- function R({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginatedData: a, getRowId: o, onRowClick: c, hasBulkActions: l, selectedRows: u, toggleRowSelection: d, visibleColumnsArray: f, columnWidths: p, hasActions: m, actions: h, columns: y, bordered: b = !1, dense: x = !1, resizableColumns: S = !1, fixedColumns: C = {} }) {
108
- let { t: w } = s(), E = (e, t) => {
109
- let n = y.find((e) => e.key === t);
108
+ function z({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginatedData: a, getRowId: o, onRowClick: c, onRowNavigate: l, hasBulkActions: u, selectedRows: d, toggleRowSelection: f, visibleColumnsArray: p, columnWidths: m, hasActions: h, actions: y, columns: b, bordered: x = !1, dense: S = !1, resizableColumns: C = !1, fixedColumns: w = {} }) {
109
+ let { t: E } = s(), D = O(), k = (e, t) => {
110
+ let n = b.find((e) => e.key === t);
110
111
  if (n?.renderCell !== void 0) return n.renderCell(e);
111
112
  let r = e[t];
112
113
  return /* @__PURE__ */ g("span", {
@@ -123,7 +124,7 @@ function R({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginate
123
124
  className: "flex flex-col items-center justify-center gap-2 text-muted-foreground",
124
125
  children: [/* @__PURE__ */ g(T, { className: "h-6 w-6 animate-spin text-primary" }), /* @__PURE__ */ g("span", {
125
126
  className: "text-sm",
126
- children: w("states.loading")
127
+ children: E("states.loading")
127
128
  })]
128
129
  })
129
130
  }) })
@@ -147,25 +148,32 @@ function R({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginate
147
148
  children: /* @__PURE__ */ g("tr", { children: /* @__PURE__ */ g("td", {
148
149
  colSpan: n,
149
150
  className: "py-8 text-center text-sm text-muted-foreground",
150
- children: r ?? w("states.noResult")
151
+ children: r ?? E("states.noResult")
151
152
  }) })
152
153
  });
153
- let D = L(C[P], "body"), O = L(C[F], "body");
154
+ let A = R(w[F], "body"), M = R(w[I], "body"), L = l !== void 0 || c !== void 0, z = (e, t) => {
155
+ if (l !== void 0) {
156
+ let n = l(e);
157
+ t.ctrlKey || t.metaKey ? window.open(n, "_blank") : D(n);
158
+ } else c?.(e, t);
159
+ };
154
160
  return /* @__PURE__ */ g("tbody", {
155
161
  className: "divide-y divide-gray-200 dark:divide-gray-800",
156
162
  children: a.map((e) => {
157
163
  let t = o(e);
158
164
  return /* @__PURE__ */ _("tr", {
159
- className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${c === void 0 ? "" : "cursor-pointer"}`,
160
- onClick: (t) => c?.(e, t),
165
+ className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${L ? "cursor-pointer" : ""}`,
166
+ onClick: (t) => {
167
+ z(e, t);
168
+ },
161
169
  children: [
162
- l ? /* @__PURE__ */ g("td", {
163
- className: `p-1 text-center align-middle ${D.className}`,
170
+ u ? /* @__PURE__ */ g("td", {
171
+ className: `p-1 text-center align-middle ${A.className}`,
164
172
  style: {
165
173
  width: "48px",
166
174
  minWidth: "48px",
167
175
  maxWidth: "48px",
168
- ...D.style
176
+ ...A.style
169
177
  },
170
178
  onClick: (e) => {
171
179
  e.stopPropagation();
@@ -173,40 +181,40 @@ function R({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginate
173
181
  children: /* @__PURE__ */ g("div", {
174
182
  className: "flex items-center justify-center",
175
183
  children: /* @__PURE__ */ g(i, {
176
- checked: u.includes(t),
184
+ checked: d.includes(t),
177
185
  onCheckedChange: () => {
178
- d(t);
186
+ f(t);
179
187
  }
180
188
  })
181
189
  })
182
190
  }) : null,
183
- f.map((t, n) => {
184
- let r = n === f.length - 1, i = L(C[t.key], "body");
191
+ p.map((t, n) => {
192
+ let r = n === p.length - 1, i = R(w[t.key], "body");
185
193
  return /* @__PURE__ */ g("td", {
186
- className: `px-2 ${x ? "py-2" : "py-4"} ${N(M(t))} ${i.className} ${b && !r ? "border-r border-gray-100 dark:border-gray-800" : ""} ${t.className ?? ""}`,
194
+ className: `px-2 ${S ? "py-2" : "py-4"} ${P(N(t))} ${i.className} ${x && !r ? "border-r border-gray-100 dark:border-gray-800" : ""} ${t.className ?? ""}`,
187
195
  style: {
188
- ...S ? { width: p[t.key] } : { minWidth: p[t.key] },
196
+ ...C ? { width: m[t.key] } : { minWidth: m[t.key] },
189
197
  ...i.style
190
198
  },
191
199
  children: /* @__PURE__ */ g("div", {
192
200
  className: "w-full h-full",
193
- children: E(e, t.key)
201
+ children: k(e, t.key)
194
202
  })
195
203
  }, t.key);
196
204
  }),
197
- m ? /* @__PURE__ */ g("td", {
198
- className: `p-1 text-right align-middle whitespace-nowrap ${O.className}`,
205
+ h ? /* @__PURE__ */ g("td", {
206
+ className: `p-1 text-right align-middle whitespace-nowrap ${M.className}`,
199
207
  style: {
200
208
  minWidth: "32px",
201
- ...O.style
209
+ ...M.style
202
210
  },
203
211
  onClick: (e) => {
204
212
  e.stopPropagation();
205
213
  },
206
- children: h !== void 0 && h.length > 0 ? /* @__PURE__ */ g("div", {
214
+ children: y !== void 0 && y.length > 0 ? /* @__PURE__ */ g("div", {
207
215
  className: "flex items-center justify-end",
208
- children: /* @__PURE__ */ g(A, {
209
- actions: h,
216
+ children: /* @__PURE__ */ g(j, {
217
+ actions: y,
210
218
  row: e
211
219
  })
212
220
  }) : null
@@ -218,7 +226,7 @@ function R({ isLoading: e, error: t, colSpanCount: n, noDataMessage: r, paginate
218
226
  }
219
227
  //#endregion
220
228
  //#region src/components/core/table/TableBulkActions.tsx
221
- function z({ selectedRows: e, setSelectedRows: t, bulkActions: n }) {
229
+ function B({ selectedRows: e, setSelectedRows: t, bulkActions: n }) {
222
230
  return /* @__PURE__ */ _("div", {
223
231
  className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-surface",
224
232
  children: [/* @__PURE__ */ _("div", {
@@ -259,22 +267,22 @@ function z({ selectedRows: e, setSelectedRows: t, bulkActions: n }) {
259
267
  }
260
268
  //#endregion
261
269
  //#region src/components/core/table/TableHeader.tsx
262
- var B = {
270
+ var V = {
263
271
  left: "justify-start",
264
272
  center: "justify-center",
265
273
  right: "justify-end"
266
274
  };
267
- function V({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll: r, visibleColumnsArray: a, draggableColumns: o, resizableColumns: s, columnWidths: c, sortColumn: l, sortDirection: u, handleSort: d, handleDragStart: f, handleDragOver: p, handleDrop: m, handleMouseDown: h, hasActions: v, settingsNode: S, bordered: C = !1, dense: T = !1, fixedColumns: E = {}, fixedSelection: D = !1, fixedActions: O = !1 }) {
275
+ function H({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll: r, visibleColumnsArray: a, draggableColumns: o, resizableColumns: s, columnWidths: c, sortColumn: l, sortDirection: u, handleSort: d, handleDragStart: f, handleDragOver: p, handleDrop: m, handleMouseDown: h, hasActions: v, settingsNode: S, bordered: C = !1, dense: T = !1, fixedColumns: E = {}, fixedSelection: D = !1, fixedActions: O = !1 }) {
268
276
  let k = !1;
269
277
  t.length === n && n > 0 ? k = !0 : t.length > 0 && (k = "indeterminate");
270
278
  let A = (e) => e.sortable === !0 ? l === e.key ? g(u === "asc" ? x : y, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ g(b, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }) : null, j = (e, t) => {
271
- let n = t !== !1 && e.fixed === void 0, r = e.sortable === !0, i = L(E[e.key], "header"), a = M(e), o = A(e);
279
+ let n = t !== !1 && e.fixed === void 0, r = e.sortable === !0, i = R(E[e.key], "header"), a = N(e), o = A(e);
272
280
  return /* @__PURE__ */ _("th", {
273
281
  "data-column-key": e.key,
274
282
  "data-fixed-side": e.fixed,
275
283
  className: [
276
284
  `px-2 ${T ? "py-2" : "py-4"} text-sm font-medium text-gray-900 dark:text-gray-100 group`,
277
- N(a),
285
+ P(a),
278
286
  i.className,
279
287
  C ? "border-r border-gray-200 dark:border-gray-800" : "",
280
288
  r ? "cursor-pointer select-none" : "",
@@ -298,7 +306,7 @@ function V({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll:
298
306
  m(t, e.key);
299
307
  },
300
308
  children: [/* @__PURE__ */ _("div", {
301
- className: `flex items-center gap-1 ${B[a]} ${s ? "pr-2" : ""}`,
309
+ className: `flex items-center gap-1 ${V[a]} ${s ? "pr-2" : ""}`,
302
310
  children: [
303
311
  n ? /* @__PURE__ */ g(w, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
304
312
  /* @__PURE__ */ g("span", {
@@ -317,19 +325,19 @@ function V({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll:
317
325
  }
318
326
  }) : null]
319
327
  }, e.key);
320
- }, I = L(E[P], "header"), R = L(E[F], "header");
328
+ }, M = R(E[F], "header"), L = R(E[I], "header");
321
329
  return /* @__PURE__ */ g("thead", {
322
330
  className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800",
323
331
  children: /* @__PURE__ */ _("tr", { children: [
324
332
  e ? /* @__PURE__ */ g("th", {
325
- "data-column-key": P,
333
+ "data-column-key": F,
326
334
  "data-fixed-side": D ? "left" : void 0,
327
- className: `p-1 text-center align-middle ${I.className}`,
335
+ className: `p-1 text-center align-middle ${M.className}`,
328
336
  style: {
329
337
  width: "48px",
330
338
  minWidth: "48px",
331
339
  maxWidth: "48px",
332
- ...I.style
340
+ ...M.style
333
341
  },
334
342
  children: /* @__PURE__ */ g("div", {
335
343
  className: "flex items-center justify-center",
@@ -341,12 +349,12 @@ function V({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll:
341
349
  }) : null,
342
350
  a.map((e) => j(e, o)),
343
351
  v || S !== void 0 ? /* @__PURE__ */ g("th", {
344
- "data-column-key": F,
352
+ "data-column-key": I,
345
353
  "data-fixed-side": O ? "right" : void 0,
346
- className: `p-1 text-right align-middle ${R.className}`,
354
+ className: `p-1 text-right align-middle ${L.className}`,
347
355
  style: {
348
356
  minWidth: "32px",
349
- ...R.style
357
+ ...L.style
350
358
  },
351
359
  children: S
352
360
  }) : null
@@ -355,31 +363,31 @@ function V({ hasBulkActions: e, selectedRows: t, totalItems: n, toggleSelectAll:
355
363
  }
356
364
  //#endregion
357
365
  //#region src/components/core/table/TablePagination.tsx
358
- var H = "…";
359
- function U(e, t) {
366
+ var U = "…";
367
+ function W(e, t) {
360
368
  return Array.from({ length: t - e + 1 }, (t, n) => e + n);
361
369
  }
362
- function W(e, t, n = 1) {
363
- if (n * 2 + 5 >= t) return U(1, t);
370
+ function G(e, t, n = 1) {
371
+ if (n * 2 + 5 >= t) return W(1, t);
364
372
  let r = Math.max(e - n, 1), i = Math.min(e + n, t), a = r > 2, o = i < t - 1;
365
373
  return !a && o ? [
366
- ...U(1, n + 2),
367
- H,
374
+ ...W(1, n + 2),
375
+ U,
368
376
  t
369
377
  ] : a && !o ? [
370
378
  1,
371
- H,
372
- ...U(t - (n + 2) + 1, t)
379
+ U,
380
+ ...W(t - (n + 2) + 1, t)
373
381
  ] : [
374
382
  1,
375
- H,
376
- ...U(r, i),
377
- H,
383
+ U,
384
+ ...W(r, i),
385
+ U,
378
386
  t
379
387
  ];
380
388
  }
381
- function G({ totalItems: e, startIndex: t, endIndex: n, pageSize: r, setPageSize: i, currentPage: a, setCurrentPage: p, pageSizeOptions: m, totalPages: v }) {
382
- let { t: y } = s(), b = W(a, v);
389
+ function K({ totalItems: e, startIndex: t, endIndex: n, pageSize: r, setPageSize: i, currentPage: a, setCurrentPage: p, pageSizeOptions: m, totalPages: v }) {
390
+ let { t: y } = s(), b = G(a, v);
383
391
  return /* @__PURE__ */ _("div", {
384
392
  className: "px-4 py-2 border-t border-gray-200 dark:border-gray-800 flex flex-col sm:grid sm:grid-cols-3 items-center gap-2 bg-muted/50 dark:bg-gray-900/50",
385
393
  children: [
@@ -405,9 +413,9 @@ function G({ totalItems: e, startIndex: t, endIndex: n, pageSize: r, setPageSize
405
413
  "aria-label": y("table.previousPage"),
406
414
  children: /* @__PURE__ */ g(S, { className: "size-4" })
407
415
  }),
408
- b.map((e, t) => e === H ? /* @__PURE__ */ g("span", {
416
+ b.map((e, t) => e === U ? /* @__PURE__ */ g("span", {
409
417
  className: "flex h-8 w-8 items-center justify-center text-sm text-muted-foreground",
410
- children: H
418
+ children: U
411
419
  }, `dots-${String(t)}`) : /* @__PURE__ */ g(o, {
412
420
  variant: e === a ? "default" : "ghost",
413
421
  size: "icon",
@@ -452,7 +460,7 @@ function G({ totalItems: e, startIndex: t, endIndex: n, pageSize: r, setPageSize
452
460
  }
453
461
  //#endregion
454
462
  //#region src/components/core/table/TableSettings.tsx
455
- function K({ columns: e, visibleColumns: i, toggleColumnVisibility: s }) {
463
+ function q({ columns: e, visibleColumns: i, toggleColumnVisibility: s }) {
456
464
  return /* @__PURE__ */ _(a, { children: [/* @__PURE__ */ g(t, {
457
465
  asChild: !0,
458
466
  children: /* @__PURE__ */ g(o, {
@@ -475,99 +483,100 @@ function K({ columns: e, visibleColumns: i, toggleColumnVisibility: s }) {
475
483
  }
476
484
  //#endregion
477
485
  //#region src/components/core/table/DataTable.tsx
478
- function q({ data: e, columns: t, getRowId: n, onRowClick: r, actions: i, bulkActions: a, draggableColumns: o = !1, resizableColumns: s = !1, columnVisibility: c = !1, isLoading: l = !1, error: u = null, bordered: d = !1, dense: f = !1, fixedActions: h = !1, noDataMessage: v, defaultPageSize: y = k, pageSizeOptions: b = O, totalRows: x, currentPage: S, pageSize: C, onPageChange: w, onPageSizeChange: T, sortColumn: E, sortDirection: D, onSortChange: A }) {
479
- let { sortColumn: j, sortDirection: M, selectedRows: N, setSelectedRows: P, visibleColumns: F, columnWidths: I, safeCurrentPage: L, totalPages: B, startIndex: H, endIndex: U, tableRef: W, hasActions: q, hasBulkActions: J, visibleColumnsArray: Y, colSpanCount: X, paginatedData: Z, handleSort: Q, handleMouseDown: ee, handleDragStart: te, handleDragOver: ne, handleDrop: re, toggleColumnVisibility: ie, toggleRowSelection: ae, toggleSelectAll: oe, pageSize: se, setPageSize: ce, setCurrentPage: le } = p({
486
+ function J({ data: e, columns: t, getRowId: n, onRowClick: r, onRowNavigate: i, actions: a, bulkActions: o, draggableColumns: s = !1, resizableColumns: c = !1, columnVisibility: l = !1, isLoading: u = !1, error: d = null, bordered: f = !1, dense: h = !1, fixedActions: v = !1, noDataMessage: y, defaultPageSize: b = A, pageSizeOptions: x = k, totalRows: S, currentPage: C, pageSize: w, onPageChange: T, onPageSizeChange: E, sortColumn: D, sortDirection: O, onSortChange: j }) {
487
+ let { sortColumn: M, sortDirection: N, selectedRows: P, setSelectedRows: F, visibleColumns: I, columnWidths: L, safeCurrentPage: R, totalPages: V, startIndex: U, endIndex: W, tableRef: G, hasActions: J, hasBulkActions: Y, visibleColumnsArray: X, colSpanCount: Z, paginatedData: Q, handleSort: ee, handleMouseDown: te, handleDragStart: ne, handleDragOver: re, handleDrop: ie, toggleColumnVisibility: ae, toggleRowSelection: oe, toggleSelectAll: se, pageSize: ce, setPageSize: le, setCurrentPage: ue } = p({
480
488
  data: e,
481
489
  columns: t,
482
490
  getRowId: n,
483
- defaultPageSize: y,
484
- actions: i,
485
- bulkActions: a,
486
- columnVisibility: c,
487
- totalRows: x,
488
- currentPage: S,
489
- pageSize: C,
490
- onPageChange: w,
491
- onPageSizeChange: T,
492
- sortColumn: E,
493
- sortDirection: D,
494
- onSortChange: A
495
- }), ue = J && Y.some((e) => e.fixed === "left"), $ = m(W);
491
+ defaultPageSize: b,
492
+ actions: a,
493
+ bulkActions: o,
494
+ columnVisibility: l,
495
+ totalRows: S,
496
+ currentPage: C,
497
+ pageSize: w,
498
+ onPageChange: T,
499
+ onPageSizeChange: E,
500
+ sortColumn: D,
501
+ sortDirection: O,
502
+ onSortChange: j
503
+ }), de = Y && X.some((e) => e.fixed === "left"), $ = m(G);
496
504
  return /* @__PURE__ */ _("div", {
497
505
  className: "space-y-4 [--k-radius-control:var(--k-radius-control-dense,0.5rem)] [--k-radius-surface:var(--k-radius-surface-dense,0.75rem)]",
498
- children: [N.length > 0 && a !== void 0 && a.length > 0 && /* @__PURE__ */ g(z, {
499
- selectedRows: N,
500
- setSelectedRows: P,
501
- bulkActions: a
506
+ children: [P.length > 0 && o !== void 0 && o.length > 0 && /* @__PURE__ */ g(B, {
507
+ selectedRows: P,
508
+ setSelectedRows: F,
509
+ bulkActions: o
502
510
  }), /* @__PURE__ */ _("div", {
503
511
  className: "w-full bg-card dark:bg-gray-950 rounded-surface border border-gray-200 dark:border-gray-800 overflow-hidden",
504
512
  children: [/* @__PURE__ */ g("div", {
505
513
  className: "overflow-x-auto",
506
514
  children: /* @__PURE__ */ _("table", {
507
- ref: W,
515
+ ref: G,
508
516
  className: "w-full",
509
- children: [/* @__PURE__ */ g(V, {
510
- hasBulkActions: J,
511
- selectedRows: N,
517
+ children: [/* @__PURE__ */ g(H, {
518
+ hasBulkActions: Y,
519
+ selectedRows: P,
512
520
  totalItems: e.length,
513
- toggleSelectAll: oe,
514
- visibleColumnsArray: Y,
515
- draggableColumns: o,
516
- resizableColumns: s,
517
- columnWidths: I,
518
- sortColumn: j,
519
- sortDirection: M,
520
- handleSort: Q,
521
- handleDragStart: te,
522
- handleDragOver: ne,
523
- handleDrop: re,
524
- handleMouseDown: ee,
525
- hasActions: q,
526
- bordered: d,
527
- dense: f,
521
+ toggleSelectAll: se,
522
+ visibleColumnsArray: X,
523
+ draggableColumns: s,
524
+ resizableColumns: c,
525
+ columnWidths: L,
526
+ sortColumn: M,
527
+ sortDirection: N,
528
+ handleSort: ee,
529
+ handleDragStart: ne,
530
+ handleDragOver: re,
531
+ handleDrop: ie,
532
+ handleMouseDown: te,
533
+ hasActions: J,
534
+ bordered: f,
535
+ dense: h,
528
536
  fixedColumns: $,
529
- fixedSelection: ue,
530
- fixedActions: h,
531
- settingsNode: c ? /* @__PURE__ */ g(K, {
537
+ fixedSelection: de,
538
+ fixedActions: v,
539
+ settingsNode: l ? /* @__PURE__ */ g(q, {
532
540
  columns: t,
533
- visibleColumns: F,
534
- toggleColumnVisibility: ie
541
+ visibleColumns: I,
542
+ toggleColumnVisibility: ae
535
543
  }) : void 0
536
- }), /* @__PURE__ */ g(R, {
537
- bordered: d,
538
- dense: f,
539
- isLoading: l,
540
- error: u,
541
- colSpanCount: X,
542
- noDataMessage: v,
543
- paginatedData: Z,
544
+ }), /* @__PURE__ */ g(z, {
545
+ bordered: f,
546
+ dense: h,
547
+ isLoading: u,
548
+ error: d,
549
+ colSpanCount: Z,
550
+ noDataMessage: y,
551
+ paginatedData: Q,
544
552
  getRowId: n,
545
553
  onRowClick: r,
546
- hasBulkActions: J,
547
- selectedRows: N,
548
- toggleRowSelection: ae,
549
- visibleColumnsArray: Y,
550
- columnWidths: I,
551
- hasActions: q || c,
552
- actions: i,
554
+ onRowNavigate: i,
555
+ hasBulkActions: Y,
556
+ selectedRows: P,
557
+ toggleRowSelection: oe,
558
+ visibleColumnsArray: X,
559
+ columnWidths: L,
560
+ hasActions: J || l,
561
+ actions: a,
553
562
  columns: t,
554
- resizableColumns: s,
563
+ resizableColumns: c,
555
564
  fixedColumns: $
556
565
  })]
557
566
  })
558
- }), /* @__PURE__ */ g(G, {
559
- totalItems: x ?? e.length,
560
- startIndex: H,
561
- endIndex: U,
562
- pageSize: se,
563
- setPageSize: ce,
564
- currentPage: L,
565
- setCurrentPage: le,
566
- pageSizeOptions: b,
567
- totalPages: B
567
+ }), /* @__PURE__ */ g(K, {
568
+ totalItems: S ?? e.length,
569
+ startIndex: U,
570
+ endIndex: W,
571
+ pageSize: ce,
572
+ setPageSize: le,
573
+ currentPage: R,
574
+ setCurrentPage: ue,
575
+ pageSizeOptions: x,
576
+ totalPages: V
568
577
  })]
569
578
  })]
570
579
  });
571
580
  }
572
581
  //#endregion
573
- export { z as a, P as c, M as d, A as f, V as i, L as l, K as n, R as o, G as r, F as s, q as t, N as u };
582
+ export { B as a, F as c, N as d, j as f, H as i, R as l, q as n, z as o, K as r, I as s, J as t, P as u };
@@ -1,7 +1,7 @@
1
1
  import { i as e, n as t, r as n, s as r, t as i } from "./tooltip-B2dzyfs9.js";
2
- import { t as a } from "./i18n-Dw99bRmg.js";
2
+ import { t as a } from "./i18n-DW5zKBEK.js";
3
3
  import { i as o, l as s, n as c, t as l, u } from "./select-ULiTPOr5.js";
4
- import { t as d } from "./useTheme-DVfcJ-Qd.js";
4
+ import { t as d } from "./useTheme-D1APOG9I.js";
5
5
  import "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  //#region src/components/core/theme/ThemeSelector.tsx
@@ -2,10 +2,10 @@ import "./useScrollFade-D9kqJBDh.js";
2
2
  import "./useToast-UeDRLovh.js";
3
3
  import "./useMobile-pTQ8lWvt.js";
4
4
  import "./useNotifications-CyhTruIG.js";
5
- import "./useLanguage-DN3CuBv5.js";
5
+ import "./useLanguage-B1dusDJk.js";
6
6
  import "./useDocumentTitle-D7MywIeB.js";
7
7
  import "./useFixedColumns-DnzqhbfT.js";
8
- import "./useTheme-DVfcJ-Qd.js";
8
+ import "./useTheme-D1APOG9I.js";
9
9
  import { useCallback as e, useEffect as t, useState as n } from "react";
10
10
  //#region src/hooks/ui/useServerTable.ts
11
11
  function r(r, i = "nom", a = {}) {
@@ -3,7 +3,7 @@ import "./helpers/index.js";
3
3
  import "./chart-Dq3AIrue.js";
4
4
  import "./alert-REQGK9bR.js";
5
5
  import { c as t, s as n } from "./tooltip-B2dzyfs9.js";
6
- import "./sheet-CRrYTZrl.js";
6
+ import "./sheet-B8mCfCPe.js";
7
7
  import "./select-ULiTPOr5.js";
8
8
  import "./skeleton-D6Ga4BLw.js";
9
9
  import { t as r } from "./useScrollFade-D9kqJBDh.js";
@@ -0,0 +1,23 @@
1
+ import { t as e } from "./i18n-DW5zKBEK.js";
2
+ import { t } from "./useNotifications-CyhTruIG.js";
3
+ import { useTranslation as n } from "react-i18next";
4
+ //#region src/hooks/ui/useLanguage.ts
5
+ function r(r) {
6
+ let { i18n: i } = n(), { t: a } = e(), { showSuccess: o } = t(), s = i.language ?? "", c = s.split("-")[0], l = r.find((e) => e.value === s) ?? r.find((e) => e.value === c) ?? r[0], u = r.findIndex((e) => e.value === l?.value), d = r.length > 0 ? r[(u + 1) % r.length] : void 0, f = (e) => {
7
+ i.changeLanguage(e);
8
+ let t = e.split("-")[0], n = r.find((t) => t.value === e) ?? r.find((e) => e.value === t);
9
+ o(a("language.updatedTitle"), a("language.updatedMessage", { language: n?.label ?? e }));
10
+ };
11
+ return {
12
+ language: s,
13
+ languageOptions: r,
14
+ currentLanguageOption: l,
15
+ nextLanguageOption: d,
16
+ changeLanguage: f,
17
+ cycleLanguage: () => {
18
+ d && f(d.value);
19
+ }
20
+ };
21
+ }
22
+ //#endregion
23
+ export { r as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-Dw99bRmg.js";
1
+ import { t as e } from "./i18n-DW5zKBEK.js";
2
2
  import { t } from "./useNotifications-CyhTruIG.js";
3
3
  import { useTheme as n } from "next-themes";
4
4
  //#region src/hooks/ui/useTheme.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.251",
3
+ "version": "0.0.253",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,19 +0,0 @@
1
- import { useTranslation as e } from "react-i18next";
2
- //#region src/hooks/ui/useLanguage.ts
3
- function t(t) {
4
- let { i18n: n } = e(), r = n.language ?? "", i = r.split("-")[0], a = t.find((e) => e.value === r) ?? t.find((e) => e.value === i) ?? t[0], o = t.findIndex((e) => e.value === a?.value), s = t.length > 0 ? t[(o + 1) % t.length] : void 0, c = (e) => {
5
- n.changeLanguage(e);
6
- };
7
- return {
8
- language: r,
9
- languageOptions: t,
10
- currentLanguageOption: a,
11
- nextLanguageOption: s,
12
- changeLanguage: c,
13
- cycleLanguage: () => {
14
- s && c(s.value);
15
- }
16
- };
17
- }
18
- //#endregion
19
- export { t };