"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); }

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

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

var _context = require("../context");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function List(props) {
  var okrs = props.okrs,
      setOkrs = props.setOkrs,
      isShowPrincple = props.isShowPrincple,
      isShowPeriod = props.isShowPeriod,
      openCreateModal = props.openCreateModal,
      isShowEasyCreate = props.isShowEasyCreate,
      refreshList = props.refreshList,
      replaceOkr = props.replaceOkr;
  var OkrListCmp = props.OkrListCmp;

  var _useContext = (0, _react.useContext)(_context.Context),
      annualNum = _useContext.annualNum,
      cycleType = _useContext.cycleType,
      yqmNum = _useContext.yqmNum,
      orderType = _useContext.orderType,
      relation = _useContext.relation;

  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(OkrListCmp, {
    orderType: orderType,
    okrData: okrs,
    setData: setOkrs,
    relation: relation,
    cycle: {
      annualNum: annualNum,
      cycleType: cycleType,
      yqmNum: yqmNum
    },
    addOkr: function addOkr(okr) {
      setOkrs([].concat(_toConsumableArray(okrs), [okr]));
    },
    refreshList: refreshList,
    replaceOkr: replaceOkr,
    onpenCreateModalWithData: function onpenCreateModalWithData(data) {// createModalRef.current && createModalRef.current.setData(data);
      // setVisible(true);
    },
    openCreateModal: openCreateModal,
    isShowPrincple: isShowPrincple,
    isShowPeriod: isShowPeriod,
    isShowEasyCreate: isShowEasyCreate
  }));
}

var _default = List;
exports["default"] = _default;