import * as React from 'react';
import weui from '../../utils/weui';
import classNames from '../../utils/classnames';
export default function TimePicker(props) {
    var _a;
    var title = props.title, defaultValue = props.defaultValue, children = props.children, className = props.className;
    var click = function () {
        var hour = [];
        var min = [];
        var sec = [];
        for (var i = 0; i < 60; i++) {
            if (i < 24) {
                hour.push({ label: i, value: i });
            }
            min.push({ label: i, value: i });
            sec.push({ label: i, value: i });
        }
        var fixedDefaultValue;
        if (defaultValue) {
            fixedDefaultValue = defaultValue.split(':');
        }
        else {
            var now = new Date();
            fixedDefaultValue = [now.getHours(), now.getMinutes(), now.getSeconds()];
        }
        weui.picker(hour, min, sec, {
            onChange: function () {
                // console.log(result);
            },
            onConfirm: function () {
                // console.log(result);
            },
            title: title,
            defaultValue: fixedDefaultValue,
        });
    };
    var cls = classNames((_a = {
            'weda-ui': true,
            'weda-time-picker': true
        },
        _a[className] = className,
        _a));
    return (React.createElement("div", { className: cls, onClick: click }, children));
}
//# sourceMappingURL=timePicker.js.map