@mui/x-data-grid 7.24.0 → 7.24.1
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 +71 -0
- package/DataGrid/useDataGridComponent.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +3 -3
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- 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/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 +3 -3
- package/hooks/utils/useGridVisibleRows.d.ts +3 -3
- package/index.js +1 -1
- package/locales/faIR.js +5 -6
- 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/columnHeaders/GridColumnHeaderFilterIconButton.js +21 -7
- 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/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/utils/isJSDOM.js +1 -0
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +20 -6
- 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/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/utils/isJSDOM.js +7 -0
- package/package.json +2 -2
- package/utils/createSelector.d.ts +3 -3
- package/utils/getPublicApiRef.d.ts +2 -1
- package/utils/isJSDOM.d.ts +1 -0
- package/utils/isJSDOM.js +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
type GetPublicApiType<PrivateApi> = PrivateApi extends {
|
|
4
4
|
getPublicApi: () => infer PublicApi;
|
|
5
5
|
} ? PublicApi : never;
|
|
6
|
-
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef:
|
|
6
|
+
export declare function useGridApiMethod<PrivateApi extends GridPrivateApiCommon, PublicApi extends GetPublicApiType<PrivateApi>, PrivateOnlyApi extends Omit<PrivateApi, keyof PublicApi>, V extends 'public' | 'private', T extends V extends 'public' ? Partial<PublicApi> : Partial<PrivateOnlyApi>>(privateApiRef: RefObject<PrivateApi>, apiMethods: T, visibility: V): void;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridApiCommon } from '../../models';
|
|
3
3
|
import { GridApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
4
|
/**
|
|
5
5
|
* Hook that instantiate a [[GridApiRef]].
|
|
6
6
|
*/
|
|
7
|
-
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() =>
|
|
7
|
+
export declare const useGridApiRef: <Api extends GridApiCommon = GridApiCommunity>() => RefObject<Api>;
|
|
@@ -2,4 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook that instantiate a [[GridApiRef]].
|
|
4
4
|
*/
|
|
5
|
-
export const useGridApiRef = () =>
|
|
5
|
+
export const useGridApiRef = () =>
|
|
6
|
+
// 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)
|
|
7
|
+
React.useRef({});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
3
|
import { GridPrivateApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
4
|
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
5
5
|
type DeepPartial<T> = {
|
|
6
6
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
7
7
|
};
|
|
8
|
-
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef:
|
|
9
|
-
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef:
|
|
8
|
+
export type GridStateInitializer<P extends Partial<DataGridProcessedProps> = DataGridProcessedProps, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity> = (state: DeepPartial<PrivateApi['state']>, props: P, privateApiRef: RefObject<PrivateApi>) => DeepPartial<PrivateApi['state']>;
|
|
9
|
+
export declare const useGridInitializeState: <P extends Partial<DataGridProcessedProps>, PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(initializer: GridStateInitializer<P, PrivateApi>, privateApiRef: RefObject<PrivateApi>, props: P) => void;
|
|
10
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { Logger } from '../../models/logger';
|
|
3
3
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
4
|
-
export declare function useGridLogger<PrivateApi extends GridPrivateApiCommon>(privateApiRef:
|
|
4
|
+
export declare function useGridLogger<PrivateApi extends GridPrivateApiCommon>(privateApiRef: RefObject<PrivateApi>, name: string): Logger;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
|
-
export declare const useGridNativeEventListener: <PrivateApi extends GridPrivateApiCommon, K extends keyof HTMLElementEventMap>(apiRef:
|
|
4
|
+
export declare const useGridNativeEventListener: <PrivateApi extends GridPrivateApiCommon, K extends keyof HTMLElementEventMap>(apiRef: RefObject<PrivateApi>, ref: React.RefObject<HTMLDivElement | null> | (() => HTMLElement | undefined | null), eventName: K, handler?: (event: HTMLElementEventMap[K]) => any, options?: AddEventListenerOptions) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
3
4
|
import { GridPrivateApiCommunity } from '../../models/api/gridApiCommunity';
|
|
4
5
|
export declare const GridPrivateApiContext: React.Context<unknown>;
|
|
5
|
-
export declare function useGridPrivateApiContext<PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>():
|
|
6
|
+
export declare function useGridPrivateApiContext<PrivateApi extends GridPrivateApiCommon = GridPrivateApiCommunity>(): RefObject<PrivateApi>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';
|
|
3
3
|
import type { GridApiCommon } from '../../models/api/gridApiCommon';
|
|
4
4
|
import type { OutputSelector, OutputSelectorV8 } from '../../utils/createSelector';
|
|
5
5
|
type Selector<Api extends GridApiCommon, Args, T> = ((state: Api['state']) => T) | OutputSelectorV8<Api['state'], Args, T>;
|
|
6
6
|
export declare const objectShallowCompare: typeof fastObjectShallowCompare;
|
|
7
7
|
export declare const argsEqual: (prev: any, curr: any) => boolean;
|
|
8
|
-
export declare const useGridSelector: <Api extends GridApiCommon, T>(apiRef:
|
|
9
|
-
export declare const useGridSelectorV8: <Api extends GridApiCommon, Args, T>(apiRef:
|
|
8
|
+
export declare const useGridSelector: <Api extends GridApiCommon, T>(apiRef: RefObject<Api>, selector: ((state: Api["state"]) => T) | OutputSelector<Api["state"], T>, equals?: (a: T, b: T) => boolean) => T;
|
|
9
|
+
export declare const useGridSelectorV8: <Api extends GridApiCommon, Args, T>(apiRef: RefObject<Api>, selector: Selector<Api, Args, T>, args?: Args, equals?: <U = T>(a: U, b: U) => boolean) => T;
|
|
10
10
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
3
3
|
import type { GridApiCommon } from '../../models';
|
|
4
|
-
export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef:
|
|
4
|
+
export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: RefObject<Api>, props?: Pick<DataGridProcessedProps, "pagination" | "paginationMode">) => {
|
|
5
5
|
rows: import("../..").GridRowEntry<import("../..").GridValidRowModel>[];
|
|
6
6
|
range: {
|
|
7
7
|
firstRowIndex: number;
|
|
@@ -16,7 +16,7 @@ export declare const getVisibleRows: <Api extends GridApiCommon>(apiRef: React.R
|
|
|
16
16
|
* - If the row tree has several layers, it contains up to `state.pageSize` top level rows and all their descendants.
|
|
17
17
|
* - If the row tree is flat, it only contains up to `state.pageSize` rows.
|
|
18
18
|
*/
|
|
19
|
-
export declare const useGridVisibleRows: <Api extends GridApiCommon>(apiRef:
|
|
19
|
+
export declare const useGridVisibleRows: <Api extends GridApiCommon>(apiRef: RefObject<Api>, props?: Pick<DataGridProcessedProps, "pagination" | "paginationMode">) => {
|
|
20
20
|
rows: import("../..").GridRowEntry<import("../..").GridValidRowModel>[];
|
|
21
21
|
range: {
|
|
22
22
|
firstRowIndex: number;
|
package/index.js
CHANGED
package/locales/faIR.js
CHANGED
|
@@ -34,8 +34,7 @@ const faIRGrid = {
|
|
|
34
34
|
columnsManagementNoColumns: 'بدون سطر',
|
|
35
35
|
columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
|
|
36
36
|
columnsManagementReset: 'بازنشانی',
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
columnsManagementDeleteIconLabel: 'پاک کردن',
|
|
39
38
|
// Filter panel text
|
|
40
39
|
filterPanelAddFilter: 'افزودن فیلتر',
|
|
41
40
|
filterPanelRemoveAll: 'حذف همه',
|
|
@@ -49,9 +48,9 @@ const faIRGrid = {
|
|
|
49
48
|
filterPanelInputPlaceholder: 'فیلتر مقدار',
|
|
50
49
|
// Filter operators text
|
|
51
50
|
filterOperatorContains: 'شامل',
|
|
52
|
-
|
|
51
|
+
filterOperatorDoesNotContain: 'شامل نمیشود',
|
|
53
52
|
filterOperatorEquals: 'مساوی',
|
|
54
|
-
|
|
53
|
+
filterOperatorDoesNotEqual: 'برابر نیست',
|
|
55
54
|
filterOperatorStartsWith: 'شروع با',
|
|
56
55
|
filterOperatorEndsWith: 'پایان با',
|
|
57
56
|
filterOperatorIs: 'هست',
|
|
@@ -71,9 +70,9 @@ const faIRGrid = {
|
|
|
71
70
|
'filterOperator<=': '<=',
|
|
72
71
|
// Header filter operators text
|
|
73
72
|
headerFilterOperatorContains: 'شامل',
|
|
74
|
-
|
|
73
|
+
headerFilterOperatorDoesNotContain: 'شامل نمیشود',
|
|
75
74
|
headerFilterOperatorEquals: 'مساوی',
|
|
76
|
-
|
|
75
|
+
headerFilterOperatorDoesNotEqual: 'برابر نیست',
|
|
77
76
|
headerFilterOperatorStartsWith: 'شروع با',
|
|
78
77
|
headerFilterOperatorEndsWith: 'پایان با',
|
|
79
78
|
headerFilterOperatorIs: 'هست',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { GridCellClassNamePropType } from '../gridCellClass';
|
|
3
4
|
import { GridColumnHeaderClassNamePropType } from '../gridColumnHeaderClass';
|
|
4
5
|
import type { GridFilterOperator } from '../gridFilterOperator';
|
|
@@ -24,13 +25,13 @@ export type ValueOptions = string | number | {
|
|
|
24
25
|
* Value that can be used as a key for grouping rows
|
|
25
26
|
*/
|
|
26
27
|
export type GridKeyValue = string | number | boolean;
|
|
27
|
-
export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef:
|
|
28
|
-
export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef:
|
|
29
|
-
export type GridValueGetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
30
|
-
export type GridValueFormatter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
31
|
-
export type GridValueSetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
32
|
-
export type GridValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: F | undefined, row: R | undefined, column: GridColDef<R, V, F>, apiRef:
|
|
33
|
-
export type GridColSpanFn<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
28
|
+
export type GridApplyQuickFilter<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: V, row: R, column: GridColDef, apiRef: RefObject<GridApiCommunity>) => boolean;
|
|
29
|
+
export type GetApplyQuickFilterFn<R extends GridValidRowModel = GridValidRowModel, V = any> = (value: any, colDef: GridStateColDef<R, V>, apiRef: RefObject<GridApiCommunity>) => null | GridApplyQuickFilter<R, V>;
|
|
30
|
+
export type GridValueGetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => V;
|
|
31
|
+
export type GridValueFormatter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V, TValue = never> = (value: TValue, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => F;
|
|
32
|
+
export type GridValueSetter<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => R;
|
|
33
|
+
export type GridValueParser<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: F | undefined, row: R | undefined, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => V;
|
|
34
|
+
export type GridColSpanFn<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => number | undefined;
|
|
34
35
|
/**
|
|
35
36
|
* Column Definition base interface.
|
|
36
37
|
*/
|
|
@@ -217,7 +218,7 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
|
|
|
217
218
|
* This function can return `null` to skip filtering for this value and column.
|
|
218
219
|
* @param {any} value The value with which we want to filter the column.
|
|
219
220
|
* @param {GridStateColDef} colDef The column from which we want to filter the rows.
|
|
220
|
-
* @param {
|
|
221
|
+
* @param {RefObject<GridApiCommunity>} apiRef Deprecated: The API of the grid.
|
|
221
222
|
* @returns {null | GridApplyQuickFilter} The function to call to check if a row pass this filter value or not.
|
|
222
223
|
*/
|
|
223
224
|
getApplyQuickFilterFn?: GetApplyQuickFilterFn<R, V>;
|
package/models/gridExport.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
2
|
import { GridRowId } from './gridRows';
|
|
3
3
|
import type { GridApiCommon } from './api';
|
|
4
4
|
import type { GridApiCommunity } from './api/gridApiCommunity';
|
|
@@ -49,7 +49,7 @@ export interface GridGetRowsToExportParams<Api extends GridApiCommon = GridApiCo
|
|
|
49
49
|
/**
|
|
50
50
|
* The API of the grid.
|
|
51
51
|
*/
|
|
52
|
-
apiRef:
|
|
52
|
+
apiRef: RefObject<Api>;
|
|
53
53
|
}
|
|
54
54
|
export interface GridCsvGetRowsToExportParams<Api extends GridApiCommon = GridApiCommunity> extends GridGetRowsToExportParams<Api> {
|
|
55
55
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { GridFilterItem } from './gridFilterItem';
|
|
3
4
|
import type { GridColDef } from './colDef/gridColDef';
|
|
4
5
|
import type { GridValidRowModel } from './gridRows';
|
|
5
6
|
import type { GridApiCommunity } from './api/gridApiCommunity';
|
|
6
|
-
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef:
|
|
7
|
+
type ApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (value: V, row: R, column: GridColDef<R, V, F>, apiRef: RefObject<GridApiCommunity>) => boolean;
|
|
7
8
|
export type GetApplyFilterFn<R extends GridValidRowModel = any, V = any, F = V> = (filterItem: GridFilterItem, column: GridColDef<R, V, F>) => null | ApplyFilterFn<R, V, F>;
|
|
8
9
|
/**
|
|
9
10
|
* Filter operator definition interface.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { RefObject } from '@mui/x-internals/types';
|
|
2
3
|
import { SxProps } from '@mui/system';
|
|
3
4
|
import { Theme } from '@mui/material/styles';
|
|
4
5
|
import { CommonProps } from '@mui/material/OverridableComponent';
|
|
@@ -386,7 +387,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
386
387
|
/**
|
|
387
388
|
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
|
|
388
389
|
*/
|
|
389
|
-
apiRef?:
|
|
390
|
+
apiRef?: RefObject<GridApiCommunity>;
|
|
390
391
|
/**
|
|
391
392
|
* Forwarded props for the Data Grid root element.
|
|
392
393
|
* @ignore - do not document.
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
|
|
5
|
-
import {
|
|
6
|
-
import { gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
5
|
+
import { useGridSelectorV8 } from "../../hooks/utils/useGridSelector.js";
|
|
6
|
+
import { gridPreferencePanelSelectorWithLabel, gridPreferencePanelStateSelector } from "../../hooks/features/preferencesPanel/gridPreferencePanelSelector.js";
|
|
7
7
|
import { GridPreferencePanelsValue } from "../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
8
8
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
@@ -19,6 +19,21 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
};
|
|
20
20
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
21
21
|
};
|
|
22
|
+
function GridColumnHeaderFilterIconButtonWrapped(props) {
|
|
23
|
+
if (!props.counter) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/_jsx(GridColumnHeaderFilterIconButton, _extends({}, props));
|
|
27
|
+
}
|
|
28
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButtonWrapped.propTypes = {
|
|
29
|
+
// ----------------------------- Warning --------------------------------
|
|
30
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
|
+
// ----------------------------------------------------------------------
|
|
33
|
+
counter: PropTypes.number,
|
|
34
|
+
field: PropTypes.string.isRequired,
|
|
35
|
+
onClick: PropTypes.func
|
|
36
|
+
} : void 0;
|
|
22
37
|
function GridColumnHeaderFilterIconButton(props) {
|
|
23
38
|
const {
|
|
24
39
|
counter,
|
|
@@ -31,8 +46,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
31
46
|
classes: rootProps.classes
|
|
32
47
|
});
|
|
33
48
|
const classes = useUtilityClasses(ownerState);
|
|
34
|
-
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
35
49
|
const labelId = useId();
|
|
50
|
+
const isOpen = useGridSelectorV8(apiRef, gridPreferencePanelSelectorWithLabel, labelId);
|
|
36
51
|
const panelId = useId();
|
|
37
52
|
const toggleFilter = React.useCallback(event => {
|
|
38
53
|
event.preventDefault();
|
|
@@ -53,7 +68,6 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
53
68
|
if (!counter) {
|
|
54
69
|
return null;
|
|
55
70
|
}
|
|
56
|
-
const open = preferencePanel.open && preferencePanel.labelId === labelId;
|
|
57
71
|
const iconButton = /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
58
72
|
id: labelId,
|
|
59
73
|
onClick: toggleFilter,
|
|
@@ -62,8 +76,8 @@ function GridColumnHeaderFilterIconButton(props) {
|
|
|
62
76
|
size: "small",
|
|
63
77
|
tabIndex: -1,
|
|
64
78
|
"aria-haspopup": "menu",
|
|
65
|
-
"aria-expanded":
|
|
66
|
-
"aria-controls":
|
|
79
|
+
"aria-expanded": isOpen,
|
|
80
|
+
"aria-controls": isOpen ? panelId : undefined
|
|
67
81
|
}, rootProps.slotProps?.baseIconButton, {
|
|
68
82
|
children: /*#__PURE__*/_jsx(rootProps.slots.columnFilteredIcon, {
|
|
69
83
|
className: classes.icon,
|
|
@@ -92,4 +106,4 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderFilterIconButton.propTyp
|
|
|
92
106
|
field: PropTypes.string.isRequired,
|
|
93
107
|
onClick: PropTypes.func
|
|
94
108
|
} : void 0;
|
|
95
|
-
export { GridColumnHeaderFilterIconButton };
|
|
109
|
+
export { GridColumnHeaderFilterIconButtonWrapped as GridColumnHeaderFilterIconButton };
|
|
@@ -91,7 +91,8 @@ const GridPanel = forwardRef((props, ref) => {
|
|
|
91
91
|
}, other, {
|
|
92
92
|
ref: ref,
|
|
93
93
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
94
|
-
mouseEvent: "
|
|
94
|
+
mouseEvent: "onPointerUp",
|
|
95
|
+
touchEvent: false,
|
|
95
96
|
onClickAway: handleClickAway,
|
|
96
97
|
children: /*#__PURE__*/_jsx(GridPaperRoot, {
|
|
97
98
|
className: classes.paper,
|
|
@@ -46,7 +46,12 @@ const GridToolbarColumnsButton = forwardRef(function GridToolbarColumnsButton(pr
|
|
|
46
46
|
"aria-expanded": isOpen,
|
|
47
47
|
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
48
48
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {}),
|
|
49
|
-
onClick: showColumns
|
|
49
|
+
onClick: showColumns,
|
|
50
|
+
onPointerUp: event => {
|
|
51
|
+
if (preferencePanel.open) {
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
50
55
|
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
51
56
|
ref: ref,
|
|
52
57
|
children: apiRef.current.getLocaleText('toolbarColumns')
|
|
@@ -110,7 +110,12 @@ const GridToolbarFilterButton = forwardRef(function GridToolbarFilterButton(prop
|
|
|
110
110
|
}, rootProps.slotProps?.baseBadge, badgeProps, {
|
|
111
111
|
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {})
|
|
112
112
|
})),
|
|
113
|
-
onClick: toggleFilter
|
|
113
|
+
onClick: toggleFilter,
|
|
114
|
+
onPointerUp: event => {
|
|
115
|
+
if (preferencePanel.open) {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
114
119
|
}, rootProps.slotProps?.baseButton, buttonProps, {
|
|
115
120
|
ref: ref,
|
|
116
121
|
children: apiRef.current.getLocaleText('toolbarFilters')
|
|
@@ -40,7 +40,6 @@ export const useGridColumnMenu = apiRef => {
|
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
42
|
apiRef.current.hidePreferences();
|
|
43
|
-
apiRef.current.forceUpdate();
|
|
44
43
|
}
|
|
45
44
|
}, [apiRef, logger]);
|
|
46
45
|
const hideColumnMenu = React.useCallback(() => {
|
|
@@ -82,7 +81,6 @@ export const useGridColumnMenu = apiRef => {
|
|
|
82
81
|
columnMenu: newState
|
|
83
82
|
});
|
|
84
83
|
});
|
|
85
|
-
apiRef.current.forceUpdate();
|
|
86
84
|
}
|
|
87
85
|
}, [apiRef, logger]);
|
|
88
86
|
const toggleColumnMenu = React.useCallback(field => {
|
|
@@ -15,6 +15,7 @@ import { gridRowsMetaSelector } from "../rows/gridRowsMetaSelector.js";
|
|
|
15
15
|
import { calculatePinnedRowsHeight, getValidRowHeight, rowHeightWarning } from "../rows/gridRowsUtils.js";
|
|
16
16
|
import { getTotalHeaderHeight } from "../columns/gridColumnsUtils.js";
|
|
17
17
|
import { DATA_GRID_PROPS_DEFAULT_VALUES } from "../../../constants/dataGridPropsDefaultValues.js";
|
|
18
|
+
import { isJSDOM } from "../../../utils/isJSDOM.js";
|
|
18
19
|
const EMPTY_SIZE = {
|
|
19
20
|
width: 0,
|
|
20
21
|
height: 0
|
|
@@ -237,9 +238,6 @@ export function useGridDimensions(apiRef, props) {
|
|
|
237
238
|
const isFirstSizing = React.useRef(true);
|
|
238
239
|
const handleResize = React.useCallback(size => {
|
|
239
240
|
rootDimensionsRef.current = size;
|
|
240
|
-
|
|
241
|
-
// jsdom has no layout capabilities
|
|
242
|
-
const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
243
241
|
if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
|
|
244
242
|
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'));
|
|
245
243
|
errorShown.current = true;
|
|
@@ -19,7 +19,7 @@ function getHasEval() {
|
|
|
19
19
|
/**
|
|
20
20
|
* Adds default values to the optional fields of a filter items.
|
|
21
21
|
* @param {GridFilterItem} item The raw filter item.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
23
23
|
* @return {GridFilterItem} The clean filter item with an uniq ID and an always-defined operator.
|
|
24
24
|
* TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.
|
|
25
25
|
*/
|
|
@@ -133,7 +133,7 @@ let filterItemsApplierId = 1;
|
|
|
133
133
|
/**
|
|
134
134
|
* Generates a method to easily check if a row is matching the current filter model.
|
|
135
135
|
* @param {GridFilterModel} filterModel The model with which we want to filter the rows.
|
|
136
|
-
* @param {
|
|
136
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
137
137
|
* @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.
|
|
138
138
|
*/
|
|
139
139
|
const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) => {
|
|
@@ -181,7 +181,7 @@ export const shouldQuickFilterExcludeHiddenColumns = filterModel => {
|
|
|
181
181
|
/**
|
|
182
182
|
* Generates a method to easily check if a row is matching the current quick filter.
|
|
183
183
|
* @param {any[]} filterModel The model with which we want to filter the rows.
|
|
184
|
-
* @param {
|
|
184
|
+
* @param {RefObject<GridPrivateApiCommunity>} apiRef The API of the grid.
|
|
185
185
|
* @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.
|
|
186
186
|
*/
|
|
187
187
|
const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { createSelectorV8 } from "../../../utils/createSelector.js";
|
|
2
|
+
export const gridPreferencePanelStateSelector = state => state.preferencePanel;
|
|
3
|
+
export const gridPreferencePanelSelectorWithLabel = createSelectorV8(gridPreferencePanelStateSelector, (panel, labelId) => {
|
|
4
|
+
if (panel.open && panel.labelId === labelId) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
return false;
|
|
8
|
+
});
|
|
@@ -15,42 +15,29 @@ export const preferencePanelStateInitializer = (state, props) => _extends({}, st
|
|
|
15
15
|
*/
|
|
16
16
|
export const useGridPreferencesPanel = (apiRef, props) => {
|
|
17
17
|
const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');
|
|
18
|
-
const hideTimeout = React.useRef(undefined);
|
|
19
|
-
const immediateTimeout = React.useRef(undefined);
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
20
|
* API METHODS
|
|
23
21
|
*/
|
|
24
22
|
const hidePreferences = React.useCallback(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
apiRef.current.setState(state => {
|
|
24
|
+
if (!state.preferencePanel.open) {
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
logger.debug('Hiding Preferences Panel');
|
|
28
|
+
const preferencePanelState = gridPreferencePanelStateSelector(state);
|
|
28
29
|
apiRef.current.publishEvent('preferencePanelClose', {
|
|
29
30
|
openedPanelValue: preferencePanelState.openedPanelValue
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
apiRef.current.forceUpdate();
|
|
32
|
+
return _extends({}, state, {
|
|
33
|
+
preferencePanel: {
|
|
34
|
+
open: false
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
38
|
}, [apiRef, logger]);
|
|
39
|
-
|
|
40
|
-
// This is to prevent the preferences from closing when you open a select box or another panel,
|
|
41
|
-
// The issue is in MUI core V4 => Fixed in V5
|
|
42
|
-
const doNotHidePanel = React.useCallback(() => {
|
|
43
|
-
immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
// This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,
|
|
47
|
-
// we can cancel the action if the trigger element still need the panel...
|
|
48
|
-
const hidePreferencesDelayed = React.useCallback(() => {
|
|
49
|
-
hideTimeout.current = setTimeout(hidePreferences, 100);
|
|
50
|
-
}, [hidePreferences]);
|
|
51
39
|
const showPreferences = React.useCallback((newValue, panelId, labelId) => {
|
|
52
40
|
logger.debug('Opening Preferences Panel');
|
|
53
|
-
doNotHidePanel();
|
|
54
41
|
apiRef.current.setState(state => _extends({}, state, {
|
|
55
42
|
preferencePanel: _extends({}, state.preferencePanel, {
|
|
56
43
|
open: true,
|
|
@@ -62,11 +49,10 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
62
49
|
apiRef.current.publishEvent('preferencePanelOpen', {
|
|
63
50
|
openedPanelValue: newValue
|
|
64
51
|
});
|
|
65
|
-
|
|
66
|
-
}, [logger, doNotHidePanel, apiRef]);
|
|
52
|
+
}, [logger, apiRef]);
|
|
67
53
|
useGridApiMethod(apiRef, {
|
|
68
54
|
showPreferences,
|
|
69
|
-
hidePreferences
|
|
55
|
+
hidePreferences
|
|
70
56
|
}, 'public');
|
|
71
57
|
|
|
72
58
|
/**
|
|
@@ -99,14 +85,4 @@ export const useGridPreferencesPanel = (apiRef, props) => {
|
|
|
99
85
|
}, [apiRef]);
|
|
100
86
|
useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
|
|
101
87
|
useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* EFFECTS
|
|
105
|
-
*/
|
|
106
|
-
React.useEffect(() => {
|
|
107
|
-
return () => {
|
|
108
|
-
clearTimeout(hideTimeout.current);
|
|
109
|
-
clearTimeout(immediateTimeout.current);
|
|
110
|
-
};
|
|
111
|
-
}, []);
|
|
112
88
|
};
|
|
@@ -19,7 +19,7 @@ const isDesc = direction => direction === 'desc';
|
|
|
19
19
|
/**
|
|
20
20
|
* Transform an item of the sorting model into a method comparing two rows.
|
|
21
21
|
* @param {GridSortItem} sortItem The sort item we want to apply.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
23
23
|
* @returns {GridParsedSortItem | null} The parsed sort item. Returns `null` is the sort item is not valid.
|
|
24
24
|
*/
|
|
25
25
|
const parseSortItem = (sortItem, apiRef) => {
|
|
@@ -72,7 +72,7 @@ const compareRows = (parsedSortItems, row1, row2) => {
|
|
|
72
72
|
/**
|
|
73
73
|
* Generates a method to easily sort a list of rows according to the current sort model.
|
|
74
74
|
* @param {GridSortModel} sortModel The model with which we want to sort the rows.
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {RefObject<GridApiCommunity>} apiRef The API of the grid.
|
|
76
76
|
* @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.
|
|
77
77
|
*/
|
|
78
78
|
export const buildAggregatedSortingApplier = (sortModel, apiRef) => {
|
|
@@ -26,6 +26,7 @@ import { gridRowSpanningHiddenCellsOriginMapSelector } from "../rows/gridRowSpan
|
|
|
26
26
|
import { gridListColumnSelector } from "../listView/gridListViewSelectors.js";
|
|
27
27
|
import { minimalContentHeight } from "../rows/gridRowsUtils.js";
|
|
28
28
|
import { gridFocusedVirtualCellSelector } from "./gridFocusedVirtualCellSelector.js";
|
|
29
|
+
import { isJSDOM } from "../../../utils/isJSDOM.js";
|
|
29
30
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
31
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
31
32
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -45,14 +46,6 @@ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, h
|
|
|
45
46
|
direction: ScrollDirection.NONE,
|
|
46
47
|
buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
47
48
|
});
|
|
48
|
-
let isJSDOM = false;
|
|
49
|
-
try {
|
|
50
|
-
if (typeof window !== 'undefined') {
|
|
51
|
-
isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
|
|
52
|
-
}
|
|
53
|
-
} catch (_) {
|
|
54
|
-
/* ignore */
|
|
55
|
-
}
|
|
56
49
|
export const useGridVirtualScroller = () => {
|
|
57
50
|
const apiRef = useGridPrivateApiContext();
|
|
58
51
|
const rootProps = useGridRootProps();
|
|
@@ -2,4 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook that instantiate a [[GridApiRef]].
|
|
4
4
|
*/
|
|
5
|
-
export const useGridApiRef = () =>
|
|
5
|
+
export const useGridApiRef = () =>
|
|
6
|
+
// 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)
|
|
7
|
+
React.useRef({});
|
package/modern/index.js
CHANGED
package/modern/locales/faIR.js
CHANGED
|
@@ -34,8 +34,7 @@ const faIRGrid = {
|
|
|
34
34
|
columnsManagementNoColumns: 'بدون سطر',
|
|
35
35
|
columnsManagementShowHideAllText: 'نمایش/مخفی کردن همه',
|
|
36
36
|
columnsManagementReset: 'بازنشانی',
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
columnsManagementDeleteIconLabel: 'پاک کردن',
|
|
39
38
|
// Filter panel text
|
|
40
39
|
filterPanelAddFilter: 'افزودن فیلتر',
|
|
41
40
|
filterPanelRemoveAll: 'حذف همه',
|
|
@@ -49,9 +48,9 @@ const faIRGrid = {
|
|
|
49
48
|
filterPanelInputPlaceholder: 'فیلتر مقدار',
|
|
50
49
|
// Filter operators text
|
|
51
50
|
filterOperatorContains: 'شامل',
|
|
52
|
-
|
|
51
|
+
filterOperatorDoesNotContain: 'شامل نمیشود',
|
|
53
52
|
filterOperatorEquals: 'مساوی',
|
|
54
|
-
|
|
53
|
+
filterOperatorDoesNotEqual: 'برابر نیست',
|
|
55
54
|
filterOperatorStartsWith: 'شروع با',
|
|
56
55
|
filterOperatorEndsWith: 'پایان با',
|
|
57
56
|
filterOperatorIs: 'هست',
|
|
@@ -71,9 +70,9 @@ const faIRGrid = {
|
|
|
71
70
|
'filterOperator<=': '<=',
|
|
72
71
|
// Header filter operators text
|
|
73
72
|
headerFilterOperatorContains: 'شامل',
|
|
74
|
-
|
|
73
|
+
headerFilterOperatorDoesNotContain: 'شامل نمیشود',
|
|
75
74
|
headerFilterOperatorEquals: 'مساوی',
|
|
76
|
-
|
|
75
|
+
headerFilterOperatorDoesNotEqual: 'برابر نیست',
|
|
77
76
|
headerFilterOperatorStartsWith: 'شروع با',
|
|
78
77
|
headerFilterOperatorEndsWith: 'پایان با',
|
|
79
78
|
headerFilterOperatorIs: 'هست',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isJSDOM = typeof window !== 'undefined' && /jsdom|HappyDOM/.test(window.navigator.userAgent);
|