import { __assign, __extends, __rest } from "tslib";
import { Balloon, Button, Icon } from '@alicloud/console-components';
import React from 'react';
import classnames from 'classnames';
var BalloonConfirm = /** @class */ (function (_super) {
    __extends(BalloonConfirm, _super);
    function BalloonConfirm(props) {
        var _this = _super.call(this, props) || this;
        _this.clickTrigger = function () {
            _this.setState({ visible: true });
        };
        _this.onOK = function () {
            _this.setState({ visible: false });
            _this.props.onOK && _this.props.onOK();
        };
        _this.onCancel = function () {
            _this.setState({ visible: false });
            _this.props.onCancel && _this.props.onCancel();
        };
        _this.onClose = function () {
            _this.setState({ visible: false });
            _this.props.onClose && _this.props.onClose();
        };
        _this.state = {
            visible: false
        };
        return _this;
    }
    BalloonConfirm.prototype.render = function () {
        var _this = this;
        var _a = this.props, title = _a.title, description = _a.description, iconType = _a.iconType, iconSize = _a.iconSize, iconColor = _a.iconColor, local = _a.local, className = _a.className, onOK = _a.onOK, onCancel = _a.onCancel, _b = _a.okProps, okProps = _b === void 0 ? {} : _b, _c = _a.cancelProps, cancelProps = _c === void 0 ? {} : _c, rest = __rest(_a, ["title", "description", "iconType", "iconSize", "iconColor", "local", "className", "onOK", "onCancel", "okProps", "cancelProps"]);
        return (React.createElement(Balloon, __assign({ autoFocus: false, className: classnames("lp-balloon-confirm", className), visible: this.state.visible, onVisibleChange: function (visible) { _this.setState({ visible: visible }); } }, rest),
            React.createElement("div", { className: "lp-balloon-confirm-content" },
                React.createElement("p", { className: "title" },
                    React.createElement(Icon, { type: iconType, size: iconSize, className: "icon", style: { color: iconColor } }),
                    React.createElement("span", { className: "text" }, title)),
                React.createElement("div", { className: "desc" }, description),
                React.createElement("div", { className: "footer" },
                    React.createElement(Button, __assign({ type: "primary", onClick: this.onOK }, okProps), local.ok),
                    "\u00A0\u00A0",
                    React.createElement(Button, __assign({ type: "normal", onClick: this.onCancel }, cancelProps), local.cancel)))));
    };
    return BalloonConfirm;
}(React.Component));
BalloonConfirm.defaultProps = {
    align: 'tl',
    style: { maxWidth: '404px', padding: '20px' },
    triggerType: 'click',
    iconType: 'warning',
    iconSize: 'small',
    iconColor: '#FF8A00',
    local: {
        ok: "确认",
        cancel: "取消"
    }
};
export default BalloonConfirm;
