Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Update to typescript 4.8.3 (target master) #6136

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@emotion/styled": "^11.10.4",
"@material-ui/core": "^5.0.0-beta.5",
"@material-ui/icons": "^5.0.0-beta.5",
"@mui/material": "^5.10.2",
"@mui/material": "^5.10.5",
"@mui/x-data-grid": "^4.0.0",
"@visx/xychart": "^2.12.2",
"ag-grid-community": "^28.1.1",
Expand Down
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"@emotion/react": "^11.10.4",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.2",
"@mui/joy": "^5.0.0-alpha.42",
"@mui/material": "^5.10.2",
"@mui/styles": "^5.9.3",
"@mui/utils": "^5.9.3",
"@mui/icons-material": "^5.10.3",
"@mui/joy": "^5.0.0-alpha.45",
"@mui/material": "^5.10.5",
"@mui/styles": "^5.10.3",
"@mui/utils": "^5.10.3",
"@trendmicro/react-interpolate": "^0.5.5",
"@types/lodash": "^4.14.184",
"@types/react-dom": "^18.0.6",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@mui/icons-material": "^5.10.2",
"@mui/material": "^5.10.2",
"@mui/icons-material": "^5.10.3",
"@mui/material": "^5.10.5",
"@mui/monorepo": "https://github.com/m4theushw/material-ui.git#master",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"@octokit/plugin-retry": "^3.0.9",
"@octokit/rest": "^18.12.0",
"@playwright/test": "1.21.1",
Expand Down Expand Up @@ -157,7 +157,7 @@
"serve": "^14.0.1",
"sinon": "^14.0.0",
"stream-browserify": "^3.0.0",
"typescript": "^4.7.4",
"typescript": "^4.8.3",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"yargs": "^17.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@mui/base": "^5.0.0-alpha.94",
"@mui/base": "^5.0.0-alpha.97",
"@mui/x-data-grid-premium": "5.17.2",
"chance": "^1.1.8",
"clsx": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"@mui/x-data-grid": "5.17.2",
"@mui/x-data-grid-pro": "5.17.2",
"@mui/x-license-pro": "5.17.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GridColDef } from '@mui/x-data-grid';
import { GridColDef, GridValidRowModel } from '@mui/x-data-grid';

export type GridRowGroupingModel = string[];

Expand Down Expand Up @@ -43,9 +43,10 @@ export interface GridRowGroupingApi {
setRowGroupingCriteriaIndex: (groupingCriteriaField: string, groupingIndex: number) => void;
}

export interface GridGroupingRule<R = any, V = any> {
export interface GridGroupingRule<R extends GridValidRowModel = GridValidRowModel, V = any> {
field: string;
groupingValueGetter?: GridColDef<R, V>['groupingValueGetter'];
}

export type GridGroupingRules<R = any> = GridGroupingRule<R>[];
export type GridGroupingRules<R extends GridValidRowModel = GridValidRowModel> =
GridGroupingRule<R>[];
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import {
GridRowTreeNodeConfig,
GridColDef,
GridStateColDef,
GridValidRowModel,
} from '@mui/x-data-grid-pro';

/**
* Parameters passed to `colDef.groupingValueGetter`.
*/
export interface GridGroupingValueGetterParams<V = any, R = any> {
export interface GridGroupingValueGetterParams<
V = any,
R extends GridValidRowModel = GridValidRowModel,
> {
/**
* The grid row id.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"@mui/x-data-grid": "5.17.2",
"@mui/x-license-pro": "5.17.0",
"@types/format-util": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GridRowId, GridRowsLookup, GridRowsProp } from '@mui/x-data-grid';
import { GridRowId, GridRowsLookup, GridRowsProp, GridValidRowModel } from '@mui/x-data-grid';

export interface GridPinnedRowsProp<R = any> {
export interface GridPinnedRowsProp<R extends GridValidRowModel = GridValidRowModel> {
top?: GridRowsProp<R>;
bottom?: GridRowsProp<R>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"clsx": "^1.2.1",
"prop-types": "^15.8.1",
"reselect": "^4.1.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid/src/components/cell/GridCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function GridCell(props: GridCellProps) {
}

if (React.isValidElement(children) && managesOwnFocus) {
return React.cloneElement(children, { focusElementRef });
return React.cloneElement<any>(children, { focusElementRef });
}

return children;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const GridToolbarExportContainer = React.forwardRef<HTMLButtonElement, Bu
if (!React.isValidElement(child)) {
return child;
}
return React.cloneElement(child, { hideMenu: handleMenuClose });
return React.cloneElement<any>(child, { hideMenu: handleMenuClose });
})}
</MenuList>
</GridMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export type GridStateInitializer<
apiRef: React.MutableRefObject<Api>,
) => DeepPartial<Api['state']>;

export const useGridInitializeState = <P, Api extends GridApiCommon = GridApiCommunity>(
export const useGridInitializeState = <
P extends Partial<DataGridProcessedProps>,
Api extends GridApiCommon = GridApiCommunity,
>(
initializer: GridStateInitializer<P, Api>,
apiRef: React.MutableRefObject<Api>,
props: P,
Expand Down
4 changes: 3 additions & 1 deletion packages/grid/x-data-grid/src/models/gridRows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import type { GridKeyValue } from './colDef/gridColDef';

export type GridValidRowModel = { [key: string]: any };

export type GridRowsProp<R = GridValidRowModel> = Readonly<GridRowModel<R>[]>;
export type GridRowsProp<R extends GridValidRowModel = GridValidRowModel> = Readonly<
GridRowModel<R>[]
>;

/**
* @deprecated prefer GridRowModel.
Expand Down
14 changes: 11 additions & 3 deletions packages/grid/x-data-grid/src/models/params/gridEditCellParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GridEditCellProps } from '../gridEditRowModel';
import { GridRowId } from '../gridRows';
import { GridRowId, GridValidRowModel } from '../gridRows';
import { GridCellParams } from './gridCellParams';

// TODO v6 - remove
Expand Down Expand Up @@ -54,7 +54,11 @@ enum GridCellEditStartReasons {
/**
* Params passed to the `cellEditStart` event.
*/
export interface GridCellEditStartParams<V = any, R = any, F = V> extends GridCellParams<V, R, F> {
export interface GridCellEditStartParams<
V = any,
R extends GridValidRowModel = GridValidRowModel,
F = V,
> extends GridCellParams<V, R, F> {
/**
* The reason for this event to be triggered.
* Only applied if `props.experimentalFeatures.newEditingApi: true`.
Expand All @@ -73,7 +77,11 @@ enum GridCellEditStopReasons {
/**
* Params passed to the `cellEditStop event.
*/
export interface GridCellEditStopParams<V = any, R = any, F = V> extends GridCellParams<V, R, F> {
export interface GridCellEditStopParams<
V = any,
R extends GridValidRowModel = GridValidRowModel,
F = V,
> extends GridCellParams<V, R, F> {
/**
* The reason for this event to be triggered.
* Only available if `props.experimentalFeatures.newEditingApi: true`.
Expand Down
4 changes: 2 additions & 2 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"directory": "packages/storybook"
},
"dependencies": {
"@mui/icons-material": "^5.10.2",
"@mui/material": "^5.10.2",
"@mui/icons-material": "^5.10.3",
"@mui/material": "^5.10.5",
"@mui/x-data-grid": "5.17.2",
"@mui/x-data-grid-generator": "5.17.2",
"@mui/x-data-grid-premium": "5.17.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@date-io/dayjs": "^2.15.0",
"@date-io/luxon": "^2.15.0",
"@date-io/moment": "^2.15.0",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"@mui/x-date-pickers": "5.0.1",
"@mui/x-license-pro": "5.17.0",
"clsx": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@date-io/dayjs": "^2.15.0",
"@date-io/luxon": "^2.15.0",
"@date-io/moment": "^2.15.0",
"@mui/utils": "^5.9.3",
"@mui/utils": "^5.10.3",
"@types/react-transition-group": "^4.4.5",
"clsx": "^1.2.1",
"prop-types": "^15.7.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { IUtils } from '@date-io/core/IUtils';

// @ts-ignore TDate in our codebase does not have the `ExtendableDateType` constraint.
// TODO: Maybe we should add the same constraint.
export type MuiPickersAdapter<TDate> = IUtils<TDate>;

export type MuiDateSectionName = 'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'am-pm';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-license-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@mui/utils": "^5.9.3"
"@mui/utils": "^5.10.3"
},
"peerDependencies": {
"react": "^17.0.2 || ^18.0.0"
Expand Down
Loading