import { ComponentDescription } from '@vtj/engine';
const Table: ComponentDescription[] = [
  {
    name: 'ElTable',
    title: '表格',
    groupId: 'el',
    categoryId: 'data',
    childIncludes: ['ElTableColumn'],
    package: 'element-plus',
    props: [
      {
        name: 'data',
        defaultValue: '',
        setters: 'JSONSetter'
      },
      {
        name: 'height',
        defaultValue: '',
        setters: ['InputSetter', 'NumberSetter']
      },
      {
        name: 'maxHeight',
        defaultValue: '',
        setters: ['InputSetter', 'NumberSetter']
      },
      {
        name: 'stripe',
        defaultValue: false,
        setters: 'BooleanSetter'
      },
      {
        name: 'border',
        defaultValue: false,
        setters: 'BooleanSetter'
      },
      {
        name: 'size',
        defaultValue: '',
        options: ['large', 'default', 'small'],
        setters: 'InputSetter'
      },
      {
        name: 'fit',
        defaultValue: true,
        title: '列的宽度是否自撑开',
        setters: 'BooleanSetter'
      },
      {
        name: 'showHeader',
        defaultValue: true,
        setters: 'BooleanSetter'
      },
      {
        name: 'highlightCurrentRow',
        defaultValue: false,
        label: '是否高亮',
        setters: 'BooleanSetter'
      },
      {
        name: 'currentRowKey',
        defaultValue: '',
        setters: ['InputSetter', 'NumberSetter']
      },
      {
        name: 'rowClassName',
        defaultValue: '',
        setters: ['ExpressionSetter', 'InputSetter']
      },
      {
        name: 'rowStyle',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter']
      },
      {
        name: 'cellClassName',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter']
      },
      {
        name: 'cellStyle',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter']
      },
      {
        name: 'headerRowClassName',
        defaultValue: '',
        title: '表头行类名',
        label: 'RowClassName',
        setters: ['ExpressionSetter', 'InputSetter']
      },
      {
        name: 'headerRowStyle',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter']
      },
      {
        name: 'headerCellClassName',
        defaultValue: '',
        title: '表头单元格类名',
        label: 'CellClassName',
        setters: ['ExpressionSetter', 'InputSetter']
      },
      {
        name: 'headerCellStyle',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter']
      },
      {
        name: 'rowKey',
        defaultValue: '',
        setters: ['ExpressionSetter', 'InputSetter']
      },
      {
        name: 'emptyText',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'defaultExpandAll',
        defaultValue: false,
        label: '展开所有',
        setters: 'BooleanSetter'
      },
      {
        name: 'expand-row-keys',
        defaultValue: '',
        title:
          '可以通过该属性设置 Table 目前的展开行，需要设置 row-key 属性才能使用，该属性为展开行的 keys 数组。',
        label: 'row-keys',
        setters: 'ExpressionSetter'
      },
      {
        name: 'default-sort',
        defaultValue: '',
        setters: 'JSONSetter'
      },
      {
        name: 'tooltip-effect',
        defaultValue: 'dark',
        options: ['dark', 'light'],
        setters: 'SelectSetter'
      },
      {
        name: 'show-summary',
        defaultValue: false,
        label: '显示合计行',
        setters: 'BooleanSetter'
      },
      {
        name: 'sum-text',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'summary-method',
        defaultValue: '',
        label: '合计计算方法',
        setters: 'InputSetter'
      },
      {
        name: 'span-method',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'select-on-indeterminate',
        defaultValue: true,
        title:
          '在多选表格中，当仅有部分行被选中时，点击表头的多选框时的行为。 若为 true，则选中所有行；若为 false，则取消选择所有行',
        label: 'indeterminate',
        setters: 'BooleanSetter'
      },
      {
        name: 'indent',
        defaultValue: 16,
        setters: 'NumberSetter'
      },
      {
        name: 'lazy',
        defaultValue: '',
        setters: 'BooleanSetter'
      },
      {
        name: 'load',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'tree-props',
        defaultValue: { hasChildren: 'hasChildren', children: 'children' },
        setters: 'JSONSetter'
      },
      {
        name: 'scrollbar-always-on',
        defaultValue: false,
        label: '显示滚动条',
        setters: 'BooleanSetter'
      },
      {
        name: 'flexible',
        defaultValue: false,
        setters: 'BooleanSetter'
      }
    ],
    events: [
      'select',
      'select-all',
      'selection-change',
      'cell-mouse-enter',
      'cell-mouse-leave',
      'cell-click',
      'cell-dblclick',
      'cell-contextmenu',
      'row-click',
      'row-contextmenu',
      'row-dblclick',
      'header-click',
      'header-contextmenu',
      'sort-change',
      'filter-change',
      'current-change',
      'header-dragend',
      'expand-change'
    ],
    slots: ['default', 'append', 'empty'],
    snippet: {
      name: 'ElTable',
      children: [
        {
          name: 'ElTableColumn',
          children: '标题1',
          props: {
            prop: 'date',
            label: 'Date'
          }
        },
        {
          name: 'ElTableColumn',
          children: '标题2',
          props: {
            prop: 'name',
            label: 'name'
          }
        },
        {
          name: 'ElTableColumn',
          children: '标题3',
          props: {
            prop: 'Address',
            label: 'a ddress'
          }
        }
      ]
    }
  },
  {
    name: 'ElTableColumn',
    title: '表头',
    groupId: 'el',
    categoryId: 'data',
    childIncludes: false,
    package: 'element-plus',
    props: [
      {
        name: 'type',
        defaultValue: '',
        options: ['selection', 'index', 'expand'],
        setters: 'InputSetter'
      },
      {
        name: 'index',
        defaultValue: '',
        title: '如果设置了 type=index，可以通过传递 index 属性来自定义索引',
        setters: ['ExpressionSetter', 'NumberSetter']
      },
      {
        name: 'label',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'column-key',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'prop',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'width',
        defaultValue: '',
        setters: ['InputSetter', 'NumberSetter']
      },
      {
        name: 'min-width',
        defaultValue: true,
        title: '',
        setters: ['InputSetter', 'NumberSetter']
      },
      {
        name: 'fixed',
        defaultValue: '',
        options: ['left', 'right'],
        setters: ['SelectSetter', 'BooleanSetter']
      },
      {
        name: 'render-header',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'sortable',
        defaultValue: '',
        options: ['custom'],
        setters: ['BooleanSetter', 'SelectSetter']
      },
      {
        name: 'sort-method',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'sort-by',
        defaultValue: '',
        setters: ['ExpressionSetter', 'JSONSetter', 'InputSetter']
      },
      {
        name: 'sort-orders',
        defaultValue: ['ascending', 'descending', null],
        title:
          '数据在排序时所使用排序策略的轮转顺序，仅当 sortable 为 true 时有效。 需传入一个数组，随着用户点击表头，该列依次按照数组中元素的顺序进行排序',
        setters: 'JSONSetter'
      },
      {
        name: 'resizable',
        defaultValue: true,
        setters: 'BooleanSetter'
      },
      {
        name: 'formatter',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'show-overflow-tooltip',
        defaultValue: false,
        title: '当内容过长被隐藏时显示 tooltip',
        label: 'tooltip',
        setters: 'BooleanSetter'
      },
      {
        name: 'align',
        defaultValue: 'left',
        options: ['left', 'center', 'right'],
        setters: 'InputSetter'
      },
      {
        name: 'header-align',
        defaultValue: '',
        options: ['left', 'center', 'right'],
        setters: 'InputSetter'
      },
      {
        name: 'class-name',
        defaultValue: '',
        setters: 'InputSetter'
      },
      {
        name: 'label-class-name',
        defaultValue: '',
        title: '当前列标题的自定义类名',
        label: '当前列类名',
        setters: 'InputSetter'
      },
      {
        name: 'selectable',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'reserve-selection',
        defaultValue: false,
        title:
          '仅对  type=selection 的列有效， 请注意， 需指定 row-key 来让这个功能生效。',
        label: '储备选择',
        setters: 'BooleanSetter'
      },
      {
        name: 'filters',
        defaultValue: '',
        setters: 'JSONSetter'
      },
      {
        name: 'filter-placement',
        defaultValue: '',
        label: '过滤弹出框的定位',
        setters: 'InputSetter'
      },
      {
        name: 'filter-multiple',
        defaultValue: true,
        setters: 'BooleanSetter'
      },
      {
        name: 'filter-method',
        defaultValue: '',
        setters: 'ExpressionSetter'
      },
      {
        name: 'filtered-value',
        defaultValue: '',
        setters: 'JSONSetter'
      }
    ],
    slots: ['default', 'header']
  }
];

export default Table;
