@mui/x-data-grid 6.3.1 → 6.5.0
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 +113 -0
- package/DataGrid/DataGrid.js +20 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/DataGrid/useDataGridProps.js +8 -13
- package/colDef/gridBooleanColDef.js +19 -1
- package/colDef/gridDateColDef.js +6 -2
- package/colDef/gridNumericOperators.js +0 -6
- package/colDef/gridSingleSelectColDef.js +21 -1
- package/components/base/GridBody.js +2 -1
- package/components/cell/GridEditInputCell.js +4 -1
- package/components/containers/GridRootStyles.js +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +8 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +8 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
- package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/components/panel/filterPanel/index.d.ts +3 -1
- package/components/panel/filterPanel/index.js +2 -1
- package/constants/localeTextConstants.js +26 -0
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +12 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -1
- package/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +9 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/hooks/features/dimensions/useGridDimensions.js +4 -6
- package/hooks/features/editing/useGridCellEditing.js +7 -3
- package/hooks/features/editing/useGridEditing.js +0 -3
- package/hooks/features/editing/useGridRowEditing.js +7 -3
- package/hooks/features/export/serializers/csvSerializer.d.ts +5 -0
- package/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/hooks/features/export/useGridCsvExport.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.js +7 -5
- package/hooks/features/focus/gridFocusState.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/hooks/features/focus/useGridFocus.js +55 -9
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/hooks/features/headerFiltering/index.d.ts +1 -0
- package/hooks/features/headerFiltering/index.js +1 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
- package/hooks/features/rows/useGridRows.js +16 -1
- package/index.js +1 -1
- package/internals/index.d.ts +9 -3
- package/internals/index.js +7 -2
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/internals/utils/useProps.d.ts +8 -0
- package/internals/utils/useProps.js +13 -0
- package/joy/icons.d.ts +33 -0
- package/joy/icons.js +433 -0
- package/joy/joySlots.js +114 -4
- package/legacy/DataGrid/DataGrid.js +20 -1
- package/legacy/DataGrid/useDataGridComponent.js +2 -2
- package/legacy/DataGrid/useDataGridProps.js +11 -9
- package/legacy/colDef/gridBooleanColDef.js +21 -1
- package/legacy/colDef/gridDateColDef.js +10 -2
- package/legacy/colDef/gridNumericOperators.js +0 -6
- package/legacy/colDef/gridSingleSelectColDef.js +21 -1
- package/legacy/components/base/GridBody.js +2 -1
- package/legacy/components/cell/GridEditInputCell.js +4 -1
- package/legacy/components/containers/GridRootStyles.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +54 -31
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/components/panel/filterPanel/index.js +2 -1
- package/legacy/constants/localeTextConstants.js +26 -0
- package/legacy/hooks/features/clipboard/useGridClipboard.js +44 -26
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/legacy/hooks/features/dimensions/useGridDimensions.js +4 -6
- package/legacy/hooks/features/editing/useGridCellEditing.js +7 -3
- package/legacy/hooks/features/editing/useGridEditing.js +0 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +7 -3
- package/legacy/hooks/features/export/serializers/csvSerializer.js +43 -6
- package/legacy/hooks/features/export/useGridCsvExport.js +8 -5
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
- package/legacy/hooks/features/focus/useGridFocus.js +58 -9
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
- package/legacy/hooks/features/headerFiltering/index.js +1 -0
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +123 -4
- package/legacy/hooks/features/rows/useGridRows.js +16 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +7 -2
- package/legacy/internals/utils/index.js +2 -1
- package/legacy/internals/utils/useProps.js +11 -0
- package/legacy/joy/icons.js +432 -0
- package/legacy/joy/joySlots.js +118 -4
- package/legacy/locales/arSD.js +28 -0
- package/legacy/locales/beBY.js +28 -0
- package/legacy/locales/bgBG.js +28 -0
- package/legacy/locales/csCZ.js +36 -8
- package/legacy/locales/daDK.js +28 -0
- package/legacy/locales/deDE.js +30 -2
- package/legacy/locales/elGR.js +27 -0
- package/legacy/locales/esES.js +28 -0
- package/legacy/locales/faIR.js +28 -0
- package/legacy/locales/fiFI.js +28 -0
- package/legacy/locales/frFR.js +34 -6
- package/legacy/locales/heIL.js +30 -2
- package/legacy/locales/huHU.js +28 -0
- package/legacy/locales/itIT.js +28 -0
- package/legacy/locales/jaJP.js +28 -0
- package/legacy/locales/koKR.js +28 -0
- package/legacy/locales/nbNO.js +28 -0
- package/legacy/locales/nlNL.js +28 -0
- package/legacy/locales/plPL.js +28 -0
- package/legacy/locales/ptBR.js +29 -1
- package/legacy/locales/roRO.js +28 -0
- package/legacy/locales/ruRU.js +28 -0
- package/legacy/locales/skSK.js +28 -0
- package/legacy/locales/svSE.js +28 -0
- package/legacy/locales/trTR.js +28 -0
- package/legacy/locales/ukUA.js +36 -9
- package/legacy/locales/urPK.js +28 -0
- package/legacy/locales/viVN.js +27 -0
- package/legacy/locales/zhCN.js +28 -0
- package/legacy/locales/zhTW.js +28 -0
- package/legacy/material/index.js +5 -1
- package/legacy/models/api/index.js +0 -1
- package/legacy/models/index.js +0 -1
- package/legacy/utils/domUtils.js +14 -1
- package/locales/arSD.js +28 -0
- package/locales/beBY.js +28 -0
- package/locales/bgBG.js +28 -0
- package/locales/csCZ.js +36 -8
- package/locales/daDK.js +28 -0
- package/locales/deDE.js +30 -2
- package/locales/elGR.js +27 -0
- package/locales/esES.js +28 -0
- package/locales/faIR.js +28 -0
- package/locales/fiFI.js +28 -0
- package/locales/frFR.js +34 -6
- package/locales/heIL.js +30 -2
- package/locales/huHU.js +28 -0
- package/locales/itIT.js +28 -0
- package/locales/jaJP.js +28 -0
- package/locales/koKR.js +28 -0
- package/locales/nbNO.js +28 -0
- package/locales/nlNL.js +28 -0
- package/locales/plPL.js +28 -0
- package/locales/ptBR.js +29 -1
- package/locales/roRO.js +28 -0
- package/locales/ruRU.js +28 -0
- package/locales/skSK.js +28 -0
- package/locales/svSE.js +28 -0
- package/locales/trTR.js +28 -0
- package/locales/ukUA.js +36 -9
- package/locales/urPK.js +28 -0
- package/locales/viVN.js +27 -0
- package/locales/zhCN.js +28 -0
- package/locales/zhTW.js +28 -0
- package/material/index.d.ts +3 -65
- package/material/index.js +5 -1
- package/models/api/gridApiCommon.d.ts +3 -3
- package/models/api/gridCoreApi.d.ts +8 -0
- package/models/api/gridFocusApi.d.ts +6 -0
- package/models/api/gridHeaderFilteringApi.d.ts +30 -0
- package/models/api/gridLocaleTextApi.d.ts +25 -0
- package/models/api/index.d.ts +0 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +33 -1
- package/models/gridFilterOperator.d.ts +4 -0
- package/models/gridHeaderFilteringModel.d.ts +5 -0
- package/models/gridHeaderFilteringModel.js +1 -0
- package/models/gridSlotsComponent.d.ts +21 -4
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/index.d.ts +1 -1
- package/models/index.js +0 -1
- package/models/props/DataGridProps.d.ts +19 -0
- package/modern/DataGrid/DataGrid.js +20 -1
- package/modern/DataGrid/useDataGridComponent.js +2 -2
- package/modern/DataGrid/useDataGridProps.js +8 -13
- package/modern/colDef/gridBooleanColDef.js +19 -1
- package/modern/colDef/gridDateColDef.js +6 -2
- package/modern/colDef/gridNumericOperators.js +0 -6
- package/modern/colDef/gridSingleSelectColDef.js +21 -1
- package/modern/components/base/GridBody.js +2 -1
- package/modern/components/cell/GridEditInputCell.js +4 -1
- package/modern/components/containers/GridRootStyles.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/components/panel/filterPanel/index.js +2 -1
- package/modern/constants/localeTextConstants.js +26 -0
- package/modern/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +3 -5
- package/modern/hooks/features/editing/useGridCellEditing.js +7 -3
- package/modern/hooks/features/editing/useGridEditing.js +0 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -3
- package/modern/hooks/features/export/serializers/csvSerializer.js +44 -6
- package/modern/hooks/features/export/useGridCsvExport.js +7 -5
- package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/modern/hooks/features/focus/useGridFocus.js +55 -9
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/modern/hooks/features/headerFiltering/index.js +1 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
- package/modern/hooks/features/rows/useGridRows.js +16 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +7 -2
- package/modern/internals/utils/index.js +2 -1
- package/modern/internals/utils/useProps.js +13 -0
- package/modern/joy/icons.js +433 -0
- package/modern/joy/joySlots.js +110 -4
- package/modern/locales/arSD.js +28 -0
- package/modern/locales/beBY.js +28 -0
- package/modern/locales/bgBG.js +28 -0
- package/modern/locales/csCZ.js +36 -8
- package/modern/locales/daDK.js +28 -0
- package/modern/locales/deDE.js +30 -2
- package/modern/locales/elGR.js +27 -0
- package/modern/locales/esES.js +28 -0
- package/modern/locales/faIR.js +28 -0
- package/modern/locales/fiFI.js +28 -0
- package/modern/locales/frFR.js +34 -6
- package/modern/locales/heIL.js +30 -2
- package/modern/locales/huHU.js +28 -0
- package/modern/locales/itIT.js +28 -0
- package/modern/locales/jaJP.js +28 -0
- package/modern/locales/koKR.js +28 -0
- package/modern/locales/nbNO.js +28 -0
- package/modern/locales/nlNL.js +28 -0
- package/modern/locales/plPL.js +28 -0
- package/modern/locales/ptBR.js +29 -1
- package/modern/locales/roRO.js +28 -0
- package/modern/locales/ruRU.js +28 -0
- package/modern/locales/skSK.js +28 -0
- package/modern/locales/svSE.js +28 -0
- package/modern/locales/trTR.js +28 -0
- package/modern/locales/ukUA.js +36 -9
- package/modern/locales/urPK.js +28 -0
- package/modern/locales/viVN.js +27 -0
- package/modern/locales/zhCN.js +28 -0
- package/modern/locales/zhTW.js +28 -0
- package/modern/material/index.js +5 -1
- package/modern/models/api/gridHeaderFilteringApi.js +1 -0
- package/modern/models/api/index.js +0 -1
- package/modern/models/gridHeaderFilteringModel.js +1 -0
- package/modern/models/index.js +0 -1
- package/modern/utils/domUtils.js +13 -1
- package/node/DataGrid/DataGrid.js +20 -1
- package/node/DataGrid/useDataGridComponent.js +2 -2
- package/node/DataGrid/useDataGridProps.js +7 -12
- package/node/colDef/gridBooleanColDef.js +19 -1
- package/node/colDef/gridDateColDef.js +6 -2
- package/node/colDef/gridNumericOperators.js +0 -6
- package/node/colDef/gridSingleSelectColDef.js +21 -1
- package/node/components/base/GridBody.js +2 -1
- package/node/components/cell/GridEditInputCell.js +4 -1
- package/node/components/containers/GridRootStyles.js +1 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
- package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
- package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
- package/node/components/panel/filterPanel/index.js +26 -8
- package/node/constants/localeTextConstants.js +26 -0
- package/node/hooks/features/clipboard/useGridClipboard.js +42 -25
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
- package/node/hooks/features/editing/useGridCellEditing.js +7 -3
- package/node/hooks/features/editing/useGridEditing.js +0 -3
- package/node/hooks/features/editing/useGridRowEditing.js +7 -3
- package/node/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/node/hooks/features/export/useGridCsvExport.js +6 -3
- package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
- package/node/hooks/features/focus/useGridFocus.js +55 -9
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
- package/node/hooks/features/headerFiltering/index.js +16 -0
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
- package/node/hooks/features/rows/useGridRows.js +16 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +69 -1
- package/node/internals/utils/index.js +11 -0
- package/node/internals/utils/useProps.js +22 -0
- package/node/joy/icons.js +471 -0
- package/node/joy/joySlots.js +110 -3
- package/node/locales/arSD.js +28 -0
- package/node/locales/beBY.js +28 -0
- package/node/locales/bgBG.js +28 -0
- package/node/locales/csCZ.js +36 -8
- package/node/locales/daDK.js +28 -0
- package/node/locales/deDE.js +30 -2
- package/node/locales/elGR.js +27 -0
- package/node/locales/esES.js +28 -0
- package/node/locales/faIR.js +28 -0
- package/node/locales/fiFI.js +28 -0
- package/node/locales/frFR.js +34 -6
- package/node/locales/heIL.js +30 -2
- package/node/locales/huHU.js +28 -0
- package/node/locales/itIT.js +28 -0
- package/node/locales/jaJP.js +28 -0
- package/node/locales/koKR.js +28 -0
- package/node/locales/nbNO.js +28 -0
- package/node/locales/nlNL.js +28 -0
- package/node/locales/plPL.js +28 -0
- package/node/locales/ptBR.js +29 -1
- package/node/locales/roRO.js +28 -0
- package/node/locales/ruRU.js +28 -0
- package/node/locales/skSK.js +28 -0
- package/node/locales/svSE.js +28 -0
- package/node/locales/trTR.js +28 -0
- package/node/locales/ukUA.js +36 -9
- package/node/locales/urPK.js +28 -0
- package/node/locales/viVN.js +27 -0
- package/node/locales/zhCN.js +28 -0
- package/node/locales/zhTW.js +28 -0
- package/node/material/index.js +5 -1
- package/node/models/api/index.js +0 -11
- package/node/models/gridHeaderFilteringModel.js +5 -0
- package/node/models/index.js +0 -11
- package/node/utils/domUtils.js +15 -1
- package/package.json +1 -1
- package/utils/domUtils.d.ts +1 -0
- package/utils/domUtils.js +13 -1
- package/models/api/gridClipboardApi.d.ts +0 -11
- /package/legacy/models/api/{gridClipboardApi.js → gridHeaderFilteringApi.js} +0 -0
- /package/{models/api/gridClipboardApi.js → legacy/models/gridHeaderFilteringModel.js} +0 -0
- /package/{modern/models/api/gridClipboardApi.js → models/api/gridHeaderFilteringApi.js} +0 -0
- /package/node/models/api/{gridClipboardApi.js → gridHeaderFilteringApi.js} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GridColDef } from '../colDef';
|
|
2
|
+
import { GridHeaderFilteringState } from '../gridHeaderFilteringModel';
|
|
3
|
+
export interface GridHeaderFilteringPrivateApi {
|
|
4
|
+
/**
|
|
5
|
+
* Internal function to set the header filter state.
|
|
6
|
+
* @param {Partial<GridHeaderFilteringState>} headerFilterState The field to be edited.
|
|
7
|
+
* @ignore - do not document.
|
|
8
|
+
*/
|
|
9
|
+
setHeaderFilterState: (headerFilterState: Partial<GridHeaderFilteringState>) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface GridHeaderFilteringApi {
|
|
12
|
+
/**
|
|
13
|
+
* Puts the cell corresponding to the given row id and field into edit mode.
|
|
14
|
+
* @param {GridColDef['field']} field The field of the header filter to put in edit mode.
|
|
15
|
+
*/
|
|
16
|
+
startHeaderFilterEditMode: (field: GridColDef['field']) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Stops the edit mode for the current field.
|
|
19
|
+
*/
|
|
20
|
+
stopHeaderFilterEditMode: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Opens the header filter menu for the given field.
|
|
23
|
+
* @param {GridColDef['field']} field The field of the header filter to open menu for.
|
|
24
|
+
*/
|
|
25
|
+
showHeaderFilterMenu: (field: GridColDef['field']) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Hides the header filter menu.
|
|
28
|
+
*/
|
|
29
|
+
hideHeaderFilterMenu: () => void;
|
|
30
|
+
}
|
|
@@ -54,6 +54,31 @@ export interface GridLocaleText {
|
|
|
54
54
|
filterOperatorIsEmpty: string;
|
|
55
55
|
filterOperatorIsNotEmpty: string;
|
|
56
56
|
filterOperatorIsAnyOf: string;
|
|
57
|
+
'filterOperator=': string;
|
|
58
|
+
'filterOperator!=': string;
|
|
59
|
+
'filterOperator>': string;
|
|
60
|
+
'filterOperator>=': string;
|
|
61
|
+
'filterOperator<': string;
|
|
62
|
+
'filterOperator<=': string;
|
|
63
|
+
headerFilterOperatorContains: string;
|
|
64
|
+
headerFilterOperatorEquals: string;
|
|
65
|
+
headerFilterOperatorStartsWith: string;
|
|
66
|
+
headerFilterOperatorEndsWith: string;
|
|
67
|
+
headerFilterOperatorIs: string;
|
|
68
|
+
headerFilterOperatorNot: string;
|
|
69
|
+
headerFilterOperatorAfter: string;
|
|
70
|
+
headerFilterOperatorOnOrAfter: string;
|
|
71
|
+
headerFilterOperatorBefore: string;
|
|
72
|
+
headerFilterOperatorOnOrBefore: string;
|
|
73
|
+
headerFilterOperatorIsEmpty: string;
|
|
74
|
+
headerFilterOperatorIsNotEmpty: string;
|
|
75
|
+
headerFilterOperatorIsAnyOf: string;
|
|
76
|
+
'headerFilterOperator=': string;
|
|
77
|
+
'headerFilterOperator!=': string;
|
|
78
|
+
'headerFilterOperator>': string;
|
|
79
|
+
'headerFilterOperator>=': string;
|
|
80
|
+
'headerFilterOperator<': string;
|
|
81
|
+
'headerFilterOperator<=': string;
|
|
57
82
|
filterValueAny: string;
|
|
58
83
|
filterValueTrue: string;
|
|
59
84
|
filterValueFalse: string;
|
package/models/api/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export * from './gridColumnMenuApi';
|
|
|
16
16
|
export * from './gridPreferencesPanelApi';
|
|
17
17
|
export * from './gridPrintExportApi';
|
|
18
18
|
export * from './gridDisableVirtualizationApi';
|
|
19
|
-
export * from './gridClipboardApi';
|
|
20
19
|
export * from './gridCallbackDetails';
|
|
21
20
|
export * from './gridScrollApi';
|
|
22
21
|
export * from './gridVirtualScrollerApi';
|
package/models/api/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export * from './gridColumnMenuApi';
|
|
|
11
11
|
export * from './gridPreferencesPanelApi';
|
|
12
12
|
export * from './gridPrintExportApi';
|
|
13
13
|
export * from './gridDisableVirtualizationApi';
|
|
14
|
-
export * from './gridClipboardApi';
|
|
15
14
|
export * from './gridCallbackDetails';
|
|
16
15
|
export * from './gridScrollApi';
|
|
17
16
|
export * from './gridVirtualScrollerApi';
|
|
@@ -189,6 +189,32 @@ export interface GridColumnHeaderEventLookup {
|
|
|
189
189
|
params: GridColumnOrderChangeParams;
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
+
export interface GridHeaderFilterEventLookup {
|
|
193
|
+
/**
|
|
194
|
+
* Fired when a column header filter is clicked
|
|
195
|
+
* @ignore - do not document.
|
|
196
|
+
*/
|
|
197
|
+
headerFilterClick: {
|
|
198
|
+
params: GridColumnHeaderParams;
|
|
199
|
+
event: React.MouseEvent<HTMLElement>;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Fired when a key is pressed in a column header filter. It's mapped to the `keydown` DOM event.
|
|
203
|
+
* @ignore - do not document.
|
|
204
|
+
*/
|
|
205
|
+
headerFilterKeyDown: {
|
|
206
|
+
params: GridColumnHeaderParams;
|
|
207
|
+
event: React.KeyboardEvent<HTMLElement>;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Fired when a mouse is pressed in a column header filter. It's mapped to the `mousedown` DOM event.
|
|
211
|
+
* @ignore - do not document.
|
|
212
|
+
*/
|
|
213
|
+
headerFilterMouseDown: {
|
|
214
|
+
params: GridColumnHeaderParams;
|
|
215
|
+
event: React.KeyboardEvent<HTMLElement>;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
192
218
|
export interface GridColumnGroupHeaderEventLookup {
|
|
193
219
|
/**
|
|
194
220
|
* Fired when a key is pressed in a column group header. It's mapped do the `keydown` DOM event.
|
|
@@ -318,7 +344,7 @@ export interface GridControlledStateReasonLookup {
|
|
|
318
344
|
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState';
|
|
319
345
|
pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
|
|
320
346
|
}
|
|
321
|
-
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
347
|
+
export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
|
|
322
348
|
/**
|
|
323
349
|
* Fired when the grid is unmounted.
|
|
324
350
|
*/
|
|
@@ -541,6 +567,12 @@ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEve
|
|
|
541
567
|
params: GridRowSelectionCheckboxParams;
|
|
542
568
|
event: React.ChangeEvent<HTMLElement>;
|
|
543
569
|
};
|
|
570
|
+
/**
|
|
571
|
+
* Fired when the data is copied to the clipboard
|
|
572
|
+
*/
|
|
573
|
+
clipboardCopy: {
|
|
574
|
+
params: string;
|
|
575
|
+
};
|
|
544
576
|
/**
|
|
545
577
|
* Fired when the preference panel is closed.
|
|
546
578
|
*/
|
|
@@ -13,6 +13,10 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
|
|
|
13
13
|
* The label of the filter operator.
|
|
14
14
|
*/
|
|
15
15
|
label?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The label of the filter shown in header filter row.
|
|
18
|
+
*/
|
|
19
|
+
headerLabel?: string;
|
|
16
20
|
/**
|
|
17
21
|
* The name of the filter operator.
|
|
18
22
|
* It will be matched with the `operator` property of the filter items.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { UncapitalizeObjectKeys } from '../internals/utils';
|
|
3
3
|
import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
|
|
4
|
-
|
|
5
|
-
* Grid components React prop interface containing all the overridable components.
|
|
6
|
-
*/
|
|
7
|
-
export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
4
|
+
export interface GridBaseSlots {
|
|
8
5
|
/**
|
|
9
6
|
* The custom Checkbox component used in the grid for both header and cells.
|
|
10
7
|
* @default Checkbox
|
|
11
8
|
*/
|
|
12
9
|
BaseCheckbox: React.JSXElementConstructor<any>;
|
|
10
|
+
/**
|
|
11
|
+
* The custom Chip component used in the grid.
|
|
12
|
+
* @default Chip
|
|
13
|
+
*/
|
|
14
|
+
BaseChip: React.JSXElementConstructor<any>;
|
|
15
|
+
/**
|
|
16
|
+
* The custom InputAdornment component used in the grid.
|
|
17
|
+
* @default InputAdornment
|
|
18
|
+
*/
|
|
19
|
+
BaseInputAdornment: React.JSXElementConstructor<any>;
|
|
13
20
|
/**
|
|
14
21
|
* The custom TextField component used in the grid.
|
|
15
22
|
* @default TextField
|
|
@@ -60,6 +67,16 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
|
|
|
60
67
|
* @default MenuItem
|
|
61
68
|
*/
|
|
62
69
|
BaseSelectOption: React.JSXElementConstructor<any>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Grid components React prop interface containing all the overridable components.
|
|
73
|
+
*/
|
|
74
|
+
export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponent {
|
|
75
|
+
/**
|
|
76
|
+
* The custom Chip component used in the grid.
|
|
77
|
+
* @default Chip
|
|
78
|
+
*/
|
|
79
|
+
BaseChip: React.JSXElementConstructor<any>;
|
|
63
80
|
/**
|
|
64
81
|
* Component rendered for each cell.
|
|
65
82
|
* @default GridCell
|
|
@@ -10,6 +10,7 @@ import { TooltipProps } from '@mui/material/Tooltip';
|
|
|
10
10
|
import type { InputLabelProps } from '@mui/material/InputLabel';
|
|
11
11
|
import { PopperProps } from '@mui/material/Popper';
|
|
12
12
|
import { TablePaginationProps } from '@mui/material/TablePagination';
|
|
13
|
+
import { ChipProps } from '@mui/material/Chip';
|
|
13
14
|
import { GridToolbarProps } from '../components/toolbar/GridToolbar';
|
|
14
15
|
import { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
|
|
15
16
|
import { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
|
|
@@ -42,6 +43,8 @@ export interface BaseInputLabelPropsOverrides {
|
|
|
42
43
|
}
|
|
43
44
|
export interface BaseSelectOptionPropsOverrides {
|
|
44
45
|
}
|
|
46
|
+
export interface BaseChipPropsOverrides {
|
|
47
|
+
}
|
|
45
48
|
export interface CellPropsOverrides {
|
|
46
49
|
}
|
|
47
50
|
export interface ToolbarPropsOverrides {
|
|
@@ -90,6 +93,7 @@ export interface GridSlotsComponentsProps {
|
|
|
90
93
|
value: any;
|
|
91
94
|
children?: React.ReactNode;
|
|
92
95
|
}, BaseSelectOptionPropsOverrides>;
|
|
96
|
+
baseChip?: SlotProps<ChipProps, BaseChipPropsOverrides>;
|
|
93
97
|
cell?: SlotProps<GridCellProps, CellPropsOverrides>;
|
|
94
98
|
columnHeaderFilterIconButton?: SlotProps<ColumnHeaderFilterIconButtonProps, ColumnHeaderFilterIconButtonPropsOverrides>;
|
|
95
99
|
columnMenu?: SlotProps<GridColumnMenuProps, ColumnMenuPropsOverrides>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
|
|
2
2
|
import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
|
|
3
3
|
import type { GridEditingState } from './gridEditRowModel';
|
|
4
|
+
import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
|
|
4
5
|
import type { GridRowSelectionModel } from './gridRowSelectionModel';
|
|
5
6
|
/**
|
|
6
7
|
* The state of `DataGrid`.
|
|
@@ -9,6 +10,7 @@ export interface GridStateCommunity {
|
|
|
9
10
|
rows: GridRowsState;
|
|
10
11
|
rowsMeta: GridRowsMetaState;
|
|
11
12
|
editRows: GridEditingState;
|
|
13
|
+
headerFiltering: GridHeaderFilteringState;
|
|
12
14
|
pagination: GridPaginationState;
|
|
13
15
|
columns: GridColumnsState;
|
|
14
16
|
columnGrouping: GridColumnsGroupingState;
|
package/models/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export * from './gridCell';
|
|
|
16
16
|
export * from './gridColumnHeaderClass';
|
|
17
17
|
export * from './api';
|
|
18
18
|
export * from './gridIconSlotsComponent';
|
|
19
|
-
export
|
|
19
|
+
export type { GridSlotsComponent, UncapitalizedGridSlotsComponent } from './gridSlotsComponent';
|
|
20
20
|
export * from './gridSlotsComponentsProps';
|
|
21
21
|
export * from './gridDensity';
|
|
22
22
|
export * from './logger';
|
package/models/index.js
CHANGED
|
@@ -16,7 +16,6 @@ export * from './gridCell';
|
|
|
16
16
|
export * from './gridColumnHeaderClass';
|
|
17
17
|
export * from './api';
|
|
18
18
|
export * from './gridIconSlotsComponent';
|
|
19
|
-
export * from './gridSlotsComponent';
|
|
20
19
|
export * from './gridSlotsComponentsProps';
|
|
21
20
|
export * from './gridDensity';
|
|
22
21
|
export * from './logger';
|
|
@@ -306,6 +306,20 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
306
306
|
* @default false
|
|
307
307
|
*/
|
|
308
308
|
keepColumnPositionIfDraggedOutside: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
311
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
312
|
+
* @default: false
|
|
313
|
+
*/
|
|
314
|
+
unstable_ignoreValueFormatterDuringExport: boolean | {
|
|
315
|
+
csvExport?: boolean;
|
|
316
|
+
clipboardExport?: boolean;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* The character used to separate cell values when copying to the clipboard.
|
|
320
|
+
* @default '\t'
|
|
321
|
+
*/
|
|
322
|
+
clipboardCopyCellDelimiter: string;
|
|
309
323
|
}
|
|
310
324
|
/**
|
|
311
325
|
* The `DataGrid` props with no default value.
|
|
@@ -679,4 +693,9 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
679
693
|
*/
|
|
680
694
|
onProcessRowUpdateError?: (error: any) => void;
|
|
681
695
|
columnGroupingModel?: GridColumnGroupingModel;
|
|
696
|
+
/**
|
|
697
|
+
* Callback called when the data is copied to the clipboard.
|
|
698
|
+
* @param {string} data The data copied to the clipboard.
|
|
699
|
+
*/
|
|
700
|
+
onClipboardCopy?: GridEventListener<'clipboardCopy'>;
|
|
682
701
|
}
|
|
@@ -68,6 +68,11 @@ DataGridRaw.propTypes = {
|
|
|
68
68
|
* Override or extend the styles applied to the component.
|
|
69
69
|
*/
|
|
70
70
|
classes: PropTypes.object,
|
|
71
|
+
/**
|
|
72
|
+
* The character used to separate cell values when copying to the clipboard.
|
|
73
|
+
* @default '\t'
|
|
74
|
+
*/
|
|
75
|
+
clipboardCopyCellDelimiter: PropTypes.string,
|
|
71
76
|
/**
|
|
72
77
|
* Number of extra columns to be rendered before/after the visible slice.
|
|
73
78
|
* @default 3
|
|
@@ -326,6 +331,11 @@ DataGridRaw.propTypes = {
|
|
|
326
331
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
327
332
|
*/
|
|
328
333
|
onCellModesModelChange: PropTypes.func,
|
|
334
|
+
/**
|
|
335
|
+
* Callback called when the data is copied to the clipboard.
|
|
336
|
+
* @param {string} data The data copied to the clipboard.
|
|
337
|
+
*/
|
|
338
|
+
onClipboardCopy: PropTypes.func,
|
|
329
339
|
/**
|
|
330
340
|
* Callback fired when a click event comes from a column header element.
|
|
331
341
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -611,5 +621,14 @@ DataGridRaw.propTypes = {
|
|
|
611
621
|
/**
|
|
612
622
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
613
623
|
*/
|
|
614
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
624
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
625
|
+
/**
|
|
626
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
627
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
628
|
+
* @default: false
|
|
629
|
+
*/
|
|
630
|
+
unstable_ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
|
|
631
|
+
clipboardExport: PropTypes.bool,
|
|
632
|
+
csvExport: PropTypes.bool
|
|
633
|
+
}), PropTypes.bool])
|
|
615
634
|
};
|
|
@@ -67,9 +67,9 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
67
67
|
useGridRowsMeta(privateApiRef, props);
|
|
68
68
|
useGridScroll(privateApiRef, props);
|
|
69
69
|
useGridColumnMenu(privateApiRef);
|
|
70
|
-
useGridCsvExport(privateApiRef);
|
|
70
|
+
useGridCsvExport(privateApiRef, props);
|
|
71
71
|
useGridPrintExport(privateApiRef, props);
|
|
72
|
-
useGridClipboard(privateApiRef);
|
|
72
|
+
useGridClipboard(privateApiRef, props);
|
|
73
73
|
useGridDimensions(privateApiRef, props);
|
|
74
74
|
useGridEvents(privateApiRef, props);
|
|
75
75
|
useGridStatePersistence(privateApiRef);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["components", "componentsProps"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
6
4
|
import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
|
|
7
5
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
8
6
|
import { GridEditModes } from '../models';
|
|
9
|
-
import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
|
|
7
|
+
import { computeSlots, useProps, uncapitalizeObjectKeys } from '../internals/utils';
|
|
10
8
|
const DATA_GRID_FORCED_PROPS = {
|
|
11
9
|
disableMultipleColumnsFiltering: true,
|
|
12
10
|
disableMultipleColumnsSorting: true,
|
|
@@ -66,19 +64,16 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
66
64
|
disableColumnReorder: false,
|
|
67
65
|
disableColumnResize: false,
|
|
68
66
|
keepNonExistentRowsSelected: false,
|
|
69
|
-
keepColumnPositionIfDraggedOutside: false
|
|
67
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
68
|
+
unstable_ignoreValueFormatterDuringExport: false,
|
|
69
|
+
clipboardCopyCellDelimiter: '\t'
|
|
70
70
|
};
|
|
71
71
|
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
72
72
|
export const useDataGridProps = inProps => {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
components,
|
|
79
|
-
componentsProps
|
|
80
|
-
} = _useThemeProps,
|
|
81
|
-
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
73
|
+
const [components, componentsProps, themedProps] = useProps(useThemeProps({
|
|
74
|
+
props: inProps,
|
|
75
|
+
name: 'MuiDataGrid'
|
|
76
|
+
}));
|
|
82
77
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
83
78
|
const slots = React.useMemo(() => computeSlots({
|
|
84
79
|
defaultSlots,
|
|
@@ -10,6 +10,22 @@ function gridBooleanFormatter({
|
|
|
10
10
|
}) {
|
|
11
11
|
return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');
|
|
12
12
|
}
|
|
13
|
+
const stringToBoolean = value => {
|
|
14
|
+
switch (value.toLowerCase().trim()) {
|
|
15
|
+
case 'true':
|
|
16
|
+
case 'yes':
|
|
17
|
+
case '1':
|
|
18
|
+
return true;
|
|
19
|
+
case 'false':
|
|
20
|
+
case 'no':
|
|
21
|
+
case '0':
|
|
22
|
+
case 'null':
|
|
23
|
+
case 'undefined':
|
|
24
|
+
return false;
|
|
25
|
+
default:
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
13
29
|
export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
14
30
|
type: 'boolean',
|
|
15
31
|
align: 'center',
|
|
@@ -21,5 +37,7 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
21
37
|
filterOperators: getGridBooleanOperators(),
|
|
22
38
|
getApplyQuickFilterFn: undefined,
|
|
23
39
|
// @ts-ignore
|
|
24
|
-
aggregable: false
|
|
40
|
+
aggregable: false,
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
pastedValueParser: value => stringToBoolean(value)
|
|
25
43
|
});
|
|
@@ -51,7 +51,9 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
51
51
|
valueFormatter: gridDateFormatter,
|
|
52
52
|
filterOperators: getGridDateOperators(),
|
|
53
53
|
renderEditCell: renderEditDateCell,
|
|
54
|
-
getApplyQuickFilterFn: undefined
|
|
54
|
+
getApplyQuickFilterFn: undefined,
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
pastedValueParser: value => new Date(value)
|
|
55
57
|
});
|
|
56
58
|
export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
57
59
|
type: 'dateTime',
|
|
@@ -59,5 +61,7 @@ export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
59
61
|
valueFormatter: gridDateTimeFormatter,
|
|
60
62
|
filterOperators: getGridDateOperators(true),
|
|
61
63
|
renderEditCell: renderEditDateCell,
|
|
62
|
-
getApplyQuickFilterFn: undefined
|
|
64
|
+
getApplyQuickFilterFn: undefined,
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
pastedValueParser: value => new Date(value)
|
|
63
67
|
});
|
|
@@ -17,7 +17,6 @@ export const getGridNumericQuickFilterFn = value => {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export const getGridNumericOperators = () => [{
|
|
20
|
-
label: '=',
|
|
21
20
|
value: '=',
|
|
22
21
|
getApplyFilterFn: filterItem => {
|
|
23
22
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -34,7 +33,6 @@ export const getGridNumericOperators = () => [{
|
|
|
34
33
|
type: 'number'
|
|
35
34
|
}
|
|
36
35
|
}, {
|
|
37
|
-
label: '!=',
|
|
38
36
|
value: '!=',
|
|
39
37
|
getApplyFilterFn: filterItem => {
|
|
40
38
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -51,7 +49,6 @@ export const getGridNumericOperators = () => [{
|
|
|
51
49
|
type: 'number'
|
|
52
50
|
}
|
|
53
51
|
}, {
|
|
54
|
-
label: '>',
|
|
55
52
|
value: '>',
|
|
56
53
|
getApplyFilterFn: filterItem => {
|
|
57
54
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -71,7 +68,6 @@ export const getGridNumericOperators = () => [{
|
|
|
71
68
|
type: 'number'
|
|
72
69
|
}
|
|
73
70
|
}, {
|
|
74
|
-
label: '>=',
|
|
75
71
|
value: '>=',
|
|
76
72
|
getApplyFilterFn: filterItem => {
|
|
77
73
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -91,7 +87,6 @@ export const getGridNumericOperators = () => [{
|
|
|
91
87
|
type: 'number'
|
|
92
88
|
}
|
|
93
89
|
}, {
|
|
94
|
-
label: '<',
|
|
95
90
|
value: '<',
|
|
96
91
|
getApplyFilterFn: filterItem => {
|
|
97
92
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -111,7 +106,6 @@ export const getGridNumericOperators = () => [{
|
|
|
111
106
|
type: 'number'
|
|
112
107
|
}
|
|
113
108
|
}, {
|
|
114
|
-
label: '<=',
|
|
115
109
|
value: '<=',
|
|
116
110
|
getApplyFilterFn: filterItem => {
|
|
117
111
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
@@ -51,5 +51,25 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
51
51
|
return valueOption ? colDef.getOptionLabel(valueOption) : '';
|
|
52
52
|
},
|
|
53
53
|
renderEditCell: renderEditSingleSelectCell,
|
|
54
|
-
filterOperators: getGridSingleSelectOperators()
|
|
54
|
+
filterOperators: getGridSingleSelectOperators(),
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
pastedValueParser: (value, params) => {
|
|
57
|
+
const colDef = params.colDef;
|
|
58
|
+
const colDefValueOptions = colDef.valueOptions;
|
|
59
|
+
const valueOptions = typeof colDefValueOptions === 'function' ? colDefValueOptions({
|
|
60
|
+
field: colDef.field
|
|
61
|
+
}) : colDefValueOptions || [];
|
|
62
|
+
const getOptionValue = colDef.getOptionValue;
|
|
63
|
+
const valueOption = valueOptions.find(option => {
|
|
64
|
+
if (getOptionValue(option) === value) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
});
|
|
69
|
+
if (valueOption) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
// do not paste the value if it is not in the valueOptions
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
55
75
|
});
|
|
@@ -89,7 +89,8 @@ function GridBody(props) {
|
|
|
89
89
|
apiRef.current.register('private', {
|
|
90
90
|
columnHeadersContainerElementRef: columnsContainerRef,
|
|
91
91
|
columnHeadersElementRef: columnHeadersRef,
|
|
92
|
-
virtualScrollerRef
|
|
92
|
+
virtualScrollerRef,
|
|
93
|
+
mainElementRef: rootRef
|
|
93
94
|
});
|
|
94
95
|
const hasDimensions = !!apiRef.current.getRootDimensions();
|
|
95
96
|
return /*#__PURE__*/_jsxs(GridMainContainer, {
|
|
@@ -88,7 +88,10 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
88
88
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
89
89
|
value: valueState ?? '',
|
|
90
90
|
onChange: handleChange,
|
|
91
|
-
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
91
|
+
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
92
|
+
fontSize: "small",
|
|
93
|
+
color: "action"
|
|
94
|
+
}) : undefined
|
|
92
95
|
}, other));
|
|
93
96
|
});
|
|
94
97
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|