@mui/x-data-grid 8.0.0-alpha.3 → 8.0.0-alpha.5
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 +377 -0
- package/DataGrid/DataGrid.js +7 -11
- package/DataGrid/useDataGridProps.js +3 -3
- package/README.md +1 -1
- package/components/GridRow.js +13 -2
- package/components/cell/GridActionsCell.js +8 -1
- package/components/cell/GridActionsCellItem.js +4 -6
- package/components/cell/GridCell.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanelContent.js +7 -3
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +4 -3
- package/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/components/virtualization/GridMainContainer.js +1 -1
- package/constants/dataGridPropsDefaultValues.js +1 -1
- package/hooks/core/useGridStateInitialization.js +3 -3
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/filter/useGridFilter.js +1 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/overlays/useGridOverlays.js +3 -1
- package/hooks/features/pagination/gridPaginationSelector.d.ts +15 -9
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/hooks/features/rowSelection/utils.d.ts +1 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/hooks/features/rows/gridRowsSelector.d.ts +23 -12
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/hooks/features/rows/useGridRows.js +5 -5
- package/hooks/features/sorting/gridSortingSelector.d.ts +10 -5
- package/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/hooks/features/sorting/index.d.ts +2 -1
- package/hooks/features/sorting/index.js +1 -1
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/hooks/utils/useGridSelector.d.ts +4 -6
- package/hooks/utils/useGridSelector.js +6 -44
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/locales/koKR.js +45 -49
- package/locales/roRO.js +18 -20
- package/material/index.js +30 -4
- package/models/api/gridStateApi.d.ts +1 -1
- package/models/controlStateItem.d.ts +2 -2
- package/models/gridBaseSlots.d.ts +21 -0
- package/models/gridBaseSlots.js +1 -0
- package/models/gridSlotsComponentsProps.d.ts +25 -5
- package/models/props/DataGridProps.d.ts +1 -6
- package/modern/DataGrid/DataGrid.js +7 -11
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/components/GridRow.js +13 -2
- package/modern/components/cell/GridActionsCell.js +8 -1
- package/modern/components/cell/GridActionsCellItem.js +4 -6
- package/modern/components/cell/GridCell.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/modern/components/panel/GridColumnsPanel.js +1 -2
- package/modern/components/panel/GridPanelContent.js +7 -3
- package/modern/components/panel/GridPanelFooter.js +4 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/modern/components/virtualization/GridMainContainer.js +1 -1
- package/modern/constants/dataGridPropsDefaultValues.js +1 -1
- package/modern/hooks/core/useGridStateInitialization.js +3 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/filter/useGridFilter.js +1 -1
- package/modern/hooks/features/overlays/useGridOverlays.js +3 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/modern/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/modern/hooks/features/rows/useGridRows.js +5 -5
- package/modern/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/modern/hooks/features/sorting/index.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/modern/hooks/utils/useGridSelector.js +6 -44
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/internals/utils/index.js +0 -1
- package/modern/locales/koKR.js +45 -49
- package/modern/locales/roRO.js +18 -20
- package/modern/material/index.js +30 -4
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/utils/createSelector.js +1 -120
- package/node/DataGrid/DataGrid.js +7 -11
- package/node/DataGrid/useDataGridProps.js +2 -2
- package/node/components/GridRow.js +13 -2
- package/node/components/cell/GridActionsCell.js +8 -1
- package/node/components/cell/GridActionsCellItem.js +3 -5
- package/node/components/cell/GridCell.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/node/components/panel/GridColumnsPanel.js +1 -2
- package/node/components/panel/GridPanelContent.js +7 -3
- package/node/components/panel/GridPanelFooter.js +5 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/node/components/virtualization/GridMainContainer.js +1 -1
- package/node/constants/dataGridPropsDefaultValues.js +1 -1
- package/node/hooks/core/useGridStateInitialization.js +3 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/overlays/useGridOverlays.js +3 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/node/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/node/hooks/features/rows/useGridRows.js +5 -5
- package/node/hooks/features/sorting/gridSortingSelector.js +12 -1
- package/node/hooks/features/sorting/index.js +24 -16
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/node/hooks/utils/useGridSelector.js +8 -47
- package/node/index.js +1 -1
- package/node/internals/index.js +8 -22
- package/node/internals/utils/index.js +0 -11
- package/node/locales/koKR.js +45 -49
- package/node/locales/roRO.js +18 -20
- package/node/material/index.js +31 -4
- package/node/models/gridBaseSlots.js +5 -0
- package/node/utils/createSelector.js +4 -125
- package/package.json +2 -2
- package/utils/createSelector.d.ts +4 -16
- package/utils/createSelector.js +1 -120
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
package/modern/locales/roRO.js
CHANGED
|
@@ -24,16 +24,15 @@ const roROGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: 'Căutare',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'Ștergere',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: 'Scrie un prompt…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: 'Scrie sau înregistrează un prompt…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: 'Ascultare prompt…',
|
|
30
|
+
toolbarPromptControlLabel: 'Introducere prompt',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: 'Înregistrează',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: 'Oprește înregistrare',
|
|
33
|
+
toolbarPromptControlSendActionLabel: 'Trimite',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: 'Trimite prompt',
|
|
35
|
+
toolbarPromptControlErrorMessage: 'A apărut o eroare la procesare. Încercați din nou cu un alt prompt.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: 'Export',
|
|
39
38
|
toolbarExportLabel: 'Export',
|
|
@@ -41,12 +40,11 @@ const roROGrid = {
|
|
|
41
40
|
toolbarExportPrint: 'Printare',
|
|
42
41
|
toolbarExportExcel: 'Download în format Excel',
|
|
43
42
|
// Columns management text
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
columnsManagementSearchTitle: 'Caută',
|
|
44
|
+
columnsManagementNoColumns: 'Nicio coloană',
|
|
45
|
+
columnsManagementShowHideAllText: 'Arată/Ascunde tot',
|
|
46
|
+
columnsManagementReset: 'Resetează',
|
|
47
|
+
columnsManagementDeleteIconLabel: 'Șterge',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: 'Adăugare filtru',
|
|
52
50
|
filterPanelRemoveAll: 'Șterge tot',
|
|
@@ -60,9 +58,9 @@ const roROGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: 'Filtrare valoare',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: 'conține',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: 'nu conține',
|
|
64
62
|
filterOperatorEquals: 'este egal cu',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: 'nu este egal cu',
|
|
66
64
|
filterOperatorStartsWith: 'începe cu',
|
|
67
65
|
filterOperatorEndsWith: 'se termină cu',
|
|
68
66
|
filterOperatorIs: 'este',
|
|
@@ -82,9 +80,9 @@ const roROGrid = {
|
|
|
82
80
|
'filterOperator<=': '<=',
|
|
83
81
|
// Header filter operators text
|
|
84
82
|
headerFilterOperatorContains: 'Conține',
|
|
85
|
-
|
|
83
|
+
headerFilterOperatorDoesNotContain: 'Nu conține',
|
|
86
84
|
headerFilterOperatorEquals: 'Egal cu',
|
|
87
|
-
|
|
85
|
+
headerFilterOperatorDoesNotEqual: 'Nu este egal cu',
|
|
88
86
|
headerFilterOperatorStartsWith: 'Începe cu',
|
|
89
87
|
headerFilterOperatorEndsWith: 'Se termină cu',
|
|
90
88
|
headerFilterOperatorIs: 'Este',
|
package/modern/material/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["inert", "iconStart", "iconEnd", "children"];
|
|
4
|
+
import * as React from 'react';
|
|
2
5
|
import MUIBadge from '@mui/material/Badge';
|
|
3
6
|
import MUICheckbox from '@mui/material/Checkbox';
|
|
4
7
|
import MUIDivider from '@mui/material/Divider';
|
|
8
|
+
import MUIListItemIcon from '@mui/material/ListItemIcon';
|
|
9
|
+
import MUIListItemText from '@mui/material/ListItemText';
|
|
5
10
|
import MUIMenuList from '@mui/material/MenuList';
|
|
6
11
|
import MUIMenuItem from '@mui/material/MenuItem';
|
|
7
12
|
import MUITextField from '@mui/material/TextField';
|
|
@@ -17,6 +22,7 @@ import MUIChip from '@mui/material/Chip';
|
|
|
17
22
|
import { GridColumnUnsortedIcon } from "./icons/GridColumnUnsortedIcon.js";
|
|
18
23
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from "./icons/index.js";
|
|
19
24
|
import MUISelectOption from "./components/MUISelectOption.js";
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
26
|
const iconSlots = {
|
|
21
27
|
booleanCellTrueIcon: GridCheckIcon,
|
|
22
28
|
booleanCellFalseIcon: GridCloseIcon,
|
|
@@ -54,12 +60,12 @@ const iconSlots = {
|
|
|
54
60
|
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
55
61
|
columnReorderIcon: GridDragIcon
|
|
56
62
|
};
|
|
57
|
-
const
|
|
63
|
+
const baseSlots = {
|
|
58
64
|
baseBadge: MUIBadge,
|
|
59
65
|
baseCheckbox: MUICheckbox,
|
|
60
66
|
baseDivider: MUIDivider,
|
|
61
67
|
baseMenuList: MUIMenuList,
|
|
62
|
-
baseMenuItem:
|
|
68
|
+
baseMenuItem: BaseMenuItem,
|
|
63
69
|
baseTextField: MUITextField,
|
|
64
70
|
baseFormControl: MUIFormControl,
|
|
65
71
|
baseSelect: MUISelect,
|
|
@@ -71,5 +77,25 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
71
77
|
baseInputLabel: MUIInputLabel,
|
|
72
78
|
baseSelectOption: MUISelectOption,
|
|
73
79
|
baseChip: MUIChip
|
|
74
|
-
}
|
|
75
|
-
|
|
80
|
+
};
|
|
81
|
+
const materialSlots = _extends({}, baseSlots, iconSlots);
|
|
82
|
+
export default materialSlots;
|
|
83
|
+
function BaseMenuItem(props) {
|
|
84
|
+
const {
|
|
85
|
+
inert,
|
|
86
|
+
iconStart,
|
|
87
|
+
iconEnd,
|
|
88
|
+
children
|
|
89
|
+
} = props,
|
|
90
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
91
|
+
if (inert) {
|
|
92
|
+
other.disableRipple = true;
|
|
93
|
+
}
|
|
94
|
+
return /*#__PURE__*/React.createElement(MUIMenuItem, other, [iconStart && /*#__PURE__*/_jsx(MUIListItemIcon, {
|
|
95
|
+
children: iconStart
|
|
96
|
+
}, "1"), /*#__PURE__*/_jsx(MUIListItemText, {
|
|
97
|
+
children: children
|
|
98
|
+
}, "2"), iconEnd && /*#__PURE__*/_jsx(MUIListItemIcon, {
|
|
99
|
+
children: iconEnd
|
|
100
|
+
}, "3")]);
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,19 +8,6 @@ const reselectCreateSelector = createSelectorCreator({
|
|
|
8
8
|
equalityCheck: Object.is
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
// TODO v8: Remove this type
|
|
13
|
-
|
|
14
|
-
// TODO v8: Rename this type to `OutputSelector`
|
|
15
|
-
|
|
16
|
-
// TODO v8: Remove this type
|
|
17
|
-
|
|
18
|
-
// TODO v8: Rename this type to `SelectorArgs`
|
|
19
|
-
|
|
20
|
-
// TODO v8: Remove this type
|
|
21
|
-
|
|
22
|
-
// TODO v8: Rename this type to `CreateSelectorFunction`
|
|
23
|
-
|
|
24
11
|
const cache = new WeakMap();
|
|
25
12
|
function checkIsAPIRef(value) {
|
|
26
13
|
return 'current' in value && 'instanceId' in value.current;
|
|
@@ -28,83 +15,12 @@ function checkIsAPIRef(value) {
|
|
|
28
15
|
const DEFAULT_INSTANCE_ID = {
|
|
29
16
|
id: 'default'
|
|
30
17
|
};
|
|
31
|
-
|
|
32
|
-
// TODO v8: Remove this function
|
|
33
18
|
export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
34
19
|
if (other.length > 0) {
|
|
35
20
|
throw new Error('Unsupported number of selectors');
|
|
36
21
|
}
|
|
37
22
|
let selector;
|
|
38
23
|
|
|
39
|
-
// eslint-disable-next-line id-denylist
|
|
40
|
-
if (a && b && c && d && e && f) {
|
|
41
|
-
selector = (stateOrApiRef, instanceIdParam) => {
|
|
42
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
43
|
-
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
44
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
45
|
-
const va = a(state, instanceId);
|
|
46
|
-
const vb = b(state, instanceId);
|
|
47
|
-
const vc = c(state, instanceId);
|
|
48
|
-
const vd = d(state, instanceId);
|
|
49
|
-
const ve = e(state, instanceId);
|
|
50
|
-
return f(va, vb, vc, vd, ve);
|
|
51
|
-
};
|
|
52
|
-
// eslint-disable-next-line id-denylist
|
|
53
|
-
} else if (a && b && c && d && e) {
|
|
54
|
-
selector = (stateOrApiRef, instanceIdParam) => {
|
|
55
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
56
|
-
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
57
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
58
|
-
const va = a(state, instanceId);
|
|
59
|
-
const vb = b(state, instanceId);
|
|
60
|
-
const vc = c(state, instanceId);
|
|
61
|
-
const vd = d(state, instanceId);
|
|
62
|
-
return e(va, vb, vc, vd);
|
|
63
|
-
};
|
|
64
|
-
} else if (a && b && c && d) {
|
|
65
|
-
selector = (stateOrApiRef, instanceIdParam) => {
|
|
66
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
67
|
-
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
68
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
69
|
-
const va = a(state, instanceId);
|
|
70
|
-
const vb = b(state, instanceId);
|
|
71
|
-
const vc = c(state, instanceId);
|
|
72
|
-
return d(va, vb, vc);
|
|
73
|
-
};
|
|
74
|
-
} else if (a && b && c) {
|
|
75
|
-
selector = (stateOrApiRef, instanceIdParam) => {
|
|
76
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
77
|
-
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
78
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
79
|
-
const va = a(state, instanceId);
|
|
80
|
-
const vb = b(state, instanceId);
|
|
81
|
-
return c(va, vb);
|
|
82
|
-
};
|
|
83
|
-
} else if (a && b) {
|
|
84
|
-
selector = (stateOrApiRef, instanceIdParam) => {
|
|
85
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
86
|
-
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
87
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
88
|
-
const va = a(state, instanceId);
|
|
89
|
-
return b(va);
|
|
90
|
-
};
|
|
91
|
-
} else {
|
|
92
|
-
throw new Error('Missing arguments');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// We use this property to detect if the selector was created with createSelector
|
|
96
|
-
// or it's only a simple function the receives the state and returns part of it.
|
|
97
|
-
selector.acceptsApiRef = true;
|
|
98
|
-
return selector;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// TODO v8: Rename this function to `createSelector`
|
|
102
|
-
export const createSelectorV8 = (a, b, c, d, e, f, ...other) => {
|
|
103
|
-
if (other.length > 0) {
|
|
104
|
-
throw new Error('Unsupported number of selectors');
|
|
105
|
-
}
|
|
106
|
-
let selector;
|
|
107
|
-
|
|
108
24
|
// eslint-disable-next-line id-denylist
|
|
109
25
|
if (a && b && c && d && e && f) {
|
|
110
26
|
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
@@ -166,49 +82,14 @@ export const createSelectorV8 = (a, b, c, d, e, f, ...other) => {
|
|
|
166
82
|
selector.acceptsApiRef = true;
|
|
167
83
|
return selector;
|
|
168
84
|
};
|
|
169
|
-
|
|
170
|
-
// TODO v8: Remove this function
|
|
171
85
|
export const createSelectorMemoized = (...args) => {
|
|
172
|
-
const selector = (stateOrApiRef, instanceId) => {
|
|
173
|
-
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
174
|
-
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
|
|
175
|
-
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
176
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
177
|
-
if (cacheKey.id === 'default') {
|
|
178
|
-
warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
const cacheArgsInit = cache.get(cacheKey);
|
|
182
|
-
const cacheArgs = cacheArgsInit ?? new Map();
|
|
183
|
-
const cacheFn = cacheArgs?.get(args);
|
|
184
|
-
if (cacheArgs && cacheFn) {
|
|
185
|
-
// We pass the cache key because the called selector might have as
|
|
186
|
-
// dependency another selector created with this `createSelector`.
|
|
187
|
-
return cacheFn(state, cacheKey);
|
|
188
|
-
}
|
|
189
|
-
const fn = reselectCreateSelector(...args);
|
|
190
|
-
if (!cacheArgsInit) {
|
|
191
|
-
cache.set(cacheKey, cacheArgs);
|
|
192
|
-
}
|
|
193
|
-
cacheArgs.set(args, fn);
|
|
194
|
-
return fn(state, cacheKey);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// We use this property to detect if the selector was created with createSelector
|
|
198
|
-
// or it's only a simple function the receives the state and returns part of it.
|
|
199
|
-
selector.acceptsApiRef = true;
|
|
200
|
-
return selector;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
// TODO v8: Rename this function to `createSelectorMemoized`
|
|
204
|
-
export const createSelectorMemoizedV8 = (...args) => {
|
|
205
86
|
const selector = (stateOrApiRef, selectorArgs, instanceId) => {
|
|
206
87
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
207
88
|
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
|
|
208
89
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
209
90
|
if (process.env.NODE_ENV !== 'production') {
|
|
210
91
|
if (cacheKey.id === 'default') {
|
|
211
|
-
warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
|
|
92
|
+
warnOnce(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, args, apiRef.current.instanceId)`.']);
|
|
212
93
|
}
|
|
213
94
|
}
|
|
214
95
|
const cacheArgsInit = cache.get(cacheKey);
|
|
@@ -45,7 +45,7 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
45
45
|
style: props.style,
|
|
46
46
|
sx: props.sx,
|
|
47
47
|
ref: ref
|
|
48
|
-
}, props.
|
|
48
|
+
}, props.slotProps?.root, {
|
|
49
49
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridBody, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridFooterPlaceholder, {})]
|
|
50
50
|
}))
|
|
51
51
|
});
|
|
@@ -102,6 +102,7 @@ DataGridRaw.propTypes = {
|
|
|
102
102
|
*/
|
|
103
103
|
autosizeOptions: _propTypes.default.shape({
|
|
104
104
|
columns: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
105
|
+
disableColumnVirtualization: _propTypes.default.bool,
|
|
105
106
|
expand: _propTypes.default.bool,
|
|
106
107
|
includeHeaders: _propTypes.default.bool,
|
|
107
108
|
includeOutliers: _propTypes.default.bool,
|
|
@@ -255,11 +256,6 @@ DataGridRaw.propTypes = {
|
|
|
255
256
|
quickFilterLogicOperator: _propTypes.default.oneOf(['and', 'or']),
|
|
256
257
|
quickFilterValues: _propTypes.default.array
|
|
257
258
|
}),
|
|
258
|
-
/**
|
|
259
|
-
* Forwarded props for the Data Grid root element.
|
|
260
|
-
* @ignore - do not document.
|
|
261
|
-
*/
|
|
262
|
-
forwardedProps: _propTypes.default.object,
|
|
263
259
|
/**
|
|
264
260
|
* Function that applies CSS classes dynamically on cells.
|
|
265
261
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -708,6 +704,11 @@ DataGridRaw.propTypes = {
|
|
|
708
704
|
* @default "margin"
|
|
709
705
|
*/
|
|
710
706
|
rowSpacingType: _propTypes.default.oneOf(['border', 'margin']),
|
|
707
|
+
/**
|
|
708
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
709
|
+
* @default false
|
|
710
|
+
*/
|
|
711
|
+
rowSpanning: _propTypes.default.bool,
|
|
711
712
|
/**
|
|
712
713
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
713
714
|
*/
|
|
@@ -753,11 +754,6 @@ DataGridRaw.propTypes = {
|
|
|
753
754
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
754
755
|
*/
|
|
755
756
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
756
|
-
/**
|
|
757
|
-
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
758
|
-
* @default false
|
|
759
|
-
*/
|
|
760
|
-
unstable_rowSpanning: _propTypes.default.bool,
|
|
761
757
|
/**
|
|
762
758
|
* If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
|
|
763
759
|
* By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
|
|
@@ -27,12 +27,12 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
27
27
|
};
|
|
28
28
|
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
29
29
|
const useDataGridProps = inProps => {
|
|
30
|
-
const themedProps =
|
|
30
|
+
const themedProps =
|
|
31
31
|
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
32
32
|
(0, _styles.useThemeProps)({
|
|
33
33
|
props: inProps,
|
|
34
34
|
name: 'MuiDataGrid'
|
|
35
|
-
})
|
|
35
|
+
});
|
|
36
36
|
const localeText = React.useMemo(() => (0, _extends2.default)({}, _constants.GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
37
37
|
const slots = React.useMemo(() => (0, _utils.computeSlots)({
|
|
38
38
|
defaultSlots,
|
|
@@ -32,6 +32,7 @@ var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
|
|
|
32
32
|
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
33
33
|
var _useGridConfiguration = require("../hooks/utils/useGridConfiguration");
|
|
34
34
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
35
|
+
var _hooks = require("../hooks");
|
|
35
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
36
37
|
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "dimensions", "renderContext", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
37
38
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
@@ -76,6 +77,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
76
77
|
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
77
78
|
const editing = apiRef.current.getRowMode(rowId) === _gridEditRowModel.GridRowModes.Edit;
|
|
78
79
|
const editable = rootProps.editMode === _gridEditRowModel.GridEditModes.Row;
|
|
80
|
+
const hasColumnVirtualization = (0, _useGridSelector.useGridSelector)(apiRef, _hooks.gridVirtualizationColumnEnabledSelector);
|
|
79
81
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
80
82
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
81
83
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -152,7 +154,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
152
154
|
disableColumnReorder
|
|
153
155
|
} = rootProps;
|
|
154
156
|
const rowReordering = rootProps.rowReordering;
|
|
155
|
-
const heightEntry = (0, _useGridSelector.useGridSelector)(apiRef, () => (0, _extends2.default)({}, apiRef.current.getRowHeightEntry(rowId)), _useGridSelector.objectShallowCompare);
|
|
157
|
+
const heightEntry = (0, _useGridSelector.useGridSelector)(apiRef, () => (0, _extends2.default)({}, apiRef.current.getRowHeightEntry(rowId)), undefined, _useGridSelector.objectShallowCompare);
|
|
156
158
|
const style = React.useMemo(() => {
|
|
157
159
|
if (isNotVisible) {
|
|
158
160
|
return {
|
|
@@ -257,7 +259,16 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
257
259
|
if (hasVirtualFocusCellLeft) {
|
|
258
260
|
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, _GridCell.PinnedPosition.VIRTUAL));
|
|
259
261
|
}
|
|
260
|
-
|
|
262
|
+
let firstColumnIndex;
|
|
263
|
+
let lastColumnIndex;
|
|
264
|
+
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
265
|
+
firstColumnIndex = 0;
|
|
266
|
+
lastColumnIndex = visibleColumns.length;
|
|
267
|
+
} else {
|
|
268
|
+
firstColumnIndex = renderContext.firstColumnIndex;
|
|
269
|
+
lastColumnIndex = renderContext.lastColumnIndex;
|
|
270
|
+
}
|
|
271
|
+
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
261
272
|
const column = visibleColumns[i];
|
|
262
273
|
const indexInSection = i - pinnedColumns.left.length;
|
|
263
274
|
if (!column) {
|
|
@@ -98,6 +98,13 @@ function GridActionsCell(props) {
|
|
|
98
98
|
const hideMenu = () => {
|
|
99
99
|
setOpen(false);
|
|
100
100
|
};
|
|
101
|
+
const toggleMenu = () => {
|
|
102
|
+
if (open) {
|
|
103
|
+
hideMenu();
|
|
104
|
+
} else {
|
|
105
|
+
showMenu();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
101
108
|
const handleTouchRippleRef = index => instance => {
|
|
102
109
|
touchRippleRefs.current[index] = instance;
|
|
103
110
|
};
|
|
@@ -168,7 +175,7 @@ function GridActionsCell(props) {
|
|
|
168
175
|
"aria-controls": open ? menuId : undefined,
|
|
169
176
|
role: "menuitem",
|
|
170
177
|
size: "small",
|
|
171
|
-
onClick:
|
|
178
|
+
onClick: toggleMenu,
|
|
172
179
|
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
173
180
|
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
174
181
|
}, rootProps.slotProps?.baseIconButton, {
|
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
14
13
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
15
|
const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
@@ -54,13 +53,12 @@ const GridActionsCellItem = exports.GridActionsCellItem = /*#__PURE__*/React.for
|
|
|
54
53
|
closeMenu?.();
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, (0, _extends2.default)({
|
|
58
57
|
ref: ref
|
|
59
58
|
}, other, {
|
|
60
59
|
onClick: handleClick,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}), label]
|
|
60
|
+
iconStart: icon,
|
|
61
|
+
children: label
|
|
64
62
|
}));
|
|
65
63
|
});
|
|
66
64
|
process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
|
|
@@ -128,7 +128,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
128
128
|
const result = apiRef.current.getCellParams(rowId, field);
|
|
129
129
|
result.api = apiRef.current;
|
|
130
130
|
return result;
|
|
131
|
-
}, _useGridSelector.objectShallowCompare);
|
|
131
|
+
}, undefined, _useGridSelector.objectShallowCompare);
|
|
132
132
|
const isSelected = (0, _useGridSelector.useGridSelector)(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
133
133
|
id: rowId,
|
|
134
134
|
field
|
|
@@ -8,8 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.GridColumnMenuFilterItem = GridColumnMenuFilterItem;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
12
|
-
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
13
11
|
var _useGridApiContext = require("../../../../hooks/utils/useGridApiContext");
|
|
14
12
|
var _useGridRootProps = require("../../../../hooks/utils/useGridRootProps");
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -27,15 +25,12 @@ function GridColumnMenuFilterItem(props) {
|
|
|
27
25
|
if (rootProps.disableColumnFilter || !colDef.filterable) {
|
|
28
26
|
return null;
|
|
29
27
|
}
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
31
29
|
onClick: showFilter,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
37
|
-
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
38
|
-
})]
|
|
30
|
+
iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuFilterIcon, {
|
|
31
|
+
fontSize: "small"
|
|
32
|
+
}),
|
|
33
|
+
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
39
34
|
});
|
|
40
35
|
}
|
|
41
36
|
process.env.NODE_ENV !== "production" ? GridColumnMenuFilterItem.propTypes = {
|
|
@@ -8,8 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.GridColumnMenuHideItem = GridColumnMenuHideItem;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
12
|
-
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
13
11
|
var _useGridApiContext = require("../../../../hooks/utils/useGridApiContext");
|
|
14
12
|
var _useGridRootProps = require("../../../../hooks/utils/useGridRootProps");
|
|
15
13
|
var _columns = require("../../../../hooks/features/columns");
|
|
@@ -43,16 +41,13 @@ function GridColumnMenuHideItem(props) {
|
|
|
43
41
|
if (colDef.hideable === false) {
|
|
44
42
|
return null;
|
|
45
43
|
}
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
47
45
|
onClick: toggleColumn,
|
|
48
46
|
disabled: disabled,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
54
|
-
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
55
|
-
})]
|
|
47
|
+
iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuHideIcon, {
|
|
48
|
+
fontSize: "small"
|
|
49
|
+
}),
|
|
50
|
+
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
process.env.NODE_ENV !== "production" ? GridColumnMenuHideItem.propTypes = {
|
|
@@ -8,8 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.GridColumnMenuManageItem = GridColumnMenuManageItem;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
12
|
-
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
13
11
|
var _gridPreferencePanelsValue = require("../../../../hooks/features/preferencesPanel/gridPreferencePanelsValue");
|
|
14
12
|
var _useGridApiContext = require("../../../../hooks/utils/useGridApiContext");
|
|
15
13
|
var _useGridRootProps = require("../../../../hooks/utils/useGridRootProps");
|
|
@@ -27,15 +25,12 @@ function GridColumnMenuManageItem(props) {
|
|
|
27
25
|
if (rootProps.disableColumnSelector) {
|
|
28
26
|
return null;
|
|
29
27
|
}
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
31
29
|
onClick: showColumns,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
37
|
-
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
38
|
-
})]
|
|
30
|
+
iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuManageColumnsIcon, {
|
|
31
|
+
fontSize: "small"
|
|
32
|
+
}),
|
|
33
|
+
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
39
34
|
});
|
|
40
35
|
}
|
|
41
36
|
process.env.NODE_ENV !== "production" ? GridColumnMenuManageItem.propTypes = {
|
|
@@ -8,8 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.GridColumnMenuSortItem = GridColumnMenuSortItem;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
12
|
-
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
13
11
|
var _useGridSelector = require("../../../../hooks/utils/useGridSelector");
|
|
14
12
|
var _gridSortingSelector = require("../../../../hooks/features/sorting/gridSortingSelector");
|
|
15
13
|
var _useGridApiContext = require("../../../../hooks/utils/useGridApiContext");
|
|
@@ -44,31 +42,24 @@ function GridColumnMenuSortItem(props) {
|
|
|
44
42
|
return typeof label === 'function' ? label(colDef) : label;
|
|
45
43
|
};
|
|
46
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
47
|
-
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/(0, _jsxRuntime.
|
|
45
|
+
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
48
46
|
onClick: onSortMenuItemClick,
|
|
49
47
|
"data-value": "asc",
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children: getLabel('columnMenuSortAsc')
|
|
56
|
-
})]
|
|
57
|
-
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseMenuItem, {
|
|
48
|
+
iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuSortAscendingIcon, {
|
|
49
|
+
fontSize: "small"
|
|
50
|
+
}),
|
|
51
|
+
children: getLabel('columnMenuSortAsc')
|
|
52
|
+
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
58
53
|
onClick: onSortMenuItemClick,
|
|
59
54
|
"data-value": "desc",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
children: getLabel('columnMenuSortDesc')
|
|
66
|
-
})]
|
|
67
|
-
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseMenuItem, {
|
|
55
|
+
iconStart: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnMenuSortDescendingIcon, {
|
|
56
|
+
fontSize: "small"
|
|
57
|
+
}),
|
|
58
|
+
children: getLabel('columnMenuSortDesc')
|
|
59
|
+
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, {
|
|
68
60
|
onClick: onSortMenuItemClick,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})]
|
|
61
|
+
iconStart: "",
|
|
62
|
+
children: apiRef.current.getLocaleText('columnMenuUnsort')
|
|
72
63
|
}) : null]
|
|
73
64
|
});
|
|
74
65
|
}
|
|
@@ -10,13 +10,12 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _GridPanelWrapper = require("./GridPanelWrapper");
|
|
13
|
-
var _columnsManagement = require("../columnsManagement");
|
|
14
13
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
15
|
function GridColumnsPanel(props) {
|
|
17
16
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
18
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridPanelWrapper.GridPanelWrapper, (0, _extends2.default)({}, props, {
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnsManagement, (0, _extends2.default)({}, rootProps.slotProps?.columnsManagement))
|
|
20
19
|
}));
|
|
21
20
|
}
|
|
22
21
|
process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
|
|
@@ -30,13 +30,17 @@ const GridPanelContentRoot = (0, _system.styled)('div', {
|
|
|
30
30
|
name: 'MuiDataGrid',
|
|
31
31
|
slot: 'PanelContent',
|
|
32
32
|
overridesResolver: (props, styles) => styles.panelContent
|
|
33
|
-
})({
|
|
33
|
+
})(({
|
|
34
|
+
theme
|
|
35
|
+
}) => ({
|
|
34
36
|
display: 'flex',
|
|
35
37
|
flexDirection: 'column',
|
|
36
38
|
overflow: 'auto',
|
|
37
39
|
flex: '1 1',
|
|
38
|
-
maxHeight: 400
|
|
39
|
-
|
|
40
|
+
maxHeight: 400,
|
|
41
|
+
padding: theme.spacing(2.5, 1.5, 2, 1),
|
|
42
|
+
gap: theme.spacing(2.5)
|
|
43
|
+
}));
|
|
40
44
|
function GridPanelContent(props) {
|
|
41
45
|
const {
|
|
42
46
|
className
|