@mui/x-data-grid 8.0.0-alpha.2 → 8.0.0-alpha.3
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/CHANGELOG.md +102 -0
- package/DataGrid/DataGrid.js +0 -8
- package/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/constants/dataGridPropsDefaultValues.js +0 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +25 -9
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +3 -6
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridRowEditing.js +3 -3
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -8
- package/hooks/features/rows/gridRowsSelector.d.ts +0 -1
- package/hooks/features/rows/gridRowsSelector.js +0 -1
- package/hooks/features/rows/gridRowsUtils.js +0 -9
- package/hooks/features/rows/index.d.ts +1 -1
- package/hooks/features/rows/index.js +1 -1
- package/hooks/features/rows/useGridRows.js +12 -14
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/locales/heIL.js +14 -16
- package/locales/trTR.js +12 -14
- package/models/events/gridEventLookup.d.ts +1 -0
- package/models/gridDataSource.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +0 -8
- package/modern/DataGrid/DataGrid.js +0 -8
- package/modern/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/modern/constants/dataGridPropsDefaultValues.js +0 -1
- package/modern/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +5 -1
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -3
- package/modern/hooks/features/rows/gridRowsSelector.js +0 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +0 -9
- package/modern/hooks/features/rows/index.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +12 -14
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/heIL.js +14 -16
- package/modern/locales/trTR.js +12 -14
- package/node/DataGrid/DataGrid.js +0 -8
- package/node/components/columnSelection/GridHeaderCheckbox.js +4 -1
- package/node/constants/dataGridPropsDefaultValues.js +0 -1
- package/node/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +7 -1
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +7 -8
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +1 -2
- package/node/hooks/features/rows/gridRowsUtils.js +0 -9
- package/node/hooks/features/rows/index.js +0 -7
- package/node/hooks/features/rows/useGridRows.js +11 -13
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/locales/heIL.js +14 -16
- package/node/locales/trTR.js +12 -14
- package/package.json +1 -1
package/locales/heIL.js
CHANGED
|
@@ -24,16 +24,15 @@ const heILGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: 'חיפוש',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'ניקוי',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: 'הקלד ערך…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: 'הקלד או הקלט ערך…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: 'ממתין להנחיה…',
|
|
30
|
+
toolbarPromptControlLabel: 'הזן ערך',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'הקלטה',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: 'הפסק הקלטה',
|
|
33
|
+
toolbarPromptControlSendActionLabel: 'שלח',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: 'שלח ערך',
|
|
35
|
+
toolbarPromptControlErrorMessage: 'התרחשה שגיאה בזמן העיבוד של הבקשה. נסה שוב עם ערך אחר בבקשה.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: 'ייצוא',
|
|
39
38
|
toolbarExportLabel: 'ייצוא',
|
|
@@ -45,8 +44,7 @@ const heILGrid = {
|
|
|
45
44
|
columnsManagementNoColumns: 'אין עמודות',
|
|
46
45
|
columnsManagementShowHideAllText: 'הצג/הסתר הכל',
|
|
47
46
|
columnsManagementReset: 'אתחול',
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
columnsManagementDeleteIconLabel: 'נקה',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: 'הוסף מסנן',
|
|
52
50
|
filterPanelRemoveAll: 'מחק הכל',
|
|
@@ -60,9 +58,9 @@ const heILGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: 'ערך מסנן',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: 'מכיל',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: 'לא מכיל',
|
|
64
62
|
filterOperatorEquals: 'שווה',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: 'לא שווה',
|
|
66
64
|
filterOperatorStartsWith: 'מתחיל ב-',
|
|
67
65
|
filterOperatorEndsWith: 'נגמר ב-',
|
|
68
66
|
filterOperatorIs: 'הינו',
|
|
@@ -82,9 +80,9 @@ const heILGrid = {
|
|
|
82
80
|
'filterOperator<=': '<=',
|
|
83
81
|
// Header filter operators text
|
|
84
82
|
headerFilterOperatorContains: 'מכיל',
|
|
85
|
-
|
|
83
|
+
headerFilterOperatorDoesNotContain: 'לא מכיל',
|
|
86
84
|
headerFilterOperatorEquals: 'שווה',
|
|
87
|
-
|
|
85
|
+
headerFilterOperatorDoesNotEqual: 'לא שווה',
|
|
88
86
|
headerFilterOperatorStartsWith: 'מתחיל ב-',
|
|
89
87
|
headerFilterOperatorEndsWith: 'נגמר ב-',
|
|
90
88
|
headerFilterOperatorIs: 'הינו',
|
package/locales/trTR.js
CHANGED
|
@@ -24,16 +24,15 @@ const trTRGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: 'Ara',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'Temizle',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: 'Bir istem yazın…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: 'Bir istem yazın veya kaydedin…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: 'İstem dinleniyor…',
|
|
30
|
+
toolbarPromptControlLabel: 'İstem girişi',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'Kaydet',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: 'Kaydı durdur',
|
|
33
|
+
toolbarPromptControlSendActionLabel: 'Gönder',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: 'İstemi gönder',
|
|
35
|
+
toolbarPromptControlErrorMessage: 'İstek işlenirken bir hata oluştu. Lütfen farklı bir istemle tekrar deneyin.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: 'Dışa aktar',
|
|
39
38
|
toolbarExportLabel: 'Dışa aktar',
|
|
@@ -45,8 +44,7 @@ const trTRGrid = {
|
|
|
45
44
|
columnsManagementNoColumns: 'Kolon yok',
|
|
46
45
|
columnsManagementShowHideAllText: 'Hepsini Göster/Gizle',
|
|
47
46
|
columnsManagementReset: 'Sıfırla',
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
columnsManagementDeleteIconLabel: 'Temizle',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
52
50
|
filterPanelRemoveAll: 'Hepsini kaldır',
|
|
@@ -60,9 +58,9 @@ const trTRGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: 'Filtre değeri',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: 'içerir',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: 'içermiyor',
|
|
64
62
|
filterOperatorEquals: 'eşittir',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: 'eşit değil',
|
|
66
64
|
filterOperatorStartsWith: 'ile başlar',
|
|
67
65
|
filterOperatorEndsWith: 'ile biter',
|
|
68
66
|
filterOperatorIs: 'eşittir',
|
|
@@ -399,6 +399,7 @@ export interface GridControlledStateEventLookup {
|
|
|
399
399
|
export interface GridControlledStateReasonLookup {
|
|
400
400
|
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
|
|
401
401
|
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
|
|
402
|
+
rows: 'addSkeletonRows';
|
|
402
403
|
}
|
|
403
404
|
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
404
405
|
/**
|
|
@@ -5,7 +5,7 @@ export interface GridGetRowsParams {
|
|
|
5
5
|
/**
|
|
6
6
|
* Alternate to `start` and `end`, maps to `GridPaginationModel` interface.
|
|
7
7
|
*/
|
|
8
|
-
paginationModel
|
|
8
|
+
paginationModel?: GridPaginationModel;
|
|
9
9
|
/**
|
|
10
10
|
* First row index to fetch (number) or cursor information (number | string).
|
|
11
11
|
*/
|
|
@@ -338,14 +338,6 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
338
338
|
* @default '\t'
|
|
339
339
|
*/
|
|
340
340
|
clipboardCopyCellDelimiter: string;
|
|
341
|
-
/**
|
|
342
|
-
* The milliseconds delay to wait after measuring the row height before recalculating row positions.
|
|
343
|
-
* Setting it to a lower value could be useful when using dynamic row height,
|
|
344
|
-
* but might reduce performance when displaying a large number of rows.
|
|
345
|
-
* @default 166
|
|
346
|
-
* @deprecated
|
|
347
|
-
*/
|
|
348
|
-
rowPositionsDebounceMs: number;
|
|
349
341
|
/**
|
|
350
342
|
* If `true`, columns are autosized after the datagrid is mounted.
|
|
351
343
|
* @default false
|
|
@@ -682,14 +682,6 @@ DataGridRaw.propTypes = {
|
|
|
682
682
|
* Controls the modes of the rows.
|
|
683
683
|
*/
|
|
684
684
|
rowModesModel: PropTypes.object,
|
|
685
|
-
/**
|
|
686
|
-
* The milliseconds delay to wait after measuring the row height before recalculating row positions.
|
|
687
|
-
* Setting it to a lower value could be useful when using dynamic row height,
|
|
688
|
-
* but might reduce performance when displaying a large number of rows.
|
|
689
|
-
* @default 166
|
|
690
|
-
* @deprecated
|
|
691
|
-
*/
|
|
692
|
-
rowPositionsDebounceMs: PropTypes.number,
|
|
693
685
|
/**
|
|
694
686
|
* Set of rows of type [[GridRowsProp]].
|
|
695
687
|
* @default []
|
|
@@ -56,10 +56,13 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
|
|
|
56
56
|
// Convert to an object to make O(1) checking if a row exists or not
|
|
57
57
|
// TODO create selector that returns visibleRowIds/paginatedVisibleRowIds as an object
|
|
58
58
|
return rowIds.reduce((acc, id) => {
|
|
59
|
+
if (!apiRef.current.isRowSelectable(id)) {
|
|
60
|
+
return acc;
|
|
61
|
+
}
|
|
59
62
|
acc[id] = true;
|
|
60
63
|
return acc;
|
|
61
64
|
}, {});
|
|
62
|
-
}, [rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);
|
|
65
|
+
}, [apiRef, rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);
|
|
63
66
|
|
|
64
67
|
// Amount of rows selected and that are visible in the current page
|
|
65
68
|
const currentSelectionSize = React.useMemo(() => filteredSelection.filter(id => selectionCandidates[id]).length, [filteredSelection, selectionCandidates]);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { GridStrategyGroup } from "./gridStrategyProcessingApi.js";
|
|
4
5
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
6
|
export const GRID_DEFAULT_STRATEGY = 'none';
|
|
6
7
|
export const GRID_STRATEGIES_PROCESSORS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
dataSourceRowsUpdate: GridStrategyGroup.DataSource,
|
|
9
|
+
rowTreeCreation: GridStrategyGroup.RowTree,
|
|
10
|
+
filtering: GridStrategyGroup.RowTree,
|
|
11
|
+
sorting: GridStrategyGroup.RowTree,
|
|
12
|
+
visibleRowsLookupCreation: GridStrategyGroup.RowTree
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
@@ -44,10 +46,7 @@ export const GRID_STRATEGIES_PROCESSORS = {
|
|
|
44
46
|
* =====================================================================================================================
|
|
45
47
|
*
|
|
46
48
|
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
47
|
-
*
|
|
48
|
-
* - row tree creation algorithm.
|
|
49
|
-
* - sorting algorithm.
|
|
50
|
-
* - filtering algorithm.
|
|
49
|
+
* There are two active groups named `rowTree` and `dataSource`.
|
|
51
50
|
*/
|
|
52
51
|
export const useGridStrategyProcessing = apiRef => {
|
|
53
52
|
const availableStrategies = React.useRef(new Map());
|
|
@@ -491,7 +491,8 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
491
491
|
const widthByField = extractColumnWidths(apiRef, options, columns);
|
|
492
492
|
const newColumns = columns.map(column => _extends({}, column, {
|
|
493
493
|
width: widthByField[column.field],
|
|
494
|
-
computedWidth: widthByField[column.field]
|
|
494
|
+
computedWidth: widthByField[column.field],
|
|
495
|
+
flex: 0
|
|
495
496
|
}));
|
|
496
497
|
if (options.expand) {
|
|
497
498
|
const visibleColumns = state.orderedFields.map(field => state.lookup[field]).filter(c => state.columnVisibilityModel[c.field] !== false);
|
|
@@ -11,7 +11,7 @@ import { GridEditModes, GridCellModes } from "../../../models/gridEditRowModel.j
|
|
|
11
11
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
12
12
|
import { gridEditRowsStateSelector } from "./gridEditingSelectors.js";
|
|
13
13
|
import { isPrintableKey, isPasteShortcut } from "../../../utils/keyboardUtils.js";
|
|
14
|
-
import {
|
|
14
|
+
import { gridRowsLookupSelector } from "../rows/gridRowsSelector.js";
|
|
15
15
|
import { deepClone } from "../../../utils/utils.js";
|
|
16
16
|
import { GridCellEditStartReasons, GridCellEditStopReasons } from "../../../models/params/gridEditCellParams.js";
|
|
17
17
|
import { getDefaultCellValue } from "./utils.js";
|
|
@@ -442,7 +442,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
442
442
|
|
|
443
443
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
444
444
|
useEnhancedEffect(() => {
|
|
445
|
-
const
|
|
445
|
+
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
446
446
|
|
|
447
447
|
// Update the ref here because updateStateToStopCellEditMode may change it later
|
|
448
448
|
const copyOfPrevCellModes = prevCellModesModel.current;
|
|
@@ -451,7 +451,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
451
451
|
Object.entries(cellModesModel).forEach(([id, fields]) => {
|
|
452
452
|
Object.entries(fields).forEach(([field, params]) => {
|
|
453
453
|
const prevMode = copyOfPrevCellModes[id]?.[field]?.mode || GridCellModes.View;
|
|
454
|
-
const originalId =
|
|
454
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
455
455
|
if (params.mode === GridCellModes.Edit && prevMode === GridCellModes.View) {
|
|
456
456
|
updateStateToStartCellEditMode(_extends({
|
|
457
457
|
id: originalId,
|
|
@@ -12,7 +12,7 @@ import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
|
12
12
|
import { gridEditRowsStateSelector } from "./gridEditingSelectors.js";
|
|
13
13
|
import { isPrintableKey, isPasteShortcut } from "../../../utils/keyboardUtils.js";
|
|
14
14
|
import { gridColumnFieldsSelector, gridVisibleColumnFieldsSelector } from "../columns/gridColumnsSelector.js";
|
|
15
|
-
import {
|
|
15
|
+
import { gridRowsLookupSelector } from "../rows/gridRowsSelector.js";
|
|
16
16
|
import { deepClone } from "../../../utils/utils.js";
|
|
17
17
|
import { GridRowEditStopReasons, GridRowEditStartReasons } from "../../../models/params/gridRowParams.js";
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../../../colDef/index.js";
|
|
@@ -571,7 +571,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
571
571
|
|
|
572
572
|
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
573
573
|
useEnhancedEffect(() => {
|
|
574
|
-
const
|
|
574
|
+
const rowsLookup = gridRowsLookupSelector(apiRef);
|
|
575
575
|
|
|
576
576
|
// Update the ref here because updateStateToStopRowEditMode may change it later
|
|
577
577
|
const copyOfPrevRowModesModel = prevRowModesModel.current;
|
|
@@ -583,7 +583,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
583
583
|
mode: GridRowModes.View
|
|
584
584
|
};
|
|
585
585
|
const prevMode = copyOfPrevRowModesModel[id]?.mode || GridRowModes.View;
|
|
586
|
-
const originalId =
|
|
586
|
+
const originalId = apiRef.current.getRowId(rowsLookup[id]) ?? id;
|
|
587
587
|
if (params.mode === GridRowModes.Edit && prevMode === GridRowModes.View) {
|
|
588
588
|
updateStateToStartRowEditMode(_extends({
|
|
589
589
|
id: originalId
|
|
@@ -6,7 +6,6 @@ export const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector
|
|
|
6
6
|
|
|
7
7
|
// TODO rows v6: Rename
|
|
8
8
|
export const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);
|
|
9
|
-
export const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);
|
|
10
9
|
export const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);
|
|
11
10
|
export const gridRowGroupsToFetchSelector = createSelector(gridRowsStateSelector, rows => rows.groupsToFetch);
|
|
12
11
|
export const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);
|
|
@@ -42,12 +42,10 @@ export const createRowsInternalCache = ({
|
|
|
42
42
|
rows: []
|
|
43
43
|
};
|
|
44
44
|
const dataRowIdToModelLookup = {};
|
|
45
|
-
const dataRowIdToIdLookup = {};
|
|
46
45
|
for (let i = 0; i < rows.length; i += 1) {
|
|
47
46
|
const model = rows[i];
|
|
48
47
|
const id = getRowIdFromRowModel(model, getRowId);
|
|
49
48
|
dataRowIdToModelLookup[id] = model;
|
|
50
|
-
dataRowIdToIdLookup[id] = id;
|
|
51
49
|
updates.rows.push(id);
|
|
52
50
|
}
|
|
53
51
|
return {
|
|
@@ -55,7 +53,6 @@ export const createRowsInternalCache = ({
|
|
|
55
53
|
loadingPropBeforePartialUpdates: loading,
|
|
56
54
|
rowCountPropBeforePartialUpdates: rowCount,
|
|
57
55
|
updates,
|
|
58
|
-
dataRowIdToIdLookup,
|
|
59
56
|
dataRowIdToModelLookup
|
|
60
57
|
};
|
|
61
58
|
};
|
|
@@ -87,7 +84,6 @@ export const getRowsStateFromCache = ({
|
|
|
87
84
|
previousTree,
|
|
88
85
|
previousTreeDepths,
|
|
89
86
|
updates: cache.updates,
|
|
90
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
91
87
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup,
|
|
92
88
|
previousGroupsToFetch
|
|
93
89
|
});
|
|
@@ -96,7 +92,6 @@ export const getRowsStateFromCache = ({
|
|
|
96
92
|
const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
97
93
|
tree: unProcessedTree,
|
|
98
94
|
treeDepths: unProcessedTreeDepths,
|
|
99
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
100
95
|
dataRowIds: unProcessedDataRowIds,
|
|
101
96
|
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
102
97
|
});
|
|
@@ -177,7 +172,6 @@ export const updateCacheWithNewRows = ({
|
|
|
177
172
|
groupKeys
|
|
178
173
|
};
|
|
179
174
|
const dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);
|
|
180
|
-
const dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);
|
|
181
175
|
const alreadyAppliedActionsToRemove = {
|
|
182
176
|
insert: {},
|
|
183
177
|
modify: {},
|
|
@@ -210,7 +204,6 @@ export const updateCacheWithNewRows = ({
|
|
|
210
204
|
// Remove the data row from the lookups and add it to the "delete" update.
|
|
211
205
|
partialUpdates.actions.remove.push(id);
|
|
212
206
|
delete dataRowIdToModelLookup[id];
|
|
213
|
-
delete dataRowIdToIdLookup[id];
|
|
214
207
|
return;
|
|
215
208
|
}
|
|
216
209
|
const oldRow = dataRowIdToModelLookup[id];
|
|
@@ -250,7 +243,6 @@ export const updateCacheWithNewRows = ({
|
|
|
250
243
|
|
|
251
244
|
// Update the data row lookups.
|
|
252
245
|
dataRowIdToModelLookup[id] = partialRow;
|
|
253
|
-
dataRowIdToIdLookup[id] = id;
|
|
254
246
|
});
|
|
255
247
|
const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);
|
|
256
248
|
for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {
|
|
@@ -262,7 +254,6 @@ export const updateCacheWithNewRows = ({
|
|
|
262
254
|
}
|
|
263
255
|
return {
|
|
264
256
|
dataRowIdToModelLookup,
|
|
265
|
-
dataRowIdToIdLookup,
|
|
266
257
|
updates: partialUpdates,
|
|
267
258
|
rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,
|
|
268
259
|
loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./gridRowsMetaSelector.js";
|
|
2
2
|
export * from "./gridRowsMetaState.js";
|
|
3
|
-
export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector,
|
|
3
|
+
export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridRowMaximumTreeDepthSelector, gridDataRowIdsSelector } from "./gridRowsSelector.js";
|
|
4
4
|
export { GRID_ROOT_GROUP_ID, checkGridRowIdIsValid, isAutogeneratedRow } from "./gridRowsUtils.js";
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
|
|
5
5
|
import { useGridLogger } from "../../utils/useGridLogger.js";
|
|
6
|
-
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector,
|
|
6
|
+
import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
|
|
7
7
|
import { useTimeout } from "../../utils/useTimeout.js";
|
|
8
8
|
import { GridSignature, useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
9
9
|
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
@@ -11,6 +11,7 @@ import { gridSortedRowIdsSelector } from "../sorting/gridSortingSelector.js";
|
|
|
11
11
|
import { gridFilteredRowsLookupSelector } from "../filter/gridFilterSelector.js";
|
|
12
12
|
import { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutogeneratedRowNode, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel, computeRowsUpdates } from "./gridRowsUtils.js";
|
|
13
13
|
import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.js";
|
|
14
|
+
import { GridStrategyGroup } from "../../core/strategyProcessing/index.js";
|
|
14
15
|
export const rowsStateInitializer = (state, props, apiRef) => {
|
|
15
16
|
const isDataSourceAvailable = !!props.unstable_dataSource;
|
|
16
17
|
apiRef.current.caches.rows = createRowsInternalCache({
|
|
@@ -272,7 +273,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
272
273
|
}
|
|
273
274
|
const tree = _extends({}, gridRowTreeSelector(apiRef));
|
|
274
275
|
const dataRowIdToModelLookup = _extends({}, gridRowsLookupSelector(apiRef));
|
|
275
|
-
const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));
|
|
276
276
|
const rootGroup = tree[GRID_ROOT_GROUP_ID];
|
|
277
277
|
const rootGroupChildren = [...rootGroup.children];
|
|
278
278
|
const seenIds = new Set();
|
|
@@ -282,7 +282,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
282
282
|
const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);
|
|
283
283
|
if (!seenIds.has(removedRowId)) {
|
|
284
284
|
delete dataRowIdToModelLookup[removedRowId];
|
|
285
|
-
delete dataRowIdToIdLookup[removedRowId];
|
|
286
285
|
delete tree[removedRowId];
|
|
287
286
|
}
|
|
288
287
|
const rowTreeNodeConfig = {
|
|
@@ -293,7 +292,6 @@ export const useGridRows = (apiRef, props) => {
|
|
|
293
292
|
groupingKey: null
|
|
294
293
|
};
|
|
295
294
|
dataRowIdToModelLookup[rowId] = rowModel;
|
|
296
|
-
dataRowIdToIdLookup[rowId] = rowId;
|
|
297
295
|
tree[rowId] = rowTreeNodeConfig;
|
|
298
296
|
seenIds.add(rowId);
|
|
299
297
|
}
|
|
@@ -304,17 +302,17 @@ export const useGridRows = (apiRef, props) => {
|
|
|
304
302
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
305
303
|
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
306
304
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
307
|
-
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
308
305
|
apiRef.current.setState(state => _extends({}, state, {
|
|
309
306
|
rows: _extends({}, state.rows, {
|
|
307
|
+
loading: props.loading,
|
|
308
|
+
totalRowCount: Math.max(props.rowCount || 0, rootGroupChildren.length),
|
|
310
309
|
dataRowIdToModelLookup,
|
|
311
|
-
dataRowIdToIdLookup,
|
|
312
310
|
dataRowIds,
|
|
313
311
|
tree
|
|
314
312
|
})
|
|
315
313
|
}));
|
|
316
314
|
apiRef.current.publishEvent('rowsSet');
|
|
317
|
-
}, [apiRef, props.signature, props.getRowId]);
|
|
315
|
+
}, [apiRef, props.signature, props.getRowId, props.loading, props.rowCount]);
|
|
318
316
|
const rowApi = {
|
|
319
317
|
getRow,
|
|
320
318
|
setLoading,
|
|
@@ -381,7 +379,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
381
379
|
const handleStrategyActivityChange = React.useCallback(() => {
|
|
382
380
|
// `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
|
|
383
381
|
// All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
|
|
384
|
-
if (apiRef.current.getActiveStrategy(
|
|
382
|
+
if (apiRef.current.getActiveStrategy(GridStrategyGroup.RowTree) !== gridRowGroupingNameSelector(apiRef)) {
|
|
385
383
|
groupRows();
|
|
386
384
|
}
|
|
387
385
|
}, [apiRef, groupRows]);
|
|
@@ -397,8 +395,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
397
395
|
tree: gridRowTreeSelector(state, apiRef.current.instanceId),
|
|
398
396
|
treeDepths: gridRowTreeDepthsSelector(state, apiRef.current.instanceId),
|
|
399
397
|
dataRowIds: gridDataRowIdsSelector(state, apiRef.current.instanceId),
|
|
400
|
-
dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId)
|
|
401
|
-
dataRowIdToIdLookup: gridRowsDataRowIdToIdLookupSelector(state, apiRef.current.instanceId)
|
|
398
|
+
dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId)
|
|
402
399
|
});
|
|
403
400
|
return _extends({}, state, {
|
|
404
401
|
rows: _extends({}, state.rows, response, {
|
|
@@ -430,7 +427,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
430
427
|
isRowCountPropUpdated = true;
|
|
431
428
|
lastRowCount.current = props.rowCount;
|
|
432
429
|
}
|
|
433
|
-
const
|
|
430
|
+
const currentRows = props.unstable_dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
|
|
431
|
+
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
|
|
434
432
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
435
433
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
436
434
|
|
|
@@ -460,15 +458,15 @@ export const useGridRows = (apiRef, props) => {
|
|
|
460
458
|
return;
|
|
461
459
|
}
|
|
462
460
|
}
|
|
463
|
-
logger.debug(`Updating all rows, new length ${
|
|
461
|
+
logger.debug(`Updating all rows, new length ${currentRows?.length}`);
|
|
464
462
|
throttledRowsChange({
|
|
465
463
|
cache: createRowsInternalCache({
|
|
466
|
-
rows:
|
|
464
|
+
rows: currentRows,
|
|
467
465
|
getRowId: props.getRowId,
|
|
468
466
|
loading: props.loading,
|
|
469
467
|
rowCount: props.rowCount
|
|
470
468
|
}),
|
|
471
469
|
throttle: false
|
|
472
470
|
});
|
|
473
|
-
}, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);
|
|
471
|
+
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.unstable_dataSource, logger, throttledRowsChange, apiRef]);
|
|
474
472
|
};
|
package/modern/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlot
|
|
|
7
7
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.js";
|
|
8
8
|
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
9
9
|
export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.js";
|
|
10
|
-
export { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.js";
|
|
10
|
+
export { GridStrategyGroup, useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.js";
|
|
11
11
|
export { useGridInitialization } from "../hooks/core/useGridInitialization.js";
|
|
12
12
|
export { unwrapPrivateAPI } from "../hooks/core/useGridApiInitialization.js";
|
|
13
13
|
export { useGridClipboard } from "../hooks/features/clipboard/useGridClipboard.js";
|
package/modern/locales/heIL.js
CHANGED
|
@@ -24,16 +24,15 @@ const heILGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: 'חיפוש',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'ניקוי',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: 'הקלד ערך…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: 'הקלד או הקלט ערך…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: 'ממתין להנחיה…',
|
|
30
|
+
toolbarPromptControlLabel: 'הזן ערך',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'הקלטה',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: 'הפסק הקלטה',
|
|
33
|
+
toolbarPromptControlSendActionLabel: 'שלח',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: 'שלח ערך',
|
|
35
|
+
toolbarPromptControlErrorMessage: 'התרחשה שגיאה בזמן העיבוד של הבקשה. נסה שוב עם ערך אחר בבקשה.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: 'ייצוא',
|
|
39
38
|
toolbarExportLabel: 'ייצוא',
|
|
@@ -45,8 +44,7 @@ const heILGrid = {
|
|
|
45
44
|
columnsManagementNoColumns: 'אין עמודות',
|
|
46
45
|
columnsManagementShowHideAllText: 'הצג/הסתר הכל',
|
|
47
46
|
columnsManagementReset: 'אתחול',
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
columnsManagementDeleteIconLabel: 'נקה',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: 'הוסף מסנן',
|
|
52
50
|
filterPanelRemoveAll: 'מחק הכל',
|
|
@@ -60,9 +58,9 @@ const heILGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: 'ערך מסנן',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: 'מכיל',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: 'לא מכיל',
|
|
64
62
|
filterOperatorEquals: 'שווה',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: 'לא שווה',
|
|
66
64
|
filterOperatorStartsWith: 'מתחיל ב-',
|
|
67
65
|
filterOperatorEndsWith: 'נגמר ב-',
|
|
68
66
|
filterOperatorIs: 'הינו',
|
|
@@ -82,9 +80,9 @@ const heILGrid = {
|
|
|
82
80
|
'filterOperator<=': '<=',
|
|
83
81
|
// Header filter operators text
|
|
84
82
|
headerFilterOperatorContains: 'מכיל',
|
|
85
|
-
|
|
83
|
+
headerFilterOperatorDoesNotContain: 'לא מכיל',
|
|
86
84
|
headerFilterOperatorEquals: 'שווה',
|
|
87
|
-
|
|
85
|
+
headerFilterOperatorDoesNotEqual: 'לא שווה',
|
|
88
86
|
headerFilterOperatorStartsWith: 'מתחיל ב-',
|
|
89
87
|
headerFilterOperatorEndsWith: 'נגמר ב-',
|
|
90
88
|
headerFilterOperatorIs: 'הינו',
|
package/modern/locales/trTR.js
CHANGED
|
@@ -24,16 +24,15 @@ const trTRGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: 'Ara',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'Temizle',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: 'Bir istem yazın…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: 'Bir istem yazın veya kaydedin…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: 'İstem dinleniyor…',
|
|
30
|
+
toolbarPromptControlLabel: 'İstem girişi',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'Kaydet',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: 'Kaydı durdur',
|
|
33
|
+
toolbarPromptControlSendActionLabel: 'Gönder',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: 'İstemi gönder',
|
|
35
|
+
toolbarPromptControlErrorMessage: 'İstek işlenirken bir hata oluştu. Lütfen farklı bir istemle tekrar deneyin.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: 'Dışa aktar',
|
|
39
38
|
toolbarExportLabel: 'Dışa aktar',
|
|
@@ -45,8 +44,7 @@ const trTRGrid = {
|
|
|
45
44
|
columnsManagementNoColumns: 'Kolon yok',
|
|
46
45
|
columnsManagementShowHideAllText: 'Hepsini Göster/Gizle',
|
|
47
46
|
columnsManagementReset: 'Sıfırla',
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
columnsManagementDeleteIconLabel: 'Temizle',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
52
50
|
filterPanelRemoveAll: 'Hepsini kaldır',
|
|
@@ -60,9 +58,9 @@ const trTRGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: 'Filtre değeri',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: 'içerir',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: 'içermiyor',
|
|
64
62
|
filterOperatorEquals: 'eşittir',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: 'eşit değil',
|
|
66
64
|
filterOperatorStartsWith: 'ile başlar',
|
|
67
65
|
filterOperatorEndsWith: 'ile biter',
|
|
68
66
|
filterOperatorIs: 'eşittir',
|
|
@@ -689,14 +689,6 @@ DataGridRaw.propTypes = {
|
|
|
689
689
|
* Controls the modes of the rows.
|
|
690
690
|
*/
|
|
691
691
|
rowModesModel: _propTypes.default.object,
|
|
692
|
-
/**
|
|
693
|
-
* The milliseconds delay to wait after measuring the row height before recalculating row positions.
|
|
694
|
-
* Setting it to a lower value could be useful when using dynamic row height,
|
|
695
|
-
* but might reduce performance when displaying a large number of rows.
|
|
696
|
-
* @default 166
|
|
697
|
-
* @deprecated
|
|
698
|
-
*/
|
|
699
|
-
rowPositionsDebounceMs: _propTypes.default.number,
|
|
700
692
|
/**
|
|
701
693
|
* Set of rows of type [[GridRowsProp]].
|
|
702
694
|
* @default []
|