🤖 Merge PR #46334 [material-ui] fix: makeSelectable omit inner component's onChange property by @ngbrown

* [material-ui] fix: makeSelectable omit inner component's onChange property.

* [material-ui-datatables]: update minimum TypeScript version to 3.5.

* [material-ui-pagination]: update minimum TypeScript version to 3.5.

* [react-material-ui-form-validator]: update minimum TypeScript version to 3.5.
This commit is contained in:
Nathan Brown 2020-08-15 22:14:24 -07:00 committed by GitHub
parent 0c793bde20
commit ff616a1458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,7 @@
// Project: https://github.com/hyojin/material-ui-datatables#readme
// Definitions by: Ravi L. <https://github.com/coding2012>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Minimum TypeScript Version: 3.5
import * as React from 'react';

View File

@ -2,7 +2,7 @@
// Project: https://github.com/lo-tp/material-ui-pagination
// Definitions by: m0a <https://m0a.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Minimum TypeScript Version: 3.5
import * as React from 'react';
export interface PaginationProps {
total: number;

View File

@ -14,7 +14,7 @@
// Sam Walsh <https://github.com/samwalshnz>
// Tim de Koning <https://github.com/reggino>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Minimum TypeScript Version: 3.5
/// <reference types="react" />
/// <reference types="react-addons-linked-state-mixin" />
@ -1192,7 +1192,7 @@ declare namespace __MaterialUI {
}
// union types for higher order components in TypeScript 1.8: https://github.com/Microsoft/TypeScript/issues/4362
export function makeSelectable<P extends {}>(component: React.ComponentClass<P>): React.ComponentClass<P & SelectableProps>;
export function makeSelectable<P extends {}>(component: React.ComponentClass<P>): React.ComponentClass<Omit<P, 'onChange'> & SelectableProps>;
}
namespace Menus {

View File

@ -4227,7 +4227,7 @@ function wrapState(ComposedComponent: ComponentClass<__MaterialUI.List.Selectabl
};
}
const SelectableList = wrapState(makeSelectable<{}>(List));
const SelectableList = wrapState(makeSelectable(List));
const ListExampleSelectable = () => (
<Paper>
@ -4264,6 +4264,12 @@ const ListExampleSelectable = () => (
</Paper>
);
const DirectSelectableList = makeSelectable(List);
const DirectSelectableListExample = () => (
<DirectSelectableList onChange={(e, v) => console.log(v)} />
);
// "http://www.material-ui.com/#/components/menu"
const MenuExampleSimple = () => (
<div>

View File

@ -3,7 +3,7 @@
// Definitions by: Frank Brullo <https://github.com/FrankBrullo>
// J.R <https://github.com/jrguenin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
// TypeScript Version: 3.5
import * as React from 'react';
import { SelectFieldProps, TextFieldProps } from 'material-ui';