import * as tslib_1 from "tslib";
import React from 'react';
import classnames from 'classnames';
import InputGroup from './input-group';
import InputGroupAddon from './input-group-addon';
import InputGroupButton from './input-group-button';
var defaultProps = {
    prefixCls: 'ty-input',
    size: 'md',
    disabled: false,
    block: false,
};
var Input = function (props) {
    var _a;
    var defaultValue = props.defaultValue, value = props.value, onChange = props.onChange, size = props.size, block = props.block, onEnterPress = props.onEnterPress, onKeyDown = props.onKeyDown, disabled = props.disabled, prefixCls = props.prefixCls, className = props.className, style = props.style, restProps = tslib_1.__rest(props, ["defaultValue", "value", "onChange", "size", "block", "onEnterPress", "onKeyDown", "disabled", "prefixCls", "className", "style"]);
    var cls = classnames(prefixCls, className, prefixCls + "_" + size, (_a = {},
        _a[prefixCls + "_disabled"] = disabled,
        _a[prefixCls + "_block"] = block,
        _a));
    var _inputOnChange = function (e) {
        onChange && onChange(e.currentTarget.value, e);
    };
    var _inputOnKeydown = function (e) {
        if (e.keyCode === 13) {
            onEnterPress && onEnterPress(e);
        }
        onKeyDown && onKeyDown(e);
    };
    return (React.createElement("input", tslib_1.__assign({ defaultValue: defaultValue, value: value, disabled: disabled, className: cls, style: style, onChange: _inputOnChange, onKeyDown: _inputOnKeydown }, restProps)));
};
Input.defaultProps = defaultProps;
Input.Group = InputGroup;
Input.Addon = InputGroupAddon;
Input.Button = InputGroupButton;
export default Input;
//# sourceMappingURL=index.js.map