@ackplus/react-tanstack-data-table 1.1.19 → 1.1.21

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 (63) hide show
  1. package/dist/lib/hooks/use-data-table-engine.d.ts.map +1 -1
  2. package/dist/lib/hooks/use-data-table-engine.js +54 -15
  3. package/dist/lib/types/data-table.types.d.ts +2 -1
  4. package/dist/lib/types/data-table.types.d.ts.map +1 -1
  5. package/package.json +3 -4
  6. package/src/index.ts +0 -75
  7. package/src/lib/components/data-table-view.tsx +0 -386
  8. package/src/lib/components/droupdown/menu-dropdown.tsx +0 -103
  9. package/src/lib/components/filters/filter-value-input.tsx +0 -225
  10. package/src/lib/components/filters/index.ts +0 -126
  11. package/src/lib/components/headers/draggable-header.tsx +0 -326
  12. package/src/lib/components/headers/index.ts +0 -6
  13. package/src/lib/components/headers/table-header.tsx +0 -175
  14. package/src/lib/components/index.ts +0 -21
  15. package/src/lib/components/pagination/data-table-pagination.tsx +0 -111
  16. package/src/lib/components/pagination/index.ts +0 -5
  17. package/src/lib/components/rows/data-table-row.tsx +0 -218
  18. package/src/lib/components/rows/empty-data-row.tsx +0 -69
  19. package/src/lib/components/rows/index.ts +0 -7
  20. package/src/lib/components/rows/loading-rows.tsx +0 -164
  21. package/src/lib/components/toolbar/bulk-actions-toolbar.tsx +0 -125
  22. package/src/lib/components/toolbar/column-filter-control.tsx +0 -432
  23. package/src/lib/components/toolbar/column-pinning-control.tsx +0 -275
  24. package/src/lib/components/toolbar/column-reset-control.tsx +0 -74
  25. package/src/lib/components/toolbar/column-visibility-control.tsx +0 -105
  26. package/src/lib/components/toolbar/data-table-toolbar.tsx +0 -257
  27. package/src/lib/components/toolbar/index.ts +0 -17
  28. package/src/lib/components/toolbar/table-export-control.tsx +0 -233
  29. package/src/lib/components/toolbar/table-refresh-control.tsx +0 -62
  30. package/src/lib/components/toolbar/table-search-control.tsx +0 -155
  31. package/src/lib/components/toolbar/table-size-control.tsx +0 -102
  32. package/src/lib/contexts/data-table-context.tsx +0 -126
  33. package/src/lib/data-table.tsx +0 -29
  34. package/src/lib/features/README.md +0 -161
  35. package/src/lib/features/column-filter.feature.ts +0 -493
  36. package/src/lib/features/index.ts +0 -23
  37. package/src/lib/features/selection.feature.ts +0 -322
  38. package/src/lib/hooks/index.ts +0 -2
  39. package/src/lib/hooks/use-data-table-engine.ts +0 -1516
  40. package/src/lib/icons/add-icon.tsx +0 -23
  41. package/src/lib/icons/csv-icon.tsx +0 -15
  42. package/src/lib/icons/delete-icon.tsx +0 -30
  43. package/src/lib/icons/excel-icon.tsx +0 -15
  44. package/src/lib/icons/index.ts +0 -7
  45. package/src/lib/icons/unpin-icon.tsx +0 -18
  46. package/src/lib/icons/view-comfortable-icon.tsx +0 -45
  47. package/src/lib/icons/view-compact-icon.tsx +0 -55
  48. package/src/lib/types/column.types.ts +0 -63
  49. package/src/lib/types/data-table-api.ts +0 -191
  50. package/src/lib/types/data-table.types.ts +0 -192
  51. package/src/lib/types/export.types.ts +0 -223
  52. package/src/lib/types/index.ts +0 -24
  53. package/src/lib/types/slots.types.ts +0 -342
  54. package/src/lib/types/table.types.ts +0 -88
  55. package/src/lib/utils/column-helpers.ts +0 -72
  56. package/src/lib/utils/debounced-fetch.utils.ts +0 -131
  57. package/src/lib/utils/export-utils.ts +0 -712
  58. package/src/lib/utils/index.ts +0 -27
  59. package/src/lib/utils/logger.ts +0 -203
  60. package/src/lib/utils/slot-helpers.tsx +0 -194
  61. package/src/lib/utils/special-columns.utils.ts +0 -101
  62. package/src/lib/utils/styling-helpers.ts +0 -126
  63. package/src/lib/utils/table-helpers.ts +0 -106
@@ -1,106 +0,0 @@
1
- /**
2
- * General table utilities for DataTable components
3
- */
4
-
5
- // Import types from centralized location
6
- import type { TableMetrics } from '../types';
7
-
8
-
9
- export type DataTableSize = 'small' | 'medium';
10
-
11
- /**
12
- * Calculate skeleton rows count based on viewport and row height
13
- */
14
- export function calculateSkeletonRows(
15
- containerHeight: number,
16
- rowHeight: number,
17
- maxRows = 10,
18
- ): number {
19
- const estimatedRows = Math.ceil(containerHeight / rowHeight);
20
- return Math.min(estimatedRows, maxRows);
21
- }
22
-
23
- /**
24
- * Generate unique row ID for virtualization
25
- */
26
- export function generateRowId<T>(row: T, index: number, idKey?: keyof T): string {
27
- if (idKey && row[idKey]) {
28
- return String(row[idKey]);
29
- }
30
- return `row-${index}`;
31
- }
32
-
33
- /**
34
- * Calculate total width of pinned columns
35
- */
36
- export function calculatePinnedColumnsWidth(
37
- columns: any[],
38
- side: 'left' | 'right',
39
- ): number {
40
- return columns
41
- .filter(col => col.getIsPinned() === side)
42
- .reduce((total, col) => total + (col.getSize() || 0), 0);
43
- }
44
-
45
- /**
46
- * Check if table should use fixed layout
47
- */
48
- export function shouldUseFixedLayout(
49
- fitToScreen: boolean,
50
- enableColumnResizing: boolean,
51
- totalColumns: number,
52
- ): boolean {
53
- return fitToScreen || (enableColumnResizing && totalColumns > 5);
54
- }
55
-
56
- /**
57
- * Format cell value based on column type
58
- */
59
- export function formatCellValue(value: any, type: string): string {
60
- if (value === null || value === undefined) {
61
- return '-';
62
- }
63
-
64
- switch (type) {
65
- case 'date':
66
- return value instanceof Date ? value.toLocaleDateString() : String(value);
67
- case 'number':
68
- return typeof value === 'number' ? value.toLocaleString() : String(value);
69
- case 'boolean':
70
- return value ? 'Yes' : 'No';
71
- default:
72
- return String(value);
73
- }
74
- }
75
-
76
- /**
77
- * Debounce function for search and filters
78
- */
79
- export function debounce<T extends (...args: any[]) => any>(
80
- func: T,
81
- wait: number,
82
- ): (...args: Parameters<T>) => void {
83
- let timeout: NodeJS.Timeout;
84
- return (...args: Parameters<T>) => {
85
- clearTimeout(timeout);
86
- timeout = setTimeout(() => func(...args), wait);
87
- };
88
- }
89
-
90
- /**
91
- * Get table performance metrics
92
- */
93
-
94
- export function calculateTableMetrics(
95
- totalRows: number,
96
- visibleRows: number,
97
- columns: any[],
98
- renderStartTime: number,
99
- ): TableMetrics {
100
- return {
101
- totalRows,
102
- visibleRows,
103
- pinnedColumns: columns.filter(col => col.getIsPinned()).length,
104
- renderTime: performance.now() - renderStartTime,
105
- };
106
- }