@ackplus/react-tanstack-data-table 1.0.19-beta-0.6 → 1.0.19-beta-0.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/package.json +3 -11
- package/{index.js → src/index.d.ts} +3 -26
- package/src/index.js +31 -0
- package/src/lib/components/droupdown/menu-dropdown.d.ts +17 -0
- package/src/lib/components/droupdown/menu-dropdown.js +52 -0
- package/src/lib/components/filters/filter-value-input.d.ts +9 -0
- package/src/lib/components/filters/filter-value-input.js +58 -0
- package/src/lib/components/filters/index.d.ts +23 -0
- package/{lib → src/lib}/components/filters/index.js +6 -2
- package/src/lib/components/headers/draggable-header.d.ts +12 -0
- package/{lib → src/lib}/components/headers/draggable-header.js +35 -49
- package/{lib/components/headers/index.js → src/lib/components/headers/index.d.ts} +0 -3
- package/src/lib/components/headers/index.js +5 -0
- package/src/lib/components/headers/table-header.d.ts +10 -0
- package/src/lib/components/headers/table-header.js +48 -0
- package/src/lib/components/index.d.ts +7 -0
- package/src/lib/components/index.js +10 -0
- package/src/lib/components/pagination/data-table-pagination.d.ts +11 -0
- package/src/lib/components/pagination/data-table-pagination.js +25 -0
- package/src/lib/components/pagination/index.d.ts +1 -0
- package/src/lib/components/pagination/index.js +4 -0
- package/src/lib/components/rows/data-table-row.d.ts +13 -0
- package/src/lib/components/rows/data-table-row.js +31 -0
- package/src/lib/components/rows/empty-data-row.d.ts +6 -0
- package/src/lib/components/rows/empty-data-row.js +11 -0
- package/{lib/components/rows/index.js → src/lib/components/rows/index.d.ts} +0 -3
- package/src/lib/components/rows/index.js +6 -0
- package/src/lib/components/rows/loading-rows.d.ts +5 -0
- package/src/lib/components/rows/loading-rows.js +49 -0
- package/src/lib/components/table/data-table.d.ts +3 -0
- package/src/lib/components/table/data-table.js +492 -0
- package/src/lib/components/table/data-table.types.d.ts +114 -0
- package/src/lib/components/table/data-table.types.js +2 -0
- package/{lib/components/table/index.js → src/lib/components/table/index.d.ts} +0 -3
- package/src/lib/components/table/index.js +5 -0
- package/src/lib/components/toolbar/bulk-actions-toolbar.d.ts +9 -0
- package/src/lib/components/toolbar/bulk-actions-toolbar.js +25 -0
- package/src/lib/components/toolbar/column-custom-filter-control.d.ts +1 -0
- package/src/lib/components/toolbar/column-custom-filter-control.js +137 -0
- package/src/lib/components/toolbar/column-pinning-control.d.ts +1 -0
- package/src/lib/components/toolbar/column-pinning-control.js +105 -0
- package/src/lib/components/toolbar/column-reset-control.d.ts +1 -0
- package/src/lib/components/toolbar/column-reset-control.js +16 -0
- package/src/lib/components/toolbar/column-visibility-control.d.ts +1 -0
- package/src/lib/components/toolbar/column-visibility-control.js +31 -0
- package/src/lib/components/toolbar/data-table-toolbar.d.ts +14 -0
- package/src/lib/components/toolbar/data-table-toolbar.js +26 -0
- package/{lib/components/toolbar/index.js → src/lib/components/toolbar/index.d.ts} +1 -6
- package/src/lib/components/toolbar/index.js +17 -0
- package/src/lib/components/toolbar/table-export-control.d.ts +25 -0
- package/src/lib/components/toolbar/table-export-control.js +93 -0
- package/src/lib/components/toolbar/table-search-control.d.ts +1 -0
- package/src/lib/components/toolbar/table-search-control.js +61 -0
- package/src/lib/components/toolbar/table-size-control.d.ts +1 -0
- package/src/lib/components/toolbar/table-size-control.js +36 -0
- package/src/lib/contexts/data-table-context.d.ts +43 -0
- package/{lib → src/lib}/contexts/data-table-context.js +12 -8
- package/src/lib/examples/advanced-features-example.d.ts +1 -0
- package/src/lib/examples/advanced-features-example.js +264 -0
- package/src/lib/examples/bulk-actions-test.d.ts +1 -0
- package/src/lib/examples/bulk-actions-test.js +44 -0
- package/src/lib/examples/custom-column-filter-example.d.ts +1 -0
- package/{lib → src/lib}/examples/custom-column-filter-example.js +10 -10
- package/src/lib/examples/index.js +13 -0
- package/src/lib/examples/selection-test-example.d.ts +1 -0
- package/src/lib/examples/selection-test-example.js +101 -0
- package/src/lib/examples/simple-local-example.d.ts +1 -0
- package/{lib → src/lib}/examples/simple-local-example.js +14 -18
- package/src/lib/features/custom-column-filter.feature.d.ts +45 -0
- package/{lib → src/lib}/features/custom-column-filter.feature.js +40 -99
- package/src/lib/features/custom-selection.feature.d.ts +46 -0
- package/{lib → src/lib}/features/custom-selection.feature.js +18 -70
- package/src/lib/features/index.d.ts +2 -0
- package/src/lib/features/index.js +8 -0
- package/src/lib/hooks/index.d.ts +1 -0
- package/src/lib/hooks/index.js +4 -0
- package/src/lib/hooks/use-data-table-api.d.ts +56 -0
- package/{lib → src/lib}/hooks/use-data-table-api.js +79 -136
- package/src/lib/icons/add-icon.d.ts +2 -0
- package/src/lib/icons/add-icon.js +8 -0
- package/src/lib/icons/csv-icon.d.ts +2 -0
- package/src/lib/icons/csv-icon.js +8 -0
- package/src/lib/icons/delete-icon.d.ts +2 -0
- package/src/lib/icons/delete-icon.js +8 -0
- package/src/lib/icons/excel-icon.d.ts +2 -0
- package/src/lib/icons/excel-icon.js +8 -0
- package/src/lib/icons/index.js +17 -0
- package/src/lib/icons/unpin-icon.d.ts +2 -0
- package/src/lib/icons/unpin-icon.js +8 -0
- package/src/lib/icons/view-comfortable-icon.d.ts +2 -0
- package/src/lib/icons/view-comfortable-icon.js +8 -0
- package/src/lib/icons/view-compact-icon.d.ts +2 -0
- package/src/lib/icons/view-compact-icon.js +8 -0
- package/src/lib/types/column.types.d.ts +29 -0
- package/src/lib/types/column.types.js +5 -0
- package/src/lib/types/data-table-api.d.ts +134 -0
- package/src/lib/types/data-table-api.js +2 -0
- package/src/lib/types/export.types.d.ts +99 -0
- package/src/lib/types/export.types.js +2 -0
- package/src/lib/types/index.d.ts +6 -0
- package/src/lib/types/index.js +8 -0
- package/src/lib/types/slots.types.d.ts +272 -0
- package/src/lib/types/slots.types.js +2 -0
- package/src/lib/types/table.types.d.ts +63 -0
- package/src/lib/types/table.types.js +2 -0
- package/src/lib/utils/column-helpers.d.ts +7 -0
- package/src/lib/utils/column-helpers.js +43 -0
- package/src/lib/utils/debounced-fetch.utils.d.ts +11 -0
- package/{lib → src/lib}/utils/debounced-fetch.utils.js +15 -17
- package/src/lib/utils/export-utils.d.ts +30 -0
- package/src/lib/utils/export-utils.js +152 -0
- package/{lib/utils/index.js → src/lib/utils/index.d.ts} +0 -10
- package/src/lib/utils/index.js +10 -0
- package/src/lib/utils/slot-helpers.d.ts +9 -0
- package/src/lib/utils/slot-helpers.js +21 -0
- package/src/lib/utils/special-columns.utils.d.ts +6 -0
- package/src/lib/utils/special-columns.utils.js +52 -0
- package/src/lib/utils/styling-helpers.d.ts +36 -0
- package/src/lib/utils/styling-helpers.js +61 -0
- package/src/lib/utils/table-helpers.d.ts +9 -0
- package/{lib → src/lib}/utils/table-helpers.js +16 -31
- package/tsconfig.tsbuildinfo +1 -0
- package/LICENSE +0 -21
- package/index.d.ts.map +0 -1
- 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/headers/draggable-header.d.ts.map +0 -1
- package/lib/components/headers/index.d.ts.map +0 -1
- 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/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/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/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/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-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/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-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-selection.feature.d.ts.map +0 -1
- 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-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/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/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/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/value-helpers.d.ts.map +0 -1
- package/lib/utils/value-helpers.js +0 -48
- package/tsconfig.lib.tsbuildinfo +0 -1
- /package/{lib/examples/index.js → src/lib/examples/index.d.ts} +0 -0
- /package/{lib/icons/index.js → src/lib/icons/index.d.ts} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomSelectionFeature = exports.matchesCustomColumnFilters = exports.CustomColumnFilterFeature = void 0;
|
|
4
|
+
var custom_column_filter_feature_1 = require("./custom-column-filter.feature");
|
|
5
|
+
Object.defineProperty(exports, "CustomColumnFilterFeature", { enumerable: true, get: function () { return custom_column_filter_feature_1.CustomColumnFilterFeature; } });
|
|
6
|
+
Object.defineProperty(exports, "matchesCustomColumnFilters", { enumerable: true, get: function () { return custom_column_filter_feature_1.matchesCustomColumnFilters; } });
|
|
7
|
+
var custom_selection_feature_1 = require("./custom-selection.feature");
|
|
8
|
+
Object.defineProperty(exports, "CustomSelectionFeature", { enumerable: true, get: function () { return custom_selection_feature_1.CustomSelectionFeature; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-data-table-api';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ColumnOrderState, ColumnPinningState, SortingState, Table } from '@tanstack/react-table';
|
|
2
|
+
import { Ref } from 'react';
|
|
3
|
+
import { CustomColumnFilterState, TableFilters, TableState } from '../types';
|
|
4
|
+
import { DataTableApi } from '../types/data-table-api';
|
|
5
|
+
import { SelectionState } from '../features';
|
|
6
|
+
interface UseDataTableApiProps<T> {
|
|
7
|
+
table: Table<T>;
|
|
8
|
+
data: T[];
|
|
9
|
+
idKey: keyof T;
|
|
10
|
+
globalFilter: string;
|
|
11
|
+
customColumnsFilter: CustomColumnFilterState;
|
|
12
|
+
sorting: SortingState;
|
|
13
|
+
pagination: {
|
|
14
|
+
pageIndex: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
};
|
|
17
|
+
columnOrder: ColumnOrderState;
|
|
18
|
+
columnPinning: ColumnPinningState;
|
|
19
|
+
enhancedColumns: any[];
|
|
20
|
+
enablePagination: boolean;
|
|
21
|
+
enableColumnPinning: boolean;
|
|
22
|
+
initialPageIndex: number;
|
|
23
|
+
initialPageSize?: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
selectMode?: 'page' | 'all';
|
|
26
|
+
onSelectionChange?: (state: SelectionState) => void;
|
|
27
|
+
handleColumnFilterStateChange: (filterState: CustomColumnFilterState) => void;
|
|
28
|
+
onDataStateChange?: (state: Partial<TableState>) => void;
|
|
29
|
+
onFetchData?: (filters: Partial<TableFilters>) => void;
|
|
30
|
+
onDataChange?: (newData: T[]) => void;
|
|
31
|
+
exportFilename?: string;
|
|
32
|
+
onExportProgress?: (progress: {
|
|
33
|
+
processedRows: number;
|
|
34
|
+
totalRows: number;
|
|
35
|
+
percentage: number;
|
|
36
|
+
}) => void;
|
|
37
|
+
onExportComplete?: (result: {
|
|
38
|
+
success: boolean;
|
|
39
|
+
filename: string;
|
|
40
|
+
totalRows: number;
|
|
41
|
+
}) => void;
|
|
42
|
+
onExportError?: (error: {
|
|
43
|
+
message: string;
|
|
44
|
+
code: string;
|
|
45
|
+
}) => void;
|
|
46
|
+
onServerExport?: (filters?: Partial<TableFilters>, selection?: any) => Promise<{
|
|
47
|
+
data: any[];
|
|
48
|
+
total: number;
|
|
49
|
+
}>;
|
|
50
|
+
exportController?: AbortController | null;
|
|
51
|
+
setExportController?: (controller: AbortController | null) => void;
|
|
52
|
+
isExporting?: boolean;
|
|
53
|
+
dataMode?: 'client' | 'server';
|
|
54
|
+
}
|
|
55
|
+
export declare function useDataTableApi<T extends Record<string, any>>(props: UseDataTableApiProps<T>, ref: Ref<DataTableApi<T>>): void;
|
|
56
|
+
export {};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exportFilename = 'export', onExportProgress, onExportComplete, onExportError, onServerExport, exportController, setExportController, isExporting, dataMode = 'client', } = props;
|
|
9
|
-
|
|
10
|
-
useImperativeHandle(ref, () => ({
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDataTableApi = useDataTableApi;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const export_utils_1 = require("../utils/export-utils");
|
|
7
|
+
function useDataTableApi(props, ref) {
|
|
8
|
+
const { table, data, idKey, globalFilter, customColumnsFilter, sorting, pagination, columnOrder, columnPinning, enhancedColumns, enablePagination, enableColumnPinning, initialPageIndex, initialPageSize, pageSize, selectMode = 'page', onSelectionChange, handleColumnFilterStateChange, onDataStateChange, onFetchData, onDataChange, exportFilename = 'export', onExportProgress, onExportComplete, onExportError, onServerExport, exportController, setExportController, isExporting, dataMode = 'client', } = props;
|
|
9
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
11
10
|
table: {
|
|
12
11
|
getTable: () => table,
|
|
13
12
|
},
|
|
14
|
-
// Column Management
|
|
15
13
|
columnVisibility: {
|
|
16
14
|
showColumn: (columnId) => {
|
|
17
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
(_a = table.getColumn(columnId)) === null || _a === void 0 ? void 0 : _a.toggleVisibility(true);
|
|
18
17
|
},
|
|
19
18
|
hideColumn: (columnId) => {
|
|
20
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = table.getColumn(columnId)) === null || _a === void 0 ? void 0 : _a.toggleVisibility(false);
|
|
21
21
|
},
|
|
22
22
|
toggleColumn: (columnId) => {
|
|
23
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
(_a = table.getColumn(columnId)) === null || _a === void 0 ? void 0 : _a.toggleVisibility();
|
|
24
25
|
},
|
|
25
26
|
showAllColumns: () => {
|
|
26
27
|
table.toggleAllColumnsVisible(true);
|
|
@@ -32,7 +33,6 @@ export function useDataTableApi(props, ref) {
|
|
|
32
33
|
table.resetColumnVisibility();
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
|
-
// Column Ordering
|
|
36
36
|
columnOrdering: {
|
|
37
37
|
setColumnOrder: (columnOrder) => {
|
|
38
38
|
table.setColumnOrder(columnOrder);
|
|
@@ -60,23 +60,18 @@ export function useDataTableApi(props, ref) {
|
|
|
60
60
|
table.setColumnOrder(initialOrder);
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
|
-
// Column Pinning
|
|
64
63
|
columnPinning: {
|
|
65
64
|
pinColumnLeft: (columnId) => {
|
|
66
65
|
const currentPinning = table.getState().columnPinning;
|
|
67
|
-
const newPinning = {
|
|
68
|
-
// Remove from right if exists
|
|
66
|
+
const newPinning = Object.assign({}, currentPinning);
|
|
69
67
|
newPinning.right = (newPinning.right || []).filter(id => id !== columnId);
|
|
70
|
-
// Add to left if not exists
|
|
71
68
|
newPinning.left = [...(newPinning.left || []).filter(id => id !== columnId), columnId];
|
|
72
69
|
table.setColumnPinning(newPinning);
|
|
73
70
|
},
|
|
74
71
|
pinColumnRight: (columnId) => {
|
|
75
72
|
const currentPinning = table.getState().columnPinning;
|
|
76
|
-
const newPinning = {
|
|
77
|
-
// Remove from left if exists
|
|
73
|
+
const newPinning = Object.assign({}, currentPinning);
|
|
78
74
|
newPinning.left = (newPinning.left || []).filter(id => id !== columnId);
|
|
79
|
-
// Add to right if not exists
|
|
80
75
|
newPinning.right = [...(newPinning.right || []).filter(id => id !== columnId), columnId];
|
|
81
76
|
table.setColumnPinning(newPinning);
|
|
82
77
|
},
|
|
@@ -95,19 +90,14 @@ export function useDataTableApi(props, ref) {
|
|
|
95
90
|
table.setColumnPinning(table.initialState.columnPinning);
|
|
96
91
|
},
|
|
97
92
|
},
|
|
98
|
-
// Column Resizing
|
|
99
93
|
columnResizing: {
|
|
100
94
|
resizeColumn: (columnId, width) => {
|
|
101
|
-
// Use table's setColumnSizing method
|
|
102
95
|
const currentSizing = table.getState().columnSizing;
|
|
103
|
-
table.setColumnSizing({
|
|
104
|
-
...currentSizing,
|
|
105
|
-
[columnId]: width,
|
|
106
|
-
});
|
|
96
|
+
table.setColumnSizing(Object.assign(Object.assign({}, currentSizing), { [columnId]: width }));
|
|
107
97
|
},
|
|
108
98
|
autoSizeColumn: (columnId) => {
|
|
109
|
-
|
|
110
|
-
table.getColumn(columnId)
|
|
99
|
+
var _a;
|
|
100
|
+
(_a = table.getColumn(columnId)) === null || _a === void 0 ? void 0 : _a.resetSize();
|
|
111
101
|
},
|
|
112
102
|
autoSizeAllColumns: () => {
|
|
113
103
|
table.resetColumnSizing();
|
|
@@ -116,7 +106,6 @@ export function useDataTableApi(props, ref) {
|
|
|
116
106
|
table.resetColumnSizing();
|
|
117
107
|
},
|
|
118
108
|
},
|
|
119
|
-
// Filtering
|
|
120
109
|
filtering: {
|
|
121
110
|
setGlobalFilter: (filter) => {
|
|
122
111
|
table.setGlobalFilter(filter);
|
|
@@ -172,7 +161,6 @@ export function useDataTableApi(props, ref) {
|
|
|
172
161
|
});
|
|
173
162
|
},
|
|
174
163
|
},
|
|
175
|
-
// Sorting
|
|
176
164
|
sorting: {
|
|
177
165
|
setSorting: (sortingState) => {
|
|
178
166
|
table.setSorting(sortingState);
|
|
@@ -195,7 +183,6 @@ export function useDataTableApi(props, ref) {
|
|
|
195
183
|
table.resetSorting();
|
|
196
184
|
},
|
|
197
185
|
},
|
|
198
|
-
// Pagination
|
|
199
186
|
pagination: {
|
|
200
187
|
goToPage: (pageIndex) => {
|
|
201
188
|
table.setPageIndex(pageIndex);
|
|
@@ -219,24 +206,20 @@ export function useDataTableApi(props, ref) {
|
|
|
219
206
|
}
|
|
220
207
|
},
|
|
221
208
|
},
|
|
222
|
-
// Selection methods now use TanStack Table CustomSelectionFeature
|
|
223
|
-
// Access via table methods: table.selectRow(), table.getIsRowSelected(), etc.
|
|
224
209
|
selection: {
|
|
225
|
-
selectRow: (rowId) => table.selectRow
|
|
226
|
-
deselectRow: (rowId) => table.deselectRow
|
|
227
|
-
toggleRowSelection: (rowId) => table.toggleRowSelected
|
|
228
|
-
selectAll: () => table.selectAll
|
|
229
|
-
deselectAll: () => table.deselectAll
|
|
230
|
-
toggleSelectAll: () => table.toggleAllRowsSelected
|
|
231
|
-
getSelectionState: () => table.getSelectionState
|
|
210
|
+
selectRow: (rowId) => { var _a; return (_a = table.selectRow) === null || _a === void 0 ? void 0 : _a.call(table, rowId); },
|
|
211
|
+
deselectRow: (rowId) => { var _a; return (_a = table.deselectRow) === null || _a === void 0 ? void 0 : _a.call(table, rowId); },
|
|
212
|
+
toggleRowSelection: (rowId) => { var _a; return (_a = table.toggleRowSelected) === null || _a === void 0 ? void 0 : _a.call(table, rowId); },
|
|
213
|
+
selectAll: () => { var _a; return (_a = table.selectAll) === null || _a === void 0 ? void 0 : _a.call(table); },
|
|
214
|
+
deselectAll: () => { var _a; return (_a = table.deselectAll) === null || _a === void 0 ? void 0 : _a.call(table); },
|
|
215
|
+
toggleSelectAll: () => { var _a; return (_a = table.toggleAllRowsSelected) === null || _a === void 0 ? void 0 : _a.call(table); },
|
|
216
|
+
getSelectionState: () => { var _a; return ((_a = table.getSelectionState) === null || _a === void 0 ? void 0 : _a.call(table)) || { ids: [], type: 'include' }; },
|
|
232
217
|
getSelectedRows: () => table.getSelectedRows(),
|
|
233
218
|
getSelectedCount: () => table.getSelectedCount(),
|
|
234
219
|
isRowSelected: (rowId) => table.getIsRowSelected(rowId) || false,
|
|
235
220
|
},
|
|
236
|
-
// Data Management
|
|
237
221
|
data: {
|
|
238
222
|
refresh: () => {
|
|
239
|
-
// Call external data state change handler to trigger refresh
|
|
240
223
|
const currentFilters = {
|
|
241
224
|
globalFilter,
|
|
242
225
|
customColumnsFilter: customColumnsFilter,
|
|
@@ -244,11 +227,8 @@ export function useDataTableApi(props, ref) {
|
|
|
244
227
|
pagination,
|
|
245
228
|
};
|
|
246
229
|
if (onDataStateChange) {
|
|
247
|
-
const currentState = {
|
|
248
|
-
|
|
249
|
-
columnOrder,
|
|
250
|
-
columnPinning,
|
|
251
|
-
};
|
|
230
|
+
const currentState = Object.assign(Object.assign({}, currentFilters), { columnOrder,
|
|
231
|
+
columnPinning });
|
|
252
232
|
onDataStateChange(currentState);
|
|
253
233
|
}
|
|
254
234
|
if (onFetchData) {
|
|
@@ -256,7 +236,6 @@ export function useDataTableApi(props, ref) {
|
|
|
256
236
|
}
|
|
257
237
|
},
|
|
258
238
|
reload: () => {
|
|
259
|
-
// Same as refresh for now
|
|
260
239
|
const currentFilters = {
|
|
261
240
|
globalFilter,
|
|
262
241
|
customColumnsFilter: customColumnsFilter,
|
|
@@ -264,18 +243,14 @@ export function useDataTableApi(props, ref) {
|
|
|
264
243
|
pagination,
|
|
265
244
|
};
|
|
266
245
|
if (onDataStateChange) {
|
|
267
|
-
const currentState = {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
columnPinning,
|
|
271
|
-
};
|
|
272
|
-
onDataStateChange({ ...currentState });
|
|
246
|
+
const currentState = Object.assign(Object.assign({}, currentFilters), { columnOrder,
|
|
247
|
+
columnPinning });
|
|
248
|
+
onDataStateChange(Object.assign({}, currentState));
|
|
273
249
|
}
|
|
274
250
|
if (onFetchData) {
|
|
275
|
-
onFetchData({
|
|
251
|
+
onFetchData(Object.assign({}, currentFilters));
|
|
276
252
|
}
|
|
277
253
|
},
|
|
278
|
-
// Data CRUD operations
|
|
279
254
|
getAllData: () => {
|
|
280
255
|
return [...data];
|
|
281
256
|
},
|
|
@@ -287,21 +262,14 @@ export function useDataTableApi(props, ref) {
|
|
|
287
262
|
},
|
|
288
263
|
updateRow: (rowId, updates) => {
|
|
289
264
|
const newData = data.map(row => String(row[idKey]) === rowId
|
|
290
|
-
? {
|
|
291
|
-
|
|
292
|
-
...updates,
|
|
293
|
-
}
|
|
294
|
-
: row);
|
|
295
|
-
onDataChange?.(newData);
|
|
265
|
+
? Object.assign(Object.assign({}, row), updates) : row);
|
|
266
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
296
267
|
},
|
|
297
268
|
updateRowByIndex: (index, updates) => {
|
|
298
269
|
const newData = [...data];
|
|
299
270
|
if (newData[index]) {
|
|
300
|
-
newData[index] = {
|
|
301
|
-
|
|
302
|
-
...updates,
|
|
303
|
-
};
|
|
304
|
-
onDataChange?.(newData);
|
|
271
|
+
newData[index] = Object.assign(Object.assign({}, newData[index]), updates);
|
|
272
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
305
273
|
}
|
|
306
274
|
},
|
|
307
275
|
insertRow: (newRow, index) => {
|
|
@@ -312,40 +280,35 @@ export function useDataTableApi(props, ref) {
|
|
|
312
280
|
else {
|
|
313
281
|
newData.push(newRow);
|
|
314
282
|
}
|
|
315
|
-
onDataChange
|
|
283
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
316
284
|
},
|
|
317
285
|
deleteRow: (rowId) => {
|
|
318
286
|
const newData = data.filter(row => String(row[idKey]) !== rowId);
|
|
319
|
-
onDataChange
|
|
287
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
320
288
|
},
|
|
321
289
|
deleteRowByIndex: (index) => {
|
|
322
290
|
const newData = [...data];
|
|
323
291
|
newData.splice(index, 1);
|
|
324
|
-
onDataChange
|
|
292
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
325
293
|
},
|
|
326
294
|
deleteSelectedRows: () => {
|
|
327
295
|
const selectedRowIds = Object.keys(table.getState().rowSelection)
|
|
328
296
|
.filter(key => table.getState().rowSelection[key]);
|
|
329
297
|
const newData = data.filter(row => !selectedRowIds.includes(String(row[idKey])));
|
|
330
|
-
onDataChange
|
|
331
|
-
// Clear selection after deletion
|
|
298
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
332
299
|
table.resetRowSelection();
|
|
333
300
|
},
|
|
334
301
|
replaceAllData: (newData) => {
|
|
335
|
-
onDataChange
|
|
302
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
336
303
|
},
|
|
337
|
-
// Bulk operations
|
|
338
304
|
updateMultipleRows: (updates) => {
|
|
339
305
|
const updateMap = new Map(updates.map(u => [u.rowId, u.data]));
|
|
340
306
|
const newData = data.map(row => {
|
|
341
307
|
const rowId = String(row[idKey]);
|
|
342
308
|
const updateData = updateMap.get(rowId);
|
|
343
|
-
return updateData ? {
|
|
344
|
-
...row,
|
|
345
|
-
...updateData,
|
|
346
|
-
} : row;
|
|
309
|
+
return updateData ? Object.assign(Object.assign({}, row), updateData) : row;
|
|
347
310
|
});
|
|
348
|
-
onDataChange
|
|
311
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
349
312
|
},
|
|
350
313
|
insertMultipleRows: (newRows, startIndex) => {
|
|
351
314
|
const newData = [...data];
|
|
@@ -355,34 +318,25 @@ export function useDataTableApi(props, ref) {
|
|
|
355
318
|
else {
|
|
356
319
|
newData.push(...newRows);
|
|
357
320
|
}
|
|
358
|
-
onDataChange
|
|
321
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
359
322
|
},
|
|
360
323
|
deleteMultipleRows: (rowIds) => {
|
|
361
324
|
const idsToDelete = new Set(rowIds);
|
|
362
325
|
const newData = data.filter(row => !idsToDelete.has(String(row[idKey])));
|
|
363
|
-
onDataChange
|
|
326
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
364
327
|
},
|
|
365
|
-
// Field-specific updates
|
|
366
328
|
updateField: (rowId, fieldName, value) => {
|
|
367
329
|
const newData = data.map(row => String(row[idKey]) === rowId
|
|
368
|
-
? {
|
|
369
|
-
|
|
370
|
-
[fieldName]: value,
|
|
371
|
-
}
|
|
372
|
-
: row);
|
|
373
|
-
onDataChange?.(newData);
|
|
330
|
+
? Object.assign(Object.assign({}, row), { [fieldName]: value }) : row);
|
|
331
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
374
332
|
},
|
|
375
333
|
updateFieldByIndex: (index, fieldName, value) => {
|
|
376
334
|
const newData = [...data];
|
|
377
335
|
if (newData[index]) {
|
|
378
|
-
newData[index] = {
|
|
379
|
-
|
|
380
|
-
[fieldName]: value,
|
|
381
|
-
};
|
|
382
|
-
onDataChange?.(newData);
|
|
336
|
+
newData[index] = Object.assign(Object.assign({}, newData[index]), { [fieldName]: value });
|
|
337
|
+
onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(newData);
|
|
383
338
|
}
|
|
384
339
|
},
|
|
385
|
-
// Data queries
|
|
386
340
|
findRows: (predicate) => {
|
|
387
341
|
return data.filter(predicate);
|
|
388
342
|
},
|
|
@@ -396,7 +350,6 @@ export function useDataTableApi(props, ref) {
|
|
|
396
350
|
return table.getFilteredRowModel().rows.length;
|
|
397
351
|
},
|
|
398
352
|
},
|
|
399
|
-
// Layout Management
|
|
400
353
|
layout: {
|
|
401
354
|
resetLayout: () => {
|
|
402
355
|
table.resetColumnSizing();
|
|
@@ -405,7 +358,6 @@ export function useDataTableApi(props, ref) {
|
|
|
405
358
|
table.resetGlobalFilter();
|
|
406
359
|
},
|
|
407
360
|
resetAll: () => {
|
|
408
|
-
// Reset everything to initial state
|
|
409
361
|
table.resetColumnSizing();
|
|
410
362
|
table.resetColumnVisibility();
|
|
411
363
|
table.resetSorting();
|
|
@@ -470,7 +422,6 @@ export function useDataTableApi(props, ref) {
|
|
|
470
422
|
}
|
|
471
423
|
},
|
|
472
424
|
},
|
|
473
|
-
// Table State
|
|
474
425
|
state: {
|
|
475
426
|
getTableState: () => {
|
|
476
427
|
return table.getState();
|
|
@@ -489,16 +440,14 @@ export function useDataTableApi(props, ref) {
|
|
|
489
440
|
.filter(key => table.getState().rowSelection[key]);
|
|
490
441
|
},
|
|
491
442
|
},
|
|
492
|
-
// Simplified Export
|
|
493
443
|
export: {
|
|
494
|
-
exportCSV:
|
|
444
|
+
exportCSV: (...args_1) => tslib_1.__awaiter(this, [...args_1], void 0, function* (options = {}) {
|
|
445
|
+
var _a;
|
|
495
446
|
const { filename = exportFilename, } = options;
|
|
496
447
|
try {
|
|
497
|
-
// Create abort controller for this export
|
|
498
448
|
const controller = new AbortController();
|
|
499
|
-
setExportController
|
|
449
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(controller);
|
|
500
450
|
if (dataMode === 'server' && onServerExport) {
|
|
501
|
-
// Server export with selection data
|
|
502
451
|
const currentFilters = {
|
|
503
452
|
globalFilter,
|
|
504
453
|
customColumnsFilter,
|
|
@@ -507,20 +456,19 @@ export function useDataTableApi(props, ref) {
|
|
|
507
456
|
columnOrder,
|
|
508
457
|
columnPinning,
|
|
509
458
|
};
|
|
510
|
-
|
|
459
|
+
yield (0, export_utils_1.exportServerData)(table, {
|
|
511
460
|
format: 'csv',
|
|
512
461
|
filename,
|
|
513
462
|
fetchData: (filters, selection) => onServerExport(filters, selection),
|
|
514
463
|
currentFilters,
|
|
515
|
-
selection: table.getSelectionState
|
|
464
|
+
selection: (_a = table.getSelectionState) === null || _a === void 0 ? void 0 : _a.call(table),
|
|
516
465
|
onProgress: onExportProgress,
|
|
517
466
|
onComplete: onExportComplete,
|
|
518
467
|
onError: onExportError,
|
|
519
468
|
});
|
|
520
469
|
}
|
|
521
470
|
else {
|
|
522
|
-
|
|
523
|
-
await exportClientData(table, {
|
|
471
|
+
yield (0, export_utils_1.exportClientData)(table, {
|
|
524
472
|
format: 'csv',
|
|
525
473
|
filename,
|
|
526
474
|
onProgress: onExportProgress,
|
|
@@ -530,23 +478,22 @@ export function useDataTableApi(props, ref) {
|
|
|
530
478
|
}
|
|
531
479
|
}
|
|
532
480
|
catch (error) {
|
|
533
|
-
onExportError
|
|
481
|
+
onExportError === null || onExportError === void 0 ? void 0 : onExportError({
|
|
534
482
|
message: error.message || 'Export failed',
|
|
535
483
|
code: 'EXPORT_ERROR',
|
|
536
484
|
});
|
|
537
485
|
}
|
|
538
486
|
finally {
|
|
539
|
-
setExportController
|
|
487
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(null);
|
|
540
488
|
}
|
|
541
|
-
},
|
|
542
|
-
exportExcel:
|
|
489
|
+
}),
|
|
490
|
+
exportExcel: (...args_1) => tslib_1.__awaiter(this, [...args_1], void 0, function* (options = {}) {
|
|
491
|
+
var _a;
|
|
543
492
|
const { filename = exportFilename } = options;
|
|
544
493
|
try {
|
|
545
|
-
// Create abort controller for this export
|
|
546
494
|
const controller = new AbortController();
|
|
547
|
-
setExportController
|
|
495
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(controller);
|
|
548
496
|
if (dataMode === 'server' && onServerExport) {
|
|
549
|
-
// Server export with selection data
|
|
550
497
|
const currentFilters = {
|
|
551
498
|
globalFilter,
|
|
552
499
|
customColumnsFilter,
|
|
@@ -555,20 +502,19 @@ export function useDataTableApi(props, ref) {
|
|
|
555
502
|
columnOrder,
|
|
556
503
|
columnPinning,
|
|
557
504
|
};
|
|
558
|
-
|
|
505
|
+
yield (0, export_utils_1.exportServerData)(table, {
|
|
559
506
|
format: 'excel',
|
|
560
507
|
filename,
|
|
561
508
|
fetchData: (filters, selection) => onServerExport(filters, selection),
|
|
562
509
|
currentFilters,
|
|
563
|
-
selection: table.getSelectionState
|
|
510
|
+
selection: (_a = table.getSelectionState) === null || _a === void 0 ? void 0 : _a.call(table),
|
|
564
511
|
onProgress: onExportProgress,
|
|
565
512
|
onComplete: onExportComplete,
|
|
566
513
|
onError: onExportError,
|
|
567
514
|
});
|
|
568
515
|
}
|
|
569
516
|
else {
|
|
570
|
-
|
|
571
|
-
await exportClientData(table, {
|
|
517
|
+
yield (0, export_utils_1.exportClientData)(table, {
|
|
572
518
|
format: 'excel',
|
|
573
519
|
filename,
|
|
574
520
|
onProgress: onExportProgress,
|
|
@@ -578,28 +524,28 @@ export function useDataTableApi(props, ref) {
|
|
|
578
524
|
}
|
|
579
525
|
}
|
|
580
526
|
catch (error) {
|
|
581
|
-
onExportError
|
|
527
|
+
onExportError === null || onExportError === void 0 ? void 0 : onExportError({
|
|
582
528
|
message: error.message || 'Export failed',
|
|
583
529
|
code: 'EXPORT_ERROR',
|
|
584
530
|
});
|
|
585
531
|
}
|
|
586
532
|
finally {
|
|
587
|
-
setExportController
|
|
533
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(null);
|
|
588
534
|
}
|
|
589
|
-
},
|
|
590
|
-
exportServerData:
|
|
535
|
+
}),
|
|
536
|
+
exportServerData: (options) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
537
|
+
var _a;
|
|
591
538
|
const { format, filename = exportFilename, fetchData = onServerExport, } = options;
|
|
592
539
|
if (!fetchData) {
|
|
593
|
-
onExportError
|
|
540
|
+
onExportError === null || onExportError === void 0 ? void 0 : onExportError({
|
|
594
541
|
message: 'No server export function provided',
|
|
595
542
|
code: 'NO_SERVER_EXPORT',
|
|
596
543
|
});
|
|
597
544
|
return;
|
|
598
545
|
}
|
|
599
546
|
try {
|
|
600
|
-
// Create abort controller for this export
|
|
601
547
|
const controller = new AbortController();
|
|
602
|
-
setExportController
|
|
548
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(controller);
|
|
603
549
|
const currentFilters = {
|
|
604
550
|
globalFilter,
|
|
605
551
|
customColumnsFilter,
|
|
@@ -608,32 +554,31 @@ export function useDataTableApi(props, ref) {
|
|
|
608
554
|
columnOrder,
|
|
609
555
|
columnPinning,
|
|
610
556
|
};
|
|
611
|
-
|
|
557
|
+
yield (0, export_utils_1.exportServerData)(table, {
|
|
612
558
|
format,
|
|
613
559
|
filename,
|
|
614
560
|
fetchData: (filters, selection) => fetchData(filters, selection),
|
|
615
561
|
currentFilters,
|
|
616
|
-
selection: table.getSelectionState
|
|
562
|
+
selection: (_a = table.getSelectionState) === null || _a === void 0 ? void 0 : _a.call(table),
|
|
617
563
|
onProgress: onExportProgress,
|
|
618
564
|
onComplete: onExportComplete,
|
|
619
565
|
onError: onExportError,
|
|
620
566
|
});
|
|
621
567
|
}
|
|
622
568
|
catch (error) {
|
|
623
|
-
onExportError
|
|
569
|
+
onExportError === null || onExportError === void 0 ? void 0 : onExportError({
|
|
624
570
|
message: error.message || 'Export failed',
|
|
625
571
|
code: 'EXPORT_ERROR',
|
|
626
572
|
});
|
|
627
573
|
}
|
|
628
574
|
finally {
|
|
629
|
-
setExportController
|
|
575
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(null);
|
|
630
576
|
}
|
|
631
|
-
},
|
|
632
|
-
// Export state
|
|
577
|
+
}),
|
|
633
578
|
isExporting: () => isExporting || false,
|
|
634
579
|
cancelExport: () => {
|
|
635
|
-
exportController
|
|
636
|
-
setExportController
|
|
580
|
+
exportController === null || exportController === void 0 ? void 0 : exportController.abort();
|
|
581
|
+
setExportController === null || setExportController === void 0 ? void 0 : setExportController(null);
|
|
637
582
|
},
|
|
638
583
|
},
|
|
639
584
|
}), [
|
|
@@ -656,7 +601,6 @@ export function useDataTableApi(props, ref) {
|
|
|
656
601
|
initialPageIndex,
|
|
657
602
|
initialPageSize,
|
|
658
603
|
pageSize,
|
|
659
|
-
// Export dependencies
|
|
660
604
|
exportFilename,
|
|
661
605
|
onExportProgress,
|
|
662
606
|
onExportComplete,
|
|
@@ -668,6 +612,5 @@ export function useDataTableApi(props, ref) {
|
|
|
668
612
|
dataMode,
|
|
669
613
|
selectMode,
|
|
670
614
|
onSelectionChange,
|
|
671
|
-
// Note: custom selection removed from dependency array
|
|
672
615
|
]);
|
|
673
616
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddIcon = AddIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
function AddIcon(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.SvgIcon, Object.assign({}, props, { viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9", fill: "none", stroke: "currentColor", strokeWidth: "0.5", opacity: "0.3" })] })));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CsvIcon = CsvIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
function CsvIcon(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.SvgIcon, Object.assign({}, props, { viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M7,12.5A0.5,0.5 0 0,1 7.5,12H8.5A0.5,0.5 0 0,1 9,12.5V13.5A0.5,0.5 0 0,1 8.5,14H7.5A0.5,0.5 0 0,1 7,13.5M10.5,12.5A0.5,0.5 0 0,1 11,12H12A0.5,0.5 0 0,1 12.5,12.5V13.5A0.5,0.5 0 0,1 12,14H11A0.5,0.5 0 0,1 10.5,13.5M14,12.5A0.5,0.5 0 0,1 14.5,12H15.5A0.5,0.5 0 0,1 16,12.5V13.5A0.5,0.5 0 0,1 15.5,14H14.5A0.5,0.5 0 0,1 14,13.5" })] })));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteIcon = DeleteIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
function DeleteIcon(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.SvgIcon, Object.assign({}, props, { viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }), (0, jsx_runtime_1.jsx)("rect", { x: "9", y: "8", width: "2", height: "9", fill: "currentColor", opacity: "0.6" }), (0, jsx_runtime_1.jsx)("rect", { x: "13", y: "8", width: "2", height: "9", fill: "currentColor", opacity: "0.6" })] })));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExcelIcon = ExcelIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
function ExcelIcon(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.SvgIcon, Object.assign({}, props, { viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.5,15L9.75,12.5L11.5,10H10L8.75,11.5L7.5,10H6L7.75,12.5L6,15H7.5L8.75,13.5L10,15H11.5M15,10V12H17V10H15M15,14V16H17V14H15Z" })] })));
|
|
8
|
+
}
|