@mui/x-data-grid 6.0.0-alpha.2 → 6.0.0-alpha.4
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 +493 -141
- package/DataGrid/DataGrid.js +14 -34
- package/DataGrid/useDataGridComponent.js +8 -14
- package/DataGrid/useDataGridProps.js +3 -3
- package/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/colDef/gridNumericOperators.d.ts +1 -1
- package/colDef/gridSingleSelectOperators.d.ts +1 -1
- package/colDef/gridStringOperators.d.ts +1 -1
- package/components/GridFooter.js +1 -1
- package/components/GridRow.js +2 -2
- package/components/base/GridBody.js +2 -2
- package/components/cell/GridEditInputCell.js +3 -8
- package/components/cell/GridEditSingleSelectCell.js +6 -38
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +32 -5
- package/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/components/containers/GridRoot.js +4 -3
- package/components/panel/GridColumnsPanel.d.ts +2 -0
- package/components/panel/GridColumnsPanel.js +10 -4
- package/components/panel/filterPanel/GridFilterForm.d.ts +12 -0
- package/components/panel/filterPanel/GridFilterForm.js +29 -7
- package/components/panel/filterPanel/GridFilterPanel.d.ts +12 -0
- package/components/panel/filterPanel/GridFilterPanel.js +64 -19
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +1 -1
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -1
- package/hooks/features/columnGrouping/gridColumnGroupsInterfaces.d.ts +10 -1
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +6 -0
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +34 -1
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.d.ts +15 -0
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +89 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -15
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +66 -66
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +60 -116
- package/hooks/features/density/densitySelector.d.ts +0 -2
- package/hooks/features/density/densitySelector.js +1 -3
- package/hooks/features/density/densityState.d.ts +0 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/density/useGridDensity.js +9 -45
- package/hooks/features/dimensions/useGridDimensions.js +3 -2
- package/hooks/features/{editRows/gridEditRowsSelector.d.ts → editing/gridEditingSelectors.d.ts} +0 -0
- package/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
- package/hooks/features/editing/index.d.ts +1 -0
- package/hooks/features/editing/index.js +1 -0
- package/hooks/features/{editRows/useGridCellEditing.new.d.ts → editing/useGridCellEditing.d.ts} +0 -0
- package/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
- package/hooks/features/{editRows/useGridEditing.new.d.ts → editing/useGridEditing.d.ts} +0 -0
- package/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
- package/hooks/features/{editRows/useGridRowEditing.new.d.ts → editing/useGridRowEditing.d.ts} +0 -0
- package/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
- package/hooks/features/export/useGridPrintExport.js +2 -2
- package/hooks/features/focus/gridFocusState.d.ts +6 -0
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.js +6 -2
- package/hooks/features/focus/useGridFocus.js +69 -11
- package/hooks/features/index.d.ts +2 -2
- package/hooks/features/index.js +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +135 -1
- package/hooks/features/{selection/gridSelectionSelector.d.ts → rowSelection/gridRowSelectionSelector.d.ts} +1 -1
- package/hooks/features/rowSelection/gridRowSelectionSelector.js +9 -0
- package/hooks/features/rowSelection/index.d.ts +1 -0
- package/hooks/features/rowSelection/index.js +1 -0
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +12 -0
- package/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
- package/hooks/features/{selection/useGridSelectionPreProcessors.d.ts → rowSelection/useGridRowSelectionPreProcessors.d.ts} +1 -1
- package/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
- package/hooks/features/rows/gridRowsInterfaces.d.ts +4 -0
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +5 -2
- package/hooks/features/rows/useGridRows.js +23 -7
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/hooks/utils/useGridApi.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +1 -1
- package/hooks/utils/useGridInitializeState.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/hooks/utils/useGridState.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +3 -5
- package/internals/index.js +3 -5
- package/legacy/DataGrid/DataGrid.js +14 -34
- package/legacy/DataGrid/useDataGridComponent.js +8 -14
- package/legacy/DataGrid/useDataGridProps.js +3 -3
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/legacy/components/GridFooter.js +1 -1
- package/legacy/components/GridRow.js +2 -2
- package/legacy/components/base/GridBody.js +2 -2
- package/legacy/components/cell/GridEditInputCell.js +3 -8
- package/legacy/components/cell/GridEditSingleSelectCell.js +6 -52
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +46 -13
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/legacy/components/containers/GridRoot.js +4 -3
- package/legacy/components/panel/GridColumnsPanel.js +10 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +31 -7
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +67 -18
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +33 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +96 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +64 -64
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +70 -122
- package/legacy/hooks/features/density/densitySelector.js +0 -6
- package/legacy/hooks/features/density/useGridDensity.js +6 -44
- package/legacy/hooks/features/dimensions/useGridDimensions.js +3 -2
- package/legacy/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
- package/legacy/hooks/features/editing/index.js +1 -0
- package/legacy/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
- package/legacy/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
- package/legacy/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
- package/legacy/hooks/features/export/useGridPrintExport.js +2 -2
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +8 -0
- package/legacy/hooks/features/focus/useGridFocus.js +72 -11
- package/legacy/hooks/features/index.js +2 -2
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +129 -1
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +19 -0
- package/legacy/hooks/features/rowSelection/index.js +1 -0
- package/legacy/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
- package/legacy/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
- package/legacy/hooks/features/rows/gridRowsUtils.js +5 -2
- package/legacy/hooks/features/rows/useGridRows.js +25 -7
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +3 -5
- package/legacy/locales/trTR.js +17 -17
- package/legacy/models/api/{gridSelectionApi.js → gridRowSelectionApi.js} +0 -0
- package/legacy/models/api/index.js +1 -1
- package/legacy/models/{gridSelectionModel.js → gridRowSelectionModel.js} +0 -0
- package/legacy/models/index.js +1 -1
- package/{models/api/gridSelectionApi.js → legacy/models/params/gridColumnGroupHeaderParams.js} +0 -0
- package/legacy/models/params/gridEditCellParams.js +0 -4
- package/legacy/models/params/index.js +1 -0
- package/locales/trTR.js +17 -17
- package/models/api/gridApiCommon.d.ts +3 -6
- package/models/api/gridApiCommunity.d.ts +1 -7
- package/models/api/gridEditingApi.d.ts +36 -121
- package/models/api/gridFocusApi.d.ts +13 -0
- package/models/api/{gridSelectionApi.d.ts → gridRowSelectionApi.d.ts} +2 -2
- package/models/{gridSelectionModel.js → api/gridRowSelectionApi.js} +0 -0
- package/models/api/index.d.ts +2 -2
- package/models/api/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +0 -8
- package/models/events/gridEventLookup.d.ts +30 -19
- package/models/gridColumnGrouping.d.ts +1 -26
- package/models/gridRowSelectionModel.d.ts +3 -0
- package/{modern/models/api/gridSelectionApi.js → models/gridRowSelectionModel.js} +0 -0
- package/models/gridStateCommunity.d.ts +2 -2
- package/models/index.d.ts +1 -1
- package/models/index.js +1 -1
- package/models/params/gridColumnGroupHeaderParams.d.ts +30 -0
- package/{modern/models/gridSelectionModel.js → models/params/gridColumnGroupHeaderParams.js} +0 -0
- package/models/params/gridEditCellParams.d.ts +4 -17
- package/models/params/gridEditCellParams.js +0 -4
- package/models/params/gridRowParams.d.ts +4 -4
- package/models/params/index.d.ts +1 -0
- package/models/params/index.js +1 -0
- package/models/props/DataGridProps.d.ts +8 -32
- package/modern/DataGrid/DataGrid.js +14 -34
- package/modern/DataGrid/useDataGridComponent.js +8 -12
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/modern/components/GridFooter.js +1 -1
- package/modern/components/GridRow.js +2 -2
- package/modern/components/base/GridBody.js +2 -2
- package/modern/components/cell/GridEditInputCell.js +3 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +6 -34
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +32 -5
- package/modern/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/modern/components/containers/GridRoot.js +4 -3
- package/modern/components/panel/GridColumnsPanel.js +10 -4
- package/modern/components/panel/filterPanel/GridFilterForm.js +29 -7
- package/modern/components/panel/filterPanel/GridFilterPanel.js +62 -17
- package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +14 -1
- package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +83 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +50 -62
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +58 -98
- package/modern/hooks/features/density/densitySelector.js +1 -3
- package/modern/hooks/features/density/useGridDensity.js +9 -37
- package/modern/hooks/features/dimensions/useGridDimensions.js +3 -2
- package/modern/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
- package/modern/hooks/features/editing/index.js +1 -0
- package/modern/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +21 -6
- package/modern/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +3 -3
- package/modern/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +20 -6
- package/modern/hooks/features/export/useGridPrintExport.js +2 -2
- package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -2
- package/modern/hooks/features/focus/useGridFocus.js +69 -11
- package/modern/hooks/features/index.js +2 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +135 -1
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +9 -0
- package/modern/hooks/features/rowSelection/index.js +1 -0
- package/modern/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +37 -37
- package/modern/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +5 -2
- package/modern/hooks/features/rows/useGridRows.js +23 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -5
- package/modern/locales/trTR.js +17 -17
- package/modern/models/api/gridRowSelectionApi.js +1 -0
- package/modern/models/api/index.js +1 -1
- package/modern/models/gridRowSelectionModel.js +1 -0
- package/modern/models/index.js +1 -1
- package/modern/models/params/gridColumnGroupHeaderParams.js +1 -0
- package/modern/models/params/gridEditCellParams.js +0 -4
- package/modern/models/params/index.js +1 -0
- package/node/DataGrid/DataGrid.js +14 -34
- package/node/DataGrid/useDataGridComponent.js +9 -17
- package/node/DataGrid/useDataGridProps.js +3 -3
- package/node/colDef/gridCheckboxSelectionColDef.js +2 -2
- package/node/components/GridFooter.js +2 -2
- package/node/components/GridRow.js +2 -2
- package/node/components/base/GridBody.js +2 -2
- package/node/components/cell/GridEditInputCell.js +3 -9
- package/node/components/cell/GridEditSingleSelectCell.js +6 -38
- package/node/components/columnHeaders/GridColumnGroupHeader.js +32 -5
- package/node/components/columnSelection/GridHeaderCheckbox.js +3 -3
- package/node/components/containers/GridRoot.js +4 -2
- package/node/components/panel/GridColumnsPanel.js +10 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +30 -7
- package/node/components/panel/filterPanel/GridFilterPanel.js +63 -19
- package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +40 -3
- package/node/hooks/features/columnGrouping/gridColumnGroupsUtils.js +102 -0
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +68 -71
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +57 -113
- package/node/hooks/features/density/densitySelector.js +2 -6
- package/node/hooks/features/density/useGridDensity.js +9 -48
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -1
- package/node/hooks/features/{editRows/gridEditRowsSelector.js → editing/gridEditingSelectors.js} +0 -0
- package/node/hooks/features/{editRows → editing}/index.js +4 -4
- package/node/hooks/features/{editRows/useGridCellEditing.new.js → editing/useGridCellEditing.js} +28 -13
- package/node/hooks/features/{editRows/useGridEditing.new.js → editing/useGridEditing.js} +4 -4
- package/node/hooks/features/{editRows/useGridRowEditing.new.js → editing/useGridRowEditing.js} +28 -14
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/focus/gridFocusStateSelector.js +10 -4
- package/node/hooks/features/focus/useGridFocus.js +68 -10
- package/node/hooks/features/index.js +8 -8
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +138 -1
- package/node/hooks/features/{selection/gridSelectionSelector.js → rowSelection/gridRowSelectionSelector.js} +6 -6
- package/node/hooks/features/rowSelection/index.js +18 -0
- package/node/hooks/features/{selection/useGridSelection.js → rowSelection/useGridRowSelection.js} +43 -43
- package/node/hooks/features/{selection/useGridSelectionPreProcessors.js → rowSelection/useGridRowSelectionPreProcessors.js} +3 -3
- package/node/hooks/features/rows/gridRowsUtils.js +5 -2
- package/node/hooks/features/rows/useGridRows.js +23 -7
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/node/index.js +1 -1
- package/node/internals/index.js +23 -45
- package/node/locales/trTR.js +17 -17
- package/node/models/api/{gridSelectionApi.js → gridRowSelectionApi.js} +0 -0
- package/node/models/api/index.js +4 -4
- package/node/models/{gridSelectionModel.js → gridRowSelectionModel.js} +0 -0
- package/node/models/index.js +4 -4
- package/node/models/params/gridColumnGroupHeaderParams.js +5 -0
- package/node/models/params/gridEditCellParams.js +0 -3
- package/node/models/params/index.js +13 -0
- package/package.json +2 -2
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.d.ts +0 -4
- package/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -35
- package/hooks/features/editRows/index.d.ts +0 -1
- package/hooks/features/editRows/index.js +0 -1
- package/hooks/features/editRows/useGridCellEditing.old.d.ts +0 -4
- package/hooks/features/editRows/useGridCellEditing.old.js +0 -359
- package/hooks/features/editRows/useGridEditing.old.d.ts +0 -11
- package/hooks/features/editRows/useGridEditing.old.js +0 -167
- package/hooks/features/editRows/useGridRowEditing.old.d.ts +0 -4
- package/hooks/features/editRows/useGridRowEditing.old.js +0 -334
- package/hooks/features/selection/gridSelectionSelector.js +0 -9
- package/hooks/features/selection/index.d.ts +0 -1
- package/hooks/features/selection/index.js +0 -1
- package/hooks/features/selection/useGridSelection.d.ts +0 -12
- package/legacy/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -35
- package/legacy/hooks/features/editRows/index.js +0 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +0 -411
- package/legacy/hooks/features/editRows/useGridEditing.old.js +0 -184
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +0 -505
- package/legacy/hooks/features/selection/gridSelectionSelector.js +0 -19
- package/legacy/hooks/features/selection/index.js +0 -1
- package/models/gridSelectionModel.d.ts +0 -3
- package/modern/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -29
- package/modern/hooks/features/editRows/index.js +0 -1
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +0 -355
- package/modern/hooks/features/editRows/useGridEditing.old.js +0 -163
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +0 -326
- package/modern/hooks/features/selection/gridSelectionSelector.js +0 -9
- package/modern/hooks/features/selection/index.js +0 -1
- package/node/hooks/features/columnGrouping/useGridColumnGroupingPreProcessors.js +0 -55
- package/node/hooks/features/editRows/useGridCellEditing.old.js +0 -380
- package/node/hooks/features/editRows/useGridEditing.old.js +0 -193
- package/node/hooks/features/editRows/useGridRowEditing.old.js +0 -358
- package/node/hooks/features/selection/index.js +0 -18
|
@@ -13,7 +13,8 @@ export const rowsStateInitializer = (state, props, apiRef) => {
|
|
|
13
13
|
apiRef.current.unstable_caches.rows = createRowsInternalCache({
|
|
14
14
|
rows: props.rows,
|
|
15
15
|
getRowId: props.getRowId,
|
|
16
|
-
loading: props.loading
|
|
16
|
+
loading: props.loading,
|
|
17
|
+
rowCount: props.rowCount
|
|
17
18
|
});
|
|
18
19
|
return _extends({}, state, {
|
|
19
20
|
rows: getRowsStateFromCache({
|
|
@@ -111,11 +112,12 @@ export const useGridRows = (apiRef, props) => {
|
|
|
111
112
|
cache: createRowsInternalCache({
|
|
112
113
|
rows,
|
|
113
114
|
getRowId: props.getRowId,
|
|
114
|
-
loading: props.loading
|
|
115
|
+
loading: props.loading,
|
|
116
|
+
rowCount: props.rowCount
|
|
115
117
|
}),
|
|
116
118
|
throttle: true
|
|
117
119
|
});
|
|
118
|
-
}, [logger, props.getRowId, props.loading, throttledRowsChange]);
|
|
120
|
+
}, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
|
|
119
121
|
const updateRows = React.useCallback(updates => {
|
|
120
122
|
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
|
|
121
123
|
// TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
|
|
@@ -341,7 +343,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
341
343
|
cache = createRowsInternalCache({
|
|
342
344
|
rows: props.rows,
|
|
343
345
|
getRowId: props.getRowId,
|
|
344
|
-
loading: props.loading
|
|
346
|
+
loading: props.loading,
|
|
347
|
+
rowCount: props.rowCount
|
|
345
348
|
});
|
|
346
349
|
}
|
|
347
350
|
|
|
@@ -349,7 +352,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
349
352
|
cache,
|
|
350
353
|
throttle: false
|
|
351
354
|
});
|
|
352
|
-
}, [logger, apiRef, props.rows, props.getRowId, props.loading, throttledRowsChange]);
|
|
355
|
+
}, [logger, apiRef, props.rows, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
|
|
353
356
|
const handleStrategyProcessorChange = React.useCallback(methodName => {
|
|
354
357
|
if (methodName === 'rowTreeCreation') {
|
|
355
358
|
groupRows();
|
|
@@ -412,7 +415,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
412
415
|
}
|
|
413
416
|
|
|
414
417
|
const areNewRowsAlreadyInState = apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows;
|
|
415
|
-
const isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
418
|
+
const isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
419
|
+
const isNewRowCountAlreadyInState = apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates === props.rowCount; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
|
|
416
420
|
|
|
417
421
|
if (areNewRowsAlreadyInState) {
|
|
418
422
|
// If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`
|
|
@@ -426,6 +430,17 @@ export const useGridRows = (apiRef, props) => {
|
|
|
426
430
|
apiRef.current.forceUpdate();
|
|
427
431
|
}
|
|
428
432
|
|
|
433
|
+
if (!isNewRowCountAlreadyInState) {
|
|
434
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
435
|
+
rows: _extends({}, state.rows, {
|
|
436
|
+
totalRowCount: Math.max(props.rowCount || 0, state.rows.totalRowCount),
|
|
437
|
+
totalTopLevelRowCount: Math.max(props.rowCount || 0, state.rows.totalTopLevelRowCount)
|
|
438
|
+
})
|
|
439
|
+
}));
|
|
440
|
+
apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates = props.rowCount;
|
|
441
|
+
apiRef.current.forceUpdate();
|
|
442
|
+
}
|
|
443
|
+
|
|
429
444
|
return;
|
|
430
445
|
}
|
|
431
446
|
|
|
@@ -434,7 +449,8 @@ export const useGridRows = (apiRef, props) => {
|
|
|
434
449
|
cache: createRowsInternalCache({
|
|
435
450
|
rows: props.rows,
|
|
436
451
|
getRowId: props.getRowId,
|
|
437
|
-
loading: props.loading
|
|
452
|
+
loading: props.loading,
|
|
453
|
+
rowCount: props.rowCount
|
|
438
454
|
}),
|
|
439
455
|
throttle: false
|
|
440
456
|
});
|
|
@@ -9,11 +9,11 @@ import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
|
9
9
|
import { useGridSelector } from '../../utils/useGridSelector';
|
|
10
10
|
import { gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from '../columns/gridColumnsSelector';
|
|
11
11
|
import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
|
|
12
|
-
import { gridEditRowsStateSelector } from '../
|
|
12
|
+
import { gridEditRowsStateSelector } from '../editing/gridEditingSelectors';
|
|
13
13
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
14
14
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
15
15
|
import { clamp } from '../../../utils/utils';
|
|
16
|
-
import { selectedIdsLookupSelector } from '../
|
|
16
|
+
import { selectedIdsLookupSelector } from '../rowSelection/gridRowSelectionSelector';
|
|
17
17
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
18
18
|
import { getFirstNonSpannedColumnToRender } from '../columns/gridColumnsUtils';
|
|
19
19
|
import { getMinimalContentHeight } from '../rows/gridRowsUtils'; // Uses binary search to avoid looping through all possible positions
|
package/modern/index.js
CHANGED
|
@@ -12,7 +12,6 @@ export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features
|
|
|
12
12
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
13
13
|
export { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';
|
|
14
14
|
export { useGridColumnGrouping, columnGroupsStateInitializer } from '../hooks/features/columnGrouping/useGridColumnGrouping';
|
|
15
|
-
export { useGridColumnGroupingPreProcessors } from '../hooks/features/columnGrouping/useGridColumnGroupingPreProcessors';
|
|
16
15
|
export { useGridDensity, densityStateInitializer } from '../hooks/features/density/useGridDensity';
|
|
17
16
|
export { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
|
|
18
17
|
export { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
|
|
@@ -22,8 +21,7 @@ export { useGridFocus, focusStateInitializer } from '../hooks/features/focus/use
|
|
|
22
21
|
export { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';
|
|
23
22
|
export { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
|
|
24
23
|
export { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
|
|
25
|
-
export { useGridEditing
|
|
26
|
-
export { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old } from '../hooks/features/editRows/useGridEditing.old';
|
|
24
|
+
export { useGridEditing, editingStateInitializer } from '../hooks/features/editing/useGridEditing';
|
|
27
25
|
export { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
|
|
28
26
|
export { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';
|
|
29
27
|
export { getTreeNodeDescendants, buildRootGroup } from '../hooks/features/rows/gridRowsUtils';
|
|
@@ -32,8 +30,8 @@ export { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
|
|
|
32
30
|
export { getRowIdFromRowModel } from '../hooks/features/rows/gridRowsUtils';
|
|
33
31
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
34
32
|
export { calculatePinnedRowsHeight } from '../hooks/features/rows/gridRowsUtils';
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
33
|
+
export { useGridRowSelection, rowSelectionStateInitializer } from '../hooks/features/rowSelection/useGridRowSelection';
|
|
34
|
+
export { useGridRowSelectionPreProcessors } from '../hooks/features/rowSelection/useGridRowSelectionPreProcessors';
|
|
37
35
|
export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
|
|
38
36
|
export { useGridScroll } from '../hooks/features/scroll/useGridScroll';
|
|
39
37
|
export { useGridEvents } from '../hooks/features/events/useGridEvents';
|
package/modern/locales/trTR.js
CHANGED
|
@@ -39,7 +39,7 @@ const trTRGrid = {
|
|
|
39
39
|
// Filter panel text
|
|
40
40
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Kaldır',
|
|
42
|
-
|
|
42
|
+
filterPanelLinkOperator: 'Mantıksal operatörler',
|
|
43
43
|
filterPanelOperators: 'Operatör',
|
|
44
44
|
// TODO v6: rename to filterPanelOperator
|
|
45
45
|
filterPanelOperatorAnd: 'Ve',
|
|
@@ -85,13 +85,13 @@ const trTRGrid = {
|
|
|
85
85
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} / ${totalCount.toLocaleString()}`,
|
|
86
86
|
// Checkbox selection text
|
|
87
87
|
checkboxSelectionHeaderName: 'Seçim',
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
checkboxSelectionSelectAllRows: 'Tüm satırları seç',
|
|
89
|
+
checkboxSelectionUnselectAllRows: 'Tüm satırların seçimini kaldır',
|
|
90
|
+
checkboxSelectionSelectRow: 'Satırı seç',
|
|
91
|
+
checkboxSelectionUnselectRow: 'Satır seçimini bırak',
|
|
92
92
|
// Boolean cell text
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
booleanCellTrueLabel: 'Evet',
|
|
94
|
+
booleanCellFalseLabel: 'Hayır',
|
|
95
95
|
// Actions cell more text
|
|
96
96
|
actionsCellMore: 'daha fazla',
|
|
97
97
|
// Column pinning text
|
|
@@ -107,17 +107,17 @@ const trTRGrid = {
|
|
|
107
107
|
groupColumn: name => `${name} için grupla`,
|
|
108
108
|
unGroupColumn: name => `${name} için gruplamayı kaldır`,
|
|
109
109
|
// Master/detail
|
|
110
|
-
|
|
110
|
+
detailPanelToggle: 'Detay görünümüne geçiş',
|
|
111
111
|
expandDetailPanel: 'Genişlet',
|
|
112
|
-
collapseDetailPanel: 'Gizle'
|
|
113
|
-
//
|
|
112
|
+
collapseDetailPanel: 'Gizle',
|
|
113
|
+
// Row reordering text
|
|
114
|
+
rowReorderingHeaderName: 'Satırı yeniden sırala',
|
|
114
115
|
// Aggregation
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'Toplama',
|
|
117
|
+
aggregationFunctionLabelSum: 'top',
|
|
118
|
+
aggregationFunctionLabelAvg: 'ort',
|
|
119
|
+
aggregationFunctionLabelMin: 'min',
|
|
120
|
+
aggregationFunctionLabelMax: 'maks',
|
|
121
|
+
aggregationFunctionLabelSize: 'boyut'
|
|
122
122
|
};
|
|
123
123
|
export const trTR = getGridLocalization(trTRGrid, trTRCore);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@ export * from './gridColumnApi';
|
|
|
4
4
|
export * from './gridDensityApi';
|
|
5
5
|
export * from './gridRowApi';
|
|
6
6
|
export * from './gridRowsMetaApi';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './gridRowSelectionApi';
|
|
8
8
|
export * from './gridSortApi';
|
|
9
9
|
export * from './gridStateApi';
|
|
10
10
|
export * from './gridLocaleTextApi';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/modern/models/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export * from './gridFilterModel';
|
|
|
8
8
|
export * from './gridRootContainerRef';
|
|
9
9
|
export * from './gridRenderContextProps';
|
|
10
10
|
export * from './gridRows';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './gridRowSelectionModel';
|
|
12
12
|
export * from './params';
|
|
13
13
|
export * from './gridCellClass';
|
|
14
14
|
export * from './gridCell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -189,7 +189,7 @@ DataGridRaw.propTypes = {
|
|
|
189
189
|
* If `true`, the selection on click on a row or cell is disabled.
|
|
190
190
|
* @default false
|
|
191
191
|
*/
|
|
192
|
-
|
|
192
|
+
disableRowSelectionOnClick: _propTypes.default.bool,
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
195
|
* If `true`, the virtualization is disabled.
|
|
@@ -219,8 +219,6 @@ DataGridRaw.propTypes = {
|
|
|
219
219
|
*/
|
|
220
220
|
experimentalFeatures: _propTypes.default.shape({
|
|
221
221
|
columnGrouping: _propTypes.default.bool,
|
|
222
|
-
newEditingApi: _propTypes.default.bool,
|
|
223
|
-
preventCommitWhileValidating: _propTypes.default.bool,
|
|
224
222
|
warnIfFocusStateIsNotSynced: _propTypes.default.bool
|
|
225
223
|
}),
|
|
226
224
|
|
|
@@ -397,14 +395,6 @@ DataGridRaw.propTypes = {
|
|
|
397
395
|
*/
|
|
398
396
|
onCellDoubleClick: _propTypes.default.func,
|
|
399
397
|
|
|
400
|
-
/**
|
|
401
|
-
* Callback fired when the cell changes are committed.
|
|
402
|
-
* @param {GridCellEditCommitParams} params With all properties from [[GridCellEditCommitParams]].
|
|
403
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
404
|
-
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
405
|
-
*/
|
|
406
|
-
onCellEditCommit: _propTypes.default.func,
|
|
407
|
-
|
|
408
398
|
/**
|
|
409
399
|
* Callback fired when the cell turns to edit mode.
|
|
410
400
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -505,15 +495,6 @@ DataGridRaw.propTypes = {
|
|
|
505
495
|
*/
|
|
506
496
|
onColumnVisibilityModelChange: _propTypes.default.func,
|
|
507
497
|
|
|
508
|
-
/**
|
|
509
|
-
* Callback fired when the edit cell value changes.
|
|
510
|
-
* @param {GridEditCellPropsParams} params With all properties from [[GridEditCellPropsParams]].
|
|
511
|
-
* @param {MuiEvent<React.SyntheticEvent>} event The event that caused this prop to be called.
|
|
512
|
-
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
513
|
-
* @deprecated use `preProcessEditCellProps` from the [`GridColDef`](/x/api/data-grid/grid-col-def/)
|
|
514
|
-
*/
|
|
515
|
-
onEditCellPropsChange: _propTypes.default.func,
|
|
516
|
-
|
|
517
498
|
/**
|
|
518
499
|
* Callback fired when the `editRowsModel` changes.
|
|
519
500
|
* @param {GridEditRowsModel} editRowsModel With all properties from [[GridEditRowsModel]].
|
|
@@ -643,10 +624,10 @@ DataGridRaw.propTypes = {
|
|
|
643
624
|
|
|
644
625
|
/**
|
|
645
626
|
* Callback fired when the selection state of one or multiple rows changes.
|
|
646
|
-
* @param {
|
|
627
|
+
* @param {GridRowSelectionModel} rowSelectionModel With all the row ids [[GridSelectionModel]].
|
|
647
628
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
648
629
|
*/
|
|
649
|
-
|
|
630
|
+
onRowSelectionModelChange: _propTypes.default.func,
|
|
650
631
|
|
|
651
632
|
/**
|
|
652
633
|
* Callback fired when the sort model changes before a column is sorted.
|
|
@@ -700,7 +681,6 @@ DataGridRaw.propTypes = {
|
|
|
700
681
|
|
|
701
682
|
/**
|
|
702
683
|
* Callback called before updating a row with new values in the row and cell editing.
|
|
703
|
-
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
|
|
704
684
|
* @template R
|
|
705
685
|
* @param {R} newRow Row object with the new values.
|
|
706
686
|
* @param {R} oldRow Row object with the old values.
|
|
@@ -736,6 +716,17 @@ DataGridRaw.propTypes = {
|
|
|
736
716
|
*/
|
|
737
717
|
rows: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
738
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Sets the row selection model of the grid.
|
|
721
|
+
*/
|
|
722
|
+
rowSelectionModel: (0, _utils.chainPropTypes)(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.array]), props => {
|
|
723
|
+
if (!props.checkboxSelection && Array.isArray(props.rowSelectionModel) && props.rowSelectionModel.length > 1) {
|
|
724
|
+
return new Error([`MUI: \`<DataGrid rowSelectionModel={${JSON.stringify(props.rowSelectionModel)}} />\` is not a valid prop.`, 'rowSelectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\n'));
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
return null;
|
|
728
|
+
}),
|
|
729
|
+
|
|
739
730
|
/**
|
|
740
731
|
* Sets the type of space between rows added by `getRowSpacing`.
|
|
741
732
|
* @default "margin"
|
|
@@ -759,17 +750,6 @@ DataGridRaw.propTypes = {
|
|
|
759
750
|
*/
|
|
760
751
|
scrollbarSize: _propTypes.default.number,
|
|
761
752
|
|
|
762
|
-
/**
|
|
763
|
-
* Set the selection model of the grid.
|
|
764
|
-
*/
|
|
765
|
-
selectionModel: (0, _utils.chainPropTypes)(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.array]), props => {
|
|
766
|
-
if (!props.checkboxSelection && Array.isArray(props.selectionModel) && props.selectionModel.length > 1) {
|
|
767
|
-
return new Error([`MUI: \`<DataGrid selectionModel={${JSON.stringify(props.selectionModel)}} />\` is not a valid prop.`, 'selectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\n'));
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
return null;
|
|
771
|
-
}),
|
|
772
|
-
|
|
773
753
|
/**
|
|
774
754
|
* If `true`, the right border of the cells are displayed.
|
|
775
755
|
* @default false
|
|
@@ -31,9 +31,7 @@ var _useGridPagination = require("../hooks/features/pagination/useGridPagination
|
|
|
31
31
|
|
|
32
32
|
var _useGridPreferencesPanel = require("../hooks/features/preferencesPanel/useGridPreferencesPanel");
|
|
33
33
|
|
|
34
|
-
var _useGridEditing = require("../hooks/features/
|
|
35
|
-
|
|
36
|
-
var _useGridEditing2 = require("../hooks/features/editRows/useGridEditing.new");
|
|
34
|
+
var _useGridEditing = require("../hooks/features/editing/useGridEditing");
|
|
37
35
|
|
|
38
36
|
var _useGridRows = require("../hooks/features/rows/useGridRows");
|
|
39
37
|
|
|
@@ -41,9 +39,9 @@ var _useGridRowsPreProcessors = require("../hooks/features/rows/useGridRowsPrePr
|
|
|
41
39
|
|
|
42
40
|
var _useGridParamsApi = require("../hooks/features/rows/useGridParamsApi");
|
|
43
41
|
|
|
44
|
-
var
|
|
42
|
+
var _useGridRowSelection = require("../hooks/features/rowSelection/useGridRowSelection");
|
|
45
43
|
|
|
46
|
-
var
|
|
44
|
+
var _useGridRowSelectionPreProcessors = require("../hooks/features/rowSelection/useGridRowSelectionPreProcessors");
|
|
47
45
|
|
|
48
46
|
var _useGridSorting = require("../hooks/features/sorting/useGridSorting");
|
|
49
47
|
|
|
@@ -61,28 +59,22 @@ var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpa
|
|
|
61
59
|
|
|
62
60
|
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
|
|
63
61
|
|
|
64
|
-
var _useGridColumnGroupingPreProcessors = require("../hooks/features/columnGrouping/useGridColumnGroupingPreProcessors");
|
|
65
|
-
|
|
66
62
|
const useDataGridComponent = props => {
|
|
67
|
-
var _props$experimentalFe, _props$experimentalFe2;
|
|
68
|
-
|
|
69
63
|
const apiRef = (0, _useGridInitialization.useGridInitialization)(undefined, props);
|
|
70
64
|
/**
|
|
71
65
|
* Register all pre-processors called during state initialization here.
|
|
72
66
|
*/
|
|
73
67
|
|
|
74
|
-
(0,
|
|
75
|
-
(0, _useGridSelectionPreProcessors.useGridSelectionPreProcessors)(apiRef, props);
|
|
68
|
+
(0, _useGridRowSelectionPreProcessors.useGridRowSelectionPreProcessors)(apiRef, props);
|
|
76
69
|
(0, _useGridRowsPreProcessors.useGridRowsPreProcessors)(apiRef);
|
|
77
70
|
/**
|
|
78
71
|
* Register all state initializers here.
|
|
79
72
|
*/
|
|
80
73
|
|
|
81
|
-
(0, _useGridInitializeState.useGridInitializeState)(
|
|
74
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSelection.rowSelectionStateInitializer, apiRef, props);
|
|
82
75
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumns.columnsStateInitializer, apiRef, props);
|
|
83
|
-
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnGrouping.columnGroupsStateInitializer, apiRef, props);
|
|
84
76
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRows.rowsStateInitializer, apiRef, props);
|
|
85
|
-
(0, _useGridInitializeState.useGridInitializeState)(
|
|
77
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridEditing.editingStateInitializer, apiRef, props);
|
|
86
78
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridFocus.focusStateInitializer, apiRef, props);
|
|
87
79
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridSorting.sortingStateInitializer, apiRef, props);
|
|
88
80
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPreferencesPanel.preferencePanelStateInitializer, apiRef, props);
|
|
@@ -91,15 +83,15 @@ const useDataGridComponent = props => {
|
|
|
91
83
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
92
84
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
93
85
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
|
|
86
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnGrouping.columnGroupsStateInitializer, apiRef, props);
|
|
94
87
|
(0, _useGridKeyboardNavigation.useGridKeyboardNavigation)(apiRef, props);
|
|
95
|
-
(0,
|
|
88
|
+
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
|
|
96
89
|
(0, _useGridColumns.useGridColumns)(apiRef, props);
|
|
97
90
|
(0, _useGridRows.useGridRows)(apiRef, props);
|
|
98
91
|
(0, _useGridParamsApi.useGridParamsApi)(apiRef);
|
|
99
92
|
(0, _useGridColumnSpanning.useGridColumnSpanning)(apiRef);
|
|
100
93
|
(0, _useGridColumnGrouping.useGridColumnGrouping)(apiRef, props);
|
|
101
|
-
|
|
102
|
-
useGridEditing(apiRef, props);
|
|
94
|
+
(0, _useGridEditing.useGridEditing)(apiRef, props);
|
|
103
95
|
(0, _useGridFocus.useGridFocus)(apiRef, props);
|
|
104
96
|
(0, _useGridPreferencesPanel.useGridPreferencesPanel)(apiRef, props);
|
|
105
97
|
(0, _useGridFilter.useGridFilter)(apiRef, props);
|
|
@@ -25,7 +25,7 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
25
25
|
apiRef: undefined,
|
|
26
26
|
disableMultipleColumnsFiltering: true,
|
|
27
27
|
disableMultipleColumnsSorting: true,
|
|
28
|
-
|
|
28
|
+
disableMultipleRowSelection: true,
|
|
29
29
|
throttleRowsMs: undefined,
|
|
30
30
|
hideFooterRowCount: false,
|
|
31
31
|
pagination: true,
|
|
@@ -56,9 +56,9 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
56
56
|
disableColumnSelector: false,
|
|
57
57
|
disableDensitySelector: false,
|
|
58
58
|
disableMultipleColumnsFiltering: false,
|
|
59
|
-
|
|
59
|
+
disableMultipleRowSelection: false,
|
|
60
60
|
disableMultipleColumnsSorting: false,
|
|
61
|
-
|
|
61
|
+
disableRowSelectionOnClick: false,
|
|
62
62
|
disableVirtualization: false,
|
|
63
63
|
disableIgnoreModificationsIfProcessingProps: false,
|
|
64
64
|
editMode: _models.GridEditModes.Cell,
|
|
@@ -15,7 +15,7 @@ var _GridCellCheckboxRenderer = require("../components/columnSelection/GridCellC
|
|
|
15
15
|
|
|
16
16
|
var _GridHeaderCheckbox = require("../components/columnSelection/GridHeaderCheckbox");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _gridRowSelectionSelector = require("../hooks/features/rowSelection/gridRowSelectionSelector");
|
|
19
19
|
|
|
20
20
|
var _gridBooleanColDef = require("./gridBooleanColDef");
|
|
21
21
|
|
|
@@ -41,7 +41,7 @@ const GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanC
|
|
|
41
41
|
disableExport: true,
|
|
42
42
|
getApplyQuickFilterFn: undefined,
|
|
43
43
|
valueGetter: params => {
|
|
44
|
-
const selectionLookup = (0,
|
|
44
|
+
const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(params.api.state, params.api.instanceId);
|
|
45
45
|
return selectionLookup[params.id] !== undefined;
|
|
46
46
|
},
|
|
47
47
|
renderHeader: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeaderCheckbox.GridHeaderCheckbox, (0, _extends2.default)({}, params)),
|
|
@@ -17,7 +17,7 @@ var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
|
17
17
|
|
|
18
18
|
var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _gridRowSelectionSelector = require("../hooks/features/rowSelection/gridRowSelectionSelector");
|
|
21
21
|
|
|
22
22
|
var _gridFilterSelector = require("../hooks/features/filter/gridFilterSelector");
|
|
23
23
|
|
|
@@ -43,7 +43,7 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
43
43
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
44
44
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
45
45
|
const totalTopLevelRowCount = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridTopLevelRowCountSelector);
|
|
46
|
-
const selectedRowCount = (0, _useGridSelector.useGridSelector)(apiRef,
|
|
46
|
+
const selectedRowCount = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSelectionSelector.selectedGridRowsCountSelector);
|
|
47
47
|
const visibleTopLevelRowCount = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridVisibleTopLevelRowCountSelector);
|
|
48
48
|
const selectedRowCountElement = !rootProps.hideFooterSelectedRowCount && selectedRowCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridSelectedRowCount.GridSelectedRowCount, {
|
|
49
49
|
selectedRowCount: selectedRowCount
|
|
@@ -45,7 +45,7 @@ var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelecto
|
|
|
45
45
|
|
|
46
46
|
var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _gridColumnGroupsSelector = require("../hooks/features/columnGrouping/gridColumnGroupsSelector");
|
|
49
49
|
|
|
50
50
|
var _utils = require("../utils/utils");
|
|
51
51
|
|
|
@@ -122,7 +122,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
122
122
|
const columnsTotalWidth = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnsTotalWidthSelector);
|
|
123
123
|
const sortModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortModelSelector);
|
|
124
124
|
const treeDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowMaximumTreeDepthSelector);
|
|
125
|
-
const headerGroupingMaxDepth = (0, _useGridSelector.useGridSelector)(apiRef,
|
|
125
|
+
const headerGroupingMaxDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderMaxDepthSelector);
|
|
126
126
|
const handleRef = (0, _material.useForkRef)(ref, refProp);
|
|
127
127
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
128
128
|
|
|
@@ -21,7 +21,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
21
21
|
|
|
22
22
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _gridColumnGroupsSelector = require("../../hooks/features/columnGrouping/gridColumnGroupsSelector");
|
|
25
25
|
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@ function GridBody(props) {
|
|
|
37
37
|
} = props;
|
|
38
38
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
39
39
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
40
|
-
const totalHeaderHeight = (0, _useGridSelector.useGridSelector)(apiRef,
|
|
40
|
+
const totalHeaderHeight = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridTotalHeaderHeightSelector);
|
|
41
41
|
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
42
42
|
const disableVirtualization = React.useCallback(() => {
|
|
43
43
|
setIsVirtualizationDisabled(true);
|
|
@@ -29,8 +29,6 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
29
29
|
|
|
30
30
|
var _index = require("../icons/index");
|
|
31
31
|
|
|
32
|
-
var _GridFilterInputValue = require("../panel/filterPanel/GridFilterInputValue");
|
|
33
|
-
|
|
34
32
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
35
33
|
|
|
36
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -65,8 +63,6 @@ const GridEditInputCellRoot = (0, _styles.styled)(_InputBase.default, {
|
|
|
65
63
|
}
|
|
66
64
|
}));
|
|
67
65
|
const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
68
|
-
var _rootProps$experiment, _rootProps$experiment3;
|
|
69
|
-
|
|
70
66
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
71
67
|
const {
|
|
72
68
|
id,
|
|
@@ -74,7 +70,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
74
70
|
field,
|
|
75
71
|
colDef,
|
|
76
72
|
hasFocus,
|
|
77
|
-
debounceMs =
|
|
73
|
+
debounceMs = 200,
|
|
78
74
|
isProcessingProps,
|
|
79
75
|
onValueChange
|
|
80
76
|
} = props,
|
|
@@ -87,8 +83,6 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
87
83
|
};
|
|
88
84
|
const classes = useUtilityClasses(ownerState);
|
|
89
85
|
const handleChange = React.useCallback(async event => {
|
|
90
|
-
var _rootProps$experiment2;
|
|
91
|
-
|
|
92
86
|
const newValue = event.target.value;
|
|
93
87
|
|
|
94
88
|
if (onValueChange) {
|
|
@@ -98,7 +92,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
98
92
|
const column = apiRef.current.getColumn(field);
|
|
99
93
|
let parsedValue = newValue;
|
|
100
94
|
|
|
101
|
-
if (column.valueParser
|
|
95
|
+
if (column.valueParser) {
|
|
102
96
|
parsedValue = column.valueParser(newValue, apiRef.current.getCellParams(id, field));
|
|
103
97
|
}
|
|
104
98
|
|
|
@@ -110,7 +104,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
110
104
|
debounceMs,
|
|
111
105
|
unstable_skipValueParser: true
|
|
112
106
|
}, event);
|
|
113
|
-
}, [apiRef, debounceMs, field, id, onValueChange
|
|
107
|
+
}, [apiRef, debounceMs, field, id, onValueChange]);
|
|
114
108
|
const meta = apiRef.current.unstable_getEditCellMeta ? apiRef.current.unstable_getEditCellMeta(id, field) : {};
|
|
115
109
|
React.useEffect(() => {
|
|
116
110
|
if (meta.changeReason !== 'debouncedSetEditCellValue') {
|
|
@@ -107,8 +107,6 @@ function GridEditSingleSelectCell(props) {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
const handleChange = async event => {
|
|
110
|
-
var _rootProps$experiment;
|
|
111
|
-
|
|
112
110
|
setOpen(false);
|
|
113
111
|
const target = event.target; // NativeSelect casts the value to a string.
|
|
114
112
|
|
|
@@ -118,35 +116,11 @@ function GridEditSingleSelectCell(props) {
|
|
|
118
116
|
await onValueChange(event, formattedTargetValue);
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
await apiRef.current.setEditCellValue({
|
|
122
120
|
id,
|
|
123
121
|
field,
|
|
124
122
|
value: formattedTargetValue
|
|
125
123
|
}, event);
|
|
126
|
-
|
|
127
|
-
if ((_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi) {
|
|
128
|
-
return;
|
|
129
|
-
} // We use isValid === false because the default return is undefined which evaluates to true with !isValid
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (rootProps.editMode === _gridEditRowModel.GridEditModes.Row || isValid === false) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const canCommit = await Promise.resolve(apiRef.current.commitCellChange({
|
|
137
|
-
id,
|
|
138
|
-
field
|
|
139
|
-
}, event));
|
|
140
|
-
|
|
141
|
-
if (canCommit) {
|
|
142
|
-
apiRef.current.setCellMode(id, field, 'view');
|
|
143
|
-
|
|
144
|
-
if (event.key) {
|
|
145
|
-
// TODO v6: remove once we stop ignoring events fired from portals
|
|
146
|
-
const params = apiRef.current.getCellParams(id, field);
|
|
147
|
-
apiRef.current.publishEvent('cellNavigationKeyDown', params, event);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
124
|
};
|
|
151
125
|
|
|
152
126
|
const handleClose = (event, reason) => {
|
|
@@ -156,17 +130,11 @@ function GridEditSingleSelectCell(props) {
|
|
|
156
130
|
}
|
|
157
131
|
|
|
158
132
|
if (reason === 'backdropClick' || (0, _keyboardUtils.isEscapeKey)(event.key)) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
field,
|
|
165
|
-
ignoreModifications: true
|
|
166
|
-
});
|
|
167
|
-
} else {
|
|
168
|
-
apiRef.current.setCellMode(id, field, 'view');
|
|
169
|
-
}
|
|
133
|
+
apiRef.current.stopCellEditMode({
|
|
134
|
+
id,
|
|
135
|
+
field,
|
|
136
|
+
ignoreModifications: true
|
|
137
|
+
});
|
|
170
138
|
}
|
|
171
139
|
};
|
|
172
140
|
|