"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _parseData = _interopRequireDefault(require("../utils/parse-data"));
var plainData = '*Panel Header 1\n\tPeople always make mistakes, frustrated, nerve-racking, but cannot remain stagnant.\nPanel Header 2\n\tPeople always make mistakes, frustrated, nerve-racking, but cannot remain stagnant.\nPanel Header 3\n\tPeople always make mistakes, frustrated, nerve-racking, but cannot remain stagnant.\n';
var list = (0, _parseData["default"])(plainData).filter(function (node) {
  return 'node' === node.type;
});
var defaultExpandedKeys = [];
var dataSource = list.map(function (item, index) {
  if (item.state === 'active') {
    defaultExpandedKeys.push("panel_" + index);
  }
  return {
    key: "panel_" + index,
    title: item.value,
    content: item.children.map(function (_ref) {
      var type = _ref.type,
        value = _ref.value;
      return type === 'node' ? value : '';
    }),
    disabled: item.state === 'disabled'
  };
});
var _default = [{
  title: '折叠面板',
  screenshot: 'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_dialog.png',
  schema: {
    componentName: 'Collapse',
    props: {
      accordion: false,
      plainData: plainData,
      dataSource: dataSource,
      defaultExpandedKeys: defaultExpandedKeys
    }
  }
}];
exports["default"] = _default;