@mui/x-data-grid 5.12.1 → 5.13.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 +155 -8
- package/DataGrid/DataGrid.js +4 -4
- package/colDef/gridCheckboxSelectionColDef.d.ts +1 -0
- package/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/colDef/gridDateOperators.d.ts +1 -1
- package/colDef/gridNumericColDef.js +1 -1
- package/colDef/gridStringOperators.d.ts +1 -1
- package/colDef/gridStringOperators.js +11 -6
- package/components/GridRow.js +1 -1
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridBooleanCell.js +4 -3
- package/components/cell/GridEditBooleanCell.js +4 -3
- package/components/cell/GridEditDateCell.js +4 -3
- package/components/cell/GridEditInputCell.js +4 -3
- package/components/cell/GridEditSingleSelectCell.js +9 -7
- package/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/components/containers/GridRootStyles.js +1 -1
- package/components/panel/GridColumnsPanel.js +3 -6
- 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 +5 -9
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +42 -19
- 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/GridFilterPanel.js +1 -2
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/constants/localeTextConstants.js +1 -0
- package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
- package/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
- package/hooks/features/dimensions/useGridDimensions.js +37 -23
- package/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/hooks/features/filter/gridFilterState.d.ts +1 -1
- package/hooks/features/filter/gridFilterUtils.js +8 -5
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +16 -3
- package/hooks/features/rows/useGridRowsMeta.js +79 -77
- package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/hooks/utils/useGridApiContext.js +1 -1
- package/hooks/utils/useGridRootProps.js +1 -1
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +4 -4
- package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/legacy/colDef/gridNumericColDef.js +1 -1
- package/legacy/colDef/gridStringOperators.js +13 -5
- package/legacy/components/GridRow.js +1 -1
- package/legacy/components/cell/GridBooleanCell.js +3 -1
- package/legacy/components/cell/GridEditBooleanCell.js +4 -2
- package/legacy/components/cell/GridEditDateCell.js +4 -2
- package/legacy/components/cell/GridEditInputCell.js +4 -2
- package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/legacy/components/containers/GridRootStyles.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +5 -6
- 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 +34 -12
- 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/panel/filterPanel/GridFilterPanel.js +1 -2
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/legacy/constants/localeTextConstants.js +1 -0
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/legacy/hooks/features/dimensions/useGridDimensions.js +36 -23
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
- package/legacy/hooks/features/filter/gridFilterUtils.js +8 -5
- package/legacy/hooks/features/rows/useGridRows.js +18 -3
- package/legacy/hooks/features/rows/useGridRowsMeta.js +81 -77
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/legacy/hooks/utils/useGridApiContext.js +1 -1
- package/legacy/hooks/utils/useGridRootProps.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +1 -0
- package/legacy/locales/bgBG.js +1 -0
- package/legacy/locales/csCZ.js +1 -0
- package/legacy/locales/daDK.js +1 -0
- package/legacy/locales/deDE.js +1 -0
- package/legacy/locales/elGR.js +1 -0
- package/legacy/locales/esES.js +1 -0
- package/legacy/locales/faIR.js +1 -0
- package/legacy/locales/fiFI.js +1 -0
- package/legacy/locales/frFR.js +1 -0
- package/legacy/locales/heIL.js +1 -0
- package/legacy/locales/huHU.js +1 -0
- package/legacy/locales/index.js +3 -0
- package/legacy/locales/itIT.js +1 -0
- package/legacy/locales/jaJP.js +1 -0
- package/legacy/locales/koKR.js +1 -0
- package/legacy/locales/nbNO.js +1 -0
- package/legacy/locales/nlNL.js +1 -0
- package/legacy/locales/plPL.js +1 -0
- package/legacy/locales/ptBR.js +1 -0
- package/legacy/locales/roRO.js +128 -0
- package/legacy/locales/ruRU.js +1 -0
- package/legacy/locales/skSK.js +16 -15
- package/legacy/locales/svSE.js +128 -0
- package/legacy/locales/trTR.js +1 -0
- package/legacy/locales/ukUA.js +1 -0
- package/legacy/locales/viVN.js +1 -0
- package/legacy/locales/zhCN.js +1 -0
- package/legacy/utils/keyboardUtils.js +4 -3
- package/locales/arSD.js +1 -0
- package/locales/bgBG.js +1 -0
- package/locales/csCZ.js +1 -0
- package/locales/daDK.js +1 -0
- package/locales/deDE.js +1 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +1 -0
- package/locales/faIR.js +1 -0
- package/locales/fiFI.js +1 -0
- package/locales/frFR.js +1 -0
- package/locales/heIL.js +1 -0
- package/locales/huHU.js +1 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +3 -0
- package/locales/itIT.js +1 -0
- package/locales/jaJP.js +1 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +1 -0
- package/locales/nlNL.js +1 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +1 -0
- package/locales/roRO.d.ts +2 -0
- package/locales/roRO.js +116 -0
- package/locales/ruRU.js +1 -0
- package/locales/skSK.js +16 -15
- package/locales/svSE.d.ts +2 -0
- package/locales/svSE.js +116 -0
- package/locales/trTR.js +1 -0
- package/locales/ukUA.js +1 -0
- package/locales/viVN.js +1 -0
- package/locales/zhCN.js +1 -0
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +4 -4
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
- package/modern/colDef/gridNumericColDef.js +1 -1
- package/modern/colDef/gridStringOperators.js +11 -6
- package/modern/components/GridRow.js +1 -1
- package/modern/components/cell/GridBooleanCell.js +4 -3
- package/modern/components/cell/GridEditBooleanCell.js +4 -3
- package/modern/components/cell/GridEditDateCell.js +4 -3
- package/modern/components/cell/GridEditInputCell.js +4 -3
- package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/modern/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/modern/components/containers/GridRootStyles.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +3 -6
- 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 +32 -13
- 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/panel/filterPanel/GridFilterPanel.js +1 -2
- package/modern/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +37 -23
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +8 -5
- package/modern/hooks/features/rows/useGridRows.js +16 -3
- package/modern/hooks/features/rows/useGridRowsMeta.js +77 -75
- package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
- package/modern/hooks/utils/useGridApiContext.js +1 -1
- package/modern/hooks/utils/useGridRootProps.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +1 -0
- package/modern/locales/bgBG.js +1 -0
- package/modern/locales/csCZ.js +1 -0
- package/modern/locales/daDK.js +1 -0
- package/modern/locales/deDE.js +1 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +1 -0
- package/modern/locales/faIR.js +1 -0
- package/modern/locales/fiFI.js +1 -0
- package/modern/locales/frFR.js +1 -0
- package/modern/locales/heIL.js +1 -0
- package/modern/locales/huHU.js +1 -0
- package/modern/locales/index.js +3 -0
- package/modern/locales/itIT.js +1 -0
- package/modern/locales/jaJP.js +1 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +1 -0
- package/modern/locales/nlNL.js +1 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +1 -0
- package/modern/locales/roRO.js +116 -0
- package/modern/locales/ruRU.js +1 -0
- package/modern/locales/skSK.js +16 -15
- package/modern/locales/svSE.js +116 -0
- package/modern/locales/trTR.js +1 -0
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/viVN.js +1 -0
- package/modern/locales/zhCN.js +1 -0
- package/modern/utils/keyboardUtils.js +4 -3
- package/node/DataGrid/DataGrid.js +4 -4
- package/node/colDef/gridCheckboxSelectionColDef.js +4 -2
- package/node/colDef/gridNumericColDef.js +1 -1
- package/node/colDef/gridStringOperators.js +11 -6
- package/node/components/GridRow.js +1 -1
- package/node/components/cell/GridBooleanCell.js +5 -3
- package/node/components/cell/GridEditBooleanCell.js +5 -3
- package/node/components/cell/GridEditDateCell.js +5 -3
- package/node/components/cell/GridEditInputCell.js +5 -3
- package/node/components/cell/GridEditSingleSelectCell.js +10 -7
- package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
- package/node/components/columnSelection/GridHeaderCheckbox.js +0 -1
- package/node/components/containers/GridRootStyles.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +3 -6
- 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 +43 -20
- 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/panel/filterPanel/GridFilterPanel.js +1 -2
- package/node/components/toolbar/GridToolbarColumnsButton.js +0 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +0 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +0 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +0 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columns/useGridColumnSpanning.js +11 -16
- package/node/hooks/features/dimensions/useGridDimensions.js +37 -23
- package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -0
- package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.new.js +6 -0
- package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
- package/node/hooks/features/filter/gridFilterUtils.js +7 -4
- package/node/hooks/features/rows/useGridRows.js +16 -3
- package/node/hooks/features/rows/useGridRowsMeta.js +80 -77
- package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
- package/node/hooks/features/selection/useGridSelectionPreProcessors.js +7 -5
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -9
- package/node/hooks/utils/useGridApiContext.js +1 -1
- package/node/hooks/utils/useGridRootProps.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/arSD.js +1 -0
- package/node/locales/bgBG.js +1 -0
- package/node/locales/csCZ.js +1 -0
- package/node/locales/daDK.js +1 -0
- package/node/locales/deDE.js +1 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +1 -0
- package/node/locales/faIR.js +1 -0
- package/node/locales/fiFI.js +1 -0
- package/node/locales/frFR.js +1 -0
- package/node/locales/heIL.js +1 -0
- package/node/locales/huHU.js +1 -0
- package/node/locales/index.js +39 -0
- package/node/locales/itIT.js +1 -0
- package/node/locales/jaJP.js +1 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +1 -0
- package/node/locales/nlNL.js +1 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +1 -0
- package/node/locales/roRO.js +126 -0
- package/node/locales/ruRU.js +1 -0
- package/node/locales/skSK.js +16 -15
- package/node/locales/svSE.js +126 -0
- package/node/locales/trTR.js +1 -0
- package/node/locales/ukUA.js +1 -0
- package/node/locales/viVN.js +1 -0
- package/node/locales/zhCN.js +1 -0
- package/node/utils/keyboardUtils.js +4 -3
- package/package.json +3 -3
- package/utils/keyboardUtils.js +4 -3
package/modern/locales/viVN.js
CHANGED
|
@@ -106,6 +106,7 @@ const viVNGrid = {
|
|
|
106
106
|
// groupColumn: name => `Group by ${name}`,
|
|
107
107
|
// unGroupColumn: name => `Stop grouping by ${name}`,
|
|
108
108
|
// Master/detail
|
|
109
|
+
// detailPanelToggle: 'Detail panel toggle',
|
|
109
110
|
// expandDetailPanel: 'Expand',
|
|
110
111
|
// collapseDetailPanel: 'Collapse',
|
|
111
112
|
// Row reordering text
|
package/modern/locales/zhCN.js
CHANGED
|
@@ -106,6 +106,7 @@ const zhCNGrid = {
|
|
|
106
106
|
// groupColumn: name => `Group by ${name}`,
|
|
107
107
|
// unGroupColumn: name => `Stop grouping by ${name}`,
|
|
108
108
|
// Master/detail
|
|
109
|
+
// detailPanelToggle: 'Detail panel toggle',
|
|
109
110
|
// expandDetailPanel: 'Expand',
|
|
110
111
|
// collapseDetailPanel: 'Collapse',
|
|
111
112
|
// Row reordering text
|
|
@@ -8,9 +8,10 @@ export const isSpaceKey = key => key === ' ';
|
|
|
8
8
|
export const isArrowKeys = key => key.indexOf('Arrow') === 0;
|
|
9
9
|
export const isHomeOrEndKeys = key => key === 'Home' || key === 'End';
|
|
10
10
|
export const isPageKeys = key => key.indexOf('Page') === 0;
|
|
11
|
-
export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export const isDeleteKeys = key => key === 'Delete' || key === 'Backspace'; // Non printable keys have a name, e.g. "ArrowRight", see the whole list:
|
|
12
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
13
|
+
|
|
14
|
+
export const isPrintableKey = key => key.length === 1;
|
|
14
15
|
export const GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
15
16
|
export const GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|
|
16
17
|
export const GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
|
|
@@ -109,7 +109,7 @@ DataGridRaw.propTypes = {
|
|
|
109
109
|
columns: (0, _utils.chainPropTypes)(_propTypes.default.array.isRequired, props => {
|
|
110
110
|
// @ts-ignore because otherwise `build:api` doesn't work
|
|
111
111
|
if (props.columns && props.columns.some(column => column.resizable)) {
|
|
112
|
-
return new Error([`MUI: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to
|
|
112
|
+
return new Error([`MUI: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return null;
|
|
@@ -679,14 +679,14 @@ DataGridRaw.propTypes = {
|
|
|
679
679
|
*/
|
|
680
680
|
pageSize: (0, _utils.chainPropTypes)(_propTypes.default.number, props => {
|
|
681
681
|
if (props.pageSize && props.pageSize > _useDataGridProps.MAX_PAGE_SIZE) {
|
|
682
|
-
return new Error([`MUI: \`<DataGrid pageSize={${props.pageSize}} />\` is not a valid prop.`, `Only page size below ${_useDataGridProps.MAX_PAGE_SIZE} is available in the MIT version.`, '', 'You need to upgrade to
|
|
682
|
+
return new Error([`MUI: \`<DataGrid pageSize={${props.pageSize}} />\` is not a valid prop.`, `Only page size below ${_useDataGridProps.MAX_PAGE_SIZE} is available in the MIT version.`, '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
return null;
|
|
686
686
|
}),
|
|
687
687
|
pagination: props => {
|
|
688
688
|
if (props.pagination === false) {
|
|
689
|
-
return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to
|
|
689
|
+
return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination.'].join('\n'));
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
return null;
|
|
@@ -766,7 +766,7 @@ DataGridRaw.propTypes = {
|
|
|
766
766
|
*/
|
|
767
767
|
selectionModel: (0, _utils.chainPropTypes)(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.array]), props => {
|
|
768
768
|
if (!props.checkboxSelection && Array.isArray(props.selectionModel) && props.selectionModel.length > 1) {
|
|
769
|
-
return new Error([`MUI: \`<DataGrid selectionModel={${JSON.stringify(props.selectionModel)}} />\` is not a valid prop.`, 'selectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to
|
|
769
|
+
return new Error([`MUI: \`<DataGrid selectionModel={${JSON.stringify(props.selectionModel)}} />\` is not a valid prop.`, 'selectionModel can only be of 1 item in DataGrid.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\n'));
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
return null;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.GRID_CHECKBOX_SELECTION_COL_DEF = void 0;
|
|
8
|
+
exports.GRID_CHECKBOX_SELECTION_FIELD = exports.GRID_CHECKBOX_SELECTION_COL_DEF = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -25,8 +25,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
+
const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
|
|
29
|
+
exports.GRID_CHECKBOX_SELECTION_FIELD = GRID_CHECKBOX_SELECTION_FIELD;
|
|
28
30
|
const GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanColDef.GRID_BOOLEAN_COL_DEF, {
|
|
29
|
-
field:
|
|
31
|
+
field: GRID_CHECKBOX_SELECTION_FIELD,
|
|
30
32
|
type: 'checkboxSelection',
|
|
31
33
|
width: 50,
|
|
32
34
|
resizable: false,
|
|
@@ -25,7 +25,7 @@ const GRID_NUMERIC_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_S
|
|
|
25
25
|
valueParser: value => value === '' ? null : Number(value),
|
|
26
26
|
valueFormatter: ({
|
|
27
27
|
value
|
|
28
|
-
}) =>
|
|
28
|
+
}) => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
|
|
29
29
|
filterOperators: (0, _gridNumericOperators.getGridNumericOperators)(),
|
|
30
30
|
getApplyQuickFilterFn: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
31
31
|
});
|
|
@@ -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
|
}) => {
|
|
@@ -114,13 +118,14 @@ const getGridStringOperators = () => [{
|
|
|
114
118
|
return null;
|
|
115
119
|
}
|
|
116
120
|
|
|
121
|
+
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
|
|
117
122
|
const collator = new Intl.Collator(undefined, {
|
|
118
123
|
sensitivity: 'base',
|
|
119
124
|
usage: 'search'
|
|
120
125
|
});
|
|
121
126
|
return ({
|
|
122
127
|
value
|
|
123
|
-
}) => value != null ?
|
|
128
|
+
}) => value != null ? filterItemValue.some(filterValue => {
|
|
124
129
|
return collator.compare(filterValue, value.toString() || '') === 0;
|
|
125
130
|
}) : false;
|
|
126
131
|
},
|
|
@@ -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
|
|
@@ -19,6 +19,8 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
19
19
|
|
|
20
20
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
21
21
|
|
|
22
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
23
|
+
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
25
|
|
|
24
26
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "hasFocus", "tabIndex", "getValue"];
|
|
@@ -39,10 +41,10 @@ const useUtilityClasses = ownerState => {
|
|
|
39
41
|
|
|
40
42
|
const GridBooleanCell = /*#__PURE__*/React.memo(props => {
|
|
41
43
|
const {
|
|
42
|
-
value
|
|
43
|
-
api
|
|
44
|
+
value
|
|
44
45
|
} = props,
|
|
45
46
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
46
48
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
47
49
|
const ownerState = {
|
|
48
50
|
classes: rootProps.classes
|
|
@@ -52,7 +54,7 @@ const GridBooleanCell = /*#__PURE__*/React.memo(props => {
|
|
|
52
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, (0, _extends2.default)({
|
|
53
55
|
fontSize: "small",
|
|
54
56
|
className: classes.root,
|
|
55
|
-
titleAccess:
|
|
57
|
+
titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
|
|
56
58
|
"data-value": Boolean(value)
|
|
57
59
|
}, other));
|
|
58
60
|
});
|
|
@@ -26,6 +26,8 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
26
26
|
|
|
27
27
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
28
28
|
|
|
29
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
30
|
+
|
|
29
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
32
|
|
|
31
33
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
@@ -50,13 +52,13 @@ function GridEditBooleanCell(props) {
|
|
|
50
52
|
const {
|
|
51
53
|
id: idProp,
|
|
52
54
|
value,
|
|
53
|
-
api,
|
|
54
55
|
field,
|
|
55
56
|
className,
|
|
56
57
|
hasFocus,
|
|
57
58
|
onValueChange
|
|
58
59
|
} = props,
|
|
59
60
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
61
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
60
62
|
const inputRef = React.useRef(null);
|
|
61
63
|
const id = (0, _utils.unstable_useId)();
|
|
62
64
|
const [valueState, setValueState] = React.useState(value);
|
|
@@ -73,12 +75,12 @@ function GridEditBooleanCell(props) {
|
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
setValueState(newValue);
|
|
76
|
-
await
|
|
78
|
+
await apiRef.current.setEditCellValue({
|
|
77
79
|
id: idProp,
|
|
78
80
|
field,
|
|
79
81
|
value: newValue
|
|
80
82
|
}, event);
|
|
81
|
-
}, [
|
|
83
|
+
}, [apiRef, field, idProp, onValueChange]);
|
|
82
84
|
React.useEffect(() => {
|
|
83
85
|
setValueState(value);
|
|
84
86
|
}, [value]);
|
|
@@ -26,6 +26,8 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
26
26
|
|
|
27
27
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
28
28
|
|
|
29
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
30
|
+
|
|
29
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
32
|
|
|
31
33
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
|
|
@@ -48,7 +50,6 @@ function GridEditDateCell(props) {
|
|
|
48
50
|
const {
|
|
49
51
|
id,
|
|
50
52
|
value: valueProp,
|
|
51
|
-
api,
|
|
52
53
|
field,
|
|
53
54
|
colDef,
|
|
54
55
|
hasFocus,
|
|
@@ -57,6 +58,7 @@ function GridEditDateCell(props) {
|
|
|
57
58
|
} = props,
|
|
58
59
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
59
60
|
const isDateTime = colDef.type === 'dateTime';
|
|
61
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
60
62
|
const inputRef = React.useRef();
|
|
61
63
|
const valueTransformed = React.useMemo(() => {
|
|
62
64
|
let parsedDate;
|
|
@@ -116,12 +118,12 @@ function GridEditDateCell(props) {
|
|
|
116
118
|
parsed: newParsedDate,
|
|
117
119
|
formatted: newFormattedDate
|
|
118
120
|
});
|
|
119
|
-
|
|
121
|
+
apiRef.current.setEditCellValue({
|
|
120
122
|
id,
|
|
121
123
|
field,
|
|
122
124
|
value: newParsedDate
|
|
123
125
|
}, event);
|
|
124
|
-
}, [
|
|
126
|
+
}, [apiRef, field, id, onValueChange]);
|
|
125
127
|
React.useEffect(() => {
|
|
126
128
|
setValueState(state => {
|
|
127
129
|
var _valueTransformed$par, _state$parsed;
|
|
@@ -32,6 +32,8 @@ var _index = require("../icons/index");
|
|
|
32
32
|
|
|
33
33
|
var _GridFilterInputValue = require("../panel/filterPanel/GridFilterInputValue");
|
|
34
34
|
|
|
35
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
36
|
+
|
|
35
37
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
36
38
|
|
|
37
39
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "getValue", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
@@ -71,7 +73,6 @@ function GridEditInputCell(props) {
|
|
|
71
73
|
const {
|
|
72
74
|
id,
|
|
73
75
|
value,
|
|
74
|
-
api,
|
|
75
76
|
field,
|
|
76
77
|
colDef,
|
|
77
78
|
hasFocus,
|
|
@@ -80,6 +81,7 @@ function GridEditInputCell(props) {
|
|
|
80
81
|
onValueChange
|
|
81
82
|
} = props,
|
|
82
83
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
84
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
83
85
|
const inputRef = React.useRef();
|
|
84
86
|
const [valueState, setValueState] = React.useState(value);
|
|
85
87
|
const ownerState = {
|
|
@@ -94,13 +96,13 @@ function GridEditInputCell(props) {
|
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
setValueState(newValue);
|
|
97
|
-
|
|
99
|
+
apiRef.current.setEditCellValue({
|
|
98
100
|
id,
|
|
99
101
|
field,
|
|
100
102
|
value: newValue,
|
|
101
103
|
debounceMs
|
|
102
104
|
}, event);
|
|
103
|
-
}, [
|
|
105
|
+
}, [apiRef, debounceMs, field, id, onValueChange]);
|
|
104
106
|
React.useEffect(() => {
|
|
105
107
|
setValueState(value);
|
|
106
108
|
}, [value]);
|
|
@@ -28,6 +28,8 @@ var _gridEditRowModel = require("../../models/gridEditRowModel");
|
|
|
28
28
|
|
|
29
29
|
var _filterPanelUtils = require("../panel/filterPanel/filterPanelUtils");
|
|
30
30
|
|
|
31
|
+
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
32
|
+
|
|
31
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
34
|
|
|
33
35
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "getValue", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange"];
|
|
@@ -62,6 +64,7 @@ function GridEditSingleSelectCell(props) {
|
|
|
62
64
|
onValueChange
|
|
63
65
|
} = props,
|
|
64
66
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
67
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
65
68
|
const ref = React.useRef();
|
|
66
69
|
const inputRef = React.useRef();
|
|
67
70
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -110,7 +113,7 @@ function GridEditSingleSelectCell(props) {
|
|
|
110
113
|
await onValueChange(event, formattedTargetValue);
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
const isValid = await
|
|
116
|
+
const isValid = await apiRef.current.setEditCellValue({
|
|
114
117
|
id,
|
|
115
118
|
field,
|
|
116
119
|
value: formattedTargetValue
|
|
@@ -125,18 +128,18 @@ function GridEditSingleSelectCell(props) {
|
|
|
125
128
|
return;
|
|
126
129
|
}
|
|
127
130
|
|
|
128
|
-
const canCommit = await Promise.resolve(
|
|
131
|
+
const canCommit = await Promise.resolve(apiRef.current.commitCellChange({
|
|
129
132
|
id,
|
|
130
133
|
field
|
|
131
134
|
}, event));
|
|
132
135
|
|
|
133
136
|
if (canCommit) {
|
|
134
|
-
|
|
137
|
+
apiRef.current.setCellMode(id, field, 'view');
|
|
135
138
|
|
|
136
139
|
if (event.key) {
|
|
137
140
|
// TODO v6: remove once we stop ignoring events fired from portals
|
|
138
|
-
const params =
|
|
139
|
-
|
|
141
|
+
const params = apiRef.current.getCellParams(id, field);
|
|
142
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', params, event);
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
};
|
|
@@ -151,13 +154,13 @@ function GridEditSingleSelectCell(props) {
|
|
|
151
154
|
var _rootProps$experiment2;
|
|
152
155
|
|
|
153
156
|
if ((_rootProps$experiment2 = rootProps.experimentalFeatures) != null && _rootProps$experiment2.newEditingApi) {
|
|
154
|
-
|
|
157
|
+
apiRef.current.stopCellEditMode({
|
|
155
158
|
id,
|
|
156
159
|
field,
|
|
157
160
|
ignoreModifications: true
|
|
158
161
|
});
|
|
159
162
|
} else {
|
|
160
|
-
|
|
163
|
+
apiRef.current.setCellMode(id, field, 'view');
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
};
|
|
@@ -187,6 +187,7 @@ function GridColumnHeaderItem(props) {
|
|
|
187
187
|
field: column.field,
|
|
188
188
|
colDef: column
|
|
189
189
|
}) : column.headerClassName;
|
|
190
|
+
const label = (_column$headerName = column.headerName) != null ? _column$headerName : column.field;
|
|
190
191
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
|
|
191
192
|
ref: headerCellRef,
|
|
192
193
|
className: (0, _clsx.default)(classes.root, headerClassName),
|
|
@@ -199,7 +200,8 @@ function GridColumnHeaderItem(props) {
|
|
|
199
200
|
role: "columnheader",
|
|
200
201
|
tabIndex: tabIndex,
|
|
201
202
|
"aria-colindex": colIndex + 1,
|
|
202
|
-
"aria-sort": ariaSort
|
|
203
|
+
"aria-sort": ariaSort,
|
|
204
|
+
"aria-label": column.renderHeader && headerComponent == null ? label : undefined
|
|
203
205
|
}, mouseEventsHandlers, {
|
|
204
206
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
|
|
205
207
|
className: classes.draggableContainer,
|
|
@@ -209,8 +211,8 @@ function GridColumnHeaderItem(props) {
|
|
|
209
211
|
className: classes.titleContainer,
|
|
210
212
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
211
213
|
className: classes.titleContainerContent,
|
|
212
|
-
children: headerComponent
|
|
213
|
-
label:
|
|
214
|
+
children: column.renderHeader ? headerComponent : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridColumnHeaderTitle.GridColumnHeaderTitle, {
|
|
215
|
+
label: label,
|
|
214
216
|
description: column.description,
|
|
215
217
|
columnWidth: width
|
|
216
218
|
})
|
|
@@ -176,7 +176,7 @@ const GridRootStyles = (0, _styles.styled)('div', {
|
|
|
176
176
|
minWidth: 0,
|
|
177
177
|
flex: 1,
|
|
178
178
|
whiteSpace: 'nowrap',
|
|
179
|
-
|
|
179
|
+
overflowX: 'hidden'
|
|
180
180
|
},
|
|
181
181
|
[`& .${_gridClasses.gridClasses.columnHeaderTitleContainerContent}`]: {
|
|
182
182
|
overflow: 'hidden',
|
|
@@ -112,7 +112,7 @@ function GridColumnsPanel(props) {
|
|
|
112
112
|
return apiRef.current.setColumnVisibilityModel({});
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.map(col => [col.field, false])));
|
|
115
|
+
return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.filter(col => col.hideable !== false).map(col => [col.field, false])));
|
|
116
116
|
} // TODO v6: Remove
|
|
117
117
|
|
|
118
118
|
|
|
@@ -166,7 +166,6 @@ function GridColumnsPanel(props) {
|
|
|
166
166
|
checked: columnVisibilityModel[column.field] !== false,
|
|
167
167
|
onClick: toggleColumn,
|
|
168
168
|
name: column.field,
|
|
169
|
-
color: "primary",
|
|
170
169
|
size: "small"
|
|
171
170
|
}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSwitch)),
|
|
172
171
|
label: column.headerName || column.field
|
|
@@ -183,13 +182,11 @@ function GridColumnsPanel(props) {
|
|
|
183
182
|
})
|
|
184
183
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridPanelFooter.GridPanelFooter, {
|
|
185
184
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
186
|
-
onClick: () => toggleAllColumns(false)
|
|
187
|
-
color: "primary"
|
|
185
|
+
onClick: () => toggleAllColumns(false)
|
|
188
186
|
}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseButton, {
|
|
189
187
|
children: apiRef.current.getLocaleText('columnsPanelHideAllButton')
|
|
190
188
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
191
|
-
onClick: () => toggleAllColumns(true)
|
|
192
|
-
color: "primary"
|
|
189
|
+
onClick: () => toggleAllColumns(true)
|
|
193
190
|
}, (_rootProps$components4 = rootProps.componentsProps) == null ? void 0 : _rootProps$components4.baseButton, {
|
|
194
191
|
children: apiRef.current.getLocaleText('columnsPanelShowAllButton')
|
|
195
192
|
}))]
|
|
@@ -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 */
|