"use strict";

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

require("./demo3.css");

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

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

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

var _enUs = _interopRequireDefault(require("../../locale/en-us"));

var _jaJp = _interopRequireDefault(require("../../locale/ja-jp"));

var _ptPt = _interopRequireDefault(require("../../locale/pt-pt"));

var _viVn = _interopRequireDefault(require("../../locale/vi-vn"));

var _zhCn = _interopRequireDefault(require("../../locale/zh-cn"));

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); 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 } }); 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; } 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 localeMap = {
  'zh-cn': _zhCn["default"],
  'en-us': _enUs["default"],
  'ja-jp': _jaJp["default"],
  'vi-vn': _viVn["default"],
  'pt-pt': _ptPt["default"]
}; // If the application directly imports the next-with-locales.js file from cdn
// it need to import locale file in the following way
// import { locales } from '@alifd/next';
// const enUS = locales['en-us'];
// const zhCN = locales['zh-cn'];

var RangePicker = _2.DatePicker.RangePicker;
var RangePicker2 = _2.DatePicker2.RangePicker;

var transferDataSource = function () {
  var dataSource = [];

  for (var i = 0; i < 10; i++) {
    dataSource.push({
      label: "content ".concat(i),
      value: "".concat(i),
      disabled: i % 4 === 0
    });
  }

  return dataSource;
}();

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 = {
      lang: 'en-us'
    };
    _this.changeLang = _this.changeLang.bind(_assertThisInitialized(_this));
    _this.showDialog = _this.showDialog.bind(_assertThisInitialized(_this));
    return _this;
  }

  _createClass(Demo, [{
    key: "changeLang",
    value: function changeLang(lang) {
      this.setState({
        lang: lang
      });
    }
  }, {
    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() {
      var locale = localeMap[this.state.lang];
      return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
        className: "change-locale"
      }, /*#__PURE__*/_react["default"].createElement("span", {
        style: {
          marginRight: 16
        }
      }, "Change locale of components: "), /*#__PURE__*/_react["default"].createElement(_2.Radio.Group, {
        shape: "button",
        size: "large",
        defaultValue: "en-us",
        onChange: this.changeLang
      }, /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        value: "en-us"
      }, "English"), /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        value: "zh-cn"
      }, "\u4E2D\u6587"), /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        value: "ja-jp"
      }, "\u65E5\u672C\u8A9E"), /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        value: "vi-vn"
      }, "Vi\u1EC7tName"), /*#__PURE__*/_react["default"].createElement(_2.Radio, {
        value: "pt-pt"
      }, "Portugu\xEAs"))), /*#__PURE__*/_react["default"].createElement(_["default"], {
        locale: locale
      }, /*#__PURE__*/_react["default"].createElement("div", {
        className: "locale-components"
      }, /*#__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(_2.DatePicker, null), /*#__PURE__*/_react["default"].createElement(_2.TimePicker, null), /*#__PURE__*/_react["default"].createElement(RangePicker, null), /*#__PURE__*/_react["default"].createElement(_2.DatePicker2, null), /*#__PURE__*/_react["default"].createElement(_2.TimePicker2, null), /*#__PURE__*/_react["default"].createElement(RangePicker2, null), /*#__PURE__*/_react["default"].createElement(_2.Calendar, {
        style: {
          width: '350px',
          padding: '12px',
          border: '1px solid #C4C6CF',
          borderRadius: '3px'
        },
        shape: "card"
      }), /*#__PURE__*/_react["default"].createElement(_2.Pagination, {
        defaultCurrent: 2
      }), /*#__PURE__*/_react["default"].createElement(_2.Transfer, {
        dataSource: transferDataSource,
        defaultValue: ['3'],
        defaultLeftChecked: ['1'],
        titles: ['Source', 'Target']
      }), /*#__PURE__*/_react["default"].createElement(_2.Table, {
        style: {
          width: '500px'
        },
        dataSource: []
      }, /*#__PURE__*/_react["default"].createElement(_2.Table.Column, {
        title: "Name",
        dataIndex: "name",
        filters: [{
          label: 'Filter 1',
          value: '1'
        }, {
          label: 'Filter 2',
          value: '2'
        }]
      }), /*#__PURE__*/_react["default"].createElement(_2.Table.Column, {
        title: "Age",
        dataIndex: "age"
      })), /*#__PURE__*/_react["default"].createElement(_2.Card, {
        style: {
          width: '300px'
        },
        title: "Title"
      }, /*#__PURE__*/_react["default"].createElement("div", {
        style: {
          height: '250px',
          background: '#F7F8FA'
        }
      })), /*#__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.Upload.Dragger, {
        style: {
          width: '500px'
        },
        listType: "image",
        action: "https://www.easy-mock.com/mock/5b713974309d0d7d107a74a3/alifd/upload",
        accept: "image/png, image/jpg, image/jpeg, image/gif, image/bmp"
      }))));
    }
  }]);

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

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