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

fix(Dropdown|Select|Form): fixes in typings #1401

Merged
merged 1 commit into from
Mar 1, 2017
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
1 change: 0 additions & 1 deletion src/addons/Select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from '../../modules/Dropdown';

export interface SelectProps extends DropdownProps {
selection: true;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true is not valid type, so it's cruft.


interface SelectComponent extends React.StatelessComponent<SelectProps> {
Expand Down
4 changes: 0 additions & 4 deletions src/collections/Form/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ interface FormProps {
widths?: 'equal';
}

interface FormOnSubmitData extends FormProps {
formData: {[key: string]: any};
}

interface FormClass extends React.ComponentClass<FormProps> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cruft.

Field: typeof FormField;
Button: typeof FormButton;
Expand Down
20 changes: 10 additions & 10 deletions src/modules/Dropdown/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,71 +106,71 @@ export interface DropdownProps {
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onBlur: (event: React.KeyboardEvent<HTMLElement>, data: DropdownProps) => void;
onBlur?: (event: React.KeyboardEvent<HTMLElement>, data: DropdownProps) => void;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prop is optional


/**
* Called when the user attempts to change the value.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed value.
*/
onChange: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;
onChange?: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: (event: React.KeyboardEvent<HTMLElement>, data: DropdownProps) => void;
onClick?: (event: React.KeyboardEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called when a close event happens.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;
onClose?: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called on focus.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onFocus: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;
onFocus?: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called when a multi-select label is clicked.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All label props.
*/
onLabelClick: (event: React.MouseEvent<HTMLElement>, data: LabelProps) => void;
onLabelClick?: (event: React.MouseEvent<HTMLElement>, data: LabelProps) => void;

/**
* Called on mousedown.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onMouseDown: (event: React.MouseEvent<HTMLElement>, data: DropdownProps) => void;
onMouseDown?: (event: React.MouseEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called when an open event happens.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;
onOpen?: (event: React.SyntheticEvent<HTMLElement>, data: DropdownProps) => void;

/**
* Called on search input change.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {string} value - Current value of search input.
*/
onSearchChange: (event: React.SyntheticEvent<HTMLElement>, value: string) => void;
onSearchChange?: (event: React.SyntheticEvent<HTMLElement>, value: string) => void;

/** Controls whether or not the dropdown menu is displayed. */
open?: boolean;
Expand Down Expand Up @@ -305,7 +305,7 @@ interface DropdownItemProps {
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: (event: React.MouseEvent<HTMLDivElement>, data: DropdownItemProps) => void;
onClick?: (event: React.MouseEvent<HTMLDivElement>, data: DropdownItemProps) => void;

/**
* The item currently selected by keyboard shortcut.
Expand Down