"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));

var _tslib = require("tslib");

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

var _mobxReact = require("mobx-react");

var _enum = require("../enum");

var Toolbar = function Toolbar(props) {
  var id = props.id,
      prefixCls = props.prefixCls;
  return /*#__PURE__*/_react["default"].createElement("div", {
    id: id || 'toolbar',
    className: "".concat(prefixCls, "-toolbar")
  }, /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-bold"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-italic"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-underline"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-strike"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-blockquote"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-list",
    value: "ordered"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-list",
    value: "bullet"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-image"
  }), /*#__PURE__*/_react["default"].createElement("button", {
    type: "button",
    className: "ql-link"
  }), /*#__PURE__*/_react["default"].createElement("select", {
    className: "ql-color"
  }));
};

var RichTextToolbar = /*#__PURE__*/function (_Component) {
  (0, _inherits2["default"])(RichTextToolbar, _Component);

  var _super = (0, _createSuper2["default"])(RichTextToolbar);

  function RichTextToolbar() {
    (0, _classCallCheck2["default"])(this, RichTextToolbar);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(RichTextToolbar, [{
    key: "renderToolBar",
    value: function renderToolBar(props) {
      var prefixCls = this.props.prefixCls;
      return /*#__PURE__*/_react["default"].createElement(Toolbar, (0, _extends2["default"])({
        key: "toolbar",
        prefixCls: prefixCls
      }, props));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          id = _this$props.id,
          toolbar = _this$props.toolbar,
          dataSet = _this$props.dataSet;
      var props = {
        id: id,
        dataSet: dataSet
      };

      if (typeof toolbar === 'function') {
        return toolbar(props);
      }

      switch (toolbar) {
        case _enum.RichTextToolbarType.normal:
          return this.renderToolBar(props);

        default:
          return null;
      }
    }
  }]);
  return RichTextToolbar;
}(_react.Component);

RichTextToolbar.displayName = 'RichTextToolbar';
RichTextToolbar = (0, _tslib.__decorate)([_mobxReact.observer], RichTextToolbar);
var _default = RichTextToolbar;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
