-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,10 +46,6 @@ interface FormProps { | |
widths?: 'equal'; | ||
} | ||
|
||
interface FormOnSubmitData extends FormProps { | ||
formData: {[key: string]: any}; | ||
} | ||
|
||
interface FormClass extends React.ComponentClass<FormProps> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cruft. |
||
Field: typeof FormField; | ||
Button: typeof FormButton; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -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. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.