Skip to content

Commit

Permalink
fix(Dropdown|Select|Form): fixes in typings (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored and levithomason committed Mar 1, 2017
1 parent 768f97c commit c7bdf53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
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;
}

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> {
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;

/**
* 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

0 comments on commit c7bdf53

Please sign in to comment.