"use strict";

require("core-js/modules/es.object.define-property.js");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.Docs = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _react = require("react");
var _ = require(".");
var _globalDialog = require("./global-dialog");
var _button = require("../button");
var _icon = require("../icon");
var _type = require("../icon/type");
var _basicConfirmDialog = require("./basic-confirm-dialog");
var _confirm = require("./confirm");
var _jsxRuntime = require("react/jsx-runtime");
var meta = {
  title: 'Components/Dialog'
};
var Docs = exports.Docs = function Docs() {
  var _useState = (0, _react.useState)(false),
    _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
    visible = _useState2[0],
    setVisible = _useState2[1];
  var _useState3 = (0, _react.useState)(false),
    _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
    confirmDialogVisible = _useState4[0],
    setConfirmDialogVisible = _useState4[1];
  var _useState5 = (0, _react.useState)(false),
    _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
    FcrBasicConfirmDialogVisible = _useState6[0],
    setBasicConfirmVisible = _useState6[1];
  var _useState7 = (0, _react.useState)(false),
    _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
    classDialogVisible = _useState8[0],
    setClassDialogVisible = _useState8[1];
  var _useState9 = (0, _react.useState)(false),
    _useState0 = (0, _slicedToArray2["default"])(_useState9, 2),
    globalDialogVisible = _useState0[0],
    setGlobalDialogVisible = _useState0[1];
  var handlerDialog = function handlerDialog() {
    _confirm.FcrDialogApi.warning({
      id: 'warning',
      dialogProps: {
        title: 'title',
        content: 'content',
        onOk: function onOk() {
          return console.log('ok');
        },
        onCancel: function onCancel() {
          return console.log('cancel');
        },
        visible: true
      }
    });
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: function onClick() {
        return setVisible(true);
      },
      children: "open base dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: handlerDialog,
      children: "use api open base dialog "
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: function onClick() {
        return setBasicConfirmVisible(true);
      },
      children: "open base confirm dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: function onClick() {
        return setConfirmDialogVisible(true);
      },
      children: "open confirm dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: function onClick() {
        return setClassDialogVisible(true);
      },
      children: "open class dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.FcrButton, {
      onClick: function onClick() {
        return setGlobalDialogVisible(true);
      },
      children: "open global dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.BaseDialog, {
      closable: true,
      visible: visible,
      onClose: function onClose() {
        return setVisible(false);
      },
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        children: "Base Dialog"
      })
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_basicConfirmDialog.FcrBasicConfirmDialog, {
      visible: FcrBasicConfirmDialogVisible,
      onOk: function onOk() {
        return setBasicConfirmVisible(false);
      },
      onCancel: function onCancel() {
        return setBasicConfirmVisible(false);
      },
      title: "Basic Confirm Dialog"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrConfirmDialog, {
      icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FcrIcon, {
        type: _type.FcrIconType.FCR_BTN_LOADING,
        size: 50
      }),
      checkedProps: {
        label: '不再显示'
      },
      checkable: true,
      maskClosable: false,
      onOk: function onOk() {
        return setConfirmDialogVisible(false);
      },
      title: '移到垃圾桶',
      visible: confirmDialogVisible,
      onClose: function onClose() {
        return setConfirmDialogVisible(false);
      },
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        children: "\u6B64\u767D\u677F\u5C06\u79FB\u5230\u5783\u573E\u6876\uFF0C\u534F\u4F5C\u7EC4\u5C06\u4E0D\u518D\u62E5\u6709\u5176\u8BBF\u95EE\u6743\u9650\u3002"
      })
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrClassDialog, {
      imgUrl: " ",
      maskClosable: false,
      visible: classDialogVisible,
      onClose: function onClose() {
        return setClassDialogVisible(false);
      },
      title: '本节课程已结束！',
      content: '你可以去预约其它的课程啦',
      cancelBtn: false,
      actions: [{
        text: '我知道了，离开教室',
        styleType: 'danger',
        onClick: function onClick() {
          return setClassDialogVisible(false);
        }
      }]
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalDialog.FcrGlobalDialog, {
      header: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
        children: "Global dialog"
      }),
      onClose: function onClose() {
        return setGlobalDialogVisible(false);
      },
      visible: globalDialogVisible,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "fcr-text-1 fcr-flex fcr-justify-center",
        children: "global dialog"
      })
    })]
  });
};
var _default = exports["default"] = meta;