import snippets from "./snippets";

export default {
  snippets,
  componentName: "PisellTags",
  title: "标签",
  category: "数据展示",
  docUrl: "",
  screenshot: "",
  devMode: "proCode",
  npm: {
    package: "@pisell/materials",
    version: "1.0.1",
    exportName: "PisellTags",
    main: "src/index.tsx",
    destructuring: true,
    subName: "",
  },
  props: [
    {
      name: "children",
      title: { label: "内容" },
      propType: { type: "oneOfType", value: ["string", "node"] },
      setter: ['PisellI18nSetter', 'SlotSetter']
    },
    {
      name: 'type',
      title: { label: '展示类型' },
      setter: {
        componentName: 'RadioGroupSetter',
        props: {
          options: [
            {
              title: '填充',
              value: 'pill_color',
            },
            {
              title: '边框',
              value: 'pill_outline',
            },
          ],
        },
      },
      propType: { type: 'oneOf', value: ['pill_color', 'pill_outline'] },
      defaultValue: 'pill_color',
    },
    {
      name: "icon",
      title: {
        label: {
          type: "i18n",
          "en-US": "icon",
          "zh-CN": "图标",
        },
        tip: "icon | Set the icon component of the button",
      },
      propType: { type: "oneOfType", value: ["node"] },
      setter: [{
        componentName: "SlotSetter",
        initialValue: {
          type: "JSSlot",
          value: [
            {
              componentName: "Icon",
              props: {
                type: "SmileOutlined",
                size: 20,
                rotate: 0,
                spin: false,
              },
            },
          ],
        },
        defaultValue: null
      }],
    },
    {
      name: 'color',
      title: { label: '颜色' },
      setter: [
        {
          componentName: 'RadioGroupSetter',
          props: {
            options: [
              {
                title: 'Success',
                value: 'success',
              },
              {
                title: 'Warning',
                value: 'warning',
              },
              {
                title: 'Error',
                value: 'error',
              },
              {
                title: 'Gray',
                value: 'gray',
              },
            ],
          },
        },
        'ColorSetter', "StringSetter"
      ],
      propType: { type: 'oneOf', value: ['success', 'warning', 'error', 'gray'] },
      defaultValue: 'success',
    },
  ],
  configure: {
    component: { isContainer: true },
    supports: {
      style: true,
      events: [
        {
          name: "onClick",
          template:
            "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
        },
      ],
    },
  },
};
