@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
|
@@ -26,14 +26,15 @@ const getGridStringQuickFilterFn = value => {
|
|
|
26
26
|
|
|
27
27
|
exports.getGridStringQuickFilterFn = getGridStringQuickFilterFn;
|
|
28
28
|
|
|
29
|
-
const getGridStringOperators = () => [{
|
|
29
|
+
const getGridStringOperators = (disableTrim = false) => [{
|
|
30
30
|
value: 'contains',
|
|
31
31
|
getApplyFilterFn: filterItem => {
|
|
32
32
|
if (!filterItem.value) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
37
|
+
const filterRegex = new RegExp((0, _utils.escapeRegExp)(filterItemValue), 'i');
|
|
37
38
|
return ({
|
|
38
39
|
value
|
|
39
40
|
}) => {
|
|
@@ -48,6 +49,7 @@ const getGridStringOperators = () => [{
|
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
51
53
|
const collator = new Intl.Collator(undefined, {
|
|
52
54
|
sensitivity: 'base',
|
|
53
55
|
usage: 'search'
|
|
@@ -55,7 +57,7 @@ const getGridStringOperators = () => [{
|
|
|
55
57
|
return ({
|
|
56
58
|
value
|
|
57
59
|
}) => {
|
|
58
|
-
return value != null ? collator.compare(
|
|
60
|
+
return value != null ? collator.compare(filterItemValue, value.toString()) === 0 : false;
|
|
59
61
|
};
|
|
60
62
|
},
|
|
61
63
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
@@ -66,7 +68,8 @@ const getGridStringOperators = () => [{
|
|
|
66
68
|
return null;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
const
|
|
71
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
72
|
+
const filterRegex = new RegExp(`^${(0, _utils.escapeRegExp)(filterItemValue)}.*$`, 'i');
|
|
70
73
|
return ({
|
|
71
74
|
value
|
|
72
75
|
}) => {
|
|
@@ -81,7 +84,8 @@ const getGridStringOperators = () => [{
|
|
|
81
84
|
return null;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
const
|
|
87
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
88
|
+
const filterRegex = new RegExp(`.*${(0, _utils.escapeRegExp)(filterItemValue)}$`, 'i');
|
|
85
89
|
return ({
|
|
86
90
|
value
|
|
87
91
|
}) => {
|
|
@@ -97,7 +101,8 @@ const getGridStringOperators = () => [{
|
|
|
97
101
|
}) => {
|
|
98
102
|
return value === '' || value == null;
|
|
99
103
|
};
|
|
100
|
-
}
|
|
104
|
+
},
|
|
105
|
+
requiresFilterValue: false
|
|
101
106
|
}, {
|
|
102
107
|
value: 'isNotEmpty',
|
|
103
108
|
getApplyFilterFn: () => {
|
|
@@ -106,7 +111,8 @@ const getGridStringOperators = () => [{
|
|
|
106
111
|
}) => {
|
|
107
112
|
return value !== '' && value != null;
|
|
108
113
|
};
|
|
109
|
-
}
|
|
114
|
+
},
|
|
115
|
+
requiresFilterValue: false
|
|
110
116
|
}, {
|
|
111
117
|
value: 'isAnyOf',
|
|
112
118
|
getApplyFilterFn: filterItem => {
|
|
@@ -114,13 +120,14 @@ const getGridStringOperators = () => [{
|
|
|
114
120
|
return null;
|
|
115
121
|
}
|
|
116
122
|
|
|
123
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
|
|
117
124
|
const collator = new Intl.Collator(undefined, {
|
|
118
125
|
sensitivity: 'base',
|
|
119
126
|
usage: 'search'
|
|
120
127
|
});
|
|
121
128
|
return ({
|
|
122
129
|
value
|
|
123
|
-
}) => value != null ?
|
|
130
|
+
}) => value != null ? filterItemValue.some(filterValue => {
|
|
124
131
|
return collator.compare(filterValue, value.toString() || '') === 0;
|
|
125
132
|
}) : false;
|
|
126
133
|
},
|
|
@@ -139,7 +139,7 @@ function GridRow(props) {
|
|
|
139
139
|
// Fallback for IE
|
|
140
140
|
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
141
141
|
}
|
|
142
|
-
});
|
|
142
|
+
}, [apiRef, rowHeight, rowId]);
|
|
143
143
|
React.useLayoutEffect(() => {
|
|
144
144
|
if (currentPage.range) {
|
|
145
145
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -66,7 +66,10 @@ function GridOverlayWrapper(props) {
|
|
|
66
66
|
width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0,
|
|
67
67
|
position: 'absolute',
|
|
68
68
|
top: headerHeight,
|
|
69
|
-
bottom: height === 'auto' ? 0 : undefined
|
|
69
|
+
bottom: height === 'auto' ? 0 : undefined,
|
|
70
|
+
zIndex: 3,
|
|
71
|
+
// should be above pinned columns and detail panel
|
|
72
|
+
pointerEvents: 'none'
|
|
70
73
|
}
|
|
71
74
|
}, props));
|
|
72
75
|
}
|
|
@@ -13,6 +13,8 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
13
13
|
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
16
18
|
var _material = require("@mui/material");
|
|
17
19
|
|
|
18
20
|
var _gridClasses = require("../../constants/gridClasses");
|
|
@@ -39,7 +41,7 @@ const useUtilityClasses = ownerState => {
|
|
|
39
41
|
return (0, _material.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
const
|
|
44
|
+
const GridBooleanCellRaw = props => {
|
|
43
45
|
const {
|
|
44
46
|
value
|
|
45
47
|
} = props,
|
|
@@ -57,7 +59,96 @@ const GridBooleanCell = /*#__PURE__*/React.memo(props => {
|
|
|
57
59
|
titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
|
|
58
60
|
"data-value": Boolean(value)
|
|
59
61
|
}, other));
|
|
60
|
-
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
65
|
+
// ----------------------------- Warning --------------------------------
|
|
66
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
67
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
68
|
+
// ----------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* GridApi that let you manipulate the grid.
|
|
72
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
73
|
+
*/
|
|
74
|
+
api: _propTypes.default.any.isRequired,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The mode of the cell.
|
|
78
|
+
*/
|
|
79
|
+
cellMode: _propTypes.default.oneOf(['edit', 'view']).isRequired,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The column of the row that the current cell belongs to.
|
|
83
|
+
*/
|
|
84
|
+
colDef: _propTypes.default.object.isRequired,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The column field of the cell that triggered the event.
|
|
88
|
+
*/
|
|
89
|
+
field: _propTypes.default.string.isRequired,
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* A ref allowing to set imperative focus.
|
|
93
|
+
* It can be passed to the element that should receive focus.
|
|
94
|
+
* @ignore - do not document.
|
|
95
|
+
*/
|
|
96
|
+
focusElementRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
97
|
+
current: _propTypes.default.shape({
|
|
98
|
+
focus: _propTypes.default.func.isRequired
|
|
99
|
+
})
|
|
100
|
+
})]),
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The cell value formatted with the column valueFormatter.
|
|
104
|
+
*/
|
|
105
|
+
formattedValue: _propTypes.default.any,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get the cell value of a row and field.
|
|
109
|
+
* @param {GridRowId} id The row id.
|
|
110
|
+
* @param {string} field The field.
|
|
111
|
+
* @returns {any} The cell value.
|
|
112
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
113
|
+
*/
|
|
114
|
+
getValue: _propTypes.default.func.isRequired,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* If true, the cell is the active element.
|
|
118
|
+
*/
|
|
119
|
+
hasFocus: _propTypes.default.bool.isRequired,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The grid row id.
|
|
123
|
+
*/
|
|
124
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* If true, the cell is editable.
|
|
128
|
+
*/
|
|
129
|
+
isEditable: _propTypes.default.bool,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The row model of the row that the current cell belongs to.
|
|
133
|
+
*/
|
|
134
|
+
row: _propTypes.default.object.isRequired,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The node of the row that the current cell belongs to.
|
|
138
|
+
*/
|
|
139
|
+
rowNode: _propTypes.default.object.isRequired,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* the tabIndex value.
|
|
143
|
+
*/
|
|
144
|
+
tabIndex: _propTypes.default.oneOf([-1, 0]).isRequired,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
148
|
+
*/
|
|
149
|
+
value: _propTypes.default.any
|
|
150
|
+
} : void 0;
|
|
151
|
+
const GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
61
152
|
exports.GridBooleanCell = GridBooleanCell;
|
|
62
153
|
|
|
63
154
|
const renderBooleanCell = params => {
|
|
@@ -22,6 +22,8 @@ var _utils = require("@mui/material/utils");
|
|
|
22
22
|
|
|
23
23
|
var _InputBase = _interopRequireDefault(require("@mui/material/InputBase"));
|
|
24
24
|
|
|
25
|
+
var _styles = require("@mui/material/styles");
|
|
26
|
+
|
|
25
27
|
var _gridClasses = require("../../constants/gridClasses");
|
|
26
28
|
|
|
27
29
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
@@ -36,6 +38,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
36
38
|
|
|
37
39
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
38
40
|
|
|
41
|
+
const StyledInputBase = (0, _styles.styled)(_InputBase.default)({
|
|
42
|
+
fontSize: 'inherit'
|
|
43
|
+
});
|
|
44
|
+
|
|
39
45
|
const useUtilityClasses = ownerState => {
|
|
40
46
|
const {
|
|
41
47
|
classes
|
|
@@ -140,7 +146,7 @@ function GridEditDateCell(props) {
|
|
|
140
146
|
inputRef.current.focus();
|
|
141
147
|
}
|
|
142
148
|
}, [hasFocus]);
|
|
143
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
149
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInputBase, (0, _extends2.default)({
|
|
144
150
|
inputRef: inputRef,
|
|
145
151
|
fullWidth: true,
|
|
146
152
|
className: classes.root,
|
|
@@ -17,6 +17,19 @@ Object.keys(_GridCell).forEach(function (key) {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
var _GridBooleanCell = require("./GridBooleanCell");
|
|
21
|
+
|
|
22
|
+
Object.keys(_GridBooleanCell).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _GridBooleanCell[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _GridBooleanCell[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
var _GridEditBooleanCell = require("./GridEditBooleanCell");
|
|
21
34
|
|
|
22
35
|
Object.keys(_GridEditBooleanCell).forEach(function (key) {
|
|
@@ -52,6 +52,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
52
52
|
field,
|
|
53
53
|
id,
|
|
54
54
|
value: isChecked,
|
|
55
|
+
rowNode,
|
|
55
56
|
hasFocus,
|
|
56
57
|
tabIndex
|
|
57
58
|
} = props,
|
|
@@ -100,7 +101,12 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
100
101
|
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
101
102
|
}
|
|
102
103
|
}, [apiRef, props]);
|
|
103
|
-
|
|
104
|
+
|
|
105
|
+
if (rowNode.position === 'footer') {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
104
110
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
105
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseCheckbox, (0, _extends2.default)({
|
|
106
112
|
ref: handleRef,
|
|
@@ -18,6 +18,16 @@ const GridRootStyles = (0, _styles.styled)('div', {
|
|
|
18
18
|
slot: 'Root',
|
|
19
19
|
overridesResolver: (props, styles) => [{
|
|
20
20
|
[`&.${_gridClasses.gridClasses.autoHeight}`]: styles.autoHeight
|
|
21
|
+
}, {
|
|
22
|
+
[`&.${_gridClasses.gridClasses.aggregationColumnHeader}`]: styles.aggregationColumnHeader
|
|
23
|
+
}, {
|
|
24
|
+
[`&.${_gridClasses.gridClasses['aggregationColumnHeader--alignLeft']}`]: styles['aggregationColumnHeader--alignLeft']
|
|
25
|
+
}, {
|
|
26
|
+
[`&.${_gridClasses.gridClasses['aggregationColumnHeader--alignCenter']}`]: styles['aggregationColumnHeader--alignCenter']
|
|
27
|
+
}, {
|
|
28
|
+
[`&.${_gridClasses.gridClasses['aggregationColumnHeader--alignRight']}`]: styles['aggregationColumnHeader--alignRight']
|
|
29
|
+
}, {
|
|
30
|
+
[`&.${_gridClasses.gridClasses.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel
|
|
21
31
|
}, {
|
|
22
32
|
[`& .${_gridClasses.gridClasses.editBooleanCell}`]: styles.editBooleanCell
|
|
23
33
|
}, {
|
|
@@ -45,7 +45,8 @@ var _gridClasses = require("../../../constants/gridClasses");
|
|
|
45
45
|
|
|
46
46
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
47
47
|
|
|
48
|
-
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"]
|
|
48
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"],
|
|
49
|
+
_excluded2 = ["InputComponentProps"];
|
|
49
50
|
|
|
50
51
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
52
|
|
|
@@ -175,6 +176,10 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
175
176
|
const baseSelectProps = ((_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect) || {};
|
|
176
177
|
const isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
177
178
|
const OptionComponent = isBaseSelectNative ? 'option' : _MenuItem.default;
|
|
179
|
+
const {
|
|
180
|
+
InputComponentProps
|
|
181
|
+
} = valueInputProps,
|
|
182
|
+
valueInputPropsOther = (0, _objectWithoutPropertiesLoose2.default)(valueInputProps, _excluded2);
|
|
178
183
|
const sortedFilterableColumns = React.useMemo(() => {
|
|
179
184
|
switch (columnsSort) {
|
|
180
185
|
case 'asc':
|
|
@@ -345,14 +350,14 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
345
350
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterFormValueInput, (0, _extends2.default)({
|
|
346
351
|
variant: "standard",
|
|
347
352
|
as: rootProps.components.BaseFormControl
|
|
348
|
-
}, baseFormControlProps,
|
|
349
|
-
className: (0, _clsx.default)(classes.valueInput, baseFormControlProps.className,
|
|
353
|
+
}, baseFormControlProps, valueInputPropsOther, {
|
|
354
|
+
className: (0, _clsx.default)(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
|
|
350
355
|
children: currentOperator != null && currentOperator.InputComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(currentOperator.InputComponent, (0, _extends2.default)({
|
|
351
356
|
apiRef: apiRef,
|
|
352
357
|
item: item,
|
|
353
358
|
applyValue: applyFilterChanges,
|
|
354
359
|
focusElementRef: valueRef
|
|
355
|
-
}, currentOperator.InputComponentProps)) : null
|
|
360
|
+
}, currentOperator.InputComponentProps, InputComponentProps)) : null
|
|
356
361
|
}))]
|
|
357
362
|
}));
|
|
358
363
|
});
|
|
@@ -54,8 +54,8 @@ function GridFilterInputBoolean(props) {
|
|
|
54
54
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
55
55
|
value: filterValueState,
|
|
56
56
|
onChange: onFilterChange,
|
|
57
|
-
variant: "standard",
|
|
58
57
|
select: true,
|
|
58
|
+
variant: "standard",
|
|
59
59
|
SelectProps: (0, _extends2.default)({
|
|
60
60
|
native: isSelectNative,
|
|
61
61
|
displayEmpty: true
|
|
@@ -79,8 +79,8 @@ function GridFilterInputDate(props) {
|
|
|
79
79
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
80
80
|
value: filterValueState,
|
|
81
81
|
onChange: onFilterChange,
|
|
82
|
-
type: type || 'text',
|
|
83
82
|
variant: "standard",
|
|
83
|
+
type: type || 'text',
|
|
84
84
|
InputLabelProps: {
|
|
85
85
|
shrink: true
|
|
86
86
|
},
|
|
@@ -100,7 +100,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
100
100
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
101
101
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
102
|
// ----------------------------------------------------------------------
|
|
103
|
-
apiRef: _propTypes.default.
|
|
103
|
+
apiRef: _propTypes.default.shape({
|
|
104
|
+
current: _propTypes.default.object.isRequired
|
|
105
|
+
}).isRequired,
|
|
104
106
|
applyValue: _propTypes.default.func.isRequired,
|
|
105
107
|
focusElementRef: _propTypes.default
|
|
106
108
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -19,15 +19,15 @@ var _Autocomplete = _interopRequireWildcard(require("@mui/material/Autocomplete"
|
|
|
19
19
|
|
|
20
20
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
21
21
|
|
|
22
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
23
|
-
|
|
24
22
|
var _utils = require("@mui/material/utils");
|
|
25
23
|
|
|
26
24
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
27
25
|
|
|
26
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
27
|
+
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
30
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
31
31
|
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
@@ -42,10 +42,23 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
42
42
|
item,
|
|
43
43
|
applyValue,
|
|
44
44
|
apiRef,
|
|
45
|
-
focusElementRef
|
|
45
|
+
focusElementRef,
|
|
46
|
+
color,
|
|
47
|
+
error,
|
|
48
|
+
helperText,
|
|
49
|
+
size,
|
|
50
|
+
variant = 'standard'
|
|
46
51
|
} = props,
|
|
47
52
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
53
|
+
const TextFieldProps = {
|
|
54
|
+
color,
|
|
55
|
+
error,
|
|
56
|
+
helperText,
|
|
57
|
+
size,
|
|
58
|
+
variant
|
|
59
|
+
};
|
|
48
60
|
const id = (0, _utils.unstable_useId)();
|
|
61
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
49
62
|
const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
50
63
|
const resolvedValueOptions = React.useMemo(() => {
|
|
51
64
|
if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
|
|
@@ -89,7 +102,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
89
102
|
|
|
90
103
|
if (resolvedValueOptions !== undefined) {
|
|
91
104
|
const itemValueIndexes = item.value.map(element => {
|
|
92
|
-
// get the index matching between values and
|
|
105
|
+
// get the index matching between values and valueOptions
|
|
93
106
|
const formattedElement = (0, _filterPanelUtils.getValueFromOption)(element);
|
|
94
107
|
const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;
|
|
95
108
|
return index;
|
|
@@ -128,16 +141,19 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
128
141
|
}, getTagProps({
|
|
129
142
|
index
|
|
130
143
|
})))),
|
|
131
|
-
renderInput: params =>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
renderInput: params => {
|
|
145
|
+
var _rootProps$components;
|
|
146
|
+
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
|
|
148
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
149
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
150
|
+
InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
|
|
151
|
+
shrink: true
|
|
152
|
+
}),
|
|
153
|
+
inputRef: focusElementRef,
|
|
154
|
+
type: "singleSelect"
|
|
155
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
156
|
+
}
|
|
141
157
|
}, other));
|
|
142
158
|
}
|
|
143
159
|
|
|
@@ -19,13 +19,13 @@ var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete")
|
|
|
19
19
|
|
|
20
20
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
21
21
|
|
|
22
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
23
|
-
|
|
24
22
|
var _utils = require("@mui/material/utils");
|
|
25
23
|
|
|
24
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
25
|
+
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
28
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -37,11 +37,24 @@ function GridFilterInputMultipleValue(props) {
|
|
|
37
37
|
applyValue,
|
|
38
38
|
type,
|
|
39
39
|
apiRef,
|
|
40
|
-
focusElementRef
|
|
40
|
+
focusElementRef,
|
|
41
|
+
color,
|
|
42
|
+
error,
|
|
43
|
+
helperText,
|
|
44
|
+
size,
|
|
45
|
+
variant
|
|
41
46
|
} = props,
|
|
42
47
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
48
|
+
const TextFieldProps = {
|
|
49
|
+
color,
|
|
50
|
+
error,
|
|
51
|
+
helperText,
|
|
52
|
+
size,
|
|
53
|
+
variant
|
|
54
|
+
};
|
|
43
55
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
44
56
|
const id = (0, _utils.unstable_useId)();
|
|
57
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
45
58
|
React.useEffect(() => {
|
|
46
59
|
var _item$value;
|
|
47
60
|
|
|
@@ -75,16 +88,19 @@ function GridFilterInputMultipleValue(props) {
|
|
|
75
88
|
}, getTagProps({
|
|
76
89
|
index
|
|
77
90
|
})))),
|
|
78
|
-
renderInput: params =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
renderInput: params => {
|
|
92
|
+
var _rootProps$components;
|
|
93
|
+
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
|
|
95
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
96
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
97
|
+
InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
|
|
98
|
+
shrink: true
|
|
99
|
+
}),
|
|
100
|
+
inputRef: focusElementRef,
|
|
101
|
+
type: type || 'text'
|
|
102
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
103
|
+
}
|
|
88
104
|
}, other));
|
|
89
105
|
}
|
|
90
106
|
|
|
@@ -93,7 +109,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
|
|
|
93
109
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
94
110
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
95
111
|
// ----------------------------------------------------------------------
|
|
96
|
-
apiRef: _propTypes.default.
|
|
112
|
+
apiRef: _propTypes.default.shape({
|
|
113
|
+
current: _propTypes.default.object.isRequired
|
|
114
|
+
}).isRequired,
|
|
97
115
|
applyValue: _propTypes.default.func.isRequired,
|
|
98
116
|
focusElementRef: _propTypes.default
|
|
99
117
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -74,6 +74,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
74
74
|
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
75
75
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
76
76
|
const currentValueOptions = React.useMemo(() => {
|
|
77
|
+
if (currentColumn === null) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
78
82
|
field: currentColumn.field
|
|
79
83
|
}) : currentColumn.valueOptions;
|
|
@@ -115,8 +119,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
115
119
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
116
120
|
value: filterValueState,
|
|
117
121
|
onChange: onFilterChange,
|
|
118
|
-
type: type || 'text',
|
|
119
122
|
variant: "standard",
|
|
123
|
+
type: type || 'text',
|
|
120
124
|
InputLabelProps: {
|
|
121
125
|
shrink: true
|
|
122
126
|
},
|
|
@@ -135,7 +139,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
135
139
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
136
140
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
137
141
|
// ----------------------------------------------------------------------
|
|
138
|
-
apiRef: _propTypes.default.
|
|
142
|
+
apiRef: _propTypes.default.shape({
|
|
143
|
+
current: _propTypes.default.object.isRequired
|
|
144
|
+
}).isRequired,
|
|
139
145
|
applyValue: _propTypes.default.func.isRequired,
|
|
140
146
|
focusElementRef: _propTypes.default
|
|
141
147
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -141,8 +141,8 @@ function GridFilterInputValue(props) {
|
|
|
141
141
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
142
142
|
value: filterValueState,
|
|
143
143
|
onChange: onFilterChange,
|
|
144
|
-
type: type || 'text',
|
|
145
144
|
variant: "standard",
|
|
145
|
+
type: type || 'text',
|
|
146
146
|
InputProps: InputProps,
|
|
147
147
|
InputLabelProps: {
|
|
148
148
|
shrink: true
|
|
@@ -156,7 +156,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
156
156
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
157
157
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
158
158
|
// ----------------------------------------------------------------------
|
|
159
|
-
apiRef: _propTypes.default.
|
|
159
|
+
apiRef: _propTypes.default.shape({
|
|
160
|
+
current: _propTypes.default.object.isRequired
|
|
161
|
+
}).isRequired,
|
|
160
162
|
applyValue: _propTypes.default.func.isRequired,
|
|
161
163
|
focusElementRef: _propTypes.default
|
|
162
164
|
/* @typescript-to-proptypes-ignore */
|