mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
Added Typing definitions for MaterialUI 0.15.1 and Moved 0.15.0 into legacy
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
--experimentalDecorators
|
||||
+8414
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ import AutoComplete from 'material-ui/AutoComplete';
|
||||
import Avatar from 'material-ui/Avatar';
|
||||
import Badge from 'material-ui/Badge';
|
||||
import Checkbox from 'material-ui/Checkbox';
|
||||
import Chip from 'material-ui/Chip';
|
||||
import CircularProgress from 'material-ui/CircularProgress';
|
||||
import DatePicker from 'material-ui/DatePicker';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
@@ -140,6 +141,9 @@ const styles = {
|
||||
button: {
|
||||
margin: 12,
|
||||
},
|
||||
chip: {
|
||||
margin: 4
|
||||
},
|
||||
smallIcon: {
|
||||
width: 36,
|
||||
height: 36,
|
||||
@@ -261,7 +265,6 @@ const iconStyles = {
|
||||
marginRight: 24,
|
||||
};
|
||||
|
||||
|
||||
// "http://www.material-ui.com/#/customization/themes"
|
||||
|
||||
// This replaces the textColor value on the palette
|
||||
@@ -1029,6 +1032,35 @@ class CardExampleControlled extends React.Component<{}, {expanded: boolean}> {
|
||||
}
|
||||
}
|
||||
|
||||
// "http://www.material-ui.com/#/components/chip"
|
||||
const ChipExampleSimple = () => (
|
||||
<div>
|
||||
<Chip>Basic Chip</Chip>
|
||||
<Chip backgroundColor={blue300}>Blue Background</Chip>
|
||||
<Chip labelColor={blue500}>Blue Label Color</Chip>
|
||||
<Chip><Avatar size={32} color={blue300} backgroundColor={indigo900}>UI</Avatar> Avatar</Chip>
|
||||
<Chip style={styles.chip}>Styled</Chip>
|
||||
</div>
|
||||
);
|
||||
|
||||
class ChipExampleComplex extends React.Component<{}, {}>{
|
||||
handleRequestDelete = () => {
|
||||
alert('You clicked the delete button.');
|
||||
}
|
||||
|
||||
handleTouchTap = () => {
|
||||
alert('You clicked the Chip.');
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Chip onTouchTap={this.handleTouchTap} onRequestDelete={this.handleRequestDelete}>Click Me</Chip>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// "http://www.material-ui.com/#/components/date-picker"
|
||||
const DatePickerExampleSimple = () => (
|
||||
@@ -2433,6 +2465,7 @@ const MenuExampleNested = () => (
|
||||
const IconMenuExampleSimple = () => (
|
||||
<div>
|
||||
<IconMenu
|
||||
animated={true}
|
||||
iconButtonElement={<IconButton><MoreVertIcon /></IconButton>}
|
||||
anchorOrigin={{horizontal: 'left', vertical: 'top'}}
|
||||
targetOrigin={{horizontal: 'left', vertical: 'top'}}
|
||||
@@ -2444,6 +2477,7 @@ const IconMenuExampleSimple = () => (
|
||||
<MenuItem primaryText="Sign out" />
|
||||
</IconMenu>
|
||||
<IconMenu
|
||||
animated={false}
|
||||
iconButtonElement={<IconButton><MoreVertIcon /></IconButton>}
|
||||
anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
|
||||
targetOrigin={{horizontal: 'left', vertical: 'bottom'}}
|
||||
@@ -2674,7 +2708,7 @@ class DropDownMenuSimpleExample extends React.Component<{}, {value?: number}> {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<DropDownMenu value={this.state.value} onChange={this.handleChange}>
|
||||
<DropDownMenu animated={false} value={this.state.value} onChange={this.handleChange}>
|
||||
<MenuItem value={1} primaryText="Never" />
|
||||
<MenuItem value={2} primaryText="Every Night" />
|
||||
<MenuItem value={3} primaryText="Weeknights" />
|
||||
@@ -2683,6 +2717,7 @@ class DropDownMenuSimpleExample extends React.Component<{}, {value?: number}> {
|
||||
</DropDownMenu>
|
||||
<br />
|
||||
<DropDownMenu
|
||||
animated={true}
|
||||
value={this.state.value}
|
||||
onChange={this.handleChange}
|
||||
style={styles.customWidth}
|
||||
@@ -3339,6 +3374,7 @@ export default class SelectFieldExampleFloatingLabel extends React.Component<{},
|
||||
<SelectField
|
||||
value={this.state.value}
|
||||
onChange={this.handleChange}
|
||||
floatingLabelFixed={true}
|
||||
floatingLabelText="Styled Floating Label Text"
|
||||
floatingLabelStyle={{color: 'red'}}
|
||||
>
|
||||
|
||||
Vendored
+27
-4
@@ -1,4 +1,4 @@
|
||||
// Type definitions for material-ui v0.15.0
|
||||
// Type definitions for material-ui v0.15.1
|
||||
// Project: https://github.com/callemall/material-ui
|
||||
// Definitions by: Nathan Brown <https://github.com/ngbrown>, Oliver Herrmann <https://github.com/herrmanno>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -17,6 +17,7 @@ declare module "material-ui" {
|
||||
export import CardText = __MaterialUI.Card.CardText;
|
||||
export import CardTitle = __MaterialUI.Card.CardTitle;
|
||||
export import Checkbox = __MaterialUI.Switches.Checkbox;
|
||||
export import Chip = __MaterialUI.Chip;
|
||||
export import CircularProgress = __MaterialUI.CircularProgress;
|
||||
export import DatePicker = __MaterialUI.DatePicker.DatePicker;
|
||||
export import Dialog = __MaterialUI.Dialog;
|
||||
@@ -248,7 +249,7 @@ declare namespace __MaterialUI {
|
||||
inkBar?: {
|
||||
backgroundColor?: string;
|
||||
};
|
||||
navDrawer?: {
|
||||
drawer?: {
|
||||
width?: number;
|
||||
color?: string;
|
||||
};
|
||||
@@ -427,7 +428,7 @@ declare namespace __MaterialUI {
|
||||
menu: number;
|
||||
appBar: number;
|
||||
drawerOverlay: number;
|
||||
navDrawer: number;
|
||||
drawer: number;
|
||||
dialogOverlay: number;
|
||||
dialog: number;
|
||||
layer: number;
|
||||
@@ -513,6 +514,7 @@ declare namespace __MaterialUI {
|
||||
iconElementLeft?: React.ReactElement<any>;
|
||||
iconElementRight?: React.ReactElement<any>;
|
||||
iconStyleRight?: string;
|
||||
iconStyleLeft?: string;
|
||||
onLeftIconButtonTouchTap?: TouchTapEventHandler;
|
||||
onRightIconButtonTouchTap?: TouchTapEventHandler;
|
||||
onTitleTouchTap?: TouchTapEventHandler;
|
||||
@@ -837,6 +839,18 @@ declare namespace __MaterialUI {
|
||||
}
|
||||
}
|
||||
|
||||
interface ChipProps extends React.Props<Chip> {
|
||||
backgroundColor?: string;
|
||||
className?: string;
|
||||
labelColor?: string;
|
||||
labelStyle?: React.CSSProperties;
|
||||
onRequestDelete?: React.TouchEventHandler;
|
||||
onTouchTap?: React.TouchEventHandler;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
export class Chip extends React.Component<ChipProps, {}> {
|
||||
}
|
||||
|
||||
namespace DatePicker {
|
||||
interface DatePickerProps extends React.Props<DatePicker> {
|
||||
// <TextField/> is the element that get the 'other' properties
|
||||
@@ -1150,6 +1164,7 @@ declare namespace __MaterialUI {
|
||||
touchTapCloseDelay?: number;
|
||||
useLayerForClickAway?: boolean;
|
||||
|
||||
animated?: boolean;
|
||||
autoWidth?: boolean;
|
||||
desktop?: boolean;
|
||||
listStyle?: React.CSSProperties;
|
||||
@@ -1169,6 +1184,7 @@ declare namespace __MaterialUI {
|
||||
|
||||
interface DropDownMenuProps extends React.Props<DropDownMenu> {
|
||||
// <div/> is the element that gets the 'other' properties
|
||||
animated?: boolean;
|
||||
autoWidth?: boolean;
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
@@ -1281,6 +1297,7 @@ declare namespace __MaterialUI {
|
||||
disabled?: boolean;
|
||||
errorStyle?: React.CSSProperties;
|
||||
errorText?: React.ReactNode;
|
||||
floatingLabelFixed?: boolean;
|
||||
floatingLabelStyle?: React.CSSProperties;
|
||||
floatingLabelText?: React.ReactNode;
|
||||
fullWidth?: boolean;
|
||||
@@ -1292,7 +1309,6 @@ declare namespace __MaterialUI {
|
||||
onBlur?: React.FocusEventHandler;
|
||||
onChange?: (e: TouchTapEvent, index: number, menuItemValue: any) => void;
|
||||
onFocus?: React.FocusEventHandler;
|
||||
selectFieldRoot?: React.CSSProperties;
|
||||
style?: React.CSSProperties;
|
||||
underlineDisabledStyle?: React.CSSProperties;
|
||||
underlineFocusStyle?: React.CSSProperties;
|
||||
@@ -1703,6 +1719,8 @@ declare namespace __MaterialUI {
|
||||
autoOk?: boolean;
|
||||
cancelLabel?: React.ReactNode;
|
||||
defaultTime?: Date;
|
||||
dialogBodyStyle?: React.CSSProperties;
|
||||
dialogStyle?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
format?: "ampm" | "24hr";
|
||||
okLabel?: React.ReactNode;
|
||||
@@ -1898,6 +1916,11 @@ declare module 'material-ui/Checkbox' {
|
||||
export default Checkbox;
|
||||
}
|
||||
|
||||
declare module 'material-ui/Chip' {
|
||||
export import Chip = __MaterialUI.Chip;
|
||||
export default Chip;
|
||||
}
|
||||
|
||||
declare module 'material-ui/CircularProgress' {
|
||||
export import CircularProgress = __MaterialUI.CircularProgress;
|
||||
export default CircularProgress;
|
||||
|
||||
Reference in New Issue
Block a user