mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
material-ui - update to new dialog usage.
This commit is contained in:
@@ -47,7 +47,13 @@ type CheckboxProps = __MaterialUI.CheckboxProps;
|
||||
type MuiTheme = __MaterialUI.Styles.MuiTheme;
|
||||
type TouchTapEvent = __MaterialUI.TouchTapEvent;
|
||||
|
||||
class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedStateMixin {
|
||||
interface MaterialUiTestsState {
|
||||
showDialogStandardActions: boolean;
|
||||
showDialogCustomActions: boolean;
|
||||
showDialogScrollable: boolean;
|
||||
}
|
||||
|
||||
class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> implements React.LinkedStateMixin {
|
||||
|
||||
// injected with mixin
|
||||
linkState: <T>(key: string) => React.ReactLink<T>;
|
||||
@@ -60,6 +66,8 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta
|
||||
}
|
||||
private selectFieldChangeHandler(e: TouchTapEvent, si: number, mi: any) {
|
||||
}
|
||||
private handleRequestClose(buttonClicked: boolean) {
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -193,7 +201,8 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta
|
||||
title="Dialog With Standard Actions"
|
||||
actions={standardActions}
|
||||
actionFocus="submit"
|
||||
modal={true}>
|
||||
open={this.state.showDialogStandardActions}
|
||||
onRequestClose={this.handleRequestClose}>
|
||||
The actions in this window are created from the json that's passed in.
|
||||
</Dialog>;
|
||||
|
||||
@@ -212,12 +221,23 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta
|
||||
element = <Dialog
|
||||
title="Dialog With Custom Actions"
|
||||
actions={customActions}
|
||||
modal={false}
|
||||
autoDetectWindowHeight={true}
|
||||
autoScrollBodyContent={true}>
|
||||
open={this.state.showDialogCustomActions}
|
||||
onRequestClose={this.handleRequestClose}>
|
||||
The actions in this window were passed in as an array of react objects.
|
||||
</Dialog>;
|
||||
|
||||
element = <Dialog
|
||||
title="Dialog With Scrollable Content"
|
||||
actions={customActions}
|
||||
autoDetectWindowHeight={true}
|
||||
autoScrollBodyContent={true}
|
||||
open={this.state.showDialogScrollable}
|
||||
onRequestClose={this.handleRequestClose}>
|
||||
<div style={{ height: '1000px' }}>
|
||||
Really long content
|
||||
</div>
|
||||
</Dialog>;
|
||||
|
||||
|
||||
// "http://material-ui.com/#/components/dropdown-menu"
|
||||
let menuItems = [
|
||||
|
||||
6
material-ui/material-ui.d.ts
vendored
6
material-ui/material-ui.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for material-ui v0.13.1
|
||||
// Type definitions for material-ui v0.13.4
|
||||
// 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/borisyankov/DefinitelyTyped
|
||||
@@ -379,14 +379,18 @@ declare namespace __MaterialUI {
|
||||
openImmediately?: boolean;
|
||||
repositionOnUpdate?: boolean;
|
||||
title?: React.ReactNode;
|
||||
defaultOpen?: boolean;
|
||||
open?: boolean;
|
||||
|
||||
onClickAway?: () => void;
|
||||
onDismiss?: () => void;
|
||||
onShow?: () => void;
|
||||
onRequestClose?: (buttonClicked: boolean) => void;
|
||||
}
|
||||
export class Dialog extends React.Component<DialogProps, {}> {
|
||||
dismiss(): void;
|
||||
show(): void;
|
||||
isOpen(): boolean;
|
||||
}
|
||||
|
||||
interface DropDownIconProps extends React.Props<DropDownIcon> {
|
||||
|
||||
Reference in New Issue
Block a user