@mui/x-data-grid 5.15.0 → 5.15.3
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 +128 -1
- package/DataGrid/DataGrid.js +2 -2
- package/README.md +2 -1
- package/components/ErrorBoundary.d.ts +1 -0
- package/components/GridAutoSizer.js +7 -0
- package/components/base/GridOverlays.js +1 -4
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.d.ts +2 -5
- package/components/cell/GridEditInputCell.js +13 -14
- package/components/cell/GridEditSingleSelectCell.d.ts +4 -0
- package/components/cell/GridEditSingleSelectCell.js +20 -5
- package/components/containers/GridOverlay.js +7 -1
- package/components/menu/GridMenu.d.ts +3 -2
- package/components/menu/GridMenu.js +1 -0
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +1 -0
- package/components/panel/filterPanel/GridFilterForm.d.ts +4 -0
- package/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.d.ts +4 -0
- package/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/constants/envConstants.d.ts +1 -1
- package/constants/envConstants.js +2 -11
- package/hooks/features/editRows/useGridCellEditing.new.js +20 -13
- package/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/hooks/features/editRows/useGridRowEditing.new.js +14 -8
- package/hooks/features/filter/gridFilterState.d.ts +12 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -5
- package/hooks/features/filter/gridFilterUtils.js +74 -43
- package/hooks/features/filter/useGridFilter.js +16 -3
- package/hooks/features/focus/useGridFocus.js +11 -6
- package/hooks/features/rows/useGridRows.js +5 -2
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +3 -0
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridNativeEventListener.js +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/legacy/DataGrid/DataGrid.js +2 -2
- package/legacy/components/GridAutoSizer.js +7 -0
- package/legacy/components/base/GridOverlays.js +1 -4
- package/legacy/components/cell/GridEditDateCell.js +1 -1
- package/legacy/components/cell/GridEditInputCell.js +13 -14
- package/legacy/components/cell/GridEditSingleSelectCell.js +20 -4
- package/legacy/components/containers/GridOverlay.js +7 -1
- package/legacy/components/menu/GridMenu.js +1 -0
- package/legacy/components/panel/GridPanel.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +14 -5
- package/legacy/components/toolbar/GridToolbarExportContainer.js +15 -2
- package/legacy/constants/envConstants.js +2 -11
- package/legacy/hooks/features/editRows/useGridCellEditing.new.js +21 -14
- package/legacy/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/legacy/hooks/features/editRows/useGridRowEditing.new.js +14 -8
- package/legacy/hooks/features/filter/gridFilterUtils.js +84 -55
- package/legacy/hooks/features/filter/useGridFilter.js +16 -3
- package/legacy/hooks/features/focus/useGridFocus.js +11 -6
- package/legacy/hooks/features/rows/useGridRows.js +5 -2
- package/legacy/hooks/utils/useGridNativeEventListener.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -0
- package/legacy/locales/deDE.js +8 -8
- package/legacy/locales/itIT.js +15 -15
- package/legacy/locales/koKR.js +34 -30
- package/legacy/utils/keyboardUtils.js +8 -5
- package/locales/deDE.js +8 -8
- package/locales/itIT.js +15 -15
- package/locales/koKR.js +30 -30
- package/models/params/gridMenuParams.d.ts +1 -2
- package/models/props/DataGridProps.d.ts +4 -4
- package/modern/DataGrid/DataGrid.js +2 -2
- package/modern/components/GridAutoSizer.js +7 -0
- package/modern/components/base/GridOverlays.js +1 -4
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +13 -14
- package/modern/components/cell/GridEditSingleSelectCell.js +20 -5
- package/modern/components/containers/GridOverlay.js +7 -1
- package/modern/components/menu/GridMenu.js +1 -0
- package/modern/components/panel/GridPanel.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/modern/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/modern/components/toolbar/GridToolbarDensitySelector.js +11 -4
- package/modern/components/toolbar/GridToolbarExportContainer.js +11 -2
- package/modern/constants/envConstants.js +2 -11
- package/modern/hooks/features/editRows/useGridCellEditing.new.js +20 -13
- package/modern/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/modern/hooks/features/editRows/useGridRowEditing.new.js +14 -8
- package/modern/hooks/features/filter/gridFilterUtils.js +73 -42
- package/modern/hooks/features/filter/useGridFilter.js +16 -3
- package/modern/hooks/features/focus/useGridFocus.js +11 -6
- package/modern/hooks/features/rows/useGridRows.js +5 -2
- package/modern/hooks/utils/useGridNativeEventListener.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -0
- package/modern/locales/deDE.js +8 -8
- package/modern/locales/itIT.js +15 -15
- package/modern/locales/koKR.js +30 -30
- package/modern/utils/keyboardUtils.js +7 -2
- package/node/DataGrid/DataGrid.js +2 -2
- package/node/components/GridAutoSizer.js +7 -0
- package/node/components/base/GridOverlays.js +1 -4
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +15 -16
- package/node/components/cell/GridEditSingleSelectCell.js +19 -5
- package/node/components/containers/GridOverlay.js +7 -1
- package/node/components/menu/GridMenu.js +1 -0
- package/node/components/panel/GridPanel.js +1 -0
- package/node/components/panel/filterPanel/GridFilterForm.js +5 -0
- package/node/components/panel/filterPanel/GridFilterPanel.js +5 -0
- package/node/components/toolbar/GridToolbarDensitySelector.js +13 -4
- package/node/components/toolbar/GridToolbarExportContainer.js +13 -2
- package/node/constants/envConstants.js +2 -13
- package/node/hooks/features/editRows/useGridCellEditing.new.js +20 -13
- package/node/hooks/features/editRows/useGridCellEditing.old.js +2 -2
- package/node/hooks/features/editRows/useGridRowEditing.new.js +14 -8
- package/node/hooks/features/filter/gridFilterUtils.js +81 -47
- package/node/hooks/features/filter/useGridFilter.js +15 -2
- package/node/hooks/features/focus/useGridFocus.js +11 -6
- package/node/hooks/features/rows/useGridRows.js +5 -2
- package/node/hooks/utils/useGridNativeEventListener.js +2 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +8 -0
- package/node/locales/deDE.js +8 -8
- package/node/locales/itIT.js +15 -15
- package/node/locales/koKR.js +30 -30
- package/node/utils/keyboardUtils.js +10 -4
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +2 -2
- package/utils/keyboardUtils.js +7 -2
|
@@ -3,7 +3,7 @@ import { AutocompleteProps } from '@mui/material/Autocomplete';
|
|
|
3
3
|
import { GridFilterInputValueProps } from './GridFilterInputValueProps';
|
|
4
4
|
export declare type GridFilterInputMultipleValueProps = {
|
|
5
5
|
type?: 'text' | 'number';
|
|
6
|
-
} & GridFilterInputValueProps & Omit<AutocompleteProps<
|
|
6
|
+
} & GridFilterInputValueProps & Omit<AutocompleteProps<string, true, false, true>, 'options' | 'renderInput'>;
|
|
7
7
|
declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): JSX.Element;
|
|
8
8
|
declare namespace GridFilterInputMultipleValue {
|
|
9
9
|
var propTypes: any;
|
|
@@ -10,6 +10,10 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'linkOpe
|
|
|
10
10
|
* Props passed to each filter form.
|
|
11
11
|
*/
|
|
12
12
|
filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'linkOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps'>;
|
|
13
|
+
/**
|
|
14
|
+
* @ignore - do not document.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactNode;
|
|
13
17
|
}
|
|
14
18
|
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
19
|
export { GridFilterPanel };
|
|
@@ -126,6 +126,11 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
|
|
|
126
126
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
127
127
|
// ----------------------------------------------------------------------
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @ignore - do not document.
|
|
131
|
+
*/
|
|
132
|
+
children: PropTypes.node,
|
|
133
|
+
|
|
129
134
|
/**
|
|
130
135
|
* Changes how the options in the columns selector should be ordered.
|
|
131
136
|
* If not specified, the order is derived from the `columns` prop.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
export declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "
|
|
3
|
+
export declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
export declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "
|
|
3
|
+
export declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -59,11 +59,20 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
59
59
|
}, [densityValue, rootProps]);
|
|
60
60
|
|
|
61
61
|
const handleDensitySelectorOpen = event => {
|
|
62
|
-
setOpen(
|
|
62
|
+
setOpen(prevOpen => !prevOpen);
|
|
63
63
|
onClick == null ? void 0 : onClick(event);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const handleDensitySelectorClickAway = event => {
|
|
67
|
+
var _buttonRef$current;
|
|
68
|
+
|
|
69
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
70
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
setOpen(false);
|
|
75
|
+
};
|
|
67
76
|
|
|
68
77
|
const handleDensityUpdate = newDensity => {
|
|
69
78
|
apiRef.current.setDensity(newDensity);
|
|
@@ -76,7 +85,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
if (isHideMenuKey(event.key)) {
|
|
79
|
-
|
|
88
|
+
setOpen(false);
|
|
80
89
|
}
|
|
81
90
|
}; // Disable the button if the corresponding is disabled
|
|
82
91
|
|
|
@@ -109,7 +118,7 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
109
118
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
110
119
|
open: open,
|
|
111
120
|
target: buttonRef.current,
|
|
112
|
-
onClickAway:
|
|
121
|
+
onClickAway: handleDensitySelectorClickAway,
|
|
113
122
|
position: "bottom-start",
|
|
114
123
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
115
124
|
id: densityMenuId,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
export declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "
|
|
3
|
+
export declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<Pick<ButtonProps<"button", {}>, "hidden" | "color" | "size" | "translate" | "disabled" | "form" | "slot" | "title" | "key" | "action" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "href" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "type" | "value" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant" | "onFocusVisible" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "disableElevation" | "fullWidth" | "endIcon" | "startIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -29,7 +29,7 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
29
29
|
const handleRef = useForkRef(ref, buttonRef);
|
|
30
30
|
|
|
31
31
|
const handleMenuOpen = event => {
|
|
32
|
-
setOpen(
|
|
32
|
+
setOpen(prevOpen => !prevOpen);
|
|
33
33
|
onClick == null ? void 0 : onClick(event);
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -45,6 +45,17 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
const handleMenuClickAway = event => {
|
|
49
|
+
var _buttonRef$current;
|
|
50
|
+
|
|
51
|
+
if (buttonRef.current === event.target || // if user clicked on the icon
|
|
52
|
+
(_buttonRef$current = buttonRef.current) != null && _buttonRef$current.contains(event.target)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setOpen(false);
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
if (children == null) {
|
|
49
60
|
return null;
|
|
50
61
|
}
|
|
@@ -66,7 +77,7 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
|
|
|
66
77
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
67
78
|
open: open,
|
|
68
79
|
target: buttonRef.current,
|
|
69
|
-
onClickAway:
|
|
80
|
+
onClickAway: handleMenuClickAway,
|
|
70
81
|
position: "bottom-start",
|
|
71
82
|
children: /*#__PURE__*/_jsx(MenuList, {
|
|
72
83
|
id: menuId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GRID_EXPERIMENTAL_ENABLED
|
|
1
|
+
export declare const GRID_EXPERIMENTAL_ENABLED = false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// A guide to feature toggling (deprecated)
|
|
2
2
|
//
|
|
3
3
|
// The feature toggle is:
|
|
4
4
|
// - independent from the NODE_ENV
|
|
@@ -15,13 +15,4 @@ import { localStorageAvailable } from '../utils/utils'; // A guide to feature to
|
|
|
15
15
|
//
|
|
16
16
|
// Developers (users) are discouraged to enable the experimental feature by setting the GRID_EXPERIMENTAL_ENABLED env.
|
|
17
17
|
// Instead, prefer exposing experimental APIs, for instance, a prop or a new `unstable_` module.
|
|
18
|
-
|
|
19
|
-
let experimentalEnabled = false;
|
|
20
|
-
|
|
21
|
-
if (typeof process !== 'undefined' && process.env.GRID_EXPERIMENTAL_ENABLED !== undefined && localStorageAvailable() && window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED')) {
|
|
22
|
-
experimentalEnabled = window.localStorage.getItem('GRID_EXPERIMENTAL_ENABLED') === 'true';
|
|
23
|
-
} else if (typeof process !== 'undefined') {
|
|
24
|
-
experimentalEnabled = process.env.GRID_EXPERIMENTAL_ENABLED === 'true';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const GRID_EXPERIMENTAL_ENABLED = experimentalEnabled;
|
|
18
|
+
export const GRID_EXPERIMENTAL_ENABLED = false;
|
|
@@ -15,6 +15,7 @@ import { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../mode
|
|
|
15
15
|
const 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');
|
|
16
16
|
export const useGridCellEditing = (apiRef, props) => {
|
|
17
17
|
const [cellModesModel, setCellModesModel] = React.useState({});
|
|
18
|
+
const cellModesModelRef = React.useRef(cellModesModel);
|
|
18
19
|
const prevCellModesModel = React.useRef({});
|
|
19
20
|
const {
|
|
20
21
|
processRowUpdate,
|
|
@@ -62,6 +63,10 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
if (apiRef.current.getCellMode(params.id, params.field) === GridCellModes.View) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
const newParams = _extends({}, params, {
|
|
66
71
|
reason: GridCellEditStopReasons.cellFocusOut
|
|
67
72
|
});
|
|
@@ -97,15 +102,14 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
97
102
|
} else if (params.isEditable) {
|
|
98
103
|
let reason;
|
|
99
104
|
|
|
100
|
-
if (isPrintableKey(event
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
+
if (isPrintableKey(event)) {
|
|
106
|
+
reason = GridCellEditStartReasons.printableKeyDown;
|
|
107
|
+
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
105
108
|
reason = GridCellEditStartReasons.printableKeyDown;
|
|
106
109
|
} else if (event.key === 'Enter') {
|
|
107
110
|
reason = GridCellEditStartReasons.enterKeyDown;
|
|
108
|
-
} else if (event.key === 'Delete') {
|
|
111
|
+
} else if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
112
|
+
// Delete on Windows, Backspace on macOS
|
|
109
113
|
reason = GridCellEditStartReasons.deleteKeyDown;
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -195,18 +199,21 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
setCellModesModel(newModel);
|
|
202
|
+
cellModesModelRef.current = newModel;
|
|
198
203
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
199
204
|
}, [apiRef, onCellModesModelChange, props.cellModesModel, signature]);
|
|
200
205
|
const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {
|
|
201
|
-
|
|
206
|
+
// We use the ref because it always contain the up-to-date value, different from the state
|
|
207
|
+
// that needs a rerender to reflect the new value
|
|
208
|
+
const newModel = _extends({}, cellModesModelRef.current);
|
|
202
209
|
|
|
203
210
|
if (newProps !== null) {
|
|
204
211
|
newModel[id] = _extends({}, newModel[id], {
|
|
205
212
|
[field]: _extends({}, newProps)
|
|
206
213
|
});
|
|
207
214
|
} else {
|
|
208
|
-
const
|
|
209
|
-
otherFields = _objectWithoutPropertiesLoose(
|
|
215
|
+
const _newModel$id = newModel[id],
|
|
216
|
+
otherFields = _objectWithoutPropertiesLoose(_newModel$id, [field].map(_toPropertyKey)); // Ensure that we have a new object, not a reference
|
|
210
217
|
|
|
211
218
|
|
|
212
219
|
newModel[id] = otherFields;
|
|
@@ -217,7 +224,7 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
217
224
|
}
|
|
218
225
|
|
|
219
226
|
updateCellModesModel(newModel);
|
|
220
|
-
}, [
|
|
227
|
+
}, [updateCellModesModel]);
|
|
221
228
|
const updateOrDeleteFieldState = React.useCallback((id, field, newProps) => {
|
|
222
229
|
apiRef.current.setState(state => {
|
|
223
230
|
const newEditingState = _extends({}, state.editRows);
|
|
@@ -290,12 +297,12 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
290
297
|
apiRef.current.unstable_runPendingEditCellValueMutation(id, field);
|
|
291
298
|
|
|
292
299
|
const finishCellEditMode = () => {
|
|
300
|
+
updateOrDeleteFieldState(id, field, null);
|
|
301
|
+
updateFieldInCellModesModel(id, field, null);
|
|
302
|
+
|
|
293
303
|
if (cellToFocusAfter !== 'none') {
|
|
294
304
|
apiRef.current.unstable_moveFocusToRelativeCell(id, field, cellToFocusAfter);
|
|
295
305
|
}
|
|
296
|
-
|
|
297
|
-
updateOrDeleteFieldState(id, field, null);
|
|
298
|
-
updateFieldInCellModesModel(id, field, null);
|
|
299
306
|
};
|
|
300
307
|
|
|
301
308
|
if (ignoreModifications) {
|
|
@@ -199,7 +199,7 @@ export const useCellEditing = (apiRef, props) => {
|
|
|
199
199
|
const isEditMode = cellMode === GridCellModes.Edit;
|
|
200
200
|
const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
|
|
201
201
|
|
|
202
|
-
if (!isEditMode && isCellEnterEditModeKeys(event
|
|
202
|
+
if (!isEditMode && isCellEnterEditModeKeys(event) && !isModifierKeyPressed && !(event.key === ' ' && event.shiftKey)) {
|
|
203
203
|
apiRef.current.publishEvent('cellEditStart', params, event);
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -269,7 +269,7 @@ export const useCellEditing = (apiRef, props) => {
|
|
|
269
269
|
|
|
270
270
|
apiRef.current.setCellMode(params.id, params.field, GridCellModes.Edit);
|
|
271
271
|
|
|
272
|
-
if (isKeyboardEvent(event) && isPrintableKey(event
|
|
272
|
+
if (isKeyboardEvent(event) && isPrintableKey(event)) {
|
|
273
273
|
apiRef.current.unstable_setEditCellProps({
|
|
274
274
|
id: params.id,
|
|
275
275
|
field: params.field,
|
|
@@ -16,6 +16,7 @@ import { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models
|
|
|
16
16
|
const 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');
|
|
17
17
|
export const useGridRowEditing = (apiRef, props) => {
|
|
18
18
|
const [rowModesModel, setRowModesModel] = React.useState({});
|
|
19
|
+
const rowModesModelRef = React.useRef(rowModesModel);
|
|
19
20
|
const prevRowModesModel = React.useRef({});
|
|
20
21
|
const focusTimeout = React.useRef(null);
|
|
21
22
|
const nextFocusedCell = React.useRef(null);
|
|
@@ -90,6 +91,11 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
90
91
|
// The row might have been deleted during the click
|
|
91
92
|
if (!apiRef.current.getRow(params.id)) {
|
|
92
93
|
return;
|
|
94
|
+
} // The row may already changed its mode
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if (apiRef.current.getRowMode(params.id) === GridRowModes.View) {
|
|
98
|
+
return;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
const rowParams = apiRef.current.getRowParams(params.id);
|
|
@@ -153,15 +159,14 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
153
159
|
} else if (params.isEditable) {
|
|
154
160
|
let reason;
|
|
155
161
|
|
|
156
|
-
if (isPrintableKey(event
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
162
|
+
if (isPrintableKey(event)) {
|
|
163
|
+
reason = GridRowEditStartReasons.printableKeyDown;
|
|
164
|
+
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
161
165
|
reason = GridRowEditStartReasons.printableKeyDown;
|
|
162
166
|
} else if (event.key === 'Enter') {
|
|
163
167
|
reason = GridRowEditStartReasons.enterKeyDown;
|
|
164
|
-
} else if (event.key === 'Delete') {
|
|
168
|
+
} else if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
169
|
+
// Delete on Windows, Backspace on macOS
|
|
165
170
|
reason = GridRowEditStartReasons.deleteKeyDown;
|
|
166
171
|
}
|
|
167
172
|
|
|
@@ -261,10 +266,11 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
261
266
|
}
|
|
262
267
|
|
|
263
268
|
setRowModesModel(newModel);
|
|
269
|
+
rowModesModelRef.current = newModel;
|
|
264
270
|
apiRef.current.publishEvent('rowModesModelChange', newModel);
|
|
265
271
|
}, [apiRef, onRowModesModelChange, props.rowModesModel, signature]);
|
|
266
272
|
const updateRowInRowModesModel = React.useCallback((id, newProps) => {
|
|
267
|
-
const newModel = _extends({},
|
|
273
|
+
const newModel = _extends({}, rowModesModelRef.current);
|
|
268
274
|
|
|
269
275
|
if (newProps !== null) {
|
|
270
276
|
newModel[id] = _extends({}, newProps);
|
|
@@ -273,7 +279,7 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
273
279
|
}
|
|
274
280
|
|
|
275
281
|
updateRowModesModel(newModel);
|
|
276
|
-
}, [
|
|
282
|
+
}, [updateRowModesModel]);
|
|
277
283
|
const updateOrDeleteRowState = React.useCallback((id, newProps) => {
|
|
278
284
|
apiRef.current.setState(state => {
|
|
279
285
|
const newEditingState = _extends({}, state.editRows);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { GridFilterItem } from '../../../models/gridFilterItem';
|
|
1
2
|
import { GridFilterModel } from '../../../models/gridFilterModel';
|
|
2
3
|
import { GridRowId } from '../../../models/gridRows';
|
|
4
|
+
export declare type GridFilterItemResult = {
|
|
5
|
+
[key: Required<GridFilterItem>['id']]: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare type GridQuickFilterValueResult = {
|
|
8
|
+
[key: string]: boolean;
|
|
9
|
+
};
|
|
3
10
|
export declare const getDefaultGridFilterModel: () => GridFilterModel;
|
|
4
11
|
export interface GridFilterState {
|
|
5
12
|
filterModel: GridFilterModel;
|
|
@@ -31,8 +38,12 @@ export interface GridFilterInitialState {
|
|
|
31
38
|
* @param {GridRowId} rowId The id of the row we want to filter.
|
|
32
39
|
* @param {(filterItem: GridFilterItem) => boolean} shouldApplyItem An optional callback to allow the filtering engine to only apply some items.
|
|
33
40
|
*/
|
|
34
|
-
export declare type GridAggregatedFilterItemApplier = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) =>
|
|
41
|
+
export declare type GridAggregatedFilterItemApplier = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) => {
|
|
42
|
+
passingFilterItems: null | GridFilterItemResult;
|
|
43
|
+
passingQuickFilterValues: null | GridQuickFilterValueResult;
|
|
44
|
+
};
|
|
35
45
|
export interface GridFilteringMethodParams {
|
|
36
46
|
isRowMatchingFilters: GridAggregatedFilterItemApplier | null;
|
|
47
|
+
filterModel: GridFilterModel;
|
|
37
48
|
}
|
|
38
49
|
export declare type GridFilteringMethodValue = Omit<GridFilterState, 'filterModel'>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GridFilterItem, GridFilterModel } from '../../../models';
|
|
2
|
+
import { GridFilterItem, GridFilterModel, GridRowId } from '../../../models';
|
|
3
3
|
import { GridApiCommunity } from '../../../models/api/gridApiCommunity';
|
|
4
4
|
import { GridStateCommunity } from '../../../models/gridStateCommunity';
|
|
5
|
-
import { GridAggregatedFilterItemApplier } from './gridFilterState';
|
|
5
|
+
import { GridAggregatedFilterItemApplier, GridFilterItemResult, GridQuickFilterValueResult } from './gridFilterState';
|
|
6
|
+
declare type GridFilterItemApplierNotAggregated = (rowId: GridRowId, shouldApplyItem?: (columnField: string) => boolean) => GridFilterItemResult;
|
|
6
7
|
/**
|
|
7
8
|
* Adds default values to the optional fields of a filter items.
|
|
8
9
|
* @param {GridFilterItem} item The raw filter item.
|
|
@@ -19,12 +20,14 @@ export declare const mergeStateWithFilterModel: (filterModel: GridFilterModel, d
|
|
|
19
20
|
* @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
20
21
|
* @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
|
|
21
22
|
*/
|
|
22
|
-
export declare const buildAggregatedFilterItemsApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) =>
|
|
23
|
+
export declare const buildAggregatedFilterItemsApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridFilterItemApplierNotAggregated | null;
|
|
23
24
|
/**
|
|
24
25
|
* Generates a method to easily check if a row is matching the current quick filter.
|
|
25
26
|
* @param {any[]} values The model with which we want to filter the rows.
|
|
26
27
|
* @param {React.MutableRefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
27
28
|
* @returns {GridAggregatedFilterItemApplier | null} A method that checks if a row is matching the current filter model. If `null`, we consider that all the rows are matching the filters.
|
|
28
29
|
*/
|
|
29
|
-
export declare const buildAggregatedQuickFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) =>
|
|
30
|
-
export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier
|
|
30
|
+
export declare const buildAggregatedQuickFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridFilterItemApplierNotAggregated | null;
|
|
31
|
+
export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier;
|
|
32
|
+
export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel) => boolean;
|
|
33
|
+
export {};
|