"use strict";

var _box = _interopRequireDefault(require("../../box"));

var _button = _interopRequireDefault(require("../../button"));

var _configProvider = _interopRequireDefault(require("../../config-provider"));

var _ = _interopRequireDefault(require(".."));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var popupAlert = function popupAlert() {
  _["default"].alert({
    title: 'Alert',
    content: 'alert content alert content...',
    okProps: {
      children: 'Custom OK'
    },
    cancelProps: {
      children: 'Custom cancel'
    },
    onOk: function onOk() {
      return console.log('alert ok');
    }
  });
};

var popupConfirm = function popupConfirm() {
  _["default"].confirm({
    title: 'Confirm',
    content: 'confirm content confirm content...',
    locale: {
      ok: '这是确定',
      cancel: '这是取消'
    },
    onOk: function onOk() {
      return console.log('confirm ok');
    },
    onCancel: function onCancel() {
      return console.log('confirm cancel');
    }
  });
};

var popupShow = function popupShow() {
  var dialog = _["default"].show({
    title: 'Custom',
    content: 'custom content custom content...',
    footer: /*#__PURE__*/_react["default"].createElement(_button["default"], {
      warning: true,
      type: "primary",
      onClick: function onClick() {
        return dialog.hide();
      }
    }, "Custom button")
  });
};

var popupCustomIcon = function popupCustomIcon() {
  _["default"].confirm({
    title: 'Confirm',
    content: 'set icon as "warning" ',
    messageProps: {
      type: 'warning'
    },
    onOk: function onOk() {
      return console.log('ok');
    },
    onCancel: function onCancel() {
      return console.log('cancel');
    }
  });
};

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_configProvider["default"], {
  locale: {
    Dialog: {
      ok: 'OK',
      cancel: 'Cancel'
    }
  }
}, /*#__PURE__*/_react["default"].createElement(_box["default"], {
  direction: "row",
  spacing: 20
}, /*#__PURE__*/_react["default"].createElement(_button["default"], {
  onClick: popupAlert
}, "Alert"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
  onClick: popupConfirm
}, "Confirm"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
  onClick: popupShow
}, "Show"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
  onClick: popupCustomIcon
}, "Custom Icon"))), document.getElementById('dialog-demo-2'));