@mui/x-data-grid 5.12.3 → 5.14.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 +147 -1
- package/DataGrid/DataGrid.js +4 -4
- package/DataGrid/useDataGridComponent.js +1 -1
- package/colDef/gridActionsColDef.js +2 -0
- package/colDef/gridBooleanColDef.js +3 -1
- package/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/colDef/gridDateOperators.d.ts +1 -1
- package/colDef/gridDateOperators.js +4 -2
- package/colDef/gridNumericOperators.js +4 -2
- package/colDef/gridStringColDef.d.ts +3 -0
- package/colDef/gridStringColDef.js +6 -0
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/gridStringOperators.js +15 -8
- package/components/GridRow.js +1 -1
- package/components/base/GridOverlays.js +4 -1
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridBooleanCell.d.ts +5 -2
- package/components/cell/GridBooleanCell.js +93 -2
- package/components/cell/GridEditDateCell.js +5 -1
- package/components/cell/index.d.ts +1 -0
- package/components/cell/index.js +1 -0
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/components/containers/GridRootStyles.js +10 -0
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +3 -8
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +30 -14
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +20 -10
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/constants/gridClasses.d.ts +25 -1
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +8 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +2 -1
- package/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.js +13 -6
- package/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/hooks/features/export/utils.d.ts +1 -1
- package/hooks/features/export/utils.js +9 -2
- package/hooks/features/filter/gridFilterUtils.js +6 -0
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +30 -5
- package/hooks/features/pagination/useGridPage.js +4 -3
- package/hooks/features/pagination/useGridPageSize.js +4 -3
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/hooks/features/selection/useGridSelection.js +24 -10
- package/hooks/features/sorting/gridSortingUtils.d.ts +1 -0
- package/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +34 -6
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +12 -1
- package/hooks/features/statePersistence/index.d.ts +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.js +1 -1
- package/hooks/utils/useGridRootProps.js +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/legacy/DataGrid/DataGrid.js +4 -4
- package/legacy/DataGrid/useDataGridComponent.js +1 -1
- package/legacy/colDef/gridActionsColDef.js +2 -0
- package/legacy/colDef/gridBooleanColDef.js +3 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/legacy/colDef/gridDateOperators.js +4 -2
- package/legacy/colDef/gridNumericOperators.js +4 -2
- package/legacy/colDef/gridStringColDef.js +6 -0
- package/legacy/colDef/gridStringOperators.js +17 -7
- package/legacy/components/GridRow.js +1 -1
- package/legacy/components/base/GridOverlays.js +4 -1
- package/legacy/components/cell/GridBooleanCell.js +93 -2
- package/legacy/components/cell/GridEditDateCell.js +5 -1
- package/legacy/components/cell/index.js +1 -0
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +6 -1
- package/legacy/components/containers/GridRootStyles.js +3 -3
- package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +22 -7
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/components/toolbar/GridToolbarExport.js +20 -10
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +8 -1
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/legacy/hooks/features/columns/useGridColumns.js +13 -8
- package/legacy/hooks/features/dimensions/useGridDimensions.js +27 -15
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
- package/legacy/hooks/features/export/utils.js +9 -2
- package/legacy/hooks/features/filter/gridFilterUtils.js +6 -0
- package/legacy/hooks/features/filter/useGridFilter.js +30 -5
- package/legacy/hooks/features/pagination/useGridPage.js +4 -3
- package/legacy/hooks/features/pagination/useGridPageSize.js +4 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/legacy/hooks/features/rows/useGridRows.js +1 -1
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/legacy/hooks/features/selection/useGridSelection.js +26 -12
- package/legacy/hooks/features/sorting/gridSortingUtils.js +11 -12
- package/legacy/hooks/features/sorting/useGridSorting.js +34 -6
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +2 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +22 -12
- package/legacy/hooks/utils/useGridApiContext.js +1 -1
- package/legacy/hooks/utils/useGridNativeEventListener.js +1 -1
- package/legacy/hooks/utils/useGridRootProps.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +2 -2
- package/legacy/locales/arSD.js +7 -0
- package/legacy/locales/bgBG.js +7 -0
- package/legacy/locales/csCZ.js +7 -0
- package/legacy/locales/daDK.js +7 -0
- package/legacy/locales/deDE.js +12 -5
- package/legacy/locales/elGR.js +7 -0
- package/legacy/locales/esES.js +7 -0
- package/legacy/locales/faIR.js +7 -0
- package/legacy/locales/fiFI.js +7 -0
- package/legacy/locales/frFR.js +17 -10
- package/legacy/locales/heIL.js +8 -1
- package/legacy/locales/huHU.js +7 -0
- package/legacy/locales/index.js +4 -1
- package/legacy/locales/itIT.js +7 -0
- package/legacy/locales/jaJP.js +8 -1
- package/legacy/locales/koKR.js +7 -0
- package/legacy/locales/nbNO.js +8 -1
- package/legacy/locales/nlNL.js +21 -14
- package/legacy/locales/plPL.js +7 -0
- package/legacy/locales/ptBR.js +17 -10
- package/legacy/locales/roRO.js +135 -0
- package/legacy/locales/ruRU.js +7 -0
- package/legacy/locales/skSK.js +22 -15
- package/legacy/locales/svSE.js +8 -1
- package/legacy/locales/trTR.js +7 -0
- package/legacy/locales/ukUA.js +7 -0
- package/legacy/locales/viVN.js +7 -0
- package/legacy/locales/zhCN.js +7 -0
- package/legacy/locales/zhTW.js +135 -0
- package/legacy/models/events/gridEvents.js +1 -0
- package/legacy/utils/keyboardUtils.js +4 -3
- package/locales/arSD.js +7 -0
- package/locales/bgBG.js +7 -0
- package/locales/csCZ.js +7 -0
- package/locales/daDK.js +7 -0
- package/locales/deDE.js +12 -5
- package/locales/elGR.js +7 -0
- package/locales/esES.js +7 -0
- package/locales/faIR.js +7 -0
- package/locales/fiFI.js +7 -0
- package/locales/frFR.js +17 -10
- package/locales/heIL.js +8 -1
- package/locales/huHU.js +7 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +4 -1
- package/locales/itIT.js +7 -0
- package/locales/jaJP.js +8 -1
- package/locales/koKR.js +7 -0
- package/locales/nbNO.js +8 -1
- package/locales/nlNL.js +21 -14
- package/locales/plPL.js +7 -0
- package/locales/ptBR.js +17 -10
- package/locales/roRO.d.ts +2 -0
- package/locales/roRO.js +123 -0
- package/locales/ruRU.js +7 -0
- package/locales/skSK.js +22 -15
- package/locales/svSE.js +8 -1
- package/locales/trTR.js +7 -0
- package/locales/ukUA.js +7 -0
- package/locales/viVN.js +7 -0
- package/locales/zhCN.js +7 -0
- package/locales/zhTW.d.ts +2 -0
- package/locales/zhTW.js +123 -0
- package/models/api/gridColumnSpanning.d.ts +2 -0
- package/models/api/gridLocaleTextApi.d.ts +8 -2
- package/models/api/gridSelectionApi.d.ts +6 -0
- package/models/events/gridEvents.d.ts +1 -0
- package/models/events/gridEvents.js +1 -0
- package/models/gridFilterOperator.d.ts +6 -0
- package/models/gridRows.d.ts +10 -1
- package/models/params/gridCellParams.d.ts +4 -4
- package/modern/DataGrid/DataGrid.js +4 -4
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/colDef/gridActionsColDef.js +2 -0
- package/modern/colDef/gridBooleanColDef.js +3 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/modern/colDef/gridDateOperators.js +4 -2
- package/modern/colDef/gridNumericOperators.js +4 -2
- package/modern/colDef/gridStringColDef.js +6 -0
- package/modern/colDef/gridStringOperators.js +15 -8
- package/modern/components/GridRow.js +1 -1
- package/modern/components/base/GridOverlays.js +4 -1
- package/modern/components/cell/GridBooleanCell.js +93 -2
- package/modern/components/cell/GridEditDateCell.js +5 -1
- package/modern/components/cell/index.js +1 -0
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/modern/components/containers/GridRootStyles.js +10 -0
- package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +20 -8
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/modern/components/toolbar/GridToolbarExport.js +20 -10
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +8 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/modern/hooks/features/columns/useGridColumns.js +10 -5
- package/modern/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/modern/hooks/features/export/utils.js +5 -2
- package/modern/hooks/features/filter/gridFilterUtils.js +6 -0
- package/modern/hooks/features/filter/useGridFilter.js +25 -4
- package/modern/hooks/features/pagination/useGridPage.js +4 -3
- package/modern/hooks/features/pagination/useGridPageSize.js +4 -3
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +8 -4
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/modern/hooks/features/selection/useGridSelection.js +22 -10
- package/modern/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/modern/hooks/features/sorting/useGridSorting.js +30 -6
- package/modern/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +13 -7
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridNativeEventListener.js +1 -1
- package/modern/hooks/utils/useGridRootProps.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/locales/arSD.js +7 -0
- package/modern/locales/bgBG.js +7 -0
- package/modern/locales/csCZ.js +7 -0
- package/modern/locales/daDK.js +7 -0
- package/modern/locales/deDE.js +12 -5
- package/modern/locales/elGR.js +7 -0
- package/modern/locales/esES.js +7 -0
- package/modern/locales/faIR.js +7 -0
- package/modern/locales/fiFI.js +7 -0
- package/modern/locales/frFR.js +17 -10
- package/modern/locales/heIL.js +8 -1
- package/modern/locales/huHU.js +7 -0
- package/modern/locales/index.js +4 -1
- package/modern/locales/itIT.js +7 -0
- package/modern/locales/jaJP.js +8 -1
- package/modern/locales/koKR.js +7 -0
- package/modern/locales/nbNO.js +8 -1
- package/modern/locales/nlNL.js +21 -14
- package/modern/locales/plPL.js +7 -0
- package/modern/locales/ptBR.js +17 -10
- package/modern/locales/roRO.js +123 -0
- package/modern/locales/ruRU.js +7 -0
- package/modern/locales/skSK.js +22 -15
- package/modern/locales/svSE.js +8 -1
- package/modern/locales/trTR.js +7 -0
- package/modern/locales/ukUA.js +7 -0
- package/modern/locales/viVN.js +7 -0
- package/modern/locales/zhCN.js +7 -0
- package/modern/locales/zhTW.js +123 -0
- package/modern/models/events/gridEvents.js +1 -0
- package/modern/utils/keyboardUtils.js +4 -3
- package/node/DataGrid/DataGrid.js +4 -4
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/colDef/gridActionsColDef.js +2 -0
- package/node/colDef/gridBooleanColDef.js +3 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +2 -0
- package/node/colDef/gridDateOperators.js +4 -2
- package/node/colDef/gridNumericOperators.js +4 -2
- package/node/colDef/gridStringColDef.js +5 -0
- package/node/colDef/gridStringOperators.js +15 -8
- package/node/components/GridRow.js +1 -1
- package/node/components/base/GridOverlays.js +4 -1
- package/node/components/cell/GridBooleanCell.js +93 -2
- package/node/components/cell/GridEditDateCell.js +7 -1
- package/node/components/cell/index.js +13 -0
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -1
- package/node/components/containers/GridRootStyles.js +10 -0
- package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +31 -15
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/node/components/toolbar/GridToolbarExport.js +16 -10
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +8 -1
- package/node/hooks/features/columns/useGridColumnSpanning.js +9 -7
- package/node/hooks/features/columns/useGridColumns.js +13 -6
- package/node/hooks/features/dimensions/useGridDimensions.js +28 -15
- package/node/hooks/features/editRows/useGridCellEditing.new.js +7 -1
- package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.new.js +7 -1
- package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/node/hooks/features/export/utils.js +10 -2
- package/node/hooks/features/filter/gridFilterUtils.js +7 -0
- package/node/hooks/features/filter/useGridFilter.js +30 -5
- package/node/hooks/features/pagination/useGridPage.js +4 -3
- package/node/hooks/features/pagination/useGridPageSize.js +4 -3
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +12 -4
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/node/hooks/features/selection/useGridSelection.js +24 -10
- package/node/hooks/features/sorting/gridSortingUtils.js +10 -11
- package/node/hooks/features/sorting/useGridSorting.js +34 -6
- package/node/hooks/features/statePersistence/useGridStatePersistence.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +18 -0
- package/node/locales/arSD.js +7 -0
- package/node/locales/bgBG.js +7 -0
- package/node/locales/csCZ.js +7 -0
- package/node/locales/daDK.js +7 -0
- package/node/locales/deDE.js +12 -5
- package/node/locales/elGR.js +7 -0
- package/node/locales/esES.js +7 -0
- package/node/locales/faIR.js +7 -0
- package/node/locales/fiFI.js +7 -0
- package/node/locales/frFR.js +17 -10
- package/node/locales/heIL.js +8 -1
- package/node/locales/huHU.js +7 -0
- package/node/locales/index.js +39 -0
- package/node/locales/itIT.js +7 -0
- package/node/locales/jaJP.js +8 -1
- package/node/locales/koKR.js +7 -0
- package/node/locales/nbNO.js +8 -1
- package/node/locales/nlNL.js +21 -14
- package/node/locales/plPL.js +7 -0
- package/node/locales/ptBR.js +17 -10
- package/node/locales/roRO.js +133 -0
- package/node/locales/ruRU.js +7 -0
- package/node/locales/skSK.js +22 -15
- package/node/locales/svSE.js +8 -1
- package/node/locales/trTR.js +7 -0
- package/node/locales/ukUA.js +7 -0
- package/node/locales/viVN.js +7 -0
- package/node/locales/zhCN.js +7 -0
- package/node/locales/zhTW.js +133 -0
- package/node/models/events/gridEvents.js +1 -0
- package/node/utils/keyboardUtils.js +4 -3
- package/package.json +3 -3
- package/utils/getGridLocalization.d.ts +1 -1
- package/utils/keyboardUtils.js +4 -3
|
@@ -153,7 +153,8 @@ export const getGridNumericOperators = () => [{
|
|
|
153
153
|
}) => {
|
|
154
154
|
return value == null;
|
|
155
155
|
};
|
|
156
|
-
}
|
|
156
|
+
},
|
|
157
|
+
requiresFilterValue: false
|
|
157
158
|
}, {
|
|
158
159
|
value: 'isNotEmpty',
|
|
159
160
|
getApplyFilterFn: () => {
|
|
@@ -162,7 +163,8 @@ export const getGridNumericOperators = () => [{
|
|
|
162
163
|
}) => {
|
|
163
164
|
return value != null;
|
|
164
165
|
};
|
|
165
|
-
}
|
|
166
|
+
},
|
|
167
|
+
requiresFilterValue: false
|
|
166
168
|
}, {
|
|
167
169
|
value: 'isAnyOf',
|
|
168
170
|
getApplyFilterFn: filterItem => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { renderEditInputCell } from '../components/cell/GridEditInputCell';
|
|
2
2
|
import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
|
|
3
3
|
import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Move pro and premium properties outside of this Community file
|
|
6
|
+
*/
|
|
7
|
+
|
|
4
8
|
export const GRID_STRING_COL_DEF = {
|
|
5
9
|
width: 100,
|
|
6
10
|
minWidth: 50,
|
|
@@ -12,6 +16,8 @@ export const GRID_STRING_COL_DEF = {
|
|
|
12
16
|
filterable: true,
|
|
13
17
|
groupable: true,
|
|
14
18
|
pinnable: true,
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
private_aggregable: true,
|
|
15
21
|
editable: false,
|
|
16
22
|
sortComparator: gridStringOrNumberComparator,
|
|
17
23
|
type: 'string',
|
|
@@ -13,14 +13,15 @@ export const getGridStringQuickFilterFn = value => {
|
|
|
13
13
|
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export const getGridStringOperators = () => [{
|
|
16
|
+
export const getGridStringOperators = (disableTrim = false) => [{
|
|
17
17
|
value: 'contains',
|
|
18
18
|
getApplyFilterFn: filterItem => {
|
|
19
19
|
if (!filterItem.value) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
24
|
+
const filterRegex = new RegExp(escapeRegExp(filterItemValue), 'i');
|
|
24
25
|
return ({
|
|
25
26
|
value
|
|
26
27
|
}) => {
|
|
@@ -35,6 +36,7 @@ export const getGridStringOperators = () => [{
|
|
|
35
36
|
return null;
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
38
40
|
const collator = new Intl.Collator(undefined, {
|
|
39
41
|
sensitivity: 'base',
|
|
40
42
|
usage: 'search'
|
|
@@ -42,7 +44,7 @@ export const getGridStringOperators = () => [{
|
|
|
42
44
|
return ({
|
|
43
45
|
value
|
|
44
46
|
}) => {
|
|
45
|
-
return value != null ? collator.compare(
|
|
47
|
+
return value != null ? collator.compare(filterItemValue, value.toString()) === 0 : false;
|
|
46
48
|
};
|
|
47
49
|
},
|
|
48
50
|
InputComponent: GridFilterInputValue
|
|
@@ -53,7 +55,8 @@ export const getGridStringOperators = () => [{
|
|
|
53
55
|
return null;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
const
|
|
58
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
59
|
+
const filterRegex = new RegExp(`^${escapeRegExp(filterItemValue)}.*$`, 'i');
|
|
57
60
|
return ({
|
|
58
61
|
value
|
|
59
62
|
}) => {
|
|
@@ -68,7 +71,8 @@ export const getGridStringOperators = () => [{
|
|
|
68
71
|
return null;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
const
|
|
74
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
75
|
+
const filterRegex = new RegExp(`.*${escapeRegExp(filterItemValue)}$`, 'i');
|
|
72
76
|
return ({
|
|
73
77
|
value
|
|
74
78
|
}) => {
|
|
@@ -84,7 +88,8 @@ export const getGridStringOperators = () => [{
|
|
|
84
88
|
}) => {
|
|
85
89
|
return value === '' || value == null;
|
|
86
90
|
};
|
|
87
|
-
}
|
|
91
|
+
},
|
|
92
|
+
requiresFilterValue: false
|
|
88
93
|
}, {
|
|
89
94
|
value: 'isNotEmpty',
|
|
90
95
|
getApplyFilterFn: () => {
|
|
@@ -93,7 +98,8 @@ export const getGridStringOperators = () => [{
|
|
|
93
98
|
}) => {
|
|
94
99
|
return value !== '' && value != null;
|
|
95
100
|
};
|
|
96
|
-
}
|
|
101
|
+
},
|
|
102
|
+
requiresFilterValue: false
|
|
97
103
|
}, {
|
|
98
104
|
value: 'isAnyOf',
|
|
99
105
|
getApplyFilterFn: filterItem => {
|
|
@@ -101,13 +107,14 @@ export const getGridStringOperators = () => [{
|
|
|
101
107
|
return null;
|
|
102
108
|
}
|
|
103
109
|
|
|
110
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
|
|
104
111
|
const collator = new Intl.Collator(undefined, {
|
|
105
112
|
sensitivity: 'base',
|
|
106
113
|
usage: 'search'
|
|
107
114
|
});
|
|
108
115
|
return ({
|
|
109
116
|
value
|
|
110
|
-
}) => value != null ?
|
|
117
|
+
}) => value != null ? filterItemValue.some(filterValue => {
|
|
111
118
|
return collator.compare(filterValue, value.toString() || '') === 0;
|
|
112
119
|
}) : false;
|
|
113
120
|
},
|
|
@@ -110,7 +110,7 @@ function GridRow(props) {
|
|
|
110
110
|
// Fallback for IE
|
|
111
111
|
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
112
112
|
}
|
|
113
|
-
});
|
|
113
|
+
}, [apiRef, rowHeight, rowId]);
|
|
114
114
|
React.useLayoutEffect(() => {
|
|
115
115
|
if (currentPage.range) {
|
|
116
116
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -36,7 +36,10 @@ function GridOverlayWrapper(props) {
|
|
|
36
36
|
width: viewportInnerSize?.width ?? 0,
|
|
37
37
|
position: 'absolute',
|
|
38
38
|
top: headerHeight,
|
|
39
|
-
bottom: height === 'auto' ? 0 : undefined
|
|
39
|
+
bottom: height === 'auto' ? 0 : undefined,
|
|
40
|
+
zIndex: 3,
|
|
41
|
+
// should be above pinned columns and detail panel
|
|
42
|
+
pointerEvents: 'none'
|
|
40
43
|
}
|
|
41
44
|
}, props));
|
|
42
45
|
}
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "hasFocus", "tabIndex", "getValue"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
7
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
7
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -18,7 +19,7 @@ const useUtilityClasses = ownerState => {
|
|
|
18
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const GridBooleanCellRaw = props => {
|
|
22
23
|
const {
|
|
23
24
|
value
|
|
24
25
|
} = props,
|
|
@@ -37,7 +38,97 @@ export const GridBooleanCell = /*#__PURE__*/React.memo(props => {
|
|
|
37
38
|
titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
|
|
38
39
|
"data-value": Boolean(value)
|
|
39
40
|
}, other));
|
|
40
|
-
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
44
|
+
// ----------------------------- Warning --------------------------------
|
|
45
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
46
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
47
|
+
// ----------------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* GridApi that let you manipulate the grid.
|
|
51
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
52
|
+
*/
|
|
53
|
+
api: PropTypes.any.isRequired,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The mode of the cell.
|
|
57
|
+
*/
|
|
58
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The column of the row that the current cell belongs to.
|
|
62
|
+
*/
|
|
63
|
+
colDef: PropTypes.object.isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The column field of the cell that triggered the event.
|
|
67
|
+
*/
|
|
68
|
+
field: PropTypes.string.isRequired,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A ref allowing to set imperative focus.
|
|
72
|
+
* It can be passed to the element that should receive focus.
|
|
73
|
+
* @ignore - do not document.
|
|
74
|
+
*/
|
|
75
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
76
|
+
current: PropTypes.shape({
|
|
77
|
+
focus: PropTypes.func.isRequired
|
|
78
|
+
})
|
|
79
|
+
})]),
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The cell value formatted with the column valueFormatter.
|
|
83
|
+
*/
|
|
84
|
+
formattedValue: PropTypes.any,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get the cell value of a row and field.
|
|
88
|
+
* @param {GridRowId} id The row id.
|
|
89
|
+
* @param {string} field The field.
|
|
90
|
+
* @returns {any} The cell value.
|
|
91
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
92
|
+
*/
|
|
93
|
+
getValue: PropTypes.func.isRequired,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* If true, the cell is the active element.
|
|
97
|
+
*/
|
|
98
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The grid row id.
|
|
102
|
+
*/
|
|
103
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* If true, the cell is editable.
|
|
107
|
+
*/
|
|
108
|
+
isEditable: PropTypes.bool,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The row model of the row that the current cell belongs to.
|
|
112
|
+
*/
|
|
113
|
+
row: PropTypes.object.isRequired,
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The node of the row that the current cell belongs to.
|
|
117
|
+
*/
|
|
118
|
+
rowNode: PropTypes.object.isRequired,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* the tabIndex value.
|
|
122
|
+
*/
|
|
123
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
127
|
+
*/
|
|
128
|
+
value: PropTypes.any
|
|
129
|
+
} : void 0;
|
|
130
|
+
const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
131
|
+
export { GridBooleanCell };
|
|
41
132
|
export const renderBooleanCell = params => {
|
|
42
133
|
if (params.rowNode.isAutoGenerated) {
|
|
43
134
|
return '';
|
|
@@ -6,10 +6,14 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
7
7
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
8
8
|
import InputBase from '@mui/material/InputBase';
|
|
9
|
+
import { styled } from '@mui/material/styles';
|
|
9
10
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const StyledInputBase = styled(InputBase)({
|
|
15
|
+
fontSize: 'inherit'
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
const useUtilityClasses = ownerState => {
|
|
15
19
|
const {
|
|
@@ -114,7 +118,7 @@ function GridEditDateCell(props) {
|
|
|
114
118
|
inputRef.current.focus();
|
|
115
119
|
}
|
|
116
120
|
}, [hasFocus]);
|
|
117
|
-
return /*#__PURE__*/_jsx(
|
|
121
|
+
return /*#__PURE__*/_jsx(StyledInputBase, _extends({
|
|
118
122
|
inputRef: inputRef,
|
|
119
123
|
fullWidth: true,
|
|
120
124
|
className: classes.root,
|
|
@@ -26,6 +26,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
26
26
|
field,
|
|
27
27
|
id,
|
|
28
28
|
value: isChecked,
|
|
29
|
+
rowNode,
|
|
29
30
|
hasFocus,
|
|
30
31
|
tabIndex
|
|
31
32
|
} = props,
|
|
@@ -73,7 +74,12 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
73
74
|
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
74
75
|
}
|
|
75
76
|
}, [apiRef, props]);
|
|
76
|
-
|
|
77
|
+
|
|
78
|
+
if (rowNode.position === 'footer') {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
77
83
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
78
84
|
return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
|
|
79
85
|
ref: handleRef,
|
|
@@ -6,6 +6,16 @@ export const GridRootStyles = styled('div', {
|
|
|
6
6
|
slot: 'Root',
|
|
7
7
|
overridesResolver: (props, styles) => [{
|
|
8
8
|
[`&.${gridClasses.autoHeight}`]: styles.autoHeight
|
|
9
|
+
}, {
|
|
10
|
+
[`&.${gridClasses.aggregationColumnHeader}`]: styles.aggregationColumnHeader
|
|
11
|
+
}, {
|
|
12
|
+
[`&.${gridClasses['aggregationColumnHeader--alignLeft']}`]: styles['aggregationColumnHeader--alignLeft']
|
|
13
|
+
}, {
|
|
14
|
+
[`&.${gridClasses['aggregationColumnHeader--alignCenter']}`]: styles['aggregationColumnHeader--alignCenter']
|
|
15
|
+
}, {
|
|
16
|
+
[`&.${gridClasses['aggregationColumnHeader--alignRight']}`]: styles['aggregationColumnHeader--alignRight']
|
|
17
|
+
}, {
|
|
18
|
+
[`&.${gridClasses.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel
|
|
9
19
|
}, {
|
|
10
20
|
[`& .${gridClasses.editBooleanCell}`]: styles.editBooleanCell
|
|
11
21
|
}, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"]
|
|
3
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"],
|
|
4
|
+
_excluded2 = ["InputComponentProps"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
@@ -143,6 +144,12 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
143
144
|
const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
|
|
144
145
|
const isBaseSelectNative = baseSelectProps.native ?? true;
|
|
145
146
|
const OptionComponent = isBaseSelectNative ? 'option' : MenuItem;
|
|
147
|
+
|
|
148
|
+
const {
|
|
149
|
+
InputComponentProps
|
|
150
|
+
} = valueInputProps,
|
|
151
|
+
valueInputPropsOther = _objectWithoutPropertiesLoose(valueInputProps, _excluded2);
|
|
152
|
+
|
|
146
153
|
const sortedFilterableColumns = React.useMemo(() => {
|
|
147
154
|
switch (columnsSort) {
|
|
148
155
|
case 'asc':
|
|
@@ -309,14 +316,14 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
309
316
|
})), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
|
|
310
317
|
variant: "standard",
|
|
311
318
|
as: rootProps.components.BaseFormControl
|
|
312
|
-
}, baseFormControlProps,
|
|
313
|
-
className: clsx(classes.valueInput, baseFormControlProps.className,
|
|
319
|
+
}, baseFormControlProps, valueInputPropsOther, {
|
|
320
|
+
className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
|
|
314
321
|
children: currentOperator?.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({
|
|
315
322
|
apiRef: apiRef,
|
|
316
323
|
item: item,
|
|
317
324
|
applyValue: applyFilterChanges,
|
|
318
325
|
focusElementRef: valueRef
|
|
319
|
-
}, currentOperator.InputComponentProps)) : null
|
|
326
|
+
}, currentOperator.InputComponentProps, InputComponentProps)) : null
|
|
320
327
|
}))]
|
|
321
328
|
}));
|
|
322
329
|
});
|
|
@@ -34,8 +34,8 @@ export function GridFilterInputBoolean(props) {
|
|
|
34
34
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
35
35
|
value: filterValueState,
|
|
36
36
|
onChange: onFilterChange,
|
|
37
|
-
variant: "standard",
|
|
38
37
|
select: true,
|
|
38
|
+
variant: "standard",
|
|
39
39
|
SelectProps: _extends({
|
|
40
40
|
native: isSelectNative,
|
|
41
41
|
displayEmpty: true
|
|
@@ -52,8 +52,8 @@ function GridFilterInputDate(props) {
|
|
|
52
52
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
53
53
|
value: filterValueState,
|
|
54
54
|
onChange: onFilterChange,
|
|
55
|
-
type: type || 'text',
|
|
56
55
|
variant: "standard",
|
|
56
|
+
type: type || 'text',
|
|
57
57
|
InputLabelProps: {
|
|
58
58
|
shrink: true
|
|
59
59
|
},
|
|
@@ -73,7 +73,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
73
73
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
74
74
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
75
75
|
// ----------------------------------------------------------------------
|
|
76
|
-
apiRef: PropTypes.
|
|
76
|
+
apiRef: PropTypes.shape({
|
|
77
|
+
current: PropTypes.object.isRequired
|
|
78
|
+
}).isRequired,
|
|
77
79
|
applyValue: PropTypes.func.isRequired,
|
|
78
80
|
focusElementRef: PropTypes
|
|
79
81
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
7
7
|
import Chip from '@mui/material/Chip';
|
|
8
|
-
import TextField from '@mui/material/TextField';
|
|
9
8
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
10
9
|
import { getValueFromOption } from './filterPanelUtils';
|
|
10
|
+
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
|
|
13
13
|
const isOptionEqualToValue = (option, value) => getValueFromOption(option) === getValueFromOption(value);
|
|
@@ -19,11 +19,24 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
19
19
|
item,
|
|
20
20
|
applyValue,
|
|
21
21
|
apiRef,
|
|
22
|
-
focusElementRef
|
|
22
|
+
focusElementRef,
|
|
23
|
+
color,
|
|
24
|
+
error,
|
|
25
|
+
helperText,
|
|
26
|
+
size,
|
|
27
|
+
variant = 'standard'
|
|
23
28
|
} = props,
|
|
24
29
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
25
30
|
|
|
31
|
+
const TextFieldProps = {
|
|
32
|
+
color,
|
|
33
|
+
error,
|
|
34
|
+
helperText,
|
|
35
|
+
size,
|
|
36
|
+
variant
|
|
37
|
+
};
|
|
26
38
|
const id = useId();
|
|
39
|
+
const rootProps = useGridRootProps();
|
|
27
40
|
const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
28
41
|
const resolvedValueOptions = React.useMemo(() => {
|
|
29
42
|
if (!resolvedColumn?.valueOptions) {
|
|
@@ -67,7 +80,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
67
80
|
|
|
68
81
|
if (resolvedValueOptions !== undefined) {
|
|
69
82
|
const itemValueIndexes = item.value.map(element => {
|
|
70
|
-
// get the index matching between values and
|
|
83
|
+
// get the index matching between values and valueOptions
|
|
71
84
|
const formattedElement = getValueFromOption(element);
|
|
72
85
|
const index = resolvedFormattedValueOptions?.findIndex(formatedOption => formatedOption === formattedElement) || 0;
|
|
73
86
|
return index;
|
|
@@ -106,16 +119,15 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
106
119
|
}, getTagProps({
|
|
107
120
|
index
|
|
108
121
|
})))),
|
|
109
|
-
renderInput: params => /*#__PURE__*/_jsx(
|
|
122
|
+
renderInput: params => /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
|
|
110
123
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
111
124
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
112
125
|
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
113
126
|
shrink: true
|
|
114
127
|
}),
|
|
115
128
|
inputRef: focusElementRef,
|
|
116
|
-
type:
|
|
117
|
-
|
|
118
|
-
}))
|
|
129
|
+
type: "singleSelect"
|
|
130
|
+
}, TextFieldProps, rootProps.componentsProps?.baseTextField))
|
|
119
131
|
}, other));
|
|
120
132
|
}
|
|
121
133
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
7
7
|
import Chip from '@mui/material/Chip';
|
|
8
|
-
import TextField from '@mui/material/TextField';
|
|
9
8
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
9
|
+
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
function GridFilterInputMultipleValue(props) {
|
|
@@ -15,12 +15,25 @@ function GridFilterInputMultipleValue(props) {
|
|
|
15
15
|
applyValue,
|
|
16
16
|
type,
|
|
17
17
|
apiRef,
|
|
18
|
-
focusElementRef
|
|
18
|
+
focusElementRef,
|
|
19
|
+
color,
|
|
20
|
+
error,
|
|
21
|
+
helperText,
|
|
22
|
+
size,
|
|
23
|
+
variant
|
|
19
24
|
} = props,
|
|
20
25
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
26
|
|
|
27
|
+
const TextFieldProps = {
|
|
28
|
+
color,
|
|
29
|
+
error,
|
|
30
|
+
helperText,
|
|
31
|
+
size,
|
|
32
|
+
variant
|
|
33
|
+
};
|
|
22
34
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
23
35
|
const id = useId();
|
|
36
|
+
const rootProps = useGridRootProps();
|
|
24
37
|
React.useEffect(() => {
|
|
25
38
|
const itemValue = item.value ?? [];
|
|
26
39
|
setFilterValueState(itemValue.map(String));
|
|
@@ -52,16 +65,15 @@ function GridFilterInputMultipleValue(props) {
|
|
|
52
65
|
}, getTagProps({
|
|
53
66
|
index
|
|
54
67
|
})))),
|
|
55
|
-
renderInput: params => /*#__PURE__*/_jsx(
|
|
68
|
+
renderInput: params => /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
|
|
56
69
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
57
70
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
58
71
|
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
59
72
|
shrink: true
|
|
60
73
|
}),
|
|
61
74
|
inputRef: focusElementRef,
|
|
62
|
-
type: type || 'text'
|
|
63
|
-
|
|
64
|
-
}))
|
|
75
|
+
type: type || 'text'
|
|
76
|
+
}, TextFieldProps, rootProps.componentsProps?.baseTextField))
|
|
65
77
|
}, other));
|
|
66
78
|
}
|
|
67
79
|
|
|
@@ -70,7 +82,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
|
|
|
70
82
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
83
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
72
84
|
// ----------------------------------------------------------------------
|
|
73
|
-
apiRef: PropTypes.
|
|
85
|
+
apiRef: PropTypes.shape({
|
|
86
|
+
current: PropTypes.object.isRequired
|
|
87
|
+
}).isRequired,
|
|
74
88
|
applyValue: PropTypes.func.isRequired,
|
|
75
89
|
focusElementRef: PropTypes
|
|
76
90
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -51,6 +51,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
51
51
|
const isSelectNative = baseSelectProps.native ?? true;
|
|
52
52
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
53
53
|
const currentValueOptions = React.useMemo(() => {
|
|
54
|
+
if (currentColumn === null) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
55
59
|
field: currentColumn.field
|
|
56
60
|
}) : currentColumn.valueOptions;
|
|
@@ -90,8 +94,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
90
94
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
91
95
|
value: filterValueState,
|
|
92
96
|
onChange: onFilterChange,
|
|
93
|
-
type: type || 'text',
|
|
94
97
|
variant: "standard",
|
|
98
|
+
type: type || 'text',
|
|
95
99
|
InputLabelProps: {
|
|
96
100
|
shrink: true
|
|
97
101
|
},
|
|
@@ -110,7 +114,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
110
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
111
115
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
112
116
|
// ----------------------------------------------------------------------
|
|
113
|
-
apiRef: PropTypes.
|
|
117
|
+
apiRef: PropTypes.shape({
|
|
118
|
+
current: PropTypes.object.isRequired
|
|
119
|
+
}).isRequired,
|
|
114
120
|
applyValue: PropTypes.func.isRequired,
|
|
115
121
|
focusElementRef: PropTypes
|
|
116
122
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -111,8 +111,8 @@ function GridFilterInputValue(props) {
|
|
|
111
111
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
112
112
|
value: filterValueState,
|
|
113
113
|
onChange: onFilterChange,
|
|
114
|
-
type: type || 'text',
|
|
115
114
|
variant: "standard",
|
|
115
|
+
type: type || 'text',
|
|
116
116
|
InputProps: InputProps,
|
|
117
117
|
InputLabelProps: {
|
|
118
118
|
shrink: true
|
|
@@ -126,7 +126,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
126
126
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
127
127
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
128
128
|
// ----------------------------------------------------------------------
|
|
129
|
-
apiRef: PropTypes.
|
|
129
|
+
apiRef: PropTypes.shape({
|
|
130
|
+
current: PropTypes.object.isRequired
|
|
131
|
+
}).isRequired,
|
|
130
132
|
applyValue: PropTypes.func.isRequired,
|
|
131
133
|
focusElementRef: PropTypes
|
|
132
134
|
/* @typescript-to-proptypes-ignore */
|