import snippets from './snippets';

export default {
  snippets,
  componentName: 'PisellModal.Information',
  title: '信息对话框',
  category: '反馈',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: '@pisell/materials',
    version: '1.0.1',
    exportName: 'PisellModal',
    main: 'src/index.tsx',
    destructuring: true,
    subName: 'Information',
  },
  props: [
    {
      name: "open",
      title: { label: "是否可见", tip: "对话框是否可见" },
      propType: "bool",
      setter: "BoolSetter",
      supportVariable: true,
    },
    {
      name: "title",
      title: { label: "标题内容", tip: "标题内容" },
      propType: { type: "oneOfType", value: ["string", "node"] },
      setter: ["PisellI18nSetter", "SlotSetter"],
    },
    {
      name: "describe",
      title: { label: "描述正文", tip: "描述正文" },
      propType: { type: "oneOfType", value: ["string", "node"] },
      setter: ["PisellI18nSetter", "SlotSetter"],
    },
    {
      name: 'okVisible',
      title: { label: '确认按钮', tip: '确认按钮是否可见' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: 'footerDivider',
      title: { label: '顶部区域分割线', tip: '顶部区域分割线是否可见' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: "okText",
      title: { label: "确认按钮文字", tip: "确认按钮文字" },
      propType: { type: "oneOfType", value: ["string", "node"] },
      setter: ["PisellI18nSetter", "SlotSetter"],
    },
    {
      name: "closable",
      title: { label: "显示关闭按钮", tip: "是否显示右上角的关闭按钮" },
      propType: "bool",
      defaultValue: true,
      setter: "BoolSetter",
      supportVariable: true,
    },
    {
      name: 'cancelVisible',
      title: { label: '取消按钮', tip: '取消按钮是否可见' },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: true,
    },
    {
      name: "cancelText",
      title: { label: "取消按钮文字", tip: "取消按钮文字" },
      propType: { type: "oneOfType", value: ["string", "node"] },
      setter: ["PisellI18nSetter", "SlotSetter"],
    },
    {
      name: "cancelButtonProps",
      title: { label: "取消按钮配置", tip: "详见 antd Modal cancelButtonProps" },
      setter: [ "JSONSetter"],
    },
  ],
  configure: {
    component: {
      isContainer: true,
      isModal: true,
      rootSelector: '.pisell-lowcode-modal-content',
      nestingRule: {
        parentWhitelist: ['Page', 'Component'],
      },
    },
    supports: {
      style: true,
      events: [
        {
          name: 'afterClose',
          templete:
            "onCancel(${extParams}){\n// 完全关闭后的回调\nconsole.log('afterClose');}",
        },
        {
          name: 'onCancel',
          template:
            "onCancel(${extParams}){\n// 点击遮罩层或右上角叉或取消按钮的回调\nconsole.log('onCancel');}",
        },
        {
          name: 'onOk',
          template:
            "onOk(${extParams}){\n// 点击确定回调\nconsole.log('onOk');}",
        },
        {
          name: 'onDelete',
          template:
            "onDelete(${extParams}){\n// 点击删除回调\nconsole.log('onDelete');}",
        },
      ],
    },
  },
};
