@mui/x-data-grid 9.8.0 → 9.9.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.
Files changed (180) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/DataGrid/DataGrid.js +7 -0
  3. package/DataGrid/DataGrid.mjs +7 -0
  4. package/components/GridColumnSortButton.d.mts +1 -1
  5. package/components/GridColumnSortButton.d.ts +1 -1
  6. package/components/GridColumnUnsortedIcon.d.mts +2 -1
  7. package/components/GridColumnUnsortedIcon.d.ts +2 -1
  8. package/components/GridHeader.d.mts +2 -1
  9. package/components/GridHeader.d.ts +2 -1
  10. package/components/GridHeaders.d.mts +1 -1
  11. package/components/GridHeaders.d.ts +1 -1
  12. package/components/GridPagination.d.mts +2 -1
  13. package/components/GridPagination.d.ts +2 -1
  14. package/components/GridRowDragAndDropOverlay.d.mts +1 -1
  15. package/components/GridRowDragAndDropOverlay.d.ts +1 -1
  16. package/components/GridScrollArea.d.mts +2 -1
  17. package/components/GridScrollArea.d.ts +2 -1
  18. package/components/GridScrollShadows.d.mts +2 -1
  19. package/components/GridScrollShadows.d.ts +2 -1
  20. package/components/GridScrollbarFillerCell.d.mts +1 -1
  21. package/components/GridScrollbarFillerCell.d.ts +1 -1
  22. package/components/base/GridFooterPlaceholder.d.mts +1 -1
  23. package/components/base/GridFooterPlaceholder.d.ts +1 -1
  24. package/components/base/GridFooterPlaceholder.js +1 -1
  25. package/components/base/GridFooterPlaceholder.mjs +1 -1
  26. package/components/base/GridOverlays.d.mts +1 -1
  27. package/components/base/GridOverlays.d.ts +1 -1
  28. package/components/cell/GridActionsCell.d.mts +2 -2
  29. package/components/cell/GridActionsCell.d.ts +2 -2
  30. package/components/cell/GridActionsCellItem.js +1 -58
  31. package/components/cell/GridActionsCellItem.mjs +1 -58
  32. package/components/cell/GridBooleanCell.d.mts +1 -1
  33. package/components/cell/GridBooleanCell.d.ts +1 -1
  34. package/components/cell/GridEditBooleanCell.d.mts +2 -2
  35. package/components/cell/GridEditBooleanCell.d.ts +2 -2
  36. package/components/cell/GridEditDateCell.d.mts +2 -2
  37. package/components/cell/GridEditDateCell.d.ts +2 -2
  38. package/components/cell/GridEditInputCell.d.mts +1 -1
  39. package/components/cell/GridEditInputCell.d.ts +1 -1
  40. package/components/cell/GridEditLongTextCell.d.mts +2 -2
  41. package/components/cell/GridEditLongTextCell.d.ts +2 -2
  42. package/components/cell/GridEditSingleSelectCell.d.mts +3 -2
  43. package/components/cell/GridEditSingleSelectCell.d.ts +3 -2
  44. package/components/cell/GridFooterCell.d.mts +1 -1
  45. package/components/cell/GridFooterCell.d.ts +1 -1
  46. package/components/cell/GridLongTextCell.d.mts +2 -2
  47. package/components/cell/GridLongTextCell.d.ts +2 -2
  48. package/components/cell/GridSkeletonCell.d.mts +1 -1
  49. package/components/cell/GridSkeletonCell.d.ts +1 -1
  50. package/components/columnHeaders/ColumnHeaderMenuIcon.d.mts +1 -1
  51. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  52. package/components/columnHeaders/GridColumnGroupHeader.d.mts +1 -1
  53. package/components/columnHeaders/GridColumnGroupHeader.d.ts +1 -1
  54. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.mts +1 -1
  55. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
  56. package/components/columnHeaders/GridColumnHeaderItem.d.mts +1 -1
  57. package/components/columnHeaders/GridColumnHeaderItem.d.ts +1 -1
  58. package/components/columnHeaders/GridColumnHeaderSeparator.d.mts +1 -1
  59. package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
  60. package/components/columnHeaders/GridColumnHeaderSortIcon.d.mts +1 -1
  61. package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
  62. package/components/columnHeaders/GridColumnHeaderTitle.d.mts +1 -1
  63. package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
  64. package/components/columnsManagement/GridColumnsManagement.d.mts +2 -1
  65. package/components/columnsManagement/GridColumnsManagement.d.ts +2 -1
  66. package/components/menu/GridMenu.d.mts +1 -1
  67. package/components/menu/GridMenu.d.ts +1 -1
  68. package/components/menu/columnMenu/GridColumnHeaderMenu.d.mts +1 -1
  69. package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
  70. package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.mts +2 -1
  71. package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -1
  72. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.mts +2 -1
  73. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -1
  74. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.mts +2 -1
  75. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -1
  76. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.mts +2 -1
  77. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -1
  78. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.mts +2 -1
  79. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -1
  80. package/components/panel/GridColumnsPanel.d.mts +1 -1
  81. package/components/panel/GridColumnsPanel.d.ts +1 -1
  82. package/components/panel/GridPanelContent.d.mts +1 -1
  83. package/components/panel/GridPanelContent.d.ts +1 -1
  84. package/components/panel/GridPanelContext.d.mts +1 -1
  85. package/components/panel/GridPanelContext.d.ts +1 -1
  86. package/components/panel/GridPanelFooter.d.mts +1 -1
  87. package/components/panel/GridPanelFooter.d.ts +1 -1
  88. package/components/panel/GridPanelHeader.d.mts +1 -1
  89. package/components/panel/GridPanelHeader.d.ts +1 -1
  90. package/components/panel/GridPreferencesPanel.d.mts +1 -1
  91. package/components/panel/GridPreferencesPanel.d.ts +1 -1
  92. package/components/panel/filterPanel/GridFilterForm.d.mts +1 -98
  93. package/components/panel/filterPanel/GridFilterForm.d.ts +1 -98
  94. package/components/panel/filterPanel/GridFilterForm.js +9 -355
  95. package/components/panel/filterPanel/GridFilterForm.mjs +8 -354
  96. package/components/panel/filterPanel/GridFilterFormBase.d.mts +119 -0
  97. package/components/panel/filterPanel/GridFilterFormBase.d.ts +119 -0
  98. package/components/panel/filterPanel/GridFilterFormBase.js +497 -0
  99. package/components/panel/filterPanel/GridFilterFormBase.mjs +491 -0
  100. package/components/panel/filterPanel/GridFilterInputBoolean.d.mts +2 -1
  101. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +2 -1
  102. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -1
  103. package/components/panel/filterPanel/GridFilterInputBoolean.mjs +6 -1
  104. package/components/panel/filterPanel/GridFilterInputDate.d.mts +2 -1
  105. package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
  106. package/components/panel/filterPanel/GridFilterInputDate.js +21 -9
  107. package/components/panel/filterPanel/GridFilterInputDate.mjs +21 -9
  108. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.mts +2 -1
  109. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -1
  110. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -1
  111. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +6 -1
  112. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.mts +2 -1
  113. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -1
  114. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +6 -1
  115. package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +6 -1
  116. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.mts +2 -1
  117. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -1
  118. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -1
  119. package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +6 -1
  120. package/components/panel/filterPanel/GridFilterInputValue.d.mts +2 -1
  121. package/components/panel/filterPanel/GridFilterInputValue.d.ts +2 -1
  122. package/components/panel/filterPanel/GridFilterInputValue.js +19 -8
  123. package/components/panel/filterPanel/GridFilterInputValue.mjs +19 -8
  124. package/components/panel/filterPanel/GridFilterPanel.d.mts +3 -40
  125. package/components/panel/filterPanel/GridFilterPanel.d.ts +3 -40
  126. package/components/panel/filterPanel/GridFilterPanel.js +19 -174
  127. package/components/panel/filterPanel/GridFilterPanel.mjs +14 -173
  128. package/components/panel/filterPanel/GridFilterPanelBase.d.mts +79 -0
  129. package/components/panel/filterPanel/GridFilterPanelBase.d.ts +79 -0
  130. package/components/panel/filterPanel/GridFilterPanelBase.js +304 -0
  131. package/components/panel/filterPanel/GridFilterPanelBase.mjs +297 -0
  132. package/components/panel/filterPanel/index.d.mts +3 -1
  133. package/components/panel/filterPanel/index.d.ts +3 -1
  134. package/components/panel/filterPanel/index.js +9 -1
  135. package/components/panel/filterPanel/index.mjs +3 -0
  136. package/components/quickFilter/QuickFilter.d.mts +1 -1
  137. package/components/quickFilter/QuickFilter.d.ts +1 -1
  138. package/components/toolbar/GridToolbarExport.d.mts +2 -2
  139. package/components/toolbar/GridToolbarExport.d.ts +2 -2
  140. package/components/toolbar/GridToolbarQuickFilter.d.mts +1 -1
  141. package/components/toolbar/GridToolbarQuickFilter.d.ts +1 -1
  142. package/components/toolbarV8/GridToolbar.d.mts +3 -3
  143. package/components/toolbarV8/GridToolbar.d.ts +3 -3
  144. package/components/virtualization/GridBottomContainer.d.mts +1 -1
  145. package/components/virtualization/GridBottomContainer.d.ts +1 -1
  146. package/components/virtualization/GridTopContainer.d.mts +1 -1
  147. package/components/virtualization/GridTopContainer.d.ts +1 -1
  148. package/components/virtualization/GridVirtualScroller.d.mts +1 -1
  149. package/components/virtualization/GridVirtualScroller.d.ts +1 -1
  150. package/components/virtualization/GridVirtualScrollerFiller.d.mts +2 -1
  151. package/components/virtualization/GridVirtualScrollerFiller.d.ts +2 -1
  152. package/constants/dataGridPropsDefaultValues.js +1 -0
  153. package/constants/dataGridPropsDefaultValues.mjs +1 -0
  154. package/context/GridContextProvider.d.mts +1 -1
  155. package/context/GridContextProvider.d.ts +1 -1
  156. package/hooks/features/columnHeaders/useGridColumnHeaders.d.mts +2 -2
  157. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +2 -2
  158. package/hooks/features/dataSource/useGridDataSourceBase.d.mts +1 -1
  159. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  160. package/hooks/features/dataSource/useGridDataSourceBase.js +39 -10
  161. package/hooks/features/dataSource/useGridDataSourceBase.mjs +39 -10
  162. package/hooks/features/filter/gridFilterUtils.d.mts +12 -0
  163. package/hooks/features/filter/gridFilterUtils.d.ts +12 -0
  164. package/hooks/features/filter/gridFilterUtils.js +56 -1
  165. package/hooks/features/filter/gridFilterUtils.mjs +52 -0
  166. package/hooks/features/filter/useGridFilter.js +4 -35
  167. package/hooks/features/filter/useGridFilter.mjs +5 -36
  168. package/index.js +1 -1
  169. package/index.mjs +1 -1
  170. package/internals/demo/TailwindDemoContainer.d.mts +1 -1
  171. package/internals/demo/TailwindDemoContainer.d.ts +1 -1
  172. package/models/gridFilterInputComponent.d.mts +5 -0
  173. package/models/gridFilterInputComponent.d.ts +5 -0
  174. package/models/gridSlotsComponentsProps.d.mts +1 -1
  175. package/models/gridSlotsComponentsProps.d.ts +1 -1
  176. package/models/props/DataGridProps.d.mts +7 -0
  177. package/models/props/DataGridProps.d.ts +7 -0
  178. package/package.json +4 -4
  179. package/utils/css/context.d.mts +3 -3
  180. package/utils/css/context.d.ts +3 -3
@@ -3,7 +3,7 @@
3
3
  import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
6
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled"];
6
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled", "disableDebounce"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import useId from '@mui/utils/useId';
@@ -41,7 +41,8 @@ function GridFilterInputDate(props) {
41
41
  headerFilterMenu,
42
42
  clearButton,
43
43
  tabIndex,
44
- disabled
44
+ disabled,
45
+ disableDebounce = false
45
46
  } = props,
46
47
  other = _objectWithoutPropertiesLoose(props, _excluded);
47
48
  const rootSlotProps = slotProps?.root.slotProps;
@@ -50,19 +51,25 @@ function GridFilterInputDate(props) {
50
51
  const [applying, setIsApplying] = React.useState(false);
51
52
  const id = useId();
52
53
  const rootProps = useGridRootProps();
54
+ const debounceMs = disableDebounce ? 0 : rootProps.filterDebounceMs;
53
55
  const onFilterChange = React.useCallback(event => {
54
56
  filterTimeout.clear();
55
57
  const value = event.target.value;
56
58
  setFilterValueState(value);
59
+ const date = new Date(value);
60
+ const newItem = _extends({}, item, {
61
+ value: Number.isNaN(date.getTime()) ? undefined : date
62
+ });
63
+ if (debounceMs === 0) {
64
+ applyValue(newItem);
65
+ return;
66
+ }
57
67
  setIsApplying(true);
58
- filterTimeout.start(rootProps.filterDebounceMs, () => {
59
- const date = new Date(value);
60
- applyValue(_extends({}, item, {
61
- value: Number.isNaN(date.getTime()) ? undefined : date
62
- }));
68
+ filterTimeout.start(debounceMs, () => {
69
+ applyValue(newItem);
63
70
  setIsApplying(false);
64
71
  });
65
- }, [applyValue, item, rootProps.filterDebounceMs, filterTimeout]);
72
+ }, [applyValue, item, debounceMs, filterTimeout]);
66
73
  React.useEffect(() => {
67
74
  const value = convertFilterItemValueToInputValue(item.value, type);
68
75
  setFilterValueState(value);
@@ -80,7 +87,7 @@ function GridFilterInputDate(props) {
80
87
  inputRef: focusElementRef,
81
88
  slotProps: _extends({}, rootSlotProps, {
82
89
  input: _extends({
83
- endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
90
+ endAdornment: applying && debounceMs > 0 ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
84
91
  fontSize: "small",
85
92
  color: "action"
86
93
  }) : null
@@ -105,6 +112,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes /* remove-
105
112
  className: PropTypes.string,
106
113
  clearButton: PropTypes.node,
107
114
  disabled: PropTypes.bool,
115
+ /**
116
+ * If `true`, filter value changes are applied immediately without debouncing.
117
+ * @default false
118
+ */
119
+ disableDebounce: PropTypes.bool,
108
120
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
109
121
  headerFilterMenu: PropTypes.node,
110
122
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -1,10 +1,11 @@
1
+ import * as React from 'react';
1
2
  import type { AutocompleteProps } from "../../../models/gridBaseSlots.mjs";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.mjs";
3
4
  import type { ValueOptions } from "../../../models/colDef/gridColDef.mjs";
4
5
  export type GridFilterInputMultipleSingleSelectProps = GridFilterInputValueProps<Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options'>> & {
5
6
  type?: 'singleSelect';
6
7
  };
7
- declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): import("react/jsx-runtime").JSX.Element | null;
8
+ declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element | null;
8
9
  declare namespace GridFilterInputMultipleSingleSelect {
9
10
  var propTypes: any;
10
11
  }
@@ -1,10 +1,11 @@
1
+ import * as React from 'react';
1
2
  import type { AutocompleteProps } from "../../../models/gridBaseSlots.js";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.js";
3
4
  import type { ValueOptions } from "../../../models/colDef/gridColDef.js";
4
5
  export type GridFilterInputMultipleSingleSelectProps = GridFilterInputValueProps<Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options'>> & {
5
6
  type?: 'singleSelect';
6
7
  };
7
- declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): import("react/jsx-runtime").JSX.Element | null;
8
+ declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element | null;
8
9
  declare namespace GridFilterInputMultipleSingleSelect {
9
10
  var propTypes: any;
10
11
  }
@@ -15,7 +15,7 @@ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
15
15
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
16
16
  var _filterPanelUtils = require("./filterPanelUtils");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
18
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "disableDebounce"];
19
19
  function GridFilterInputMultipleSingleSelect(props) {
20
20
  const {
21
21
  item,
@@ -89,6 +89,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.prop
89
89
  className: _propTypes.default.string,
90
90
  clearButton: _propTypes.default.node,
91
91
  disabled: _propTypes.default.bool,
92
+ /**
93
+ * If `true`, filter value changes are applied immediately without debouncing.
94
+ * @default false
95
+ */
96
+ disableDebounce: _propTypes.default.bool,
92
97
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
93
98
  headerFilterMenu: _propTypes.default.node,
94
99
  inputRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
@@ -1,7 +1,7 @@
1
1
  import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
4
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "disableDebounce"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import useId from '@mui/utils/useId';
@@ -81,6 +81,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.prop
81
81
  className: PropTypes.string,
82
82
  clearButton: PropTypes.node,
83
83
  disabled: PropTypes.bool,
84
+ /**
85
+ * If `true`, filter value changes are applied immediately without debouncing.
86
+ * @default false
87
+ */
88
+ disableDebounce: PropTypes.bool,
84
89
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
85
90
  headerFilterMenu: PropTypes.node,
86
91
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -1,9 +1,10 @@
1
+ import * as React from 'react';
1
2
  import type { AutocompleteProps } from "../../../models/gridBaseSlots.mjs";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.mjs";
3
4
  export type GridFilterInputMultipleValueProps = GridFilterInputValueProps<Omit<AutocompleteProps<string, true, false, true>, 'options'>> & {
4
5
  type?: 'text' | 'number' | 'date' | 'datetime-local';
5
6
  };
6
- declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): React.JSX.Element;
7
8
  declare namespace GridFilterInputMultipleValue {
8
9
  var propTypes: any;
9
10
  }
@@ -1,9 +1,10 @@
1
+ import * as React from 'react';
1
2
  import type { AutocompleteProps } from "../../../models/gridBaseSlots.js";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.js";
3
4
  export type GridFilterInputMultipleValueProps = GridFilterInputValueProps<Omit<AutocompleteProps<string, true, false, true>, 'options'>> & {
4
5
  type?: 'text' | 'number' | 'date' | 'datetime-local';
5
6
  };
6
- declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): React.JSX.Element;
7
8
  declare namespace GridFilterInputMultipleValue {
8
9
  var propTypes: any;
9
10
  }
@@ -15,7 +15,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
  var _useId = _interopRequireDefault(require("@mui/utils/useId"));
16
16
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
18
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "disableDebounce"];
19
19
  function GridFilterInputMultipleValue(props) {
20
20
  const {
21
21
  item,
@@ -78,6 +78,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes /
78
78
  className: _propTypes.default.string,
79
79
  clearButton: _propTypes.default.node,
80
80
  disabled: _propTypes.default.bool,
81
+ /**
82
+ * If `true`, filter value changes are applied immediately without debouncing.
83
+ * @default false
84
+ */
85
+ disableDebounce: _propTypes.default.bool,
81
86
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
82
87
  headerFilterMenu: _propTypes.default.node,
83
88
  inputRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
@@ -3,7 +3,7 @@
3
3
  import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
6
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps"];
6
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "slotProps", "disableDebounce"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import useId from '@mui/utils/useId';
@@ -71,6 +71,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes /
71
71
  className: PropTypes.string,
72
72
  clearButton: PropTypes.node,
73
73
  disabled: PropTypes.bool,
74
+ /**
75
+ * If `true`, filter value changes are applied immediately without debouncing.
76
+ * @default false
77
+ */
78
+ disableDebounce: PropTypes.bool,
74
79
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
75
80
  headerFilterMenu: PropTypes.node,
76
81
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -1,9 +1,10 @@
1
+ import * as React from 'react';
1
2
  import type { TextFieldProps } from "../../../models/gridBaseSlots.mjs";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.mjs";
3
4
  export type GridFilterInputSingleSelectProps = GridFilterInputValueProps<TextFieldProps> & {
4
5
  type?: 'singleSelect';
5
6
  };
6
- declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): import("react/jsx-runtime").JSX.Element | null;
7
+ declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): React.JSX.Element | null;
7
8
  declare namespace GridFilterInputSingleSelect {
8
9
  var propTypes: any;
9
10
  }
@@ -1,9 +1,10 @@
1
+ import * as React from 'react';
1
2
  import type { TextFieldProps } from "../../../models/gridBaseSlots.js";
2
3
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.js";
3
4
  export type GridFilterInputSingleSelectProps = GridFilterInputValueProps<TextFieldProps> & {
4
5
  type?: 'singleSelect';
5
6
  };
6
- declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): import("react/jsx-runtime").JSX.Element | null;
7
+ declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): React.JSX.Element | null;
7
8
  declare namespace GridFilterInputSingleSelect {
8
9
  var propTypes: any;
9
10
  }
@@ -16,7 +16,7 @@ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
16
16
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
17
17
  var _filterPanelUtils = require("./filterPanelUtils");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "isFilterActive", "clearButton", "headerFilterMenu", "slotProps"];
19
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "isFilterActive", "clearButton", "headerFilterMenu", "slotProps", "disableDebounce"];
20
20
  const renderSingleSelectOptions = ({
21
21
  column,
22
22
  OptionComponent,
@@ -115,6 +115,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes /*
115
115
  className: _propTypes.default.string,
116
116
  clearButton: _propTypes.default.node,
117
117
  disabled: _propTypes.default.bool,
118
+ /**
119
+ * If `true`, filter value changes are applied immediately without debouncing.
120
+ * @default false
121
+ */
122
+ disableDebounce: _propTypes.default.bool,
118
123
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
119
124
  headerFilterMenu: _propTypes.default.node,
120
125
  inputRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
@@ -1,7 +1,7 @@
1
1
  import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "isFilterActive", "clearButton", "headerFilterMenu", "slotProps"];
4
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "isFilterActive", "clearButton", "headerFilterMenu", "slotProps", "disableDebounce"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import useId from '@mui/utils/useId';
@@ -107,6 +107,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes /*
107
107
  className: PropTypes.string,
108
108
  clearButton: PropTypes.node,
109
109
  disabled: PropTypes.bool,
110
+ /**
111
+ * If `true`, filter value changes are applied immediately without debouncing.
112
+ * @default false
113
+ */
114
+ disableDebounce: PropTypes.bool,
110
115
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
111
116
  headerFilterMenu: PropTypes.node,
112
117
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { TextFieldProps } from "../../../models/gridBaseSlots.mjs";
2
3
  import type { GridFilterItem } from "../../../models/gridFilterItem.mjs";
3
4
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.mjs";
@@ -7,7 +8,7 @@ export type GridTypeFilterInputValueProps = GridFilterInputValueProps<TextFieldP
7
8
  export type ItemPlusTag = GridFilterItem & {
8
9
  fromInput?: string;
9
10
  };
10
- declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): React.JSX.Element;
11
12
  declare namespace GridFilterInputValue {
12
13
  var propTypes: any;
13
14
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { TextFieldProps } from "../../../models/gridBaseSlots.js";
2
3
  import type { GridFilterItem } from "../../../models/gridFilterItem.js";
3
4
  import type { GridFilterInputValueProps } from "../../../models/gridFilterInputComponent.js";
@@ -7,7 +8,7 @@ export type GridTypeFilterInputValueProps = GridFilterInputValueProps<TextFieldP
7
8
  export type ItemPlusTag = GridFilterItem & {
8
9
  fromInput?: string;
9
10
  };
10
- declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): React.JSX.Element;
11
12
  declare namespace GridFilterInputValue {
12
13
  var propTypes: any;
13
14
  }
@@ -16,7 +16,7 @@ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
16
16
  var _useTimeout = require("../../../hooks/utils/useTimeout");
17
17
  var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "slotProps", "clearButton", "headerFilterMenu"];
19
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "disableDebounce", "isFilterActive", "slotProps", "clearButton", "headerFilterMenu"];
20
20
  function GridFilterInputValue(props) {
21
21
  const {
22
22
  item,
@@ -26,6 +26,7 @@ function GridFilterInputValue(props) {
26
26
  focusElementRef,
27
27
  tabIndex,
28
28
  disabled,
29
+ disableDebounce = false,
29
30
  slotProps,
30
31
  clearButton,
31
32
  headerFilterMenu
@@ -37,19 +38,24 @@ function GridFilterInputValue(props) {
37
38
  const [applying, setIsApplying] = React.useState(false);
38
39
  const id = (0, _useId.default)();
39
40
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
41
+ const debounceMs = disableDebounce ? 0 : rootProps.filterDebounceMs;
40
42
  const onFilterChange = React.useCallback(event => {
41
43
  const value = sanitizeFilterItemValue(event.target.value);
42
44
  setFilterValueState(value);
45
+ const newItem = (0, _extends2.default)({}, item, {
46
+ value: type === 'number' && !Number.isNaN(Number(value)) ? Number(value) : value,
47
+ fromInput: id
48
+ });
49
+ if (debounceMs === 0) {
50
+ applyValue(newItem);
51
+ return;
52
+ }
43
53
  setIsApplying(true);
44
- filterTimeout.start(rootProps.filterDebounceMs, () => {
45
- const newItem = (0, _extends2.default)({}, item, {
46
- value: type === 'number' && !Number.isNaN(Number(value)) ? Number(value) : value,
47
- fromInput: id
48
- });
54
+ filterTimeout.start(debounceMs, () => {
49
55
  applyValue(newItem);
50
56
  setIsApplying(false);
51
57
  });
52
- }, [filterTimeout, rootProps.filterDebounceMs, item, type, id, applyValue]);
58
+ }, [filterTimeout, debounceMs, item, type, id, applyValue]);
53
59
  React.useEffect(() => {
54
60
  const itemPlusTag = item;
55
61
  if (itemPlusTag.fromInput !== id || item.value == null) {
@@ -67,7 +73,7 @@ function GridFilterInputValue(props) {
67
73
  disabled: disabled,
68
74
  slotProps: (0, _extends2.default)({}, textFieldProps?.slotProps, {
69
75
  input: (0, _extends2.default)({
70
- endAdornment: applying ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {
76
+ endAdornment: applying && debounceMs > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {
71
77
  fontSize: "small",
72
78
  color: "action"
73
79
  }) : null
@@ -98,6 +104,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes /* remove
98
104
  className: _propTypes.default.string,
99
105
  clearButton: _propTypes.default.node,
100
106
  disabled: _propTypes.default.bool,
107
+ /**
108
+ * If `true`, filter value changes are applied immediately without debouncing.
109
+ * @default false
110
+ */
111
+ disableDebounce: _propTypes.default.bool,
101
112
  focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
102
113
  headerFilterMenu: _propTypes.default.node,
103
114
  inputRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
@@ -3,7 +3,7 @@
3
3
  import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
6
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "slotProps", "clearButton", "headerFilterMenu"];
6
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "disableDebounce", "isFilterActive", "slotProps", "clearButton", "headerFilterMenu"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import useId from '@mui/utils/useId';
@@ -19,6 +19,7 @@ function GridFilterInputValue(props) {
19
19
  focusElementRef,
20
20
  tabIndex,
21
21
  disabled,
22
+ disableDebounce = false,
22
23
  slotProps,
23
24
  clearButton,
24
25
  headerFilterMenu
@@ -30,19 +31,24 @@ function GridFilterInputValue(props) {
30
31
  const [applying, setIsApplying] = React.useState(false);
31
32
  const id = useId();
32
33
  const rootProps = useGridRootProps();
34
+ const debounceMs = disableDebounce ? 0 : rootProps.filterDebounceMs;
33
35
  const onFilterChange = React.useCallback(event => {
34
36
  const value = sanitizeFilterItemValue(event.target.value);
35
37
  setFilterValueState(value);
38
+ const newItem = _extends({}, item, {
39
+ value: type === 'number' && !Number.isNaN(Number(value)) ? Number(value) : value,
40
+ fromInput: id
41
+ });
42
+ if (debounceMs === 0) {
43
+ applyValue(newItem);
44
+ return;
45
+ }
36
46
  setIsApplying(true);
37
- filterTimeout.start(rootProps.filterDebounceMs, () => {
38
- const newItem = _extends({}, item, {
39
- value: type === 'number' && !Number.isNaN(Number(value)) ? Number(value) : value,
40
- fromInput: id
41
- });
47
+ filterTimeout.start(debounceMs, () => {
42
48
  applyValue(newItem);
43
49
  setIsApplying(false);
44
50
  });
45
- }, [filterTimeout, rootProps.filterDebounceMs, item, type, id, applyValue]);
51
+ }, [filterTimeout, debounceMs, item, type, id, applyValue]);
46
52
  React.useEffect(() => {
47
53
  const itemPlusTag = item;
48
54
  if (itemPlusTag.fromInput !== id || item.value == null) {
@@ -60,7 +66,7 @@ function GridFilterInputValue(props) {
60
66
  disabled: disabled,
61
67
  slotProps: _extends({}, textFieldProps?.slotProps, {
62
68
  input: _extends({
63
- endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
69
+ endAdornment: applying && debounceMs > 0 ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
64
70
  fontSize: "small",
65
71
  color: "action"
66
72
  }) : null
@@ -91,6 +97,11 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes /* remove
91
97
  className: PropTypes.string,
92
98
  clearButton: PropTypes.node,
93
99
  disabled: PropTypes.bool,
100
+ /**
101
+ * If `true`, filter value changes are applied immediately without debouncing.
102
+ * @default false
103
+ */
104
+ disableDebounce: PropTypes.bool,
94
105
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
95
106
  headerFilterMenu: PropTypes.node,
96
107
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
@@ -1,43 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { SxProps, Theme } from '@mui/material/styles';
3
- import type { GridFilterItem } from "../../../models/gridFilterItem.mjs";
4
- import type { GridFilterFormProps } from "./GridFilterForm.mjs";
5
- import type { GridColDef, GridStateColDef } from "../../../models/colDef/gridColDef.mjs";
6
- export interface GetColumnForNewFilterArgs {
7
- currentFilters: GridFilterItem[];
8
- columns: GridStateColDef[];
9
- }
10
- export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOperators' | 'columnsSort'> {
11
- /**
12
- * The system prop that allows defining system overrides as well as additional CSS styles.
13
- */
14
- sx?: SxProps<Theme>;
15
- /**
16
- * Function that returns the next filter item to be picked as default filter.
17
- * @param {GetColumnForNewFilterArgs} args Currently configured filters and columns.
18
- * @returns {GridColDef['field']} The field to be used for the next filter or `null` to prevent adding a filter.
19
- */
20
- getColumnForNewFilter?: (args: GetColumnForNewFilterArgs) => GridColDef['field'] | null;
21
- /**
22
- * Props passed to each filter form.
23
- */
24
- filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'logicOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps' | 'filterColumns'>;
25
- /**
26
- * If `true`, the `Add filter` button will not be displayed.
27
- * @default false
28
- */
29
- disableAddFilterButton?: boolean;
30
- /**
31
- * If `true`, the `Remove all` button will be disabled
32
- * @default false
33
- */
34
- disableRemoveAllButton?: boolean;
35
- /**
36
- * @ignore - do not document.
37
- */
38
- children?: React.ReactNode;
39
- }
40
- declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
2
+ import type { GridFilterPanelProps } from "./GridFilterPanelBase.mjs";
41
3
  declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps> | React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
42
4
  /**
43
5
  * Demos:
@@ -46,4 +8,5 @@ declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelPr
46
8
  * API:
47
9
  * - [GridFilterPanel API](https://mui.com/x/api/data-grid/grid-filter-panel/)
48
10
  */
49
- export { GridFilterPanel, getGridFilter };
11
+ export { GridFilterPanel };
12
+ export { getGridFilter } from "./GridFilterPanelBase.mjs";
@@ -1,43 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { SxProps, Theme } from '@mui/material/styles';
3
- import type { GridFilterItem } from "../../../models/gridFilterItem.js";
4
- import type { GridFilterFormProps } from "./GridFilterForm.js";
5
- import type { GridColDef, GridStateColDef } from "../../../models/colDef/gridColDef.js";
6
- export interface GetColumnForNewFilterArgs {
7
- currentFilters: GridFilterItem[];
8
- columns: GridStateColDef[];
9
- }
10
- export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOperators' | 'columnsSort'> {
11
- /**
12
- * The system prop that allows defining system overrides as well as additional CSS styles.
13
- */
14
- sx?: SxProps<Theme>;
15
- /**
16
- * Function that returns the next filter item to be picked as default filter.
17
- * @param {GetColumnForNewFilterArgs} args Currently configured filters and columns.
18
- * @returns {GridColDef['field']} The field to be used for the next filter or `null` to prevent adding a filter.
19
- */
20
- getColumnForNewFilter?: (args: GetColumnForNewFilterArgs) => GridColDef['field'] | null;
21
- /**
22
- * Props passed to each filter form.
23
- */
24
- filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'logicOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps' | 'filterColumns'>;
25
- /**
26
- * If `true`, the `Add filter` button will not be displayed.
27
- * @default false
28
- */
29
- disableAddFilterButton?: boolean;
30
- /**
31
- * If `true`, the `Remove all` button will be disabled
32
- * @default false
33
- */
34
- disableRemoveAllButton?: boolean;
35
- /**
36
- * @ignore - do not document.
37
- */
38
- children?: React.ReactNode;
39
- }
40
- declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
2
+ import type { GridFilterPanelProps } from "./GridFilterPanelBase.js";
41
3
  declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps> | React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
42
4
  /**
43
5
  * Demos:
@@ -46,4 +8,5 @@ declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelPr
46
8
  * API:
47
9
  * - [GridFilterPanel API](https://mui.com/x/api/data-grid/grid-filter-panel/)
48
10
  */
49
- export { GridFilterPanel, getGridFilter };
11
+ export { GridFilterPanel };
12
+ export { getGridFilter } from "./GridFilterPanelBase.js";