import parseData from "../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 = parseData(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'
  };
});
export 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
    }
  }
}];