"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

require("./demo5.css");

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

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

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

var _2 = require("../..");

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

var SubMenu = _2.Menu.SubMenu,
    Item = _2.Menu.Item,
    Group = _2.Menu.Group,
    Divider = _2.Menu.Divider;
var RangePicker = _2.DatePicker.RangePicker; // Set global direction to 'rtl'. This affects the whole page
// ConfigProvider.setDirection('rtl');

var Demo = /*#__PURE__*/function (_React$Component) {
  _inherits(Demo, _React$Component);

  var _super = _createSuper(Demo);

  function Demo(props) {
    var _this;

    _classCallCheck(this, Demo);

    _this = _super.call(this, props);
    _this.state = {
      dir: 'rtl'
    };
    _this.changeDir = _this.changeDir.bind(_assertThisInitialized(_this));
    _this.showDialog = _this.showDialog.bind(_assertThisInitialized(_this));
    return _this;
  }

  _createClass(Demo, [{
    key: "changeDir",
    value: function changeDir(value) {
      this.setState({
        dir: value
      });
    }
  }, {
    key: "showDialog",
    value: function showDialog() {
      _2.Dialog.confirm({
        title: 'Confirm',
        content: 'Are you sure you want to delete all alert e-mails waiting in queue?'
      });
    }
  }, {
    key: "render",
    value: function render() {
      return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
        className: "change-rtl"
      }, /*#__PURE__*/_react["default"].createElement("span", {
        style: {
          marginRight: 16
        }
      }, "Change direction of components:", ' '), /*#__PURE__*/_react["default"].createElement(_2.Radio.Group, {
        shape: "button",
        size: "large",
        value: this.state.dir,
        onChange: this.changeDir
      }, /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        key: "rtl",
        value: "rtl"
      }, "RTL"), /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        key: "ltr",
        value: "ltr"
      }, "LTR"))), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("hr", null), /*#__PURE__*/_react["default"].createElement(_["default"], {
        rtl: this.state.dir === 'rtl'
      }, /*#__PURE__*/_react["default"].createElement("div", {
        className: "locale-components",
        dir: this.state.dir
      }, /*#__PURE__*/_react["default"].createElement(_2.Button, {
        type: "primary",
        onClick: this.showDialog
      }, "Show Dialog"), /*#__PURE__*/_react["default"].createElement(_2.Select, {
        style: {
          width: '150px'
        },
        dataSource: ['hello', 'bye']
      }), /*#__PURE__*/_react["default"].createElement(RangePicker, {
        showTime: true
      }), /*#__PURE__*/_react["default"].createElement(_2.Calendar, {
        style: {
          width: '350px',
          padding: '12px',
          border: '1px solid #C4C6CF',
          borderRadius: '3px'
        },
        shape: "card"
      }), /*#__PURE__*/_react["default"].createElement(_2.Timeline, {
        fold: [{
          foldArea: [1, 2],
          foldShow: true
        }]
      }, /*#__PURE__*/_react["default"].createElement(_2.Timeline.Item, {
        title: "Signed",
        content: "Signed, sign Alibaba is a small post office, thanks to the use of STO, look forward to once again at your service",
        time: '2016-06-10 10:30:00',
        state: "process"
      }), /*#__PURE__*/_react["default"].createElement(_2.Timeline.Item, {
        title: "Ship",
        content: "Express has arrived in Hangzhou, Zhejiang Binjiang company",
        time: '2016-06-10 09:30:00'
      }), /*#__PURE__*/_react["default"].createElement(_2.Timeline.Item, {
        title: "Ship",
        content: "Zhejiang Hangzhou Riverside company sent a member for you to send pieces",
        time: '2016-06-10 09:03:00'
      }), /*#__PURE__*/_react["default"].createElement(_2.Timeline.Item, {
        title: "Ship",
        content: "Zhejiang Hangzhou Transshipment Center has been issued",
        time: '2016-06-10 06:10:00'
      })), /*#__PURE__*/_react["default"].createElement(_2.Menu, {
        className: "my-menu",
        defaultOpenKeys: "sub-menu"
      }, /*#__PURE__*/_react["default"].createElement(Item, {
        key: "1"
      }, "Option 1"), /*#__PURE__*/_react["default"].createElement(Item, {
        disabled: true,
        key: "2"
      }, "Disabled option 2"), /*#__PURE__*/_react["default"].createElement(Divider, {
        key: "divider"
      }), /*#__PURE__*/_react["default"].createElement(Group, {
        label: "Group"
      }, /*#__PURE__*/_react["default"].createElement(Item, {
        key: "group-1"
      }, "Group option 1"), /*#__PURE__*/_react["default"].createElement(Item, {
        key: "group-2"
      }, "Group option 2")), /*#__PURE__*/_react["default"].createElement(Divider, null), /*#__PURE__*/_react["default"].createElement(SubMenu, {
        key: "sub-menu",
        label: "Sub menu"
      }, /*#__PURE__*/_react["default"].createElement(Item, {
        key: "sub-1"
      }, "Sub option 1"), /*#__PURE__*/_react["default"].createElement(Item, {
        key: "sub-2"
      }, "Sub option 2"), /*#__PURE__*/_react["default"].createElement(Item, {
        disabled: true,
        key: "sub-3"
      }, /*#__PURE__*/_react["default"].createElement("a", {
        href: "https://www.taobao.com/",
        target: "__blank"
      }, "Disabled Option Link 3")), /*#__PURE__*/_react["default"].createElement(Item, {
        key: "sub-4"
      }, /*#__PURE__*/_react["default"].createElement("a", {
        href: "https://www.taobao.com/",
        target: "__blank"
      }, "Option Link 4"))), /*#__PURE__*/_react["default"].createElement(Item, {
        key: "3",
        helper: "CTRL+P"
      }, "Option 3"), /*#__PURE__*/_react["default"].createElement(Item, {
        disabled: true,
        key: "4"
      }, /*#__PURE__*/_react["default"].createElement("a", {
        href: "https://www.taobao.com/",
        target: "__blank"
      }, "Disabled Option Link")), /*#__PURE__*/_react["default"].createElement(Item, {
        key: "5"
      }, /*#__PURE__*/_react["default"].createElement("a", {
        href: "https://www.taobao.com/",
        target: "__blank"
      }, "Option Link"))))));
    }
  }]);

  return Demo;
}(_react["default"].Component);

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(Demo, null), document.getElementById('config-provider-demo-5'));