Merge branch 'dev' of github.com:soyjavi/react-toolbox into dev

* 'dev' of github.com:soyjavi/react-toolbox:
  Added missing modules
  Remove prop duplicates
  Added Touch events to the base props
  Fixes for typescript definitions, typos etc.
  fix for target missing id
old
Javi Velasco 2016-08-11 17:47:28 +02:00
commit b43a7a1ed3
37 changed files with 150 additions and 122 deletions

View File

@ -70,7 +70,7 @@ interface AutocompleteProps extends __ReactToolbox.Props {
* Callback function that is fired when the components's value changes.
* @default auto
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Determines if the selected list is shown above or below input. It can be above or below.
* @default above

View File

@ -102,14 +102,6 @@ interface ButtonProps extends __ReactToolbox.Props {
* @default true
*/
neutral?: boolean;
/**
* Fires after the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Fires after the mouse is released from the Component.
*/
OnMouseUp?: __React.MouseEventHandler;
/**
* Indicates if the button should have primary color.
* @default false
@ -200,14 +192,6 @@ interface IconButtonProps extends __ReactToolbox.Props {
* @default true
*/
neutral?: boolean;
/**
* Fires after the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Fires after the mouse is released from the Component.
*/
OnMouseUp?: __React.MouseEventHandler;
/**
* Indicates if the button should have primary color.
* @default false

View File

@ -53,11 +53,11 @@ interface CheckboxProps extends __ReactToolbox.Props {
/**
* Callback called when the checkbox is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback called when the checkbox value is changed.
*/
onChange?: __React.MouseEventHandler;
onChange?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -40,7 +40,7 @@ interface ChipProps extends __ReactToolbox.Props {
/**
* Callback to be invoked when the delete icon is clicked.
*/
onDeleteClick?: __React.MouseEventHandler;
onDeleteClick?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -124,15 +124,15 @@ interface DatePickerProps extends __ReactToolbox.Props {
/**
* Callback called when the picker value is changed.
*/
onChange?: __React.MouseEventHandler;
onChange?: Function;
/**
* Callback called when the ESC key is pressed with the overlay active.
*/
onEscKeyDown?: __React.KeyboardEventHandler;
onEscKeyDown?: Function;
/**
* Callback to be invoked when the dialog overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -35,7 +35,7 @@ interface DialogActionProps {
/**
* Callback called when the component is clicked.
*/
onClick?: __React.MouseEventHandler;
onClick?: Function;
}
interface DialogProps extends __ReactToolbox.Props {
@ -55,23 +55,23 @@ interface DialogProps extends __ReactToolbox.Props {
/**
* Callback called when the ESC key is pressed with the overlay active.
*/
onEscKeyDown?: __React.KeyboardEventHandler;
onEscKeyDown?: Function;
/**
* Callback to be invoked when the dialog overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Callback called when the mouse button is pressed on the overlay.
*/
onOverlayMouseDown?: __React.MouseEventHandler;
onOverlayMouseDown?: Function;
/**
* Callback called when the mouse is moving over the overlay.
*/
onOverlayMouseMove?: __React.MouseEventHandler;
onOverlayMouseMove?: Function;
/**
* Callback called when the mouse button is released over the overlay.
*/
onOverlayMouseUp?: __React.MouseEventHandler;
onOverlayMouseUp?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -36,7 +36,7 @@ interface DrawerProps extends __ReactToolbox.Props {
/**
* Callback function to be invoked when the overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -82,15 +82,15 @@ interface DropdownProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when the component is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when the component is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Array of data objects with the data to represent in the dropdown.
*/

35
components/index.d.ts vendored
View File

@ -11,7 +11,40 @@ export declare namespace __ReactToolbox {
/**
* Callback called when the component is clicked.
*/
onClick?: __React.MouseEventHandler;
onClick?: Function;
/**
* Fires after the mouse is released from the Component.
*/
onMouseUp?: Function;
/**
* Callback called when the mouse enters the Component.
*/
onMouseEnter?: Function;
/**
* Callback called when the mouse leaves the Component.
*/
onMouseLeave?: Function;
/**
* Callback called when the mouse press the Component.
*/
onMouseDown?: Function;
onContextMenu?: Function;
onDoubleClick?: Function;
onDrag?: Function;
onDragEnd?: Function;
onDragEnter?: Function;
onDragExit?: Function;
onDragLeave?: Function;
onDragOver?: Function;
onDragStart?: Function;
onDrop?: Function;
onMouseMove?: Function;
onMouseOut?: Function;
onMouseOver?: Function;
onTouchCancel?: Function;
onTouchEnd?: Function;
uchMove?: Function;
onTouchStart?: Function;
/**
* Set inline style for the root component.
*/

View File

@ -90,7 +90,7 @@ interface InputProps extends __ReactToolbox.Props {
* If true, a textarea element will be rendered. The textarea also grows and shrinks according to the number of lines.
* @default false
*/
multiLine?: boolean;
multiline?: boolean;
/**
* Name for the input field.
*/
@ -98,19 +98,19 @@ interface InputProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when component is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when component is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Callback function that is fired when a key is pressed.
*/
onKeyPress?: __React.MouseEventHandler;
onKeyPress?: Function;
/**
* If true, the html input has a required attribute.
* @default false

View File

@ -88,7 +88,7 @@ interface NavDrawerProps extends __ReactToolbox.Props {
/**
* Callback function to be invoked when the overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* The breakpoint at which the drawer is automatically pinned.
*/

View File

@ -91,15 +91,15 @@ interface ListCheckboxProps extends __ReactToolbox.Props {
/**
* Callback called when the input element is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback called when the input element is changed.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback called when the input element is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -21,7 +21,7 @@ interface RadioGroupProps extends __ReactToolbox.Props {
/**
* Default value selected in the radio group.
*/
value?: number;
value?: any;
}
export class RadioGroup extends __React.Component<RadioGroupProps, {}> { }
@ -79,15 +79,15 @@ interface RadioButtonProps extends __ReactToolbox.Props {
/**
* Callback function that will be invoked when the input is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that will be invoked when the value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that will be invoked when the input is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -57,15 +57,15 @@ interface SwitchProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when when the switch is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when the switch is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -40,7 +40,7 @@ interface TableProps extends __ReactToolbox.Props {
/**
* Callback function invoked when the row selection changes.
*/
onSelect?: __React.FormEventHandler;
onSelect?: Function;
/**
* If true, each row will display a checkbox to allow the user to select that one row.
* @default true

View File

@ -41,7 +41,7 @@ const factory = (Tab, TabContent) => {
}
handleHeaderClick = (event) => {
const idx = parseInt(event.target.id);
const idx = parseInt(event.currentTarget.id);
if (this.props.onChange) this.props.onChange(idx);
};

View File

@ -100,6 +100,10 @@ interface TimePickerProps {
* Provide error text which will be displayed under the field.
*/
error?: string;
/**
* A key to identify an Icon from Material Design Icons or a custom Icon Element.
*/
icon?: __React.ReactNode | string;
/**
* This class will be applied to Input component of TimePicker.
*/

View File

@ -14,14 +14,6 @@ export interface TooltipTheme {
}
interface TooltipProps {
/**
* Callback called when the mouse enters the Component.
*/
onMouseEnter?: __React.MouseEventHandler;
/**
* Callback called when the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Classnames object defining the component style.
*/

View File

@ -70,7 +70,7 @@ interface AutocompleteProps extends __ReactToolbox.Props {
* Callback function that is fired when the components's value changes.
* @default auto
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Determines if the selected list is shown above or below input. It can be above or below.
* @default above

16
lib/button/index.d.ts vendored
View File

@ -102,14 +102,6 @@ interface ButtonProps extends __ReactToolbox.Props {
* @default true
*/
neutral?: boolean;
/**
* Fires after the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Fires after the mouse is released from the Component.
*/
OnMouseUp?: __React.MouseEventHandler;
/**
* Indicates if the button should have primary color.
* @default false
@ -200,14 +192,6 @@ interface IconButtonProps extends __ReactToolbox.Props {
* @default true
*/
neutral?: boolean;
/**
* Fires after the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Fires after the mouse is released from the Component.
*/
OnMouseUp?: __React.MouseEventHandler;
/**
* Indicates if the button should have primary color.
* @default false

View File

@ -53,11 +53,11 @@ interface CheckboxProps extends __ReactToolbox.Props {
/**
* Callback called when the checkbox is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback called when the checkbox value is changed.
*/
onChange?: __React.MouseEventHandler;
onChange?: Function;
/**
* Classnames object defining the component style.
*/

2
lib/chip/index.d.ts vendored
View File

@ -40,7 +40,7 @@ interface ChipProps extends __ReactToolbox.Props {
/**
* Callback to be invoked when the delete icon is clicked.
*/
onDeleteClick?: __React.MouseEventHandler;
onDeleteClick?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -124,15 +124,15 @@ interface DatePickerProps extends __ReactToolbox.Props {
/**
* Callback called when the picker value is changed.
*/
onChange?: __React.MouseEventHandler;
onChange?: Function;
/**
* Callback called when the ESC key is pressed with the overlay active.
*/
onEscKeyDown?: __React.KeyboardEventHandler;
onEscKeyDown?: Function;
/**
* Callback to be invoked when the dialog overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Classnames object defining the component style.
*/

12
lib/dialog/index.d.ts vendored
View File

@ -35,7 +35,7 @@ interface DialogActionProps {
/**
* Callback called when the component is clicked.
*/
onClick?: __React.MouseEventHandler;
onClick?: Function;
}
interface DialogProps extends __ReactToolbox.Props {
@ -55,23 +55,23 @@ interface DialogProps extends __ReactToolbox.Props {
/**
* Callback called when the ESC key is pressed with the overlay active.
*/
onEscKeyDown?: __React.KeyboardEventHandler;
onEscKeyDown?: Function;
/**
* Callback to be invoked when the dialog overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Callback called when the mouse button is pressed on the overlay.
*/
onOverlayMouseDown?: __React.MouseEventHandler;
onOverlayMouseDown?: Function;
/**
* Callback called when the mouse is moving over the overlay.
*/
onOverlayMouseMove?: __React.MouseEventHandler;
onOverlayMouseMove?: Function;
/**
* Callback called when the mouse button is released over the overlay.
*/
onOverlayMouseUp?: __React.MouseEventHandler;
onOverlayMouseUp?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -36,7 +36,7 @@ interface DrawerProps extends __ReactToolbox.Props {
/**
* Callback function to be invoked when the overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -82,15 +82,15 @@ interface DropdownProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when the component is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when the component is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Array of data objects with the data to represent in the dropdown.
*/

35
lib/index.d.ts vendored
View File

@ -11,7 +11,40 @@ export declare namespace __ReactToolbox {
/**
* Callback called when the component is clicked.
*/
onClick?: __React.MouseEventHandler;
onClick?: Function;
/**
* Fires after the mouse is released from the Component.
*/
onMouseUp?: Function;
/**
* Callback called when the mouse enters the Component.
*/
onMouseEnter?: Function;
/**
* Callback called when the mouse leaves the Component.
*/
onMouseLeave?: Function;
/**
* Callback called when the mouse press the Component.
*/
onMouseDown?: Function;
onContextMenu?: Function;
onDoubleClick?: Function;
onDrag?: Function;
onDragEnd?: Function;
onDragEnter?: Function;
onDragExit?: Function;
onDragLeave?: Function;
onDragOver?: Function;
onDragStart?: Function;
onDrop?: Function;
onMouseMove?: Function;
onMouseOut?: Function;
onMouseOver?: Function;
onTouchCancel?: Function;
onTouchEnd?: Function;
uchMove?: Function;
onTouchStart?: Function;
/**
* Set inline style for the root component.
*/

10
lib/input/index.d.ts vendored
View File

@ -90,7 +90,7 @@ interface InputProps extends __ReactToolbox.Props {
* If true, a textarea element will be rendered. The textarea also grows and shrinks according to the number of lines.
* @default false
*/
multiLine?: boolean;
multiline?: boolean;
/**
* Name for the input field.
*/
@ -98,19 +98,19 @@ interface InputProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when component is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when component is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Callback function that is fired when a key is pressed.
*/
onKeyPress?: __React.MouseEventHandler;
onKeyPress?: Function;
/**
* If true, the html input has a required attribute.
* @default false

View File

@ -88,7 +88,7 @@ interface NavDrawerProps extends __ReactToolbox.Props {
/**
* Callback function to be invoked when the overlay is clicked.
*/
onOverlayClick?: __React.MouseEventHandler;
onOverlayClick?: Function;
/**
* The breakpoint at which the drawer is automatically pinned.
*/

6
lib/list/index.d.ts vendored
View File

@ -91,15 +91,15 @@ interface ListCheckboxProps extends __ReactToolbox.Props {
/**
* Callback called when the input element is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback called when the input element is changed.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback called when the input element is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -21,7 +21,7 @@ interface RadioGroupProps extends __ReactToolbox.Props {
/**
* Default value selected in the radio group.
*/
value?: number;
value?: any;
}
export class RadioGroup extends __React.Component<RadioGroupProps, {}> { }
@ -79,15 +79,15 @@ interface RadioButtonProps extends __ReactToolbox.Props {
/**
* Callback function that will be invoked when the input is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that will be invoked when the value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that will be invoked when the input is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -57,15 +57,15 @@ interface SwitchProps extends __ReactToolbox.Props {
/**
* Callback function that is fired when when the switch is blurred.
*/
onBlur?: __React.FocusEventHandler;
onBlur?: Function;
/**
* Callback function that is fired when the component's value changes.
*/
onChange?: __React.FormEventHandler;
onChange?: Function;
/**
* Callback function that is fired when the switch is focused.
*/
onFocus?: __React.FocusEventHandler;
onFocus?: Function;
/**
* Classnames object defining the component style.
*/

View File

@ -40,7 +40,7 @@ interface TableProps extends __ReactToolbox.Props {
/**
* Callback function invoked when the row selection changes.
*/
onSelect?: __React.FormEventHandler;
onSelect?: Function;
/**
* If true, each row will display a checkbox to allow the user to select that one row.
* @default true

View File

@ -53,7 +53,7 @@ var factory = function factory(Tab, TabContent) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Tabs)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.state = {
pointer: {}
}, _this.handleHeaderClick = function (event) {
var idx = parseInt(event.target.id);
var idx = parseInt(event.currentTarget.id);
if (_this.props.onChange) _this.props.onChange(idx);
}, _temp), _possibleConstructorReturn(_this, _ret);
}

View File

@ -100,6 +100,10 @@ interface TimePickerProps {
* Provide error text which will be displayed under the field.
*/
error?: string;
/**
* A key to identify an Icon from Material Design Icons or a custom Icon Element.
*/
icon?: __React.ReactNode | string;
/**
* This class will be applied to Input component of TimePicker.
*/

View File

@ -14,14 +14,6 @@ export interface TooltipTheme {
}
interface TooltipProps {
/**
* Callback called when the mouse enters the Component.
*/
onMouseEnter?: __React.MouseEventHandler;
/**
* Callback called when the mouse leaves the Component.
*/
onMouseLeave?: __React.MouseEventHandler;
/**
* Classnames object defining the component style.
*/

View File

@ -76,9 +76,11 @@
"phantomjs-prebuilt": "^2.1.7",
"postcss-loader": "^0.9.1",
"react": "^15.2.1",
"react-addons-test-utils": "^15.0.2",
"react-addons-update": "^15.2.1",
"react-addons-test-utils": "^15.2.1",
"react-addons-css-transition-group": "^15.2.1",
"react-docgen": "^2.8.2",
"react-dom": "^15.2.0",
"react-dom": "^15.2.1",
"react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4",
"redbox-react": "^1.2.4",