nillud-data-table 1.4.6 → 1.4.8
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/index.js +84 -71
- package/package.json +2 -7
package/dist/index.js
CHANGED
|
@@ -18,8 +18,18 @@ var SortUp = () => {
|
|
|
18
18
|
};
|
|
19
19
|
var SortUp_default = SortUp;
|
|
20
20
|
|
|
21
|
+
// components/data-table/img/CloseIcon.tsx
|
|
22
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
23
|
+
var CloseIcon = ({
|
|
24
|
+
size = 16,
|
|
25
|
+
fill = "currentColor"
|
|
26
|
+
}) => {
|
|
27
|
+
return /* @__PURE__ */ jsx3("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill, className: "bi bi-x-circle-fill", viewBox: `0 0 ${size} ${size}`, children: /* @__PURE__ */ jsx3("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z" }) });
|
|
28
|
+
};
|
|
29
|
+
var CloseIcon_default = CloseIcon;
|
|
30
|
+
|
|
21
31
|
// components/data-table/Column.tsx
|
|
22
|
-
import { Fragment, jsx as
|
|
32
|
+
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
23
33
|
var Column = ({ column, getSortField, sortBy, getFilters, filters, selectedRows, toggleAllSelection, displayData }) => {
|
|
24
34
|
var _a;
|
|
25
35
|
const currentSort = useMemo(() => {
|
|
@@ -29,11 +39,11 @@ var Column = ({ column, getSortField, sortBy, getFilters, filters, selectedRows,
|
|
|
29
39
|
const nextType = currentSort === "asc" ? "desc" : "asc";
|
|
30
40
|
getSortField({ col: column.field, type: nextType });
|
|
31
41
|
};
|
|
32
|
-
const onFilterChange = (
|
|
33
|
-
getFilters({ ...filters, [column.field]:
|
|
42
|
+
const onFilterChange = (value) => {
|
|
43
|
+
getFilters({ ...filters, [column.field]: value });
|
|
34
44
|
};
|
|
35
45
|
const renderSelectable = () => {
|
|
36
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx4("div", { className: "ndt-column ndt-checkbox-column", children: /* @__PURE__ */ jsx4(
|
|
37
47
|
"input",
|
|
38
48
|
{
|
|
39
49
|
type: "checkbox",
|
|
@@ -46,38 +56,41 @@ var Column = ({ column, getSortField, sortBy, getFilters, filters, selectedRows,
|
|
|
46
56
|
if (column.headerFormatter) {
|
|
47
57
|
return column.headerFormatter(column.title);
|
|
48
58
|
}
|
|
49
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ jsx4("span", { title: `${column.title}`, children: column.title });
|
|
50
60
|
};
|
|
51
61
|
const renderColumnSort = () => {
|
|
52
62
|
if (typeof column.autoinc === "undefined" && (typeof column.sortable === "undefined" || column.sortable)) {
|
|
53
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ jsx4("div", { className: "ndt-sorter", role: "button", tabIndex: 1, onClick: toggleSort, children: currentSort === "asc" ? /* @__PURE__ */ jsx4(SortDown_default, {}) : currentSort === "desc" ? /* @__PURE__ */ jsx4(SortUp_default, {}) : /* @__PURE__ */ jsx4(SortDown_default, {}) });
|
|
54
64
|
}
|
|
55
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsx4(Fragment, {});
|
|
56
66
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ jsx4(Fragment, { children: column.selectable ? renderSelectable() : /* @__PURE__ */ jsxs("div", { className: "ndt-column", children: [
|
|
58
68
|
/* @__PURE__ */ jsxs("div", { className: "ndt-column-head", children: [
|
|
59
69
|
renderColumnHead(),
|
|
60
70
|
renderColumnSort()
|
|
61
71
|
] }),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
/* @__PURE__ */ jsx4("div", { className: "ndt-column-footer", children: typeof column.autoinc === "undefined" && (typeof column.filterable === "undefined" || column.filterable) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx4(
|
|
74
|
+
"input",
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
value: (_a = filters[column.field]) != null ? _a : "",
|
|
78
|
+
onChange: (e) => onFilterChange(e.target.value),
|
|
79
|
+
placeholder: column.filterPlaceholder || ""
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
filters[column.field] !== "" && /* @__PURE__ */ jsx4("span", { onClick: () => onFilterChange(""), children: /* @__PURE__ */ jsx4(CloseIcon_default, { size: 16, fill: "#707695" }) })
|
|
83
|
+
] }) })
|
|
71
84
|
] }) });
|
|
72
85
|
};
|
|
73
86
|
var Column_default = memo(Column);
|
|
74
87
|
|
|
75
88
|
// components/data-table/TableHeader.tsx
|
|
76
89
|
import { memo as memo2 } from "react";
|
|
77
|
-
import { Fragment as Fragment2, jsx as
|
|
90
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
78
91
|
var Header = ({ columns, getSortField, sortBy, getFilters, filters, widths, headerGroup, selectedRows, toggleAllSelection, displayData }) => {
|
|
79
|
-
const renderHeaderGroup = () => headerGroup && /* @__PURE__ */
|
|
80
|
-
const renderColumns = () => columns && columns.length > 0 ? columns.map((column, id) => /* @__PURE__ */
|
|
92
|
+
const renderHeaderGroup = () => headerGroup && /* @__PURE__ */ jsx5("div", { className: "ndt-table-columns", style: { gridTemplateColumns: widths || "auto" }, children: headerGroup.map((col, id) => /* @__PURE__ */ jsx5("div", { className: "ndt-column", style: { gridColumn: `span ${col.cols || 1}` }, children: /* @__PURE__ */ jsx5("div", { className: "ndt-column-head", children: /* @__PURE__ */ jsx5("span", { title: col.title, children: col.title }) }) }, `header-group-${id}`)) });
|
|
93
|
+
const renderColumns = () => columns && columns.length > 0 ? columns.map((column, id) => /* @__PURE__ */ jsx5(
|
|
81
94
|
Column_default,
|
|
82
95
|
{
|
|
83
96
|
column,
|
|
@@ -90,10 +103,10 @@ var Header = ({ columns, getSortField, sortBy, getFilters, filters, widths, head
|
|
|
90
103
|
displayData
|
|
91
104
|
},
|
|
92
105
|
`column-${id}`
|
|
93
|
-
)) : /* @__PURE__ */
|
|
106
|
+
)) : /* @__PURE__ */ jsx5("div", { className: "ndt-data-error", children: "\u041E\u0448\u0438\u0431\u043A\u0430: columns is undefined" });
|
|
94
107
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
95
108
|
renderHeaderGroup(),
|
|
96
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ jsx5("div", { className: "ndt-table-columns", style: { gridTemplateColumns: widths || "auto" }, children: renderColumns() })
|
|
97
110
|
] });
|
|
98
111
|
};
|
|
99
112
|
var TableHeader_default = memo2(Header);
|
|
@@ -103,7 +116,7 @@ import React, { memo as memo5, useMemo as useMemo3 } from "react";
|
|
|
103
116
|
|
|
104
117
|
// components/data-table/Cell.tsx
|
|
105
118
|
import { memo as memo3, useMemo as useMemo2 } from "react";
|
|
106
|
-
import { jsx as
|
|
119
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
107
120
|
var Cell = ({
|
|
108
121
|
row,
|
|
109
122
|
column,
|
|
@@ -124,7 +137,7 @@ var Cell = ({
|
|
|
124
137
|
var _a;
|
|
125
138
|
return (_a = column.formatter) == null ? void 0 : _a.call(column, stringValue, row, column);
|
|
126
139
|
}, [column.formatter, stringValue, row, column]);
|
|
127
|
-
const CellWithData = ({ children }) => /* @__PURE__ */
|
|
140
|
+
const CellWithData = ({ children }) => /* @__PURE__ */ jsx6(
|
|
128
141
|
"div",
|
|
129
142
|
{
|
|
130
143
|
className: "ndt-cell",
|
|
@@ -134,7 +147,7 @@ var Cell = ({
|
|
|
134
147
|
children
|
|
135
148
|
}
|
|
136
149
|
);
|
|
137
|
-
const EditableCell = () => /* @__PURE__ */
|
|
150
|
+
const EditableCell = () => /* @__PURE__ */ jsx6(
|
|
138
151
|
"input",
|
|
139
152
|
{
|
|
140
153
|
className: "ndt-cell ndt-cell-editable",
|
|
@@ -144,19 +157,19 @@ var Cell = ({
|
|
|
144
157
|
}
|
|
145
158
|
}
|
|
146
159
|
);
|
|
147
|
-
const SelectableCell = () => /* @__PURE__ */
|
|
160
|
+
const SelectableCell = () => /* @__PURE__ */ jsx6("div", { className: "ndt-cell ndt-checkbox-cell", onClick: onRowSelect, children: /* @__PURE__ */ jsx6("input", { type: "checkbox", checked: !!isRowSelected, onChange: () => {
|
|
148
161
|
} }) });
|
|
149
|
-
if (isAutoinc) return /* @__PURE__ */
|
|
150
|
-
if (isFormatted) return /* @__PURE__ */
|
|
151
|
-
if (isEditable) return /* @__PURE__ */
|
|
152
|
-
if (isColumnSelectable) return /* @__PURE__ */
|
|
153
|
-
return /* @__PURE__ */
|
|
162
|
+
if (isAutoinc) return /* @__PURE__ */ jsx6(CellWithData, { children: displayId + 1 });
|
|
163
|
+
if (isFormatted) return /* @__PURE__ */ jsx6(CellWithData, { children: formattedContent });
|
|
164
|
+
if (isEditable) return /* @__PURE__ */ jsx6(EditableCell, {});
|
|
165
|
+
if (isColumnSelectable) return /* @__PURE__ */ jsx6(SelectableCell, {});
|
|
166
|
+
return /* @__PURE__ */ jsx6(CellWithData, { children: stringValue });
|
|
154
167
|
};
|
|
155
168
|
var Cell_default = memo3(Cell);
|
|
156
169
|
|
|
157
170
|
// components/data-table/Row.tsx
|
|
158
171
|
import { memo as memo4 } from "react";
|
|
159
|
-
import { jsx as
|
|
172
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
160
173
|
var Row = ({
|
|
161
174
|
rowId,
|
|
162
175
|
displayId,
|
|
@@ -168,12 +181,12 @@ var Row = ({
|
|
|
168
181
|
onRowSelect
|
|
169
182
|
}) => {
|
|
170
183
|
const isSelectable = columns.find((element) => element.selectable);
|
|
171
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ jsx7(
|
|
172
185
|
"div",
|
|
173
186
|
{
|
|
174
187
|
className: `ndt-table-row ${isSelectable && "ndt-table-row-selectable"} ${isRowSelected && "ndt-table-row-selected"}`,
|
|
175
188
|
style: { gridTemplateColumns: widths },
|
|
176
|
-
children: columns.map((column, id) => /* @__PURE__ */
|
|
189
|
+
children: columns.map((column, id) => /* @__PURE__ */ jsx7(
|
|
177
190
|
Cell_default,
|
|
178
191
|
{
|
|
179
192
|
row,
|
|
@@ -205,7 +218,7 @@ var groupDataBy = (data, key) => {
|
|
|
205
218
|
};
|
|
206
219
|
|
|
207
220
|
// components/data-table/TableBody.tsx
|
|
208
|
-
import { jsx as
|
|
221
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
209
222
|
var TableBody = ({
|
|
210
223
|
columns,
|
|
211
224
|
tableData,
|
|
@@ -225,7 +238,7 @@ var TableBody = ({
|
|
|
225
238
|
}) => {
|
|
226
239
|
const grouped = useMemo3(() => groupBy ? groupDataBy(tableData, groupBy) : [], [tableData, groupBy]);
|
|
227
240
|
if (!tableData || tableData.length === 0) {
|
|
228
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ jsx8("div", { className: `ndt-table-body${scrollable ? " ndt-table-body-scrollable" : ""}`, style: scrollable ? { height: scrollHeight } : {}, children: /* @__PURE__ */ jsx8("div", { className: "ndt-table-row", style: { height: "100%" }, children: /* @__PURE__ */ jsx8("div", { className: "ndt-row-item", style: { margin: "auto", padding: 20, fontWeight: "bold" }, children: "\u0414\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0442" }) }) });
|
|
229
242
|
}
|
|
230
243
|
const renderGroupedRows = () => {
|
|
231
244
|
let currentIndex = 0;
|
|
@@ -236,7 +249,7 @@ var TableBody = ({
|
|
|
236
249
|
className: "ndt-group-header",
|
|
237
250
|
onClick: () => toggleGroup == null ? void 0 : toggleGroup(group.key),
|
|
238
251
|
children: [
|
|
239
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ jsx8("span", { style: { marginRight: 8 }, children: collapsedGroups[group.key] ? "\u25B6" : "\u25BC" }),
|
|
240
253
|
group.key,
|
|
241
254
|
" (",
|
|
242
255
|
group.items.length,
|
|
@@ -250,7 +263,7 @@ var TableBody = ({
|
|
|
250
263
|
if (globalIndex === void 0) return null;
|
|
251
264
|
const localIndex = currentIndex++;
|
|
252
265
|
const displayIndex = paginationSize === 0 ? localIndex : paginationPage * paginationSize + localIndex;
|
|
253
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ jsx8(
|
|
254
267
|
Row_default,
|
|
255
268
|
{
|
|
256
269
|
rowId: globalIndex,
|
|
@@ -278,7 +291,7 @@ var TableBody = ({
|
|
|
278
291
|
if (globalIndex === void 0) return null;
|
|
279
292
|
const localIndex = currentIndex++;
|
|
280
293
|
const displayIndex = paginationSize === 0 ? localIndex : paginationPage * paginationSize + localIndex;
|
|
281
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ jsx8(
|
|
282
295
|
Row_default,
|
|
283
296
|
{
|
|
284
297
|
rowId: globalIndex,
|
|
@@ -294,40 +307,40 @@ var TableBody = ({
|
|
|
294
307
|
);
|
|
295
308
|
});
|
|
296
309
|
};
|
|
297
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ jsx8("div", { className: `ndt-table-body${scrollable ? " ndt-table-body-scrollable" : ""}`, style: scrollable ? { height: scrollHeight } : {}, children: groupBy ? renderGroupedRows() : renderFlatRows() });
|
|
298
311
|
};
|
|
299
312
|
var TableBody_default = memo5(TableBody);
|
|
300
313
|
|
|
301
314
|
// components/data-table/img/NextIcon.tsx
|
|
302
|
-
import { jsx as
|
|
315
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
303
316
|
var NextIcon = () => {
|
|
304
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ jsx9("svg", { width: "41", height: "65", viewBox: "0 0 41 65", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx9("path", { d: "M0.674316 57.2669L25.3872 32.5L0.674316 7.73312L8.28244 0.125L40.6574 32.5L8.28244 64.875L0.674316 57.2669Z", fill: "#666666" }) });
|
|
305
318
|
};
|
|
306
319
|
var NextIcon_default = NextIcon;
|
|
307
320
|
|
|
308
321
|
// components/data-table/img/LastIcon.tsx
|
|
309
|
-
import { jsx as
|
|
322
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
310
323
|
var LastIcon = () => {
|
|
311
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ jsx10("svg", { width: "68", height: "65", viewBox: "0 0 68 65", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx10("path", { d: "M0.185059 7.73312L24.9519 32.5L0.185059 57.2669L7.79318 64.875L40.1682 32.5L7.79318 0.125L0.185059 7.73312ZM56.3557 0.125H67.1474V64.875H56.3557V0.125Z", fill: "#666666" }) });
|
|
312
325
|
};
|
|
313
326
|
var LastIcon_default = LastIcon;
|
|
314
327
|
|
|
315
328
|
// components/data-table/img/PrevIcon.tsx
|
|
316
|
-
import { jsx as
|
|
329
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
317
330
|
var PrevIcon = () => {
|
|
318
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ jsx11("svg", { width: "41", height: "65", viewBox: "0 0 41 65", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx11("path", { d: "M40.6574 57.2669L15.9445 32.5L40.6574 7.73312L33.0493 0.125L0.674316 32.5L33.0493 64.875L40.6574 57.2669Z", fill: "#666666" }) });
|
|
319
332
|
};
|
|
320
333
|
var PrevIcon_default = PrevIcon;
|
|
321
334
|
|
|
322
335
|
// components/data-table/img/FirstIcon.tsx
|
|
323
|
-
import { jsx as
|
|
336
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
324
337
|
var FirstIcon = () => {
|
|
325
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ jsx12("svg", { width: "68", height: "65", viewBox: "0 0 68 65", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx12("path", { d: "M67.1474 57.2669L42.3805 32.5L67.1474 7.73312L59.5392 0.125L27.1642 32.5L59.5392 64.875L67.1474 57.2669ZM0.185059 0.125H10.9767V64.875H0.185059V0.125Z", fill: "#666666" }) });
|
|
326
339
|
};
|
|
327
340
|
var FirstIcon_default = FirstIcon;
|
|
328
341
|
|
|
329
342
|
// components/data-table/TableFooter.tsx
|
|
330
|
-
import { jsx as
|
|
343
|
+
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
331
344
|
var TableFooter = ({
|
|
332
345
|
tableData,
|
|
333
346
|
paginationCounts,
|
|
@@ -348,7 +361,7 @@ var TableFooter = ({
|
|
|
348
361
|
}
|
|
349
362
|
};
|
|
350
363
|
const renderPageNumbers = () => {
|
|
351
|
-
if (totalPages <= 1) return /* @__PURE__ */
|
|
364
|
+
if (totalPages <= 1) return /* @__PURE__ */ jsx13(
|
|
352
365
|
"button",
|
|
353
366
|
{
|
|
354
367
|
className: "btn-active",
|
|
@@ -367,15 +380,15 @@ var TableFooter = ({
|
|
|
367
380
|
}
|
|
368
381
|
if (start > 0) {
|
|
369
382
|
pages.push(
|
|
370
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ jsx13("button", { onClick: () => handlePageChange(0), children: "1" }, "page-0")
|
|
371
384
|
);
|
|
372
385
|
if (start > 1) {
|
|
373
|
-
pages.push(/* @__PURE__ */
|
|
386
|
+
pages.push(/* @__PURE__ */ jsx13("span", { children: "..." }, "ellipsis-start"));
|
|
374
387
|
}
|
|
375
388
|
}
|
|
376
389
|
for (let i = start; i <= end; i++) {
|
|
377
390
|
pages.push(
|
|
378
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ jsx13(
|
|
379
392
|
"button",
|
|
380
393
|
{
|
|
381
394
|
className: i === paginationPage ? "btn-active" : "",
|
|
@@ -389,10 +402,10 @@ var TableFooter = ({
|
|
|
389
402
|
}
|
|
390
403
|
if (end < totalPages - 1) {
|
|
391
404
|
if (end < totalPages - 2) {
|
|
392
|
-
pages.push(/* @__PURE__ */
|
|
405
|
+
pages.push(/* @__PURE__ */ jsx13("span", { children: "..." }, "ellipsis-end"));
|
|
393
406
|
}
|
|
394
407
|
pages.push(
|
|
395
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ jsx13("button", { onClick: () => handlePageChange(totalPages - 1), children: totalPages }, `page-${totalPages - 1}`)
|
|
396
409
|
);
|
|
397
410
|
}
|
|
398
411
|
return pages;
|
|
@@ -415,45 +428,45 @@ var TableFooter = ({
|
|
|
415
428
|
] }),
|
|
416
429
|
paginationCounts && /* @__PURE__ */ jsxs4("div", { className: "ndt-footer-pagination", children: [
|
|
417
430
|
/* @__PURE__ */ jsxs4("div", { className: "ndt-pagination-counts", children: [
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ jsx13("span", { children: "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A: " }),
|
|
432
|
+
/* @__PURE__ */ jsx13("select", { value: paginationSize, onChange: handleCountChange, children: paginationCounts.map((count) => /* @__PURE__ */ jsx13("option", { value: count, children: count === 0 ? "\u0412\u0441\u0435" : count }, `count-${count}`)) })
|
|
420
433
|
] }),
|
|
421
434
|
/* @__PURE__ */ jsxs4("div", { className: "ndt-pagination-buttons", children: [
|
|
422
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ jsx13(
|
|
423
436
|
"button",
|
|
424
437
|
{
|
|
425
438
|
disabled: paginationPage === 0,
|
|
426
439
|
onClick: () => handlePageChange(0),
|
|
427
440
|
"aria-label": "\u041F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",
|
|
428
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ jsx13(FirstIcon_default, {})
|
|
429
442
|
}
|
|
430
443
|
),
|
|
431
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ jsx13(
|
|
432
445
|
"button",
|
|
433
446
|
{
|
|
434
447
|
disabled: paginationPage === 0,
|
|
435
448
|
onClick: () => handlePageChange(paginationPage - 1),
|
|
436
449
|
"aria-label": "\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",
|
|
437
|
-
children: /* @__PURE__ */
|
|
450
|
+
children: /* @__PURE__ */ jsx13(PrevIcon_default, {})
|
|
438
451
|
}
|
|
439
452
|
),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ jsx13("div", { className: "ndt-buttons-num", children: renderPageNumbers() }),
|
|
454
|
+
/* @__PURE__ */ jsx13(
|
|
442
455
|
"button",
|
|
443
456
|
{
|
|
444
457
|
disabled: paginationPage >= totalPages - 1,
|
|
445
458
|
onClick: () => handlePageChange(paginationPage + 1),
|
|
446
459
|
"aria-label": "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",
|
|
447
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ jsx13(NextIcon_default, {})
|
|
448
461
|
}
|
|
449
462
|
),
|
|
450
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ jsx13(
|
|
451
464
|
"button",
|
|
452
465
|
{
|
|
453
466
|
disabled: paginationPage >= totalPages - 1,
|
|
454
467
|
onClick: () => handlePageChange(totalPages - 1),
|
|
455
468
|
"aria-label": "\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",
|
|
456
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ jsx13(LastIcon_default, {})
|
|
457
470
|
}
|
|
458
471
|
)
|
|
459
472
|
] })
|
|
@@ -516,7 +529,7 @@ function useDebouncedEffect(callback, deps, delay) {
|
|
|
516
529
|
}
|
|
517
530
|
|
|
518
531
|
// components/data-table/DataTable.tsx
|
|
519
|
-
import { jsx as
|
|
532
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
520
533
|
var DataTable = forwardRef(({
|
|
521
534
|
tableData,
|
|
522
535
|
columns,
|
|
@@ -623,8 +636,8 @@ var DataTable = forwardRef(({
|
|
|
623
636
|
getCurrentData: () => displayData,
|
|
624
637
|
getSelectedData: () => Array.from(selectedRows).map((i) => processedData[i])
|
|
625
638
|
}), [processedData, displayData, selectedRows]);
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ jsx14("div", { className: "ndt-table-container", children: /* @__PURE__ */ jsxs5("div", { className: "ndt-table", children: [
|
|
640
|
+
/* @__PURE__ */ jsx14(
|
|
628
641
|
TableHeader_default,
|
|
629
642
|
{
|
|
630
643
|
columns,
|
|
@@ -639,7 +652,7 @@ var DataTable = forwardRef(({
|
|
|
639
652
|
displayData: processedData
|
|
640
653
|
}
|
|
641
654
|
),
|
|
642
|
-
loading ? loadingElement !== null ? loadingElement : /* @__PURE__ */
|
|
655
|
+
loading ? loadingElement !== null ? loadingElement : /* @__PURE__ */ jsx14("span", { style: { marginLeft: 10, fontWeight: "bold" }, children: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445..." }) : /* @__PURE__ */ jsx14(
|
|
643
656
|
TableBody_default,
|
|
644
657
|
{
|
|
645
658
|
tableData: displayData,
|
|
@@ -658,7 +671,7 @@ var DataTable = forwardRef(({
|
|
|
658
671
|
paginationPage
|
|
659
672
|
}
|
|
660
673
|
),
|
|
661
|
-
isFooter && /* @__PURE__ */
|
|
674
|
+
isFooter && /* @__PURE__ */ jsx14(
|
|
662
675
|
TableFooter_default,
|
|
663
676
|
{
|
|
664
677
|
paginationCounts,
|
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nillud-data-table",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"style": "./dist/styles.css",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
"dist/export/export-excel",
|
|
12
|
-
"dist/export/export-word"
|
|
10
|
+
"dist"
|
|
13
11
|
],
|
|
14
12
|
"exports": {
|
|
15
13
|
".": {
|
|
@@ -36,9 +34,6 @@
|
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
36
|
"@types/file-saver": "^2.0.7",
|
|
39
|
-
"@types/exceljs": "^4.3.1",
|
|
40
|
-
"@types/docx": "^8.1.2",
|
|
41
|
-
"@types/node": "^20.11.0",
|
|
42
37
|
"@types/react": "^19.1.3",
|
|
43
38
|
"@types/react-dom": "^19.1.3",
|
|
44
39
|
"sass": "^1.87.0",
|