@redsift/table 11.2.0 → 11.2.1
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/index.d.ts +5 -7
- package/index.js +51 -62
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
|
-
import { GridColumnTypesRecord, GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps,
|
|
2
|
+
import { GridColumnTypesRecord, GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps, GridPaginationModel, GridFilterModel, GridSortModel, GridSortItem, GridColumnVisibilityModel, GridPinnedColumns, GridSlotsComponent, GridRowSelectionModel, GridApiPro as GridApiPro$1, GridRowParams, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
3
|
export { GridAlignment, GridColDef, GridFilterItem, GridFilterModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
4
|
import { GridInitialStatePro } from '@mui/x-data-grid-pro/models/gridStatePro';
|
|
5
5
|
import React, { ReactNode, ComponentProps, MutableRefObject, RefObject } from 'react';
|
|
@@ -155,8 +155,6 @@ interface StatefulDataGridProps extends DataGridProps {
|
|
|
155
155
|
search: string;
|
|
156
156
|
historyReplace: (newSearch: string) => void;
|
|
157
157
|
};
|
|
158
|
-
/** Pinned custom columns. */
|
|
159
|
-
pinnedCustomColumns?: Required<GridPinnedColumns>;
|
|
160
158
|
/** Local Storage version, to upgrade when we want to force a clean out. */
|
|
161
159
|
localStorageVersion?: number;
|
|
162
160
|
}
|
|
@@ -179,15 +177,15 @@ declare const isValueValid: (value: OperatorValue, field: string, columns: DataG
|
|
|
179
177
|
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel | 'invalid';
|
|
180
178
|
declare const getSearchParamsFromFilterModel: (filterModel: GridFilterModel) => URLSearchParams;
|
|
181
179
|
/** SORT */
|
|
182
|
-
declare const getSortingFromString: (searchString: string, columns: DataGridProps['columns']) => GridSortModel |
|
|
180
|
+
declare const getSortingFromString: (searchString: string, columns: DataGridProps['columns']) => GridSortModel | 'invalid';
|
|
183
181
|
declare const getSearchParamsFromSorting: (sorting: GridSortItem[]) => URLSearchParams;
|
|
184
182
|
/** PAGINATION */
|
|
185
|
-
declare const getPaginationFromString: (searchString: string) => ExtendedGridPaginationModel |
|
|
183
|
+
declare const getPaginationFromString: (searchString: string) => ExtendedGridPaginationModel | 'invalid';
|
|
186
184
|
declare const getSearchParamsFromPagination: (pagination: ExtendedGridPaginationModel) => URLSearchParams;
|
|
187
185
|
/** COLUMN VISIBILITY */
|
|
188
186
|
declare const getSearchParamsFromColumnVisibility: (columnVisibility: GridColumnVisibilityModel, columns: DataGridProps['columns']) => URLSearchParams;
|
|
189
|
-
declare const getColumnVisibilityFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => GridColumnVisibilityModel |
|
|
190
|
-
declare const getPinnedColumnsFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => PinnedColumns |
|
|
187
|
+
declare const getColumnVisibilityFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => GridColumnVisibilityModel | 'invalid';
|
|
188
|
+
declare const getPinnedColumnsFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => PinnedColumns | 'invalid';
|
|
191
189
|
declare const getSearchParamsFromPinnedColumns: (pinnedColumns: GridPinnedColumns) => URLSearchParams;
|
|
192
190
|
declare const getSearchParamsFromTab: (search: string) => URLSearchParams;
|
|
193
191
|
type FinalSearchInput = {
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLogicOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, useGridApiRef, DataGridPro
|
|
1
|
+
import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNumericOperators$1, GridFilterInputValue, GridFilterInputMultipleValue, getGridStringOperators as getGridStringOperators$1, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators, GridLogicOperator, GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, gridPaginatedVisibleSortedGridRowEntriesSelector, gridPaginatedVisibleSortedGridRowIdsSelector, gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, useGridApiRef, DataGridPro } from '@mui/x-data-grid-pro';
|
|
2
2
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { Children, isValidElement, cloneElement, forwardRef, useLayoutEffect, useEffect, useRef, useContext, useState, useCallback, createElement, useMemo } from 'react';
|
|
@@ -18247,7 +18247,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18247
18247
|
|
|
18248
18248
|
const getSortingFromString = (searchString, columns) => {
|
|
18249
18249
|
if (!searchString) {
|
|
18250
|
-
return
|
|
18250
|
+
return 'invalid';
|
|
18251
18251
|
}
|
|
18252
18252
|
const searchParams = new URLSearchParams(searchString);
|
|
18253
18253
|
const value = searchParams.get('_sortColumn');
|
|
@@ -18262,7 +18262,7 @@ const getSortingFromString = (searchString, columns) => {
|
|
|
18262
18262
|
sort: order
|
|
18263
18263
|
}];
|
|
18264
18264
|
}
|
|
18265
|
-
return
|
|
18265
|
+
return 'invalid';
|
|
18266
18266
|
};
|
|
18267
18267
|
const getSearchParamsFromSorting = sorting => {
|
|
18268
18268
|
const searchParams = new URLSearchParams();
|
|
@@ -18274,9 +18274,10 @@ const getSearchParamsFromSorting = sorting => {
|
|
|
18274
18274
|
// - if we have something in the URL, use that info
|
|
18275
18275
|
// - if we don't have that, use the localStorage and update the URL
|
|
18276
18276
|
// - if we don't have that, return an empty SortModel
|
|
18277
|
-
const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorting) => {
|
|
18277
|
+
const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorting, initialState) => {
|
|
18278
|
+
var _initialState$sorting;
|
|
18278
18279
|
const sorting = getSortingFromString(search, columns);
|
|
18279
|
-
if (sorting) {
|
|
18280
|
+
if (sorting !== 'invalid') {
|
|
18280
18281
|
const searchFromSortModel = getSearchParamsFromSorting(sorting);
|
|
18281
18282
|
const searchString = urlSearchParamsToString(searchFromSortModel);
|
|
18282
18283
|
if (searchString !== localStorageSorting) {
|
|
@@ -18285,30 +18286,22 @@ const getSortModel = (search, columns, localStorageSorting, setLocalStorageSorti
|
|
|
18285
18286
|
return sorting;
|
|
18286
18287
|
}
|
|
18287
18288
|
const sortModelFromLocalStorage = getSortingFromString(localStorageSorting, columns);
|
|
18288
|
-
if (sortModelFromLocalStorage) {
|
|
18289
|
+
if (sortModelFromLocalStorage !== 'invalid') {
|
|
18289
18290
|
return sortModelFromLocalStorage;
|
|
18290
18291
|
}
|
|
18291
|
-
return [];
|
|
18292
|
+
return initialState !== null && initialState !== void 0 && (_initialState$sorting = initialState.sorting) !== null && _initialState$sorting !== void 0 && _initialState$sorting.sortModel ? initialState.sorting.sortModel : [];
|
|
18292
18293
|
};
|
|
18293
18294
|
|
|
18294
18295
|
/** PAGINATION */
|
|
18295
18296
|
|
|
18296
18297
|
const getPaginationFromString = searchString => {
|
|
18297
18298
|
if (!searchString) {
|
|
18298
|
-
return
|
|
18299
|
-
page: 0,
|
|
18300
|
-
pageSize: 25,
|
|
18301
|
-
direction: 'next'
|
|
18302
|
-
};
|
|
18299
|
+
return 'invalid';
|
|
18303
18300
|
}
|
|
18304
18301
|
const searchParams = new URLSearchParams(searchString);
|
|
18305
18302
|
const value = searchParams.get('_pagination');
|
|
18306
18303
|
if (value === '' || value === null || value === '[]') {
|
|
18307
|
-
return
|
|
18308
|
-
page: 0,
|
|
18309
|
-
pageSize: 25,
|
|
18310
|
-
direction: 'next'
|
|
18311
|
-
};
|
|
18304
|
+
return 'invalid';
|
|
18312
18305
|
}
|
|
18313
18306
|
const pagination = value.slice(1, value.length - 1).split(',');
|
|
18314
18307
|
const page = parseFloat(pagination[0]);
|
|
@@ -18321,11 +18314,7 @@ const getPaginationFromString = searchString => {
|
|
|
18321
18314
|
direction: direction
|
|
18322
18315
|
};
|
|
18323
18316
|
}
|
|
18324
|
-
return
|
|
18325
|
-
page: 0,
|
|
18326
|
-
pageSize: 25,
|
|
18327
|
-
direction: 'next'
|
|
18328
|
-
};
|
|
18317
|
+
return 'invalid';
|
|
18329
18318
|
};
|
|
18330
18319
|
const getSearchParamsFromPagination = pagination => {
|
|
18331
18320
|
const searchParams = new URLSearchParams();
|
|
@@ -18337,9 +18326,9 @@ const getSearchParamsFromPagination = pagination => {
|
|
|
18337
18326
|
// - if we have something in the URL, use that info
|
|
18338
18327
|
// - if we don't have that, use the localStorage and update the URL
|
|
18339
18328
|
// - if we don't have that, return an empty PaginationModel
|
|
18340
|
-
const getPaginationModel = (search, localStoragePagination, setLocalStoragePagination) => {
|
|
18329
|
+
const getPaginationModel = (search, localStoragePagination, setLocalStoragePagination, initialState) => {
|
|
18341
18330
|
const pagination = getPaginationFromString(search);
|
|
18342
|
-
if (pagination) {
|
|
18331
|
+
if (pagination !== 'invalid') {
|
|
18343
18332
|
const searchFromPaginationModel = getSearchParamsFromPagination(pagination);
|
|
18344
18333
|
const searchString = urlSearchParamsToString(searchFromPaginationModel);
|
|
18345
18334
|
if (searchString !== localStoragePagination) {
|
|
@@ -18348,10 +18337,14 @@ const getPaginationModel = (search, localStoragePagination, setLocalStoragePagin
|
|
|
18348
18337
|
return pagination;
|
|
18349
18338
|
}
|
|
18350
18339
|
const paginationModelFromLocalStorage = getPaginationFromString(localStoragePagination);
|
|
18351
|
-
if (paginationModelFromLocalStorage) {
|
|
18340
|
+
if (paginationModelFromLocalStorage !== 'invalid') {
|
|
18352
18341
|
return paginationModelFromLocalStorage;
|
|
18353
18342
|
}
|
|
18354
|
-
return {
|
|
18343
|
+
return initialState !== null && initialState !== void 0 && initialState.pagination ? _objectSpread2({
|
|
18344
|
+
page: 0,
|
|
18345
|
+
pageSize: 25,
|
|
18346
|
+
direction: 'next'
|
|
18347
|
+
}, initialState.pagination) : {
|
|
18355
18348
|
page: 0,
|
|
18356
18349
|
pageSize: 25,
|
|
18357
18350
|
direction: 'next'
|
|
@@ -18393,7 +18386,7 @@ const getSearchParamsFromColumnVisibility = (columnVisibility, columns) => {
|
|
|
18393
18386
|
};
|
|
18394
18387
|
const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
18395
18388
|
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
18396
|
-
return
|
|
18389
|
+
return 'invalid';
|
|
18397
18390
|
}
|
|
18398
18391
|
// remove the initial ? if present
|
|
18399
18392
|
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
@@ -18430,7 +18423,7 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
|
18430
18423
|
}
|
|
18431
18424
|
}
|
|
18432
18425
|
if (visibleColumnsCount === 0 && !exist) {
|
|
18433
|
-
return
|
|
18426
|
+
return 'invalid';
|
|
18434
18427
|
}
|
|
18435
18428
|
return visibility;
|
|
18436
18429
|
};
|
|
@@ -18441,9 +18434,10 @@ const getColumnVisibilityFromString = (notParsed, tableColumns) => {
|
|
|
18441
18434
|
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
18442
18435
|
// NOTE: the `defaultHidden` is a custom field and not standard DataGrid
|
|
18443
18436
|
// The reason is the following bug: https://github.com/mui/mui-x/issues/8407
|
|
18444
|
-
const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility) => {
|
|
18437
|
+
const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility, initialState) => {
|
|
18438
|
+
var _initialState$columns;
|
|
18445
18439
|
const columnVisibility = getColumnVisibilityFromString(search, columns);
|
|
18446
|
-
if (columnVisibility) {
|
|
18440
|
+
if (columnVisibility !== 'invalid') {
|
|
18447
18441
|
const searchColumnVisibility = getSearchParamsFromColumnVisibility(columnVisibility, columns);
|
|
18448
18442
|
if (searchColumnVisibility.toString() !== localStorageColumnsVisibility) {
|
|
18449
18443
|
setLocalStorageColumnsVisibility(searchColumnVisibility.toString());
|
|
@@ -18451,9 +18445,12 @@ const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, se
|
|
|
18451
18445
|
return columnVisibility;
|
|
18452
18446
|
}
|
|
18453
18447
|
const columnVisibilityFromLocalStorage = getColumnVisibilityFromString(localStorageColumnsVisibility, columns);
|
|
18454
|
-
if (columnVisibilityFromLocalStorage) {
|
|
18448
|
+
if (columnVisibilityFromLocalStorage !== 'invalid') {
|
|
18455
18449
|
return columnVisibilityFromLocalStorage;
|
|
18456
18450
|
}
|
|
18451
|
+
if (initialState !== null && initialState !== void 0 && (_initialState$columns = initialState.columns) !== null && _initialState$columns !== void 0 && _initialState$columns.columnVisibilityModel) {
|
|
18452
|
+
return initialState.columns.columnVisibilityModel;
|
|
18453
|
+
}
|
|
18457
18454
|
|
|
18458
18455
|
// No columns in URL or localStorage, just show them all expect the hidden ones
|
|
18459
18456
|
const res = {};
|
|
@@ -18466,7 +18463,7 @@ const getColumnsVisibility = (search, columns, localStorageColumnsVisibility, se
|
|
|
18466
18463
|
};
|
|
18467
18464
|
const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
18468
18465
|
if (!notParsed || notParsed.length === 1 && notParsed[0] === '?') {
|
|
18469
|
-
return
|
|
18466
|
+
return 'invalid';
|
|
18470
18467
|
}
|
|
18471
18468
|
// remove the initial ? if present
|
|
18472
18469
|
const parsed = notParsed[0] === '?' ? notParsed.slice(1) : notParsed;
|
|
@@ -18493,13 +18490,10 @@ const getPinnedColumnsFromString = (notParsed, tableColumns) => {
|
|
|
18493
18490
|
pinnedColumns['right'] = columns;
|
|
18494
18491
|
}
|
|
18495
18492
|
}
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
};
|
|
18501
|
-
}
|
|
18502
|
-
return null;
|
|
18493
|
+
return pinnedColumns['left'] || pinnedColumns['right'] ? {
|
|
18494
|
+
left: pinnedColumns['left'] || [],
|
|
18495
|
+
right: pinnedColumns['right'] || []
|
|
18496
|
+
} : 'invalid';
|
|
18503
18497
|
};
|
|
18504
18498
|
const getSearchParamsFromPinnedColumns = pinnedColumns => {
|
|
18505
18499
|
var _pinnedColumns$left, _pinnedColumns$right;
|
|
@@ -18515,9 +18509,9 @@ const getSearchParamsFromPinnedColumns = pinnedColumns => {
|
|
|
18515
18509
|
// - if we have something in the URL, use that info
|
|
18516
18510
|
// - if we don't have that, use the localStorage and update the URL
|
|
18517
18511
|
// - if we don't have that, return an empty ColumnVisibilityModel (which is all columns)
|
|
18518
|
-
const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns) => {
|
|
18512
|
+
const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns, initialState) => {
|
|
18519
18513
|
const pinnedColumns = getPinnedColumnsFromString(search, columns);
|
|
18520
|
-
if (pinnedColumns) {
|
|
18514
|
+
if (pinnedColumns !== 'invalid') {
|
|
18521
18515
|
const searchPinnedColumns = getSearchParamsFromPinnedColumns(pinnedColumns);
|
|
18522
18516
|
if (searchPinnedColumns.toString() !== localStoragePinnedColumns) {
|
|
18523
18517
|
setLocalStoragePinnedColumns(searchPinnedColumns.toString());
|
|
@@ -18525,9 +18519,15 @@ const getPinnedColumns = (search, columns, localStoragePinnedColumns, setLocalSt
|
|
|
18525
18519
|
return pinnedColumns;
|
|
18526
18520
|
}
|
|
18527
18521
|
const pinnedColumnsFromLocalStorage = getPinnedColumnsFromString(localStoragePinnedColumns, columns);
|
|
18528
|
-
if (pinnedColumnsFromLocalStorage) {
|
|
18522
|
+
if (pinnedColumnsFromLocalStorage !== 'invalid') {
|
|
18529
18523
|
return pinnedColumnsFromLocalStorage;
|
|
18530
18524
|
}
|
|
18525
|
+
if (initialState !== null && initialState !== void 0 && initialState.pinnedColumns) {
|
|
18526
|
+
return {
|
|
18527
|
+
left: (initialState === null || initialState === void 0 ? void 0 : initialState.pinnedColumns['left']) || [],
|
|
18528
|
+
right: (initialState === null || initialState === void 0 ? void 0 : initialState.pinnedColumns['right']) || []
|
|
18529
|
+
};
|
|
18530
|
+
}
|
|
18531
18531
|
|
|
18532
18532
|
// No pinnedColumn in URL or localStorage, TODO: decide what is the default state
|
|
18533
18533
|
const res = {
|
|
@@ -18583,10 +18583,10 @@ const getModelsParsedOrUpdateLocalStorage = (search, columns, historyReplace, in
|
|
|
18583
18583
|
setLocalStoragePinnedColumns
|
|
18584
18584
|
} = localStorage;
|
|
18585
18585
|
const filterModel = getFilterModel(search, columns, localStorageFilters, setLocalStorageFilters, initialState);
|
|
18586
|
-
const sortModel = getSortModel(search, columns, localStorageSorting, setLocalStorageSorting);
|
|
18587
|
-
const paginationModel = getPaginationModel(search, localStoragePagination, setLocalStoragePagination);
|
|
18588
|
-
const columnVisibilityModel = getColumnsVisibility(search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility);
|
|
18589
|
-
const pinnedColumnsModel = getPinnedColumns(search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns);
|
|
18586
|
+
const sortModel = getSortModel(search, columns, localStorageSorting, setLocalStorageSorting, initialState);
|
|
18587
|
+
const paginationModel = getPaginationModel(search, localStoragePagination, setLocalStoragePagination, initialState);
|
|
18588
|
+
const columnVisibilityModel = getColumnsVisibility(search, columns, localStorageColumnsVisibility, setLocalStorageColumnsVisibility, initialState);
|
|
18589
|
+
const pinnedColumnsModel = getPinnedColumns(search, columns, localStoragePinnedColumns, setLocalStoragePinnedColumns, initialState);
|
|
18590
18590
|
const finalSearch = getFinalSearch({
|
|
18591
18591
|
search,
|
|
18592
18592
|
filterModel,
|
|
@@ -27479,13 +27479,13 @@ const useFetchState = (defaultValue, key) => {
|
|
|
27479
27479
|
|
|
27480
27480
|
// import useLocalStorage from './useLocalStorage';
|
|
27481
27481
|
|
|
27482
|
-
const useTableStates = (id, version
|
|
27482
|
+
const useTableStates = (id, version) => {
|
|
27483
27483
|
const [paginationModel, setPaginationModel] = useFetchState('', buildStorageKey({
|
|
27484
27484
|
id,
|
|
27485
27485
|
version,
|
|
27486
27486
|
category: PAGINATION_MODEL_KEY
|
|
27487
27487
|
}));
|
|
27488
|
-
const [sortModel, setSortModel] = useFetchState(
|
|
27488
|
+
const [sortModel, setSortModel] = useFetchState('', buildStorageKey({
|
|
27489
27489
|
id,
|
|
27490
27490
|
version,
|
|
27491
27491
|
category: SORT_MODEL_KEY
|
|
@@ -27500,7 +27500,7 @@ const useTableStates = (id, version, customDefaults) => {
|
|
|
27500
27500
|
version,
|
|
27501
27501
|
category: VISIBILITY_MODEL_KEY
|
|
27502
27502
|
}));
|
|
27503
|
-
const [pinnedColumns, setPinnedColumns] = useFetchState(
|
|
27503
|
+
const [pinnedColumns, setPinnedColumns] = useFetchState('_pinnedColumnsLeft=[]&_pinnedColumnsRight=[]', buildStorageKey({
|
|
27504
27504
|
id,
|
|
27505
27505
|
version,
|
|
27506
27506
|
category: PINNED_COLUMNS
|
|
@@ -27538,10 +27538,6 @@ const useStatefulTable = props => {
|
|
|
27538
27538
|
onPaginationModelChange: propsOnPaginationModelChange,
|
|
27539
27539
|
onPinnedColumnsChange: propsOnPinnedColumnsChange,
|
|
27540
27540
|
onSortModelChange: propsOnSortModelChange,
|
|
27541
|
-
pinnedCustomColumns = {
|
|
27542
|
-
left: [],
|
|
27543
|
-
right: []
|
|
27544
|
-
},
|
|
27545
27541
|
useRouter,
|
|
27546
27542
|
localStorageVersion = 2
|
|
27547
27543
|
} = props;
|
|
@@ -27551,11 +27547,6 @@ const useStatefulTable = props => {
|
|
|
27551
27547
|
historyReplace
|
|
27552
27548
|
} = useRouter();
|
|
27553
27549
|
const id = pathname;
|
|
27554
|
-
const customDefaults = useMemo(() => {
|
|
27555
|
-
return {
|
|
27556
|
-
pinnedColumns: `_pinnedColumnsLeft=[${[GRID_CHECKBOX_SELECTION_COL_DEF.field, ...pinnedCustomColumns.left].join(',')}]&_pinnedColumnsRight=[${pinnedCustomColumns.right.join(',')}]`
|
|
27557
|
-
};
|
|
27558
|
-
}, [pinnedCustomColumns]);
|
|
27559
27550
|
|
|
27560
27551
|
// States and setters persisted in the local storage for this table
|
|
27561
27552
|
const {
|
|
@@ -27571,7 +27562,7 @@ const useStatefulTable = props => {
|
|
|
27571
27562
|
setPinnedColumns,
|
|
27572
27563
|
dimensionModel,
|
|
27573
27564
|
setDimensionModel
|
|
27574
|
-
} = useTableStates(id, localStorageVersion
|
|
27565
|
+
} = useTableStates(id, localStorageVersion);
|
|
27575
27566
|
|
|
27576
27567
|
// clearing up old version keys, triggering only on first render
|
|
27577
27568
|
useEffect(() => clearPreviousVersionStorage(id, localStorageVersion), [id, localStorageVersion]);
|
|
@@ -27688,7 +27679,7 @@ const useStatefulTable = props => {
|
|
|
27688
27679
|
};
|
|
27689
27680
|
};
|
|
27690
27681
|
|
|
27691
|
-
const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "localStorageVersion", "onFilterModelChange", "rowSelectionModel", "onColumnWidthChange", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "
|
|
27682
|
+
const _excluded$1 = ["apiRef", "autoHeight", "className", "columns", "slots", "slotProps", "filterModel", "columnVisibilityModel", "pinnedColumns", "sortModel", "paginationModel", "height", "hideToolbar", "initialState", "isRowSelectable", "license", "localStorageVersion", "onFilterModelChange", "rowSelectionModel", "onColumnWidthChange", "onPaginationModelChange", "onRowSelectionModelChange", "onColumnVisibilityModelChange", "onPinnedColumnsChange", "onSortModelChange", "pagination", "paginationPlacement", "paginationProps", "rows", "pageSizeOptions", "sx", "theme", "useRouter", "paginationMode", "rowCount"];
|
|
27692
27683
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
27693
27684
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
27694
27685
|
const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -27722,7 +27713,6 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27722
27713
|
pagination,
|
|
27723
27714
|
paginationPlacement = 'both',
|
|
27724
27715
|
paginationProps,
|
|
27725
|
-
pinnedCustomColumns,
|
|
27726
27716
|
rows,
|
|
27727
27717
|
pageSizeOptions,
|
|
27728
27718
|
sx,
|
|
@@ -27780,7 +27770,6 @@ const StatefulDataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27780
27770
|
onPaginationModelChange: controlledOnPaginationModelChange,
|
|
27781
27771
|
onPinnedColumnsChange: controlledOnPinnedColumnsChange,
|
|
27782
27772
|
onSortModelChange: controlledOnSortModelChange,
|
|
27783
|
-
pinnedCustomColumns,
|
|
27784
27773
|
useRouter: useRouter,
|
|
27785
27774
|
localStorageVersion
|
|
27786
27775
|
});
|