@mui/x-data-grid 9.8.0 → 9.10.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 +230 -0
- package/DataGrid/DataGrid.js +7 -0
- package/DataGrid/DataGrid.mjs +7 -0
- package/colDef/gridNumericOperators.d.mts +1 -1
- package/colDef/gridNumericOperators.d.ts +1 -1
- package/components/GridColumnSortButton.d.mts +1 -1
- package/components/GridColumnSortButton.d.ts +1 -1
- package/components/GridColumnUnsortedIcon.d.mts +2 -1
- package/components/GridColumnUnsortedIcon.d.ts +2 -1
- package/components/GridHeader.d.mts +2 -1
- package/components/GridHeader.d.ts +2 -1
- package/components/GridHeaders.d.mts +1 -1
- package/components/GridHeaders.d.ts +1 -1
- package/components/GridPagination.d.mts +2 -1
- package/components/GridPagination.d.ts +2 -1
- package/components/GridRowDragAndDropOverlay.d.mts +1 -1
- package/components/GridRowDragAndDropOverlay.d.ts +1 -1
- package/components/GridScrollArea.d.mts +2 -1
- package/components/GridScrollArea.d.ts +2 -1
- package/components/GridScrollShadows.d.mts +2 -1
- package/components/GridScrollShadows.d.ts +2 -1
- package/components/GridScrollbarFillerCell.d.mts +1 -1
- package/components/GridScrollbarFillerCell.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.d.mts +1 -1
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.d.mts +1 -1
- package/components/base/GridFooterPlaceholder.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.js +1 -1
- package/components/base/GridFooterPlaceholder.mjs +1 -1
- package/components/base/GridOverlays.d.mts +1 -1
- package/components/base/GridOverlays.d.ts +1 -1
- package/components/cell/GridActionsCell.d.mts +2 -2
- package/components/cell/GridActionsCell.d.ts +2 -2
- package/components/cell/GridActionsCellItem.d.mts +10 -10
- package/components/cell/GridActionsCellItem.d.ts +10 -10
- package/components/cell/GridActionsCellItem.js +1 -58
- package/components/cell/GridActionsCellItem.mjs +1 -58
- package/components/cell/GridBooleanCell.d.mts +1 -4
- package/components/cell/GridBooleanCell.d.ts +1 -4
- package/components/cell/GridEditBooleanCell.d.mts +2 -2
- package/components/cell/GridEditBooleanCell.d.ts +2 -2
- package/components/cell/GridEditDateCell.d.mts +2 -2
- package/components/cell/GridEditDateCell.d.ts +2 -2
- package/components/cell/GridEditInputCell.d.mts +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditLongTextCell.d.mts +2 -2
- package/components/cell/GridEditLongTextCell.d.ts +2 -2
- package/components/cell/GridEditSingleSelectCell.d.mts +3 -2
- package/components/cell/GridEditSingleSelectCell.d.ts +3 -2
- package/components/cell/GridFooterCell.d.mts +1 -1
- package/components/cell/GridFooterCell.d.ts +1 -1
- package/components/cell/GridLongTextCell.d.mts +2 -2
- package/components/cell/GridLongTextCell.d.ts +2 -2
- package/components/cell/GridSkeletonCell.d.mts +1 -4
- package/components/cell/GridSkeletonCell.d.ts +1 -4
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.mts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.mts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.d.mts +1 -4
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +1 -4
- package/components/columnHeaders/GridColumnHeaderSeparator.d.mts +1 -4
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -4
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.mts +1 -4
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -4
- package/components/columnHeaders/GridColumnHeaderTitle.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
- package/components/columnsManagement/GridColumnsManagement.d.mts +2 -1
- package/components/columnsManagement/GridColumnsManagement.d.ts +2 -1
- package/components/menu/GridMenu.d.mts +1 -1
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.mts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -1
- package/components/panel/GridColumnsPanel.d.mts +1 -1
- package/components/panel/GridColumnsPanel.d.ts +1 -1
- package/components/panel/GridPanelContent.d.mts +1 -1
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContext.d.mts +1 -1
- package/components/panel/GridPanelContext.d.ts +1 -1
- package/components/panel/GridPanelFooter.d.mts +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelHeader.d.mts +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.d.mts +1 -1
- package/components/panel/GridPreferencesPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.d.mts +1 -98
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -98
- package/components/panel/filterPanel/GridFilterForm.js +9 -355
- package/components/panel/filterPanel/GridFilterForm.mjs +8 -354
- package/components/panel/filterPanel/GridFilterFormBase.d.mts +119 -0
- package/components/panel/filterPanel/GridFilterFormBase.d.ts +119 -0
- package/components/panel/filterPanel/GridFilterFormBase.js +497 -0
- package/components/panel/filterPanel/GridFilterFormBase.mjs +491 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputDate.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +21 -9
- package/components/panel/filterPanel/GridFilterInputDate.mjs +21 -9
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputValue.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +19 -8
- package/components/panel/filterPanel/GridFilterInputValue.mjs +19 -8
- package/components/panel/filterPanel/GridFilterPanel.d.mts +3 -40
- package/components/panel/filterPanel/GridFilterPanel.d.ts +3 -40
- package/components/panel/filterPanel/GridFilterPanel.js +19 -174
- package/components/panel/filterPanel/GridFilterPanel.mjs +14 -173
- package/components/panel/filterPanel/GridFilterPanelBase.d.mts +79 -0
- package/components/panel/filterPanel/GridFilterPanelBase.d.ts +79 -0
- package/components/panel/filterPanel/GridFilterPanelBase.js +304 -0
- package/components/panel/filterPanel/GridFilterPanelBase.mjs +297 -0
- package/components/panel/filterPanel/index.d.mts +3 -1
- package/components/panel/filterPanel/index.d.ts +3 -1
- package/components/panel/filterPanel/index.js +9 -1
- package/components/panel/filterPanel/index.mjs +3 -0
- package/components/quickFilter/QuickFilter.d.mts +1 -1
- package/components/quickFilter/QuickFilter.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.d.mts +2 -2
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarQuickFilter.d.mts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.d.ts +1 -1
- package/components/toolbarV8/GridToolbar.d.mts +3 -3
- package/components/toolbarV8/GridToolbar.d.ts +3 -3
- package/components/toolbarV8/utils.d.mts +1 -1
- package/components/toolbarV8/utils.d.ts +1 -1
- package/components/virtualization/GridBottomContainer.d.mts +1 -1
- package/components/virtualization/GridBottomContainer.d.ts +1 -1
- package/components/virtualization/GridTopContainer.d.mts +1 -1
- package/components/virtualization/GridTopContainer.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.d.mts +1 -1
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerFiller.d.mts +2 -1
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +2 -1
- package/constants/cssVariables.d.mts +120 -120
- package/constants/cssVariables.d.ts +120 -120
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/constants/dataGridPropsDefaultValues.mjs +1 -0
- package/context/GridContextProvider.d.mts +1 -1
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/useGridLocaleText.d.mts +1 -1
- package/hooks/core/useGridLocaleText.d.ts +1 -1
- package/hooks/core/useGridLoggerFactory.d.mts +1 -1
- package/hooks/core/useGridLoggerFactory.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.mts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.mts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.mts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +4 -4
- package/hooks/features/columnResize/useGridColumnResize.d.mts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.mts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.d.mts +2 -2
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +2 -2
- package/hooks/features/dataSource/useGridDataSourceBase.js +39 -10
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +39 -10
- package/hooks/features/density/useGridDensity.d.mts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.d.mts +1 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridEditing.d.mts +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.mts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
- package/hooks/features/editing/utils.d.mts +1 -1
- package/hooks/features/editing/utils.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.d.mts +1 -1
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.d.mts +1 -1
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/filter/gridFilterUtils.d.mts +13 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +13 -1
- package/hooks/features/filter/gridFilterUtils.js +56 -1
- package/hooks/features/filter/gridFilterUtils.mjs +52 -0
- package/hooks/features/filter/useGridFilter.d.mts +1 -1
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +4 -35
- package/hooks/features/filter/useGridFilter.mjs +5 -36
- package/hooks/features/focus/useGridFocus.d.mts +1 -1
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.mts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.mts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/overlays/useGridOverlays.d.mts +1 -1
- package/hooks/features/overlays/useGridOverlays.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationUtils.d.mts +1 -1
- package/hooks/features/pagination/gridPaginationUtils.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationMeta.d.mts +1 -1
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.mts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridRowCount.d.mts +1 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.mts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.mts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.d.mts +4 -4
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/useGridRowSpanning.d.mts +1 -1
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRows.d.mts +1 -1
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRowsMeta.d.mts +1 -1
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.d.mts +1 -1
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.d.mts +1 -1
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.mts +2 -2
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +2 -2
- package/hooks/utils/useGridEvent.d.mts +1 -1
- package/hooks/utils/useGridEvent.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.mts +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/demo/TailwindDemoContainer.d.mts +1 -1
- package/internals/demo/TailwindDemoContainer.d.ts +1 -1
- package/models/api/gridApiCommon.d.mts +1 -1
- package/models/api/gridApiCommon.d.ts +1 -1
- package/models/gridFilterInputComponent.d.mts +5 -0
- package/models/gridFilterInputComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.mts +1 -1
- package/models/gridSlotsComponentsProps.d.ts +1 -1
- package/models/props/DataGridProps.d.mts +7 -0
- package/models/props/DataGridProps.d.ts +7 -0
- package/package.json +5 -5
- package/utils/cellBorderUtils.d.mts +2 -2
- package/utils/cellBorderUtils.d.ts +2 -2
- package/utils/css/context.d.mts +3 -3
- package/utils/css/context.d.ts +3 -3
- package/utils/getPublicApiRef.d.mts +1 -1
- package/utils/getPublicApiRef.d.ts +1 -1
- package/utils/keyboardUtils.d.mts +1 -1
- package/utils/keyboardUtils.d.ts +1 -1
- package/utils/rtlFlipSide.d.mts +1 -1
- package/utils/rtlFlipSide.d.ts +1 -1
|
@@ -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(
|
|
59
|
-
|
|
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,
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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(
|
|
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,
|
|
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(
|
|
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,
|
|
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 {
|
|
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
|
|
11
|
+
export { GridFilterPanel };
|
|
12
|
+
export { getGridFilter } from "./GridFilterPanelBase.mjs";
|
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
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
|
|
11
|
+
export { GridFilterPanel };
|
|
12
|
+
export { getGridFilter } from "./GridFilterPanelBase.js";
|