@mui/x-data-grid 6.6.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -13
- package/components/GridColumnHeaders.d.ts +2 -2
- package/components/GridColumnHeaders.js +3 -1
- package/components/GridRow.d.ts +2 -2
- package/components/GridRow.js +23 -69
- package/components/cell/GridCell.d.ts +24 -15
- package/components/cell/GridCell.js +422 -45
- package/components/cell/index.d.ts +2 -1
- package/components/cell/index.js +1 -1
- package/components/containers/GridRootStyles.js +38 -17
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/panel/GridColumnsPanel.d.ts +14 -0
- package/components/panel/GridColumnsPanel.js +14 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +0 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +0 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +0 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +0 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -0
- package/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/components/toolbar/GridToolbar.js +2 -2
- package/components/virtualization/GridVirtualScroller.js +4 -9
- package/components/virtualization/GridVirtualScrollerContent.js +11 -20
- package/constants/defaultGridSlotsComponents.js +6 -2
- package/constants/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +4 -4
- package/hooks/core/useGridApiInitialization.js +4 -1
- package/hooks/core/useGridStateInitialization.js +2 -9
- package/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/hooks/features/editing/useGridCellEditing.js +5 -3
- package/hooks/features/editing/useGridRowEditing.js +14 -6
- package/hooks/features/filter/gridFilterUtils.d.ts +4 -1
- package/hooks/features/filter/gridFilterUtils.js +19 -13
- package/hooks/features/filter/useGridFilter.js +4 -2
- package/hooks/features/focus/useGridFocus.js +10 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -0
- package/hooks/features/rows/useGridParamsApi.js +7 -15
- package/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/hooks/features/sorting/useGridSorting.js +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -816
- package/hooks/features/virtualization/useGridVirtualScroller.js +42 -40
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/useGridSelector.d.ts +3 -1
- package/hooks/utils/useGridSelector.js +37 -6
- package/hooks/utils/useLazyRef.d.ts +2 -0
- package/hooks/utils/useLazyRef.js +9 -0
- package/hooks/utils/useOnMount.d.ts +2 -0
- package/hooks/utils/useOnMount.js +7 -0
- package/index.js +1 -1
- package/legacy/components/GridColumnHeaders.js +3 -1
- package/legacy/components/GridRow.js +25 -69
- package/legacy/components/cell/GridCell.js +425 -46
- package/legacy/components/cell/index.js +1 -1
- package/legacy/components/containers/GridRootStyles.js +25 -18
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +14 -0
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +7 -7
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/legacy/components/toolbar/GridToolbar.js +2 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +4 -7
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +10 -17
- package/legacy/constants/defaultGridSlotsComponents.js +6 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +4 -4
- package/legacy/hooks/core/useGridApiInitialization.js +4 -1
- package/legacy/hooks/core/useGridStateInitialization.js +2 -7
- package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/legacy/hooks/features/editing/useGridCellEditing.js +5 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +15 -7
- package/legacy/hooks/features/filter/gridFilterUtils.js +23 -19
- package/legacy/hooks/features/filter/useGridFilter.js +4 -2
- package/legacy/hooks/features/focus/useGridFocus.js +10 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/legacy/hooks/features/rows/useGridParamsApi.js +23 -15
- package/legacy/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +2 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +40 -36
- package/legacy/hooks/utils/index.js +1 -1
- package/legacy/hooks/utils/useGridSelector.js +43 -5
- package/legacy/hooks/utils/useLazyRef.js +9 -0
- package/legacy/hooks/utils/useOnMount.js +7 -0
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +4 -4
- package/legacy/locales/beBY.js +4 -4
- package/legacy/locales/bgBG.js +4 -4
- package/legacy/locales/csCZ.js +25 -27
- package/legacy/locales/daDK.js +4 -4
- package/legacy/locales/deDE.js +25 -27
- package/legacy/locales/elGR.js +70 -79
- package/legacy/locales/esES.js +4 -4
- package/legacy/locales/faIR.js +4 -4
- package/legacy/locales/fiFI.js +4 -4
- package/legacy/locales/heIL.js +4 -4
- package/legacy/locales/huHU.js +4 -4
- package/legacy/locales/itIT.js +4 -4
- package/legacy/locales/jaJP.js +4 -4
- package/legacy/locales/koKR.js +4 -4
- package/legacy/locales/nbNO.js +4 -4
- package/legacy/locales/plPL.js +4 -4
- package/legacy/locales/ptBR.js +4 -4
- package/legacy/locales/roRO.js +4 -4
- package/legacy/locales/ruRU.js +4 -4
- package/legacy/locales/skSK.js +4 -4
- package/legacy/locales/svSE.js +4 -4
- package/legacy/locales/trTR.js +16 -17
- package/legacy/locales/ukUA.js +4 -4
- package/legacy/locales/urPK.js +4 -4
- package/legacy/locales/viVN.js +4 -4
- package/legacy/locales/zhCN.js +4 -4
- package/legacy/locales/zhTW.js +4 -4
- package/legacy/utils/EventManager.js +2 -2
- package/legacy/utils/Store.js +34 -0
- package/legacy/utils/doesSupportPreventScroll.js +13 -0
- package/legacy/utils/fastMemo.js +5 -0
- package/legacy/utils/fastObjectShallowCompare.js +32 -0
- package/legacy/utils/keyboardUtils.js +4 -2
- package/locales/arSD.js +4 -4
- package/locales/beBY.js +4 -4
- package/locales/bgBG.js +4 -4
- package/locales/csCZ.js +25 -27
- package/locales/daDK.js +4 -4
- package/locales/deDE.js +25 -27
- package/locales/elGR.js +66 -79
- package/locales/esES.js +4 -4
- package/locales/faIR.js +4 -4
- package/locales/fiFI.js +4 -4
- package/locales/heIL.js +4 -4
- package/locales/huHU.js +4 -4
- package/locales/itIT.js +4 -4
- package/locales/jaJP.js +4 -4
- package/locales/koKR.js +4 -4
- package/locales/nbNO.js +4 -4
- package/locales/plPL.js +4 -4
- package/locales/ptBR.js +4 -4
- package/locales/roRO.js +4 -4
- package/locales/ruRU.js +4 -4
- package/locales/skSK.js +4 -4
- package/locales/svSE.js +4 -4
- package/locales/trTR.js +16 -17
- package/locales/ukUA.js +4 -4
- package/locales/urPK.js +4 -4
- package/locales/viVN.js +4 -4
- package/locales/zhCN.js +4 -4
- package/locales/zhTW.js +4 -4
- package/models/api/gridCoreApi.d.ts +6 -0
- package/models/colDef/gridColDef.d.ts +4 -3
- package/models/colDef/gridColType.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +11 -3
- package/modern/components/GridColumnHeaders.js +3 -1
- package/modern/components/GridRow.js +22 -69
- package/modern/components/cell/GridCell.js +421 -45
- package/modern/components/cell/index.js +1 -1
- package/modern/components/containers/GridRootStyles.js +38 -17
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +14 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/modern/components/toolbar/GridToolbar.js +2 -2
- package/modern/components/virtualization/GridVirtualScroller.js +4 -9
- package/modern/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/modern/constants/defaultGridSlotsComponents.js +6 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +4 -4
- package/modern/hooks/core/useGridApiInitialization.js +4 -1
- package/modern/hooks/core/useGridStateInitialization.js +2 -9
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +5 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +14 -6
- package/modern/hooks/features/filter/gridFilterUtils.js +17 -12
- package/modern/hooks/features/filter/useGridFilter.js +4 -2
- package/modern/hooks/features/focus/useGridFocus.js +9 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/modern/hooks/features/rows/useGridParamsApi.js +7 -15
- package/modern/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +2 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +42 -40
- package/modern/hooks/utils/index.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +37 -6
- package/modern/hooks/utils/useLazyRef.js +9 -0
- package/modern/hooks/utils/useOnMount.js +7 -0
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +4 -4
- package/modern/locales/beBY.js +4 -4
- package/modern/locales/bgBG.js +4 -4
- package/modern/locales/csCZ.js +25 -27
- package/modern/locales/daDK.js +4 -4
- package/modern/locales/deDE.js +25 -27
- package/modern/locales/elGR.js +66 -79
- package/modern/locales/esES.js +4 -4
- package/modern/locales/faIR.js +4 -4
- package/modern/locales/fiFI.js +4 -4
- package/modern/locales/heIL.js +4 -4
- package/modern/locales/huHU.js +4 -4
- package/modern/locales/itIT.js +4 -4
- package/modern/locales/jaJP.js +4 -4
- package/modern/locales/koKR.js +4 -4
- package/modern/locales/nbNO.js +4 -4
- package/modern/locales/plPL.js +4 -4
- package/modern/locales/ptBR.js +4 -4
- package/modern/locales/roRO.js +4 -4
- package/modern/locales/ruRU.js +4 -4
- package/modern/locales/skSK.js +4 -4
- package/modern/locales/svSE.js +4 -4
- package/modern/locales/trTR.js +16 -17
- package/modern/locales/ukUA.js +4 -4
- package/modern/locales/urPK.js +4 -4
- package/modern/locales/viVN.js +4 -4
- package/modern/locales/zhCN.js +4 -4
- package/modern/locales/zhTW.js +4 -4
- package/modern/utils/EventManager.js +2 -2
- package/modern/utils/Store.js +24 -0
- package/modern/utils/doesSupportPreventScroll.js +13 -0
- package/modern/utils/fastMemo.js +5 -0
- package/modern/utils/fastObjectShallowCompare.js +32 -0
- package/modern/utils/keyboardUtils.js +4 -2
- package/node/components/GridColumnHeaders.js +4 -2
- package/node/components/GridRow.js +22 -69
- package/node/components/cell/GridCell.js +424 -47
- package/node/components/cell/index.js +17 -10
- package/node/components/containers/GridRootStyles.js +38 -17
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +14 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -6
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +8 -0
- package/node/components/toolbar/GridToolbar.js +2 -2
- package/node/components/virtualization/GridVirtualScroller.js +4 -9
- package/node/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/node/constants/defaultGridSlotsComponents.js +4 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +4 -4
- package/node/hooks/core/useGridApiInitialization.js +4 -1
- package/node/hooks/core/useGridStateInitialization.js +2 -9
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -2
- package/node/hooks/features/editing/useGridCellEditing.js +5 -3
- package/node/hooks/features/editing/useGridRowEditing.js +14 -6
- package/node/hooks/features/filter/gridFilterUtils.js +17 -12
- package/node/hooks/features/filter/useGridFilter.js +7 -5
- package/node/hooks/features/focus/useGridFocus.js +9 -4
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/node/hooks/features/rows/useGridParamsApi.js +9 -15
- package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/node/hooks/features/sorting/useGridSorting.js +2 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -38
- package/node/hooks/utils/index.js +14 -10
- package/node/hooks/utils/useGridSelector.js +41 -7
- package/node/hooks/utils/useLazyRef.js +17 -0
- package/node/hooks/utils/useOnMount.js +15 -0
- package/node/index.js +1 -1
- package/node/locales/arSD.js +4 -4
- package/node/locales/beBY.js +4 -4
- package/node/locales/bgBG.js +4 -4
- package/node/locales/csCZ.js +25 -27
- package/node/locales/daDK.js +4 -4
- package/node/locales/deDE.js +25 -27
- package/node/locales/elGR.js +66 -79
- package/node/locales/esES.js +4 -4
- package/node/locales/faIR.js +4 -4
- package/node/locales/fiFI.js +4 -4
- package/node/locales/heIL.js +4 -4
- package/node/locales/huHU.js +4 -4
- package/node/locales/itIT.js +4 -4
- package/node/locales/jaJP.js +4 -4
- package/node/locales/koKR.js +4 -4
- package/node/locales/nbNO.js +4 -4
- package/node/locales/plPL.js +4 -4
- package/node/locales/ptBR.js +4 -4
- package/node/locales/roRO.js +4 -4
- package/node/locales/ruRU.js +4 -4
- package/node/locales/skSK.js +4 -4
- package/node/locales/svSE.js +4 -4
- package/node/locales/trTR.js +16 -17
- package/node/locales/ukUA.js +4 -4
- package/node/locales/urPK.js +4 -4
- package/node/locales/viVN.js +4 -4
- package/node/locales/zhCN.js +4 -4
- package/node/locales/zhTW.js +4 -4
- package/node/utils/EventManager.js +2 -2
- package/node/utils/Store.js +31 -0
- package/node/utils/doesSupportPreventScroll.js +19 -0
- package/node/utils/fastMemo.js +13 -0
- package/node/utils/fastObjectShallowCompare.js +38 -0
- package/node/utils/keyboardUtils.js +4 -2
- package/package.json +1 -1
- package/themeAugmentation/overrides.d.ts +1 -1
- package/utils/EventManager.js +2 -2
- package/utils/Store.d.ts +11 -0
- package/utils/Store.js +24 -0
- package/utils/doesSupportPreventScroll.d.ts +1 -0
- package/utils/doesSupportPreventScroll.js +13 -0
- package/utils/fastMemo.d.ts +1 -0
- package/utils/fastMemo.js +5 -0
- package/utils/fastObjectShallowCompare.d.ts +1 -0
- package/utils/fastObjectShallowCompare.js +32 -0
- package/utils/keyboardUtils.js +4 -2
|
@@ -218,8 +218,22 @@ process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
|
|
|
218
218
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
219
219
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
220
220
|
// ----------------------------------------------------------------------
|
|
221
|
+
/**
|
|
222
|
+
* If `true`, the column search field will be focused automatically.
|
|
223
|
+
* If `false`, the first column switch input will be focused automatically.
|
|
224
|
+
* This helps to avoid input keyboard panel to popup automatically on touch devices.
|
|
225
|
+
* @default true
|
|
226
|
+
*/
|
|
221
227
|
autoFocusSearchField: PropTypes.bool,
|
|
228
|
+
/**
|
|
229
|
+
* If `true`, the `Hide all` button will not be displayed.
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
222
232
|
disableHideAllButton: PropTypes.bool,
|
|
233
|
+
/**
|
|
234
|
+
* If `true`, the `Show all` button will be disabled
|
|
235
|
+
* @default false
|
|
236
|
+
*/
|
|
223
237
|
disableShowAllButton: PropTypes.bool,
|
|
224
238
|
/**
|
|
225
239
|
* Returns the list of togglable columns.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
+
var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -9,18 +10,19 @@ import { styled } from '@mui/material/styles';
|
|
|
9
10
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var BooleanOperatorContainer = styled('div')({
|
|
13
|
+
var BooleanOperatorContainer = styled('div')(_defineProperty({
|
|
13
14
|
display: 'flex',
|
|
14
|
-
alignItems: '
|
|
15
|
+
alignItems: 'center',
|
|
15
16
|
width: '100%'
|
|
16
|
-
}
|
|
17
|
+
}, "& button", {
|
|
18
|
+
margin: 'auto 0px 5px 5px'
|
|
19
|
+
}));
|
|
17
20
|
function GridFilterInputBoolean(props) {
|
|
18
21
|
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
|
|
19
22
|
var item = props.item,
|
|
20
23
|
applyValue = props.applyValue,
|
|
21
24
|
apiRef = props.apiRef,
|
|
22
25
|
focusElementRef = props.focusElementRef,
|
|
23
|
-
headerFilterMenu = props.headerFilterMenu,
|
|
24
26
|
isFilterActive = props.isFilterActive,
|
|
25
27
|
clearButton = props.clearButton,
|
|
26
28
|
tabIndex = props.tabIndex,
|
|
@@ -64,7 +66,6 @@ function GridFilterInputBoolean(props) {
|
|
|
64
66
|
variant: "standard",
|
|
65
67
|
native: isSelectNative,
|
|
66
68
|
displayEmpty: true,
|
|
67
|
-
startAdornment: isFilterActive ? headerFilterMenu : null,
|
|
68
69
|
inputProps: {
|
|
69
70
|
ref: focusElementRef,
|
|
70
71
|
tabIndex: tabIndex
|
|
@@ -100,7 +101,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
|
100
101
|
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
101
102
|
current: PropTypes.any.isRequired
|
|
102
103
|
})]),
|
|
103
|
-
headerFilterMenu: PropTypes.node,
|
|
104
104
|
/**
|
|
105
105
|
* It is `true` if the filter either has a value or an operator with no value
|
|
106
106
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "
|
|
4
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -16,7 +16,6 @@ function GridFilterInputDate(props) {
|
|
|
16
16
|
apiRef = props.apiRef,
|
|
17
17
|
focusElementRef = props.focusElementRef,
|
|
18
18
|
InputProps = props.InputProps,
|
|
19
|
-
headerFilterMenu = props.headerFilterMenu,
|
|
20
19
|
isFilterActive = props.isFilterActive,
|
|
21
20
|
clearButton = props.clearButton,
|
|
22
21
|
tabIndex = props.tabIndex,
|
|
@@ -73,8 +72,6 @@ function GridFilterInputDate(props) {
|
|
|
73
72
|
fontSize: "small",
|
|
74
73
|
color: "action"
|
|
75
74
|
}) : clearButton
|
|
76
|
-
} : {}, headerFilterMenu && isFilterActive ? {
|
|
77
|
-
startAdornment: headerFilterMenu
|
|
78
75
|
} : {}, {
|
|
79
76
|
disabled: disabled
|
|
80
77
|
}, InputProps, {
|
|
@@ -96,7 +93,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
96
93
|
applyValue: PropTypes.func.isRequired,
|
|
97
94
|
clearButton: PropTypes.node,
|
|
98
95
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
99
|
-
headerFilterMenu: PropTypes.node,
|
|
100
96
|
/**
|
|
101
97
|
* It is `true` if the filter either has a value or an operator with no value
|
|
102
98
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "
|
|
6
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
9
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -34,11 +35,13 @@ var renderSingleSelectOptions = function renderSingleSelectOptions(_ref) {
|
|
|
34
35
|
}), label);
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
|
-
var SingleSelectOperatorContainer = styled('div')({
|
|
38
|
+
var SingleSelectOperatorContainer = styled('div')(_defineProperty({
|
|
38
39
|
display: 'flex',
|
|
39
40
|
alignItems: 'flex-end',
|
|
40
41
|
width: '100%'
|
|
41
|
-
}
|
|
42
|
+
}, "& button", {
|
|
43
|
+
margin: 'auto 0px 5px 5px'
|
|
44
|
+
}));
|
|
42
45
|
function GridFilterInputSingleSelect(props) {
|
|
43
46
|
var _item$value, _rootProps$slotProps$, _rootProps$slotProps, _rootProps$slotProps$2, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
|
|
44
47
|
var item = props.item,
|
|
@@ -51,7 +54,6 @@ function GridFilterInputSingleSelect(props) {
|
|
|
51
54
|
placeholder = props.placeholder,
|
|
52
55
|
tabIndex = props.tabIndex,
|
|
53
56
|
labelProp = props.label,
|
|
54
|
-
headerFilterMenu = props.headerFilterMenu,
|
|
55
57
|
isFilterActive = props.isFilterActive,
|
|
56
58
|
clearButton = props.clearButton,
|
|
57
59
|
others = _objectWithoutProperties(props, _excluded);
|
|
@@ -129,7 +131,6 @@ function GridFilterInputSingleSelect(props) {
|
|
|
129
131
|
labelId: labelId,
|
|
130
132
|
value: filterValueState,
|
|
131
133
|
onChange: onFilterChange,
|
|
132
|
-
startAdornment: isFilterActive ? headerFilterMenu : null,
|
|
133
134
|
variant: "standard",
|
|
134
135
|
type: type || 'text',
|
|
135
136
|
inputProps: {
|
|
@@ -174,7 +175,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
174
175
|
* @returns {string} The value to be used.
|
|
175
176
|
*/
|
|
176
177
|
getOptionValue: PropTypes.func,
|
|
177
|
-
headerFilterMenu: PropTypes.node,
|
|
178
178
|
/**
|
|
179
179
|
* It is `true` if the filter either has a value or an operator with no value
|
|
180
180
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "
|
|
4
|
+
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -17,7 +17,6 @@ function GridFilterInputValue(props) {
|
|
|
17
17
|
focusElementRef = props.focusElementRef,
|
|
18
18
|
tabIndex = props.tabIndex,
|
|
19
19
|
disabled = props.disabled,
|
|
20
|
-
headerFilterMenu = props.headerFilterMenu,
|
|
21
20
|
isFilterActive = props.isFilterActive,
|
|
22
21
|
clearButton = props.clearButton,
|
|
23
22
|
InputProps = props.InputProps,
|
|
@@ -68,8 +67,6 @@ function GridFilterInputValue(props) {
|
|
|
68
67
|
fontSize: "small",
|
|
69
68
|
color: "action"
|
|
70
69
|
}) : clearButton
|
|
71
|
-
} : {}, headerFilterMenu && isFilterActive ? {
|
|
72
|
-
startAdornment: headerFilterMenu
|
|
73
70
|
} : {}, {
|
|
74
71
|
disabled: disabled
|
|
75
72
|
}, InputProps, {
|
|
@@ -94,7 +91,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
|
94
91
|
applyValue: PropTypes.func.isRequired,
|
|
95
92
|
clearButton: PropTypes.node,
|
|
96
93
|
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
97
|
-
headerFilterMenu: PropTypes.node,
|
|
98
94
|
/**
|
|
99
95
|
* It is `true` if the filter either has a value or an operator with no value
|
|
100
96
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -188,7 +188,15 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
188
188
|
* If not specified, the order is derived from the `columns` prop.
|
|
189
189
|
*/
|
|
190
190
|
columnsSort: PropTypes.oneOf(['asc', 'desc']),
|
|
191
|
+
/**
|
|
192
|
+
* If `true`, the `Add filter` button will not be displayed.
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
191
195
|
disableAddFilterButton: PropTypes.bool,
|
|
196
|
+
/**
|
|
197
|
+
* If `true`, the `Remove all` button will be disabled
|
|
198
|
+
* @default false
|
|
199
|
+
*/
|
|
192
200
|
disableRemoveAllButton: PropTypes.bool,
|
|
193
201
|
/**
|
|
194
202
|
* Props passed to each filter form.
|
|
@@ -14,8 +14,8 @@ import { GridToolbarQuickFilter } from './GridToolbarQuickFilter';
|
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
var GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {
|
|
17
|
-
// TODO
|
|
18
|
-
// from
|
|
17
|
+
// TODO v7: think about where export option should be passed.
|
|
18
|
+
// from slotProps={{ toolbarExport: { ...exportOption } }} seems to be more appropriate
|
|
19
19
|
var className = props.className,
|
|
20
20
|
csvOptions = props.csvOptions,
|
|
21
21
|
printOptions = props.printOptions,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
import { styled } from '@mui/system';
|
|
@@ -31,14 +29,13 @@ var VirtualScrollerRoot = styled('div', {
|
|
|
31
29
|
}
|
|
32
30
|
});
|
|
33
31
|
var GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
|
|
34
|
-
var className = props.className,
|
|
35
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
36
32
|
var rootProps = useGridRootProps();
|
|
37
33
|
var classes = useUtilityClasses(rootProps);
|
|
38
34
|
return /*#__PURE__*/_jsx(VirtualScrollerRoot, _extends({
|
|
39
|
-
ref: ref
|
|
40
|
-
|
|
35
|
+
ref: ref
|
|
36
|
+
}, props, {
|
|
37
|
+
className: clsx(classes.root, props.className),
|
|
41
38
|
ownerState: rootProps
|
|
42
|
-
}
|
|
39
|
+
}));
|
|
43
40
|
});
|
|
44
41
|
export { GridVirtualScroller };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "style"];
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
import { styled } from '@mui/system';
|
|
@@ -8,9 +6,8 @@ import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
|
8
6
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
7
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var useUtilityClasses = function useUtilityClasses(
|
|
12
|
-
var classes =
|
|
13
|
-
overflowedContent = ownerState.overflowedContent;
|
|
9
|
+
var useUtilityClasses = function useUtilityClasses(props, overflowedContent) {
|
|
10
|
+
var classes = props.classes;
|
|
14
11
|
var slots = {
|
|
15
12
|
root: ['virtualScrollerContent', overflowedContent && 'virtualScrollerContent--overflowed']
|
|
16
13
|
};
|
|
@@ -24,19 +21,15 @@ var VirtualScrollerContentRoot = styled('div', {
|
|
|
24
21
|
}
|
|
25
22
|
})({});
|
|
26
23
|
var GridVirtualScrollerContent = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerContent(props, ref) {
|
|
27
|
-
var
|
|
28
|
-
style = props.style,
|
|
29
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
var _props$style;
|
|
30
25
|
var rootProps = useGridRootProps();
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
var classes = useUtilityClasses(ownerState);
|
|
26
|
+
var overflowedContent = !rootProps.autoHeight && ((_props$style = props.style) == null ? void 0 : _props$style.minHeight) === 'auto';
|
|
27
|
+
var classes = useUtilityClasses(rootProps, overflowedContent);
|
|
35
28
|
return /*#__PURE__*/_jsx(VirtualScrollerContentRoot, _extends({
|
|
36
|
-
ref: ref
|
|
37
|
-
|
|
38
|
-
ownerState:
|
|
39
|
-
|
|
40
|
-
}
|
|
29
|
+
ref: ref
|
|
30
|
+
}, props, {
|
|
31
|
+
ownerState: rootProps,
|
|
32
|
+
className: clsx(classes.root, props.className)
|
|
33
|
+
}));
|
|
41
34
|
});
|
|
42
35
|
export { GridVirtualScrollerContent };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import {
|
|
2
|
+
import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton } from '../components';
|
|
3
|
+
import { GridCellV7 } from '../components/cell/GridCell';
|
|
3
4
|
import { GridColumnHeaders } from '../components/GridColumnHeaders';
|
|
4
5
|
import { GridColumnMenu } from '../components/menu/columnMenu/GridColumnMenu';
|
|
5
6
|
import { GridNoResultsOverlay } from '../components/GridNoResultsOverlay';
|
|
6
7
|
import materialSlots from '../material';
|
|
8
|
+
|
|
9
|
+
// TODO: camelCase these key. It's a private helper now.
|
|
10
|
+
// Remove then need to call `uncapitalizeObjectKeys`.
|
|
7
11
|
export var DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
|
|
8
|
-
Cell:
|
|
12
|
+
Cell: GridCellV7,
|
|
9
13
|
SkeletonCell: GridSkeletonCell,
|
|
10
14
|
ColumnHeaderFilterIconButton: GridColumnHeaderFilterIconButton,
|
|
11
15
|
ColumnMenu: GridColumnMenu,
|
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
5
|
+
export var gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -82,10 +82,10 @@ export var GRID_DEFAULT_LOCALE_TEXT = {
|
|
|
82
82
|
headerFilterOperatorIsAnyOf: 'Is any of',
|
|
83
83
|
'headerFilterOperator=': 'Equals',
|
|
84
84
|
'headerFilterOperator!=': 'Not equals',
|
|
85
|
-
'headerFilterOperator>': '
|
|
86
|
-
'headerFilterOperator>=': '
|
|
87
|
-
'headerFilterOperator<': '
|
|
88
|
-
'headerFilterOperator<=': '
|
|
85
|
+
'headerFilterOperator>': 'Greater than',
|
|
86
|
+
'headerFilterOperator>=': 'Greater than or equal to',
|
|
87
|
+
'headerFilterOperator<': 'Less than',
|
|
88
|
+
'headerFilterOperator<=': 'Less than or equal to',
|
|
89
89
|
// Filter values text
|
|
90
90
|
filterValueAny: 'any',
|
|
91
91
|
filterValueTrue: 'true',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Store } from '../../utils/Store';
|
|
2
3
|
import { useGridApiMethod } from '../utils/useGridApiMethod';
|
|
3
4
|
import { GridSignature } from '../utils/useGridApiEventHandler';
|
|
4
5
|
import { EventManager } from '../../utils/EventManager';
|
|
@@ -37,8 +38,10 @@ var wrapPublicApi = function wrapPublicApi(publicApi) {
|
|
|
37
38
|
export function useGridApiInitialization(inputApiRef, props) {
|
|
38
39
|
var publicApiRef = React.useRef();
|
|
39
40
|
if (!publicApiRef.current) {
|
|
41
|
+
var state = {};
|
|
40
42
|
publicApiRef.current = {
|
|
41
|
-
state:
|
|
43
|
+
state: state,
|
|
44
|
+
store: Store.create(state),
|
|
42
45
|
instanceId: {
|
|
43
46
|
id: globalId
|
|
44
47
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
-
var _excluded = ["stateId"];
|
|
6
4
|
import * as React from 'react';
|
|
7
5
|
import { GridSignature } from '../utils/useGridApiEventHandler';
|
|
8
6
|
import { useGridApiMethod } from '../utils';
|
|
@@ -13,11 +11,7 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
13
11
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14
12
|
rawForceUpdate = _React$useState2[1];
|
|
15
13
|
var registerControlState = React.useCallback(function (controlStateItem) {
|
|
16
|
-
|
|
17
|
-
others = _objectWithoutProperties(controlStateItem, _excluded);
|
|
18
|
-
controlStateMapRef.current[stateId] = _extends({}, others, {
|
|
19
|
-
stateId: stateId
|
|
20
|
-
});
|
|
14
|
+
controlStateMapRef.current[controlStateItem.stateId] = controlStateItem;
|
|
21
15
|
}, []);
|
|
22
16
|
var setState = React.useCallback(function (state, reason) {
|
|
23
17
|
var newState;
|
|
@@ -64,6 +58,7 @@ export var useGridStateInitialization = function useGridStateInitialization(apiR
|
|
|
64
58
|
if (apiRef.current.publishEvent) {
|
|
65
59
|
apiRef.current.publishEvent('stateChange', newState);
|
|
66
60
|
}
|
|
61
|
+
apiRef.current.store.update(newState);
|
|
67
62
|
}
|
|
68
63
|
if (updatedControlStateIds.length === 1) {
|
|
69
64
|
var _updatedControlStateI = updatedControlStateIds[0],
|
|
@@ -55,10 +55,7 @@ export var useGridClipboard = function useGridClipboard(apiRef, props) {
|
|
|
55
55
|
var ignoreValueFormatter = (_typeof(ignoreValueFormatterProp) === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
|
|
56
56
|
var clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
57
57
|
var handleCopy = React.useCallback(function (event) {
|
|
58
|
-
|
|
59
|
-
// event.code === 'KeyC' is not enough as event.code assume a QWERTY keyboard layout which would
|
|
60
|
-
// be wrong with a Dvorak keyboard (as if pressing J).
|
|
61
|
-
if (String.fromCharCode(event.keyCode) !== 'C' || !isModifierKeyPressed) {
|
|
58
|
+
if (!((event.ctrlKey || event.metaKey) && event.key === 'c')) {
|
|
62
59
|
return;
|
|
63
60
|
}
|
|
64
61
|
|
|
@@ -11,7 +11,7 @@ import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
|
11
11
|
import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
|
|
12
12
|
import { getFirstColumnIndexToRender, getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
13
13
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
14
|
-
import { getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
14
|
+
import { areRenderContextsEqual, getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
15
15
|
import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
var GridColumnHeaderRow = styled('div', {
|
|
@@ -62,12 +62,18 @@ export var useGridColumnHeaders = function useGridColumnHeaders(props) {
|
|
|
62
62
|
var _React$useState5 = React.useState(null),
|
|
63
63
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
64
64
|
renderContext = _React$useState6[0],
|
|
65
|
-
|
|
65
|
+
setRenderContextRaw = _React$useState6[1];
|
|
66
66
|
var prevRenderContext = React.useRef(renderContext);
|
|
67
67
|
var prevScrollLeft = React.useRef(0);
|
|
68
68
|
var currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
69
69
|
var totalHeaderHeight = getTotalHeaderHeight(apiRef, rootProps.columnHeaderHeight);
|
|
70
70
|
var headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
71
|
+
var setRenderContext = React.useCallback(function (nextRenderContext) {
|
|
72
|
+
if (renderContext && nextRenderContext && areRenderContextsEqual(renderContext, nextRenderContext)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setRenderContextRaw(nextRenderContext);
|
|
76
|
+
}, [renderContext]);
|
|
71
77
|
React.useEffect(function () {
|
|
72
78
|
apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
|
|
73
79
|
}, [apiRef]);
|
|
@@ -150,7 +156,7 @@ export var useGridColumnHeaders = function useGridColumnHeaders(props) {
|
|
|
150
156
|
if (nextRenderContext && canUpdateInnerPosition) {
|
|
151
157
|
updateInnerPosition(nextRenderContext);
|
|
152
158
|
}
|
|
153
|
-
}, [updateInnerPosition]);
|
|
159
|
+
}, [updateInnerPosition, setRenderContext]);
|
|
154
160
|
var handleColumnResizeStart = React.useCallback(function (params) {
|
|
155
161
|
return setResizeCol(params.field);
|
|
156
162
|
}, []);
|
|
@@ -18,7 +18,7 @@ import { buildWarning } from '../../../utils/warning';
|
|
|
18
18
|
import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
|
|
19
19
|
import { deepClone } from '../../../utils/utils';
|
|
20
20
|
import { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../models/params/gridEditCellParams';
|
|
21
|
-
var missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');
|
|
21
|
+
var missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence.'], 'error');
|
|
22
22
|
export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
23
23
|
var _React$useState = React.useState({}),
|
|
24
24
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -128,7 +128,8 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
128
128
|
var id = params.id,
|
|
129
129
|
field = params.field,
|
|
130
130
|
reason = params.reason,
|
|
131
|
-
key = params.key
|
|
131
|
+
key = params.key,
|
|
132
|
+
colDef = params.colDef;
|
|
132
133
|
var startCellEditModeParams = {
|
|
133
134
|
id: id,
|
|
134
135
|
field: field
|
|
@@ -139,7 +140,8 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
139
140
|
// The sequence of events makes the key pressed by the end-users update the textbox directly.
|
|
140
141
|
startCellEditModeParams.deleteValue = true;
|
|
141
142
|
} else {
|
|
142
|
-
|
|
143
|
+
var initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
|
|
144
|
+
startCellEditModeParams.initialValue = initialValue;
|
|
143
145
|
}
|
|
144
146
|
} else if (reason === GridCellEditStartReasons.deleteKeyDown) {
|
|
145
147
|
startCellEditModeParams.deleteValue = true;
|
|
@@ -17,7 +17,8 @@ import { buildWarning } from '../../../utils/warning';
|
|
|
17
17
|
import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
|
|
18
18
|
import { deepClone } from '../../../utils/utils';
|
|
19
19
|
import { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models/params/gridRowParams';
|
|
20
|
-
|
|
20
|
+
import { GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
|
|
21
|
+
var missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence.'], 'error');
|
|
21
22
|
export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
22
23
|
var _React$useState = React.useState({}),
|
|
23
24
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -120,6 +121,10 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
120
121
|
reason = GridRowEditStopReasons.enterKeyDown;
|
|
121
122
|
} else if (event.key === 'Tab') {
|
|
122
123
|
var columnFields = gridColumnFieldsSelector(apiRef).filter(function (field) {
|
|
124
|
+
var column = apiRef.current.getColumn(field);
|
|
125
|
+
if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
123
128
|
return apiRef.current.isCellEditable(apiRef.current.getCellParams(params.id, field));
|
|
124
129
|
});
|
|
125
130
|
if (event.shiftKey) {
|
|
@@ -144,8 +149,7 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
if (reason) {
|
|
147
|
-
var
|
|
148
|
-
var newParams = _extends({}, rowParams, {
|
|
152
|
+
var newParams = _extends({}, apiRef.current.getRowParams(params.id), {
|
|
149
153
|
reason: reason,
|
|
150
154
|
field: params.field
|
|
151
155
|
});
|
|
@@ -172,8 +176,8 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
172
176
|
_reason = GridRowEditStartReasons.deleteKeyDown;
|
|
173
177
|
}
|
|
174
178
|
if (_reason) {
|
|
175
|
-
var
|
|
176
|
-
var _newParams = _extends({},
|
|
179
|
+
var rowParams = apiRef.current.getRowParams(params.id);
|
|
180
|
+
var _newParams = _extends({}, rowParams, {
|
|
177
181
|
field: params.field,
|
|
178
182
|
key: event.key,
|
|
179
183
|
reason: _reason
|
|
@@ -186,7 +190,8 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
186
190
|
var id = params.id,
|
|
187
191
|
field = params.field,
|
|
188
192
|
reason = params.reason,
|
|
189
|
-
key = params.key
|
|
193
|
+
key = params.key,
|
|
194
|
+
columns = params.columns;
|
|
190
195
|
var startRowEditModeParams = {
|
|
191
196
|
id: id,
|
|
192
197
|
fieldToFocus: field
|
|
@@ -197,7 +202,10 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
197
202
|
// The sequence of events makes the key pressed by the end-users update the textbox directly.
|
|
198
203
|
startRowEditModeParams.deleteValue = !!field;
|
|
199
204
|
} else {
|
|
200
|
-
|
|
205
|
+
var colDef = columns.find(function (col) {
|
|
206
|
+
return col.field === field;
|
|
207
|
+
});
|
|
208
|
+
startRowEditModeParams.initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
|
|
201
209
|
}
|
|
202
210
|
} else if (reason === GridRowEditStartReasons.deleteKeyDown) {
|
|
203
211
|
startRowEditModeParams.deleteValue = !!field;
|
|
@@ -208,30 +208,32 @@ export var buildAggregatedFilterApplier = function buildAggregatedFilterApplier(
|
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
var
|
|
225
|
-
var
|
|
211
|
+
var isNotNull = function isNotNull(result) {
|
|
212
|
+
return result != null;
|
|
213
|
+
};
|
|
214
|
+
var filterModelItems = function filterModelItems(cache, apiRef, items) {
|
|
215
|
+
if (!cache.cleanedFilterItems) {
|
|
216
|
+
cache.cleanedFilterItems = items.filter(function (item) {
|
|
217
|
+
return getFilterCallbackFromItem(item, apiRef) !== null;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return cache.cleanedFilterItems;
|
|
221
|
+
};
|
|
222
|
+
export var passFilterLogic = function passFilterLogic(allFilterItemResults, allQuickFilterResults, filterModel, apiRef, cache) {
|
|
223
|
+
var cleanedFilterItems = filterModelItems(cache, apiRef, filterModel.items);
|
|
224
|
+
var cleanedFilterItemResults = allFilterItemResults.filter(isNotNull);
|
|
225
|
+
var cleanedQuickFilterResults = allQuickFilterResults.filter(isNotNull);
|
|
226
226
|
|
|
227
227
|
// get result for filter items model
|
|
228
|
-
if (
|
|
228
|
+
if (cleanedFilterItemResults.length > 0) {
|
|
229
|
+
var _filterModel$logicOpe;
|
|
229
230
|
// Return true if the item pass with one of the rows
|
|
230
231
|
var filterItemPredicate = function filterItemPredicate(item) {
|
|
231
|
-
return
|
|
232
|
+
return cleanedFilterItemResults.some(function (filterItemResult) {
|
|
232
233
|
return filterItemResult[item.id];
|
|
233
234
|
});
|
|
234
235
|
};
|
|
236
|
+
var logicOperator = (_filterModel$logicOpe = filterModel.logicOperator) != null ? _filterModel$logicOpe : getDefaultGridFilterModel().logicOperator;
|
|
235
237
|
if (logicOperator === GridLogicOperator.And) {
|
|
236
238
|
var passesAllFilters = cleanedFilterItems.every(filterItemPredicate);
|
|
237
239
|
if (!passesAllFilters) {
|
|
@@ -246,13 +248,15 @@ export var passFilterLogic = function passFilterLogic(allFilterItemResults, allQ
|
|
|
246
248
|
}
|
|
247
249
|
|
|
248
250
|
// get result for quick filter model
|
|
249
|
-
if (
|
|
251
|
+
if (cleanedQuickFilterResults.length > 0 && filterModel.quickFilterValues != null) {
|
|
252
|
+
var _filterModel$quickFil2;
|
|
250
253
|
// Return true if the item pass with one of the rows
|
|
251
254
|
var quickFilterValuePredicate = function quickFilterValuePredicate(value) {
|
|
252
|
-
return
|
|
255
|
+
return cleanedQuickFilterResults.some(function (quickFilterValueResult) {
|
|
253
256
|
return quickFilterValueResult[value];
|
|
254
257
|
});
|
|
255
258
|
};
|
|
259
|
+
var quickFilterLogicOperator = (_filterModel$quickFil2 = filterModel.quickFilterLogicOperator) != null ? _filterModel$quickFil2 : getDefaultGridFilterModel().quickFilterLogicOperator;
|
|
256
260
|
if (quickFilterLogicOperator === GridLogicOperator.And) {
|
|
257
261
|
var passesAllQuickFilterValues = filterModel.quickFilterValues.every(quickFilterValuePredicate);
|
|
258
262
|
if (!passesAllQuickFilterValues) {
|