@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.
- package/dist/{AppActions-C_0YI75w.js → AppActions-BMq9aQrB.js} +1 -1
- package/dist/{AppSubTitle-tqqV9nuT.js → AppSubTitle-DIQetGjl.js} +1 -1
- package/dist/{ErrorAlert-BDqDHUUc.js → ErrorAlert-DClCk3Ey.js} +1 -1
- package/dist/{GenericForm-CWXT5wiv.js → GenericForm-D1TP41Gp.js} +6 -6
- package/dist/{ImageInput-CN2ozjpc.js → ImageInput-DnoBhP4X.js} +2 -2
- package/dist/{MultiSelect-BF0zL0B0.js → MultiSelect-O9AljNco.js} +2 -2
- package/dist/{SearchInput-BQyRXzCv.js → SearchInput-BEqCjP6R.js} +3 -3
- package/dist/{behavior-D3JNfIVJ.js → behavior-DDtrNBAq.js} +1 -1
- package/dist/{cards-Bkwz7WQM.js → cards-3sbUuHR0.js} +1 -1
- package/dist/{charts-CXhVUqLH.js → charts-CwT9AFWj.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +3 -3
- package/dist/components/core/filters/index.js +5 -5
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +17 -17
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +5 -5
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts +2 -1
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +2 -1
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +4 -4
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +17 -17
- package/dist/components/ui/index.js +2 -2
- package/dist/{dialogs-BGHSClsq.js → dialogs-CVA3y-o4.js} +5 -5
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/ui/index.js +3 -3
- package/dist/hooks/ui/useLanguage.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +4 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/{i18n-Dw99bRmg.js → i18n-DW5zKBEK.js} +6 -2
- package/dist/{language-BQpuOau0.js → language-Cn7U026J.js} +2 -2
- package/dist/{navbar-G9FexEW-.js → navbar-DLxNVUU9.js} +3 -3
- package/dist/{sheet-CRrYTZrl.js → sheet-B8mCfCPe.js} +1 -1
- package/dist/{states-N8-LjFng.js → states-BusGNKku.js} +2 -2
- package/dist/{table-DhdShTkb.js → table-BGKIqR2y.js} +144 -135
- package/dist/{theme-BGakUJ9c.js → theme-Ck_D5xtg.js} +2 -2
- package/dist/{ui-CmUIUFnk.js → ui-Dg7lq9J8.js} +2 -2
- package/dist/{ui-CiX0E_bn.js → ui-hvA1osvS.js} +1 -1
- package/dist/useLanguage-B1dusDJk.js +23 -0
- package/dist/{useTheme-DVfcJ-Qd.js → useTheme-D1APOG9I.js} +1 -1
- package/package.json +1 -1
- 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-
|
|
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-
|
|
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
|
|
11
|
+
var k = [
|
|
11
12
|
5,
|
|
12
13
|
10,
|
|
13
14
|
30,
|
|
14
15
|
50,
|
|
15
16
|
100
|
|
16
|
-
],
|
|
17
|
+
], A = k[1];
|
|
17
18
|
//#endregion
|
|
18
19
|
//#region src/components/core/table/TableActions.tsx
|
|
19
|
-
function
|
|
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
|
|
70
|
+
var M = {
|
|
70
71
|
left: "text-left",
|
|
71
72
|
center: "text-center",
|
|
72
73
|
right: "text-right"
|
|
73
74
|
};
|
|
74
|
-
function
|
|
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
|
|
80
|
-
return
|
|
80
|
+
function P(e) {
|
|
81
|
+
return M[e];
|
|
81
82
|
}
|
|
82
83
|
//#endregion
|
|
83
84
|
//#region src/components/core/table/fixedColumns.ts
|
|
84
|
-
var
|
|
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
|
|
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 ?
|
|
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
|
|
108
|
-
let { t:
|
|
109
|
-
let n =
|
|
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:
|
|
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 ??
|
|
151
|
+
children: r ?? E("states.noResult")
|
|
151
152
|
}) })
|
|
152
153
|
});
|
|
153
|
-
let
|
|
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 ${
|
|
160
|
-
onClick: (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
|
-
|
|
163
|
-
className: `p-1 text-center align-middle ${
|
|
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
|
-
...
|
|
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:
|
|
184
|
+
checked: d.includes(t),
|
|
177
185
|
onCheckedChange: () => {
|
|
178
|
-
|
|
186
|
+
f(t);
|
|
179
187
|
}
|
|
180
188
|
})
|
|
181
189
|
})
|
|
182
190
|
}) : null,
|
|
183
|
-
|
|
184
|
-
let r = n ===
|
|
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 ${
|
|
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
|
-
...
|
|
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:
|
|
201
|
+
children: k(e, t.key)
|
|
194
202
|
})
|
|
195
203
|
}, t.key);
|
|
196
204
|
}),
|
|
197
|
-
|
|
198
|
-
className: `p-1 text-right align-middle whitespace-nowrap ${
|
|
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
|
-
...
|
|
209
|
+
...M.style
|
|
202
210
|
},
|
|
203
211
|
onClick: (e) => {
|
|
204
212
|
e.stopPropagation();
|
|
205
213
|
},
|
|
206
|
-
children:
|
|
214
|
+
children: y !== void 0 && y.length > 0 ? /* @__PURE__ */ g("div", {
|
|
207
215
|
className: "flex items-center justify-end",
|
|
208
|
-
children: /* @__PURE__ */ g(
|
|
209
|
-
actions:
|
|
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
|
|
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
|
|
270
|
+
var V = {
|
|
263
271
|
left: "justify-start",
|
|
264
272
|
center: "justify-center",
|
|
265
273
|
right: "justify-end"
|
|
266
274
|
};
|
|
267
|
-
function
|
|
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 =
|
|
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
|
-
|
|
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 ${
|
|
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
|
-
},
|
|
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":
|
|
333
|
+
"data-column-key": F,
|
|
326
334
|
"data-fixed-side": D ? "left" : void 0,
|
|
327
|
-
className: `p-1 text-center align-middle ${
|
|
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
|
-
...
|
|
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":
|
|
352
|
+
"data-column-key": I,
|
|
345
353
|
"data-fixed-side": O ? "right" : void 0,
|
|
346
|
-
className: `p-1 text-right align-middle ${
|
|
354
|
+
className: `p-1 text-right align-middle ${L.className}`,
|
|
347
355
|
style: {
|
|
348
356
|
minWidth: "32px",
|
|
349
|
-
...
|
|
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
|
|
359
|
-
function
|
|
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
|
|
363
|
-
if (n * 2 + 5 >= t) return
|
|
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
|
-
...
|
|
367
|
-
|
|
374
|
+
...W(1, n + 2),
|
|
375
|
+
U,
|
|
368
376
|
t
|
|
369
377
|
] : a && !o ? [
|
|
370
378
|
1,
|
|
371
|
-
|
|
372
|
-
...
|
|
379
|
+
U,
|
|
380
|
+
...W(t - (n + 2) + 1, t)
|
|
373
381
|
] : [
|
|
374
382
|
1,
|
|
375
|
-
|
|
376
|
-
...
|
|
377
|
-
|
|
383
|
+
U,
|
|
384
|
+
...W(r, i),
|
|
385
|
+
U,
|
|
378
386
|
t
|
|
379
387
|
];
|
|
380
388
|
}
|
|
381
|
-
function
|
|
382
|
-
let { t: y } = s(), b =
|
|
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 ===
|
|
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:
|
|
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
|
|
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
|
|
479
|
-
let { sortColumn:
|
|
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:
|
|
484
|
-
actions:
|
|
485
|
-
bulkActions:
|
|
486
|
-
columnVisibility:
|
|
487
|
-
totalRows:
|
|
488
|
-
currentPage:
|
|
489
|
-
pageSize:
|
|
490
|
-
onPageChange:
|
|
491
|
-
onPageSizeChange:
|
|
492
|
-
sortColumn:
|
|
493
|
-
sortDirection:
|
|
494
|
-
onSortChange:
|
|
495
|
-
}),
|
|
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: [
|
|
499
|
-
selectedRows:
|
|
500
|
-
setSelectedRows:
|
|
501
|
-
bulkActions:
|
|
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:
|
|
515
|
+
ref: G,
|
|
508
516
|
className: "w-full",
|
|
509
|
-
children: [/* @__PURE__ */ g(
|
|
510
|
-
hasBulkActions:
|
|
511
|
-
selectedRows:
|
|
517
|
+
children: [/* @__PURE__ */ g(H, {
|
|
518
|
+
hasBulkActions: Y,
|
|
519
|
+
selectedRows: P,
|
|
512
520
|
totalItems: e.length,
|
|
513
|
-
toggleSelectAll:
|
|
514
|
-
visibleColumnsArray:
|
|
515
|
-
draggableColumns:
|
|
516
|
-
resizableColumns:
|
|
517
|
-
columnWidths:
|
|
518
|
-
sortColumn:
|
|
519
|
-
sortDirection:
|
|
520
|
-
handleSort:
|
|
521
|
-
handleDragStart:
|
|
522
|
-
handleDragOver:
|
|
523
|
-
handleDrop:
|
|
524
|
-
handleMouseDown:
|
|
525
|
-
hasActions:
|
|
526
|
-
bordered:
|
|
527
|
-
dense:
|
|
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:
|
|
530
|
-
fixedActions:
|
|
531
|
-
settingsNode:
|
|
537
|
+
fixedSelection: de,
|
|
538
|
+
fixedActions: v,
|
|
539
|
+
settingsNode: l ? /* @__PURE__ */ g(q, {
|
|
532
540
|
columns: t,
|
|
533
|
-
visibleColumns:
|
|
534
|
-
toggleColumnVisibility:
|
|
541
|
+
visibleColumns: I,
|
|
542
|
+
toggleColumnVisibility: ae
|
|
535
543
|
}) : void 0
|
|
536
|
-
}), /* @__PURE__ */ g(
|
|
537
|
-
bordered:
|
|
538
|
-
dense:
|
|
539
|
-
isLoading:
|
|
540
|
-
error:
|
|
541
|
-
colSpanCount:
|
|
542
|
-
noDataMessage:
|
|
543
|
-
paginatedData:
|
|
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
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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:
|
|
563
|
+
resizableColumns: c,
|
|
555
564
|
fixedColumns: $
|
|
556
565
|
})]
|
|
557
566
|
})
|
|
558
|
-
}), /* @__PURE__ */ g(
|
|
559
|
-
totalItems:
|
|
560
|
-
startIndex:
|
|
561
|
-
endIndex:
|
|
562
|
-
pageSize:
|
|
563
|
-
setPageSize:
|
|
564
|
-
currentPage:
|
|
565
|
-
setCurrentPage:
|
|
566
|
-
pageSizeOptions:
|
|
567
|
-
totalPages:
|
|
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 {
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
+
import "./useLanguage-B1dusDJk.js";
|
|
6
6
|
import "./useDocumentTitle-D7MywIeB.js";
|
|
7
7
|
import "./useFixedColumns-DnzqhbfT.js";
|
|
8
|
-
import "./useTheme-
|
|
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-
|
|
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 };
|
package/package.json
CHANGED
|
@@ -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 };
|