@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
|
@@ -16,7 +16,8 @@ export var rowsStateInitializer = function rowsStateInitializer(state, props, ap
|
|
|
16
16
|
apiRef.current.unstable_caches.rows = createRowsInternalCache({
|
|
17
17
|
rows: props.rows,
|
|
18
18
|
getRowId: props.getRowId,
|
|
19
|
-
loading: props.loading
|
|
19
|
+
loading: props.loading,
|
|
20
|
+
rowCount: props.rowCount
|
|
20
21
|
});
|
|
21
22
|
return _extends({}, state, {
|
|
22
23
|
rows: getRowsStateFromCache({
|
|
@@ -117,11 +118,12 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
117
118
|
cache: createRowsInternalCache({
|
|
118
119
|
rows: rows,
|
|
119
120
|
getRowId: props.getRowId,
|
|
120
|
-
loading: props.loading
|
|
121
|
+
loading: props.loading,
|
|
122
|
+
rowCount: props.rowCount
|
|
121
123
|
}),
|
|
122
124
|
throttle: true
|
|
123
125
|
});
|
|
124
|
-
}, [logger, props.getRowId, props.loading, throttledRowsChange]);
|
|
126
|
+
}, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
|
|
125
127
|
var updateRows = React.useCallback(function (updates) {
|
|
126
128
|
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
|
|
127
129
|
// TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
|
|
@@ -374,7 +376,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
374
376
|
cache = createRowsInternalCache({
|
|
375
377
|
rows: props.rows,
|
|
376
378
|
getRowId: props.getRowId,
|
|
377
|
-
loading: props.loading
|
|
379
|
+
loading: props.loading,
|
|
380
|
+
rowCount: props.rowCount
|
|
378
381
|
});
|
|
379
382
|
}
|
|
380
383
|
|
|
@@ -382,7 +385,7 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
382
385
|
cache: cache,
|
|
383
386
|
throttle: false
|
|
384
387
|
});
|
|
385
|
-
}, [logger, apiRef, props.rows, props.getRowId, props.loading, throttledRowsChange]);
|
|
388
|
+
}, [logger, apiRef, props.rows, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
|
|
386
389
|
var handleStrategyProcessorChange = React.useCallback(function (methodName) {
|
|
387
390
|
if (methodName === 'rowTreeCreation') {
|
|
388
391
|
groupRows();
|
|
@@ -445,7 +448,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
445
448
|
}
|
|
446
449
|
|
|
447
450
|
var areNewRowsAlreadyInState = apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows;
|
|
448
|
-
var isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
451
|
+
var isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
452
|
+
var isNewRowCountAlreadyInState = apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates === props.rowCount; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
|
|
449
453
|
|
|
450
454
|
if (areNewRowsAlreadyInState) {
|
|
451
455
|
// If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`
|
|
@@ -461,6 +465,19 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
461
465
|
apiRef.current.forceUpdate();
|
|
462
466
|
}
|
|
463
467
|
|
|
468
|
+
if (!isNewRowCountAlreadyInState) {
|
|
469
|
+
apiRef.current.setState(function (state) {
|
|
470
|
+
return _extends({}, state, {
|
|
471
|
+
rows: _extends({}, state.rows, {
|
|
472
|
+
totalRowCount: Math.max(props.rowCount || 0, state.rows.totalRowCount),
|
|
473
|
+
totalTopLevelRowCount: Math.max(props.rowCount || 0, state.rows.totalTopLevelRowCount)
|
|
474
|
+
})
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
apiRef.current.unstable_caches.rows.rowCountPropBeforePartialUpdates = props.rowCount;
|
|
478
|
+
apiRef.current.forceUpdate();
|
|
479
|
+
}
|
|
480
|
+
|
|
464
481
|
return;
|
|
465
482
|
}
|
|
466
483
|
|
|
@@ -469,7 +486,8 @@ export var useGridRows = function useGridRows(apiRef, props) {
|
|
|
469
486
|
cache: createRowsInternalCache({
|
|
470
487
|
rows: props.rows,
|
|
471
488
|
getRowId: props.getRowId,
|
|
472
|
-
loading: props.loading
|
|
489
|
+
loading: props.loading,
|
|
490
|
+
rowCount: props.rowCount
|
|
473
491
|
}),
|
|
474
492
|
throttle: false
|
|
475
493
|
});
|
|
@@ -10,11 +10,11 @@ import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
|
10
10
|
import { useGridSelector } from '../../utils/useGridSelector';
|
|
11
11
|
import { gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from '../columns/gridColumnsSelector';
|
|
12
12
|
import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
|
|
13
|
-
import { gridEditRowsStateSelector } from '../
|
|
13
|
+
import { gridEditRowsStateSelector } from '../editing/gridEditingSelectors';
|
|
14
14
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
15
15
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
16
16
|
import { clamp } from '../../../utils/utils';
|
|
17
|
-
import { selectedIdsLookupSelector } from '../
|
|
17
|
+
import { selectedIdsLookupSelector } from '../rowSelection/gridRowSelectionSelector';
|
|
18
18
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
19
19
|
import { getFirstNonSpannedColumnToRender } from '../columns/gridColumnsUtils';
|
|
20
20
|
import { getMinimalContentHeight } from '../rows/gridRowsUtils'; // Uses binary search to avoid looping through all possible positions
|
package/legacy/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/legacy/locales/trTR.js
CHANGED
|
@@ -41,7 +41,7 @@ var trTRGrid = {
|
|
|
41
41
|
// Filter panel text
|
|
42
42
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
43
43
|
filterPanelDeleteIconLabel: 'Kaldır',
|
|
44
|
-
|
|
44
|
+
filterPanelLinkOperator: 'Mantıksal operatörler',
|
|
45
45
|
filterPanelOperators: 'Operatör',
|
|
46
46
|
// TODO v6: rename to filterPanelOperator
|
|
47
47
|
filterPanelOperatorAnd: 'Ve',
|
|
@@ -93,13 +93,13 @@ var trTRGrid = {
|
|
|
93
93
|
},
|
|
94
94
|
// Checkbox selection text
|
|
95
95
|
checkboxSelectionHeaderName: 'Seçim',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
checkboxSelectionSelectAllRows: 'Tüm satırları seç',
|
|
97
|
+
checkboxSelectionUnselectAllRows: 'Tüm satırların seçimini kaldır',
|
|
98
|
+
checkboxSelectionSelectRow: 'Satırı seç',
|
|
99
|
+
checkboxSelectionUnselectRow: 'Satır seçimini bırak',
|
|
100
100
|
// Boolean cell text
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
booleanCellTrueLabel: 'Evet',
|
|
102
|
+
booleanCellFalseLabel: 'Hayır',
|
|
103
103
|
// Actions cell more text
|
|
104
104
|
actionsCellMore: 'daha fazla',
|
|
105
105
|
// Column pinning text
|
|
@@ -119,17 +119,17 @@ var trTRGrid = {
|
|
|
119
119
|
return "".concat(name, " i\xE7in gruplamay\u0131 kald\u0131r");
|
|
120
120
|
},
|
|
121
121
|
// Master/detail
|
|
122
|
-
|
|
122
|
+
detailPanelToggle: 'Detay görünümüne geçiş',
|
|
123
123
|
expandDetailPanel: 'Genişlet',
|
|
124
|
-
collapseDetailPanel: 'Gizle'
|
|
125
|
-
//
|
|
124
|
+
collapseDetailPanel: 'Gizle',
|
|
125
|
+
// Row reordering text
|
|
126
|
+
rowReorderingHeaderName: 'Satırı yeniden sırala',
|
|
126
127
|
// Aggregation
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
aggregationMenuItemHeader: 'Toplama',
|
|
129
|
+
aggregationFunctionLabelSum: 'top',
|
|
130
|
+
aggregationFunctionLabelAvg: 'ort',
|
|
131
|
+
aggregationFunctionLabelMin: 'min',
|
|
132
|
+
aggregationFunctionLabelMax: 'maks',
|
|
133
|
+
aggregationFunctionLabelSize: 'boyut'
|
|
134
134
|
};
|
|
135
135
|
export var trTR = getGridLocalization(trTRGrid, trTRCore);
|
|
File without changes
|
|
@@ -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';
|
|
File without changes
|
package/legacy/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';
|
package/{models/api/gridSelectionApi.js → legacy/models/params/gridColumnGroupHeaderParams.js}
RENAMED
|
File without changes
|
package/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);
|
|
@@ -14,7 +14,7 @@ import { GridPrintExportApi } from './gridPrintExportApi';
|
|
|
14
14
|
import { GridDisableVirtualizationApi } from './gridDisableVirtualizationApi';
|
|
15
15
|
import { GridRowApi } from './gridRowApi';
|
|
16
16
|
import { GridRowsMetaApi } from './gridRowsMetaApi';
|
|
17
|
-
import {
|
|
17
|
+
import { GridRowSelectionApi } from './gridRowSelectionApi';
|
|
18
18
|
import { GridSortApi } from './gridSortApi';
|
|
19
19
|
import { GridStateApi } from './gridStateApi';
|
|
20
20
|
import { GridLoggerApi } from './gridLoggerApi';
|
|
@@ -27,9 +27,6 @@ import type { GridDimensionsApi } from '../../hooks/features/dimensions';
|
|
|
27
27
|
import type { GridPaginationApi } from '../../hooks/features/pagination';
|
|
28
28
|
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
|
|
29
29
|
import { GridColumnGroupingApi } from './gridColumnGroupingApi';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
export interface GridApiCommon extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApiUntyped, GridColumnGroupingApi {
|
|
30
|
+
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
|
|
31
|
+
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridLoggerApi, GridPipeProcessingApi, GridStrategyProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridVirtualScrollerApi, GridLocaleTextApi, GridClipboardApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi {
|
|
34
32
|
}
|
|
35
|
-
export {};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type { GridStateApi } from './gridStateApi';
|
|
2
1
|
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
|
|
3
2
|
import type { GridApiCommon } from './gridApiCommon';
|
|
4
|
-
import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
|
|
5
|
-
declare type GridStateApiUntyped = {
|
|
6
|
-
[key in keyof (GridStateApi<any> & GridStatePersistenceApi<any>)]: any;
|
|
7
|
-
};
|
|
8
3
|
/**
|
|
9
4
|
* The api of `DataGrid`.
|
|
10
5
|
*/
|
|
11
|
-
export interface GridApiCommunity extends
|
|
6
|
+
export interface GridApiCommunity extends GridApiCommon<GridStateCommunity, GridInitialStateCommunity> {
|
|
12
7
|
}
|
|
13
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GridCellMode, GridRowMode } from '../gridCell';
|
|
2
|
-
import {
|
|
2
|
+
import { GridCellModes, GridRowModes } from '../gridEditRowModel';
|
|
3
3
|
import { GridRowId, GridRowModel } from '../gridRows';
|
|
4
4
|
import { GridCellParams } from '../params/gridCellParams';
|
|
5
|
-
import {
|
|
5
|
+
import { GridEditCellValueParams } from '../params/gridEditCellParams';
|
|
6
6
|
import { MuiBaseEvent } from '../muiEvent';
|
|
7
7
|
export declare type GridCellModesModelProps = ({
|
|
8
8
|
mode: GridCellModes.View;
|
|
@@ -19,7 +19,7 @@ export declare type GridRowModesModel = Record<GridRowId, GridRowModesModelProps
|
|
|
19
19
|
export interface GridEditCellMeta {
|
|
20
20
|
changeReason?: 'debouncedSetEditCellValue' | 'setEditCellValue';
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface GridEditingSharedApi {
|
|
23
23
|
/**
|
|
24
24
|
* Controls if a cell is editable.
|
|
25
25
|
* @param {GridCellParams} params The cell params.
|
|
@@ -31,7 +31,7 @@ export interface GridNewEditingSharedApi {
|
|
|
31
31
|
* Commonly used inside the edit cell component.
|
|
32
32
|
* @param {GridEditCellValueParams} params Contains the id, field and value to set.
|
|
33
33
|
* @param {React.SyntheticEvent} event The event to pass forward.
|
|
34
|
-
* @returns {Promise<boolean> | void} A promise with the validation status
|
|
34
|
+
* @returns {Promise<boolean> | void} A promise with the validation status.
|
|
35
35
|
*/
|
|
36
36
|
setEditCellValue: (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void;
|
|
37
37
|
/**
|
|
@@ -57,116 +57,6 @@ export interface GridNewEditingSharedApi {
|
|
|
57
57
|
*/
|
|
58
58
|
unstable_getEditCellMeta: (id: GridRowId, field: string) => GridEditCellMeta;
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
61
|
-
* The shared methods used by the cell and row editing API.
|
|
62
|
-
*/
|
|
63
|
-
export interface GridEditingSharedApi {
|
|
64
|
-
/**
|
|
65
|
-
* Set the edit rows model of the grid.
|
|
66
|
-
* @param {GridEditRowsModel} model The new edit rows model.
|
|
67
|
-
* @deprecated Prefer the new editing API.
|
|
68
|
-
*/
|
|
69
|
-
setEditRowsModel: (model: GridEditRowsModel) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Gets the edit rows model of the grid.
|
|
72
|
-
* @returns {GridEditRowsModel} The edit rows model.
|
|
73
|
-
* @deprecated Prefer the new editing API.
|
|
74
|
-
*/
|
|
75
|
-
getEditRowsModel: () => GridEditRowsModel;
|
|
76
|
-
/**
|
|
77
|
-
* Controls if a cell is editable.
|
|
78
|
-
* @param {GridCellParams} params The cell params.
|
|
79
|
-
* @returns {boolean} A boolean value determining if the cell is editable.
|
|
80
|
-
*/
|
|
81
|
-
isCellEditable: (params: GridCellParams) => boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Sets the value of the edit cell.
|
|
84
|
-
* Commonly used inside the edit cell component.
|
|
85
|
-
* @param {GridEditCellValueParams} params Contains the id, field and value to set.
|
|
86
|
-
* @param {React.SyntheticEvent} event The event to pass forward.
|
|
87
|
-
* @returns {Promise<boolean> | void} A promise with the validation status if `preventCommitWhileValidating` is `true`. Otherwise, void.
|
|
88
|
-
*/
|
|
89
|
-
setEditCellValue: (params: GridEditCellValueParams, event?: MuiBaseEvent) => Promise<boolean> | void;
|
|
90
|
-
/**
|
|
91
|
-
* Immediatelly updates the value of the cell, without waiting for the debounce.
|
|
92
|
-
* @param {GridRowId} id The row id.
|
|
93
|
-
* @param {string} field The field to update. If not passed, updates all fields in the given row id.
|
|
94
|
-
* @ignore - do not document.
|
|
95
|
-
*/
|
|
96
|
-
unstable_runPendingEditCellValueMutation: (id: GridRowId, field?: string) => void;
|
|
97
|
-
/**
|
|
98
|
-
* @ignore - do not document.
|
|
99
|
-
*/
|
|
100
|
-
unstable_setEditCellProps: (params: GridEditCellPropsParams) => GridEditCellProps;
|
|
101
|
-
/**
|
|
102
|
-
* @ignore - do not document.
|
|
103
|
-
*/
|
|
104
|
-
unstable_parseValue: (id: GridRowId, field: string, value: any) => any;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* The row editing API interface.
|
|
108
|
-
*/
|
|
109
|
-
export interface GridRowEditingApi extends GridEditingSharedApi {
|
|
110
|
-
/**
|
|
111
|
-
* Sets the mode of a row.
|
|
112
|
-
* @param {GridRowId} id The id of the row.
|
|
113
|
-
* @param {GridRowMode} mode Can be: `"edit"`, `"view"`.
|
|
114
|
-
*/
|
|
115
|
-
setRowMode: (id: GridRowId, mode: GridRowMode) => void;
|
|
116
|
-
/**
|
|
117
|
-
* Gets the mode of a row.
|
|
118
|
-
* @param {GridRowId} id The id of the row.
|
|
119
|
-
* @returns {GridRowMode} Returns `"edit"` or `"view"`.
|
|
120
|
-
*/
|
|
121
|
-
getRowMode: (id: GridRowId) => GridRowMode;
|
|
122
|
-
/**
|
|
123
|
-
* Updates the row corresponding to the given id with the values stored in the edit row model.
|
|
124
|
-
* @param {GridRowId} id The id to commit to.
|
|
125
|
-
* @param {React.SyntheticEvent} event The event to pass forward.
|
|
126
|
-
* @returns {boolean} A boolean indicating if there is an error.
|
|
127
|
-
*/
|
|
128
|
-
commitRowChange: (id: GridRowId, event?: MuiBaseEvent) => boolean | Promise<boolean>;
|
|
129
|
-
/**
|
|
130
|
-
* Updates the value of a cell and calls all `preProcessEditCellProps` if necessary.
|
|
131
|
-
* @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
|
|
132
|
-
* @returns {Promise<boolean>} Resolves with `true` when all values in the row are valid.
|
|
133
|
-
* @ignore - do not document.
|
|
134
|
-
*/
|
|
135
|
-
unstable_setRowEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* The cell editing API interface.
|
|
139
|
-
*/
|
|
140
|
-
export interface GridCellEditingApi extends GridEditingSharedApi {
|
|
141
|
-
/**
|
|
142
|
-
* Updates the field corresponding to the given id with the value stored in the edit row model.
|
|
143
|
-
* @param {GridCommitCellChangeParams} params The id and field to commit to.
|
|
144
|
-
* @param {React.SyntheticEvent} event The event to pass forward.
|
|
145
|
-
* @returns {boolean} A boolean indicating if there is an error.
|
|
146
|
-
*/
|
|
147
|
-
commitCellChange: (params: GridCommitCellChangeParams, event?: MuiBaseEvent) => boolean | Promise<boolean>;
|
|
148
|
-
/**
|
|
149
|
-
* Sets the mode of a cell.
|
|
150
|
-
* @param {GridRowId} id The id of the row.
|
|
151
|
-
* @param {string} field The field to change the mode.
|
|
152
|
-
* @param {GridCellMode} mode Can be: `"edit"`, `"view"`.
|
|
153
|
-
*/
|
|
154
|
-
setCellMode: (id: GridRowId, field: string, mode: GridCellMode) => void;
|
|
155
|
-
/**
|
|
156
|
-
* Gets the mode of a cell.
|
|
157
|
-
* @param {GridRowId} id The id of the row.
|
|
158
|
-
* @param {string} field The field to get the mode.
|
|
159
|
-
* @returns {GridCellMode} Returns `"edit"` or `"view"`.
|
|
160
|
-
*/
|
|
161
|
-
getCellMode: (id: GridRowId, field: string) => GridCellMode;
|
|
162
|
-
/**
|
|
163
|
-
* Updates the value of a cell and calls `preProcessEditCellProps` if necessary.
|
|
164
|
-
* @param {GridCommitCellChangeParams} params Object with the new value and id and field to update.
|
|
165
|
-
* @returns {Promise<boolean>} Resolves with `true` when the new value is valid.
|
|
166
|
-
* @ignore - do not document.
|
|
167
|
-
*/
|
|
168
|
-
unstable_setCellEditingEditCellValue: (params: GridEditCellValueParams) => Promise<boolean>;
|
|
169
|
-
}
|
|
170
60
|
/**
|
|
171
61
|
* Params passed to `apiRef.current.startCellEditMode`.
|
|
172
62
|
*/
|
|
@@ -183,6 +73,11 @@ export interface GridStartCellEditModeParams {
|
|
|
183
73
|
* If `true`, the value will be deleted before entering the edit mode.
|
|
184
74
|
*/
|
|
185
75
|
deleteValue?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The initial value for the field.
|
|
78
|
+
* If `deleteValue` is also true, this value is not used.
|
|
79
|
+
*/
|
|
80
|
+
initialValue?: any;
|
|
186
81
|
}
|
|
187
82
|
/**
|
|
188
83
|
* Params passed to `apiRef.current.stopCellEditMode`.
|
|
@@ -223,6 +118,11 @@ export interface GridStartRowEditModeParams {
|
|
|
223
118
|
* If `true`, the value in `fieldToFocus` will be deleted before entering the edit mode.
|
|
224
119
|
*/
|
|
225
120
|
deleteValue?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The initial value for the given `fieldToFocus`.
|
|
123
|
+
* If `deleteValue` is also true, this value is not used.
|
|
124
|
+
*/
|
|
125
|
+
initialValue?: string;
|
|
226
126
|
}
|
|
227
127
|
/**
|
|
228
128
|
* Params passed to `apiRef.current.stopRowEditMode`.
|
|
@@ -249,7 +149,17 @@ export interface GridStopRowEditModeParams {
|
|
|
249
149
|
*/
|
|
250
150
|
cellToFocusAfter?: 'none' | 'below' | 'right' | 'left';
|
|
251
151
|
}
|
|
252
|
-
|
|
152
|
+
/**
|
|
153
|
+
* The cell editing API interface.
|
|
154
|
+
*/
|
|
155
|
+
export interface GridCellEditingApi extends GridEditingSharedApi {
|
|
156
|
+
/**
|
|
157
|
+
* Gets the mode of a cell.
|
|
158
|
+
* @param {GridRowId} id The id of the row.
|
|
159
|
+
* @param {string} field The field to get the mode.
|
|
160
|
+
* @returns {GridCellMode} Returns `"edit"` or `"view"`.
|
|
161
|
+
*/
|
|
162
|
+
getCellMode: (id: GridRowId, field: string) => GridCellMode;
|
|
253
163
|
/**
|
|
254
164
|
* Puts the cell corresponding to the given row id and field into edit mode.
|
|
255
165
|
* @param {GridStartCellEditModeParams} params The row id and field of the cell to edit.
|
|
@@ -277,7 +187,16 @@ export interface GridNewCellEditingApi extends GridNewEditingSharedApi, Pick<Gri
|
|
|
277
187
|
*/
|
|
278
188
|
unstable_getRowWithUpdatedValuesFromCellEditing: (id: GridRowId, field: string) => GridRowModel;
|
|
279
189
|
}
|
|
280
|
-
|
|
190
|
+
/**
|
|
191
|
+
* The row editing API interface.
|
|
192
|
+
*/
|
|
193
|
+
export interface GridRowEditingApi extends GridEditingSharedApi {
|
|
194
|
+
/**
|
|
195
|
+
* Gets the mode of a row.
|
|
196
|
+
* @param {GridRowId} id The id of the row.
|
|
197
|
+
* @returns {GridRowMode} Returns `"edit"` or `"view"`.
|
|
198
|
+
*/
|
|
199
|
+
getRowMode: (id: GridRowId) => GridRowMode;
|
|
281
200
|
/**
|
|
282
201
|
* Puts the row corresponding to the given id into edit mode.
|
|
283
202
|
* @param {GridStartCellEditModeParams} params The row id edit.
|
|
@@ -307,9 +226,5 @@ export interface GridNewRowEditingApi extends GridNewEditingSharedApi, Pick<Grid
|
|
|
307
226
|
/**
|
|
308
227
|
* The editing API interface that is available in the grid `apiRef`.
|
|
309
228
|
*/
|
|
310
|
-
export interface GridEditingApi extends GridCellEditingApi, GridRowEditingApi
|
|
311
|
-
}
|
|
312
|
-
export interface GridOldEditingApi extends GridCellEditingApi, GridRowEditingApi {
|
|
313
|
-
}
|
|
314
|
-
export interface GridNewEditingApi extends GridNewCellEditingApi, GridNewRowEditingApi {
|
|
229
|
+
export interface GridEditingApi extends GridCellEditingApi, GridRowEditingApi {
|
|
315
230
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GridRowId } from '../gridRows';
|
|
2
2
|
import { MuiBaseEvent } from '../muiEvent';
|
|
3
|
+
import { GridColumnGroupIdentifier } from '../../hooks/features/focus';
|
|
3
4
|
export interface GridFocusApi {
|
|
4
5
|
/**
|
|
5
6
|
* Sets the focus to the cell at the given `id` and `field`.
|
|
@@ -13,6 +14,18 @@ export interface GridFocusApi {
|
|
|
13
14
|
* @param {string} event The event that triggers the action.
|
|
14
15
|
*/
|
|
15
16
|
setColumnHeaderFocus: (field: string, event?: MuiBaseEvent) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the focus to the column group header at the given `field` and given depth.
|
|
19
|
+
* @param {string} field The column field.
|
|
20
|
+
* @param {number} depth The group depth.
|
|
21
|
+
* @param {object} event The event that triggers the action.
|
|
22
|
+
*/
|
|
23
|
+
unstable_setColumnGroupHeaderFocus: (field: string, depth: number, event?: MuiBaseEvent) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the focus to the column group header at the given `field` and given depth.
|
|
26
|
+
* @returns {GridColumnGroupIdentifier | null} focused
|
|
27
|
+
*/
|
|
28
|
+
unstable_getColumnGroupHeaderFocus: () => GridColumnGroupIdentifier | null;
|
|
16
29
|
/**
|
|
17
30
|
* Moves the focus to the cell situated at the given direction.
|
|
18
31
|
* If field is the last and direction=right, the focus goes to the next row.
|
|
@@ -2,7 +2,7 @@ import { GridRowId, GridRowModel } from '../gridRows';
|
|
|
2
2
|
/**
|
|
3
3
|
* The selection API interface that is available in the grid [[apiRef]].
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface GridRowSelectionApi {
|
|
6
6
|
/**
|
|
7
7
|
* Change the selection state of a row.
|
|
8
8
|
* @param {GridRowId} id The id of the row.
|
|
@@ -51,5 +51,5 @@ export interface GridSelectionApi {
|
|
|
51
51
|
* Any row already selected will be unselected.
|
|
52
52
|
* @param {GridRowId[]} rowIds The row ids to select.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
setRowSelectionModel: (rowIds: GridRowId[]) => void;
|
|
55
55
|
}
|
|
File without changes
|
package/models/api/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './gridColumnApi';
|
|
|
5
5
|
export * from './gridDensityApi';
|
|
6
6
|
export * from './gridRowApi';
|
|
7
7
|
export * from './gridRowsMetaApi';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './gridRowSelectionApi';
|
|
9
9
|
export * from './gridSortApi';
|
|
10
10
|
export * from './gridStateApi';
|
|
11
11
|
export * from './gridLocaleTextApi';
|
|
@@ -21,5 +21,5 @@ export * from './gridCallbackDetails';
|
|
|
21
21
|
export * from './gridScrollApi';
|
|
22
22
|
export * from './gridVirtualScrollerApi';
|
|
23
23
|
export * from './gridApiCommon';
|
|
24
|
-
export type { GridEditingApi,
|
|
24
|
+
export type { GridEditingApi, GridCellModesModel, GridRowModesModel } from './gridEditingApi';
|
|
25
25
|
export declare type GridEditRowApi = GridEditingApi;
|
package/models/api/index.js
CHANGED
|
@@ -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';
|
|
@@ -12,7 +12,6 @@ import { GridActionsCellItemProps } from '../../components/cell/GridActionsCellI
|
|
|
12
12
|
import { GridEditCellProps } from '../gridEditRowModel';
|
|
13
13
|
import type { GridValidRowModel } from '../gridRows';
|
|
14
14
|
import { GridApiCommunity } from '../api/gridApiCommunity';
|
|
15
|
-
import type { GridColumnGroup } from '../gridColumnGrouping';
|
|
16
15
|
/**
|
|
17
16
|
* Alignment used in position elements in Cells.
|
|
18
17
|
*/
|
|
@@ -252,13 +251,6 @@ export declare type GridStateColDef<R extends GridValidRowModel = any, V = any,
|
|
|
252
251
|
* If `true`, it means that at least one of the dimension's property of this column has been modified since the last time the column prop has changed.
|
|
253
252
|
*/
|
|
254
253
|
hasBeenResized?: boolean;
|
|
255
|
-
/**
|
|
256
|
-
* The id of the groups leading to the column.
|
|
257
|
-
* The array is ordered by increasing depth (the last element is the direct parent of the column).
|
|
258
|
-
* If not defined, the column is in no group (equivalent to a path equal to `[]`).
|
|
259
|
-
* This parameter is computed from the `columnGroupingModel` prop.
|
|
260
|
-
*/
|
|
261
|
-
groupPath?: GridColumnGroup['groupId'][];
|
|
262
254
|
};
|
|
263
255
|
/**
|
|
264
256
|
* Meta Info about columns.
|