@mui/x-data-grid 8.0.0-alpha.8 → 8.0.0-alpha.9
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 +436 -3
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/components/GridApiContext.js +2 -0
- package/components/GridConfigurationContext.js +2 -0
- package/components/GridRow.js +2 -0
- package/components/GridScrollArea.js +2 -0
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/components/panel/GridPanel.js +2 -1
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/context/GridContextProvider.d.ts +2 -1
- package/context/GridRootPropsContext.js +2 -0
- package/hooks/core/pipeProcessing/useGridPipeProcessing.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.d.ts +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.d.ts +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.d.ts +2 -2
- package/hooks/core/useGridApiInitialization.d.ts +2 -2
- package/hooks/core/useGridInitialization.d.ts +2 -2
- package/hooks/core/useGridIsRtl.d.ts +2 -2
- package/hooks/core/useGridLocaleText.d.ts +2 -2
- package/hooks/core/useGridLoggerFactory.d.ts +2 -2
- package/hooks/core/useGridRefs.d.ts +2 -2
- package/hooks/core/useGridStateInitialization.d.ts +2 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -2
- package/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/hooks/features/columnResize/useGridColumnResize.d.ts +2 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +4 -4
- package/hooks/features/columns/useGridColumnSpanning.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/hooks/features/editing/useGridCellEditing.d.ts +2 -2
- package/hooks/features/editing/useGridEditing.d.ts +2 -2
- package/hooks/features/editing/useGridRowEditing.d.ts +2 -2
- package/hooks/features/events/useGridEvents.d.ts +2 -2
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.d.ts +2 -2
- package/hooks/features/export/useGridPrintExport.d.ts +2 -2
- package/hooks/features/export/utils.d.ts +2 -2
- package/hooks/features/filter/gridFilterUtils.d.ts +7 -7
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +2 -2
- package/hooks/features/focus/useGridFocus.d.ts +2 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/utils.d.ts +3 -3
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +2 -2
- package/hooks/features/pagination/useGridPaginationModel.d.ts +2 -2
- package/hooks/features/pagination/useGridRowCount.d.ts +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +1 -0
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/hooks/features/preferencesPanel/index.d.ts +1 -1
- package/hooks/features/preferencesPanel/index.js +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +2 -2
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +2 -2
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.d.ts +2 -2
- package/hooks/features/rowSelection/utils.d.ts +3 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +2 -2
- package/hooks/features/rows/gridRowsUtils.d.ts +4 -4
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -2
- package/hooks/features/rows/useGridRowSpanning.d.ts +2 -2
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +2 -2
- package/hooks/features/rows/useGridRowsPreProcessors.d.ts +2 -2
- package/hooks/features/scroll/useGridScroll.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.d.ts +3 -3
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +2 -2
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +1 -8
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridApiContext.d.ts +2 -2
- package/hooks/utils/useGridApiEventHandler.d.ts +4 -4
- package/hooks/utils/useGridApiMethod.d.ts +2 -2
- package/hooks/utils/useGridApiRef.d.ts +2 -2
- package/hooks/utils/useGridApiRef.js +3 -1
- package/hooks/utils/useGridInitializeState.d.ts +3 -3
- package/hooks/utils/useGridLogger.d.ts +2 -2
- package/hooks/utils/useGridNativeEventListener.d.ts +2 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +2 -1
- package/hooks/utils/useGridSelector.d.ts +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +3 -3
- package/index.js +1 -1
- package/locales/faIR.js +5 -6
- package/locales/urPK.js +9 -10
- package/models/colDef/gridColDef.d.ts +9 -8
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterOperator.d.ts +2 -1
- package/models/props/DataGridProps.d.ts +2 -1
- package/modern/components/GridApiContext.js +2 -0
- package/modern/components/GridConfigurationContext.js +2 -0
- package/modern/components/GridRow.js +2 -0
- package/modern/components/GridScrollArea.js +2 -0
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- package/modern/components/panel/GridPanel.js +2 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/modern/context/GridRootPropsContext.js +2 -0
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +8 -1
- package/modern/hooks/features/preferencesPanel/index.js +1 -1
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +1 -8
- package/modern/hooks/utils/useGridApiRef.js +3 -1
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +5 -6
- package/modern/locales/urPK.js +9 -10
- package/modern/utils/isJSDOM.js +1 -0
- package/node/components/GridApiContext.js +1 -0
- package/node/components/GridConfigurationContext.js +1 -0
- package/node/components/GridRow.js +1 -0
- package/node/components/GridScrollArea.js +1 -0
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +19 -5
- package/node/components/panel/GridPanel.js +2 -1
- package/node/components/toolbar/GridToolbarColumnsButton.js +6 -1
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -1
- package/node/context/GridRootPropsContext.js +1 -0
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +0 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +9 -2
- package/node/hooks/features/preferencesPanel/index.js +11 -10
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +14 -38
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -10
- package/node/hooks/utils/useGridApiRef.js +3 -1
- package/node/index.js +1 -1
- package/node/locales/faIR.js +5 -6
- package/node/locales/urPK.js +9 -10
- package/node/utils/isJSDOM.js +7 -0
- package/package.json +2 -2
- package/utils/createSelector.d.ts +2 -2
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
|
@@ -54,7 +54,12 @@ const GridToolbarColumnsButton = exports.GridToolbarColumnsButton = (0, _forward
|
|
|
54
54
|
"aria-expanded": isOpen,
|
|
55
55
|
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
56
56
|
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnSelectorIcon, {}),
|
|
57
|
-
onClick: showColumns
|
|
57
|
+
onClick: showColumns,
|
|
58
|
+
onPointerUp: event => {
|
|
59
|
+
if (preferencePanel.open) {
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
58
63
|
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
59
64
|
ref: ref,
|
|
60
65
|
children: apiRef.current.getLocaleText('toolbarColumns')
|
|
@@ -121,7 +121,12 @@ const GridToolbarFilterButton = exports.GridToolbarFilterButton = (0, _forwardRe
|
|
|
121
121
|
}, rootProps.slotProps?.baseBadge, badgeProps, {
|
|
122
122
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.openFilterButtonIcon, {})
|
|
123
123
|
})),
|
|
124
|
-
onClick: toggleFilter
|
|
124
|
+
onClick: toggleFilter,
|
|
125
|
+
onPointerUp: event => {
|
|
126
|
+
if (preferencePanel.open) {
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
125
130
|
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
126
131
|
ref: ref,
|
|
127
132
|
children: apiRef.current.getLocaleText('toolbarFilters')
|
|
@@ -49,7 +49,6 @@ const useGridColumnMenu = apiRef => {
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
apiRef.current.hidePreferences();
|
|
52
|
-
apiRef.current.forceUpdate();
|
|
53
52
|
}
|
|
54
53
|
}, [apiRef, logger]);
|
|
55
54
|
const hideColumnMenu = React.useCallback(() => {
|
|
@@ -91,7 +90,6 @@ const useGridColumnMenu = apiRef => {
|
|
|
91
90
|
columnMenu: newState
|
|
92
91
|
});
|
|
93
92
|
});
|
|
94
|
-
apiRef.current.forceUpdate();
|
|
95
93
|
}
|
|
96
94
|
}, [apiRef, logger]);
|
|
97
95
|
const toggleColumnMenu = React.useCallback(field => {
|
|
@@ -24,6 +24,7 @@ var _gridRowsMetaSelector = require("../rows/gridRowsMetaSelector");
|
|
|
24
24
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
25
25
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
26
26
|
var _dataGridPropsDefaultValues = require("../../../constants/dataGridPropsDefaultValues");
|
|
27
|
+
var _isJSDOM = require("../../../utils/isJSDOM");
|
|
27
28
|
const EMPTY_SIZE = {
|
|
28
29
|
width: 0,
|
|
29
30
|
height: 0
|
|
@@ -230,14 +231,11 @@ function useGridDimensions(apiRef, props) {
|
|
|
230
231
|
const isFirstSizing = React.useRef(true);
|
|
231
232
|
const handleResize = React.useCallback(size => {
|
|
232
233
|
rootDimensionsRef.current = size;
|
|
233
|
-
|
|
234
|
-
// jsdom has no layout capabilities
|
|
235
|
-
const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
236
|
-
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
234
|
+
if (size.height === 0 && !errorShown.current && !props.autoHeight && !_isJSDOM.isJSDOM) {
|
|
237
235
|
logger.error(['The parent DOM element of the Data Grid has an empty height.', 'Please make sure that this element has an intrinsic height.', 'The grid displays with a height of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
238
236
|
errorShown.current = true;
|
|
239
237
|
}
|
|
240
|
-
if (size.width === 0 && !errorShown.current && !isJSDOM) {
|
|
238
|
+
if (size.width === 0 && !errorShown.current && !_isJSDOM.isJSDOM) {
|
|
241
239
|
logger.error(['The parent DOM element of the Data Grid has an empty width.', 'Please make sure that this element has an intrinsic width.', 'The grid displays with a width of 0px.', '', 'More details: https://mui.com/r/x-data-grid-no-dimensions.'].join('\n'));
|
|
242
240
|
errorShown.current = true;
|
|
243
241
|
}
|
|
@@ -26,7 +26,7 @@ function getHasEval() {
|
|
|
26
26
|
/**
|
|
27
27
|
* Adds default values to the optional fields of a filter items.
|
|
28
28
|
* @param {GridFilterItem} item The raw filter item.
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
30
30
|
* @return {GridFilterItem} The clean filter item with an uniq ID and an always-defined operator.
|
|
31
31
|
* TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.
|
|
32
32
|
*/
|
|
@@ -144,7 +144,7 @@ let filterItemsApplierId = 1;
|
|
|
144
144
|
/**
|
|
145
145
|
* Generates a method to easily check if a row is matching the current filter model.
|
|
146
146
|
* @param {GridFilterModel} filterModel The model with which we want to filter the rows.
|
|
147
|
-
* @param {
|
|
147
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
148
148
|
* @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.
|
|
149
149
|
*/
|
|
150
150
|
const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) => {
|
|
@@ -192,7 +192,7 @@ const shouldQuickFilterExcludeHiddenColumns = filterModel => {
|
|
|
192
192
|
/**
|
|
193
193
|
* Generates a method to easily check if a row is matching the current quick filter.
|
|
194
194
|
* @param {any[]} filterModel The model with which we want to filter the rows.
|
|
195
|
-
* @param {
|
|
195
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
196
196
|
* @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.
|
|
197
197
|
*/
|
|
198
198
|
exports.shouldQuickFilterExcludeHiddenColumns = shouldQuickFilterExcludeHiddenColumns;
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.gridPreferencePanelStateSelector = void 0;
|
|
6
|
+
exports.gridPreferencePanelStateSelector = exports.gridPreferencePanelSelectorWithLabel = void 0;
|
|
7
|
+
var _createSelector = require("../../../utils/createSelector");
|
|
7
8
|
const gridPreferencePanelStateSelector = state => state.preferencePanel;
|
|
8
|
-
exports.gridPreferencePanelStateSelector = gridPreferencePanelStateSelector;
|
|
9
|
+
exports.gridPreferencePanelStateSelector = gridPreferencePanelStateSelector;
|
|
10
|
+
const gridPreferencePanelSelectorWithLabel = exports.gridPreferencePanelSelectorWithLabel = (0, _createSelector.createSelector)(gridPreferencePanelStateSelector, (panel, labelId) => {
|
|
11
|
+
if (panel.open && panel.labelId === labelId) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
});
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
gridPreferencePanelStateSelector: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "gridPreferencePanelStateSelector", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _gridPreferencePanelSelector.gridPreferencePanelStateSelector;
|
|
13
|
+
}
|
|
16
14
|
});
|
|
15
|
+
var _gridPreferencePanelSelector = require("./gridPreferencePanelSelector");
|
|
17
16
|
var _gridPreferencePanelState = require("./gridPreferencePanelState");
|
|
18
17
|
Object.keys(_gridPreferencePanelState).forEach(function (key) {
|
|
19
18
|
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
20
|
if (key in exports && exports[key] === _gridPreferencePanelState[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
@@ -28,6 +28,7 @@ Object.keys(_gridPreferencePanelState).forEach(function (key) {
|
|
|
28
28
|
var _gridPreferencePanelsValue = require("./gridPreferencePanelsValue");
|
|
29
29
|
Object.keys(_gridPreferencePanelsValue).forEach(function (key) {
|
|
30
30
|
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
32
|
if (key in exports && exports[key] === _gridPreferencePanelsValue[key]) return;
|
|
32
33
|
Object.defineProperty(exports, key, {
|
|
33
34
|
enumerable: true,
|
|
@@ -24,42 +24,29 @@ const preferencePanelStateInitializer = (state, props) => (0, _extends2.default)
|
|
|
24
24
|
exports.preferencePanelStateInitializer = preferencePanelStateInitializer;
|
|
25
25
|
const useGridPreferencesPanel = (apiRef, props) => {
|
|
26
26
|
const logger = (0, _useGridLogger.useGridLogger)(apiRef, 'useGridPreferencesPanel');
|
|
27
|
-
const hideTimeout = React.useRef(undefined);
|
|
28
|
-
const immediateTimeout = React.useRef(undefined);
|
|
29
27
|
|
|
30
28
|
/**
|
|
31
29
|
* API METHODS
|
|
32
30
|
*/
|
|
33
31
|
const hidePreferences = React.useCallback(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
apiRef.current.setState(state => {
|
|
33
|
+
if (!state.preferencePanel.open) {
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
logger.debug('Hiding Preferences Panel');
|
|
37
|
+
const preferencePanelState = (0, _gridPreferencePanelSelector.gridPreferencePanelStateSelector)(state);
|
|
37
38
|
apiRef.current.publishEvent('preferencePanelClose', {
|
|
38
39
|
openedPanelValue: preferencePanelState.openedPanelValue
|
|
39
40
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
apiRef.current.forceUpdate();
|
|
41
|
+
return (0, _extends2.default)({}, state, {
|
|
42
|
+
preferencePanel: {
|
|
43
|
+
open: false
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
47
|
}, [apiRef, logger]);
|
|
48
|
-
|
|
49
|
-
// This is to prevent the preferences from closing when you open a select box or another panel,
|
|
50
|
-
// The issue is in MUI core V4 => Fixed in V5
|
|
51
|
-
const doNotHidePanel = React.useCallback(() => {
|
|
52
|
-
immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
// This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,
|
|
56
|
-
// we can cancel the action if the trigger element still need the panel...
|
|
57
|
-
const hidePreferencesDelayed = React.useCallback(() => {
|
|
58
|
-
hideTimeout.current = setTimeout(hidePreferences, 100);
|
|
59
|
-
}, [hidePreferences]);
|
|
60
48
|
const showPreferences = React.useCallback((newValue, panelId, labelId) => {
|
|
61
49
|
logger.debug('Opening Preferences Panel');
|
|
62
|
-
doNotHidePanel();
|
|
63
50
|
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
64
51
|
preferencePanel: (0, _extends2.default)({}, state.preferencePanel, {
|
|
65
52
|
open: true,
|
|
@@ -71,11 +58,10 @@ const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
71
58
|
apiRef.current.publishEvent('preferencePanelOpen', {
|
|
72
59
|
openedPanelValue: newValue
|
|
73
60
|
});
|
|
74
|
-
|
|
75
|
-
}, [logger, doNotHidePanel, apiRef]);
|
|
61
|
+
}, [logger, apiRef]);
|
|
76
62
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, {
|
|
77
63
|
showPreferences,
|
|
78
|
-
hidePreferences
|
|
64
|
+
hidePreferences
|
|
79
65
|
}, 'public');
|
|
80
66
|
|
|
81
67
|
/**
|
|
@@ -108,15 +94,5 @@ const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
108
94
|
}, [apiRef]);
|
|
109
95
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'exportState', stateExportPreProcessing);
|
|
110
96
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* EFFECTS
|
|
114
|
-
*/
|
|
115
|
-
React.useEffect(() => {
|
|
116
|
-
return () => {
|
|
117
|
-
clearTimeout(hideTimeout.current);
|
|
118
|
-
clearTimeout(immediateTimeout.current);
|
|
119
|
-
};
|
|
120
|
-
}, []);
|
|
121
97
|
};
|
|
122
98
|
exports.useGridPreferencesPanel = useGridPreferencesPanel;
|
|
@@ -28,7 +28,7 @@ const isDesc = direction => direction === 'desc';
|
|
|
28
28
|
/**
|
|
29
29
|
* Transform an item of the sorting model into a method comparing two rows.
|
|
30
30
|
* @param {GridSortItem} sortItem The sort item we want to apply.
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
32
32
|
* @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
|
|
33
33
|
*/
|
|
34
34
|
const parseSortItem = (sortItem, apiRef) => {
|
|
@@ -81,7 +81,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
|
|
|
81
81
|
/**
|
|
82
82
|
* Generates a method to easily sort a list of rows according to the current sort model.
|
|
83
83
|
* @param {GridSortModel} sortModel The model with which we want to sort the rows.
|
|
84
|
-
* @param {
|
|
84
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
85
85
|
* @returns {GridSortingModelApplier | null} A method that generates a list of sorted row ids from a list of rows according to the current sort model. If `null`, we consider that the rows should remain in the order there were provided.
|
|
86
86
|
*/
|
|
87
87
|
const buildAggregatedSortingApplier = (sortModel, apiRef) => {
|
|
@@ -37,6 +37,7 @@ var _gridRowSpanningSelectors = require("../rows/gridRowSpanningSelectors");
|
|
|
37
37
|
var _gridListViewSelectors = require("../listView/gridListViewSelectors");
|
|
38
38
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
39
39
|
var _gridFocusedVirtualCellSelector = require("./gridFocusedVirtualCellSelector");
|
|
40
|
+
var _isJSDOM = require("../../../utils/isJSDOM");
|
|
40
41
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
42
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
42
43
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -56,14 +57,6 @@ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, h
|
|
|
56
57
|
direction: ScrollDirection.NONE,
|
|
57
58
|
buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
58
59
|
});
|
|
59
|
-
let isJSDOM = false;
|
|
60
|
-
try {
|
|
61
|
-
if (typeof window !== 'undefined') {
|
|
62
|
-
isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
63
|
-
}
|
|
64
|
-
} catch (_) {
|
|
65
|
-
/* ignore */
|
|
66
|
-
}
|
|
67
60
|
const useGridVirtualScroller = () => {
|
|
68
61
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
69
62
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -71,8 +64,8 @@ const useGridVirtualScroller = () => {
|
|
|
71
64
|
unstable_listView: listView
|
|
72
65
|
} = rootProps;
|
|
73
66
|
const visibleColumns = (0, _useGridSelector.useGridSelector)(apiRef, () => listView ? [(0, _gridListViewSelectors.gridListColumnSelector)(apiRef.current.state)] : (0, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector)(apiRef));
|
|
74
|
-
const enabledForRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationRowEnabledSelector) && !isJSDOM;
|
|
75
|
-
const enabledForColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationColumnEnabledSelector) && !isJSDOM;
|
|
67
|
+
const enabledForRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationRowEnabledSelector) && !_isJSDOM.isJSDOM;
|
|
68
|
+
const enabledForColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridVirtualizationColumnEnabledSelector) && !_isJSDOM.isJSDOM;
|
|
76
69
|
const dimensions = (0, _useGridSelector.useGridSelector)(apiRef, _gridDimensionsSelectors.gridDimensionsSelector);
|
|
77
70
|
const outerSize = dimensions.viewportOuterSize;
|
|
78
71
|
const pinnedRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridPinnedRowsSelector);
|
|
@@ -9,5 +9,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
/**
|
|
10
10
|
* Hook that instantiate a [[GridApiRef]].
|
|
11
11
|
*/
|
|
12
|
-
const useGridApiRef = () =>
|
|
12
|
+
const useGridApiRef = () =>
|
|
13
|
+
// TODO v8: initialize with null (see https://github.com/mui/mui-x/issues/16135#issuecomment-2589395230 and https://github.com/mui/mui-x/issues/16000#issuecomment-2567820735)
|
|
14
|
+
React.useRef({});
|
|
13
15
|
exports.useGridApiRef = useGridApiRef;
|
package/node/index.js
CHANGED
package/node/locales/faIR.js
CHANGED
|
@@ -51,8 +51,7 @@ const faIRGrid = {
|
|
|
51
51
|
columnsManagementNoColumns: 'بدون سطر',
|
|
52
52
|
columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
|
|
53
53
|
columnsManagementReset: 'بازنشانی',
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
columnsManagementDeleteIconLabel: 'پاک کردن',
|
|
56
55
|
// Filter panel text
|
|
57
56
|
filterPanelAddFilter: 'افزودن فیلتر',
|
|
58
57
|
filterPanelRemoveAll: 'حذف همه',
|
|
@@ -66,9 +65,9 @@ const faIRGrid = {
|
|
|
66
65
|
filterPanelInputPlaceholder: 'فیلتر مقدار',
|
|
67
66
|
// Filter operators text
|
|
68
67
|
filterOperatorContains: 'شامل',
|
|
69
|
-
|
|
68
|
+
filterOperatorDoesNotContain: 'شامل نمیشود',
|
|
70
69
|
filterOperatorEquals: 'مساوی',
|
|
71
|
-
|
|
70
|
+
filterOperatorDoesNotEqual: 'برابر نیست',
|
|
72
71
|
filterOperatorStartsWith: 'شروع با',
|
|
73
72
|
filterOperatorEndsWith: 'پایان با',
|
|
74
73
|
filterOperatorIs: 'هست',
|
|
@@ -88,9 +87,9 @@ const faIRGrid = {
|
|
|
88
87
|
'filterOperator<=': '<=',
|
|
89
88
|
// Header filter operators text
|
|
90
89
|
headerFilterOperatorContains: 'شامل',
|
|
91
|
-
|
|
90
|
+
headerFilterOperatorDoesNotContain: 'شامل نمیشود',
|
|
92
91
|
headerFilterOperatorEquals: 'مساوی',
|
|
93
|
-
|
|
92
|
+
headerFilterOperatorDoesNotEqual: 'برابر نیست',
|
|
94
93
|
headerFilterOperatorStartsWith: 'شروع با',
|
|
95
94
|
headerFilterOperatorEndsWith: 'پایان با',
|
|
96
95
|
headerFilterOperatorIs: 'هست',
|
package/node/locales/urPK.js
CHANGED
|
@@ -47,12 +47,11 @@ const urPKGrid = {
|
|
|
47
47
|
toolbarExportPrint: 'پرنٹ کریں',
|
|
48
48
|
toolbarExportExcel: 'ایکسل کے طور پر ڈاوٴنلوڈ کریں',
|
|
49
49
|
// Columns management text
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
columnsManagementSearchTitle: 'تلاش',
|
|
51
|
+
columnsManagementNoColumns: 'کوئی کالم نہیں',
|
|
52
|
+
columnsManagementShowHideAllText: 'تمام دکھائیں/چھپائیں',
|
|
53
|
+
columnsManagementReset: 'ریسیٹ',
|
|
54
|
+
columnsManagementDeleteIconLabel: 'کلئیر',
|
|
56
55
|
// Filter panel text
|
|
57
56
|
filterPanelAddFilter: 'نیا فلٹر',
|
|
58
57
|
filterPanelRemoveAll: 'سارے ختم کریں',
|
|
@@ -66,9 +65,9 @@ const urPKGrid = {
|
|
|
66
65
|
filterPanelInputPlaceholder: 'ویلیو کو فلٹر کریں',
|
|
67
66
|
// Filter operators text
|
|
68
67
|
filterOperatorContains: 'شامل ہے',
|
|
69
|
-
|
|
68
|
+
filterOperatorDoesNotContain: 'موجود نہیں ہے',
|
|
70
69
|
filterOperatorEquals: 'برابر ہے',
|
|
71
|
-
|
|
70
|
+
filterOperatorDoesNotEqual: 'برابر نہیں ہے',
|
|
72
71
|
filterOperatorStartsWith: 'شروع ہوتا ہے',
|
|
73
72
|
filterOperatorEndsWith: 'ختم ہوتا ہے',
|
|
74
73
|
filterOperatorIs: 'ہے',
|
|
@@ -88,9 +87,9 @@ const urPKGrid = {
|
|
|
88
87
|
'filterOperator<=': '<=',
|
|
89
88
|
// Header filter operators text
|
|
90
89
|
headerFilterOperatorContains: 'شامل ہے',
|
|
91
|
-
|
|
90
|
+
headerFilterOperatorDoesNotContain: 'موجود نہیں ہے',
|
|
92
91
|
headerFilterOperatorEquals: 'برابر ہے',
|
|
93
|
-
|
|
92
|
+
headerFilterOperatorDoesNotEqual: 'برابر نہیں ہے',
|
|
94
93
|
headerFilterOperatorStartsWith: 'شروع ہوتا ہے',
|
|
95
94
|
headerFilterOperatorEndsWith: 'ختم ہوتا ہے',
|
|
96
95
|
headerFilterOperatorIs: 'ہے',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.9",
|
|
4
4
|
"description": "The Community plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^5.1.1",
|
|
45
|
-
"@mui/x-internals": "8.0.0-alpha.
|
|
45
|
+
"@mui/x-internals": "8.0.0-alpha.9"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { Selector, SelectorResultArray } from 'reselect';
|
|
3
3
|
import type { GridCoreApi } from '../models/api/gridCoreApi';
|
|
4
4
|
export interface OutputSelector<State, Args, Result> {
|
|
5
|
-
(apiRef:
|
|
5
|
+
(apiRef: RefObject<{
|
|
6
6
|
state: State;
|
|
7
7
|
instanceId: GridCoreApi['instanceId'];
|
|
8
8
|
}>, args?: Args): Result;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
1
2
|
import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
2
|
-
export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef:
|
|
3
|
+
export declare function getPublicApiRef<PrivateApi extends GridPrivateApiCommunity>(apiRef: RefObject<PrivateApi>): RefObject<ReturnType<PrivateApi["getPublicApi"]>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isJSDOM: boolean;
|
package/utils/isJSDOM.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isJSDOM = typeof window !== 'undefined' && /jsdom|HappyDOM/.test(window.navigator.userAgent);
|