@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
|
@@ -19,15 +19,15 @@ var _Autocomplete = _interopRequireWildcard(require("@mui/material/Autocomplete"
|
|
|
19
19
|
|
|
20
20
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
21
21
|
|
|
22
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
23
|
-
|
|
24
22
|
var _utils = require("@mui/material/utils");
|
|
25
23
|
|
|
26
24
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
27
25
|
|
|
26
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
27
|
+
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
30
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
31
31
|
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
@@ -42,15 +42,36 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
42
42
|
item,
|
|
43
43
|
applyValue,
|
|
44
44
|
apiRef,
|
|
45
|
-
focusElementRef
|
|
45
|
+
focusElementRef,
|
|
46
|
+
color,
|
|
47
|
+
error,
|
|
48
|
+
helperText,
|
|
49
|
+
size,
|
|
50
|
+
variant = 'standard'
|
|
46
51
|
} = props,
|
|
47
52
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
53
|
+
const TextFieldProps = {
|
|
54
|
+
color,
|
|
55
|
+
error,
|
|
56
|
+
helperText,
|
|
57
|
+
size,
|
|
58
|
+
variant
|
|
59
|
+
};
|
|
48
60
|
const id = (0, _utils.unstable_useId)();
|
|
61
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
49
62
|
const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
50
63
|
const resolvedValueOptions = React.useMemo(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
64
|
+
if (!(resolvedColumn != null && resolvedColumn.valueOptions)) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (typeof resolvedColumn.valueOptions === 'function') {
|
|
69
|
+
return resolvedColumn.valueOptions({
|
|
70
|
+
field: resolvedColumn.field
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return resolvedColumn.valueOptions;
|
|
54
75
|
}, [resolvedColumn]);
|
|
55
76
|
const resolvedFormattedValueOptions = React.useMemo(() => {
|
|
56
77
|
return resolvedValueOptions == null ? void 0 : resolvedValueOptions.map(_filterPanelUtils.getValueFromOption);
|
|
@@ -81,7 +102,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
81
102
|
|
|
82
103
|
if (resolvedValueOptions !== undefined) {
|
|
83
104
|
const itemValueIndexes = item.value.map(element => {
|
|
84
|
-
// get the index matching between values and
|
|
105
|
+
// get the index matching between values and valueOptions
|
|
85
106
|
const formattedElement = (0, _filterPanelUtils.getValueFromOption)(element);
|
|
86
107
|
const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;
|
|
87
108
|
return index;
|
|
@@ -107,8 +128,7 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
107
128
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Autocomplete.default, (0, _extends2.default)({
|
|
108
129
|
multiple: true,
|
|
109
130
|
limitTags: 1,
|
|
110
|
-
options: resolvedValueOptions
|
|
111
|
-
,
|
|
131
|
+
options: resolvedValueOptions,
|
|
112
132
|
isOptionEqualToValue: isOptionEqualToValue,
|
|
113
133
|
filterOptions: filter,
|
|
114
134
|
id: id,
|
|
@@ -121,16 +141,19 @@ function GridFilterInputMultipleSingleSelect(props) {
|
|
|
121
141
|
}, getTagProps({
|
|
122
142
|
index
|
|
123
143
|
})))),
|
|
124
|
-
renderInput: params =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
renderInput: params => {
|
|
145
|
+
var _rootProps$components;
|
|
146
|
+
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
|
|
148
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
149
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
150
|
+
InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
|
|
151
|
+
shrink: true
|
|
152
|
+
}),
|
|
153
|
+
inputRef: focusElementRef,
|
|
154
|
+
type: "singleSelect"
|
|
155
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
156
|
+
}
|
|
134
157
|
}, other));
|
|
135
158
|
}
|
|
136
159
|
|
|
@@ -19,13 +19,13 @@ var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete")
|
|
|
19
19
|
|
|
20
20
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
21
21
|
|
|
22
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
23
|
-
|
|
24
22
|
var _utils = require("@mui/material/utils");
|
|
25
23
|
|
|
24
|
+
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
25
|
+
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
|
|
28
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -37,11 +37,24 @@ function GridFilterInputMultipleValue(props) {
|
|
|
37
37
|
applyValue,
|
|
38
38
|
type,
|
|
39
39
|
apiRef,
|
|
40
|
-
focusElementRef
|
|
40
|
+
focusElementRef,
|
|
41
|
+
color,
|
|
42
|
+
error,
|
|
43
|
+
helperText,
|
|
44
|
+
size,
|
|
45
|
+
variant
|
|
41
46
|
} = props,
|
|
42
47
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
48
|
+
const TextFieldProps = {
|
|
49
|
+
color,
|
|
50
|
+
error,
|
|
51
|
+
helperText,
|
|
52
|
+
size,
|
|
53
|
+
variant
|
|
54
|
+
};
|
|
43
55
|
const [filterValueState, setFilterValueState] = React.useState(item.value || []);
|
|
44
56
|
const id = (0, _utils.unstable_useId)();
|
|
57
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
45
58
|
React.useEffect(() => {
|
|
46
59
|
var _item$value;
|
|
47
60
|
|
|
@@ -75,16 +88,19 @@ function GridFilterInputMultipleValue(props) {
|
|
|
75
88
|
}, getTagProps({
|
|
76
89
|
index
|
|
77
90
|
})))),
|
|
78
|
-
renderInput: params =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
renderInput: params => {
|
|
92
|
+
var _rootProps$components;
|
|
93
|
+
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseTextField, (0, _extends2.default)({}, params, {
|
|
95
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
96
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
97
|
+
InputLabelProps: (0, _extends2.default)({}, params.InputLabelProps, {
|
|
98
|
+
shrink: true
|
|
99
|
+
}),
|
|
100
|
+
inputRef: focusElementRef,
|
|
101
|
+
type: type || 'text'
|
|
102
|
+
}, TextFieldProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));
|
|
103
|
+
}
|
|
88
104
|
}, other));
|
|
89
105
|
}
|
|
90
106
|
|
|
@@ -93,7 +109,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
|
|
|
93
109
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
94
110
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
95
111
|
// ----------------------------------------------------------------------
|
|
96
|
-
apiRef: _propTypes.default.
|
|
112
|
+
apiRef: _propTypes.default.shape({
|
|
113
|
+
current: _propTypes.default.object.isRequired
|
|
114
|
+
}).isRequired,
|
|
97
115
|
applyValue: _propTypes.default.func.isRequired,
|
|
98
116
|
focusElementRef: _propTypes.default
|
|
99
117
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -74,6 +74,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
74
74
|
const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
75
75
|
const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
|
|
76
76
|
const currentValueOptions = React.useMemo(() => {
|
|
77
|
+
if (currentColumn === null) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
|
|
78
82
|
field: currentColumn.field
|
|
79
83
|
}) : currentColumn.valueOptions;
|
|
@@ -115,8 +119,8 @@ function GridFilterInputSingleSelect(props) {
|
|
|
115
119
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
116
120
|
value: filterValueState,
|
|
117
121
|
onChange: onFilterChange,
|
|
118
|
-
type: type || 'text',
|
|
119
122
|
variant: "standard",
|
|
123
|
+
type: type || 'text',
|
|
120
124
|
InputLabelProps: {
|
|
121
125
|
shrink: true
|
|
122
126
|
},
|
|
@@ -135,7 +139,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
135
139
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
136
140
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
137
141
|
// ----------------------------------------------------------------------
|
|
138
|
-
apiRef: _propTypes.default.
|
|
142
|
+
apiRef: _propTypes.default.shape({
|
|
143
|
+
current: _propTypes.default.object.isRequired
|
|
144
|
+
}).isRequired,
|
|
139
145
|
applyValue: _propTypes.default.func.isRequired,
|
|
140
146
|
focusElementRef: _propTypes.default
|
|
141
147
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -141,8 +141,8 @@ function GridFilterInputValue(props) {
|
|
|
141
141
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
142
142
|
value: filterValueState,
|
|
143
143
|
onChange: onFilterChange,
|
|
144
|
-
type: type || 'text',
|
|
145
144
|
variant: "standard",
|
|
145
|
+
type: type || 'text',
|
|
146
146
|
InputProps: InputProps,
|
|
147
147
|
InputLabelProps: {
|
|
148
148
|
shrink: true
|
|
@@ -156,7 +156,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
156
156
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
157
157
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
158
158
|
// ----------------------------------------------------------------------
|
|
159
|
-
apiRef: _propTypes.default.
|
|
159
|
+
apiRef: _propTypes.default.shape({
|
|
160
|
+
current: _propTypes.default.object.isRequired
|
|
161
|
+
}).isRequired,
|
|
160
162
|
applyValue: _propTypes.default.func.isRequired,
|
|
161
163
|
focusElementRef: _propTypes.default
|
|
162
164
|
/* @typescript-to-proptypes-ignore */
|
|
@@ -140,8 +140,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
140
140
|
}), !rootProps.disableMultipleColumnsFiltering && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridPanelFooter.GridPanelFooter, {
|
|
141
141
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
142
142
|
onClick: addNewFilter,
|
|
143
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridAddIcon, {})
|
|
144
|
-
color: "primary"
|
|
143
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridAddIcon, {})
|
|
145
144
|
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseButton, {
|
|
146
145
|
children: apiRef.current.getLocaleText('filterPanelAddFilter')
|
|
147
146
|
}))
|
|
@@ -63,7 +63,6 @@ const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function GridTool
|
|
|
63
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
64
64
|
ref: ref,
|
|
65
65
|
size: "small",
|
|
66
|
-
color: "primary",
|
|
67
66
|
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
68
67
|
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.ColumnSelectorIcon, {})
|
|
69
68
|
}, other, {
|
|
@@ -123,7 +123,6 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
123
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
124
124
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
125
125
|
ref: handleRef,
|
|
126
|
-
color: "primary",
|
|
127
126
|
size: "small",
|
|
128
127
|
startIcon: startIcon,
|
|
129
128
|
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
@@ -75,7 +75,6 @@ const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
75
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
76
76
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
77
77
|
ref: handleRef,
|
|
78
|
-
color: "primary",
|
|
79
78
|
size: "small",
|
|
80
79
|
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.ExportIcon, {}),
|
|
81
80
|
"aria-expanded": open ? 'true' : undefined,
|
|
@@ -136,7 +136,6 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
136
136
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseButton, (0, _extends2.default)({
|
|
137
137
|
ref: ref,
|
|
138
138
|
size: "small",
|
|
139
|
-
color: "primary",
|
|
140
139
|
"aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
|
|
141
140
|
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
|
|
142
141
|
badgeContent: activeFilters.length,
|
|
@@ -111,6 +111,7 @@ const GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
111
111
|
groupColumn: name => `Group by ${name}`,
|
|
112
112
|
unGroupColumn: name => `Stop grouping by ${name}`,
|
|
113
113
|
// Master/detail
|
|
114
|
+
detailPanelToggle: 'Detail panel toggle',
|
|
114
115
|
expandDetailPanel: 'Expand',
|
|
115
116
|
collapseDetailPanel: 'Collapse',
|
|
116
117
|
// Used core components translation keys
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.useGridColumnSpanning = void 0;
|
|
9
7
|
|
|
10
|
-
var
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
9
|
|
|
12
10
|
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
13
11
|
|
|
14
12
|
var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
|
|
15
13
|
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
16
18
|
/**
|
|
17
19
|
* @requires useGridColumns (method, event)
|
|
18
20
|
* @requires useGridParamsApi (method)
|
|
19
21
|
*/
|
|
20
22
|
const useGridColumnSpanning = apiRef => {
|
|
21
|
-
const lookup =
|
|
22
|
-
|
|
23
|
-
const setCellColSpanInfo = _react.default.useCallback((rowId, columnIndex, cellColSpanInfo) => {
|
|
23
|
+
const lookup = React.useRef({});
|
|
24
|
+
const setCellColSpanInfo = React.useCallback((rowId, columnIndex, cellColSpanInfo) => {
|
|
24
25
|
const sizes = lookup.current;
|
|
25
26
|
|
|
26
27
|
if (!sizes[rowId]) {
|
|
@@ -29,15 +30,13 @@ const useGridColumnSpanning = apiRef => {
|
|
|
29
30
|
|
|
30
31
|
sizes[rowId][columnIndex] = cellColSpanInfo;
|
|
31
32
|
}, []);
|
|
32
|
-
|
|
33
|
-
const getCellColSpanInfo = _react.default.useCallback((rowId, columnIndex) => {
|
|
33
|
+
const getCellColSpanInfo = React.useCallback((rowId, columnIndex) => {
|
|
34
34
|
var _lookup$current$rowId;
|
|
35
35
|
|
|
36
36
|
return (_lookup$current$rowId = lookup.current[rowId]) == null ? void 0 : _lookup$current$rowId[columnIndex];
|
|
37
37
|
}, []); // Calculate `colSpan` for the cell.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
const calculateCellColSpan = _react.default.useCallback(params => {
|
|
39
|
+
const calculateCellColSpan = React.useCallback(params => {
|
|
41
40
|
const {
|
|
42
41
|
columnIndex,
|
|
43
42
|
rowId,
|
|
@@ -91,8 +90,7 @@ const useGridColumnSpanning = apiRef => {
|
|
|
91
90
|
};
|
|
92
91
|
}, [apiRef, setCellColSpanInfo]); // Calculate `colSpan` for each cell in the row
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
const calculateColSpan = _react.default.useCallback(({
|
|
93
|
+
const calculateColSpan = React.useCallback(({
|
|
96
94
|
rowId,
|
|
97
95
|
minFirstColumn,
|
|
98
96
|
maxLastColumn
|
|
@@ -110,18 +108,15 @@ const useGridColumnSpanning = apiRef => {
|
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
}, [calculateCellColSpan]);
|
|
113
|
-
|
|
114
111
|
const columnSpanningApi = {
|
|
115
112
|
unstable_getCellColSpanInfo: getCellColSpanInfo,
|
|
116
113
|
unstable_calculateColSpan: calculateColSpan
|
|
117
114
|
};
|
|
118
115
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, columnSpanningApi, 'GridColumnSpanningAPI');
|
|
119
|
-
|
|
120
|
-
const handleColumnReorderChange = _react.default.useCallback(() => {
|
|
116
|
+
const handleColumnReorderChange = React.useCallback(() => {
|
|
121
117
|
// `colSpan` needs to be recalculated after column reordering
|
|
122
118
|
lookup.current = {};
|
|
123
119
|
}, []);
|
|
124
|
-
|
|
125
120
|
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnOrderChange', handleColumnReorderChange);
|
|
126
121
|
};
|
|
127
122
|
|
|
@@ -58,7 +58,7 @@ const hasScroll = ({
|
|
|
58
58
|
|
|
59
59
|
function useGridDimensions(apiRef, props) {
|
|
60
60
|
const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useResizeContainer');
|
|
61
|
-
const
|
|
61
|
+
const errorShown = React.useRef(false);
|
|
62
62
|
const rootDimensionsRef = React.useRef(null);
|
|
63
63
|
const fullDimensionsRef = React.useRef(null);
|
|
64
64
|
const rowsMeta = (0, _utils2.useGridSelector)(apiRef, _gridRowsMetaSelector.gridRowsMetaSelector);
|
|
@@ -92,21 +92,34 @@ function useGridDimensions(apiRef, props) {
|
|
|
92
92
|
rootElement.removeChild(scrollDiv);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
let viewportOuterSize;
|
|
96
|
+
let hasScrollX;
|
|
97
|
+
let hasScrollY;
|
|
98
|
+
|
|
99
|
+
if (props.autoHeight) {
|
|
100
|
+
hasScrollY = false;
|
|
101
|
+
hasScrollX = Math.round(columnsTotalWidth) > rootDimensionsRef.current.width;
|
|
102
|
+
viewportOuterSize = {
|
|
103
|
+
width: rootDimensionsRef.current.width,
|
|
104
|
+
height: rowsMeta.currentPageTotalHeight + (hasScrollX ? scrollBarSize : 0)
|
|
105
|
+
};
|
|
106
|
+
} else {
|
|
107
|
+
viewportOuterSize = {
|
|
108
|
+
width: rootDimensionsRef.current.width,
|
|
109
|
+
height: rootDimensionsRef.current.height - headerHeight
|
|
110
|
+
};
|
|
111
|
+
const scrollInformation = hasScroll({
|
|
112
|
+
content: {
|
|
113
|
+
width: Math.round(columnsTotalWidth),
|
|
114
|
+
height: rowsMeta.currentPageTotalHeight
|
|
115
|
+
},
|
|
116
|
+
container: viewportOuterSize,
|
|
117
|
+
scrollBarSize
|
|
118
|
+
});
|
|
119
|
+
hasScrollY = scrollInformation.hasScrollY;
|
|
120
|
+
hasScrollX = scrollInformation.hasScrollX;
|
|
121
|
+
}
|
|
122
|
+
|
|
110
123
|
const viewportInnerSize = {
|
|
111
124
|
width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),
|
|
112
125
|
height: viewportOuterSize.height - (hasScrollX ? scrollBarSize : 0)
|
|
@@ -115,7 +128,8 @@ function useGridDimensions(apiRef, props) {
|
|
|
115
128
|
viewportOuterSize,
|
|
116
129
|
viewportInnerSize,
|
|
117
130
|
hasScrollX,
|
|
118
|
-
hasScrollY
|
|
131
|
+
hasScrollY,
|
|
132
|
+
scrollBarSize
|
|
119
133
|
};
|
|
120
134
|
const prevDimensions = fullDimensionsRef.current;
|
|
121
135
|
fullDimensionsRef.current = newFullDimensions;
|
|
@@ -165,14 +179,14 @@ function useGridDimensions(apiRef, props) {
|
|
|
165
179
|
|
|
166
180
|
const isJSDOM = /jsdom/.test(window.navigator.userAgent);
|
|
167
181
|
|
|
168
|
-
if (size.height === 0 && !
|
|
169
|
-
logger.
|
|
170
|
-
|
|
182
|
+
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
183
|
+
logger.error(['The parent DOM element of the data grid has an empty height.', 'Please make sure that this element has an intrinsic height.', 'The grid displays with a height of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
184
|
+
errorShown.current = true;
|
|
171
185
|
}
|
|
172
186
|
|
|
173
|
-
if (size.width === 0 && !
|
|
174
|
-
logger.
|
|
175
|
-
|
|
187
|
+
if (size.width === 0 && !errorShown.current && !isJSDOM) {
|
|
188
|
+
logger.error(['The parent DOM element of the data grid has an empty width.', 'Please make sure that this element has an intrinsic width.', 'The grid displays with a width of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
189
|
+
errorShown.current = true;
|
|
176
190
|
}
|
|
177
191
|
|
|
178
192
|
if (isTestEnvironment) {
|
|
@@ -95,6 +95,12 @@ const useGridCellEditing = (apiRef, props) => {
|
|
|
95
95
|
}, [apiRef]);
|
|
96
96
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
97
97
|
if (params.cellMode === _gridEditRowModel.GridCellModes.Edit) {
|
|
98
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
99
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
100
|
+
if (event.which === 229) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
98
104
|
let reason;
|
|
99
105
|
|
|
100
106
|
if (event.key === 'Escape') {
|
|
@@ -199,6 +199,12 @@ const useCellEditing = (apiRef, props) => {
|
|
|
199
199
|
};
|
|
200
200
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, cellEditingApi, 'EditRowApi');
|
|
201
201
|
const handleCellKeyDown = React.useCallback(async (params, event) => {
|
|
202
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
203
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
204
|
+
if (event.which === 229) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
202
208
|
const {
|
|
203
209
|
id,
|
|
204
210
|
field,
|
|
@@ -134,6 +134,12 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
134
134
|
}, []);
|
|
135
135
|
const handleCellKeyDown = React.useCallback((params, event) => {
|
|
136
136
|
if (params.cellMode === _gridEditRowModel.GridRowModes.Edit) {
|
|
137
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
138
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
139
|
+
if (event.which === 229) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
137
143
|
let reason;
|
|
138
144
|
|
|
139
145
|
if (event.key === 'Escape') {
|
|
@@ -199,6 +199,12 @@ const useGridRowEditing = (apiRef, props) => {
|
|
|
199
199
|
};
|
|
200
200
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, rowEditingApi, 'EditRowApi');
|
|
201
201
|
const handleCellKeyDown = React.useCallback(async (params, event) => {
|
|
202
|
+
// Wait until IME is settled for Asian languages like Japanese and Chinese
|
|
203
|
+
// TODO: `event.which` is depricated but this is a temporary workaround
|
|
204
|
+
if (event.which === 229) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
202
208
|
const {
|
|
203
209
|
cellMode,
|
|
204
210
|
isEditable
|
|
@@ -30,8 +30,9 @@ const cleanFilterItem = (item, apiRef) => {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
if (cleanItem.operatorValue == null) {
|
|
33
|
-
//
|
|
34
|
-
|
|
33
|
+
// Selects a default operator
|
|
34
|
+
// We don't use `apiRef.current.getColumn` because it is not ready during state initialization
|
|
35
|
+
const column = (0, _columns.gridColumnLookupSelector)(apiRef)[cleanItem.columnField];
|
|
35
36
|
cleanItem.operatorValue = column && column.filterOperators[0].value;
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -208,14 +209,16 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
208
209
|
const sanitizedQuickFilterValues = quickFilterValues.filter((value, index) => Object.keys(appliersPerColumnField).some(field => appliersPerColumnField[field][index] != null));
|
|
209
210
|
return (rowId, shouldApplyFilter) => {
|
|
210
211
|
const usedCellParams = {};
|
|
212
|
+
const columnsFieldsToFilter = [];
|
|
211
213
|
Object.keys(appliersPerColumnField).forEach(columnField => {
|
|
212
214
|
if (!shouldApplyFilter || shouldApplyFilter(columnField)) {
|
|
213
215
|
usedCellParams[columnField] = apiRef.current.getCellParams(rowId, columnField);
|
|
216
|
+
columnsFieldsToFilter.push(columnField);
|
|
214
217
|
}
|
|
215
218
|
}); // Return `false` as soon as we have a quick filter value that does not match any column
|
|
216
219
|
|
|
217
220
|
if (quickFilterLogicOperator === _models.GridLinkOperator.And) {
|
|
218
|
-
return sanitizedQuickFilterValues.every((value, index) =>
|
|
221
|
+
return sanitizedQuickFilterValues.every((value, index) => columnsFieldsToFilter.some(field => {
|
|
219
222
|
var _appliersPerColumnFie, _appliersPerColumnFie2;
|
|
220
223
|
|
|
221
224
|
if (appliersPerColumnField[field][index] == null) {
|
|
@@ -227,7 +230,7 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
227
230
|
} // Return `true` as soon as we have have a quick filter value that match any column
|
|
228
231
|
|
|
229
232
|
|
|
230
|
-
return sanitizedQuickFilterValues.some((value, index) =>
|
|
233
|
+
return sanitizedQuickFilterValues.some((value, index) => columnsFieldsToFilter.some(field => {
|
|
231
234
|
var _appliersPerColumnFie3, _appliersPerColumnFie4;
|
|
232
235
|
|
|
233
236
|
if (appliersPerColumnField[field][index] == null) {
|
|
@@ -124,7 +124,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
124
124
|
const updateRows = React.useCallback(updates => {
|
|
125
125
|
if (props.signature === _useGridApiEventHandler.GridSignature.DataGrid && updates.length > 1) {
|
|
126
126
|
// TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.
|
|
127
|
-
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to
|
|
127
|
+
throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.", 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
128
128
|
} // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.
|
|
129
129
|
|
|
130
130
|
|
|
@@ -349,10 +349,23 @@ const useGridRows = (apiRef, props) => {
|
|
|
349
349
|
if (isFirstRender.current) {
|
|
350
350
|
isFirstRender.current = false;
|
|
351
351
|
return;
|
|
352
|
-
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const areNewRowsAlreadyInState = apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows;
|
|
355
|
+
const isNewLoadingAlreadyInState = apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading; // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)
|
|
353
356
|
|
|
357
|
+
if (areNewRowsAlreadyInState) {
|
|
358
|
+
// If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`
|
|
359
|
+
if (!isNewLoadingAlreadyInState) {
|
|
360
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
361
|
+
rows: (0, _extends2.default)({}, state.rows, {
|
|
362
|
+
loading: props.loading
|
|
363
|
+
})
|
|
364
|
+
}));
|
|
365
|
+
apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates = props.loading;
|
|
366
|
+
apiRef.current.forceUpdate();
|
|
367
|
+
}
|
|
354
368
|
|
|
355
|
-
if (apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows && apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading) {
|
|
356
369
|
return;
|
|
357
370
|
}
|
|
358
371
|
|