@ackplus/react-tanstack-data-table 1.0.19-beta-0.6 → 1.0.19-beta-0.7
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/package.json +3 -11
- package/LICENSE +0 -21
- package/README.md +0 -599
- package/index.d.ts.map +0 -1
- package/index.js +0 -42
- package/lib/components/droupdown/menu-dropdown.d.ts.map +0 -1
- package/lib/components/droupdown/menu-dropdown.js +0 -47
- package/lib/components/export-progress-dialog.d.ts.map +0 -1
- package/lib/components/export-progress-dialog.js +0 -30
- package/lib/components/filters/filter-value-input.d.ts.map +0 -1
- package/lib/components/filters/filter-value-input.js +0 -64
- package/lib/components/filters/index.d.ts.map +0 -1
- package/lib/components/filters/index.js +0 -125
- package/lib/components/headers/draggable-header.d.ts.map +0 -1
- package/lib/components/headers/draggable-header.js +0 -226
- package/lib/components/headers/index.d.ts.map +0 -1
- package/lib/components/headers/index.js +0 -5
- package/lib/components/headers/table-header.d.ts.map +0 -1
- package/lib/components/headers/table-header.js +0 -59
- package/lib/components/index.d.ts.map +0 -1
- package/lib/components/index.js +0 -18
- package/lib/components/pagination/data-table-pagination.d.ts.map +0 -1
- package/lib/components/pagination/data-table-pagination.js +0 -24
- package/lib/components/pagination/index.d.ts.map +0 -1
- package/lib/components/pagination/index.js +0 -4
- package/lib/components/rows/data-table-row.d.ts.map +0 -1
- package/lib/components/rows/data-table-row.js +0 -42
- package/lib/components/rows/empty-data-row.d.ts.map +0 -1
- package/lib/components/rows/empty-data-row.js +0 -8
- package/lib/components/rows/index.d.ts.map +0 -1
- package/lib/components/rows/index.js +0 -6
- package/lib/components/rows/loading-rows.d.ts.map +0 -1
- package/lib/components/rows/loading-rows.js +0 -46
- package/lib/components/table/data-table.d.ts.map +0 -1
- package/lib/components/table/data-table.js +0 -663
- package/lib/components/table/data-table.types.d.ts.map +0 -1
- package/lib/components/table/data-table.types.js +0 -6
- package/lib/components/table/index.d.ts.map +0 -1
- package/lib/components/table/index.js +0 -5
- package/lib/components/toolbar/bulk-actions-toolbar.d.ts.map +0 -1
- package/lib/components/toolbar/bulk-actions-toolbar.js +0 -31
- package/lib/components/toolbar/column-custom-filter-control.d.ts.map +0 -1
- package/lib/components/toolbar/column-custom-filter-control.js +0 -149
- package/lib/components/toolbar/column-custum-filter-control.d.ts.map +0 -1
- package/lib/components/toolbar/column-custum-filter-control.js +0 -150
- package/lib/components/toolbar/column-pinning-control.d.ts.map +0 -1
- package/lib/components/toolbar/column-pinning-control.js +0 -103
- package/lib/components/toolbar/column-reset-control.d.ts.map +0 -1
- package/lib/components/toolbar/column-reset-control.js +0 -13
- package/lib/components/toolbar/column-visibility-control.d.ts.map +0 -1
- package/lib/components/toolbar/column-visibility-control.js +0 -27
- package/lib/components/toolbar/data-table-toolbar.d.ts.map +0 -1
- package/lib/components/toolbar/data-table-toolbar.js +0 -23
- package/lib/components/toolbar/index.d.ts.map +0 -1
- package/lib/components/toolbar/index.js +0 -13
- package/lib/components/toolbar/table-export-control.d.ts.map +0 -1
- package/lib/components/toolbar/table-export-control.js +0 -94
- package/lib/components/toolbar/table-search-control.d.ts.map +0 -1
- package/lib/components/toolbar/table-search-control.js +0 -61
- package/lib/components/toolbar/table-size-control.d.ts.map +0 -1
- package/lib/components/toolbar/table-size-control.js +0 -33
- package/lib/contexts/data-table-context.d.ts.map +0 -1
- package/lib/contexts/data-table-context.js +0 -50
- package/lib/examples/advanced-features-example.d.ts.map +0 -1
- package/lib/examples/advanced-features-example.js +0 -282
- package/lib/examples/basic-example.d.ts.map +0 -1
- package/lib/examples/basic-example.js +0 -323
- package/lib/examples/bulk-actions-test.d.ts.map +0 -1
- package/lib/examples/bulk-actions-test.js +0 -47
- package/lib/examples/crud-api-example.d.ts.map +0 -1
- package/lib/examples/crud-api-example.js +0 -321
- package/lib/examples/custom-column-filter-example.d.ts.map +0 -1
- package/lib/examples/custom-column-filter-example.js +0 -60
- package/lib/examples/custom-selection-example.d.ts.map +0 -1
- package/lib/examples/custom-selection-example.js +0 -184
- package/lib/examples/export-callbacks-example.d.ts.map +0 -1
- package/lib/examples/export-callbacks-example.js +0 -155
- package/lib/examples/improved-export-example.d.ts.map +0 -1
- package/lib/examples/improved-export-example.js +0 -153
- package/lib/examples/improved-server-selection-example.d.ts.map +0 -1
- package/lib/examples/improved-server-selection-example.js +0 -118
- package/lib/examples/index.d.ts.map +0 -1
- package/lib/examples/index.js +0 -5
- package/lib/examples/selection-test-example.d.ts.map +0 -1
- package/lib/examples/selection-test-example.js +0 -111
- package/lib/examples/simple-local-example.d.ts.map +0 -1
- package/lib/examples/simple-local-example.js +0 -101
- package/lib/examples/simple-server-selection-example.d.ts.map +0 -1
- package/lib/examples/simple-server-selection-example.js +0 -178
- package/lib/examples/virtualized-example.d.ts.map +0 -1
- package/lib/examples/virtualized-example.js +0 -119
- package/lib/features/custom-column-filter.feature.d.ts.map +0 -1
- package/lib/features/custom-column-filter.feature.js +0 -306
- package/lib/features/custom-selection.feature.d.ts.map +0 -1
- package/lib/features/custom-selection.feature.js +0 -224
- package/lib/features/index.d.ts.map +0 -1
- package/lib/features/index.js +0 -9
- package/lib/hooks/index.d.ts.map +0 -1
- package/lib/hooks/index.js +0 -6
- package/lib/hooks/use-data-table-api.d.ts.map +0 -1
- package/lib/hooks/use-data-table-api.js +0 -673
- package/lib/hooks/use-table-state.d.ts.map +0 -1
- package/lib/hooks/use-table-state.js +0 -74
- package/lib/icons/add-icon.d.ts.map +0 -1
- package/lib/icons/add-icon.js +0 -5
- package/lib/icons/csv-icon.d.ts.map +0 -1
- package/lib/icons/csv-icon.js +0 -5
- package/lib/icons/delete-icon.d.ts.map +0 -1
- package/lib/icons/delete-icon.js +0 -5
- package/lib/icons/excel-icon.d.ts.map +0 -1
- package/lib/icons/excel-icon.js +0 -5
- package/lib/icons/index.d.ts.map +0 -1
- package/lib/icons/index.js +0 -7
- package/lib/icons/unpin-icon.d.ts.map +0 -1
- package/lib/icons/unpin-icon.js +0 -5
- package/lib/icons/view-comfortable-icon.d.ts.map +0 -1
- package/lib/icons/view-comfortable-icon.js +0 -5
- package/lib/icons/view-compact-icon.d.ts.map +0 -1
- package/lib/icons/view-compact-icon.js +0 -5
- package/lib/types/column.types.d.ts.map +0 -1
- package/lib/types/column.types.js +0 -2
- package/lib/types/data-table-api.d.ts.map +0 -1
- package/lib/types/data-table-api.js +0 -1
- package/lib/types/export.types.d.ts.map +0 -1
- package/lib/types/export.types.js +0 -5
- package/lib/types/hooks.types.d.ts.map +0 -1
- package/lib/types/hooks.types.js +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js +0 -14
- package/lib/types/slots.types.d.ts.map +0 -1
- package/lib/types/slots.types.js +0 -1
- package/lib/types/table.types.d.ts.map +0 -1
- package/lib/types/table.types.js +0 -1
- package/lib/utils/column-helpers.d.ts.map +0 -1
- package/lib/utils/column-helpers.js +0 -46
- package/lib/utils/debounced-fetch.utils.d.ts.map +0 -1
- package/lib/utils/debounced-fetch.utils.js +0 -51
- package/lib/utils/export-utils.d.ts.map +0 -1
- package/lib/utils/export-utils.js +0 -181
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -17
- package/lib/utils/selection-helpers.d.ts.map +0 -1
- package/lib/utils/selection-helpers.js +0 -162
- package/lib/utils/slot-helpers.d.ts.map +0 -1
- package/lib/utils/slot-helpers.js +0 -27
- package/lib/utils/special-columns.utils.d.ts.map +0 -1
- package/lib/utils/special-columns.utils.js +0 -77
- package/lib/utils/styling-helpers.d.ts.map +0 -1
- package/lib/utils/styling-helpers.js +0 -97
- package/lib/utils/table-helpers.d.ts.map +0 -1
- package/lib/utils/table-helpers.js +0 -72
- package/lib/utils/value-helpers.d.ts.map +0 -1
- package/lib/utils/value-helpers.js +0 -48
- package/tsconfig.lib.tsbuildinfo +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* DataTableRow Component
|
|
4
|
-
*
|
|
5
|
-
* Renders individual table rows with support for:
|
|
6
|
-
* - Column pinning
|
|
7
|
-
* - Row expansion
|
|
8
|
-
* - Hover effects
|
|
9
|
-
* - Striped styling
|
|
10
|
-
*/
|
|
11
|
-
import { TableRow, TableCell, Collapse } from '@mui/material';
|
|
12
|
-
import { flexRender } from '@tanstack/react-table';
|
|
13
|
-
import { getPinnedColumnStyle, getColumnAlignment } from '../../utils';
|
|
14
|
-
import { getSlotComponent } from '../../utils/slot-helpers';
|
|
15
|
-
/**
|
|
16
|
-
* Individual table row component with cell rendering and expansion support
|
|
17
|
-
*/
|
|
18
|
-
export function DataTableRow({ row, enableHover = true, enableStripes = false, isOdd = false, renderSubComponent, disableStickyHeader = false, slots, slotProps, }) {
|
|
19
|
-
const CellSlot = getSlotComponent(slots, 'cell', TableCell);
|
|
20
|
-
const ExpandedRowSlot = getSlotComponent(slots, 'expandedRow', TableRow);
|
|
21
|
-
const TableRowSlot = getSlotComponent(slots, 'row', TableRow);
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableRowSlot, { hover: enableHover, sx: {
|
|
23
|
-
backgroundColor: enableStripes && isOdd ? 'action.hover' : 'transparent',
|
|
24
|
-
}, children: row.getVisibleCells().map(cell => {
|
|
25
|
-
const isPinned = cell.column.getIsPinned();
|
|
26
|
-
const pinnedPosition = isPinned ? cell.column.getStart('left') : undefined;
|
|
27
|
-
const pinnedRightPosition = isPinned === 'right' ? cell.column.getAfter('right') : undefined;
|
|
28
|
-
const alignment = getColumnAlignment(cell.column.columnDef);
|
|
29
|
-
return (_jsx(CellSlot, { align: alignment, sx: {
|
|
30
|
-
...getPinnedColumnStyle({
|
|
31
|
-
width: cell.column.getSize() || 'auto',
|
|
32
|
-
isPinned,
|
|
33
|
-
pinnedPosition,
|
|
34
|
-
pinnedRightPosition,
|
|
35
|
-
zIndex: isPinned ? 9 : 1,
|
|
36
|
-
disableStickyHeader,
|
|
37
|
-
isLastLeftPinnedColumn: isPinned === 'left' && cell.column.getIsLastColumn('left'),
|
|
38
|
-
isFirstRightPinnedColumn: isPinned === 'right' && cell.column.getIsFirstColumn('right'),
|
|
39
|
-
}),
|
|
40
|
-
}, ...slotProps?.cell, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
|
|
41
|
-
}) }), row.getIsExpanded() && renderSubComponent ? (_jsx(ExpandedRowSlot, { children: _jsx(CellSlot, { colSpan: row.getVisibleCells().length + 1, sx: { py: 0 }, children: _jsx(Collapse, { in: row.getIsExpanded(), timeout: "auto", unmountOnExit: true, children: renderSubComponent(row) }) }) })) : null] }));
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"empty-data-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/empty-data-row.tsx"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,2CAgBpK"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TableCell, TableRow } from '@mui/material';
|
|
3
|
-
import { getSlotComponent } from '../../utils/slot-helpers';
|
|
4
|
-
export function EmptyDataRow({ colSpan, message, slots, slotProps }) {
|
|
5
|
-
const EmptyRowSlot = getSlotComponent(slots, 'emptyRow', TableRow);
|
|
6
|
-
const EmptyCellSlot = getSlotComponent(slots, 'cell', TableCell);
|
|
7
|
-
return (_jsx(EmptyRowSlot, { children: _jsx(EmptyCellSlot, { colSpan: colSpan, align: "center", sx: { py: 4 }, ...slotProps?.emptyCell, children: message }) }));
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loading-rows.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/loading-rows.tsx"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,EACxB,QAAY,EACZ,KAAK,EACL,SAAS,GACZ,EAAE;IACC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,2CA+FA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { TableCell, TableRow } from '@mui/material';
|
|
3
|
-
import { Skeleton } from '@mui/material';
|
|
4
|
-
import { useDataTableContext } from '../../contexts/data-table-context';
|
|
5
|
-
import { getPinnedColumnStyle } from '../../utils';
|
|
6
|
-
import { getSlotComponent } from '../../utils/slot-helpers';
|
|
7
|
-
export function LoadingRows({ rowCount = 5, slots, slotProps, }) {
|
|
8
|
-
const { table } = useDataTableContext();
|
|
9
|
-
const visibleColumns = table.getVisibleLeafColumns();
|
|
10
|
-
const CellSlot = getSlotComponent(slots, 'cell', TableCell);
|
|
11
|
-
const TableRowSlot = getSlotComponent(slots, 'row', TableRow);
|
|
12
|
-
return (_jsx(_Fragment, { children: Array.from({ length: rowCount }, (_, rowIndex) => (_jsx(TableRowSlot, { ...slotProps?.row, children: visibleColumns.map((column, colIndex) => {
|
|
13
|
-
const isPinned = column.getIsPinned();
|
|
14
|
-
const pinnedPosition = isPinned ? column.getStart('left') : undefined;
|
|
15
|
-
const pinnedRightPosition = isPinned === 'right' ? column.getAfter('right') : undefined;
|
|
16
|
-
// Determine skeleton type based on column meta or content
|
|
17
|
-
const columnMeta = column.columnDef?.meta;
|
|
18
|
-
const isDateColumn = columnMeta?.type === 'date';
|
|
19
|
-
const isBooleanColumn = columnMeta?.type === 'boolean';
|
|
20
|
-
const isNumberColumn = columnMeta?.type === 'number';
|
|
21
|
-
const isSelectionColumn = column.id === 'select';
|
|
22
|
-
return (_jsx(CellSlot, { sx: getPinnedColumnStyle({
|
|
23
|
-
width: column.getSize() || 'auto',
|
|
24
|
-
isPinned,
|
|
25
|
-
pinnedPosition,
|
|
26
|
-
pinnedRightPosition,
|
|
27
|
-
zIndex: isPinned ? 9 : 1,
|
|
28
|
-
isLastLeftPinnedColumn: isPinned === 'left' && column.getIsLastColumn('left'),
|
|
29
|
-
isFirstRightPinnedColumn: isPinned === 'right' && column.getIsFirstColumn('right'),
|
|
30
|
-
}), ...slotProps?.cell, children: (() => {
|
|
31
|
-
if (isSelectionColumn) {
|
|
32
|
-
return (_jsx(Skeleton, { variant: "rectangular", width: 20, height: 20 }));
|
|
33
|
-
}
|
|
34
|
-
if (isBooleanColumn) {
|
|
35
|
-
return (_jsx(Skeleton, { variant: "circular", width: 20, height: 20 }));
|
|
36
|
-
}
|
|
37
|
-
if (isDateColumn) {
|
|
38
|
-
return (_jsx(Skeleton, { variant: "text", width: "80%", height: 20, animation: "wave" }));
|
|
39
|
-
}
|
|
40
|
-
if (isNumberColumn) {
|
|
41
|
-
return (_jsx(Skeleton, { variant: "text", width: "60%", height: 20, animation: "wave" }));
|
|
42
|
-
}
|
|
43
|
-
return (_jsx(Skeleton, { variant: "text", width: `${Math.random() * 40 + 60}%`, height: 20, animation: "wave" }));
|
|
44
|
-
})() }, `skeleton-${column.id || colIndex}-${rowIndex}`));
|
|
45
|
-
}) }, `skeleton-row-${rowIndex}`))) }));
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/table/data-table.tsx"],"names":[],"mappings":"AA2CA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA+B1D;;GAEG;AACH,eAAO,MAAM,SAAS,mHAw5BpB,CAAC"}
|