@ackplus/react-tanstack-data-table 1.0.24-b-1 → 1.0.24
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
CHANGED
|
@@ -454,9 +454,18 @@ exports.DataTable = (0, react_1.forwardRef)(function DataTable({ initialState, c
|
|
|
454
454
|
}, [columnOrder, enhancedColumns, handleColumnOrderChange]);
|
|
455
455
|
(0, react_1.useEffect)(() => {
|
|
456
456
|
if (initialLoadData && onFetchData) {
|
|
457
|
+
if (fetchLogger.isLevelEnabled('info')) {
|
|
458
|
+
fetchLogger.info('Initial data load triggered', { initialLoadData });
|
|
459
|
+
}
|
|
457
460
|
fetchData();
|
|
458
461
|
}
|
|
459
|
-
|
|
462
|
+
else if (fetchLogger.isLevelEnabled('debug')) {
|
|
463
|
+
fetchLogger.debug('Skipping initial data load', {
|
|
464
|
+
initialLoadData,
|
|
465
|
+
hasOnFetchData: !!onFetchData
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}, []);
|
|
460
469
|
(0, react_1.useEffect)(() => {
|
|
461
470
|
if (enableColumnDragging && columnOrder.length === 0) {
|
|
462
471
|
const initialOrder = enhancedColumns.map((col, index) => {
|
|
@@ -471,8 +480,7 @@ exports.DataTable = (0, react_1.forwardRef)(function DataTable({ initialState, c
|
|
|
471
480
|
setColumnOrder(initialOrder);
|
|
472
481
|
}
|
|
473
482
|
}, [enableColumnDragging, enhancedColumns, columnOrder.length]);
|
|
474
|
-
(0, react_1.
|
|
475
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
483
|
+
const dataTableApi = (0, react_1.useMemo)(() => ({
|
|
476
484
|
table: {
|
|
477
485
|
getTable: () => table,
|
|
478
486
|
},
|
|
@@ -1141,6 +1149,8 @@ exports.DataTable = (0, react_1.forwardRef)(function DataTable({ initialState, c
|
|
|
1141
1149
|
selectMode,
|
|
1142
1150
|
onSelectionChange,
|
|
1143
1151
|
]);
|
|
1152
|
+
internalApiRef.current = dataTableApi;
|
|
1153
|
+
(0, react_1.useImperativeHandle)(ref, () => dataTableApi, [dataTableApi]);
|
|
1144
1154
|
const renderTableRows = (0, react_1.useCallback)(() => {
|
|
1145
1155
|
var _a, _b, _c, _d;
|
|
1146
1156
|
if (tableLoading) {
|
|
@@ -11,12 +11,8 @@ const icons_1 = require("../../icons");
|
|
|
11
11
|
const slot_helpers_1 = require("../../utils/slot-helpers");
|
|
12
12
|
function TableExportControl(props = {}) {
|
|
13
13
|
const { exportFilename: propsExportFilename, onServerExport: propsOnServerExport, onExportProgress: propsOnExportProgress, onExportComplete: propsOnExportComplete, onExportError: propsOnExportError, iconButtonProps, tooltipProps, menuSx, menuItemProps } = props, otherProps = tslib_1.__rest(props, ["exportFilename", "onServerExport", "onExportProgress", "onExportComplete", "onExportError", "iconButtonProps", "tooltipProps", "menuSx", "menuItemProps"]);
|
|
14
|
-
const {
|
|
14
|
+
const { apiRef, slots, slotProps, isExporting, exportFilename: contextExportFilename, } = (0, data_table_context_1.useDataTableContext)();
|
|
15
15
|
const exportFilename = propsExportFilename || contextExportFilename || 'export';
|
|
16
|
-
const onServerExport = propsOnServerExport || contextOnServerExport;
|
|
17
|
-
const onExportProgress = propsOnExportProgress || contextOnExportProgress;
|
|
18
|
-
const onExportComplete = propsOnExportComplete || contextOnExportComplete;
|
|
19
|
-
const onExportError = propsOnExportError || contextOnExportError;
|
|
20
16
|
const exportIconSlotProps = (0, slot_helpers_1.extractSlotProps)(slotProps, 'exportIcon');
|
|
21
17
|
const csvIconSlotProps = (0, slot_helpers_1.extractSlotProps)(slotProps, 'csvIcon');
|
|
22
18
|
const excelIconSlotProps = (0, slot_helpers_1.extractSlotProps)(slotProps, 'excelIcon');
|