"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = (0, tslib_1.__importStar)(require("react"));
var weui_1 = (0, tslib_1.__importDefault)(require("../../utils/weui"));
var classnames_1 = (0, tslib_1.__importDefault)(require("../../utils/classnames"));
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_1.default.picker(hour, min, sec, {
            onChange: function () {
                // console.log(result);
            },
            onConfirm: function () {
                // console.log(result);
            },
            title: title,
            defaultValue: fixedDefaultValue,
        });
    };
    var cls = (0, classnames_1.default)((_a = {
            'weda-ui': true,
            'weda-time-picker': true
        },
        _a[className] = className,
        _a));
    return (React.createElement("div", { className: cls, onClick: click }, children));
}
exports.default = TimePicker;
//# sourceMappingURL=timePicker.js.map