import snippets from './snippets';

export default {
  snippets,
  componentName: 'PisellCardList',
  title: 'PisellCardList',
  category: '数据展示',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/materials',
    version: '1.0.1',
    exportName: 'PisellCardList',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: [
    {
      name: 'platform',
      title: {
        label: '平台',
      },
      propType: { type: 'oneOf', value: ['h5', 'pc', 'ipad'] },
      setter: [
        {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              {
                title: 'h5',
                value: 'h5',
              },
              {
                title: 'pc',
                value: 'pc',
              },
              {
                title: 'ipad',
                value: 'ipad',
              },
            ],
          },
        },
        'VariableSetter',
      ],
      defaultValue: 'pc',
    },
    {
      name: 'mode',
      title: {
        label: '选择类型',
      },
      propType: { type: 'oneOf', value: ['multiple', 'single', null] },
      setter: [
        {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              {
                title: '不选',
                value: null,
              },
              {
                title: '单选',
                value: 'single',
              },
              {
                title: '多选',
                value: 'multiple',
              },
            ],
          },
        },
        'VariableSetter',
      ],
      defaultValue: 'single',
    },
    {
      name: 'data',
      title: { label: '当前list数据', tip: '当前list数据' },
      setter: ['JsonSetter', 'VariableSetter'],
    },
    {
      name: 'hasMore',
      title: { label: '是否有更多数据', tip: '是否有更多数据' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false,
    },
    {
      name: 'showName',
      title: { label: '显示商品名称', tip: '显示商品名称' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showStoreName',
      title: { label: '显示共享店铺名称', tip: '显示共享店铺名称' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showRedeem',
      title: { label: '显示使用金额', tip: '显示使用金额' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showBalance',
      title: { label: '显示余额', tip: '显示余额' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showCode',
      title: { label: '显示识别码编号', tip: '显示识别码编号' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showValidDate',
      title: { label: '显示有效期', tip: '显示有效期' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showDetail',
      title: { label: '显示查看详情按钮', tip: '显示查看详情按钮' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showQrCode',
      title: { label: '显示识别码二维码', tip: '显示识别码二维码' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showCover',
      title: { label: '显示识别码卡封面', tip: '显示识别码卡封面' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'showEmpty',
      title: { label: '是否展示空占位', tip: '是否展示空占位' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false,
    },
    {
      name: 'value',
      title: { label: '当前选中值', tip: '当前选中值' },
      propType: 'number',
      setter: 'NumberSetter',
    },
  ],
  configure: {
    supports: {
      style: true,
      events: [
        {
          name: 'onChange',
          template:
            "onChange(event,${extParams}){\n// 选择变化时的回调\nconsole.log('onChange',event);}",
        },
      ],
    },
  },
};
