Get tests passing again

This commit is contained in:
Ryan Cavanaugh
2016-07-27 20:45:08 -07:00
parent ca19fab9cf
commit 29ba4b7a42
8 changed files with 25 additions and 19 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ class StyleButton extends React.Component<{key: string, active: boolean, label:
}
return (
<span className={className} onMouseDown={this.onToggle}>
<span className={className} onMouseDown={e => this.onToggle(e as any)}>
{this.props.label}
</span>
);
+11 -2
View File
@@ -8,7 +8,7 @@ export = ReactBootstrap;
declare namespace ReactBootstrap {
type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'lg' | 'large';
type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large';
// Change onSelect signature to be (eventKey: any, event: SyntheticEvent<{}>) => any on all React-Bootstrap components, instead of the old inconsistent mishmash (#1604, #1677, #1756)
@@ -307,6 +307,13 @@ declare namespace ReactBootstrap {
// <Modal.Dialog />
interface ModalDialogProps extends React.HTMLProps<ModalDialog> {
// TODO: Add more specific type
onHide?: Function;
onEnter?: Function;
onEntered?: Function;
onEntering?: Function;
onExit?: Function;
onExited?: Function;
onExiting?: Function;
}
type ModalDialog = React.ClassicComponent<ModalDialogProps, {}>;
var ModalDialog: React.ClassicComponentClass<ModalDialogProps>;
@@ -569,11 +576,13 @@ declare namespace ReactBootstrap {
interface NavDropdownBaseProps
extends DropdownBaseProps {
noCaret?: boolean;
eventKey?: any;
}
type NavDropdownProps = NavDropdownBaseProps & React.HTMLProps<NavDropdown>;
class NavDropdown
extends React.Component<NavDropdownProps, {}>
{ }
{
}
// <Tabs />
+1 -1
View File
@@ -170,7 +170,7 @@ export class ReactBootstrapTest extends Component<any, any> {
</div>
<div style={style}>
<DropdownButton bsStyle={'default'} title={'hello'} key={0} id={0}>
<DropdownButton bsStyle={'default'} title={'hello'} key={0} id={"0"}>
<MenuItem eventKey='1'>Action</MenuItem>
<MenuItem eventKey='2'>Another action</MenuItem>
<MenuItem eventKey='3' active>Active Item</MenuItem>
+2 -2
View File
@@ -395,7 +395,7 @@ declare namespace __ReactMDL {
title ?: string;
}
interface HeaderProps extends __MDLOtherProps {
title ?: string;
title ?: any; // string | JSX.Element
scroll ?: boolean;
seamed ?: boolean;
transparent ?: boolean;
@@ -412,7 +412,7 @@ declare namespace __ReactMDL {
interface LayoutProps extends __MDLOtherProps {
fixedDrawer ?: boolean;
fixedHeader ?: boolean;
fixedTabse ?: boolean;
fixedTabs ?: boolean;
}
interface NavigationProps extends __MDLOtherProps {}
class Content extends __MDLComponent<ContentProps> {}
+3 -3
View File
@@ -166,7 +166,7 @@ React.createClass({
<Card shadow={0} style={{width: '256px', height: '256px', background: 'url(http://www.getmdl.io/assets/demos/image_card.jpg) center / cover', margin: 'auto'}}>
<CardTitle expand />
<CardActions style={{height: '52px', padding: '16px', background: 'rgba(0,0,0,0.2)'}}>
<span style={{color: '#fff', fontSize: '14px', fontWeight: '500'}}>
<span style={{color: '#fff', fontSize: '14px', fontWeight: 500 }}>
Image.jpg
</span>
</CardActions>
@@ -310,8 +310,8 @@ React.createClass({
</div>
<div>
<Button colored onClick={this.handleOpenDialog} onCancel={this.handleCloseDialog} raised ripple>Show Dialog</Button>
<Dialog open={this.state.openDialog} onCancel={this.handleCloseDialog}>
<Button colored onClick={this.handleOpenDialog} onAbort={this.handleCloseDialog} raised ripple>Show Dialog</Button>
<Dialog open={this.state.openDialog} onAbort={this.handleCloseDialog}>
<DialogTitle>Allow data collection?</DialogTitle>
<DialogContent>
<p>Allowing us to collect data will let us get you the information you want faster.</p>
+1 -1
View File
@@ -2032,7 +2032,7 @@ declare namespace React {
title?: string;
type?: string;
useMap?: string;
value?: string | string[];
value?: string | string[] | number;
width?: number | string;
wmode?: string;
wrap?: string;
+2 -5
View File
@@ -3,11 +3,7 @@
// Definitions by: Daniel Lytkin <https://github.com/aikoven>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="react" />
/// <reference types="redux" />
import * as React from 'react';
import { Component, SyntheticEvent, FormEventHandler } from 'react';
import { Dispatch, ActionCreator, Reducer } from 'redux';
@@ -191,6 +187,7 @@ export interface ReduxFormProps<T> {
* given as the error prop.
*/
handleSubmit?(event: SyntheticEvent<T>): void;
handleSubmit?(event: React.MouseEvent<HTMLButtonElement>): void;
handleSubmit?(submit: (data: FormData, dispatch?: Dispatch<any>) => Promise<any> | void): FormEventHandler<T>;
/**
+4 -4
View File
@@ -8,7 +8,7 @@ import {reduxForm, reducer as reduxFormReducer, ReduxFormProps} from 'redux-form
namespace SimpleForm {
export const fields = ['firstName', 'lastName', 'email', 'sex', 'favoriteColor', 'employed', 'notes'];
class SimpleForm extends Component<ReduxFormProps<SimpleForm>, void> {
class SimpleForm extends Component<ReduxFormProps<SimpleForm & HTMLFormElement>, void> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
@@ -123,7 +123,7 @@ namespace SynchronousValidation {
return errors;
};
class SynchronousValidationForm extends Component<ReduxFormProps<SynchronousValidationForm>, any> {
class SynchronousValidationForm extends Component<ReduxFormProps<SynchronousValidationForm & HTMLFormElement>, any> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,
@@ -204,7 +204,7 @@ namespace SumbitValidation {
render() {
const {fields: {username, password}, error, resetForm, handleSubmit, submitting} = this.props;
return (<form onSubmit={handleSubmit(submit)}>
return (<form onSubmit={submit => handleSubmit(submit as any)}>
<div>
<label>Username</label>
<div>
@@ -255,7 +255,7 @@ namespace InitializingFromState {
load: Function;
}
class InitializingFromStateForm extends Component<Props<InitializingFromStateForm>, any> {
class InitializingFromStateForm extends Component<Props<InitializingFromStateForm & HTMLFormElement>, any> {
static propTypes = {
fields: PropTypes.object.isRequired,
handleSubmit: PropTypes.func.isRequired,