var _jsxFileName = 'src/datePicker/components/date.jsx';
/**
 * date.jsx
 *
 * @Author: apple
 * @Date: 2018/6/29 11:17
 */

import React from 'react';
import PropTypes from 'prop-types';
import Tooltip from '../../tooltip';

function Date(props) {
    var prefixClsDatePicker = props.prefixClsDatePicker,
        onlyTimeValue = props.onlyTimeValue,
        inputProps = props.inputProps,
        inputClass = props.inputClass,
        clearBtn = props.clearBtn,
        singleDisableExquisiteTimeRules = props.singleDisableExquisiteTimeRules,
        type = props.type,
        renderDtItem = props.renderDtItem,
        renderInput = props.renderInput,
        handleActive = props.handleActive,
        _autoTest_isOpen = props._autoTest_isOpen;

    var readyRenderInput = renderInput();
    var readyRenderDtItem = renderDtItem();
    return React.createElement(
        'div',
        { className: prefixClsDatePicker, __source: {
                fileName: _jsxFileName,
                lineNumber: 29
            },
            __self: this
        },
        React.createElement(
            Tooltip,
            {
                position: 'bottom',
                trigger: 'click',
                className: 'dp-panel',
                autoAdjustPosition: true,
                isOpen: _autoTest_isOpen,
                content: React.createElement(
                    'div',
                    {
                        className: prefixClsDatePicker + '-input-item',
                        onMouseEnter: function onMouseEnter() {
                            return handleActive(true);
                        },
                        onMouseLeave: function onMouseLeave() {
                            return handleActive(false);
                        }, __source: {
                            fileName: _jsxFileName,
                            lineNumber: 37
                        },
                        __self: this
                    },
                    readyRenderInput({
                        defaultValue: onlyTimeValue,
                        inputProps: inputProps[0],
                        className: inputClass
                    }),
                    clearBtn()
                ), __source: {
                    fileName: _jsxFileName,
                    lineNumber: 30
                },
                __self: this
            },
            readyRenderDtItem({
                currentTime: onlyTimeValue,
                disableExquisiteTimeRules: singleDisableExquisiteTimeRules,
                type: type,
                switchType: type
            })
        )
    );
}

Date.propTypes = {
    prefixClsDatePicker: PropTypes.string,
    onlyTimeValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),
    inputProps: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
    inputClass: PropTypes.string,
    clearBtn: PropTypes.func,
    singleDisableExquisiteTimeRules: PropTypes.object,
    type: PropTypes.string,
    renderDtItem: PropTypes.func,
    renderInput: PropTypes.func,
    onActive: PropTypes.func
};
export default Date;