@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
|
@@ -13,6 +13,7 @@ export var getGridStringQuickFilterFn = function getGridStringQuickFilterFn(valu
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export var getGridStringOperators = function getGridStringOperators() {
|
|
16
|
+
var disableTrim = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
16
17
|
return [{
|
|
17
18
|
value: 'contains',
|
|
18
19
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
@@ -20,7 +21,8 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
var filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
25
|
+
var filterRegex = new RegExp(escapeRegExp(filterItemValue), 'i');
|
|
24
26
|
return function (_ref2) {
|
|
25
27
|
var value = _ref2.value;
|
|
26
28
|
return value != null ? filterRegex.test(value.toString()) : false;
|
|
@@ -34,13 +36,14 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
34
36
|
return null;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
var filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
37
40
|
var collator = new Intl.Collator(undefined, {
|
|
38
41
|
sensitivity: 'base',
|
|
39
42
|
usage: 'search'
|
|
40
43
|
});
|
|
41
44
|
return function (_ref3) {
|
|
42
45
|
var value = _ref3.value;
|
|
43
|
-
return value != null ? collator.compare(
|
|
46
|
+
return value != null ? collator.compare(filterItemValue, value.toString()) === 0 : false;
|
|
44
47
|
};
|
|
45
48
|
},
|
|
46
49
|
InputComponent: GridFilterInputValue
|
|
@@ -51,7 +54,8 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
51
54
|
return null;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
var
|
|
57
|
+
var filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
58
|
+
var filterRegex = new RegExp("^".concat(escapeRegExp(filterItemValue), ".*$"), 'i');
|
|
55
59
|
return function (_ref4) {
|
|
56
60
|
var value = _ref4.value;
|
|
57
61
|
return value != null ? filterRegex.test(value.toString()) : false;
|
|
@@ -65,7 +69,8 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
65
69
|
return null;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
var
|
|
72
|
+
var filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
|
|
73
|
+
var filterRegex = new RegExp(".*".concat(escapeRegExp(filterItemValue), "$"), 'i');
|
|
69
74
|
return function (_ref5) {
|
|
70
75
|
var value = _ref5.value;
|
|
71
76
|
return value != null ? filterRegex.test(value.toString()) : false;
|
|
@@ -79,7 +84,8 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
79
84
|
var value = _ref6.value;
|
|
80
85
|
return value === '' || value == null;
|
|
81
86
|
};
|
|
82
|
-
}
|
|
87
|
+
},
|
|
88
|
+
requiresFilterValue: false
|
|
83
89
|
}, {
|
|
84
90
|
value: 'isNotEmpty',
|
|
85
91
|
getApplyFilterFn: function getApplyFilterFn() {
|
|
@@ -87,7 +93,8 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
87
93
|
var value = _ref7.value;
|
|
88
94
|
return value !== '' && value != null;
|
|
89
95
|
};
|
|
90
|
-
}
|
|
96
|
+
},
|
|
97
|
+
requiresFilterValue: false
|
|
91
98
|
}, {
|
|
92
99
|
value: 'isAnyOf',
|
|
93
100
|
getApplyFilterFn: function getApplyFilterFn(filterItem) {
|
|
@@ -95,13 +102,16 @@ export var getGridStringOperators = function getGridStringOperators() {
|
|
|
95
102
|
return null;
|
|
96
103
|
}
|
|
97
104
|
|
|
105
|
+
var filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(function (val) {
|
|
106
|
+
return val.trim();
|
|
107
|
+
});
|
|
98
108
|
var collator = new Intl.Collator(undefined, {
|
|
99
109
|
sensitivity: 'base',
|
|
100
110
|
usage: 'search'
|
|
101
111
|
});
|
|
102
112
|
return function (_ref8) {
|
|
103
113
|
var value = _ref8.value;
|
|
104
|
-
return value != null ?
|
|
114
|
+
return value != null ? filterItemValue.some(function (filterValue) {
|
|
105
115
|
return collator.compare(filterValue, value.toString() || '') === 0;
|
|
106
116
|
}) : false;
|
|
107
117
|
};
|
|
@@ -112,7 +112,7 @@ function GridRow(props) {
|
|
|
112
112
|
// Fallback for IE
|
|
113
113
|
apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
|
|
114
114
|
}
|
|
115
|
-
});
|
|
115
|
+
}, [apiRef, rowHeight, rowId]);
|
|
116
116
|
React.useLayoutEffect(function () {
|
|
117
117
|
if (currentPage.range) {
|
|
118
118
|
// The index prop is relative to the rows from all pages. As example, the index prop of the
|
|
@@ -50,7 +50,10 @@ function GridOverlayWrapper(props) {
|
|
|
50
50
|
width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0,
|
|
51
51
|
position: 'absolute',
|
|
52
52
|
top: headerHeight,
|
|
53
|
-
bottom: height === 'auto' ? 0 : undefined
|
|
53
|
+
bottom: height === 'auto' ? 0 : undefined,
|
|
54
|
+
zIndex: 3,
|
|
55
|
+
// should be above pinned columns and detail panel
|
|
56
|
+
pointerEvents: 'none'
|
|
54
57
|
}
|
|
55
58
|
}, props));
|
|
56
59
|
}
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _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';
|
|
@@ -16,7 +17,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
16
17
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
var GridBooleanCellRaw = function GridBooleanCellRaw(props) {
|
|
20
21
|
var id = props.id,
|
|
21
22
|
value = props.value,
|
|
22
23
|
formattedValue = props.formattedValue,
|
|
@@ -47,7 +48,97 @@ export var GridBooleanCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
47
48
|
titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
|
|
48
49
|
"data-value": Boolean(value)
|
|
49
50
|
}, other));
|
|
50
|
-
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
54
|
+
// ----------------------------- Warning --------------------------------
|
|
55
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
57
|
+
// ----------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* GridApi that let you manipulate the grid.
|
|
61
|
+
* @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)
|
|
62
|
+
*/
|
|
63
|
+
api: PropTypes.any.isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The mode of the cell.
|
|
67
|
+
*/
|
|
68
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The column of the row that the current cell belongs to.
|
|
72
|
+
*/
|
|
73
|
+
colDef: PropTypes.object.isRequired,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The column field of the cell that triggered the event.
|
|
77
|
+
*/
|
|
78
|
+
field: PropTypes.string.isRequired,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A ref allowing to set imperative focus.
|
|
82
|
+
* It can be passed to the element that should receive focus.
|
|
83
|
+
* @ignore - do not document.
|
|
84
|
+
*/
|
|
85
|
+
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
86
|
+
current: PropTypes.shape({
|
|
87
|
+
focus: PropTypes.func.isRequired
|
|
88
|
+
})
|
|
89
|
+
})]),
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The cell value formatted with the column valueFormatter.
|
|
93
|
+
*/
|
|
94
|
+
formattedValue: PropTypes.any,
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get the cell value of a row and field.
|
|
98
|
+
* @param {GridRowId} id The row id.
|
|
99
|
+
* @param {string} field The field.
|
|
100
|
+
* @returns {any} The cell value.
|
|
101
|
+
* @deprecated Use `params.row` to directly access the fields you want instead.
|
|
102
|
+
*/
|
|
103
|
+
getValue: PropTypes.func.isRequired,
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* If true, the cell is the active element.
|
|
107
|
+
*/
|
|
108
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The grid row id.
|
|
112
|
+
*/
|
|
113
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* If true, the cell is editable.
|
|
117
|
+
*/
|
|
118
|
+
isEditable: PropTypes.bool,
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The row model of the row that the current cell belongs to.
|
|
122
|
+
*/
|
|
123
|
+
row: PropTypes.object.isRequired,
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The node of the row that the current cell belongs to.
|
|
127
|
+
*/
|
|
128
|
+
rowNode: PropTypes.object.isRequired,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* the tabIndex value.
|
|
132
|
+
*/
|
|
133
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The cell value, but if the column has valueGetter, use getValue.
|
|
137
|
+
*/
|
|
138
|
+
value: PropTypes.any
|
|
139
|
+
} : void 0;
|
|
140
|
+
var GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
141
|
+
export { GridBooleanCell };
|
|
51
142
|
export var renderBooleanCell = function renderBooleanCell(params) {
|
|
52
143
|
if (params.rowNode.isAutoGenerated) {
|
|
53
144
|
return '';
|
|
@@ -9,10 +9,14 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
10
10
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
11
11
|
import InputBase from '@mui/material/InputBase';
|
|
12
|
+
import { styled } from '@mui/material/styles';
|
|
12
13
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
13
14
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
15
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
var StyledInputBase = styled(InputBase)({
|
|
18
|
+
fontSize: 'inherit'
|
|
19
|
+
});
|
|
16
20
|
|
|
17
21
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
18
22
|
var classes = ownerState.classes;
|
|
@@ -153,7 +157,7 @@ function GridEditDateCell(props) {
|
|
|
153
157
|
inputRef.current.focus();
|
|
154
158
|
}
|
|
155
159
|
}, [hasFocus]);
|
|
156
|
-
return /*#__PURE__*/_jsx(
|
|
160
|
+
return /*#__PURE__*/_jsx(StyledInputBase, _extends({
|
|
157
161
|
inputRef: inputRef,
|
|
158
162
|
fullWidth: true,
|
|
159
163
|
className: classes.root,
|
|
@@ -81,7 +81,12 @@ var GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCell
|
|
|
81
81
|
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
82
82
|
}
|
|
83
83
|
}, [apiRef, props]);
|
|
84
|
-
|
|
84
|
+
|
|
85
|
+
if (rowNode.position === 'footer') {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var isSelectable = apiRef.current.isRowSelectable(id);
|
|
85
90
|
var label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
86
91
|
return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({
|
|
87
92
|
ref: handleRef,
|
|
@@ -6,13 +6,13 @@ export var GridRootStyles = styled('div', {
|
|
|
6
6
|
name: 'MuiDataGrid',
|
|
7
7
|
slot: 'Root',
|
|
8
8
|
overridesResolver: function overridesResolver(props, styles) {
|
|
9
|
-
return [_defineProperty({}, "&.".concat(gridClasses.autoHeight), styles.autoHeight), _defineProperty({}, "& .".concat(gridClasses.editBooleanCell), styles.editBooleanCell), _defineProperty({}, "& .".concat(gridClasses['cell--editing']), styles['cell--editing']), _defineProperty({}, "& .".concat(gridClasses['cell--textCenter']), styles['cell--textCenter']), _defineProperty({}, "& .".concat(gridClasses['cell--textLeft']), styles['cell--textLeft']), _defineProperty({}, "& .".concat(gridClasses['cell--textRight']), styles['cell--textRight']), // TODO v6: Remove
|
|
9
|
+
return [_defineProperty({}, "&.".concat(gridClasses.autoHeight), styles.autoHeight), _defineProperty({}, "&.".concat(gridClasses.aggregationColumnHeader), styles.aggregationColumnHeader), _defineProperty({}, "&.".concat(gridClasses['aggregationColumnHeader--alignLeft']), styles['aggregationColumnHeader--alignLeft']), _defineProperty({}, "&.".concat(gridClasses['aggregationColumnHeader--alignCenter']), styles['aggregationColumnHeader--alignCenter']), _defineProperty({}, "&.".concat(gridClasses['aggregationColumnHeader--alignRight']), styles['aggregationColumnHeader--alignRight']), _defineProperty({}, "&.".concat(gridClasses.aggregationColumnHeaderLabel), styles.aggregationColumnHeaderLabel), _defineProperty({}, "& .".concat(gridClasses.editBooleanCell), styles.editBooleanCell), _defineProperty({}, "& .".concat(gridClasses['cell--editing']), styles['cell--editing']), _defineProperty({}, "& .".concat(gridClasses['cell--textCenter']), styles['cell--textCenter']), _defineProperty({}, "& .".concat(gridClasses['cell--textLeft']), styles['cell--textLeft']), _defineProperty({}, "& .".concat(gridClasses['cell--textRight']), styles['cell--textRight']), // TODO v6: Remove
|
|
10
10
|
_defineProperty({}, "& .".concat(gridClasses['cell--withRenderer']), styles['cell--withRenderer']), _defineProperty({}, "& .".concat(gridClasses.cell), styles.cell), _defineProperty({}, "& .".concat(gridClasses.cellContent), styles.cellContent), _defineProperty({}, "& .".concat(gridClasses.cellCheckbox), styles.cellCheckbox), _defineProperty({}, "& .".concat(gridClasses.checkboxInput), styles.checkboxInput), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignCenter']), styles['columnHeader--alignCenter']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignLeft']), styles['columnHeader--alignLeft']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignRight']), styles['columnHeader--alignRight']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--dragging']), styles['columnHeader--dragging']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--moving']), styles['columnHeader--moving']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--numeric']), styles['columnHeader--numeric']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sortable']), styles['columnHeader--sortable']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sorted']), styles['columnHeader--sorted']), _defineProperty({}, "& .".concat(gridClasses.columnHeader), styles.columnHeader), _defineProperty({}, "& .".concat(gridClasses.columnHeaderCheckbox), styles.columnHeaderCheckbox), _defineProperty({}, "& .".concat(gridClasses.columnHeaderDraggableContainer), styles.columnHeaderDraggableContainer), _defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainer), styles.columnHeaderTitleContainer), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizable']), styles['columnSeparator--resizable']), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizing']), styles['columnSeparator--resizing']), _defineProperty({}, "& .".concat(gridClasses.columnSeparator), styles.columnSeparator), _defineProperty({}, "& .".concat(gridClasses.filterIcon), styles.filterIcon), _defineProperty({}, "& .".concat(gridClasses.iconSeparator), styles.iconSeparator), _defineProperty({}, "& .".concat(gridClasses.menuIcon), styles.menuIcon), _defineProperty({}, "& .".concat(gridClasses.menuIconButton), styles.menuIconButton), _defineProperty({}, "& .".concat(gridClasses.menuOpen), styles.menuOpen), _defineProperty({}, "& .".concat(gridClasses.menuList), styles.menuList), _defineProperty({}, "& .".concat(gridClasses['row--editable']), styles['row--editable']), _defineProperty({}, "& .".concat(gridClasses['row--editing']), styles['row--editing']), _defineProperty({}, "& .".concat(gridClasses['row--dragging']), styles['row--dragging']), _defineProperty({}, "& .".concat(gridClasses.row), styles.row), _defineProperty({}, "& .".concat(gridClasses.rowReorderCellPlaceholder), styles.rowReorderCellPlaceholder), _defineProperty({}, "& .".concat(gridClasses.rowReorderCell), styles.rowReorderCell), _defineProperty({}, "& .".concat(gridClasses['rowReorderCell--draggable']), styles['rowReorderCell--draggable']), _defineProperty({}, "& .".concat(gridClasses.sortIcon), styles.sortIcon), _defineProperty({}, "& .".concat(gridClasses.withBorder), styles.withBorder), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCell), styles.treeDataGroupingCell), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCellToggle), styles.treeDataGroupingCellToggle), _defineProperty({}, "& .".concat(gridClasses.detailPanelToggleCell), styles.detailPanelToggleCell), _defineProperty({}, "& .".concat(gridClasses['detailPanelToggleCell--expanded']), styles['detailPanelToggleCell--expanded']), styles.root];
|
|
11
11
|
}
|
|
12
|
-
})(function (
|
|
12
|
+
})(function (_ref51) {
|
|
13
13
|
var _$concat2, _$concat3, _extends2;
|
|
14
14
|
|
|
15
|
-
var theme =
|
|
15
|
+
var theme = _ref51.theme;
|
|
16
16
|
var borderColor = theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68);
|
|
17
17
|
|
|
18
18
|
var gridStyle = _extends({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"]
|
|
3
|
+
var _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';
|
|
@@ -164,6 +165,10 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
164
165
|
var baseSelectProps = ((_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect) || {};
|
|
165
166
|
var isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
166
167
|
var OptionComponent = isBaseSelectNative ? 'option' : MenuItem;
|
|
168
|
+
|
|
169
|
+
var InputComponentProps = valueInputProps.InputComponentProps,
|
|
170
|
+
valueInputPropsOther = _objectWithoutProperties(valueInputProps, _excluded2);
|
|
171
|
+
|
|
167
172
|
var sortedFilterableColumns = React.useMemo(function () {
|
|
168
173
|
switch (columnsSort) {
|
|
169
174
|
case 'asc':
|
|
@@ -352,14 +357,14 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
352
357
|
})), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
|
|
353
358
|
variant: "standard",
|
|
354
359
|
as: rootProps.components.BaseFormControl
|
|
355
|
-
}, baseFormControlProps,
|
|
356
|
-
className: clsx(classes.valueInput, baseFormControlProps.className,
|
|
360
|
+
}, baseFormControlProps, valueInputPropsOther, {
|
|
361
|
+
className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
|
|
357
362
|
children: currentOperator != null && currentOperator.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({
|
|
358
363
|
apiRef: apiRef,
|
|
359
364
|
item: item,
|
|
360
365
|
applyValue: applyFilterChanges,
|
|
361
366
|
focusElementRef: valueRef
|
|
362
|
-
}, currentOperator.InputComponentProps)) : null
|
|
367
|
+
}, currentOperator.InputComponentProps, InputComponentProps)) : null
|
|
363
368
|
}))]
|
|
364
369
|
}));
|
|
365
370
|
});
|
|
@@ -39,8 +39,8 @@ export function GridFilterInputBoolean(props) {
|
|
|
39
39
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
40
40
|
value: filterValueState,
|
|
41
41
|
onChange: onFilterChange,
|
|
42
|
-
variant: "standard",
|
|
43
42
|
select: true,
|
|
43
|
+
variant: "standard",
|
|
44
44
|
SelectProps: _extends({
|
|
45
45
|
native: isSelectNative,
|
|
46
46
|
displayEmpty: true
|
|
@@ -64,8 +64,8 @@ function GridFilterInputDate(props) {
|
|
|
64
64
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
65
65
|
value: filterValueState,
|
|
66
66
|
onChange: onFilterChange,
|
|
67
|
-
type: type || 'text',
|
|
68
67
|
variant: "standard",
|
|
68
|
+
type: type || 'text',
|
|
69
69
|
InputLabelProps: {
|
|
70
70
|
shrink: true
|
|
71
71
|
},
|
|
@@ -85,7 +85,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
85
85
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
86
86
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
87
87
|
// ----------------------------------------------------------------------
|
|
88
|
-
apiRef: PropTypes.
|
|
88
|
+
apiRef: PropTypes.shape({
|
|
89
|
+
current: PropTypes.object.isRequired
|
|
90
|
+
}).isRequired,
|
|
89
91
|
applyValue: PropTypes.func.isRequired,
|
|
90
92
|
focusElementRef: PropTypes
|
|
91
93
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -2,14 +2,14 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
5
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
9
9
|
import Chip from '@mui/material/Chip';
|
|
10
|
-
import TextField from '@mui/material/TextField';
|
|
11
10
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
12
11
|
import { getValueFromOption } from './filterPanelUtils';
|
|
12
|
+
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
|
|
15
15
|
var isOptionEqualToValue = function isOptionEqualToValue(option, value) {
|
|
@@ -24,9 +24,23 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
24
24
|
type = props.type,
|
|
25
25
|
apiRef = props.apiRef,
|
|
26
26
|
focusElementRef = props.focusElementRef,
|
|
27
|
+
color = props.color,
|
|
28
|
+
error = props.error,
|
|
29
|
+
helperText = props.helperText,
|
|
30
|
+
size = props.size,
|
|
31
|
+
_props$variant = props.variant,
|
|
32
|
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
27
33
|
other = _objectWithoutProperties(props, _excluded);
|
|
28
34
|
|
|
35
|
+
var TextFieldProps = {
|
|
36
|
+
color: color,
|
|
37
|
+
error: error,
|
|
38
|
+
helperText: helperText,
|
|
39
|
+
size: size,
|
|
40
|
+
variant: variant
|
|
41
|
+
};
|
|
29
42
|
var id = useId();
|
|
43
|
+
var rootProps = useGridRootProps();
|
|
30
44
|
var resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
31
45
|
var resolvedValueOptions = React.useMemo(function () {
|
|
32
46
|
if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
|
|
@@ -70,7 +84,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
70
84
|
|
|
71
85
|
if (resolvedValueOptions !== undefined) {
|
|
72
86
|
var itemValueIndexes = item.value.map(function (element) {
|
|
73
|
-
// get the index matching between values and
|
|
87
|
+
// get the index matching between values and valueOptions
|
|
74
88
|
var formattedElement = getValueFromOption(element);
|
|
75
89
|
var index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(function (formatedOption) {
|
|
76
90
|
return formatedOption === formattedElement;
|
|
@@ -120,16 +134,17 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
120
134
|
});
|
|
121
135
|
},
|
|
122
136
|
renderInput: function renderInput(params) {
|
|
123
|
-
|
|
137
|
+
var _rootProps$components;
|
|
138
|
+
|
|
139
|
+
return /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
|
|
124
140
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
125
141
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
126
142
|
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
127
143
|
shrink: true
|
|
128
144
|
}),
|
|
129
145
|
inputRef: focusElementRef,
|
|
130
|
-
type:
|
|
131
|
-
|
|
132
|
-
}));
|
|
146
|
+
type: "singleSelect"
|
|
147
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
133
148
|
}
|
|
134
149
|
}, other));
|
|
135
150
|
}
|
|
@@ -2,13 +2,13 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
5
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
9
9
|
import Chip from '@mui/material/Chip';
|
|
10
|
-
import TextField from '@mui/material/TextField';
|
|
11
10
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
11
|
+
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
|
|
14
14
|
function GridFilterInputMultipleValue(props) {
|
|
@@ -17,14 +17,28 @@ function GridFilterInputMultipleValue(props) {
|
|
|
17
17
|
type = props.type,
|
|
18
18
|
apiRef = props.apiRef,
|
|
19
19
|
focusElementRef = props.focusElementRef,
|
|
20
|
+
color = props.color,
|
|
21
|
+
error = props.error,
|
|
22
|
+
helperText = props.helperText,
|
|
23
|
+
size = props.size,
|
|
24
|
+
variant = props.variant,
|
|
20
25
|
other = _objectWithoutProperties(props, _excluded);
|
|
21
26
|
|
|
27
|
+
var TextFieldProps = {
|
|
28
|
+
color: color,
|
|
29
|
+
error: error,
|
|
30
|
+
helperText: helperText,
|
|
31
|
+
size: size,
|
|
32
|
+
variant: variant
|
|
33
|
+
};
|
|
34
|
+
|
|
22
35
|
var _React$useState = React.useState(item.value || []),
|
|
23
36
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
37
|
filterValueState = _React$useState2[0],
|
|
25
38
|
setFilterValueState = _React$useState2[1];
|
|
26
39
|
|
|
27
40
|
var id = useId();
|
|
41
|
+
var rootProps = useGridRootProps();
|
|
28
42
|
React.useEffect(function () {
|
|
29
43
|
var _item$value;
|
|
30
44
|
|
|
@@ -61,16 +75,17 @@ function GridFilterInputMultipleValue(props) {
|
|
|
61
75
|
});
|
|
62
76
|
},
|
|
63
77
|
renderInput: function renderInput(params) {
|
|
64
|
-
|
|
78
|
+
var _rootProps$components;
|
|
79
|
+
|
|
80
|
+
return /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
|
|
65
81
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
66
82
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
67
83
|
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
68
84
|
shrink: true
|
|
69
85
|
}),
|
|
70
86
|
inputRef: focusElementRef,
|
|
71
|
-
type: type || 'text'
|
|
72
|
-
|
|
73
|
-
}));
|
|
87
|
+
type: type || 'text'
|
|
88
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
74
89
|
}
|
|
75
90
|
}, other));
|
|
76
91
|
}
|
|
@@ -80,7 +95,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
|
|
|
80
95
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
81
96
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
82
97
|
// ----------------------------------------------------------------------
|
|
83
|
-
apiRef: PropTypes.
|
|
98
|
+
apiRef: PropTypes.shape({
|
|
99
|
+
current: PropTypes.object.isRequired
|
|
100
|
+
}).isRequired,
|
|
84
101
|
applyValue: PropTypes.func.isRequired,
|
|
85
102
|
focusElementRef: PropTypes
|
|
86
103
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -57,6 +57,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
57
57
|
var isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
58
58
|
var currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
59
59
|
var currentValueOptions = React.useMemo(function () {
|
|
60
|
+
if (currentColumn === null) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
61
65
|
field: currentColumn.field
|
|
62
66
|
}) : currentColumn.valueOptions;
|
|
@@ -98,8 +102,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
98
102
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
99
103
|
value: filterValueState,
|
|
100
104
|
onChange: onFilterChange,
|
|
101
|
-
type: type || 'text',
|
|
102
105
|
variant: "standard",
|
|
106
|
+
type: type || 'text',
|
|
103
107
|
InputLabelProps: {
|
|
104
108
|
shrink: true
|
|
105
109
|
},
|
|
@@ -118,7 +122,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
118
122
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
119
123
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
120
124
|
// ----------------------------------------------------------------------
|
|
121
|
-
apiRef: PropTypes.
|
|
125
|
+
apiRef: PropTypes.shape({
|
|
126
|
+
current: PropTypes.object.isRequired
|
|
127
|
+
}).isRequired,
|
|
122
128
|
applyValue: PropTypes.func.isRequired,
|
|
123
129
|
focusElementRef: PropTypes
|
|
124
130
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -124,8 +124,8 @@ function GridFilterInputValue(props) {
|
|
|
124
124
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
125
125
|
value: filterValueState,
|
|
126
126
|
onChange: onFilterChange,
|
|
127
|
-
type: type || 'text',
|
|
128
127
|
variant: "standard",
|
|
128
|
+
type: type || 'text',
|
|
129
129
|
InputProps: InputProps,
|
|
130
130
|
InputLabelProps: {
|
|
131
131
|
shrink: true
|
|
@@ -139,7 +139,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
139
139
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
140
140
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
141
141
|
// ----------------------------------------------------------------------
|
|
142
|
-
apiRef: PropTypes.
|
|
142
|
+
apiRef: PropTypes.shape({
|
|
143
|
+
current: PropTypes.object.isRequired
|
|
144
|
+
}).isRequired,
|
|
143
145
|
applyValue: PropTypes.func.isRequired,
|
|
144
146
|
focusElementRef: PropTypes
|
|
145
147
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["hideMenu", "options"],
|
|
4
|
+
_excluded2 = ["hideMenu", "options"],
|
|
5
|
+
_excluded3 = ["csvOptions", "printOptions", "excelOptions"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -9,27 +11,35 @@ import { GridToolbarExportContainer } from './GridToolbarExportContainer';
|
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
export var GridCsvExportMenuItem = function GridCsvExportMenuItem(props) {
|
|
11
13
|
var apiRef = useGridApiContext();
|
|
14
|
+
|
|
12
15
|
var hideMenu = props.hideMenu,
|
|
13
|
-
options = props.options
|
|
14
|
-
|
|
16
|
+
options = props.options,
|
|
17
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/_jsx(MenuItem, _extends({
|
|
15
20
|
onClick: function onClick() {
|
|
16
21
|
apiRef.current.exportDataAsCsv(options);
|
|
17
22
|
hideMenu == null ? void 0 : hideMenu();
|
|
18
|
-
}
|
|
23
|
+
}
|
|
24
|
+
}, other, {
|
|
19
25
|
children: apiRef.current.getLocaleText('toolbarExportCSV')
|
|
20
|
-
});
|
|
26
|
+
}));
|
|
21
27
|
};
|
|
22
28
|
export var GridPrintExportMenuItem = function GridPrintExportMenuItem(props) {
|
|
23
29
|
var apiRef = useGridApiContext();
|
|
30
|
+
|
|
24
31
|
var hideMenu = props.hideMenu,
|
|
25
|
-
options = props.options
|
|
26
|
-
|
|
32
|
+
options = props.options,
|
|
33
|
+
other = _objectWithoutProperties(props, _excluded2);
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_jsx(MenuItem, _extends({
|
|
27
36
|
onClick: function onClick() {
|
|
28
37
|
apiRef.current.exportDataAsPrint(options);
|
|
29
38
|
hideMenu == null ? void 0 : hideMenu();
|
|
30
|
-
}
|
|
39
|
+
}
|
|
40
|
+
}, other, {
|
|
31
41
|
children: apiRef.current.getLocaleText('toolbarExportPrint')
|
|
32
|
-
});
|
|
42
|
+
}));
|
|
33
43
|
};
|
|
34
44
|
var GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport(props, ref) {
|
|
35
45
|
var _props$csvOptions = props.csvOptions,
|
|
@@ -37,7 +47,7 @@ var GridToolbarExport = /*#__PURE__*/React.forwardRef(function GridToolbarExport
|
|
|
37
47
|
_props$printOptions = props.printOptions,
|
|
38
48
|
printOptions = _props$printOptions === void 0 ? {} : _props$printOptions,
|
|
39
49
|
excelOptions = props.excelOptions,
|
|
40
|
-
other = _objectWithoutProperties(props,
|
|
50
|
+
other = _objectWithoutProperties(props, _excluded3);
|
|
41
51
|
|
|
42
52
|
var apiRef = useGridApiContext();
|
|
43
53
|
var preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('exportMenu', [], {
|