"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

require("./Confirm.css");

var _Modal = _interopRequireDefault(require("../Modal"));

var _Button = _interopRequireDefault(require("../Button"));

var _Icon = _interopRequireDefault(require("../Icon"));

var _component = require("../_utils/component");

var _vueNormalizeComponent = _interopRequireDefault(require("../_utils/vue-normalize-component.js"));

/* script */
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var __vue_script__ = {
  name: (0, _component.createComponentName)('confirm'),
  components: {
    Modal: _Modal.default,
    Button: _Button.default,
    Icon: _Icon.default
  },
  mixins: [_component.componentMixin],
  props: {
    onCancel: {
      type: Function
    },
    afterClose: {
      type: Function
    },
    title: {
      type: String,
      default: ''
    },
    subTitle: {
      type: String,
      default: ''
    },
    width: {
      type: String,
      default: '453px'
    },
    content: {
      type: [String, Object],
      default: ''
    },
    keyborad: {
      type: Boolean,
      default: false
    },
    mask: {
      type: Boolean,
      default: false
    },
    maskClosable: {
      type: Boolean,
      default: false
    },
    // 居中
    centered: {
      type: Boolean,
      default: true
    },
    visible: {
      type: Boolean,
      default: false
    },
    onOk: {
      type: Function
    },
    type: {
      type: String,
      default: 'success'
    },
    okText: {
      type: String
    },
    // 取消按钮文字
    cancelText: {
      type: String
    },
    time: {
      type: Number
    }
  },

  mounted() {
    var _this = this;

    if (this.time) {
      setTimeout(function () {
        _this.onCancel();
      }, this.time);
    }
  }

};
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c("Modal", {
    class: _vm.bem("modal"),
    attrs: {
      visible: _vm.visible,
      onCancel: _vm.onCancel,
      mask: _vm.mask,
      afterClose: _vm.afterClose,
      maskClosable: _vm.maskClosable,
      keyborad: _vm.keyborad,
      onOk: _vm.onOk,
      centered: _vm.centered,
      width: _vm.width
    }
  }, [_c("div", {
    class: _vm.bem()
  }, [_c("Icon", {
    class: _vm.bem("icon"),
    attrs: {
      name: _vm.type
    }
  }), _vm._v(" "), _vm.title ? _c("div", {
    class: _vm.bem("title")
  }, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._v(" "), _vm.subTitle ? _c("div", {
    class: _vm.bem("sub-title")
  }, [_vm._v(_vm._s(_vm.subTitle))]) : _vm._e(), _vm._v(" "), _vm.content ? _c("div", [_vm._v(_vm._s(_vm.content))]) : _vm._e(), _vm._v(" "), _vm.okText || _vm.cancelText ? _c("div", {
    class: _vm.bem("buttons")
  }, [_vm.okText ? _c("Button", {
    attrs: {
      rect: "",
      type: "primary"
    },
    on: {
      click: _vm.onOk
    }
  }, [_vm._v("\n                " + _vm._s(_vm.okText) + "\n            ")]) : _vm._e(), _vm._v(" "), _vm.cancelText ? _c("Button", {
    attrs: {
      rect: ""
    },
    on: {
      click: _vm.onCancel
    }
  }, [_vm._v("\n                " + _vm._s(_vm.cancelText) + "\n            ")]) : _vm._e()], 1) : _vm._e()], 1)]);
};

var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = undefined;
/* module identifier */

var __vue_module_identifier__ = undefined;
/* functional template */

var __vue_is_functional_template__ = false;
/* component normalizer */

/* style inject */

/* style inject SSR */
var _default = (0, _vueNormalizeComponent.default)({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined);

exports.default = _default;