// import { operationProps } from '../common';
// import { hideProp } from '../utils';
import { snippets } from './snippets';

export const StatisticProps = [
  {
    title: '指标配置',
    display: 'block',
    type: 'group',
    items: [
      {
        name: 'statistic.title',
        title: '数值的标题',
        propType: 'string',
        setter: 'StringSetter',
      },
      {
        name: 'statistic.tip',
        title: '标题提示',
        propType: 'string',
        setter: 'StringSetter',
      },
      {
        name: 'statistic.value',
        title: '数值内容',
        propType: 'number',
        setter: 'NumberSetter',
      },
      {
        name: 'statistic.prefix',
        title: '数值前缀',
        propType: 'string',
        setter: 'StringSetter',
      },
      {
        name: 'statistic.suffix',
        title: '数值后缀',
        propType: 'string',
        setter: 'StringSetter',
      },
      {
        name: 'statistic.layout',
        title: '布局',
        propType: { type: 'oneOf', value: ['horizontal', 'vertical', 'inline'] },
        setter: {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              {
                title: '水平',
                value: 'horizontal',
              },
              {
                title: '垂直',
                value: 'vertical',
              },
              {
                title: '行内',
                value: 'inline',
              },
            ],
          },
        },
        defaultValue: '',
      },
      {
        name: 'statistic.trend',
        title: '趋势',
        propType: { type: 'oneOf', value: ['up', 'down'] },
        setter: {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              {
                title: '上升',
                value: 'up',
              },
              {
                title: '下降',
                value: 'down',
              },
            ],
          },
        },
        defaultValue: '',
      },
    ],
  },
];

export const StatisticMeta = {
  componentName: 'ProStatistic',
  title: '指标组件',
  docUrl: '',
  screenshot:
    'https://img.alicdn.com/imgextra/i4/O1CN01qjZnGj1OW8lpLCQqm_!!6000000001712-55-tps-56-56.svg',
  icon: 'https://img.alicdn.com/imgextra/i4/O1CN01qjZnGj1OW8lpLCQqm_!!6000000001712-55-tps-56-56.svg',
  devMode: 'proCode',
  group: '高级组件',
  category: '指标类',
  npm: {
    package: '@devlego/lowcode-materials-procomponents',
    version: 'latest',
    exportName: 'ProStatistic',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: StatisticProps,
  configure: {
    component: {
      isContainer: false,
    },
    props: StatisticProps,
    supports: {
      style: true,
      loop: false,
    },
  },
};

export default [
  {
    ...StatisticMeta,
    snippets,
  },
];
